mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Unlike the other instructions, GEP really does need to look at the type of a
pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73299 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -284,6 +284,20 @@ static bool equals(const BasicBlock *BB1, const BasicBlock *BB2,
|
|||||||
if (!isEquivalentOperation(FI, GI))
|
if (!isEquivalentOperation(FI, GI))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (isa<GetElementPtrInst>(FI)) {
|
||||||
|
const GetElementPtrInst *GEPF = cast<GetElementPtrInst>(FI);
|
||||||
|
const GetElementPtrInst *GEPG = cast<GetElementPtrInst>(GI);
|
||||||
|
if (GEPF->hasAllZeroIndices() && GEPG->hasAllZeroIndices()) {
|
||||||
|
// It's effectively a bitcast.
|
||||||
|
++FI, ++GI;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: we only really care about the elements before the index
|
||||||
|
if (FI->getOperand(0)->getType() != GI->getOperand(0)->getType())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (ValueMap[FI] == GI) {
|
if (ValueMap[FI] == GI) {
|
||||||
++FI, ++GI;
|
++FI, ++GI;
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user