Skip to content
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

[TableGen] Fix computeRegUnitLaneMasks for ad hoc aliasing #79835

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Jan 29, 2024

With ad hoc aliasing (using the Aliases field in register definitions) we can have subregisters with disjoint lane masks that nevertheless share a regunit. In this case we need to take the union of their lane masks, not the intersection.

This was inadvertently broken by https://reviews.llvm.org/D157864

With ad hoc aliasing (using the Aliases field in register definitions)
we can have subregisters with disjoint lane masks that nevertheless
share a regunit. In this case we need to take the union of their
lane masks, not the intersection.

This was inadvertently broken by https://reviews.llvm.org/D157864
@kaz7
Copy link
Contributor

kaz7 commented Jan 30, 2024

Hi @jayfoad , thank you for this PR. I prepared a test for this PR like you asked me in #79642. What is the best way for you to merge the test I made? 1) merge this PR as usual, and I submit another PR for a test? 2) cherry-pick my test to this PR? Either is fine. Please let me know when you have time. Thanks!

The test is available at https://github.com/kaz7/llvm-project/commit/b8d3ad4f9ece967ae0512b974893af95575d1af9.

This test is based on VE implementation.  VE has two subregisters.  Both are
disjointed.  However, many instructions contaminate other register very often.
Therefore, VE defines them as aliased to avoid register allocator to allocate
both registers simultaneously.  This trick conflicts wht recent
computeRegUnitLaneMasks optimization.  The optimization is reverted now.  And
I'm adding test case for that.
@jayfoad
Copy link
Contributor Author

jayfoad commented Jan 30, 2024

Hi @jayfoad , thank you for this PR. I prepared a test for this PR like you asked me in #79642. What is the best way for you to merge the test I made? 1) merge this PR as usual, and I submit another PR for a test? 2) cherry-pick my test to this PR? Either is fine. Please let me know when you have time. Thanks!

I cherry-picked your test, thanks. But I am no longer sure this is the best approach for fixing the problem. How about #79831 as an alternative?

@kaz7
Copy link
Contributor

kaz7 commented May 4, 2024

Hi @jayfoad ,

Is it possible to ask review others about this PR in order to merge this? As I said at #79831 (comment), I think #79831 is not enough to cover the problem.

Recently the modification on live range (#88892) broke VE backend. I don't inspect the patch deeply, but the patch itself seems reasonable. And, if I apply this patch, it solves the problem. I think that it just comes naturally to treat a lanemask == None as empty. So, I'd like to fix the problem from the source.

@jayfoad
Copy link
Contributor Author

jayfoad commented May 5, 2024

Is it possible to ask review others about this PR in order to merge this? As I said at #79831 (comment), I think #79831 is not enough to cover the problem.

Sure, you can ask opinion from others, but personally I am not convinced that this is the best way to fix it.

Recently the modification on live range (#88892) broke VE backend.

Do you have a test case for the new breakage? I'd like to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants