-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AArch64] Return early rather than asserting when Size of value passed to targetShrinkDemandedConstant is not 32 or 64 #123084
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
Conversation
@llvm/pr-subscribers-backend-aarch64 Author: Will Froom (WillFroom) ChangesSee #123029 for details. Full diff: https://github.com/llvm/llvm-project/pull/123084.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index d4a114c275fb76..32abcfe7a8f452 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -2373,8 +2373,11 @@ bool AArch64TargetLowering::targetShrinkDemandedConstant(
return false;
unsigned Size = VT.getSizeInBits();
- assert((Size == 32 || Size == 64) &&
- "i32 or i64 is expected after legalization.");
+
+ if((Size != 32 || Size != 64))
+ {
+ return false;
+ }
// Exit early if we demand all bits.
if (DemandedBits.popcount() == Size)
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
53f9b3c
to
bfdd622
Compare
Thanks for doing this, it sounds like the right place to change to me. Could you add the test case from #123029? |
bfdd622
to
2a29570
Compare
@davemgreen I've added a test that does no more than simply run the compilation pipeline with no explicit checks, let me know if you are happy with that (I have confirmed that it fails prior to my change) |
2a29570
to
8df0cc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have some nitpicks over cleaning up the test a little, but otherwise LGTM.
…d to targetShrinkDemandedConstant is not 32 or 64
8df0cc3
to
6d0cdae
Compare
@davemgreen thanks for the review, I am waiting on commit access (#122733) so if you are happy could you press merge, cheers. |
Thanks |
See #123029 for details.