@@ -2062,9 +2062,8 @@ define i16 @lshr_shl_pow2_const_xor(i16 %x) {
20622062
20632063define i16 @lshr_shl_pow2_const_case2 (i16 %x ) {
20642064; CHECK-LABEL: @lshr_shl_pow2_const_case2(
2065- ; CHECK-NEXT: [[LSHR1:%.*]] = lshr i16 8192, [[X:%.*]]
2066- ; CHECK-NEXT: [[SHL:%.*]] = shl i16 [[LSHR1]], 4
2067- ; CHECK-NEXT: [[R:%.*]] = and i16 [[SHL]], 32
2065+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i16 [[X:%.*]], 12
2066+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[TMP1]], i16 32, i16 0
20682067; CHECK-NEXT: ret i16 [[R]]
20692068;
20702069 %lshr1 = lshr i16 8192 , %x
@@ -2102,9 +2101,8 @@ define i16 @lshr_shl_pow2_const_negative_oneuse(i16 %x) {
21022101
21032102define <3 x i16 > @lshr_shl_pow2_const_case1_uniform_vec (<3 x i16 > %x ) {
21042103; CHECK-LABEL: @lshr_shl_pow2_const_case1_uniform_vec(
2105- ; CHECK-NEXT: [[LSHR:%.*]] = lshr <3 x i16> <i16 8192, i16 8192, i16 8192>, [[X:%.*]]
2106- ; CHECK-NEXT: [[SHL:%.*]] = shl <3 x i16> [[LSHR]], <i16 6, i16 6, i16 6>
2107- ; CHECK-NEXT: [[R:%.*]] = and <3 x i16> [[SHL]], <i16 128, i16 128, i16 128>
2104+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp eq <3 x i16> [[X:%.*]], <i16 12, i16 12, i16 12>
2105+ ; CHECK-NEXT: [[R:%.*]] = select <3 x i1> [[TMP1]], <3 x i16> <i16 128, i16 128, i16 128>, <3 x i16> zeroinitializer
21082106; CHECK-NEXT: ret <3 x i16> [[R]]
21092107;
21102108 %lshr = lshr <3 x i16 > <i16 8192 , i16 8192 , i16 8192 >, %x
@@ -2141,9 +2139,8 @@ define <3 x i16> @lshr_shl_pow2_const_case1_non_uniform_vec_negative(<3 x i16> %
21412139
21422140define <3 x i16 > @lshr_shl_pow2_const_case1_undef1_vec (<3 x i16 > %x ) {
21432141; CHECK-LABEL: @lshr_shl_pow2_const_case1_undef1_vec(
2144- ; CHECK-NEXT: [[LSHR:%.*]] = lshr <3 x i16> <i16 undef, i16 8192, i16 8192>, [[X:%.*]]
2145- ; CHECK-NEXT: [[SHL:%.*]] = shl <3 x i16> [[LSHR]], <i16 6, i16 6, i16 6>
2146- ; CHECK-NEXT: [[R:%.*]] = and <3 x i16> [[SHL]], <i16 128, i16 128, i16 128>
2142+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp eq <3 x i16> [[X:%.*]], <i16 -1, i16 12, i16 12>
2143+ ; CHECK-NEXT: [[R:%.*]] = select <3 x i1> [[TMP1]], <3 x i16> <i16 128, i16 128, i16 128>, <3 x i16> zeroinitializer
21472144; CHECK-NEXT: ret <3 x i16> [[R]]
21482145;
21492146 %lshr = lshr <3 x i16 > <i16 undef , i16 8192 , i16 8192 >, %x
@@ -2154,9 +2151,8 @@ define <3 x i16> @lshr_shl_pow2_const_case1_undef1_vec(<3 x i16> %x) {
21542151
21552152define <3 x i16 > @lshr_shl_pow2_const_case1_undef2_vec (<3 x i16 > %x ) {
21562153; CHECK-LABEL: @lshr_shl_pow2_const_case1_undef2_vec(
2157- ; CHECK-NEXT: [[LSHR:%.*]] = lshr <3 x i16> <i16 8192, i16 8192, i16 8192>, [[X:%.*]]
2158- ; CHECK-NEXT: [[SHL:%.*]] = shl <3 x i16> [[LSHR]], <i16 undef, i16 6, i16 6>
2159- ; CHECK-NEXT: [[R:%.*]] = and <3 x i16> [[SHL]], <i16 128, i16 128, i16 128>
2154+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp eq <3 x i16> [[X:%.*]], <i16 undef, i16 12, i16 12>
2155+ ; CHECK-NEXT: [[R:%.*]] = select <3 x i1> [[TMP1]], <3 x i16> <i16 128, i16 128, i16 128>, <3 x i16> zeroinitializer
21602156; CHECK-NEXT: ret <3 x i16> [[R]]
21612157;
21622158 %lshr = lshr <3 x i16 > <i16 8192 , i16 8192 , i16 8192 >, %x
0 commit comments