[PATCH] D73978: [WIP][FPEnv] Don't transform FSUB(-0.0,X)->FNEG(X) when flushing denormals
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 3 10:15:14 PDT 2020
arsenm added a comment.
In D73978#1959879 <https://reviews.llvm.org/D73978#1959879>, @cameron.mcinally wrote:
> Thanks, Matt. It looks like preventing the FSUB->FNEG transform is still causing trouble with folding the negate into instructions. E.g.
>
> <scrubbed>/clang/llvm-project/llvm/test/CodeGen/AMDGPU/v_mac_f16.ll:125:7: error: SI: expected string not found in input
> ; SI: v_mad_f32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, -v{{[0-9]+}}
>
>
> It seems that there are a handful of new test failures too.
>
> Any suggestions on how to proceed?
> Should we not expect the explicit FSUB(-0,X) to fold under denormal flushing modes? (Too big a hammer, but correct)
That's what I would expect. Additional context is needed to know the flush will be performed elsewhere
> Or maybe fold the FSUB(-0,X) into the instruction in the backend where possible? (Might cause some slightly wrong answers, unless we're careful)
I don't think we need to fold this in the target, we should be able to fold based on another instruction we know will flush. In the sample you gave there, the f16 operation was promoted to f32 and the conversion should also flush
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73978/new/
https://reviews.llvm.org/D73978
More information about the llvm-commits
mailing list