[llvm] [LLVM][Intrinsics] Refactor IIT encoding generation (PR #189790)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 21:00:10 PDT 2026


================
@@ -201,14 +201,13 @@ namespace Intrinsic {
              Kind == TruncArgument || Kind == SameVecWidthArgument ||
              Kind == VecElementArgument || Kind == Subdivide2Argument ||
              Kind == Subdivide4Argument || Kind == VecOfBitcastsToInt);
-      return ArgumentInfo >> 3;
+      // Overload index is packed into lower 5 bits.
+      return ArgumentInfo & 0x1f;
     }
     ArgKind getArgumentKind() const {
-      assert(Kind == Argument || Kind == ExtendArgument ||
-             Kind == TruncArgument || Kind == SameVecWidthArgument ||
-             Kind == VecElementArgument || Kind == Subdivide2Argument ||
-             Kind == Subdivide4Argument || Kind == VecOfBitcastsToInt);
-      return (ArgKind)(ArgumentInfo & 7);
+      // Argument kind is packed into upper 3 bits.
----------------
jurahul wrote:

This assert is made stricter because only IIT_ARG (i.e., LLVMAnyType) encode the arg kind and we query the arg kind only for this type. 

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


More information about the llvm-commits mailing list