[llvm] select (sext m), (add X, C), X --> (add X, (and C, (sext m)))) (PR #83640)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 17:17:42 PST 2024


================
@@ -12070,6 +12070,15 @@ SDValue DAGCombiner::visitVSELECT(SDNode *N) {
   if (SDValue F = extractBooleanFlip(N0, DAG, TLI, false))
     return DAG.getSelect(DL, VT, F, N2, N1);
 
+  // select (sext m), (add X, C), X --> (add X, (and C, (sext m))))
----------------
elhewaty wrote:

@topperc  I will update it now, but can you please explain why we need this?

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


More information about the llvm-commits mailing list