[llvm] [InstCombine] Improve `foldAndOrOfICmpsUsingRanges` (PR #67327)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 11:41:03 PDT 2023


================
@@ -1480,11 +1480,8 @@ define <2 x i1> @icmp_ne_sext_eq_otherwise_vec(<2 x i32> %a) {
 ; tests from PR59555
 define i1 @isFloat(i64 %0) {
 ; CHECK-LABEL: @isFloat(
-; CHECK-NEXT:    [[TMP2:%.*]] = icmp ugt i64 [[TMP0:%.*]], 281474976710655
-; CHECK-NEXT:    [[TMP3:%.*]] = and i64 [[TMP0]], -281474976710656
-; CHECK-NEXT:    [[TMP4:%.*]] = icmp ne i64 [[TMP3]], 281474976710656
-; CHECK-NEXT:    [[TMP5:%.*]] = and i1 [[TMP2]], [[TMP4]]
-; CHECK-NEXT:    ret i1 [[TMP5]]
+; CHECK-NEXT:    [[TMP2:%.*]] = icmp ugt i64 [[TMP0:%.*]], 562949953421311
+; CHECK-NEXT:    ret i1 [[TMP2]]
 ;
----------------
goldsteinn wrote:

1) please add more robust tests. Think you need some negative ones. Maybe:
- B != D
-  some of the explicit pattern (with both sides eq/ne)
-  some non eq/ne patterns with a pred that can't be matched in mask pattern (maybe some signed preds, non-mask + ugt, etc...)
-  some vec tests with undef elements.


https://github.com/llvm/llvm-project/pull/67327


More information about the llvm-commits mailing list