[clang] [CIR] Lower pointer const_array globals without insertvalue chains (PR #198427)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 2 10:49:32 PDT 2026


================
@@ -78,6 +97,13 @@ void convertToDenseElementsAttrImpl(
 
   auto arrayAttr = mlir::cast<mlir::ArrayAttr>(attr.getElts());
   for (auto eltAttr : arrayAttr) {
+    if (auto boolAttr = mlir::dyn_cast<cir::BoolAttr>(eltAttr)) {
+      if constexpr (std::is_same_v<StorageTy, mlir::APInt>) {
----------------
erichkeane wrote:

can we put the `if constexpr` around the cast attempt?  Optimizers have a tough time removing our dyn-casts.

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


More information about the cfe-commits mailing list