This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Avoid CodeGen dependencies from AMDGPU/Utils and MCTargetDesc
ClosedPublic

Authored by rnk on Jul 27 2023, 1:53 PM.

Details

Summary

This required two substantial changes:

  1. Moving a getRegBitWidth(TargetRegisterClass) overload out of Utils and into CodeGen
  2. Passing the string function name to AMDGPUPALMetadata instead of the MachineFunction

Other changes are minor or updates to accommodate the first two.

See issue #64166 for more information on the layering issue.

Diff Detail

Event Timeline

rnk created this revision.Jul 27 2023, 1:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 1:53 PM
rnk requested review of this revision.Jul 27 2023, 1:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 1:53 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Jul 27 2023, 1:58 PM
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.h
35 ↗(On Diff #544915)

Should go in SIRegisterInfo.h,, not AMDGPURegisterBankInfo (though I'm wondering why we need this in the first place, the MCRegisterClass one should work well enough?)

rnk updated this revision to Diff 544947.Jul 27 2023, 3:11 PM
  • move to SIRegisterInfo.h
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.h
35 ↗(On Diff #544915)

I moved it. TargetRegisterClass points to a MCRegisterClass, but they are not convertible.

arsenm accepted this revision.Jul 27 2023, 3:17 PM
This revision is now accepted and ready to land.Jul 27 2023, 3:17 PM
This revision was landed with ongoing or failed builds.Jul 27 2023, 3:21 PM
This revision was automatically updated to reflect the committed changes.