aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-21 22:10:06 +0000
committerChris Lattner <sabre@nondot.org>2002-08-21 22:10:06 +0000
commit905641bb01606d3ce83d8832b7bb7607a017cf06 (patch)
tree3dc958f60e189b49589610b24fccb362fccb1346 /lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
parentd92ac5ae01617079404d3eb11ecc46970865c1cf (diff)
Remove an optimization that isn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp')
-rw-r--r--lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
index 657640471a..7bfa329b57 100644
--- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
+++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
@@ -88,13 +88,15 @@ 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 two or fewer arguments and the first argument is 0,
- // the decomposed version is identical to the instruction itself.
- // This is common enough that it is worth checking for explicitly...
- if (MAI.getNumIndices() == 0 ||
- (MAI.getNumIndices() <= 2 && IsZero(*MAI.idx_begin()))) {
+ // 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;
}