Page MenuHomePhabricator

[AMDGPU] Add option -munsafe-fp-atomics

Authored by yaxunl on Nov 16 2020, 8:15 AM.



Add an option -munsafe-fp-atomics for AMDGPU target.

When enabled, clang adds function attribute "amdgpu-unsafe-fp-atomics"
to any functions for amdgpu target. This allows amdgpu backend to use
unsafe fp atomic instructions in these functions.

Diff Detail

Event Timeline

yaxunl created this revision.Nov 16 2020, 8:15 AM
yaxunl requested review of this revision.Nov 16 2020, 8:15 AM
tra accepted this revision.Nov 16 2020, 9:35 AM


Patch description could use a pointer to more details about the unsafe atomics.


I'm curious -- what does unsafe mean here?

This revision is now accepted and ready to land.Nov 16 2020, 9:35 AM
yaxunl marked an inline comment as done.Nov 16 2020, 10:17 AM
yaxunl added inline comments.

unsafe means it does not follow requirements of other floating point options, e.g. it may flush denormals even if other fp options requires denormals not flushed. This allows user to relax fp restrictions on fp atomic instructions without relaxing fp requirements on other instructions.

This revision was automatically updated to reflect the committed changes.
yaxunl marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2020, 6:53 PM