[llvm] [InstCombine] Fold more 'fcmp' 'select' instrs idioms into 'fabs' (PR #83381)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 00:16:56 PDT 2024


sushgokh wrote:

@jcranmer-intel 
>Overall, I don't think this is the right place to do the checking on function-level attributes. Instead, we should probably be having SROA propagate function-level attributes to appropriate FMF

First, its still unclear to me why it is not appropriate to deduce fast-math flags from the func attributes in InstCombine and why that should be done in SROA.

Second, considering above comment, the line of action is unclear.
Consider the SROA output [here](https://godbolt.org/z/MW1z5ecPe) and as can be seen, one of the operands to phi is the function arg. It becomes imperative to have fast-math flags on the func argument and this does not serve the purpose when phi argument is local/global instead of func arg. Could you please elaborate here?

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


More information about the llvm-commits mailing list