================
@@ -5627,15 +5754,25 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo
&CallInfo,
} else {
uint64_t SrcSize = SrcTypeSize.getFixedValue();
uint64_t DstSize = DstTypeSize.getFixedValue();
+ bool HasPFPFields = !findPFPCoercedFields(*this, I->Ty).empty();
// If the source type is smaller than the destination type of the
// coerce-to logic, copy the source value into a temp alloca the size
// of the destination type to allow loading all of it. The bits past
// the source value are left undef.
- if (SrcSize < DstSize) {
+ if (HasPFPFields || SrcSize < DstSize) {
Address TempAlloca = CreateTempAlloca(STy, Src.getAlignment(),
Src.getName() + ".coerce");
- Builder.CreateMemCpy(TempAlloca, Src, SrcSize);
+ if (HasPFPFields) {
+ // Structures with PFP fields require a coerced load to remove
any
+ // pointer signatures.
+ Builder.CreateStore(
+ CreatePFPCoercedLoad(Src, I->Ty, ArgInfo.getCoerceToType(),
+ *this),
+ TempAlloca);
+ } else {
----------------
ojhunt wrote:
nit no braces here
https://github.com/llvm/llvm-project/pull/172119
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits