This is an archive of the discontinued LLVM Phabricator instance.

[Greedy RA] Do not split interval on tied-def
ClosedPublic

Authored by skatkov on Apr 19 2021, 3:11 AM.

Details

Summary

If end of interval for overlap utility is a use which has tied-def we
should not split interval on this instruction due to in this case use
and def may have different registers and it breaks tied-def property.

Diff Detail

Event Timeline

skatkov created this revision.Apr 19 2021, 3:11 AM
skatkov requested review of this revision.Apr 19 2021, 3:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2021, 3:11 AM

Could you add dedicated test case?

It is unclear from the test change that this is covering what you've just added.

reames requested changes to this revision.Apr 28 2021, 11:18 AM
reames added inline comments.
llvm/test/CodeGen/X86/statepoint-invoke-ra1.ll
2 ↗(On Diff #338458)

Please use an autogen test here to check the output and put a comment here explaining the two things this is testing. I think the comment will probably address Quentin's concerns as well, though he should confirm.

This revision now requires changes to proceed.Apr 28 2021, 11:18 AM
skatkov updated this revision to Diff 341452.Apr 29 2021, 3:07 AM

Update with mir test

skatkov added inline comments.Apr 29 2021, 3:09 AM
llvm/lib/CodeGen/SplitKit.cpp
822

Generally, we cannot set end of OpenIdx to End if it is a statepoint instruction and register represents tied-def on this instructions.

Setting end we split tied-use and tied-def in different live intervals allowing to assign them to different registers breaking the tied-ness property.

reames accepted this revision.May 3 2021, 6:28 PM

LGTM w/comment addressed

llvm/test/CodeGen/X86/statepoint-invoke-ra.mir
2–3

This comment is now stale, please update.

This revision is now accepted and ready to land.May 3 2021, 6:28 PM
skatkov updated this revision to Diff 342634.May 3 2021, 9:33 PM

Test description is updated.