llvm.org GIT mirror llvm / d439a66
[InstSimplify] allow icmp with constant folds for splat vectors, part 2 Completes the m_APInt changes for simplifyICmpWithConstant(). Other commits in this series: https://reviews.llvm.org/rL279492 https://reviews.llvm.org/rL279530 https://reviews.llvm.org/rL279534 https://reviews.llvm.org/rL279538 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279543 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 3 years ago
2 changed file(s) with 100 addition(s) and 146 deletion(s). Raw diff Collapse all Expand all
21642164 if (RHS_CR.isFullSet())
21652165 return ConstantInt::getTrue(GetCompareTy(RHS));
21662166
2167 // FIXME: Use m_APInt below here to allow splat vector folds.
2168 ConstantInt *CI = dyn_cast(RHS);
2169 if (!CI)
2170 return nullptr;
2171
21722167 // Many binary operators with constant RHS have easy to compute constant
21732168 // range. Use them to check whether the comparison is a tautology.
2174 unsigned Width = CI->getBitWidth();
2169 unsigned Width = C->getBitWidth();
21752170 APInt Lower = APInt(Width, 0);
21762171 APInt Upper = APInt(Width, 0);
2177 ConstantInt *CI2;
2178 if (match(LHS, m_URem(m_Value(), m_ConstantInt(CI2)))) {
2179 // 'urem x, CI2' produces [0, CI2).
2180 Upper = CI2->getValue();
2181 } else if (match(LHS, m_SRem(m_Value(), m_ConstantInt(CI2)))) {
2182 // 'srem x, CI2' produces (-|CI2|, |CI2|).
2183 Upper = CI2->getValue().abs();
2172 const APInt *C2;
2173 if (match(LHS, m_URem(m_Value(), m_APInt(C2)))) {
2174 // 'urem x, C2' produces [0, C2).
2175 Upper = *C2;
2176 } else if (match(LHS, m_SRem(m_Value(), m_APInt(C2)))) {
2177 // 'srem x, C2' produces (-|C2|, |C2|).
2178 Upper = C2->abs();
21842179 Lower = (-Upper) + 1;
2185 } else if (match(LHS, m_UDiv(m_ConstantInt(CI2), m_Value()))) {
2186 // 'udiv CI2, x' produces [0, CI2].
2187 Upper = CI2->getValue() + 1;
2188 } else if (match(LHS, m_UDiv(m_Value(), m_ConstantInt(CI2)))) {
2189 // 'udiv x, CI2' produces [0, UINT_MAX / CI2].
2180 } else if (match(LHS, m_UDiv(m_APInt(C2), m_Value()))) {
2181 // 'udiv C2, x' produces [0, C2].
2182 Upper = *C2 + 1;
2183 } else if (match(LHS, m_UDiv(m_Value(), m_APInt(C2)))) {
2184 // 'udiv x, C2' produces [0, UINT_MAX / C2].
21902185 APInt NegOne = APInt::getAllOnesValue(Width);
2191 if (!CI2->isZero())
2192 Upper = NegOne.udiv(CI2->getValue()) + 1;
2193 } else if (match(LHS, m_SDiv(m_ConstantInt(CI2), m_Value()))) {
2194 if (CI2->isMinSignedValue()) {
2186 if (*C2 != 0)
2187 Upper = NegOne.udiv(*C2) + 1;
2188 } else if (match(LHS, m_SDiv(m_APInt(C2), m_Value()))) {
2189 if (C2->isMinSignedValue()) {
21952190 // 'sdiv INT_MIN, x' produces [INT_MIN, INT_MIN / -2].
2196 Lower = CI2->getValue();
2191 Lower = *C2;
21972192 Upper = Lower.lshr(1) + 1;
21982193 } else {
2199 // 'sdiv CI2, x' produces [-|CI2|, |CI2|].
2200 Upper = CI2->getValue().abs() + 1;
2194 // 'sdiv C2, x' produces [-|C2|, |C2|].
2195 Upper = C2->abs() + 1;
22012196 Lower = (-Upper) + 1;
22022197 }
2203 } else if (match(LHS, m_SDiv(m_Value(), m_ConstantInt(CI2)))) {
2198 } else if (match(LHS, m_SDiv(m_Value(), m_APInt(C2)))) {
22042199 APInt IntMin = APInt::getSignedMinValue(Width);
22052200 APInt IntMax = APInt::getSignedMaxValue(Width);
2206 const APInt &Val = CI2->getValue();
2207 if (Val.isAllOnesValue()) {
2201 if (C2->isAllOnesValue()) {
22082202 // 'sdiv x, -1' produces [INT_MIN + 1, INT_MAX]
2209 // where CI2 != -1 and CI2 != 0 and CI2 != 1
2203 // where C2 != -1 and C2 != 0 and C2 != 1
22102204 Lower = IntMin + 1;
22112205 Upper = IntMax + 1;
2212 } else if (Val.countLeadingZeros() < Width - 1) {
2213 // 'sdiv x, CI2' produces [INT_MIN / CI2, INT_MAX / CI2]
2214 // where CI2 != -1 and CI2 != 0 and CI2 != 1
2215 Lower = IntMin.sdiv(Val);
2216 Upper = IntMax.sdiv(Val);
2206 } else if (C2->countLeadingZeros() < Width - 1) {
2207 // 'sdiv x, C2' produces [INT_MIN / C2, INT_MAX / C2]
2208 // where C2 != -1 and C2 != 0 and C2 != 1
2209 Lower = IntMin.sdiv(*C2);
2210 Upper = IntMax.sdiv(*C2);
22172211 if (Lower.sgt(Upper))
22182212 std::swap(Lower, Upper);
22192213 Upper = Upper + 1;
22202214 assert(Upper != Lower && "Upper part of range has wrapped!");
22212215 }
2222 } else if (match(LHS, m_NUWShl(m_ConstantInt(CI2), m_Value()))) {
2223 // 'shl nuw CI2, x' produces [CI2, CI2 << CLZ(CI2)]
2224 Lower = CI2->getValue();
2216 } else if (match(LHS, m_NUWShl(m_APInt(C2), m_Value()))) {
2217 // 'shl nuw C2, x' produces [C2, C2 << CLZ(C2)]
2218 Lower = *C2;
22252219 Upper = Lower.shl(Lower.countLeadingZeros()) + 1;
2226 } else if (match(LHS, m_NSWShl(m_ConstantInt(CI2), m_Value()))) {
2227 if (CI2->isNegative()) {
2228 // 'shl nsw CI2, x' produces [CI2 << CLO(CI2)-1, CI2]
2229 unsigned ShiftAmount = CI2->getValue().countLeadingOnes() - 1;
2230 Lower = CI2->getValue().shl(ShiftAmount);
2231 Upper = CI2->getValue() + 1;
2220 } else if (match(LHS, m_NSWShl(m_APInt(C2), m_Value()))) {
2221 if (C2->isNegative()) {
2222 // 'shl nsw C2, x' produces [C2 << CLO(C2)-1, C2]
2223 unsigned ShiftAmount = C2->countLeadingOnes() - 1;
2224 Lower = C2->shl(ShiftAmount);
2225 Upper = *C2 + 1;
22322226 } else {
2233 // 'shl nsw CI2, x' produces [CI2, CI2 << CLZ(CI2)-1]
2234 unsigned ShiftAmount = CI2->getValue().countLeadingZeros() - 1;
2235 Lower = CI2->getValue();
2236 Upper = CI2->getValue().shl(ShiftAmount) + 1;
2237 }
2238 } else if (match(LHS, m_LShr(m_Value(), m_ConstantInt(CI2)))) {
2239 // 'lshr x, CI2' produces [0, UINT_MAX >> CI2].
2227 // 'shl nsw C2, x' produces [C2, C2 << CLZ(C2)-1]
2228 unsigned ShiftAmount = C2->countLeadingZeros() - 1;
2229 Lower = *C2;
2230 Upper = C2->shl(ShiftAmount) + 1;
2231 }
2232 } else if (match(LHS, m_LShr(m_Value(), m_APInt(C2)))) {
2233 // 'lshr x, C2' produces [0, UINT_MAX >> C2].
22402234 APInt NegOne = APInt::getAllOnesValue(Width);
2241 if (CI2->getValue().ult(Width))
2242 Upper = NegOne.lshr(CI2->getValue()) + 1;
2243 } else if (match(LHS, m_LShr(m_ConstantInt(CI2), m_Value()))) {
2244 // 'lshr CI2, x' produces [CI2 >> (Width-1), CI2].
2235 if (C2->ult(Width))
2236 Upper = NegOne.lshr(*C2) + 1;
2237 } else if (match(LHS, m_LShr(m_APInt(C2), m_Value()))) {
2238 // 'lshr C2, x' produces [C2 >> (Width-1), C2].
22452239 unsigned ShiftAmount = Width - 1;
2246 if (!CI2->isZero() && cast(LHS)->isExact())
2247 ShiftAmount = CI2->getValue().countTrailingZeros();
2248 Lower = CI2->getValue().lshr(ShiftAmount);
2249 Upper = CI2->getValue() + 1;
2250 } else if (match(LHS, m_AShr(m_Value(), m_ConstantInt(CI2)))) {
2251 // 'ashr x, CI2' produces [INT_MIN >> CI2, INT_MAX >> CI2].
2240 if (*C2 != 0 && cast(LHS)->isExact())
2241 ShiftAmount = C2->countTrailingZeros();
2242 Lower = C2->lshr(ShiftAmount);
2243 Upper = *C2 + 1;
2244 } else if (match(LHS, m_AShr(m_Value(), m_APInt(C2)))) {
2245 // 'ashr x, C2' produces [INT_MIN >> C2, INT_MAX >> C2].
22522246 APInt IntMin = APInt::getSignedMinValue(Width);
22532247 APInt IntMax = APInt::getSignedMaxValue(Width);
2254 if (CI2->getValue().ult(Width)) {
2255 Lower = IntMin.ashr(CI2->getValue());
2256 Upper = IntMax.ashr(CI2->getValue()) + 1;
2257 }
2258 } else if (match(LHS, m_AShr(m_ConstantInt(CI2), m_Value()))) {
2248 if (C2->ult(Width)) {
2249 Lower = IntMin.ashr(*C2);
2250 Upper = IntMax.ashr(*C2) + 1;
2251 }
2252 } else if (match(LHS, m_AShr(m_APInt(C2), m_Value()))) {
22592253 unsigned ShiftAmount = Width - 1;
2260 if (!CI2->isZero() && cast(LHS)->isExact())
2261 ShiftAmount = CI2->getValue().countTrailingZeros();
2262 if (CI2->isNegative()) {
2263 // 'ashr CI2, x' produces [CI2, CI2 >> (Width-1)]
2264 Lower = CI2->getValue();
2265 Upper = CI2->getValue().ashr(ShiftAmount) + 1;
2254 if (*C2 != 0 && cast(LHS)->isExact())
2255 ShiftAmount = C2->countTrailingZeros();
2256 if (C2->isNegative()) {
2257 // 'ashr C2, x' produces [C2, C2 >> (Width-1)]
2258 Lower = *C2;
2259 Upper = C2->ashr(ShiftAmount) + 1;
22662260 } else {
2267 // 'ashr CI2, x' produces [CI2 >> (Width-1), CI2]
2268 Lower = CI2->getValue().ashr(ShiftAmount);
2269 Upper = CI2->getValue() + 1;
2270 }
2271 } else if (match(LHS, m_Or(m_Value(), m_ConstantInt(CI2)))) {
2272 // 'or x, CI2' produces [CI2, UINT_MAX].
2273 Lower = CI2->getValue();
2274 } else if (match(LHS, m_And(m_Value(), m_ConstantInt(CI2)))) {
2275 // 'and x, CI2' produces [0, CI2].
2276 Upper = CI2->getValue() + 1;
2277 } else if (match(LHS, m_NUWAdd(m_Value(), m_ConstantInt(CI2)))) {
2278 // 'add nuw x, CI2' produces [CI2, UINT_MAX].
2279 Lower = CI2->getValue();
2261 // 'ashr C2, x' produces [C2 >> (Width-1), C2]
2262 Lower = C2->ashr(ShiftAmount);
2263 Upper = *C2 + 1;
2264 }
2265 } else if (match(LHS, m_Or(m_Value(), m_APInt(C2)))) {
2266 // 'or x, C2' produces [C2, UINT_MAX].
2267 Lower = *C2;
2268 } else if (match(LHS, m_And(m_Value(), m_APInt(C2)))) {
2269 // 'and x, C2' produces [0, C2].
2270 Upper = *C2 + 1;
2271 } else if (match(LHS, m_NUWAdd(m_Value(), m_APInt(C2)))) {
2272 // 'add nuw x, C2' produces [C2, UINT_MAX].
2273 Lower = *C2;
22802274 }
22812275
22822276 ConstantRange LHS_CR =
22882282
22892283 if (!LHS_CR.isFullSet()) {
22902284 if (RHS_CR.contains(LHS_CR))
2291 return ConstantInt::getTrue(RHS->getContext());
2285 return ConstantInt::getTrue(GetCompareTy(RHS));
22922286 if (RHS_CR.inverse().contains(LHS_CR))
2293 return ConstantInt::getFalse(RHS->getContext());
2287 return ConstantInt::getFalse(GetCompareTy(RHS));
22942288 }
22952289
22962290 return nullptr;
4646
4747 define <2 x i1> @urem3_vec(<2 x i32> %X) {
4848 ; CHECK-LABEL: @urem3_vec(
49 ; CHECK-NEXT: [[A:%.*]] = urem <2 x i32> %X,
50 ; CHECK-NEXT: [[B:%.*]] = icmp ult <2 x i32> [[A]],
51 ; CHECK-NEXT: ret <2 x i1> [[B]]
49 ; CHECK-NEXT: ret <2 x i1>
5250 ;
5351 %A = urem <2 x i32> %X,
5452 %B = icmp ult <2 x i32> %A,
6765
6866 define <2 x i1> @srem1_vec(<2 x i32> %X) {
6967 ; CHECK-LABEL: @srem1_vec(
70 ; CHECK-NEXT: [[A:%.*]] = srem <2 x i32> %X,
71 ; CHECK-NEXT: [[B:%.*]] = icmp sgt <2 x i32> [[A]],
72 ; CHECK-NEXT: ret <2 x i1> [[B]]
68 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
7369 ;
7470 %A = srem <2 x i32> %X,
7571 %B = icmp sgt <2 x i32> %A,
8884
8985 define <2 x i1> @udiv5_vec(<2 x i32> %X) {
9086 ; CHECK-LABEL: @udiv5_vec(
91 ; CHECK-NEXT: [[A:%.*]] = udiv <2 x i32> , %X
92 ; CHECK-NEXT: [[C:%.*]] = icmp ugt <2 x i32> [[A]],
93 ; CHECK-NEXT: ret <2 x i1> [[C]]
87 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
9488 ;
9589 %A = udiv <2 x i32> , %X
9690 %C = icmp ugt <2 x i32> %A,
109103
110104 define <2 x i1> @udiv1_vec(<2 x i32> %X) {
111105 ; CHECK-LABEL: @udiv1_vec(
112 ; CHECK-NEXT: [[A:%.*]] = udiv <2 x i32> %X,
113 ; CHECK-NEXT: [[B:%.*]] = icmp ult <2 x i32> [[A]],
114 ; CHECK-NEXT: ret <2 x i1> [[B]]
106 ; CHECK-NEXT: ret <2 x i1>
115107 ;
116108 %A = udiv <2 x i32> %X,
117109 %B = icmp ult <2 x i32> %A,
130122
131123 define <2 x i1> @compare_dividend_vec(<2 x i32> %a) {
132124 ; CHECK-LABEL: @compare_dividend_vec(
133 ; CHECK-NEXT: [[DIV:%.*]] = sdiv <2 x i32> , %a
134 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[DIV]],
135 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
125 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
136126 ;
137127 %div = sdiv <2 x i32> , %a
138128 %cmp = icmp eq <2 x i32> %div,
152142
153143 define <2 x i1> @sdiv1_vec(<2 x i32> %X) {
154144 ; CHECK-LABEL: @sdiv1_vec(
155 ; CHECK-NEXT: [[A:%.*]] = sdiv <2 x i32> %X,
156 ; CHECK-NEXT: [[B:%.*]] = icmp slt <2 x i32> [[A]],
157 ; CHECK-NEXT: ret <2 x i1> [[B]]
145 ; CHECK-NEXT: ret <2 x i1>
158146 ;
159147 %A = sdiv <2 x i32> %X,
160148 %B = icmp slt <2 x i32> %A,
173161
174162 define <2 x i1> @shl5_vec(<2 x i32> %X) {
175163 ; CHECK-LABEL: @shl5_vec(
176 ; CHECK-NEXT: [[SUB:%.*]] = shl nuw <2 x i32> , %X
177 ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i32> [[SUB]],
178 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
164 ; CHECK-NEXT: ret <2 x i1>
179165 ;
180166 %sub = shl nuw <2 x i32> , %X
181167 %cmp = icmp ugt <2 x i32> %sub,
194180
195181 define <2 x i1> @shl2_vec(<2 x i32> %X) {
196182 ; CHECK-LABEL: @shl2_vec(
197 ; CHECK-NEXT: [[SUB:%.*]] = shl nsw <2 x i32> , %X
198 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[SUB]],
199 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
183 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
200184 ;
201185 %sub = shl nsw <2 x i32> , %X
202186 %cmp = icmp eq <2 x i32> %sub,
215199
216200 define <2 x i1> @shl4_vec(<2 x i32> %X) {
217201 ; CHECK-LABEL: @shl4_vec(
218 ; CHECK-NEXT: [[SUB:%.*]] = shl nsw <2 x i32> , %X
219 ; CHECK-NEXT: [[CMP:%.*]] = icmp sle <2 x i32> [[SUB]],
220 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
202 ; CHECK-NEXT: ret <2 x i1>
221203 ;
222204 %sub = shl nsw <2 x i32> , %X
223205 %cmp = icmp sle <2 x i32> %sub,
236218
237219 define <2 x i1> @icmp_shl_nsw_1_vec(<2 x i64> %a) {
238220 ; CHECK-LABEL: @icmp_shl_nsw_1_vec(
239 ; CHECK-NEXT: [[SHL:%.*]] = shl nsw <2 x i64> , %a
240 ; CHECK-NEXT: [[CMP:%.*]] = icmp sge <2 x i64> [[SHL]], zeroinitializer
241 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
221 ; CHECK-NEXT: ret <2 x i1>
242222 ;
243223 %shl = shl nsw <2 x i64> , %a
244224 %cmp = icmp sge <2 x i64> %shl, zeroinitializer
257237
258238 define <2 x i1> @icmp_shl_nsw_neg1_vec(<2 x i64> %a) {
259239 ; CHECK-LABEL: @icmp_shl_nsw_neg1_vec(
260 ; CHECK-NEXT: [[SHL:%.*]] = shl nsw <2 x i64> , %a
261 ; CHECK-NEXT: [[CMP:%.*]] = icmp sge <2 x i64> [[SHL]],
262 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
240 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
263241 ;
264242 %shl = shl nsw <2 x i64> , %a
265243 %cmp = icmp sge <2 x i64> %shl,
278256
279257 define <2 x i1> @lshr2_vec(<2 x i32> %x) {
280258 ; CHECK-LABEL: @lshr2_vec(
281 ; CHECK-NEXT: [[S:%.*]] = lshr <2 x i32> %x,
282 ; CHECK-NEXT: [[C:%.*]] = icmp ugt <2 x i32> [[S]],
283 ; CHECK-NEXT: ret <2 x i1> [[C]]
259 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
284260 ;
285261 %s = lshr <2 x i32> %x,
286262 %c = icmp ugt <2 x i32> %s,
299275
300276 define <2 x i1> @exact_lshr_ugt_false_vec(<2 x i32> %a) {
301277 ; CHECK-LABEL: @exact_lshr_ugt_false_vec(
302 ; CHECK-NEXT: [[SHR:%.*]] = lshr exact <2 x i32> , %a
303 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[SHR]],
304 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
278 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
305279 ;
306280 %shr = lshr exact <2 x i32> , %a
307281 %cmp = icmp ult <2 x i32> %shr,
320294
321295 define <2 x i1> @lshr_sgt_false_vec(<2 x i32> %a) {
322296 ; CHECK-LABEL: @lshr_sgt_false_vec(
323 ; CHECK-NEXT: [[SHR:%.*]] = lshr <2 x i32> , %a
324 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i32> [[SHR]],
325 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
297 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
326298 ;
327299 %shr = lshr <2 x i32> , %a
328300 %cmp = icmp sgt <2 x i32> %shr,
341313
342314 define <2 x i1> @ashr2_vec(<2 x i32> %x) {
343315 ; CHECK-LABEL: @ashr2_vec(
344 ; CHECK-NEXT: [[S:%.*]] = ashr <2 x i32> %x,
345 ; CHECK-NEXT: [[C:%.*]] = icmp slt <2 x i32> [[S]],
346 ; CHECK-NEXT: ret <2 x i1> [[C]]
316 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
347317 ;
348318 %s = ashr <2 x i32> %x,
349319 %c = icmp slt <2 x i32> %s,
362332
363333 define <2 x i1> @ashr_sgt_false_vec(<2 x i32> %a) {
364334 ; CHECK-LABEL: @ashr_sgt_false_vec(
365 ; CHECK-NEXT: [[SHR:%.*]] = ashr <2 x i32> , %a
366 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i32> [[SHR]],
367 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
335 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
368336 ;
369337 %shr = ashr <2 x i32> , %a
370338 %cmp = icmp sgt <2 x i32> %shr,
383351
384352 define <2 x i1> @exact_ashr_sgt_false_vec(<2 x i32> %a) {
385353 ; CHECK-LABEL: @exact_ashr_sgt_false_vec(
386 ; CHECK-NEXT: [[SHR:%.*]] = ashr exact <2 x i32> , %a
387 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i32> [[SHR]],
388 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
354 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
389355 ;
390356 %shr = ashr exact <2 x i32> , %a
391357 %cmp = icmp sgt <2 x i32> %shr,
404370
405371 define <2 x i1> @or1_vec(<2 x i32> %X) {
406372 ; CHECK-LABEL: @or1_vec(
407 ; CHECK-NEXT: [[A:%.*]] = or <2 x i32> %X,
408 ; CHECK-NEXT: [[B:%.*]] = icmp ult <2 x i32> [[A]],
409 ; CHECK-NEXT: ret <2 x i1> [[B]]
373 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
410374 ;
411375 %A = or <2 x i32> %X,
412376 %B = icmp ult <2 x i32> %A,
425389
426390 define <2 x i1> @and1_vec(<2 x i32> %X) {
427391 ; CHECK-LABEL: @and1_vec(
428 ; CHECK-NEXT: [[A:%.*]] = and <2 x i32> %X,
429 ; CHECK-NEXT: [[B:%.*]] = icmp ugt <2 x i32> [[A]],
430 ; CHECK-NEXT: ret <2 x i1> [[B]]
392 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
431393 ;
432394 %A = and <2 x i32> %X,
433395 %B = icmp ugt <2 x i32> %A,
446408
447409 define <2 x i1> @tautological9_vec(<2 x i32> %x) {
448410 ; CHECK-LABEL: @tautological9_vec(
449 ; CHECK-NEXT: [[ADD:%.*]] = add nuw <2 x i32> %x,
450 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[ADD]],
451 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
411 ; CHECK-NEXT: ret <2 x i1>
452412 ;
453413 %add = add nuw <2 x i32> %x,
454414 %cmp = icmp ne <2 x i32> %add,