This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add target information that is required by tools to metadata
ClosedPublic

Authored by kzhuravl on Jan 16 2017, 1:00 AM.

Details

Summary

Tools include debugger, profiler, static analyzer

  • Wavefront size
  • Local memory size
  • Number of execution units per compute unit
  • Maximum flat work group size
  • SGPR allocation granularity
  • Total number of SGPRs
  • Addressable number of SGPRs
  • VGPR allocation granularity
  • Total number of VGPRs
  • Addressable number of VGPRs

Diff Detail

Repository
rL LLVM

Event Timeline

kzhuravl updated this revision to Diff 84523.Jan 16 2017, 1:00 AM
kzhuravl retitled this revision from to [AMDGPU] Add target information that is required by static analyzer tool to metadata.
kzhuravl updated this object.
kzhuravl added reviewers: arsenm, yaxunl.
kzhuravl added a subscriber: llvm-commits.
kzhuravl added inline comments.Jan 16 2017, 1:04 AM
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
94 ↗(On Diff #84523)

We can't really include AMDGPUSubtarget.h here. Should FIXED_SGPR_COUNT_FOR_INIT_BUG definition be moved to SIDefines.h?

lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
39–49 ↗(On Diff #84523)

Is there a better place for these?

kzhuravl planned changes to this revision.Jan 16 2017, 5:14 PM

There was another request to add few other target properties.

arsenm added inline comments.Jan 16 2017, 5:25 PM
lib/Target/AMDGPU/SIRegisterInfo.cpp
1157–1163 ↗(On Diff #84523)

Can these be moved to the header now?

lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
94 ↗(On Diff #84523)

Yes

arsenm added inline comments.Jan 16 2017, 5:31 PM
lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
50 ↗(On Diff #84523)

should Module be const?

74 ↗(On Diff #84523)

Ditto

105 ↗(On Diff #84523)

Ditto

yaxunl accepted this revision.Jan 20 2017, 8:02 AM

LGTM. Thanks.

kzhuravl updated this revision to Diff 86049.Jan 27 2017, 8:10 AM
kzhuravl marked 5 inline comments as done.
kzhuravl retitled this revision from [AMDGPU] Add target information that is required by static analyzer tool to metadata to [AMDGPU] Add target information that is required by tools to metadata.
kzhuravl edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jan 27 2017, 8:10 AM
kzhuravl requested review of this revision.Jan 27 2017, 8:23 AM
kzhuravl edited edge metadata.
arsenm added inline comments.Jan 27 2017, 9:30 AM
lib/Target/AMDGPU/GCNSchedStrategy.cpp
147–148 ↗(On Diff #86049)

It would be OK to leave these as helpers in the reg info that call AMDGPU::IsaInfo

kzhuravl updated this revision to Diff 86390.Jan 30 2017, 11:51 PM

Address review feedback.

kzhuravl updated this revision to Diff 87400.Feb 7 2017, 5:05 AM

Bring up to date with trunk. Update test to check for SI/VI since those have different target info.

kzhuravl updated this revision to Diff 87409.Feb 7 2017, 5:59 AM

Upload the right diff.

arsenm accepted this revision.Feb 7 2017, 11:37 AM

LGTM

lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
413–428 ↗(On Diff #87409)

Assiging Prog.IsaInfo to a reference variable might help avoid some of the line wrapping?

This revision is now accepted and ready to land.Feb 7 2017, 11:37 AM
This revision was automatically updated to reflect the committed changes.
kzhuravl added inline comments.Feb 8 2017, 6:46 AM
lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
413–428 ↗(On Diff #87409)

Sorry, missed this one initially. Submitted follow up patch: rL294454