[Mlir-commits] [mlir] [Vector] Add canonicalization for select(pred, true, false) -> broadcast(pred) (PR #147934)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Thu Jul 10 09:08:30 PDT 2025
================
@@ -2913,13 +2913,74 @@ struct BroadcastFolder : public OpRewritePattern<BroadcastOp> {
return success();
}
};
+
+/// true: vector
+/// false: vector
+/// pred: i1
+///
+/// select(pred, true, false) -> broadcast(pred)
+/// select(pred, false, true) -> broadcast(not(pred))
+///
+/// Ideally, this would be a canonicalization pattern on arith::SelectOp, but
----------------
banach-space wrote:
I think that this paragraph makes more sense near where you register this canonicalization.
https://github.com/llvm/llvm-project/pull/147934
More information about the Mlir-commits
mailing list