mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Remove some wrong code which fortunately was never executed (as explained in
the comment I added): an extern weak global may have a null address. llvm-svn: 123373
This commit is contained in:
parent
36b007d63b
commit
69fbfa2b0e
@ -1024,12 +1024,15 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// icmp <global/alloca*/null>, <global/alloca*/null> - Global/Stack value
|
// icmp <alloca*>, <global/alloca*/null> - Different stack variables have
|
||||||
// addresses never equal each other! We already know that Op0 != Op1.
|
// different addresses, and what's more the address of a stack variable is
|
||||||
if ((isa<GlobalValue>(LHS) || isa<AllocaInst>(LHS) ||
|
// never null or equal to the address of a global. Note that generalizing
|
||||||
isa<ConstantPointerNull>(LHS)) &&
|
// to the case where LHS is a global variable address or null is pointless,
|
||||||
(isa<GlobalValue>(RHS) || isa<AllocaInst>(RHS) ||
|
// since if both LHS and RHS are constants then we already constant folded
|
||||||
isa<ConstantPointerNull>(RHS)))
|
// the compare, and if only one of them is then we moved it to RHS already.
|
||||||
|
if (isa<AllocaInst>(LHS) && (isa<GlobalValue>(RHS) || isa<AllocaInst>(RHS) ||
|
||||||
|
isa<ConstantPointerNull>(RHS)))
|
||||||
|
// We already know that LHS != LHS.
|
||||||
return ConstantInt::get(ITy, CmpInst::isFalseWhenEqual(Pred));
|
return ConstantInt::get(ITy, CmpInst::isFalseWhenEqual(Pred));
|
||||||
|
|
||||||
// If the comparison is with the result of a select instruction, check whether
|
// If the comparison is with the result of a select instruction, check whether
|
||||||
|
Loading…
Reference in New Issue
Block a user