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

Rajat Bajpai via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 22:14:14 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:

Sorry, I'm not sure if I understand this fully. Isn't for this transformation the arguments of `fcmp` and `select` instruction should be the same? If possible could you please provide an example where this is a problem? 

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


More information about the llvm-commits mailing list