From: Chris Lattner Date: Sun, 27 Sep 2009 21:42:46 +0000 (+0000) Subject: The bitcast case is not needed here: instcombine turns icmp(bitcast(x), null) ->... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=42ebefae8ef5adc46ace9e892c6cef006d94320a;p=oota-llvm.git The bitcast case is not needed here: instcombine turns icmp(bitcast(x), null) -> icmp(x, null) already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82935 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 7cd0572e72f..6826e132735 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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(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(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(AI)) { - if (AI->getAlignment() >= PrefAlign) - Align = AI->getAlignment(); - else { - AI->setAlignment(PrefAlign); - Align = PrefAlign; - } + } else if (AllocaInst *AI = dyn_cast(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;