This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Refactor waitcnt encoding
ClosedPublic

Authored by kzhuravl on Oct 5 2016, 5:15 PM.

Details

Summary
  • Refactor bit packing/unpacking
  • Calculate bit mask given bit shift and bit width
  • Introduce function for decoding bits of waitcnt
  • Introduce function for encoding bits of waitcnt
  • Introduce function for getting waitcnt mask (instead of using bare numbers)
  • Introduce function fot getting max waitcnt(s) (instead of using bare numbers)

Diff Detail

Repository
rL LLVM

Event Timeline

kzhuravl updated this revision to Diff 73713.Oct 5 2016, 5:15 PM
kzhuravl retitled this revision from to [AMDGPU] Refactor waitcnt encoding.
kzhuravl updated this object.
kzhuravl added a reviewer: tstellarAMD.
kzhuravl added a subscriber: llvm-commits.
arsenm added inline comments.Oct 5 2016, 6:49 PM
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
55–71 ↗(On Diff #73713)

These don't use the version?

kzhuravl added inline comments.Oct 10 2016, 12:26 AM
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
55–71 ↗(On Diff #73713)

Not at this time, but will in a separate patch

kzhuravl updated this revision to Diff 74146.Oct 10 2016, 10:58 AM
kzhuravl edited edge metadata.

Bring up to date with trunk + remove version from get*BitShift and get*BitWidth functions.

kzhuravl added inline comments.Oct 10 2016, 11:00 AM
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
55–71 ↗(On Diff #73713)

After giving it a second thought, we do not need version in get*BitShift and get*BitWidth functions. I have removed version from those functions.

kzhuravl updated this revision to Diff 74149.Oct 10 2016, 11:23 AM
kzhuravl edited edge metadata.

Remove unused "using".

kzhuravl updated this revision to Diff 74174.Oct 10 2016, 2:15 PM
kzhuravl updated this object.
kzhuravl edited edge metadata.
  • Introduce function for getting waitcnt mask (instead of using bare numbers)
  • Introduce function fot getting max waitcnt(s) (instead of using bare numbers)
kzhuravl updated this revision to Diff 74241.Oct 11 2016, 6:37 AM
kzhuravl edited edge metadata.

Update InstPrinter.

tstellarAMD accepted this revision.Oct 11 2016, 8:09 AM
tstellarAMD edited edge metadata.

This looks good to me. I like the simple interface.

This revision is now accepted and ready to land.Oct 11 2016, 8:09 AM
This revision was automatically updated to reflect the committed changes.