[llvm-branch-commits] [llvm] [X86] Restore CCMP and SSE select codegen after demanded-bits folding (PR #230770)

Simon Pilgrim via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 12 03:45:52 PDT 2026


================
@@ -57860,6 +57873,17 @@ static SDValue combineAndnp(SDNode *N, SelectionDAG &DAG,
     std::tie(Bits0, Elts0) = GetDemandedMasks(N1);
     std::tie(Bits1, Elts1) = GetDemandedMasks(N0, true);
 
+    // Reuse a live arithmetic shift when only sign bits are needed. This keeps
+    // the two-address SSE shift from requiring a copy of its input for ANDNP.
+    if (!Subtarget.hasAVX() && Bits0.isSignMask() &&
----------------
RKSimon wrote:

I don't like this at all - plus I'm hoping to remove a lot of this GetDemandedMasks code soon as its not POISON safe.

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


More information about the llvm-branch-commits mailing list