This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Use MachineRegisterInfo to find max used register
ClosedPublic

Authored by arsenm on Mar 27 2017, 5:12 PM.

Details

Reviewers
kzhuravl
Summary

Avoid looping through program to determine register counts.
This avoids needing to look at regmask operands.

Also fixes some counting errors with flat_scr when there
are no stack objects.

Diff Detail

Event Timeline

arsenm created this revision.Mar 27 2017, 5:12 PM
kzhuravl accepted this revision.Apr 12 2017, 1:27 PM

LGTM.

lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
420

RI->getEncodingValue(NumVGPRReg) & 0xff -> RI->getHWRegIndex(NumVGPRReg)?

422

Similar.

This revision is now accepted and ready to land.Apr 12 2017, 1:27 PM
arsenm closed this revision.Apr 17 2017, 1:01 PM

r300482