[llvm] [InstCombine] Transform (fcmp + fadd + sel) into (fcmp + sel + fadd) (PR #106492)

Rajat Bajpai via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 21:44:45 PST 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) {
----------------
rajatbajpai wrote:

@arsenm I've been working on making flags more aggressive for the above transformation. I've a question regarding the arguments of Select and FCmp instruction. Since the Select instruction already has the `nnan` flag, wouldn't that imply that the arguments of FCmp also have this property?

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


More information about the llvm-commits mailing list