[Mlir-commits] [mlir] [MLIR][Vector] Add a missing builder implementation for Vector_WarpEx… (PR #110106)

Petr Kurapov llvmlistbot at llvm.org
Thu Sep 26 04:03:34 PDT 2024


https://github.com/kurapov-peter created https://github.com/llvm/llvm-project/pull/110106

…ecuteOnLane0Op

The op declares three builders:
```
let builders = [
    OpBuilder<(ins "Value":$laneid, "int64_t":$warpSize)>,
    OpBuilder<(ins "TypeRange":$resultTypes, "Value":$laneid,
                   "int64_t":$warpSize)>,
    // `blockArgTypes` are different than `args` types as they are they
    // represent all the `args` instances visibile to lane 0. Therefore we need
    // to explicit pass the type.
    OpBuilder<(ins "TypeRange":$resultTypes, "Value":$laneid,
                   "int64_t":$warpSize, "ValueRange":$args,
                   "TypeRange":$blockArgTypes)>
  ];
```

This adds the missing implementation for the first builder.

>From bec3fa27352fb246c55fd4374bae1e1ba8eaf59e Mon Sep 17 00:00:00 2001
From: Petr Kurapov <petr.a.kurapov at intel.com>
Date: Thu, 26 Sep 2024 10:59:48 +0000
Subject: [PATCH] [MLIR][Vector] Add a missing builder implementation for
 Vector_WarpExecuteOnLane0Op

---
 mlir/lib/Dialect/Vector/IR/VectorOps.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index cac6b955457049..cf2b6e83f1fc0f 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -6421,6 +6421,12 @@ void WarpExecuteOnLane0Op::getSuccessorRegions(
   regions.push_back(RegionSuccessor(&getWarpRegion()));
 }
 
+void WarpExecuteOnLane0Op::build(OpBuilder &builder, OperationState &result,
+                                 Value laneId, int64_t warpSize) {
+  build(builder, result, TypeRange(), laneId, warpSize,
+        /*operands=*/std::nullopt, /*argTypes=*/std::nullopt);
+}
+
 void WarpExecuteOnLane0Op::build(OpBuilder &builder, OperationState &result,
                                  TypeRange resultTypes, Value laneId,
                                  int64_t warpSize) {



More information about the Mlir-commits mailing list