On the transitivity of subregisterness

Woud it be reasonable to assert that TargetRegisterInfo::isSubRegister() is a transitive relation?

In other words, if A is a subregister of B and B is a subregister of C then A is a subregister of C.

With this assumption, we could teach TableGen to sort registers topologically such that all the subregisters of R are numbered R+1, R+2, ... This produces better locality of reference and allows other optimizations in the backend code that deals in subregisters a lot.

/jakob

Woud it be reasonable to assert that TargetRegisterInfo::isSubRegister() is a transitive relation?

In other words, if A is a subregister of B and B is a subregister of C then A is a subregister of C.

This certainly makes sense to me. I suspect any backends that are doing things that violate that are playing tricks with subregisters that would be (better?) solvable another way.

With this assumption, we could teach TableGen to sort registers topologically such that all the subregisters of R are numbered R+1, R+2, ... This produces better locality of reference and allows other optimizations in the backend code that deals in subregisters a lot.

This sounds very useful.

-J

Woud it be reasonable to assert that TargetRegisterInfo::isSubRegister() is a transitive relation?

Yes.

Evan