mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Handle AddrSpaceCast in stripAndAccumulateInBoundsConstantOffsets
All of the other similar functions in that part of the file look through addrspacecast in addition to bitcast, and I see no reason why stripAndAccumulateInBoundsConstantOffsets shouldn't do so also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -455,7 +455,8 @@ Value *Value::stripAndAccumulateInBoundsConstantOffsets(const DataLayout &DL,
|
|||||||
return V;
|
return V;
|
||||||
Offset = GEPOffset;
|
Offset = GEPOffset;
|
||||||
V = GEP->getPointerOperand();
|
V = GEP->getPointerOperand();
|
||||||
} else if (Operator::getOpcode(V) == Instruction::BitCast) {
|
} else if (Operator::getOpcode(V) == Instruction::BitCast ||
|
||||||
|
Operator::getOpcode(V) == Instruction::AddrSpaceCast) {
|
||||||
V = cast<Operator>(V)->getOperand(0);
|
V = cast<Operator>(V)->getOperand(0);
|
||||||
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
|
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
|
||||||
V = GA->getAliasee();
|
V = GA->getAliasee();
|
||||||
|
Reference in New Issue
Block a user