summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-05-17 14:48:17 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-05-17 14:48:17 +0000
commitc53bee6eaeac821ca53c81efa1dfc9495a72d24b (patch)
treef9fee7516f9e22e690a36767390befc120440b74 /lib/Transforms/Vectorize
parent91c623d4ee6a9fddf73b8057d61bd9423feeb14d (diff)
downloadllvm-c53bee6eaeac821ca53c81efa1dfc9495a72d24b.tar.gz
llvm-c53bee6eaeac821ca53c81efa1dfc9495a72d24b.tar.bz2
llvm-c53bee6eaeac821ca53c81efa1dfc9495a72d24b.tar.xz
LoopVectorize: Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 88e76dabfb..fce2cf211c 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -354,24 +354,10 @@ bool LoadHoisting::isHoistableLoad(Instruction *L) {
static void addMemAccesses(BasicBlock *BB, SmallPtrSet<Value *, 8> &Set) {
for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) {
- Instruction *I = &*BI;
- Value *Addr = 0;
-
- // Try a load.
- LoadInst *LI = dyn_cast<LoadInst>(I);
- if (LI) {
- Addr = LI->getPointerOperand();
- Set.insert(Addr);
- continue;
- }
-
- // Try a store.
- StoreInst *SI = dyn_cast<StoreInst>(I);
- if (!SI)
- continue;
-
- Addr = SI->getPointerOperand();
- Set.insert(Addr);
+ if (LoadInst *LI = dyn_cast<LoadInst>(BI)) // Try a load.
+ Set.insert(LI->getPointerOperand());
+ else if (StoreInst *SI = dyn_cast<StoreInst>(BI)) // Try a store.
+ Set.insert(SI->getPointerOperand());
}
}
@@ -2708,9 +2694,7 @@ void LoopVectorizationLegality::collectLoopUniforms() {
Uniforms.insert(I);
// Insert all operands.
- for (int i = 0, Op = I->getNumOperands(); i < Op; ++i) {
- Worklist.push_back(I->getOperand(i));
- }
+ Worklist.insert(Worklist.end(), I->op_begin(), I->op_end());
}
}