[clang] [llvm] [SelectionDAG] Fix assertion failure on inline asm register type mismatch (PR #166615)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 03:01:47 PST 2025


================
@@ -11,3 +15,17 @@ vec256 foo(vec256 in) {
   return out;
 }
 
+// Additional tests for different vector sizes
+typedef int vec128 __attribute__((ext_vector_type(4)));
+typedef int vec64  __attribute__((ext_vector_type(2)));
+
+void test_128bit_mismatch() {
+  vec128 out;
+  __asm__("nop" : "=y"(out)); // expected-error {{invalid output size for constraint '=y'}}
----------------
phoebewang wrote:

This was generated as expected without this change, see https://godbolt.org/z/4eTK6en15

The crash only happens on 256-bit, so we just need to add a new RUN line with `-fopenmp`.

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


More information about the llvm-commits mailing list