[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:47:32 PDT 2025


================
@@ -390,32 +390,13 @@ DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
   case IIT_EMPTYSTRUCT:
     OutputTable.push_back(IITDescriptor::get(IITDescriptor::Struct, 0));
     return;
-  case IIT_STRUCT9:
-    ++StructElts;
-    [[fallthrough]];
-  case IIT_STRUCT8:
-    ++StructElts;
-    [[fallthrough]];
-  case IIT_STRUCT7:
-    ++StructElts;
-    [[fallthrough]];
-  case IIT_STRUCT6:
-    ++StructElts;
-    [[fallthrough]];
-  case IIT_STRUCT5:
-    ++StructElts;
-    [[fallthrough]];
-  case IIT_STRUCT4:
-    ++StructElts;
-    [[fallthrough]];
-  case IIT_STRUCT3:
-    ++StructElts;
-    [[fallthrough]];
-  case IIT_STRUCT2: {
+  case IIT_STRUCT: {
+    StructElts += Infos[NextElt++];
----------------
jurahul wrote:

nit: remove the `unsigned StructElts = 2;` at the start of this function and just do `unsigned StructElts = 2 + Infos[NextElt++];` here.

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


More information about the llvm-commits mailing list