[polly] r294576 - [ScopInfo] Expect the OriginalBaseAddr when looking at underlying instructions [NFC]
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 02:11:59 PST 2017
Author: grosser
Date: Thu Feb 9 04:11:58 2017
New Revision: 294576
URL: http://llvm.org/viewvc/llvm-project?rev=294576&view=rev
Log:
[ScopInfo] Expect the OriginalBaseAddr when looking at underlying instructions [NFC]
During SCoP construction we sometimes inspect the underlying IR by looking at
the base address of a MemoryAccess. In such cases, we always want the original
base address. Make this clear by calling getOriginalBaseAddr().
This is a non-functional change as getBaseAddr maps to getOriginalBaseAddr
at the moment.
This change removes unnecessary uses of MemoryAddress::getBaseAddr() in
preparation for https://reviews.llvm.org/D28518.
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=294576&r1=294575&r2=294576&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Feb 9 04:11:58 2017
@@ -1188,7 +1188,7 @@ void ScopStmt::addAccess(MemoryAccess *A
ValueReads[AccessVal] = Access;
} else if (Access->isAnyPHIKind() && Access->isWrite()) {
- PHINode *PHI = cast<PHINode>(Access->getBaseAddr());
+ PHINode *PHI = cast<PHINode>(Access->getOriginalBaseAddr());
assert(!PHIWrites.lookup(PHI));
PHIWrites[PHI] = Access;
@@ -2836,7 +2836,7 @@ bool Scop::addLoopBoundsToHeaderDomain(L
}
MemoryAccess *Scop::lookupBasePtrAccess(MemoryAccess *MA) {
- Value *PointerBase = MA->getBaseAddr();
+ Value *PointerBase = MA->getOriginalBaseAddr();
auto *PointerBaseInst = dyn_cast<Instruction>(PointerBase);
if (!PointerBaseInst)
@@ -2858,7 +2858,7 @@ bool Scop::hasNonHoistableBasePtrInScop(
return !Hoistable;
}
- Value *BaseAddr = MA->getBaseAddr();
+ Value *BaseAddr = MA->getOriginalBaseAddr();
if (auto *BasePtrInst = dyn_cast<Instruction>(BaseAddr))
if (!isa<LoadInst>(BasePtrInst))
return contains(BasePtrInst);
More information about the llvm-commits
mailing list