From f2eeab3e1f23578740802bdec227a81a57bf02ba Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 18 Apr 2025 19:20:50 +0200 Subject: [PATCH] Attributor: Use use_empty instead of getNumUses == 0 --- llvm/lib/Transforms/IPO/Attributor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index 4d65354455379..5ef0410ee3616 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -3864,7 +3864,7 @@ static bool runAttributorOnFunctions(InformationCache &InfoCache, unsigned FunSize = Functions.size(); for (unsigned u = 0; u < FunSize; u++) { Function *F = Functions[u]; - if (!F->isDeclaration() && !F->isDefinitionExact() && F->getNumUses() && + if (!F->isDeclaration() && !F->isDefinitionExact() && !F->use_empty() && !GlobalValue::isInterposableLinkage(F->getLinkage())) { Function *NewF = Attributor::internalizeFunction(*F); assert(NewF && "Could not internalize function.");