This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][NFC] Tidy SIOptimizeExecMaskingPreRA for extensibility
ClosedPublic

Authored by critson on Oct 17 2020, 12:57 AM.

Details

Summary

Remove duplicate code and move things around to make it easier to
add additional optimisations to the pass.

Diff Detail

Event Timeline

critson created this revision.Oct 17 2020, 12:57 AM
critson requested review of this revision.Oct 17 2020, 12:57 AM
critson updated this revision to Diff 298864.Oct 18 2020, 2:21 AM
  • Consistently use Register type.
foad added a subscriber: foad.Oct 19 2020, 4:27 AM

Looks fine to me. More ideas inline.

llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
78–79

Make this a member function so you don't have to pass ExecReg in? Or just inline it? It's so simple now, it hardly seems worth having it as a separate function.

79

Since you're cleaning up, why not just return this expression?

121–122

Return Register?

128

Could just return Register() here and elsewhere.

critson updated this revision to Diff 299239.Oct 19 2020, 7:05 PM
  • Address review comments
critson marked 3 inline comments as done.Oct 19 2020, 7:06 PM
critson added inline comments.
llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
78–79

Inlined.

128

Done, I think I got all the remaining uses.

This revision is now accepted and ready to land.Oct 19 2020, 11:38 PM
This revision was landed with ongoing or failed builds.Oct 20 2020, 1:23 AM
This revision was automatically updated to reflect the committed changes.
critson marked 2 inline comments as done.