summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/Delinearization.cpp
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2018-03-09 21:05:58 +0000
committerRenato Golin <renato.golin@linaro.org>2018-03-09 21:05:58 +0000
commit038ede2a16a55106ada3970265037ba0327385bb (patch)
treee439d0f35ec332982fbb7f1411cd6081b96c32de /llvm/lib/Analysis/Delinearization.cpp
parent0fab41782ddc6479602b496e72f7c86700a1d602 (diff)
downloadbcm5719-llvm-038ede2a16a55106ada3970265037ba0327385bb.tar.gz
bcm5719-llvm-038ede2a16a55106ada3970265037ba0327385bb.zip
[NFC] Consolidate six getPointerOperand() utility functions into one place
There are six separate instances of getPointerOperand() utility. LoopVectorize.cpp has one of them, and I don't want to create a 7th one while I'm trying to move LoopVectorizationLegality into a separate file (eventual objective is to move it to Analysis tree). See http://lists.llvm.org/pipermail/llvm-dev/2018-February/120999.html for llvm-dev discussions Closes D43323. Patch by Hideki Saito <hideki.saito@intel.com>. llvm-svn: 327173
Diffstat (limited to 'llvm/lib/Analysis/Delinearization.cpp')
-rw-r--r--llvm/lib/Analysis/Delinearization.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/Delinearization.cpp b/llvm/lib/Analysis/Delinearization.cpp
index dd5af9d43ef..4cafb7da16d 100644
--- a/llvm/lib/Analysis/Delinearization.cpp
+++ b/llvm/lib/Analysis/Delinearization.cpp
@@ -69,16 +69,6 @@ bool Delinearization::runOnFunction(Function &F) {
return false;
}
-static Value *getPointerOperand(Instruction &Inst) {
- if (LoadInst *Load = dyn_cast<LoadInst>(&Inst))
- return Load->getPointerOperand();
- else if (StoreInst *Store = dyn_cast<StoreInst>(&Inst))
- return Store->getPointerOperand();
- else if (GetElementPtrInst *Gep = dyn_cast<GetElementPtrInst>(&Inst))
- return Gep->getPointerOperand();
- return nullptr;
-}
-
void Delinearization::print(raw_ostream &O, const Module *) const {
O << "Delinearization on function " << F->getName() << ":\n";
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
@@ -93,7 +83,7 @@ void Delinearization::print(raw_ostream &O, const Module *) const {
// Delinearize the memory access as analyzed in all the surrounding loops.
// Do not analyze memory accesses outside loops.
for (Loop *L = LI->getLoopFor(BB); L != nullptr; L = L->getParentLoop()) {
- const SCEV *AccessFn = SE->getSCEVAtScope(getPointerOperand(*Inst), L);
+ const SCEV *AccessFn = SE->getSCEVAtScope(getPointerOperand(Inst), L);
const SCEVUnknown *BasePointer =
dyn_cast<SCEVUnknown>(SE->getPointerBase(AccessFn));
OpenPOWER on IntegriCloud