[llvm] [RFC][MC] Cache MCRegAliasIterator (PR #93510)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 04:06:27 PDT 2024


arsenm wrote:

> > The real fix should be to switch all uses of MCRegAliasIterator to use MCRegUnitIterator instead. No liveness infrastructure should operate in terms of aliases
> 
> I'm not too familiar with reg units but as far as I understand them, yes, that'd probably make more sense.

RegUnits are the fundamental unit of liveness tracking in llvm. All of the generated register enums have to go through the awkward mapping to regunits, things would be better if the register representation looked more like regunit sets. 


> 
> However I'm wondering how realistic it is to expect that itt'll happen anytime soon. I can fix one or two cases myself I think but we have about 80 uses in llvm/lib.

It's usually not too difficult to convert these uses. I've been suggesting this as an intern project for a while. There's some additional infrastructure changes that would make this easier, like moving block live ins and reserved registers to directly use regunits 


> How do you feel about caching? Do you think it's a good addition nonetheless, or should we avoid it in favor of (hopefully, someday) fixing all the unnecessary RegAliasIterator uses?

Maybe it's fine for a stopgap 

https://github.com/llvm/llvm-project/pull/93510


More information about the llvm-commits mailing list