diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-08-22 22:49:05 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-08-22 22:49:05 +0000 |
| commit | cd709cbf53cc33486f06e4e38f29fac87205def5 (patch) | |
| tree | 1b428d677e5c0b3751272cc97faebd73cc1190ff /llvm/lib/Transforms | |
| parent | 030effa42ca55f9bc37e542b8e06e8abf4ea730c (diff) | |
| download | bcm5719-llvm-cd709cbf53cc33486f06e4e38f29fac87205def5.tar.gz bcm5719-llvm-cd709cbf53cc33486f06e4e38f29fac87205def5.zip | |
Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore
llvm-svn: 3485
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp | 20 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GCSE.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 1 |
3 files changed, 1 insertions, 22 deletions
diff --git a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp index 7bfa329b57c..4e6cbcf5f4f 100644 --- a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp +++ b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp @@ -49,7 +49,7 @@ DecomposePass::runOnBasicBlock(BasicBlock &BB) for (BasicBlock::iterator II = BB.begin(); II != BB.end(); ) { if (MemAccessInst *MAI = dyn_cast<MemAccessInst>(&*II)) if (MAI->getNumIndices() >= 2) { - Changed = decomposeArrayRef(II) || Changed; // always modifies II + Changed |= decomposeArrayRef(II); // always modifies II continue; } ++II; @@ -88,19 +88,7 @@ IsZero(Value* idx) bool DecomposePass::decomposeArrayRef(BasicBlock::iterator &BBI) { - // FIXME: If condition below MemAccessInst &MAI = cast<MemAccessInst>(*BBI); - // FIXME: If condition below - - // If this instr has no indexes, then the decomposed version is identical to - // the instruction itself. FIXME: this should go away once GEP is the only - // MAI - // - if (MAI.getNumIndices() == 0) { - ++BBI; - return false; - } - BasicBlock *BB = MAI.getParent(); Value *LastPtr = MAI.getPointerOperand(); @@ -141,12 +129,6 @@ DecomposePass::decomposeArrayRef(BasicBlock::iterator &BBI) Instruction *NewI = 0; switch(MAI.getOpcode()) { - case Instruction::Load: - NewI = new LoadInst(LastPtr, Indices, MAI.getName()); - break; - case Instruction::Store: - NewI = new StoreInst(MAI.getOperand(0), LastPtr, Indices); - break; case Instruction::GetElementPtr: NewI = new GetElementPtrInst(LastPtr, Indices, MAI.getName()); break; diff --git a/llvm/lib/Transforms/Scalar/GCSE.cpp b/llvm/lib/Transforms/Scalar/GCSE.cpp index dc6a345316b..b4583e00963 100644 --- a/llvm/lib/Transforms/Scalar/GCSE.cpp +++ b/llvm/lib/Transforms/Scalar/GCSE.cpp @@ -381,8 +381,6 @@ bool GCSE::TryToRemoveALoad(LoadInst *L1, LoadInst *L2) { return false; // Neither instruction dominates the other one... BasicBlock *BB1 = L1->getParent(), *BB2 = L2->getParent(); - - assert(!L1->hasIndices()); Value *LoadAddress = L1->getOperand(0); // L1 now dominates L2. Check to see if the intervening instructions between diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 3714d7b08f4..37333db1115 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -105,7 +105,6 @@ namespace { void visitShiftInst(ShiftInst &I) { visitBinaryOperator((Instruction&)I); } void visitLoadInst(LoadInst &LI) { - assert(!LI.hasIndices()); if (isLoopInvariant(LI.getOperand(0)) && !pointerInvalidatedByLoop(LI.getOperand(0))) hoist(LI); |

