================
@@ -2510,6 +2509,25 @@ mlir::LogicalResult 
CIRToLLVMGlobalOpLowering::matchAndRewrite(
                          cir::ConstComplexAttr, cir::GlobalViewAttr,
                          cir::TypeInfoAttr, cir::UndefAttr, cir::PoisonAttr,
                          cir::VTableAttr, cir::ZeroAttr>(init.value())) {
+      if (auto constArr = mlir::dyn_cast<cir::ConstArrayAttr>(init.value())) {
+        if (!hasTrailingZeros(constArr)) {
+          mlir::Type elTy = constArr.getType();
+          while (auto arrTy = mlir::dyn_cast<cir::ArrayType>(elTy))
+            elTy = arrTy.getElementType();
+          if (mlir::isa<cir::PointerType>(elTy)) {
----------------
erichkeane wrote:

I was chasing down a similar issue in self build and noticed that it seems to 
skip this?  I'm still debugging, but why is this limited to pointer types, and 
not extended to other trivially copyable types? 

https://github.com/llvm/llvm-project/pull/198427
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to