[llvm] [FuncSpec] Query SCCPSolver in more places (PR #114964)

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 03:19:54 PST 2024


================
@@ -312,10 +317,10 @@ bool InstCostVisitor::discoverTransitivelyIncomingValues(
 
       // Disregard self-references and dead incoming values.
       if (auto *Inst = dyn_cast<Instruction>(V))
-        if (Inst == PN || DeadBlocks.contains(PN->getIncomingBlock(I)))
----------------
hazzlim wrote:

It's maybe confusing that this function is named the same as the `SCCPSolver` member function, but this change is to make us dispatch to `InstCostVisitor::isBlockExecutable`, which checks both the `SCCPSolver` and DeadBlocks:
https://github.com/llvm/llvm-project/blob/2de3d00edc614cdce4b30b68be564a7a3123dbf9/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h#L179-L181

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


More information about the llvm-commits mailing list