[llvm] [DAG] Matched FixedWidth pattern for ISD::AVGFLOORU (PR #84903)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 04:32:38 PDT 2024


================
@@ -2820,6 +2820,22 @@ SDValue DAGCombiner::visitADDLike(SDNode *N) {
   return SDValue();
 }
 
+// Attempt to form avgflooru(A, B) from add(and(A, B), lshr(xor(A, B), 1))
----------------
jayfoad wrote:

Nit: I think the symbolic form is easier for humans to read:
```suggestion
// Attempt to form avgflooru(A, B) from (A & B) + ((X ^ B) >> 1).
```

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


More information about the llvm-commits mailing list