[PATCH] D71495: [SelectionDAG] Copy FP flags when visiting a binary instruction.

Valentin Churavy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 10:28:48 PST 2019


vchuravy added a comment.

In D71495#1788333 <https://reviews.llvm.org/D71495#1788333>, @spatel wrote:

> It's not clear to me where the bug is. I see this debug output:
>
>   Detected a reduction operation:  %34 = fadd fast <4 x double> %vec.phi, %30
>   Creating new node: t36: v4f64 = fadd vector-reduction t35, t30 <-- dropped all other FMF
>   
>
> So that seems like we just accidentally cleared FMF by setting vector-reduction. If so, then a better fix would be after line 3127?


We dropped all FMF because we created a new `SDNodeFlags Flags` and then create a new node with those flags and replace the input node with the new one.
Setting the vector reduction doesn't clear the FMF, so where we copy them doesn't matter much. I can of course move the copying of the FMF after setting the vector reduction flag.

I reduced the test as much as possible using `llvm-reduce`, I had to check whether a patched binary produced and fma and a unpatched binary not yet produced a fma.
If the test is missing the middle block the fma is generated in either case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71495





More information about the llvm-commits mailing list