[llvm] [GVN] MemorySSA for GVN: embed the memory state in symbolic expressions (PR #123218)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 16 08:31:51 PST 2025
================
@@ -2294,15 +2350,39 @@ bool GVNPass::ValueTable::areCallValsEqual(uint32_t Num, uint32_t NewNum,
uint32_t GVNPass::ValueTable::phiTranslateImpl(const BasicBlock *Pred,
const BasicBlock *PhiBlock,
uint32_t Num, GVNPass &Gvn) {
+ // See if we can refine the value number by looking at the PN incoming value
+ // for the given predecessor.
if (PHINode *PN = NumberingPhi[Num]) {
- for (unsigned i = 0; i != PN->getNumIncomingValues(); ++i) {
- if (PN->getParent() == PhiBlock && PN->getIncomingBlock(i) == Pred)
- if (uint32_t TransVal = lookup(PN->getIncomingValue(i), false))
- return TransVal;
- }
+ if (PN->getParent() == PhiBlock)
----------------
antoniofrighetto wrote:
Just hoisted the check out of the loop, can also drop as not strictly related to the patch.
https://github.com/llvm/llvm-project/pull/123218
More information about the llvm-commits
mailing list