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

[PowerPC] Use zext instead of anyext in custom and combine #68784

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Oct 11, 2023

This custom combine currently converts and(anyext(x),c) into anyext(and(x,c)). This is not correct, because the original expression guaranteed that the high bits are zero, while the new one sets them to undef.

Emit zext(and(x,c)) instead.

Fixes #68783.

This custom combine currently converts an `and(anyext(x),c)`
into `anyext(and(x,c))`. This is not correct, because the original
expression guaranteed that the high bits are zero, while the new
one sets them to undef.

Emit `zext(and(x,c))` instead.

Fixes llvm#68783.
@nikic nikic requested a review from nemanjai October 11, 2023 10:20
Copy link
Contributor

@stefanp-ibm stefanp-ibm left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this.
LGTM.

@nikic nikic merged commit 127ed9a into llvm:main Oct 12, 2023
2 checks passed
nikic added a commit to nikic/llvm-project that referenced this pull request Oct 13, 2023
This custom combine currently converts `and(anyext(x),c)` into
`anyext(and(x,c))`. This is not correct, because the original expression
guaranteed that the high bits are zero, while the new one sets them to
undef.

Emit `zext(and(x,c))` instead.

Fixes llvm#68783.

(cherry picked from commit 127ed9a)
tru pushed a commit that referenced this pull request Oct 17, 2023
This custom combine currently converts `and(anyext(x),c)` into
`anyext(and(x,c))`. This is not correct, because the original expression
guaranteed that the high bits are zero, while the new one sets them to
undef.

Emit `zext(and(x,c))` instead.

Fixes #68783.

(cherry picked from commit 127ed9a)
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.

[PowerPC] Incorrect and/anyext interchange in custom combine
2 participants