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

via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 10:28:53 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-x86

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>

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
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: {

``````````

</details>


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


More information about the llvm-commits mailing list