diff options
author | Jinsong Ji <jji@us.ibm.com> | 2021-06-21 19:25:40 +0000 |
---|---|---|
committer | Jinsong Ji <jji@us.ibm.com> | 2021-06-21 21:15:43 +0000 |
commit | 3996311ee1b0a3c29a3ffcf9400e12ca76a846d9 (patch) | |
tree | e476f579f69bf5d645619820094be1dd80d25b16 /llvm/lib/IR/Module.cpp | |
parent | 2bfe0536e5143caad80f7a9691fa775cf451317b (diff) | |
download | llvm-3996311ee1b0a3c29a3ffcf9400e12ca76a846d9.zip llvm-3996311ee1b0a3c29a3ffcf9400e12ca76a846d9.tar.gz llvm-3996311ee1b0a3c29a3ffcf9400e12ca76a846d9.tar.bz2 |
[DAGCombine] reassoc flag shouldn't enable contract
According to IR LangRef, the FMF flag:
contract
Allow floating-point contraction (e.g. fusing a multiply followed by an
addition into a fused multiply-and-add).
reassoc
Allow reassociation transformations for floating-point instructions.
This may dramatically change results in floating-point.
My understanding is that these two flags shouldn't imply each other,
as we might have a SDNode that can be reassociated with others, but
not contractble.
eg: We may want following fmul/fad/fsub to freely reassoc, but don't
want fma being generated here.
%F = fmul reassoc double %A, %B ; <double> [#uses=1]
%G = fmul reassoc double %C, %D ; <double> [#uses=1]
%H = fadd reassoc double %F, %G ; <double> [#uses=1]
%I = fsub reassoc double %H, %E ; <double> [#uses=1]
Before https://reviews.llvm.org/D45710, `reassoc` flag actually
did not imply isContratable either.
The current implementation also only check the flag in fadd node,
ignoring fmul node, this patch update that as well.
Reviewed By: spatel, qiucf
Differential Revision: https://reviews.llvm.org/D104247
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions