[Mlir-commits] [mlir] [MLIR][Vector] Add warp distribution for `scf.if` (PR #157119)
Artem Kroviakov
llvmlistbot at llvm.org
Wed Sep 10 01:18:45 PDT 2025
================
@@ -1856,3 +1856,72 @@ func.func @negative_warp_step_more_than_warp_size(%laneid: index, %buffer: memre
// CHECK-PROP-LABEL: @negative_warp_step_more_than_warp_size
// CHECK-PROP-NOT: vector.broadcast
// CHECK-PROP: vector.step : vector<64xindex>
+
+// -----
+
+func.func @warp_scf_if_no_yield_distribute(%buffer: memref<128xindex>, %pred : i1) {
+ %laneid = gpu.lane_id
+ %c0 = arith.constant 0 : index
+
+ gpu.warp_execute_on_lane_0(%laneid)[32] {
+ %seq = vector.step : vector<32xindex>
+ scf.if %pred {
+ vector.store %seq, %buffer[%c0] : memref<128xindex>, vector<32xindex>
+ }
+ gpu.yield
+ }
+ return
+}
+
+// CHECK-PROP-LABEL: func.func @warp_scf_if_no_yield_distribute(
+// CHECK-PROP-SAME: %[[ARG0:.+]]: memref<128xindex>, %[[ARG1:.+]]: i1
+// CHECK-PROP: scf.if %[[ARG1]] {
+// CHECK-PROP: gpu.warp_execute_on_lane_0(%{{.*}})[32] args(%{{.*}} : vector<1xindex>) {
+// CHECK-PROP: ^bb0(%[[ARG2:.+]]: vector<32xindex>):
+// CHECK-PROP: vector.store %[[ARG2]], %[[ARG0]][%{{.*}}] : memref<128xindex>, vector<32xindex>
----------------
akroviakov wrote:
Could you please point to the `vector.store` distribution and examples? I do not see the pattern in `VectorDistribute.cpp`, nor any examples in `vector-warp-distribute.mlir`.
https://github.com/llvm/llvm-project/pull/157119
More information about the Mlir-commits
mailing list