1 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 define i32 @test1(i32 %X, i8 %A) {
5 %shift.upgrd.1 = zext i8 %A to i32 ; <i32> [#uses=1]
6 ; can be logical shift.
7 %Y = ashr i32 %X, %shift.upgrd.1 ; <i32> [#uses=1]
8 %Z = and i32 %Y, 1 ; <i32> [#uses=1]
11 ; CHECK: lshr i32 %X, %shift.upgrd.1
14 define i32 @test2(i8 %tmp) {
15 %tmp3 = zext i8 %tmp to i32 ; <i32> [#uses=1]
16 %tmp4 = add i32 %tmp3, 7 ; <i32> [#uses=1]
17 %tmp5 = ashr i32 %tmp4, 3 ; <i32> [#uses=1]
20 ; CHECK: lshr i32 %tmp4, 3