[AArch64][NFC] NFC for const vector as Instruction operand (#116790)
[llvm-project.git] / llvm / test / Transforms / InstCombine / apint-mul1.ll
blob7327630c5d0a03fdb4146c08e4e5648d3b208dfc
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
4 ; This test makes sure that mul instructions are properly eliminated.
5 ; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.
7 define i17 @test1(i17 %X) {
8 ; CHECK-LABEL: @test1(
9 ; CHECK-NEXT:    [[Y:%.*]] = shl i17 [[X:%.*]], 10
10 ; CHECK-NEXT:    ret i17 [[Y]]
12   %Y = mul i17 %X, 1024
13   ret i17 %Y
16 define <2 x i17> @test2(<2 x i17> %X) {
17 ; CHECK-LABEL: @test2(
18 ; CHECK-NEXT:    [[Y:%.*]] = shl <2 x i17> [[X:%.*]], splat (i17 10)
19 ; CHECK-NEXT:    ret <2 x i17> [[Y]]
21   %Y = mul <2 x i17> %X, <i17 1024, i17 1024>
22   ret <2 x i17> %Y
25 define <2 x i17> @test3(<2 x i17> %X) {
26 ; CHECK-LABEL: @test3(
27 ; CHECK-NEXT:    [[Y:%.*]] = shl <2 x i17> [[X:%.*]], <i17 10, i17 8>
28 ; CHECK-NEXT:    ret <2 x i17> [[Y]]
30   %Y = mul <2 x i17> %X, <i17 1024, i17 256>
31   ret <2 x i17> %Y