[PATCH] D132417: [GlobalOpt] Bail out on SROA of a Global if a scalable vector type is seen

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 13:22:00 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG38d58c1b376d: [GlobalOpt] Bail out of GlobalOpt SROA if a Scalable Vector is seen (authored by cameron.mcinally).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132417/new/

https://reviews.llvm.org/D132417

Files:
  llvm/lib/Transforms/IPO/GlobalOpt.cpp
  llvm/test/Transforms/GlobalOpt/2022-08-23-ScalableVectorCrash.ll


Index: llvm/test/Transforms/GlobalOpt/2022-08-23-ScalableVectorCrash.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/GlobalOpt/2022-08-23-ScalableVectorCrash.ll
@@ -0,0 +1,15 @@
+; RUN: opt -globalopt < %s
+
+; Ensure we don't ICE by trying to optimize a scalable vector load of a global
+; variable.
+
+%struct.xxx = type <{ [96 x i8] }>
+
+ at .bss = internal unnamed_addr global %struct.xxx zeroinitializer, align 32
+
+define dso_local void @foo() local_unnamed_addr align 16 #0 {
+L.entry:
+  store <vscale x 2 x double> zeroinitializer, ptr @.bss, align 1
+  %0 = load <vscale x 2 x double>, ptr @.bss, align 8
+  unreachable
+}
Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -375,6 +375,11 @@
       auto It = Types.try_emplace(Offset.getZExtValue(), Ty).first;
       if (Ty != It->second)
         return false;
+
+      // Scalable types not currently supported.
+      if (isa<ScalableVectorType>(Ty))
+        return false;
+
       continue;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132417.455344.patch
Type: text/x-patch
Size: 1176 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220824/8811934e/attachment.bin>


More information about the llvm-commits mailing list