[llvm] [Intrinsic] Unify IIT_STRUCT{2-9} into ITT_STRUCT to support upto 257 return value (PR #160434)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 26 06:52:45 PDT 2025


================
@@ -1,22 +1,58 @@
 // RUN: llvm-tblgen -gen-intrinsic-enums -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS | FileCheck %s --check-prefix=CHECK-ENUM
-// RUN: llvm-tblgen -gen-intrinsic-impl -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS > /dev/null 2>&1
+// RUN: llvm-tblgen -gen-intrinsic-impl -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS | FileCheck %s --check-prefix=CHECK-IMPL
 // RUN: not llvm-tblgen -gen-intrinsic-impl -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS -DENABLE_ERROR 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
 
 // XFAIL: vg_leak
 
 include "llvm/IR/Intrinsics.td"
 
-// Make sure we can return up to 9 values.
-// CHECK-ENUM: returns_9_results = {{[0-9]+}}, // llvm.returns.9.results
-def int_returns_9_results : Intrinsic<
-                              !listsplat(llvm_anyint_ty, 9),
-                              [], [], "llvm.returns.9.results">;
+// Make sure we can return up to 257 values. Intrinsics are in alphabetical order.
+// CHECK-ENUM: returns_a0_results = {{[0-9]+}}, // llvm.returns.a0.results
+// CHECK-ENUM: returns_b1_results, // llvm.returns.b1.results
+// CHECK-ENUM: returns_c2_results, // llvm.returns.c2.results
+// CHECK-ENUM: returns_d9_results, // llvm.returns.d9.results
+// CHECK-ENUM: returns_e10_results, // llvm.returns.e10.results
+// CHECK-ENUM: returns_f257_results, // llvm.returns.f257.results
 
-#ifdef ENABLE_ERROR
-// CHECK-ERROR: error: intrinsics can only return upto 9 values, 'int_returns_10_results' returns 10 values
-// CHECK-ERROR-NEXT: def int_returns_10_results : Intrinsic<
-def int_returns_10_results : Intrinsic<
+// Make sure the encoding table is correctly generated.
----------------
jurahul wrote:

One thing that would be nice in future is to have the emitter generate symbolic names for some of the entries as opposed to raw numbers so it's easy to check. But out of scope for this PR,

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


More information about the llvm-commits mailing list