LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 27609 - We should have a LiveRegUnits utility class
Summary: We should have a LiveRegUnits utility class
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC All
: P enhancement
Assignee: Matthias Braun
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-02 18:24 PDT by Matthias Braun
Modified: 2017-06-16 17:23 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Braun 2016-05-02 18:24:22 PDT
This is not a bug but a possible code cleanup/slight performance improvement. Just wanted to document my thoughts on it.

We currently use LivePhysRegs as a general purpose register liveness utility. It is used after register allocation to start at the end of a basic block and move upwards while maintaining the set of live registers.

LivePhysReg currently tracks live registers, while for most purposes it would be enough to track liveness of the register units. In fact LivePhysRegs code comes from a LiveRegUnits class but was changed to track registers in r197253 probably because that was needed by one of the first users (StackMapLivenessAnalysis).
Looking at our code today I believe most users of LivePhysRegs should work as well with LiveRegUnits while maintaining a set of register units should be slightly more efficient than updating a set of live registers. There are also out of tree targets with a gigantic number of tuple registers which would certainly need a LiveRegUnits class if they ever need this functionality.

We should also look into the RegScavenger class. Part of what it does is what a LiveRegUnits class would do, so that we could reuse the LiveRegUnits class in the RegScavenger.
Comment 1 Quentin Colombet 2016-05-10 13:44:45 PDT
FWIW I am supportive of the idea!
Comment 2 Matthias Braun 2016-06-30 19:46:01 PDT
Patch submitted: http://reviews.llvm.org/D21916
Comment 3 Matthias Braun 2017-06-16 17:23:35 PDT
This landed a while ago in r279171