This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix data race in SIInsertWaitcnts
ClosedPublic

Authored by kuhar on Dec 16 2021, 12:23 PM.

Details

Summary

The race condition happened when two pass managers ran on two different modules but modified/read the global variables.

To address this, I considered using singletons and freestanding functions to allow getting/setting HardwareLimits and RegisterEncoding, or making it local to the pass. I chose the latter and made it a member of WaitcntsBrackets, to minimizes the amount of global state.

Diff Detail

Event Timeline

kuhar created this revision.Dec 16 2021, 12:23 PM
kuhar requested review of this revision.Dec 16 2021, 12:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2021, 12:23 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm accepted this revision.Dec 16 2021, 1:14 PM
This revision is now accepted and ready to land.Dec 16 2021, 1:14 PM
This revision was landed with ongoing or failed builds.Dec 18 2021, 1:05 PM
This revision was automatically updated to reflect the committed changes.