From 30d712e61dbcf6ea97f0de058993073b988ae584 Mon Sep 17 00:00:00 2001 From: n0thingNoob Date: Wed, 25 Mar 2026 13:18:08 +0000 Subject: [PATCH 1/4] update codegen and test --- .../Transforms/GenerateCodePass.cpp | 313 ++++++++++++------ test/e2e/fir/fir_kernel.mlir | 10 +- test/e2e/gemm/gemm_kernel.mlir | 117 +++++++ test/e2e/gemv/gemv_kernel.mlir | 18 +- test/e2e/spmv/spmv_kernel.mlir | 28 +- 5 files changed, 357 insertions(+), 129 deletions(-) diff --git a/lib/NeuraDialect/Transforms/GenerateCodePass.cpp b/lib/NeuraDialect/Transforms/GenerateCodePass.cpp index c3493780..5719a82f 100644 --- a/lib/NeuraDialect/Transforms/GenerateCodePass.cpp +++ b/lib/NeuraDialect/Transforms/GenerateCodePass.cpp @@ -618,17 +618,19 @@ struct GenerateCodePass } // Adds producer endpoints: - // - If src_reg_step exists: producer writes ONLY to $src_reg (directional port is emitted by egress at first_link_ts). + // - If pre-link registers exist: producer writes ONLY to the earliest pre-link register. + // Later source-side register transfers and egress are emitted as synthetic instructions. // - Else: producer writes to producer_direction if link-based, or $reg for reg-only paths. void setProducerDestination(Operation *producer, StringRef producer_direction, const SmallVector ®s, - std::optional src_reg_step) { + ArrayRef src_reg_steps) { if (auto *pi = getInstructionPointer(producer)) { - if (src_reg_step) { - // This mov uses src_reg + egress to send on link.time_step. We still must NOT + if (!src_reg_steps.empty()) { + // This mov uses source-side register transfers + egress to send on link.time_step. + // We still must NOT // delete existing directional outputs, because the same producer may // fan-out to other consumers via other mov paths. - setUniqueDestination(pi, "$" + std::to_string(src_reg_step->regId)); + setUniqueDestination(pi, "$" + std::to_string(src_reg_steps.front().regId)); return; } @@ -660,10 +662,25 @@ struct GenerateCodePass } struct MovRegSplit { - std::optional src_reg_step; // last reg with time_step < first_link_time_step - std::optional dst_reg_step; // first reg with time_step > last_link_time_step + SmallVector src_reg_steps; // all regs with time_step < first_link_time_step + SmallVector dst_reg_steps; // all regs with time_step > last_link_time_step }; + SmallVector, 4> + collectRegisterTransfers(ArrayRef reg_steps) const { + SmallVector, 4> transfers; + if (reg_steps.size() < 2) return transfers; + + for (size_t i = 1; i < reg_steps.size(); ++i) { + const RegStep &prev = reg_steps[i - 1]; + const RegStep &cur = reg_steps[i]; + // Consecutive uses of the same physical register are a hold, not a move. + if (prev.regId == cur.regId) continue; + transfers.emplace_back(prev, cur); + } + return transfers; + } + MovRegSplit splitMovRegs(const SmallVector ®s, const SmallVector &links) const { MovRegSplit out; @@ -671,12 +688,107 @@ struct GenerateCodePass int first_link_time_step = links.front().time_step; int last_link_time_step = links.back().time_step; for (const RegStep &r : regs) { - if (r.time_step < first_link_time_step) out.src_reg_step = r; - if (!out.dst_reg_step && r.time_step > last_link_time_step) out.dst_reg_step = r; + if (r.time_step < first_link_time_step) { + out.src_reg_steps.push_back(r); + continue; + } + if (r.time_step > last_link_time_step) out.dst_reg_steps.push_back(r); } return out; } + template + void placeRegisterTransfer(const Topology &topology, int tile_id, int time_step, + int src_reg_id, int dst_reg_id, int assigned_id = -1) { + auto [tile_x, tile_y] = topology.tile_location.lookup(tile_id); + Instruction inst(IsCtrl ? "CTRL_MOV" : "DATA_MOV"); + inst.id = assigned_id; + inst.time_step = time_step; + inst.index_per_ii = indexPerIiFromTimeStep(time_step); + inst.invalid_iterations = syntheticInvalidIterations(time_step); + inst.src_operands.emplace_back("$" + std::to_string(src_reg_id), "RED"); + inst.dst_operands.emplace_back("$" + std::to_string(dst_reg_id), "RED"); + tile_time_instructions[{tile_x, tile_y}][inst.index_per_ii].push_back(std::move(inst)); + } + + template + size_t emitSourceSyntheticChain(const MovRegSplit ®_split, + const SmallVector &links, + const Topology &topo, + int base_mov_id) { + if (links.empty() || reg_split.src_reg_steps.empty()) return 0; + + int src_tile_id = topo.srcTileOfLink(links.front().link_id); + int next_synthetic_offset = 0; + SmallVector, 4> transfers = + collectRegisterTransfers(reg_split.src_reg_steps); + + for (const auto &[prev, cur] : transfers) { + int synthetic_id = + base_mov_id >= 0 ? base_mov_id * 10000 + next_synthetic_offset : -1; + ++next_synthetic_offset; + placeRegisterTransfer(topo, src_tile_id, cur.time_step, + prev.regId, cur.regId, synthetic_id); + } + + int egress_instruction_id = + base_mov_id >= 0 ? base_mov_id * 10000 + next_synthetic_offset : -1; + placeSrcEgress(topo, src_tile_id, links.front().time_step, + topo.dirFromLink(links.front().link_id), + reg_split.src_reg_steps.back().regId, + /*asCtrlMov=*/IsCtrl, egress_instruction_id); + ++next_synthetic_offset; + return next_synthetic_offset; + } + + template + size_t emitDestinationSyntheticChain(const MovRegSplit ®_split, + const SmallVector &links, + const Topology &topo, + int base_mov_id, + size_t next_synthetic_offset) { + if (links.empty() || reg_split.dst_reg_steps.empty()) return next_synthetic_offset; + + int dst_tile_id = topo.dstTileOfLink(links.back().link_id); + StringRef incoming_dir = topo.invertDir(topo.dirFromLink(links.back().link_id)); + + // The IR-backed mov_id materializes the deposit onto the first post-link register. + placeDstDeposit(topo, dst_tile_id, reg_split.dst_reg_steps.front().time_step, + incoming_dir, reg_split.dst_reg_steps.front().regId, + /*asCtrlMov=*/IsCtrl, base_mov_id); + + SmallVector, 4> transfers = + collectRegisterTransfers(reg_split.dst_reg_steps); + for (const auto &[prev, cur] : transfers) { + int synthetic_id = + base_mov_id >= 0 ? base_mov_id * 10000 + static_cast(next_synthetic_offset) : -1; + ++next_synthetic_offset; + placeRegisterTransfer(topo, dst_tile_id, cur.time_step, + prev.regId, cur.regId, synthetic_id); + } + return next_synthetic_offset; + } + + std::optional + selectRegisterForConsumer(ArrayRef reg_steps, + const TileLocation &consumer_placement, + bool allow_prearrival_register) const { + if (reg_steps.empty()) return std::nullopt; + if (!consumer_placement.has_tile || consumer_placement.time_step < 0) { + if (allow_prearrival_register) return reg_steps.front().regId; + return std::nullopt; + } + + std::optional selected_reg; + for (const RegStep &step : reg_steps) { + if (step.time_step >= consumer_placement.time_step) break; + selected_reg = step.regId; + } + if (selected_reg) return selected_reg; + if (allow_prearrival_register) return reg_steps.front().regId; + return std::nullopt; + } + // Emits router hops for multi-hop paths (from the second hop onwards). CTRL_MOV emits CTRL_MOV hops. template void generateIntermediateHops(const SmallVector &links, const Topology &topo, @@ -725,38 +837,37 @@ struct GenerateCodePass template bool handleRegisterRewiring(Operation *consumer_operation, Value value_at_consumer, const SmallVector ®s, - std::optional dst_reg_step, + ArrayRef dst_reg_steps, const SmallVector &links, const Topology &topo, int mov_dfg_id) { + (void)mov_dfg_id; if (!links.empty()) { - // Cross-tile: deposit on destination tile at dst_reg_step (post-link register). - if (!dst_reg_step) return false; - int deposit_time_step = dst_reg_step->time_step; - int register_id = dst_reg_step->regId; + if (dst_reg_steps.empty()) return false; int dst_tile = topo.dstTileOfLink(links.back().link_id); - // Computes incoming direction from destination tile's perspective. - StringRef incoming_dir = topo.invertDir(topo.dirFromLink(links.back().link_id)); - placeDstDeposit(topo, dst_tile, deposit_time_step, incoming_dir, register_id, - /*asCtrlMov=*/IsCtrl, mov_dfg_id); - TileLocation consumer_placement = operation_placements.lookup(consumer_operation); if (consumer_placement.has_tile) { - // For CTRL_MOV, the destination register often represents a stateful value (reserve/control) - // that must be consumed via a local register even if the consumer's time_step is earlier - // (e.g., prologue reads default, later iterations read updated). - const bool should_rewire_to_register = - IsCtrl || (consumer_placement.time_step > deposit_time_step); - if (should_rewire_to_register) { + int consumer_tile_id = + topo.tileIdAt(consumer_placement.col_idx, consumer_placement.row_idx); + if (consumer_tile_id != dst_tile) return false; + + if (std::optional register_id = + selectRegisterForConsumer(dst_reg_steps, consumer_placement, + /*allow_prearrival_register=*/IsCtrl)) { setConsumerSourceExact(consumer_operation, value_at_consumer, - "$" + std::to_string(register_id)); + "$" + std::to_string(*register_id)); return true; } } } else { // Same-tile: must go via register. if (regs.empty()) return false; - int register_id = regs.back().regId; - setConsumerSourceExact(consumer_operation, value_at_consumer, "$" + std::to_string(register_id)); + TileLocation consumer_placement = operation_placements.lookup(consumer_operation); + std::optional register_id = + selectRegisterForConsumer(regs, consumer_placement, + /*allow_prearrival_register=*/IsCtrl); + if (!register_id) register_id = regs.back().regId; + setConsumerSourceExact(consumer_operation, value_at_consumer, + "$" + std::to_string(*register_id)); return true; } return false; @@ -824,18 +935,16 @@ struct GenerateCodePass template void emitMovRoutingInstructions(Operation *forwarder, const MovBasics &basics, const Topology &topo) { + (void)forwarder; // Producer endpoints & intermediate hops. - setProducerDestination(basics.producer, basics.producer_direction, basics.regs, basics.reg_split.src_reg_step); - if (!basics.links.empty() && basics.reg_split.src_reg_step) { - int src_tile = topo.srcTileOfLink(basics.links.front().link_id); - int first_link_time_step = basics.links.front().time_step; - int egress_instruction_id = basics.mov_dfg_id >= 0 ? basics.mov_dfg_id * 10000 : -1; - placeSrcEgress(topo, src_tile, first_link_time_step, basics.producer_direction, - basics.reg_split.src_reg_step->regId, - /*asCtrlMov=*/IsCtrl, egress_instruction_id); - } - size_t hop_counter = 1; - generateIntermediateHops(basics.links, topo, basics.mov_dfg_id, hop_counter); + setProducerDestination(basics.producer, basics.producer_direction, basics.regs, + basics.reg_split.src_reg_steps); + size_t next_synthetic_offset = + emitSourceSyntheticChain(basics.reg_split, basics.links, topo, + basics.mov_dfg_id); + generateIntermediateHops(basics.links, topo, basics.mov_dfg_id, next_synthetic_offset); + emitDestinationSyntheticChain(basics.reg_split, basics.links, topo, + basics.mov_dfg_id, next_synthetic_offset); } template @@ -858,7 +967,7 @@ struct GenerateCodePass Operation *consumer_operation = consumer_pair.first; Value value_at_consumer = consumer_pair.second; if (!handleRegisterRewiring(consumer_operation, value_at_consumer, basics.regs, - basics.reg_split.dst_reg_step, + basics.reg_split.dst_reg_steps, basics.links, topo, basics.mov_dfg_id)) handleDirectionRewiring(consumer_operation, value_at_consumer, basics.consumer_direction, basics.links, topo, forwarder); @@ -1063,8 +1172,8 @@ struct GenerateCodePass int mov_id = -1; int producer_id = -1; SmallVector consumer_ids; - SmallVector, 8> hop_tiles; - SmallVector hop_time_steps; + SmallVector pre_mov_nodes; + SmallVector post_mov_nodes; }; void collectCtrlMovReserves(func::FuncOp func, @@ -1177,55 +1286,74 @@ struct GenerateCodePass } SmallVector link_steps = collectLinkSteps(operation); - SmallVector, 8> hop_tiles; - SmallVector hop_time_steps; - // Detect whether this mov has a src_reg_step (reg.time_step < first_link_time_step). If so, - // an egress instruction exists with id=mov_id*10000 and must participate in edges. - bool has_src_reg_step = false; + SmallVector pre_mov_nodes; + SmallVector post_mov_nodes; if (!link_steps.empty()) { SmallVector regs = collectRegSteps(operation); MovRegSplit reg_split = splitMovRegs(regs, link_steps); - has_src_reg_step = reg_split.src_reg_step.has_value(); - if (has_src_reg_step) { - int base = mov_dfg_id * 10000; - int egress_id = base; + + if (!reg_split.src_reg_steps.empty()) { int src_tile_id = topology.srcTileOfLink(link_steps.front().link_id); auto coord = topology.tile_location.lookup(src_tile_id); - // Add placeholder node now (will be filled/confirmed by injectMaterializedInstructionNodes). - if (!nodes.count(egress_id)) { - nodes[egress_id] = DfgNodeInfo{ - isCtrlMov(operation) ? "CTRL_MOV" : "DATA_MOV", - coord.first, coord.second, link_steps.front().time_step}; + StringRef opcode = isCtrlMov(operation) ? "CTRL_MOV" : "DATA_MOV"; + SmallVector, 4> transfers = + collectRegisterTransfers(reg_split.src_reg_steps); + + for (const auto &[prev, cur] : transfers) { + (void)prev; + pre_mov_nodes.push_back( + DfgNodeInfo{opcode.str(), coord.first, coord.second, + cur.time_step}); + } + pre_mov_nodes.push_back( + DfgNodeInfo{opcode.str(), coord.first, coord.second, + link_steps.front().time_step}); + } + + // Build hop nodes directly from link steps (mirrors router hop emission). + if (link_steps.size() > 1) { + StringRef opcode = isCtrlMov(operation) ? "CTRL_MOV" : "DATA_MOV"; + for (size_t i = 1; i < link_steps.size(); ++i) { + int middle_tile_id = topology.srcTileOfLink(link_steps[i].link_id); + auto coord = topology.tile_location.lookup(middle_tile_id); + pre_mov_nodes.push_back( + DfgNodeInfo{opcode.str(), coord.first, coord.second, + link_steps[i].time_step}); } } - } - // Build hop tiles directly from link steps (mirrors router hop emission). - if (link_steps.size() > 1) { - for (size_t i = 1; i < link_steps.size(); ++i) { - int middle_tile_id = topology.srcTileOfLink(link_steps[i].link_id); - auto coord = topology.tile_location.lookup(middle_tile_id); - hop_tiles.push_back(coord); - hop_time_steps.push_back(link_steps[i].time_step); + if (reg_split.dst_reg_steps.size() > 1) { + int dst_tile_id = topology.dstTileOfLink(link_steps.back().link_id); + auto coord = topology.tile_location.lookup(dst_tile_id); + StringRef opcode = isCtrlMov(operation) ? "CTRL_MOV" : "DATA_MOV"; + SmallVector, 4> transfers = + collectRegisterTransfers(reg_split.dst_reg_steps); + + for (const auto &[prev, cur] : transfers) { + (void)prev; + post_mov_nodes.push_back( + DfgNodeInfo{opcode.str(), coord.first, coord.second, + cur.time_step}); + } } } - if (hop_tiles.empty()) { + if (!pre_mov_nodes.empty() || !post_mov_nodes.empty()) { auto it = nodes.find(mov_dfg_id); if (it != nodes.end()) { it->second.tile_x = -1; it->second.tile_y = -1; + it->second.time_step = -1; } - } else { + int base = mov_dfg_id * 10000; - for (size_t i = 0; i < hop_tiles.size(); ++i) { - int node_id = base + static_cast(i) + 1; - DfgNodeInfo hop_node; - hop_node.opcode = isCtrlMov(operation) ? "CTRL_MOV" : "DATA_MOV"; - hop_node.tile_x = hop_tiles[i].first; - hop_node.tile_y = hop_tiles[i].second; - hop_node.time_step = (i < hop_time_steps.size()) ? hop_time_steps[i] : -1; - nodes[node_id] = hop_node; + for (size_t i = 0; i < pre_mov_nodes.size(); ++i) { + int node_id = base + static_cast(i); + nodes[node_id] = pre_mov_nodes[i]; + } + for (size_t i = 0; i < post_mov_nodes.size(); ++i) { + int node_id = base + static_cast(pre_mov_nodes.size() + i); + nodes[node_id] = post_mov_nodes[i]; } if (producer_id >= 0) @@ -1234,19 +1362,8 @@ struct GenerateCodePass skip_edges.insert({mov_dfg_id, consumer_id}); rewrites.push_back( - HopRewriteInfo{mov_dfg_id, producer_id, consumer_ids, hop_tiles, hop_time_steps}); - } - - // Also rewrite edges for single-hop (no intermediate hop nodes) when egress exists: - // producer -> egress(base) -> mov_id -> consumers - // so that DFG edges align with instruction ids. - if (has_src_reg_step && hop_tiles.empty()) { - if (producer_id >= 0) - skip_edges.insert({producer_id, mov_dfg_id}); - for (int consumer_id : consumer_ids) - skip_edges.insert({mov_dfg_id, consumer_id}); - // Store a rewrite with empty hop list; later we will special-case it. - rewrites.push_back(HopRewriteInfo{mov_dfg_id, producer_id, consumer_ids, /*hop_tiles*/{}, /*hop_time_steps*/{}}); + HopRewriteInfo{mov_dfg_id, producer_id, consumer_ids, + pre_mov_nodes, post_mov_nodes}); } }); @@ -1257,26 +1374,22 @@ struct GenerateCodePass for (const HopRewriteInfo &rewrite : rewrites) { int base = rewrite.mov_id * 10000; - int egress_id = base; int previous = rewrite.producer_id; - // If an egress instruction exists (id=mov_id*10000), route through it. - // This keeps DFG edges aligned with instruction ids for reg-before-link paths. - if (nodes.count(egress_id)) { - if (previous >= 0) edges.emplace_back(previous, egress_id); - previous = egress_id; - } - - for (size_t i = 0; i < rewrite.hop_tiles.size(); ++i) { - int node_id = base + static_cast(i) + 1; + for (size_t i = 0; i < rewrite.pre_mov_nodes.size(); ++i) { + int node_id = base + static_cast(i); if (previous >= 0) edges.emplace_back(previous, node_id); previous = node_id; } - // Always connect the chain to mov_id; if mov_id is later pruned (non-materialized), - // pruneMovNodesWithoutCoords will bypass it and connect previous directly to consumers. if (previous >= 0) edges.emplace_back(previous, rewrite.mov_id); + previous = rewrite.mov_id; + for (size_t i = 0; i < rewrite.post_mov_nodes.size(); ++i) { + int node_id = base + static_cast(rewrite.pre_mov_nodes.size() + i); + edges.emplace_back(previous, node_id); + previous = node_id; + } for (int consumer_id : rewrite.consumer_ids) - edges.emplace_back(rewrite.mov_id, consumer_id); + edges.emplace_back(previous, consumer_id); } } diff --git a/test/e2e/fir/fir_kernel.mlir b/test/e2e/fir/fir_kernel.mlir index 1a973f09..8fd48ae3 100644 --- a/test/e2e/fir/fir_kernel.mlir +++ b/test/e2e/fir/fir_kernel.mlir @@ -86,7 +86,7 @@ // YAML-NEXT: - index_per_ii: 1 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 310001 +// YAML-NEXT: id: 310000 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -249,7 +249,7 @@ // YAML-NEXT: - index_per_ii: 3 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 180001 +// YAML-NEXT: id: 180000 // YAML-NEXT: time_step: 3 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -267,7 +267,7 @@ // YAML-NEXT: - index_per_ii: 1 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 290002 +// YAML-NEXT: id: 290001 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -311,7 +311,7 @@ // YAML-NEXT: - index_per_ii: 0 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 120001 +// YAML-NEXT: id: 120000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -321,7 +321,7 @@ // YAML-NEXT: - operand: "SOUTH" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 290001 +// YAML-NEXT: id: 290000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: diff --git a/test/e2e/gemm/gemm_kernel.mlir b/test/e2e/gemm/gemm_kernel.mlir index 8f59cd9a..478831dc 100644 --- a/test/e2e/gemm/gemm_kernel.mlir +++ b/test/e2e/gemm/gemm_kernel.mlir @@ -21,6 +21,9 @@ // RUN: FileCheck %s --input-file=%t-mapping.mlir --check-prefix=MAPPING // RUN: FileCheck %s --input-file=tmp-generated-instructions.yaml --check-prefix=YAML // RUN: FileCheck %s --input-file=tmp-generated-instructions.asm --check-prefix=ASM +// RUN: FileCheck %s --input-file=tmp-generated-instructions.yaml --check-prefix=CHAIN-YAML +// RUN: FileCheck %s --input-file=tmp-generated-instructions.asm --check-prefix=CHAIN-ASM +// RUN: FileCheck %s --input-file=tmp-generated-dfg.yaml --check-prefix=CHAIN-DFG // // MAPPING: func.func @kernel_int(%arg0: i32 {llvm.noundef}, %arg1: i32 {llvm.noundef}, %arg2: i32 {llvm.noundef}, %arg3: !llvm.ptr {llvm.nocapture, llvm.noundef}, %arg4: !llvm.ptr {llvm.nocapture, llvm.noundef, llvm.readonly}, %arg5: !llvm.ptr {llvm.nocapture, llvm.noundef, llvm.readonly}) -> !llvm.void attributes {CConv = #llvm.cconv, accelerator = "neura", dataflow_mode = "predicate", linkage = #llvm.linkage, mapping_info = {compiled_ii = 17 : i32, mapping_mode = "spatial-temporal", mapping_strategy = "heuristic", rec_mii = 13 : i32, res_mii = 6 : i32, x_tiles = 4 : i32, y_tiles = 4 : i32}, memory_effects = #llvm.memory_effects, no_unwind, passthrough = ["nofree", "norecurse", "nosync", ["uwtable", "2"], ["min-legal-vector-width", "0"], ["no-trapping-math", "true"], ["stack-protector-buffer-size", "8"], ["target-cpu", "x86-64"]], target_cpu = "x86-64", target_features = #llvm.target_features<["+cmov", "+cx8", "+fxsr", "+mmx", "+sse", "+sse2", "+x87"]>, tune_cpu = "generic", unnamed_addr = 1 : i64, visibility_ = 0 : i64} { // MAPPING-NEXT: %0 = "neura.grant_once"() <{constant_value = "%arg0"}> {dfg_id = 0 : i32, mapping_locs = [{id = 0 : i32, index_per_ii = 8 : i32, invalid_iterations = 0 : i32, resource = "tile", time_step = 8 : i32, x = 0 : i32, y = 0 : i32}]} : () -> !neura.data @@ -380,3 +383,117 @@ // ASM-NEXT: GRANT_ONCE, [$0] -> [$0] (t=16, inv_iters=0) // ASM-NEXT: } (idx_per_ii=16) // ASM: PE(1,0): + +// CHAIN-YAML-LABEL: core_id: "5" +// CHAIN-YAML: - index_per_ii: 11 +// CHAIN-YAML: operations: +// CHAIN-YAML: - opcode: "NOT" +// CHAIN-YAML: id: 159 +// CHAIN-YAML: dst_operands: +// CHAIN-YAML: - operand: "$3" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: - operand: "$8" +// CHAIN-YAML: - index_per_ii: 12 +// CHAIN-YAML: operations: +// CHAIN-YAML: - opcode: "DATA_MOV" +// CHAIN-YAML: id: 1790000 +// CHAIN-YAML: src_operands: +// CHAIN-YAML: - operand: "$8" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: dst_operands: +// CHAIN-YAML: - operand: "$1" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: - index_per_ii: 13 +// CHAIN-YAML: operations: +// CHAIN-YAML: - opcode: "DATA_MOV" +// CHAIN-YAML: id: 1790001 +// CHAIN-YAML: src_operands: +// CHAIN-YAML: - operand: "$1" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: dst_operands: +// CHAIN-YAML: - operand: "$0" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: - index_per_ii: 14 +// CHAIN-YAML: operations: +// CHAIN-YAML: - opcode: "GRANT_PREDICATE" +// CHAIN-YAML: id: 190 +// CHAIN-YAML: - opcode: "DATA_MOV" +// CHAIN-YAML: id: 1790002 +// CHAIN-YAML: src_operands: +// CHAIN-YAML: - operand: "$0" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: dst_operands: +// CHAIN-YAML: - operand: "EAST" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML-LABEL: core_id: "6" +// CHAIN-YAML: - index_per_ii: 6 +// CHAIN-YAML: operations: +// CHAIN-YAML: - opcode: "GRANT_PREDICATE" +// CHAIN-YAML: id: 189 +// CHAIN-YAML: src_operands: +// CHAIN-YAML: - operand: "$7" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: - operand: "$8" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: - index_per_ii: 15 +// CHAIN-YAML: operations: +// CHAIN-YAML: - opcode: "DATA_MOV" +// CHAIN-YAML: id: 179 +// CHAIN-YAML: src_operands: +// CHAIN-YAML: - operand: "WEST" +// CHAIN-YAML: color: "RED" +// CHAIN-YAML: dst_operands: +// CHAIN-YAML: - operand: "$8" +// CHAIN-YAML: color: "RED" + +// CHAIN-ASM-LABEL: PE(1,1): +// CHAIN-ASM: NOT, [$0] -> [$3], [$8], [$7], [$6], [NORTH, RED], [$5], [SOUTH, RED], [WEST, RED] (t=11, inv_iters=0) +// CHAIN-ASM: DATA_MOV, [$8] -> [$1] (t=12, inv_iters=0) +// CHAIN-ASM: DATA_MOV, [$1] -> [$0] (t=13, inv_iters=0) +// CHAIN-ASM: GRANT_PREDICATE, [$2], [$3] -> [$1] (t=14, inv_iters=0) +// CHAIN-ASM: DATA_MOV, [$0] -> [EAST, RED] (t=14, inv_iters=0) +// CHAIN-ASM-LABEL: PE(2,1): +// CHAIN-ASM: GRANT_PREDICATE, [$7], [$8] -> [$7] (t=23, inv_iters=1) +// CHAIN-ASM: DATA_MOV, [WEST, RED] -> [$8] (t=15, inv_iters=0) + +// CHAIN-DFG: - id: 179 +// CHAIN-DFG: opcode: "DATA_MOV" +// CHAIN-DFG: tile_x: 2 +// CHAIN-DFG: tile_y: 1 +// CHAIN-DFG: time_step: 15 +// CHAIN-DFG: - id: 189 +// CHAIN-DFG: opcode: "GRANT_PREDICATE" +// CHAIN-DFG: tile_x: 2 +// CHAIN-DFG: tile_y: 1 +// CHAIN-DFG: time_step: 23 +// CHAIN-DFG: - id: 190 +// CHAIN-DFG: opcode: "GRANT_PREDICATE" +// CHAIN-DFG: tile_x: 1 +// CHAIN-DFG: tile_y: 1 +// CHAIN-DFG: time_step: 14 +// CHAIN-DFG: - id: 1790000 +// CHAIN-DFG: opcode: "DATA_MOV" +// CHAIN-DFG: tile_x: 1 +// CHAIN-DFG: tile_y: 1 +// CHAIN-DFG: time_step: 12 +// CHAIN-DFG: - id: 1790001 +// CHAIN-DFG: opcode: "DATA_MOV" +// CHAIN-DFG: tile_x: 1 +// CHAIN-DFG: tile_y: 1 +// CHAIN-DFG: time_step: 13 +// CHAIN-DFG: - id: 1790002 +// CHAIN-DFG: opcode: "DATA_MOV" +// CHAIN-DFG: tile_x: 1 +// CHAIN-DFG: tile_y: 1 +// CHAIN-DFG: time_step: 14 +// CHAIN-DFG: edges: +// CHAIN-DFG: - from: 159 +// CHAIN-DFG-NEXT: to: 1790000 +// CHAIN-DFG-NEXT: - from: 1790000 +// CHAIN-DFG-NEXT: to: 1790001 +// CHAIN-DFG-NEXT: - from: 1790001 +// CHAIN-DFG-NEXT: to: 1790002 +// CHAIN-DFG-NEXT: - from: 1790002 +// CHAIN-DFG-NEXT: to: 179 +// CHAIN-DFG-NEXT: - from: 179 +// CHAIN-DFG-NEXT: to: 189 diff --git a/test/e2e/gemv/gemv_kernel.mlir b/test/e2e/gemv/gemv_kernel.mlir index a59d0bf0..3e996d4c 100644 --- a/test/e2e/gemv/gemv_kernel.mlir +++ b/test/e2e/gemv/gemv_kernel.mlir @@ -251,7 +251,7 @@ // YAML-NEXT: - operand: "EAST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 710003 +// YAML-NEXT: id: 710002 // YAML-NEXT: time_step: 9 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -321,7 +321,7 @@ // YAML-NEXT: - index_per_ii: 8 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 710002 +// YAML-NEXT: id: 710001 // YAML-NEXT: time_step: 8 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -357,7 +357,7 @@ // YAML-NEXT: - operand: "WEST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 850001 +// YAML-NEXT: id: 850000 // YAML-NEXT: time_step: 10 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -398,7 +398,7 @@ // YAML-NEXT: - index_per_ii: 7 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 710001 +// YAML-NEXT: id: 710000 // YAML-NEXT: time_step: 7 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -748,7 +748,7 @@ // YAML-NEXT: - operand: "$3" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 830001 +// YAML-NEXT: id: 830000 // YAML-NEXT: time_step: 8 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -774,7 +774,7 @@ // YAML-NEXT: - operand: "NORTH" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 700003 +// YAML-NEXT: id: 700002 // YAML-NEXT: time_step: 9 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -900,7 +900,7 @@ // YAML-NEXT: - operand: "$0" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 700002 +// YAML-NEXT: id: 700001 // YAML-NEXT: time_step: 8 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -948,7 +948,7 @@ // YAML-NEXT: - index_per_ii: 7 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 700001 +// YAML-NEXT: id: 700000 // YAML-NEXT: time_step: 7 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -1324,5 +1324,3 @@ // ASM-NEXT: { // ASM-NEXT: GRANT_PREDICATE, [$0], [$2] -> [$3] (t=10, inv_iters=0) // ASM-NEXT: } (idx_per_ii=10) - - diff --git a/test/e2e/spmv/spmv_kernel.mlir b/test/e2e/spmv/spmv_kernel.mlir index e9ddc751..8e2a33db 100644 --- a/test/e2e/spmv/spmv_kernel.mlir +++ b/test/e2e/spmv/spmv_kernel.mlir @@ -547,7 +547,7 @@ // YAML-NEXT: - index_per_ii: 11 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "CTRL_MOV" -// YAML-NEXT: id: 2000004 +// YAML-NEXT: id: 2000003 // YAML-NEXT: time_step: 25 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -627,7 +627,7 @@ // YAML-NEXT: - operand: "$0" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 150001 +// YAML-NEXT: id: 150000 // YAML-NEXT: time_step: 2 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -697,7 +697,7 @@ // YAML-NEXT: - index_per_ii: 6 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 390002 +// YAML-NEXT: id: 390001 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -733,7 +733,7 @@ // YAML-NEXT: - index_per_ii: 8 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 2390001 +// YAML-NEXT: id: 2390000 // YAML-NEXT: time_step: 22 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -769,7 +769,7 @@ // YAML-NEXT: - operand: "WEST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 740001 +// YAML-NEXT: id: 740000 // YAML-NEXT: time_step: 9 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -817,7 +817,7 @@ // YAML-NEXT: - operand: "$1" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "CTRL_MOV" -// YAML-NEXT: id: 2000003 +// YAML-NEXT: id: 2000002 // YAML-NEXT: time_step: 24 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -843,7 +843,7 @@ // YAML-NEXT: - operand: "WEST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 1740001 +// YAML-NEXT: id: 1740000 // YAML-NEXT: time_step: 11 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -865,7 +865,7 @@ // YAML-NEXT: - operand: "NORTH" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 2200005 +// YAML-NEXT: id: 2200004 // YAML-NEXT: time_step: 26 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -918,7 +918,7 @@ // YAML-NEXT: - index_per_ii: 3 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 150002 +// YAML-NEXT: id: 150001 // YAML-NEXT: time_step: 3 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -952,7 +952,7 @@ // YAML-NEXT: - index_per_ii: 5 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 390001 +// YAML-NEXT: id: 390000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -1006,7 +1006,7 @@ // YAML-NEXT: - operand: "WEST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 830001 +// YAML-NEXT: id: 830000 // YAML-NEXT: time_step: 21 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -1062,7 +1062,7 @@ // YAML-NEXT: - operand: "$1" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "CTRL_MOV" -// YAML-NEXT: id: 2000002 +// YAML-NEXT: id: 2000001 // YAML-NEXT: time_step: 23 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -1102,7 +1102,7 @@ // YAML-NEXT: - index_per_ii: 12 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 1740002 +// YAML-NEXT: id: 1740001 // YAML-NEXT: time_step: 12 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -1123,7 +1123,7 @@ // YAML-NEXT: - operand: "$1" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 2200006 +// YAML-NEXT: id: 2200005 // YAML-NEXT: time_step: 27 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: From de1948ed3bc29d745f4b7349f56476f339a7d2d2 Mon Sep 17 00:00:00 2001 From: n0thingNoob Date: Wed, 25 Mar 2026 13:32:48 +0000 Subject: [PATCH 2/4] update code gen --- lib/NeuraDialect/Transforms/GenerateCodePass.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/NeuraDialect/Transforms/GenerateCodePass.cpp b/lib/NeuraDialect/Transforms/GenerateCodePass.cpp index 5719a82f..4ada8712 100644 --- a/lib/NeuraDialect/Transforms/GenerateCodePass.cpp +++ b/lib/NeuraDialect/Transforms/GenerateCodePass.cpp @@ -803,9 +803,9 @@ struct GenerateCodePass StringRef out = topo.dirFromLink(cur_link); uint64_t sig = static_cast(llvm::hash_combine(mid_tile, time_step, cur_link)); + int hop_id = base_mov_id >= 0 ? base_mov_id * 10000 + static_cast(hop_counter) : -1; + ++hop_counter; if (hop_signatures.insert(sig).second) { - int hop_id = base_mov_id >= 0 ? base_mov_id * 10000 + static_cast(hop_counter) : -1; - ++hop_counter; placeRouterHop(topo, mid_tile, time_step, in, out, /*asCtrlMov=*/IsCtrl, hop_id); } } @@ -832,8 +832,10 @@ struct GenerateCodePass return consumers; } - // Try register-based rewiring. If cross-tile, emit deposits [incoming_dir]->[$reg] at earliest reg time_step. - // Returns true if rewiring to $reg was applied to consumers. + // Try register-based rewiring. + // For cross-tile movs, destination deposits/register transfers have already been materialized + // during routing instruction generation; this helper only decides which local register a + // consumer should read, if any. template bool handleRegisterRewiring(Operation *consumer_operation, Value value_at_consumer, const SmallVector ®s, From 91a6d5fb6ddb22c4b64c907ee726dd1b64eed825 Mon Sep 17 00:00:00 2001 From: n0thingNoob Date: Wed, 25 Mar 2026 13:49:51 +0000 Subject: [PATCH 3/4] update tests --- test/code_gen/test_code_generate.mlir | 17 ++++++++--------- test/e2e/fir/fir_kernel_vec.mlir | 11 +++++------ test/neura/ctrl/branch_for.mlir | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/test/code_gen/test_code_generate.mlir b/test/code_gen/test_code_generate.mlir index faf98caa..74dabdaf 100644 --- a/test/code_gen/test_code_generate.mlir +++ b/test/code_gen/test_code_generate.mlir @@ -171,7 +171,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - index_per_ii: 0 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 410001 +// YAML-NEXT: id: 410000 // YAML-NEXT: time_step: 4 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -323,7 +323,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - operand: "$0" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 490002 +// YAML-NEXT: id: 490001 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -375,7 +375,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - operand: "$0" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 490001 +// YAML-NEXT: id: 490000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -401,7 +401,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - operand: "EAST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 430001 +// YAML-NEXT: id: 430000 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -427,7 +427,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - operand: "SOUTH" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 580002 +// YAML-NEXT: id: 580001 // YAML-NEXT: time_step: 7 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -505,7 +505,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - operand: "SOUTH" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 580001 +// YAML-NEXT: id: 580000 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -567,7 +567,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - index_per_ii: 2 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 440001 +// YAML-NEXT: id: 440000 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -650,7 +650,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - index_per_ii: 1 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 500001 +// YAML-NEXT: id: 500000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -809,4 +809,3 @@ func.func @loop_test() -> f32 { // ASM-NEXT: GRANT_ONCE, [$0] -> [SOUTH, RED] (t=3, inv_iters=0) // ASM-NEXT: } (idx_per_ii=3) - diff --git a/test/e2e/fir/fir_kernel_vec.mlir b/test/e2e/fir/fir_kernel_vec.mlir index 667d78a2..ffa3d936 100644 --- a/test/e2e/fir/fir_kernel_vec.mlir +++ b/test/e2e/fir/fir_kernel_vec.mlir @@ -85,7 +85,7 @@ // YAML-NEXT: - index_per_ii: 1 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 310001 +// YAML-NEXT: id: 310000 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -239,7 +239,7 @@ // YAML-NEXT: - index_per_ii: 3 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 180001 +// YAML-NEXT: id: 180000 // YAML-NEXT: time_step: 3 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -257,7 +257,7 @@ // YAML-NEXT: - index_per_ii: 1 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 290002 +// YAML-NEXT: id: 290001 // YAML-NEXT: time_step: 6 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -301,7 +301,7 @@ // YAML-NEXT: - index_per_ii: 0 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 120001 +// YAML-NEXT: id: 120000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -311,7 +311,7 @@ // YAML-NEXT: - operand: "SOUTH" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 290001 +// YAML-NEXT: id: 290000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -577,4 +577,3 @@ // ASM-NEXT: RETURN_VALUE, [SOUTH, RED] (t=10, inv_iters=2) // ASM-NEXT: } (idx_per_ii=0) - diff --git a/test/neura/ctrl/branch_for.mlir b/test/neura/ctrl/branch_for.mlir index 0a7d6031..aa37952a 100644 --- a/test/neura/ctrl/branch_for.mlir +++ b/test/neura/ctrl/branch_for.mlir @@ -231,7 +231,7 @@ func.func @loop_test() -> f32 { // YAML-NEXT: - operand: "EAST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 190001 +// YAML-NEXT: id: 190000 // YAML-NEXT: time_step: 4 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: From b096273266f607b5a11ce12d964b3d7fdc326110 Mon Sep 17 00:00:00 2001 From: n0thingNoob Date: Wed, 25 Mar 2026 14:55:24 +0000 Subject: [PATCH 4/4] update fir --- test/compiler_e2e/fir/fir_kernel.mlir | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/compiler_e2e/fir/fir_kernel.mlir b/test/compiler_e2e/fir/fir_kernel.mlir index af09176c..3619f438 100644 --- a/test/compiler_e2e/fir/fir_kernel.mlir +++ b/test/compiler_e2e/fir/fir_kernel.mlir @@ -130,7 +130,7 @@ // YAML-NEXT: - index_per_ii: 4 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 180001 +// YAML-NEXT: id: 180000 // YAML-NEXT: time_step: 4 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -240,7 +240,7 @@ // YAML-NEXT: - operand: "WEST" // YAML-NEXT: color: "RED" // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 100001 +// YAML-NEXT: id: 100000 // YAML-NEXT: time_step: 2 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -276,7 +276,7 @@ // YAML-NEXT: - index_per_ii: 0 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 280001 +// YAML-NEXT: id: 280000 // YAML-NEXT: time_step: 5 // YAML-NEXT: invalid_iterations: 1 // YAML-NEXT: src_operands: @@ -302,7 +302,7 @@ // YAML-NEXT: - index_per_ii: 2 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 110001 +// YAML-NEXT: id: 110000 // YAML-NEXT: time_step: 2 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -321,7 +321,7 @@ // YAML-NEXT: - index_per_ii: 4 // YAML-NEXT: operations: // YAML-NEXT: - opcode: "DATA_MOV" -// YAML-NEXT: id: 190001 +// YAML-NEXT: id: 190000 // YAML-NEXT: time_step: 4 // YAML-NEXT: invalid_iterations: 0 // YAML-NEXT: src_operands: @@ -443,4 +443,3 @@ // YAML-NEXT: - operand: "WEST" // YAML-NEXT: color: "RED" -