This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Check for denormal flushing when selecting V_FMA/MAD_MIX*
AcceptedPublic

Authored by matejam on Jul 10 2023, 2:38 AM.

Details

Reviewers
foad
arsenm
Summary

Tests that were affected by this change did not have denormal flushing enabled.

Diff Detail

Event Timeline

matejam created this revision.Jul 10 2023, 2:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2023, 2:38 AM
matejam requested review of this revision.Jul 10 2023, 2:38 AM

I could add a function attribute containing denormal flushing or add more run lines to these tests.

matejam added inline comments.Jul 10 2023, 2:45 AM
llvm/test/CodeGen/AMDGPU/fdot2.ll
138 ↗(On Diff #538554)

I will remove this change.

I could add a function attribute containing denormal flushing or add more run lines to these tests.

Ideally we would have checks for at least ieee and preserve-sign modes for everything touching mad selection

Why do you need to denorm flushing enabled to use v_fma_mix? I know that v_mad_mix always flushes denorms regardless of MODE register settings, but as far as I understand v_fma_mix doesn't have that issue.

Why do you need to denorm flushing enabled to use v_fma_mix? I know that v_mad_mix always flushes denorms regardless of MODE register settings, but as far as I understand v_fma_mix doesn't have that issue.

Right this is only a problem with v_mad* v_mad_mix*

matejam updated this revision to Diff 539899.Jul 13 2023, 2:07 AM

Since it doesn't affect any tests, should I add this line in D153544?

foad added a comment.Jul 13 2023, 2:42 AM

Since it doesn't affect any tests, should I add this line in D153544?

It would be better to add some tests here (or maybe just add some RUN lines to existing tests) that do show the effect.

llvm/lib/Target/AMDGPU/VOP3PInstructions.td
251

Update this comment.

matejam updated this revision to Diff 539916.Jul 13 2023, 3:03 AM

Added tests without denormal flushing as a function attribute.
In all cases except GFX900 it should have the same result as with denormal flushing.

matejam added inline comments.Jul 13 2023, 5:50 AM
llvm/test/CodeGen/AMDGPU/mad-mix-lo.ll
13 ↗(On Diff #539916)

I wasn't sure should I add all the RUN lines with and without denormal flushing.
It would have 20 RUN lines, I'm not sure is that too much?

arsenm accepted this revision.Jul 13 2023, 6:14 AM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/mad-mix-lo.ll
59 ↗(On Diff #539916)

typo siml. Also "s/no_flush/ieee"?

This revision is now accepted and ready to land.Jul 13 2023, 6:14 AM