@@ -61,6 +61,7 @@ define <2 x i16> @test_vec(<2 x i16> %x, <2 x i8> %y) {
61
61
;
62
62
; srl (or (x, shl(zext(y),c1)),c1) -> or(srl(x,c1), zext(y))
63
63
; c1 <= leadingzeros(zext(y))
64
+ ; x, y - vectors
64
65
;
65
66
; CHECK-LABEL: test_vec
66
67
; CHECK: ld.param.u32 %[[X:r[0-9]+]], [test_vec_param_0];
@@ -99,3 +100,28 @@ define i64 @test_negative_c(i64 %x, i32 %y) {
99
100
%srl = lshr i64 %or , 33
100
101
ret i64 %srl
101
102
}
103
+
104
+ declare void @use (i64 )
105
+
106
+ define i64 @test_negative_use_lop (i64 %x , i32 %y ) {
107
+ ;
108
+ ; srl (or (x, shl(zext(y),c1)),c1) -> or(srl(x,c1), zext(y))
109
+ ; c1 <= leadingzeros(zext(y))
110
+ ;
111
+ ;
112
+ ;
113
+ ; CHECK-LABEL: test_negative_use_lop
114
+ ; CHECK: ld.param.u64 %[[X:rd[0-9]+]], [test_negative_c_param_0];
115
+ ; CHECK: ld.param.u32 %[[Y:rd[0-9]+]], [test_negative_c_param_1];
116
+ ; CHECK: shl.b64 %[[SHL:rd[0-9]+]], %[[Y]], 33;
117
+ ; CHECK: or.b64 %[[OR:rd[0-9]+]], %[[X]], %[[SHL]];
118
+ ; CHECK: shr.u64 %[[SHR:rd[0-9]+]], %[[OR]], 33;
119
+ ; CHECK: st.param.b64 [func_retval0], %[[SHR]];
120
+ ;
121
+ %ext = zext i32 %y to i64
122
+ %shl = shl i64 %ext , 5
123
+ %or = or i64 %x , %shl
124
+ %srl = lshr i64 %or , 5
125
+ call void @use (i64 %or )
126
+ ret i64 %srl
127
+ }
0 commit comments