This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Save some work when an atomic op has no uses
ClosedPublic

Authored by foad on Jul 19 2019, 2:05 AM.

Details

Summary

In the atomic optimizer, save doing a bunch of work and generating a
bunch of dead IR in the fairly common case where the result of an
atomic op (i.e. the value that was in memory before the atomic op was
performed) is not used.

Diff Detail

Repository
rL LLVM

Event Timeline

foad created this revision.Jul 19 2019, 2:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2019, 2:05 AM
foad added a comment.Jul 19 2019, 2:06 AM

Follow-on patches will also improve the generated code when the result is not needed.

Test?

llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
494 ↗(On Diff #210776)

Not sure if this ignores debug uses, but it probably needs to

foad added a comment.Jul 19 2019, 10:12 AM

Test?

What sort of test? This patch should have NFC, it just saves some compile time.

arsenm accepted this revision.Jul 19 2019, 10:18 AM

LGTM

This revision is now accepted and ready to land.Jul 19 2019, 10:18 AM
This revision was automatically updated to reflect the committed changes.