[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 6 09:13:57 PDT 2024


================
@@ -5348,18 +5348,8 @@ Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) {
     return llvm::UndefValue::get(ArgTy);
   }
 
-  // FIXME Volatility.
-  llvm::Value *Val = Builder.CreateLoad(ArgPtr);
-
-  // If EmitVAArg promoted the type, we must truncate it.
-  if (ArgTy != Val->getType()) {
-    if (ArgTy->isPointerTy() && !Val->getType()->isPointerTy())
-      Val = Builder.CreateIntToPtr(Val, ArgTy);
-    else
-      Val = Builder.CreateTrunc(Val, ArgTy);
-  }
-
-  return Val;
+  return CGF.EmitLoadOfScalar(ArgPtr, Ty.isVolatileQualified(), Ty,
+                              VE->getExprLoc());
----------------
Fznamznon wrote:

I posted https://github.com/llvm/llvm-project/pull/94635 .

I somehow had to load the value anyway, since inner `EmitVAArg` that seems to be target-dependent returns an Address as well. 

https://github.com/llvm/llvm-project/pull/91364


More information about the cfe-commits mailing list