-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[ARM] Only change mask if demanded bits says we can optimize #165106
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
base: main
Are you sure you want to change the base?
Conversation
|
@llvm/pr-subscribers-backend-arm Author: AZero13 (AZero13) ChangesFull diff: https://github.com/llvm/llvm-project/pull/165106.diff 1 Files Affected:
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 313ae3d68fb83..9b7955eda8f8d 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -20178,7 +20178,7 @@ bool ARMTargetLowering::targetShrinkDemandedConstant(
// code won't do this, so we have to do it explicitly to avoid an infinite
// loop in obscure cases.)
if (ExpandedMask == ~0U)
- return TLO.CombineTo(Op, Op.getOperand(0));
+ return false;
auto IsLegalMask = [ShrunkMask, ExpandedMask](unsigned Mask) -> bool {
return (ShrunkMask & Mask) == ShrunkMask && (~ExpandedMask & Mask) == 0;
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
4a57f0e to
56c708c
Compare
|
This is the best I can do without regressions @davemgreen To remove the workarounds I have to improve the ubfx code which involves porting getUsefulBits from AArch64, which is a very large effort. |
|
@rj-jesus Thoughts on this? |
|
@arsenm Here. |
This prevents overcorrection to the mask, especially if it is valid already.
This prevents overcorrection to the mask, especially if it is valid already.