[llvm] [SDAG] Allow S/Zext in select-abd pattern (PR #191207)

via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 18 12:39:59 PDT 2026


================
@@ -12725,38 +12725,47 @@ SDValue DAGCombiner::foldSelectToABD(SDValue LHS, SDValue RHS, SDValue True,
       TLI.isTypeLegal(VT) || TLI.getTypeAction(*DAG.getContext(), VT) ==
                                  TargetLowering::TypePromoteInteger;
 
+  auto LHSPat = ISD::isSignedIntSetCC(CC) ? m_SExtOrSelf(m_Specific(LHS))
+                                          : m_ZExtOrSelf(m_Specific(LHS));
----------------
DaKnig wrote:

it does not match the pattern then and is incorrect to combine.

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


More information about the llvm-commits mailing list