-
Notifications
You must be signed in to change notification settings - Fork 28
[Draft][wip] Support composite vector register class for register allocation. #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: aie-public
Are you sure you want to change the base?
Conversation
def mCMs : AIE2PAcc1024RegisterClass<(add mCMm)>; | ||
} // let SubRegIndices = [sub_512_lo, sub_512_hi], CoveredBySubRegs = 1 | ||
|
||
def eCML : AIE2PVector1024RegisterClass<(add cml0, cml1, cml2, cml3, cml4)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, was this change also needed or just the dummy registers were enough?
0fb8751
to
0575190
Compare
Maybe a description of the idea would be nice to help us to help. |
@@ -33,8 +33,8 @@ def sub_512_hi : SubRegIndex<512, 512>; | |||
def sub_512_acc_lo : SubRegIndex<512, 0>; | |||
def sub_512_acc_hi : SubRegIndex<512, 512>; | |||
|
|||
def sub_1024_acc_lo : SubRegIndex<1024, 0>; | |||
def sub_1024_acc_hi : SubRegIndex<1024, 1024>; | |||
def sub_1024_lo : SubRegIndex<1024, 0>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will lead to another problem. I heard once that we cannot reuse this for different register classes, maybe is related to the same problem that we have.
0575190
to
e8e737d
Compare
Preliminary Core_StackSize results.
|
…to mimic vector register hierarchy Subregister indices corresponds to vector and accumulator does not cover the co- rresponding sized registers and leads to undefined uses if we use same subregis- ter indices for both. Having separate subregister indices solves this problem. However, with this approach, we cannot allocate vector register for accumulator (or vice versa). The idea is to mimic the register composition hierarchy of vector for accumulator (only for smaller types, because 2048 does not matter) creating dummy 256-bit accumulators and reverting the separate subregister indices. Now, vector and accumulator register has same lane masks.
VEC/ACC/FIFO registers can be copied to each other and which can be used as an alternative to costly stack spill.
Upon spilling the composed register, we might need to select the spill/reload instruction based on the register allocated by the register allocator itself.
ItineraryRegPairs information is missing for the FIFO store registers(sf) with VMOV_alu_mv_mv_x and we might see wrongly scheduled code. Removed fifo store registers from the composed register class for the time being.
e8e737d
to
d953477
Compare
VEC/ACC/FIFO registers can be copied to each other and which can be used as an alternative to costly stack spill. However, the problem of having a composite register class is, sub-register indices corresponds to vector and accumulator does not cover the corresponding sized registers and leads to undefined uses if we use same sub-register indices for both.
The idea is to mimic the register composition hierarchy of vector for accumulator (only for smaller types, because 2048 does not matter) creating dummy 256-bit accumulators and reverting the separate sub-register indices. Now, vector and accumulator register has same lane masks.