-
Couldn't load subscription status.
- Fork 29
[AIE2P] Allow spilling vector/accumulator registers to registers instead of memory #688
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: andreu.waw.rewriter.latency.aware
Are you sure you want to change the base?
Conversation
Ideally, we should extend with SWP metrics.
401e86b to
30888fc
Compare
| return {{AIE2P::VST_dmx_sts_x_spill, AIE2P::sub_bfp16_x}, | ||
| {AIE2P::VST_E_SPILL, AIE2P::sub_bfp16_e}}; | ||
| case AIE2P::VLDA_512_COMPOSED_REG_SPILL: | ||
| return {}; |
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.
This says 'nothing to expand' All other cases return something, so I'm wondering whether this should fall under
if (!MI.isPseudo()) in the top of the function
|
|
||
| // // Ignore Reg Pressure Set ID | ||
| const unsigned PSID = i; | ||
| if (std::find(IgnorePressureSetIDs.begin(), IgnorePressureSetIDs.end(), |
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.
Discussed offline, maybe we should try a single target hook, to which we pass the ID. All IDs a given by an enum, so it should be easy for the target to handle them.
| Opcode = AIE2P::ST_R_SPILL; | ||
| SrcReg = ScratchReg; | ||
| IsKill = true; | ||
| } else if (&AIE2P::spill_vec512_to_compositeRegClass == RC) { |
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'm wondering why we don't use regClassMatches() here.



Creating a combined register class for vector and accumulator registers changes the machine scheduling behavior because the combined register class is now used for register pressure calculation in the machine scheduler.
Therefore, vector and accumulator registers are considered as a single register pressure class and thus the machine scheduler ever so slightly changes the scheduling. This scheduling change changes register liveliness and causes spilling (sometimes even in the innermost loop).
To mitigate this:
Things to update in this PR:
P.S. For my sanity I continue #678 here