[polly] r294575 - [ScopInfo] Remove unnecessary indirection through SCEV [NFC]

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 01:34:47 PST 2017


Author: grosser
Date: Thu Feb  9 03:34:46 2017
New Revision: 294575

URL: http://llvm.org/viewvc/llvm-project?rev=294575&view=rev
Log:
[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.

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=294575&r1=294574&r2=294575&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Feb  9 03:34:46 2017
@@ -2836,12 +2836,9 @@ bool Scop::addLoopBoundsToHeaderDomain(L
 }
 
 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(
     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);
 




More information about the llvm-commits mailing list