diff options
author | Dan Gohman <dan433584@gmail.com> | 2013-01-31 23:49:33 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2013-01-31 23:49:33 +0000 |
commit | 995d40e1e29c85dbe301ab9fc44de1f2c0c52d72 (patch) | |
tree | cafddfabd895f28daf383bd7171d6e474b6b63ad /llvm/lib/Analysis/InstructionSimplify.cpp | |
parent | e5d8d0d64b6cc85e8aaa750cb68e90e672937517 (diff) | |
download | bcm5719-llvm-995d40e1e29c85dbe301ab9fc44de1f2c0c52d72.tar.gz bcm5719-llvm-995d40e1e29c85dbe301ab9fc44de1f2c0c52d72.zip |
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.
llvm-svn: 174119
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index d5e38e5c112..f8e76ca2207 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -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. |