diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-06-24 10:47:52 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-06-24 10:47:52 +0000 |
| commit | c96a7f88b92c8c572a67edf87d4fea64caa5401a (patch) | |
| tree | 63f82b73c80913747add30e112dc86d4c6c49881 | |
| parent | 6de786666a77bcdf5acfe67bcd93cdcd819c4749 (diff) | |
| download | bcm5719-llvm-c96a7f88b92c8c572a67edf87d4fea64caa5401a.tar.gz bcm5719-llvm-c96a7f88b92c8c572a67edf87d4fea64caa5401a.zip | |
InstCombine: Disable umul.with.overflow recognition for vectors.
It doesn't make a lot on most targets and the code isn't ready for it. PR20113.
llvm-svn: 211583
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 6 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/overflow-mul.ll | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 639d8319e0d..f204eeb548c 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2042,9 +2042,13 @@ static Instruction *ProcessUAddIdiom(Instruction &I, Value *OrigAddV, /// replacement required. static Instruction *ProcessUMulZExtIdiom(ICmpInst &I, Value *MulVal, Value *OtherVal, InstCombiner &IC) { + // Don't bother doing this transformation for pointers, don't do it for + // vectors. + if (!isa<IntegerType>(MulVal->getType())) + return nullptr; + assert(I.getOperand(0) == MulVal || I.getOperand(1) == MulVal); assert(I.getOperand(0) == OtherVal || I.getOperand(1) == OtherVal); - assert(isa<IntegerType>(MulVal->getType())); Instruction *MulInstr = cast<Instruction>(MulVal); assert(MulInstr->getOpcode() == Instruction::Mul); diff --git a/llvm/test/Transforms/InstCombine/overflow-mul.ll b/llvm/test/Transforms/InstCombine/overflow-mul.ll index 04019ae7bc1..cbb2f5f9500 100644 --- a/llvm/test/Transforms/InstCombine/overflow-mul.ll +++ b/llvm/test/Transforms/InstCombine/overflow-mul.ll @@ -162,3 +162,14 @@ entry: ret i32 %retval } +define <4 x i32> @pr20113(<4 x i16> %a, <4 x i16> %b) { +; CHECK-LABEL: @pr20113 +; CHECK-NOT: mul.with.overflow +; CHECK: ret + %vmovl.i.i726 = zext <4 x i16> %a to <4 x i32> + %vmovl.i.i712 = zext <4 x i16> %b to <4 x i32> + %mul.i703 = mul <4 x i32> %vmovl.i.i712, %vmovl.i.i726 + %tmp = icmp sge <4 x i32> %mul.i703, zeroinitializer + %vcgez.i = sext <4 x i1> %tmp to <4 x i32> + ret <4 x i32> %vcgez.i +} |

