diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-07-06 19:24:47 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-07-06 19:24:47 +0000 |
commit | 08cc64ebfe7d7026ad4f6d471a78427daf2ef167 (patch) | |
tree | 52f537c956546f191c39f4f573044c02528dec2c | |
parent | 10585d92da0dc9a18d6392041f909167d6eee566 (diff) |
It doesn't matter what the 2nd operand is; if the GEP has 2 operands and
the first is a zero, we should leave it alone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14648 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp index bcd0f78aba..72e537a7dc 100644 --- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp +++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp @@ -83,8 +83,7 @@ static inline bool isZeroConst (Value *V) { bool llvm::DecomposeArrayRef(GetElementPtrInst* GEP) { if (GEP->getNumIndices() < 2 || (GEP->getNumIndices() == 2 - && isZeroConst(GEP->getOperand(1)) - && isa<ConstantInt>(GEP->getOperand(2)))) { + && isZeroConst(GEP->getOperand(1)))) { DEBUG (std::cerr << "DecomposeArrayRef: Skipping " << *GEP); return false; } else { |