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. llvm-svn: 14648
This commit is contained in:
parent
0e0fe8a2e9
commit
a501be556f
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue