[PATCH] D81491: [InstCombine] reassociate FP diff of sums into sum of diffs

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 05:52:47 PDT 2020


spatel added a comment.

In D81491#2087527 <https://reviews.llvm.org/D81491#2087527>, @RKSimon wrote:

> LGTM as long as the fast math flags are OK.


That’s the usual logic - if the final value is relaxed, then we assume that calcs leading to that value are equivalently relaxed. Note that to get mixed optimization flags, you likely need compilation with different optimization flags + LTO + inlining to ever get to the state where instructions in 1 function have different FMF.

> I'm not sure if the integer add equivalent combine would be useful (yet)? It probably wouldn't help with PSAD cases tbh.

>From an IR perspective, we should have that for consistency, but I have not looked at what happens with codegen on that path yet. I'll take a look at that next.


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

https://reviews.llvm.org/D81491





More information about the llvm-commits mailing list