This is an archive of the discontinued LLVM Phabricator instance.

[NewPM][AMDGPU] Port amdgpu-simplifylib/amdgpu-usenative
ClosedPublic

Authored by aeubanks on Dec 28 2020, 9:35 AM.

Details

Summary

And add them to the pipeline via
AMDGPUTargetMachine::registerPassBuilderCallbacks(), which mirrors
AMDGPUTargetMachine::adjustPassManager().

These passes can't be unconditionally added to PassRegistry.def since
they are only present when the AMDGPU backend is enabled. And there are
no target-specific headers in llvm/include, so parsing these pass names
must occur somewhere in the AMDGPU directory. I decided the best place
was inside the TargetMachine, since the PassBuilder invokes
TargetMachine::registerPassBuilderCallbacks() anyway. If we come up with
a cleaner solution for target-specific passes in the future that's fine,
but there aren't too many target-specific IR passes living in
target-specific directories so it shouldn't be too bad to change in the
future.

Diff Detail

Event Timeline

aeubanks created this revision.Dec 28 2020, 9:35 AM
aeubanks requested review of this revision.Dec 28 2020, 9:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2020, 9:35 AM
arsenm accepted this revision.Dec 28 2020, 9:37 AM

LGTM with nit

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
496

No else after return

This revision is now accepted and ready to land.Dec 28 2020, 9:37 AM
aeubanks updated this revision to Diff 313869.Dec 28 2020, 9:44 AM

formatting

ychen accepted this revision.Dec 28 2020, 9:44 AM

LGTM

aeubanks updated this revision to Diff 313874.Dec 28 2020, 10:38 AM

add missing dependency

This revision was landed with ongoing or failed builds.Dec 28 2020, 10:39 AM
This revision was automatically updated to reflect the committed changes.