[llvm] [IntrinsicEmitter] Make AttributesMap PackedID type-adaptive (PR #158383)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 09:14:16 PDT 2025


================
@@ -751,9 +757,9 @@ AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id,
   if (id == 0)
     return AttributeList();
 
-  uint16_t PackedID = IntrinsicsToAttributesMap[id - 1];
-  uint16_t FnAttrID = PackedID >> ({});
-  uint16_t ArgAttrID = PackedID & ({});
+  uint{}_t PackedID = IntrinsicsToAttributesMap[id - 1];
----------------
jurahul wrote:

Would it be simpler to just emit a single inline function:

```
inline std::pair<uint32_t, uint32_t> getIntrinsicAttributeIDs(ID id) {
   return ...
}
```
and use that in both getAttributes and getFnAttribute? So we can parameterize less of the generated code?


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


More information about the llvm-commits mailing list