mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
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
This commit is contained in:
@@ -83,8 +83,7 @@ static inline bool isZeroConst (Value *V) {
|
|||||||
bool llvm::DecomposeArrayRef(GetElementPtrInst* GEP) {
|
bool llvm::DecomposeArrayRef(GetElementPtrInst* GEP) {
|
||||||
if (GEP->getNumIndices() < 2
|
if (GEP->getNumIndices() < 2
|
||||||
|| (GEP->getNumIndices() == 2
|
|| (GEP->getNumIndices() == 2
|
||||||
&& isZeroConst(GEP->getOperand(1))
|
&& isZeroConst(GEP->getOperand(1)))) {
|
||||||
&& isa<ConstantInt>(GEP->getOperand(2)))) {
|
|
||||||
DEBUG (std::cerr << "DecomposeArrayRef: Skipping " << *GEP);
|
DEBUG (std::cerr << "DecomposeArrayRef: Skipping " << *GEP);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user