[PATCH] D112675: [Instcombine] Add patterns to generate fneg(fabs(x)) instead of fcmp/sub/selects (part 1)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 15:34:49 PDT 2021


efriedma added a comment.

If the select is nsz, that means that if the result is zero, we don't care about its sign.  That means we could copy it onto the fneg, sure.  Actually, the produced fabs and fneg should always be nsz; the transform doesn't make sense otherwise.

For other flags, you can probably just copy them from the select?  So initialize the flags from the select, then unconditionally enable the nsz bit for both instructions, I guess.


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

https://reviews.llvm.org/D112675



More information about the llvm-commits mailing list