1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -instcombine -S | FileCheck %s
3
4; This test makes sure that mul instructions are properly eliminated.
5; This test is for Integer BitWidth >= 64 && BitWidth % 2 >= 1024.
6
7define i177 @test1(i177 %X) {
8; CHECK-LABEL: @test1(
9; CHECK-NEXT:    [[Y:%.*]] = shl i177 [[X:%.*]], 155
10; CHECK-NEXT:    ret i177 [[Y]]
11;
12  %C = shl i177 1, 155
13  %Y = mul i177 %X, %C
14  ret i177 %Y
15}
16
17define <2 x i177> @test2(<2 x i177> %X) {
18; CHECK-LABEL: @test2(
19; CHECK-NEXT:    [[Y:%.*]] = shl <2 x i177> [[X:%.*]], <i177 155, i177 155>
20; CHECK-NEXT:    ret <2 x i177> [[Y]]
21;
22  %C = shl <2 x i177> <i177 1, i177 1>, <i177 155, i177 155>
23  %Y = mul <2 x i177> %X, %C
24  ret <2 x i177> %Y
25}
26
27define <2 x i177> @test3(<2 x i177> %X) {
28; CHECK-LABEL: @test3(
29; CHECK-NEXT:    [[Y:%.*]] = shl <2 x i177> [[X:%.*]], <i177 150, i177 155>
30; CHECK-NEXT:    ret <2 x i177> [[Y]]
31;
32  %C = shl <2 x i177> <i177 1, i177 1>, <i177 150, i177 155>
33  %Y = mul <2 x i177> %X, %C
34  ret <2 x i177> %Y
35}
36