forked from OSchip/llvm-project
[ScopInfo] Remove unnecessary indirection through SCEV [NFC]
The base address of a memory access is already an llvm::Value. Hence, there is no need to go through SCEV, but we can directly work with the llvm::Value. Also use 'Value *' instead of 'auto' for cases where the type is not obvious. llvm-svn: 294575
This commit is contained in:
parent
4553463be4
commit
e0e0e4d4f6
|
@ -2836,12 +2836,9 @@ bool Scop::addLoopBoundsToHeaderDomain(Loop *L, LoopInfo &LI) {
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryAccess *Scop::lookupBasePtrAccess(MemoryAccess *MA) {
|
MemoryAccess *Scop::lookupBasePtrAccess(MemoryAccess *MA) {
|
||||||
auto *BaseAddr = SE->getSCEV(MA->getBaseAddr());
|
Value *PointerBase = MA->getBaseAddr();
|
||||||
auto *PointerBase = dyn_cast<SCEVUnknown>(SE->getPointerBase(BaseAddr));
|
|
||||||
if (!PointerBase)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
auto *PointerBaseInst = dyn_cast<Instruction>(PointerBase->getValue());
|
auto *PointerBaseInst = dyn_cast<Instruction>(PointerBase);
|
||||||
if (!PointerBaseInst)
|
if (!PointerBaseInst)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
@ -2861,9 +2858,8 @@ bool Scop::hasNonHoistableBasePtrInScop(MemoryAccess *MA,
|
||||||
return !Hoistable;
|
return !Hoistable;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *BaseAddr = SE->getSCEV(MA->getBaseAddr());
|
Value *BaseAddr = MA->getBaseAddr();
|
||||||
auto *PointerBase = dyn_cast<SCEVUnknown>(SE->getPointerBase(BaseAddr));
|
if (auto *BasePtrInst = dyn_cast<Instruction>(BaseAddr))
|
||||||
if (auto *BasePtrInst = dyn_cast<Instruction>(PointerBase->getValue()))
|
|
||||||
if (!isa<LoadInst>(BasePtrInst))
|
if (!isa<LoadInst>(BasePtrInst))
|
||||||
return contains(BasePtrInst);
|
return contains(BasePtrInst);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue