[Mlir-commits] [mlir] [mlir][arith] Canonicalization patterns for `arith.select` (PR #67809)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Oct 6 03:06:58 PDT 2023


================
@@ -233,6 +233,50 @@ def CmpIExtUI :
             CPred<"$0.getValue() == arith::CmpIPredicate::eq || "
                   "$0.getValue() == arith::CmpIPredicate::ne">> $pred)]>;
 
+//===----------------------------------------------------------------------===//
+// SelectOp
+//===----------------------------------------------------------------------===//
+
+// select(not(pred), a, b) => select(pred, b, a)
+def SelectNotCond :
+    Pat<(SelectOp (Arith_XOrIOp $pred, (ConstantLikeMatcher APIntAttr:$ones)), $a, $b),
----------------
peterbell10 wrote:

I've added an inverted call to the test case.

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


More information about the Mlir-commits mailing list