[PATCH] D133396: [MemorySSA] Don't do addr phi translation if addr value is not a loop invariant
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 7 01:11:19 PDT 2022
nikic added a comment.
You need to update phi-translation.ll for this change. From a cursory look I think the results improve while still being correct.
================
Comment at: llvm/include/llvm/Analysis/MemorySSA.h:1258
Location.getWithNewSize(LocationSize::beforeOrAfterPointer());
- PHITransAddr Translator(
- const_cast<Value *>(Location.Ptr),
- OriginalAccess->getBlock()->getModule()->getDataLayout(), nullptr);
-
- if (!Translator.PHITranslateValue(OriginalAccess->getBlock(),
- DefIterator.getPhiArgBlock(), DT,
- true)) {
- Value *TransAddr = Translator.getAddr();
- if (TransAddr != Location.Ptr) {
- CurrentPair.second = CurrentPair.second.getWithNewPtr(TransAddr);
-
- if (TransAddr &&
- !IsGuaranteedLoopInvariant(const_cast<Value *>(TransAddr)))
- CurrentPair.second = CurrentPair.second.getWithNewSize(
- LocationSize::beforeOrAfterPointer());
-
- if (PerformedPhiTranslation)
- *PerformedPhiTranslation = true;
+ else {
+ PHITransAddr Translator(
----------------
A slightly more accurate check would be `if (Location.Size != LocationSize::beforeOrAfterPointer())`. If the size is already unknown originally, then we don't need to bother with phi translation either.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133396/new/
https://reviews.llvm.org/D133396
More information about the llvm-commits
mailing list