[llvm] [Attributor] Prevent infinite loop in AAGlobalValueInfoFloating (PR #94941)
Vidush Singhal via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 10 15:39:34 PDT 2024
================
@@ -1749,6 +1749,10 @@ bool Attributor::checkForAllCallees(
return Pred(Callees.getArrayRef());
}
+bool noRevisitUser(const User *user) {
+ return isa<PHINode>(user) || !isa<Instruction>(user);
----------------
vidsinghal wrote:
I'd recommend to prevent adding a phi or instruction on the worklist to begin with.
The AddUsers function can have this check before the User is pushed on the worklist.
For instance these checks can go here: https://github.com/llvm/llvm-project/blob/530ec6d11462f7801c9cfc819b0deda876ca3d2d/llvm/lib/Transforms/IPO/Attributor.cpp#L1784
https://github.com/llvm/llvm-project/pull/94941
More information about the llvm-commits
mailing list