[PATCH] D112283: [Instcombine] Try to get select's FMFs from its operands

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 22 08:38:01 PDT 2021


spatel added reviewers: efriedma, lebedev.ri, dmgreen.
spatel added a comment.

Using function attributes is what we're trying to get away from by having instruction-level FMF, so this would have to be clearly labeled as a hack or temporary fix.

That said, I don't think anyone is working on a real fix that would apply FMF to all FP values. That was a comment I made in:
https://llvm.org/PR35607
...but it might lead to another question about how that works with type-less memory (I don't know the answer to that one).

I think that's also the root cause for the failure in the motivating bug/test for this patch:
https://llvm.org/PR52259
That is, I don't think we can blame SROA for not propagating FMF when creating a phi - the FMF weren't on the loaded values used to form that phi in the first place.

This fabs example is worth posting to llvm-dev for wider discussion. I think we do need to do something to optimize that code, but there's no clear fix that I know of. 
Note that this example is really only about 'nsz':
https://godbolt.org/z/1zW6hK1qK


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112283/new/

https://reviews.llvm.org/D112283



More information about the llvm-commits mailing list