-
Notifications
You must be signed in to change notification settings - Fork 32
[AIE] Block widening register coalescing inside innerloop #406
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
Conversation
Can you please update to Cycles? |
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 worries me a bit. We are worsening some AIE2 test results.
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.
@andcarminati as discussed, I will remove this for AIE2. Also, here is the tracking ticket for AIE2P AIECC-899
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.
We may be able to take in a bit more information. If the source is within the same loop block, I think it's always better to coalesce. If the source has a lot of live intervals (indicating that it's coalesced to a lot of other registers already), it may be better not to coalesce. In that case, it may also help to split the live range by inserting a widening copy in the preheader of the loop. That allows to bring in the double register with a very short live range, (few interferences) and coalesce the now regular copy in the loop. But I'm afraid this can not be done from this target hook.
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.
Also note that this would be a natural mechanism in region-based register allocation, where the loop body would be isolated from the surroundings by these copy-in (and copy-out) moves. The inner loops then get priority, and the rest can either be coalesced or yields a low-frequency copy.
I think such a liverange splitter pass would sit naturally before register coalescing. It would guarantee that all interbank copies would be outside the inner loops. Widening copies would never be coalesced.
9a546fc to
c18dd20
Compare
c18dd20 to
8d6b4f7
Compare
| AIE2P::FIFO1024RegClass.contains(Reg)); | ||
| } | ||
|
|
||
| bool AIE2PRegisterInfo::shouldCoalesce( |
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.
Maybe it is better to have this code only for AIE2P, as we are not planning to evaluate effects for AIE2 in this moment. Also, we should keep QoR results for AIE2 in a stable state.
d4c66d4 to
1f27c64
Compare
andcarminati
left a comment
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.
LGTM.
arith-to-emitc: Fix lowering of fptoui
Coalescing widening copy from innerloop has positive impact when there is no inline spilling. However, in case of spilling, it inversely affects the stack size.