Page MenuHomePhabricator

[AMDGPU][NFC] Tidy SIOptimizeExecMaskingPreRA for extensibility
ClosedPublic

Authored by critson on Sat, Oct 17, 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.Sat, Oct 17, 12:57 AM
critson requested review of this revision.Sat, Oct 17, 12:57 AM
critson updated this revision to Diff 298864.Sun, Oct 18, 2:21 AM
  • Consistently use Register type.
foad added a subscriber: foad.Mon, Oct 19, 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.Mon, Oct 19, 7:05 PM
  • Address review comments
critson marked 3 inline comments as done.Mon, Oct 19, 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.Mon, Oct 19, 11:38 PM
This revision was landed with ongoing or failed builds.Tue, Oct 20, 1:23 AM
This revision was automatically updated to reflect the committed changes.
critson marked 2 inline comments as done.