mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
LoopVectorize: Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182100 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -354,24 +354,10 @@ bool LoadHoisting::isHoistableLoad(Instruction *L) {
|
|||||||
|
|
||||||
static void addMemAccesses(BasicBlock *BB, SmallPtrSet<Value *, 8> &Set) {
|
static void addMemAccesses(BasicBlock *BB, SmallPtrSet<Value *, 8> &Set) {
|
||||||
for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) {
|
for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) {
|
||||||
Instruction *I = &*BI;
|
if (LoadInst *LI = dyn_cast<LoadInst>(BI)) // Try a load.
|
||||||
Value *Addr = 0;
|
Set.insert(LI->getPointerOperand());
|
||||||
|
else if (StoreInst *SI = dyn_cast<StoreInst>(BI)) // Try a store.
|
||||||
// Try a load.
|
Set.insert(SI->getPointerOperand());
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2708,9 +2694,7 @@ void LoopVectorizationLegality::collectLoopUniforms() {
|
|||||||
Uniforms.insert(I);
|
Uniforms.insert(I);
|
||||||
|
|
||||||
// Insert all operands.
|
// Insert all operands.
|
||||||
for (int i = 0, Op = I->getNumOperands(); i < Op; ++i) {
|
Worklist.insert(Worklist.end(), I->op_begin(), I->op_end());
|
||||||
Worklist.push_back(I->getOperand(i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user