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

OS#19979778 : Merge uses of auxSlotPtrSym on dead edges as well #5935

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

Conversation

meg-gupta
Copy link
Contributor

This is a fix for use-before-def of an auxSlotPtrSym.

When there is a LdFld which is a candidate of ReuseAuxSlotSymPtr optimization inside the loop which has no backedge (all are dead), the DeadStore phase never marks SetProducesAuxSlotPtr on the opnd.
This is because we don't merge upwardExposedUses on dead edges, and so the optimization never sees a set bit of the auxSlotPtrSym in upwardExposedUses in the 2nd pass.

Ideally, if GlobOpt reset block->loopbfor such loops after GlobOpt::RemoveCodeAfterNoFallThroughInstr we wouldn't be seeing this.

With this change we have a new bit vector called auxSlotPtrUpwardExposedUses which we merge on even dead successor edges to fix this issue.

@wyrichte
Copy link
Collaborator

Rerunning Linux, OSX, Win7

@meg-gupta
Copy link
Contributor Author

Ping...

Copy link
Contributor

@MikeHolman MikeHolman left a comment

Choose a reason for hiding this comment

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

:shipit:

@meg-gupta meg-gupta force-pushed the pr/meg-gupta/livenessbug branch 4 times, most recently from 84e7a20 to 8dc3939 Compare February 21, 2019 20:26
@wyrichte
Copy link
Collaborator

Ignore OSX, use macOS as validation instead

Copy link
Collaborator

@LouisLaf LouisLaf left a comment

Choose a reason for hiding this comment

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

:shipit:

This is a fix for use-before-def of an auxSlotPtrSym.

When there is a LdFld which is a candidate of ReuseAuxSlotSymPtr optimization inside the loop which has no backedge (all are dead), the DeadStore phase never marks SetProducesAuxSlotPtr on the opnd.
This is because we don't merge upwardExposedUses on dead edges, and so the optimization never sees a set bit of the auxSlotPtrSym in upwardExposedUses in the 2nd pass.

Ideally, if GlobOpt reset block->loopbfor such loops after GlobOpt::RemoveCodeAfterNoFallThroughInstr we wouldn't be seeing this.

With this change we have a new bit vector called auxSlotPtrUpwardExposedUses which we merge on even dead successor edges to fix this issue.
@rhuanjl rhuanjl self-assigned this Jan 31, 2021
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.

5 participants