diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-09-27 21:42:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-09-27 21:42:46 +0000 |
| commit | b2e88cd01c63069479623149a5fc1f514b344dda (patch) | |
| tree | c941ffd6df7a83c4b409644bfc1f71968ad93b2f /llvm/lib/Transforms/Scalar/InstructionCombining.cpp | |
| parent | 1f71578e0d3d12748b8406921a8f285982ff3280 (diff) | |
| download | bcm5719-llvm-b2e88cd01c63069479623149a5fc1f514b344dda.tar.gz bcm5719-llvm-b2e88cd01c63069479623149a5fc1f514b344dda.zip | |
The bitcast case is not needed here: instcombine turns icmp(bitcast(x), null) -> icmp(x, null) already.
llvm-svn: 82935
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 7cd0572e72f..6826e132735 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -6289,19 +6289,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { !I.isTrueWhenEqual())); } break; - case Instruction::BitCast: - // If we have (malloc != null), and if the malloc has a single use, we - // can assume it is successful and remove the malloc. - CallInst* CI = extractMallocCallFromBitCast(LHSI); - if (CI && CI->hasOneUse() && LHSI->hasOneUse() - && isa<ConstantPointerNull>(RHSC)) { - Worklist.Add(LHSI); - Worklist.Add(CI); - return ReplaceInstUsesWith(I, - ConstantInt::get(Type::getInt1Ty(*Context), - !I.isTrueWhenEqual())); - } - break; } } @@ -9536,18 +9523,14 @@ static unsigned EnforceKnownAlignment(Value *V, Align = PrefAlign; } } - } else if (AllocationInst *AI = dyn_cast<AllocationInst>(V)) { - // If there is a requested alignment and if this is an alloca, round up. We - // don't do this for malloc, because some systems can't respect the request. - if (isa<AllocaInst>(AI)) { - if (AI->getAlignment() >= PrefAlign) - Align = AI->getAlignment(); - else { - AI->setAlignment(PrefAlign); - Align = PrefAlign; - } + } else if (AllocaInst *AI = dyn_cast<AllocaInst>(V)) { + // If there is a requested alignment and if this is an alloca, round up. + if (AI->getAlignment() >= PrefAlign) + Align = AI->getAlignment(); + else { + AI->setAlignment(PrefAlign); + Align = PrefAlign; } - // No alignment changes are possible for malloc calls } return Align; |

