[llvm] [LLVM][Intrinsics] Reduce stack size for `Intrinsic::getAttributes` (PR #152219)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 06:30:47 PDT 2025


================
@@ -652,53 +652,61 @@ static constexpr uint16_t IntrinsicsToAttributesMap[] = {)";
 
 AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id,
                                        FunctionType *FT) {)";
+  // Find the max number of attributes to create the local array.
+  unsigned MaxNumAttrs = 0;
+  for (const auto [IntPtr, UniqueID] : UniqAttributes) {
+    const CodeGenIntrinsic &Int = *IntPtr;
+    unsigned NumAttrs =
+        llvm::count_if(Int.ArgumentAttributes,
+                       [](const auto &Attrs) { return !Attrs.empty(); });
----------------
nikic wrote:

I see, thanks.

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


More information about the llvm-commits mailing list