================
@@ -1886,6 +1896,29 @@ llvm::Constant 
*ConstantEmitter::emitForMemory(CodeGenModule &CGM,
     return Res;
   }
 
+  if (destType->isBitIntType()) {
+    if (CGM.getTypes().typeRequiresSplitIntoByteArray(destType, C->getType())) 
{
+      // Long _BitInt has array of bytes as in-memory type.
+      // So, split constant into individual bytes.
+      ConstantAggregateBuilder Builder(CGM);
+      llvm::Type *DesiredTy = CGM.getTypes().ConvertTypeForMem(destType);
+      llvm::Type *LoadStoreTy =
----------------
rjmccall wrote:

Right.  Momchil, your description is actually a totally reasonable way of 
understanding what `convertTypeForLoadStore` *means* for `_BitInt`: the 
load/store type is an integer type that has the same width as the in-memory 
type.  We're just recognizing that as a more general concept.

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

Reply via email to