[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:
Tobias Grosser 2017-02-09 09:34:46 +00:00
parent 4553463be4
commit e0e0e4d4f6
1 changed files with 4 additions and 8 deletions

View File

@ -2836,12 +2836,9 @@ bool Scop::addLoopBoundsToHeaderDomain(Loop *L, LoopInfo &LI) {
}
MemoryAccess *Scop::lookupBasePtrAccess(MemoryAccess *MA) {
auto *BaseAddr = SE->getSCEV(MA->getBaseAddr());
auto *PointerBase = dyn_cast<SCEVUnknown>(SE->getPointerBase(BaseAddr));
if (!PointerBase)
return nullptr;
Value *PointerBase = MA->getBaseAddr();
auto *PointerBaseInst = dyn_cast<Instruction>(PointerBase->getValue());
auto *PointerBaseInst = dyn_cast<Instruction>(PointerBase);
if (!PointerBaseInst)
return nullptr;
@ -2861,9 +2858,8 @@ bool Scop::hasNonHoistableBasePtrInScop(MemoryAccess *MA,
return !Hoistable;
}
auto *BaseAddr = SE->getSCEV(MA->getBaseAddr());
auto *PointerBase = dyn_cast<SCEVUnknown>(SE->getPointerBase(BaseAddr));
if (auto *BasePtrInst = dyn_cast<Instruction>(PointerBase->getValue()))
Value *BaseAddr = MA->getBaseAddr();
if (auto *BasePtrInst = dyn_cast<Instruction>(BaseAddr))
if (!isa<LoadInst>(BasePtrInst))
return contains(BasePtrInst);