mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
An alloca can be equal to an argument. It can't *alias* an alloca, but it could
be equal, since there's nothing preventing a caller from correctly predicting the stack location of an alloca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1828,18 +1828,6 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
|
||||
else if (Pred == CmpInst::ICMP_NE)
|
||||
return ConstantInt::get(ITy, true);
|
||||
}
|
||||
} else if (Argument *LHSArg = dyn_cast<Argument>(LHSPtr)) {
|
||||
RHSPtr = RHSPtr->stripInBoundsOffsets();
|
||||
// An alloca can't be equal to an argument unless they come from separate
|
||||
// functions via inlining.
|
||||
if (AllocaInst *RHSInst = dyn_cast<AllocaInst>(RHSPtr)) {
|
||||
if (LHSArg->getParent() == RHSInst->getParent()->getParent()) {
|
||||
if (Pred == CmpInst::ICMP_EQ)
|
||||
return ConstantInt::get(ITy, false);
|
||||
else if (Pred == CmpInst::ICMP_NE)
|
||||
return ConstantInt::get(ITy, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we are comparing with zero then try hard since this is a common case.
|
||||
|
||||
Reference in New Issue
Block a user