[llvm-commits] [llvm] r75586 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/mul.ll
Eli Friedman
eli.friedman at gmail.com
Mon Jul 13 19:01:53 PDT 2009
Author: efriedma
Date: Mon Jul 13 21:01:53 2009
New Revision: 75586
URL: http://llvm.org/viewvc/llvm-project?rev=75586&view=rev
Log:
Fix trivial todo in instcombine.
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
llvm/trunk/test/Transforms/InstCombine/mul.ll
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=75586&r1=75585&r2=75586&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jul 13 21:01:53 2009
@@ -2702,7 +2702,8 @@
Context->getConstantInt(Op0->getType(), Val.logBase2()));
}
} else if (isa<VectorType>(Op1->getType())) {
- // TODO: If Op1 is all zeros and Op0 is all finite, return all zeros.
+ if (Op1->isNullValue())
+ return ReplaceInstUsesWith(I, Op1);
if (ConstantVector *Op1V = dyn_cast<ConstantVector>(Op1)) {
if (Op1V->isAllOnesValue()) // X * -1 == 0 - X
Modified: llvm/trunk/test/Transforms/InstCombine/mul.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/mul.ll?rev=75586&r1=75585&r2=75586&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/mul.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/mul.ll Mon Jul 13 21:01:53 2009
@@ -83,3 +83,8 @@
store <4 x float> %3, <4 x float>* %0, align 1
ret void
}
+
+define <16 x i8> @test14(<16 x i8> %a) {
+ %b = mul <16 x i8> %a, zeroinitializer
+ ret <16 x i8> %b
+}
More information about the llvm-commits
mailing list