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 | 24ea74eb9a47b81c1557926acd83e0fbe6d7594e (patch) | |
tree | 603050bf899b7d3d180b19871d172daf2614520b /lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp | |
parent | 5dfe767b872988c4f54348afd0d284104d5cd0a0 (diff) |
Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp')
-rw-r--r-- | lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp index 7bfa329b57..4e6cbcf5f4 100644 --- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp +++ b/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; |