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

Assertion in LiveIntervals #13750

Closed
asl opened this issue Jul 17, 2012 · 9 comments
Closed

Assertion in LiveIntervals #13750

asl opened this issue Jul 17, 2012 · 9 comments
Labels
bugzilla Issues migrated from bugzilla llvm:codegen

Comments

@asl
Copy link
Collaborator

asl commented Jul 17, 2012

Bugzilla Link 13378
Resolution FIXED
Resolved on Jul 18, 2012 15:18
Version trunk
OS All
Attachments Testcase
CC @atrick,@chandlerc,@stoklund

Extended Description

Consider the attached testcase. Running llc -mcpu=cortex-a9 on it yields assertions fail.

@stoklund
Copy link
Mannequin

stoklund mannequin commented Jul 17, 2012

RescheduleMIBelowKill is moving an INSERT_SUBREG instruction, and then it never gets revisited, so we don't insert the required COPY in front of it.

@chandlerc
Copy link
Member

Interesting, looking into this... don't yet have a strong understanding of the change in behavior...

@stoklund
Copy link
Mannequin

stoklund mannequin commented Jul 17, 2012

Honestly, I get lost in those giant nested loops. It might help to extract a few methods.

INSERT_SUBREG gets partial special treatment because we need to both insert a COPY in front and change the instruction itself into a subreg COPY.

@chandlerc
Copy link
Member

Note that this reproduces for me even with r160228 reverted.

@stoklund
Copy link
Mannequin

stoklund mannequin commented Jul 17, 2012

You touch it, you own it ;-)

Chad, ISTR you asking me about INSERT_SUBREG and RescheduleMIBelowKill. Do you remember how it is supposed to work?

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 17, 2012

Unfortunately, I don't recall.

@chandlerc
Copy link
Member

You touch it, you own it ;-)

Careful what you wish for?

(And no, I'm not owning it... but I'll try to help when I can... ;])

I've mailed a patch that I think fixes this to -commits for review. I've included a (far too) lengthy write up of the debugging process I went through in the hope of learning whether I've got any clue how this thing works, and maybe helping some others learn as well.

@stoklund
Copy link
Mannequin

stoklund mannequin commented Jul 18, 2012

Thanks, Chandler. It looks like I broke it in r159120. I suppose "you break it, you own it" takes precedence ;-)

To summarize Chandler's analysis, when an INSERT_SUBREG instruction is rescheduled, operand processing is deferring until we reach the instruction the second time. However, the code that rewrites INSERT_SUBREG to COPY was accidentally not deferred, so the second time around we see a COPY which isn't a 2-addr instruction.

@chandlerc
Copy link
Member

Fix committed in r160443.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm:codegen
Projects
None yet
Development

No branches or pull requests

3 participants