[llvm] [InstCombine] Optimize fcmp ord/uno logical select operations using freeze (PR #205076)

SUBASH BOOPATHI via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 21:48:38 PDT 2026


================
@@ -15,9 +15,8 @@ define i1 @PR1738(double %x, double %y) {
 ; TODO: this can be supported by freezing %y
 define i1 @PR1738_logical(double %x, double %y) {
 ; CHECK-LABEL: @PR1738_logical(
-; CHECK-NEXT:    [[CMP1:%.*]] = fcmp ord double [[X:%.*]], 0.000000e+00
-; CHECK-NEXT:    [[CMP2:%.*]] = fcmp ord double [[Y:%.*]], 0.000000e+00
-; CHECK-NEXT:    [[AND:%.*]] = select i1 [[CMP1]], i1 [[CMP2]], i1 false
+; CHECK-NEXT:    [[Y_FR:%.*]] = freeze double [[Y:%.*]]
----------------
SubashBoopathi1605 wrote:

@dtcxzyw Thanks for the suggestion. I've dropped the TODO and updated the PR accordingly.

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


More information about the llvm-commits mailing list