Remove a condition which is always true.
authorChris Lattner <sabre@nondot.org>
Tue, 17 Mar 2009 17:55:15 +0000 (17:55 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 17 Mar 2009 17:55:15 +0000 (17:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67089 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 44d85e706c6d999615af438cd613120942b448ac..fa24d892176230d2038c6d9e936d425b42cf3123 100644 (file)
@@ -7533,7 +7533,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
     if (isa<ConstantInt>(NumElements))
       Amt = Multiply(cast<ConstantInt>(NumElements), cast<ConstantInt>(Amt));
     // otherwise multiply the amount and the number of elements
-    else if (Scale != 1) {
+    else {
       Instruction *Tmp = BinaryOperator::CreateMul(Amt, NumElements, "tmp");
       Amt = InsertNewInstBefore(Tmp, AI);
     }
@@ -10979,8 +10979,8 @@ Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) {
 
   if (isa<AllocaInst>(AI) && AI.getAllocatedType()->isSized()) {
     // If alloca'ing a zero byte object, replace the alloca with a null pointer.
-    // Note that we only do this for alloca's, because malloc should allocate and
-    // return a unique pointer, even for a zero byte allocation.
+    // Note that we only do this for alloca's, because malloc should allocate
+    // and return a unique pointer, even for a zero byte allocation.
     if (TD->getTypePaddedSize(AI.getAllocatedType()) == 0)
       return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));