1
0
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:
Nick Lewycky 2009-06-13 19:09:52 +00:00
parent 693a8c54e4
commit e74c3c6d46

View File

@ -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;