1 ; RUN: opt -S -disable-output -passes="print<demanded-bits>" < %s 2>&1 | FileCheck %s
3 define i8 @test_shl_const_amount_4(i32 %a) {
4 ; CHECK-LABEL: 'test_shl_const_amount_4'
5 ; CHECK-DAG: DemandedBits: 0xff for %shl = shl i32 %a, 4
6 ; CHECK-DAG: DemandedBits: 0xf for %a in %shl = shl i32 %a, 4
7 ; CHECK-DAG: DemandedBits: 0xffffffff for 4 in %shl = shl i32 %a, 4
8 ; CHECK-DAG: DemandedBits: 0xff for %shl.t = trunc i32 %shl to i8
9 ; CHECK-DAG: DemandedBits: 0xff for %shl in %shl.t = trunc i32 %shl to i8
12 %shl.t = trunc i32 %shl to i8
16 define i8 @test_shl_const_amount_5(i32 %a) {
17 ; CHECK-LABEL: 'test_shl_const_amount_5'
18 ; CHECK-DAG: DemandedBits: 0xff for %shl = shl i32 %a, 5
19 ; CHECK-DAG: DemandedBits: 0x7 for %a in %shl = shl i32 %a, 5
20 ; CHECK-DAG: DemandedBits: 0xffffffff for 5 in %shl = shl i32 %a, 5
21 ; CHECK-DAG: DemandedBits: 0xff for %shl.t = trunc i32 %shl to i8
22 ; CHECK-DAG: DemandedBits: 0xff for %shl in %shl.t = trunc i32 %shl to i8
25 %shl.t = trunc i32 %shl to i8
29 define i8 @test_shl_const_amount_8(i32 %a) {
30 ; CHECK-LABEL: 'test_shl_const_amount_8'
31 ; CHECK-DAG: DemandedBits: 0xff for %shl.t = trunc i32 %shl to i8
32 ; CHECK-DAG: DemandedBits: 0xff for %shl in %shl.t = trunc i32 %shl to i8
33 ; CHECK-DAG: DemandedBits: 0xff for %shl = shl i32 %a, 8
34 ; CHECK-DAG: DemandedBits: 0x0 for %a in %shl = shl i32 %a, 8
35 ; CHECK-DAG: DemandedBits: 0xffffffff for 8 in %shl = shl i32 %a, 8
38 %shl.t = trunc i32 %shl to i8
42 define i8 @test_shl_const_amount_9(i32 %a) {
43 ; CHECK-LABEL: 'test_shl_const_amount_9'
44 ; CHECK-DAG: DemandedBits: 0xff for %shl = shl i32 %a, 9
45 ; CHECK-DAG: DemandedBits: 0x0 for %a in %shl = shl i32 %a, 9
46 ; CHECK-DAG: DemandedBits: 0xffffffff for 9 in %shl = shl i32 %a, 9
47 ; CHECK-DAG: DemandedBits: 0xff for %shl.t = trunc i32 %shl to i8
48 ; CHECK-DAG: DemandedBits: 0xff for %shl in %shl.t = trunc i32 %shl to i8
51 %shl.t = trunc i32 %shl to i8
55 define i8 @test_shl(i32 %a, i32 %b) {
56 ; CHECK-LABEL: 'test_shl'
57 ; CHECK-DAG: DemandedBits: 0xff for %shl.t = trunc i32 %shl to i8
58 ; CHECK-DAG: DemandedBits: 0xff for %shl in %shl.t = trunc i32 %shl to i8
59 ; CHECK-DAG: DemandedBits: 0xff for %shl = shl i32 %a, %b
60 ; CHECK-DAG: DemandedBits: 0xffffffff for %a in %shl = shl i32 %a, %b
61 ; CHECK-DAG: DemandedBits: 0xffffffff for %b in %shl = shl i32 %a, %b
64 %shl.t = trunc i32 %shl to i8