[llvm] [AttributorLight] Without liveness checks, look at all functions (PR #91004)

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 13:10:10 PDT 2024


https://github.com/jdoerfert created https://github.com/llvm/llvm-project/pull/91004

None

>From 9420af28546856bd97253f07467cbde9da78d7a2 Mon Sep 17 00:00:00 2001
From: Johannes Doerfert <johannes at jdoerfert.de>
Date: Fri, 3 May 2024 13:08:37 -0700
Subject: [PATCH] [AttributorLight] Without liveness checks, look at all
 functions

---
 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 e3920b9e1d2baf..b6866580ccd3fc 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -3954,7 +3954,7 @@ static bool runAttributorLightOnFunctions(InformationCache &InfoCache,
     // We look at internal functions only on-demand but if any use is not a
     // direct call or outside the current set of analyzed functions, we have
     // to do it eagerly.
-    if (F->hasLocalLinkage()) {
+    if (AC.UseLiveness && F->hasLocalLinkage()) {
       if (llvm::all_of(F->uses(), [&Functions](const Use &U) {
             const auto *CB = dyn_cast<CallBase>(U.getUser());
             return CB && CB->isCallee(&U) &&



More information about the llvm-commits mailing list