This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget][amdgpu][nfc] Drop dead signal pool setup
ClosedPublic

Authored by JonChesterfield on Jul 21 2021, 5:40 PM.

Details

Summary

This class is instantiated once in rtl.cpp before hsa_init is
called. The hsa_signal_create call therefore fails leaving the pool empty.

This signal pool is a legacy from ATMI where it was constructed after hsa_init.
Moving the state into the rtl.cpp global class disabled the initial populating
of the pool without noticeably changing performance. Just rechecked with a fix
that allocates the signals after hsa_init and that also doesn't noticeably
change performance.

This patch therefore drops the initialisation. Only change from main is to
drop a DEBUG_PRINT statement that would say the pool initial size is zero.

Diff Detail

Event Timeline

JonChesterfield requested review of this revision.Jul 21 2021, 5:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2021, 5:40 PM
JonChesterfield edited the summary of this revision. (Show Details)Jul 21 2021, 5:41 PM
jdoerfert accepted this revision.Jul 21 2021, 9:51 PM

LG. If we don't need the pool, maybe remove it?

This revision is now accepted and ready to land.Jul 21 2021, 9:51 PM

It's a performance thing. I'm not sure signal creation is expensive enough to be worth caching, particularly without a thread local cache, but haven't checked.

They might be cheap to create on gfx9 and expensive on gfx8 or similar. Will need to trace through HSA to see how many operations are avoided by the cache.

This revision was landed with ongoing or failed builds.Jul 22 2021, 2:29 AM
This revision was automatically updated to reflect the committed changes.