[llvm] [IR] Require that global value initializers are sized (PR #137358)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 11:19:56 PDT 2025


================
@@ -2,4 +2,8 @@
 ; RUN: verify-uselistorder %s
 
 %t = type opaque
- at x = global %t undef
+
+define void @test() {
+  %sel = select i1 true, %t undef, %t poison
----------------
efriedma-quic wrote:

We should also forbid "select"/"undef"/"poison"/"zeroinitialzer", I think?  I don't see any reason to allow writing values with opaque types in any context; it's about as meaningful as a global variable with an opaque type.

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


More information about the llvm-commits mailing list