This is an archive of the discontinued LLVM Phabricator instance.

RAGreedy: Keep track of allocated PhysRegs internally
ClosedPublic

Authored by MatzeB on Jul 2 2015, 2:52 PM.

Details

Summary

Do not use MachineRegisterInfo::setPhysRegUsed()/isPhysRegUsed()
anymore. This bitset changes function-global state and is set by the
VirtRegRewriter anyway.
Simply use a bitvector private to RAGreedy.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 28978.Jul 2 2015, 2:52 PM
MatzeB retitled this revision from to RAGreedy: Keep track of allocated PhysRegs internally.
MatzeB updated this object.
MatzeB added reviewers: qcolombet, atrick.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.

Instead of maintaining a bitvector in RAGreedy, how about asking LiveRegMatrix? It can tell you if the corresponding LiveIntervalUnion is empty.

MatzeB updated this revision to Diff 29103.Jul 6 2015, 10:42 AM

Good point Jakob; Updated version attached.

stoklund accepted this revision.Jul 13 2015, 8:25 PM
stoklund added a reviewer: stoklund.
stoklund added inline comments.
lib/CodeGen/RegAllocGreedy.cpp
833

This looks like the guts of LiveRegMatrix are spilling out.

How about moving this code into a LiveRegMatrix::isPhysRegUsed() function instead?

Otherwise, looks good!

This revision is now accepted and ready to land.Jul 13 2015, 8:25 PM
This revision was automatically updated to reflect the committed changes.