Skip to content

[X86] Return from SimplifyDemandedBitsForTargetNode for X86ISD::CMOV/ANDP after computing KnownBits. NFC #141992

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented May 29, 2025

If we break out of the switch, I believe we fall back to the generic SimplifyDemandedBitsForTargetNode which will call computeKnownBitsForTargetNode. This will recurse again and calculate it's own KnownBits. Since we already did the recursion, we should keep the results.

…ANDP after computing KnownBits. NFC

If we break out of the switch, I believe we fall back to the
generic SimplifyDemandedBitsForTargetNode which will call
computeKnownBitsForTargetNode. This will recurse again and calculate
it's own KnownBits. Since we already did the recursion, we should
keep the results.
@llvmbot
Copy link
Member

llvmbot commented May 29, 2025

@llvm/pr-subscribers-backend-x86

Author: Craig Topper (topperc)

Changes

If we break out of the switch, I believe we fall back to the generic SimplifyDemandedBitsForTargetNode which will call computeKnownBitsForTargetNode. This will recurse again and calculate it's own KnownBits. Since we already did the recursion, we should keep the results.


Full diff: https://github.com/llvm/llvm-project/pull/141992.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86ISelLowering.cpp (+1-1)
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 6b71f49165c60..ecadc86a0b781 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -44789,7 +44789,7 @@ bool X86TargetLowering::SimplifyDemandedBitsForTargetNode(
 
     // Only known if known in both the LHS and RHS.
     Known = Known.intersectWith(Known2);
-    break;
+    return false;
   }
   case X86ISD::BEXTR:
   case X86ISD::BEXTRI: {

Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

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

LGTM

@topperc topperc merged commit 8e2a42a into llvm:main May 29, 2025
13 checks passed
@topperc topperc deleted the pr/x86-simplify-demanded branch May 29, 2025 19:59
svkeerthy pushed a commit that referenced this pull request May 29, 2025
…ANDP after computing KnownBits. NFC (#141992)

If we break out of the switch, I believe we fall back to the generic
SimplifyDemandedBitsForTargetNode which will call
computeKnownBitsForTargetNode. This will recurse again and calculate
it's own KnownBits. Since we already did the recursion, we should keep
the results.
google-yfyang pushed a commit to google-yfyang/llvm-project that referenced this pull request May 29, 2025
…ANDP after computing KnownBits. NFC (llvm#141992)

If we break out of the switch, I believe we fall back to the generic
SimplifyDemandedBitsForTargetNode which will call
computeKnownBitsForTargetNode. This will recurse again and calculate
it's own KnownBits. Since we already did the recursion, we should keep
the results.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
…ANDP after computing KnownBits. NFC (llvm#141992)

If we break out of the switch, I believe we fall back to the generic
SimplifyDemandedBitsForTargetNode which will call
computeKnownBitsForTargetNode. This will recurse again and calculate
it's own KnownBits. Since we already did the recursion, we should keep
the results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants