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

[TwoAddressInstruction] Update LiveIntervals after INSERT_SUBREG with undef read #66211

Merged
merged 1 commit into from
Sep 18, 2023
Merged

[TwoAddressInstruction] Update LiveIntervals after INSERT_SUBREG with undef read #66211

merged 1 commit into from
Sep 18, 2023

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Sep 13, 2023

Update LiveIntervals after rewriting:
%reg = INSERT_SUBREG undef %reg, %subreg, subidx
to:
undef %reg:subidx = COPY %subreg

D113044 implemented this for the non-undef case.

… undef read

Update LiveIntervals after rewriting:
  %reg = INSERT_SUBREG undef %reg, %subreg, subidx
to:
  undef %reg:subidx = COPY %subreg

D113044 implemented this for the non-undef case.
@jayfoad jayfoad requested review from MatzeB, arsenm, fhahn, davemgreen, qcolombet and a team September 13, 2023 14:04
S.MergeValueNumberInto(DefSeg->valno, UseSeg->valno);
LiveRange::iterator DefSeg = S.FindSegmentContaining(Idx);
if (mi->getOperand(0).isUndef()) {
S.removeValNo(DefSeg->valno);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I am pretty nervous about all this low level fiddling around with live ranges. I would be much happier if there was some higher level API I could use to do this kind of update.

@jayfoad
Copy link
Contributor Author

jayfoad commented Sep 13, 2023

I see #65916 has just been merged which fixes exactly the same kind of problem.

@lukel97
Copy link
Contributor

lukel97 commented Sep 13, 2023

I see #65916 has just been merged which fixes exactly the same kind of problem.

It was just closed, not merged. I cherry picked this onto #65997 and can confirm it fixes the crash, thanks!

Copy link
Collaborator

@qcolombet qcolombet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jayfoad jayfoad merged commit d8d0588 into llvm:main Sep 18, 2023
@jayfoad jayfoad deleted the twoaddr-extract-subreg-undef branch September 18, 2023 13:52
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
… undef read (llvm#66211)

Update LiveIntervals after rewriting:
  %reg = INSERT_SUBREG undef %reg, %subreg, subidx
to:
  undef %reg:subidx = COPY %subreg

D113044 implemented this for the non-undef case.
lukel97 added a commit that referenced this pull request Sep 21, 2023
…65997)

Similar to #65598, if we're using a vslideup to insert a fixed length
vector into another vector, then we can work out the minimum number of
registers it will need to slide up across given the minimum VLEN, and
shrink the type operated on to reduce LMUL accordingly.

This is somewhat dependent on #66211 , since it introduces a subregister
copy that triggers a crash with -early-live-intervals in one of the
tests.

Stacked upon #66211
zahiraam pushed a commit to tahonermann/llvm-project that referenced this pull request Oct 24, 2023
… undef read (llvm#66211)

Update LiveIntervals after rewriting:
  %reg = INSERT_SUBREG undef %reg, %subreg, subidx
to:
  undef %reg:subidx = COPY %subreg

D113044 implemented this for the non-undef case.
zahiraam pushed a commit to tahonermann/llvm-project that referenced this pull request Oct 24, 2023
… undef read (llvm#66211)

Update LiveIntervals after rewriting:
  %reg = INSERT_SUBREG undef %reg, %subreg, subidx
to:
  undef %reg:subidx = COPY %subreg

D113044 implemented this for the non-undef case.
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.

3 participants