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

Backport #3804: [GlobalISel] Fix SR-15531 regression #3853

Merged
merged 1 commit into from Feb 2, 2022
Merged

Backport #3804: [GlobalISel] Fix SR-15531 regression #3853

merged 1 commit into from Feb 2, 2022

Conversation

asl
Copy link

@asl asl commented Jan 27, 2022

Backport llvm/llvm-project@64bef13 (and #3804) from LLVM mainline to swift/release/5.6. This fixes compile-time regression exposed by llvm/llvm-project@d0af732

Fixes llvm#53109 and https://bugs.swift.org/browse/SR-15531

Tagging @ornata @ravimad @DougGregor

If a G_SHL is fed by a G_CONSTANT, the lower and upper bits of the source can be
shifted individually by the constant shift amount.

However in case the shift amount came from a G_TRUNC(G_CONSTANT), the generic shift legalization
code was used, producing intermediate shifts that are potentially illegal on some targets.

This change teaches narrowScalarShift to look through G_TRUNCs and G_*EXTs.

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D89100
@asl asl changed the title Backport https://github.com/apple/llvm-project/pull/3804: [GlobalISel] Fix SR-15531 regression Backport #3804: [GlobalISel] Fix SR-15531 regression Jan 27, 2022
@ornata
Copy link

ornata commented Feb 1, 2022

@swift-ci Please test

@ornata ornata merged commit cf92f74 into apple:swift/release/5.6 Feb 2, 2022
@ornata
Copy link

ornata commented Feb 2, 2022

Sorry for the late response on this, but thanks again, @asl!

@asl asl deleted the swift-5.6-3804-cherry-pick branch February 2, 2022 18:33
@asl
Copy link
Author

asl commented Feb 2, 2022

Great, thanks!

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.

None yet

3 participants