[llvm] Attributor: Avoid calling identifyDefaultAbstractAttributes on declarations (PR #182663)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 21 06:40:42 PST 2026


================
@@ -3340,10 +3340,10 @@ void Attributor::checkAndQueryIRAttr(const IRPosition &IRP, AttributeSet Attrs,
 }
 
 void Attributor::identifyDefaultAbstractAttributes(Function &F) {
+  assert(!F.isDeclaration());
+
   if (!VisitedFunctions.insert(&F).second)
     return;
-  if (F.isDeclaration())
----------------
shiltian wrote:

I think you can just move this up, and then you don't need the other two changes.

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


More information about the llvm-commits mailing list