mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01: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! llvm-svn: 73299
This commit is contained in:
parent
693a8c54e4
commit
e74c3c6d46
@ -284,6 +284,20 @@ static bool equals(const BasicBlock *BB1, const BasicBlock *BB2,
|
||||
if (!isEquivalentOperation(FI, GI))
|
||||
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) {
|
||||
++FI, ++GI;
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user