[Mlir-commits] [mlir] [mlir][arith] Canonicalization patterns for `arith.select` (PR #67809)
Matthias Springer
llvmlistbot at llvm.org
Thu Oct 5 09:15:50 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),
----------------
matthias-springer wrote:
`not` is expressed as `xor(pred, 1)`. Does this case also handle `xor(1, pred)`?
https://github.com/llvm/llvm-project/pull/67809
More information about the Mlir-commits
mailing list