================
@@ -3123,8 +3123,22 @@ Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, 
Address VAListAddr,
 
     RegAddr = Tmp.withElementType(LTy);
   } else if (neededInt) {
-    RegAddr = Address(CGF.Builder.CreateGEP(CGF.Int8Ty, RegSaveArea, 
gp_offset),
-                      LTy, CharUnits::fromQuantity(8));
+    if (AI.isDirect() && AI.getDirectOffset() == 8) {
+      Address Tmp = CGF.CreateMemTemp(Ty);
+      llvm::StructType *ST = cast<llvm::StructType>(LTy);
+      Tmp = Tmp.withElementType(ST);
+      llvm::Type *TyHi = ST->getElementType(1);
----------------
efriedma-quic wrote:

The computation of TyHi is wrong.  Use `AI.getCoerceToType()`.  (Try something 
like `typedef struct { struct Z {} z[8]; float x, y; } X;`.)

Can we unify this code with the "Copy into a temporary if the type is more 
aligned" code below, so we only call CreateMemTemp() once?

Can we reuse this code for the neededSSE == 1 case?

https://github.com/llvm/llvm-project/pull/90389
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to