[PATCH] D78690: [mlir][Standard] Allow select to use an i1 for vector and tensor values

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 21:10:33 PDT 2020


rriddle added inline comments.


================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:1928
     // Custom form of scalar selection.
-    %x = select %cond, %true, %false : i32
+    %x = select %cond, %true, %false : i1, i32
 
----------------
mehdi_amini wrote:
> I would expect that you don't need the `i1` here right? Or I misunderstand why you don't need the i1 in the "full vector selection" case below.
> 
Yep, thanks. Forgot to change this.


================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:1934
+    // Element-wise vector selection.
+    %vx = std.select" %vcond, %vtrue, %vfalse : vector<42xi1>, vector<42xf32>
+
----------------
mehdi_amini wrote:
> It almost seems like an entirely different operation to me compared to the simple selection of one input or the other. Should we have a vselect or something?
vselect sounds weird given that it also supports tensors, but I agree that the semantics are kind of different. The optional predication is the only thing that removes this from solely being a "simple" select. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78690/new/

https://reviews.llvm.org/D78690





More information about the llvm-commits mailing list