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

John McCall via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 17:07:43 PDT 2024


================
@@ -2044,6 +2048,12 @@ llvm::Value *CodeGenFunction::EmitFromMemory(llvm::Value *Value, QualType Ty) {
     return emitBoolVecConversion(V, ValNumElems, "extractvec");
   }
 
+  if (hasBooleanRepresentation(Ty) || Ty->isBitIntType()) {
+    llvm::Type *ResTy = ConvertType(Ty);
+    bool Signed = Ty->isSignedIntegerOrEnumerationType();
+    return Builder.CreateIntCast(Value, ResTy, Signed, "loadedv");
----------------
rjmccall wrote:

This is always a `trunc`, right?  Or do we need use `CreateIntCast` because it might be a trivial truncation?

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


More information about the cfe-commits mailing list