diff options
-rw-r--r-- | llvm/test/Transforms/InstCombine/apint-mul1.ll | 33 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/apint-mul2.ll | 37 |
2 files changed, 57 insertions, 13 deletions
diff --git a/llvm/test/Transforms/InstCombine/apint-mul1.ll b/llvm/test/Transforms/InstCombine/apint-mul1.ll index 6a5b3e7f03c..cd23ff5a865 100644 --- a/llvm/test/Transforms/InstCombine/apint-mul1.ll +++ b/llvm/test/Transforms/InstCombine/apint-mul1.ll @@ -1,11 +1,32 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -instcombine -S | FileCheck %s + ; This test makes sure that mul instructions are properly eliminated. ; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0. -; -; RUN: opt < %s -instcombine -S | not grep mul +define i17 @test1(i17 %X) { +; CHECK-LABEL: @test1( +; CHECK-NEXT: [[Y:%.*]] = shl i17 [[X:%.*]], 10 +; CHECK-NEXT: ret i17 [[Y]] +; + %Y = mul i17 %X, 1024 + ret i17 %Y +} +define <2 x i17> @test2(<2 x i17> %X) { +; CHECK-LABEL: @test2( +; CHECK-NEXT: [[Y:%.*]] = shl <2 x i17> [[X:%.*]], <i17 10, i17 10> +; CHECK-NEXT: ret <2 x i17> [[Y]] +; + %Y = mul <2 x i17> %X, <i17 1024, i17 1024> + ret <2 x i17> %Y +} -define i17 @test1(i17 %X) { - %Y = mul i17 %X, 1024 - ret i17 %Y -} +define <2 x i17> @test3(<2 x i17> %X) { +; CHECK-LABEL: @test3( +; CHECK-NEXT: [[Y:%.*]] = mul <2 x i17> [[X:%.*]], <i17 1024, i17 256> +; CHECK-NEXT: ret <2 x i17> [[Y]] +; + %Y = mul <2 x i17> %X, <i17 1024, i17 256> + ret <2 x i17> %Y +} diff --git a/llvm/test/Transforms/InstCombine/apint-mul2.ll b/llvm/test/Transforms/InstCombine/apint-mul2.ll index 558d2fb63c1..d961a645dac 100644 --- a/llvm/test/Transforms/InstCombine/apint-mul2.ll +++ b/llvm/test/Transforms/InstCombine/apint-mul2.ll @@ -1,12 +1,35 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -instcombine -S | FileCheck %s + ; This test makes sure that mul instructions are properly eliminated. ; This test is for Integer BitWidth >= 64 && BitWidth % 2 >= 1024. -; -; RUN: opt < %s -instcombine -S | not grep mul +define i177 @test1(i177 %X) { +; CHECK-LABEL: @test1( +; CHECK-NEXT: [[Y:%.*]] = shl i177 [[X:%.*]], 155 +; CHECK-NEXT: ret i177 [[Y]] +; + %C = shl i177 1, 155 + %Y = mul i177 %X, %C + ret i177 %Y +} +define <2 x i177> @test2(<2 x i177> %X) { +; CHECK-LABEL: @test2( +; CHECK-NEXT: [[Y:%.*]] = shl <2 x i177> [[X:%.*]], <i177 155, i177 155> +; CHECK-NEXT: ret <2 x i177> [[Y]] +; + %C = shl <2 x i177> <i177 1, i177 1>, <i177 155, i177 155> + %Y = mul <2 x i177> %X, %C + ret <2 x i177> %Y +} -define i177 @test1(i177 %X) { - %C = shl i177 1, 155 - %Y = mul i177 %X, %C - ret i177 %Y -} +define <2 x i177> @test3(<2 x i177> %X) { +; CHECK-LABEL: @test3( +; CHECK-NEXT: [[Y:%.*]] = mul <2 x i177> [[X:%.*]], <i177 1427247692705959881058285969449495136382746624, i177 45671926166590716193865151022383844364247891968> +; CHECK-NEXT: ret <2 x i177> [[Y]] +; + %C = shl <2 x i177> <i177 1, i177 1>, <i177 150, i177 155> + %Y = mul <2 x i177> %X, %C + ret <2 x i177> %Y +} |