[llvm] [InstCombine] Transform (fcmp + fadd + sel) into (fcmp + sel + fadd) (PR #106492)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 30 05:42:21 PDT 2024
================
@@ -0,0 +1,634 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+
+; fcmp OGT + fadd + sel => fcmp OGT + sel => fmaxnum
+
+define float @test_fcmp_ogt_fadd_select_constant(float %in) {
----------------
arsenm wrote:
This case fails alive: https://alive2.llvm.org/ce/z/_h-8Lw
You can't preserve the nnan unless it was also present on the fadd and fcmp
https://github.com/llvm/llvm-project/pull/106492
More information about the llvm-commits
mailing list