[llvm] [SPIR-V] Lower `select` instructions with aggregate operands (PR #201417)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 02:56:08 PDT 2026


================
@@ -0,0 +1,81 @@
+; A `select` between aggregate (array/struct) values whose arms are not both
+; composite constants -- one or both arms are loaded, or are themselves a
+; select -- used to crash in SPIRVEmitIntrinsics ("illegal aggregate intrinsic
+; user", or the verifier's "Select values must have same type as select
+; instruction"). Check that such selects are lowered to a valid OpSelect over
+; the composite type. The all-constant case is covered by
+; select-composite-constant.ll.
----------------
jmmartinez wrote:

Nitpick, maybe do not go into the symptoms of the bug (the exact complain from the verifier or the assertion failing or the places in the code) but instead explain the problem: we used to generate invalid llvm-ir, a select where the operand types (i32) did not match the select's result type.

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


More information about the llvm-commits mailing list