[llvm] [NFC][LLVM] Refactor IIT_ANY payload for vector/element constraint (PR #203506)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 12 08:36:18 PDT 2026
================
@@ -238,49 +238,48 @@ def IntrTriviallyScalarizable : IntrinsicProperty;
// IIT constants and utils
//===----------------------------------------------------------------------===//
-// llvm::Intrinsic::IITDescriptor::AnyKind::AK_%
-def AnyKind {
- int Any = 0;
- int AnyInteger = 1;
- int AnyFloat = 2;
- int AnyVector = 3;
- int AnyPointer = 4;
+// llvm::Intrinsic::IITDescriptor::AnyKindVectorConstraint::VC_%
+def AnyKindVectorConstraint {
+ int None = 0;
+ int Vector = 1;
+ int Scalar = 2;
}
-// Placeholder to encode the overload index of the current type. We encode bit
-// 8 = 1 to indicate that this entry needs to be patched up with the overload
-// index (to prevent conflict with any valid not-to-be-patched IIT enccoding
-// byte, whose value will be <= 255). The AnyKind itself is in the lower bits.
-// Note that this is just a transient representation till its gets processed
-// by `DoPatchOverloadIndex` below, so this is *not* the encoding of the
-// final type signature.
-class OverloadIndexPlaceholder<int AnyKindVal> {
- int ID = 0x100;
- int ret = !or(ID, AnyKindVal);
+// llvm::Intrinsic::IITDescriptor::AnyKindElementConstraint::EC_%
+def AnyKindElementConstraint {
+ int None = 0;
+ int Integer = 1;
+ int Float = 2;
+ int Pointer = 3;
}
-// This class defines how the overload index and the arg kind are actually
-// packed into a single byte for the final IIT table encoding. Overload index is
-// packed in low 5 bits, argument kind is packed in upper 3 bits. This enables
-// us to use the same packing for llvm_any* types, which use a argument kind
-// and for partially dependent types like `LLVMVectorOfAnyPointersToElt` which
-// do not use the argument kind and expect the overload index in the lower bits.
-class PackOverloadIndex<int OverloadIndex, int AnyKindVal> {
- assert !lt(OverloadIndex, 32), "Cannot support more than 32 overload types";
- assert !lt(AnyKindVal, 8), "Cannot support more than 8 argument kinds";
- int ret = !or(!shl(AnyKindVal, 5), OverloadIndex);
+// Placeholder to encode the overload index of the current type. We encode a
+// value > 255 to indicate that this entry needs to be patched up with the
+// overload index (to prevent conflict with any valid not-to-be-patched IIT
+// enccoding byte, whose value will be <= 255). Note that this is just a
----------------
nikic wrote:
```suggestion
// encoding byte, whose value will be <= 255). Note that this is just a
```
https://github.com/llvm/llvm-project/pull/203506
More information about the llvm-commits
mailing list