[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
Wed May 29 06:29:47 PDT 2024


================
@@ -1774,6 +1774,18 @@ llvm::Constant *ConstantEmitter::emitForMemory(CodeGenModule &CGM,
     return Res;
   }
 
+  if (const auto *BIT = destType->getAs<BitIntType>()) {
+    if (BIT->getNumBits() > 128) {
+      // Long _BitInt has array of bytes as in-memory type.
+      ConstantAggregateBuilder Builder(CGM);
+      llvm::Type *DesiredTy = CGM.getTypes().ConvertTypeForMem(destType);
+      auto *CI = cast<llvm::ConstantInt>(C);
----------------
Fznamznon wrote:

I've added a comment. I'm not able to get a ptrtoint in a constant expression involving a big _BitInt.

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


More information about the cfe-commits mailing list