[Mlir-commits] [mlir] [mlir][LLVM] `ArithToLLVM`: Add 1:N support for `arith.select` lowering (PR #153944)

Matthias Springer llvmlistbot at llvm.org
Sat Aug 16 03:32:24 PDT 2025


================
@@ -479,6 +489,36 @@ CmpFOpLowering::matchAndRewrite(arith::CmpFOp op, OpAdaptor adaptor,
       rewriter);
 }
 
+//===----------------------------------------------------------------------===//
+// SelectOpOneToNLowering
+//===----------------------------------------------------------------------===//
+
+/// Pattern for arith.select where the true/false values lower to multiple
+/// SSA values (1:N conversion). This pattern generates multiple arith.select
+/// than can be lowered by the 1:1 arith.select pattern.
+LogicalResult SelectOpOneToNLowering::matchAndRewrite(
+    arith::SelectOp op, Adaptor adaptor,
+    ConversionPatternRewriter &rewriter) const {
+  // In case of a 1:1 conversion, the 1:1 pattern will match.
----------------
matthias-springer wrote:

Note: This utilizes #153605.


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


More information about the Mlir-commits mailing list