From 43f4f32e3e9108ed4db3388bb48fab448b9c50e7 Mon Sep 17 00:00:00 2001 From: andrej Date: Thu, 9 Jul 2026 10:43:21 -0600 Subject: [PATCH 1/9] AIE: dynamic objectFifo lock lowering (SSA lock values) Make aie.use_lock carry its lock count as an i32 SSA operand instead of an optional integer attribute, and emit runtime-computed lock counts in the dynamic (loop-preserving) objectFifo lowering via a per-(fifo,port) "held" counter. Passes that need a compile-time constant read it back through UseLockOp::getConstantValue(). The static loop-unrolling path (dynamic-objFifos=false) is left in place and still emits compile-time constant lock counts, so static and dynamic lock lowering coexist on this branch. Compiler code only; the corresponding test updates follow in the next commit. --- include/aie/Dialect/AIE/IR/AIEOps.td | 23 +- lib/Dialect/AIE/IR/AIEDialect.cpp | 116 ++- lib/Dialect/AIE/IR/CMakeLists.txt | 1 + .../AIE/Transforms/AIECoreToStandard.cpp | 20 +- .../AIEObjectFifoStatefulTransform.cpp | 742 ++++-------------- .../AIEX/Transforms/AIECreateLocks.cpp | 4 + .../AIEX/Transforms/AIEDMATasksToNPU.cpp | 12 +- .../AIELowerScratchpadParameters.cpp | 4 + lib/Targets/AIERT.cpp | 16 +- lib/Targets/AIETargetXAIEV2.cpp | 10 +- python/dialects/aie.py | 16 + 11 files changed, 359 insertions(+), 605 deletions(-) diff --git a/include/aie/Dialect/AIE/IR/AIEOps.td b/include/aie/Dialect/AIE/IR/AIEOps.td index 2c4b77266bf..a6db0e8f29a 100644 --- a/include/aie/Dialect/AIE/IR/AIEOps.td +++ b/include/aie/Dialect/AIE/IR/AIEOps.td @@ -1378,18 +1378,23 @@ def AIE_UseLockOp: AIE_Op<"use_lock", []> { Then, the value of the lock is decremented by `value`. - Release: In AIE1, set the lock to `value`. In AIE2, increment the lock by `value`. + + The lock value is always given as an `i32` SSA `value` operand. Passes that + need a compile-time constant obtain it via `getConstantValue()`, which + expects the operand to be defined by an `arith.constant` and fails + otherwise. }]; let arguments = ( ins Index:$lock, LockAction:$action, - OptionalAttr:$value, + I32:$value, OptionalAttr:$blocking, DefaultValuedOptionalAttr:$acq_en ); let assemblyFormat = [{ - `(` $lock `,` $action (`,` $value^)? (`,` $blocking^)? `)` attr-dict + `(` $lock `,` custom($action, $value, $blocking) `)` attr-dict }]; let hasVerifier = 1; @@ -1397,7 +1402,15 @@ def AIE_UseLockOp: AIE_Op<"use_lock", []> { OpBuilder<(ins "mlir::Value":$lock, "xilinx::AIE::LockAction":$action, "int32_t":$value), [{ - build($_builder, $_state, lock, action, $_builder.getI32IntegerAttr(value), nullptr); + auto constant = mlir::arith::ConstantOp::create( + $_builder, $_state.location, $_builder.getI32Type(), + $_builder.getI32IntegerAttr(value)); + build($_builder, $_state, lock, action, constant, /*blocking=*/nullptr); + }]>, + OpBuilder<(ins "mlir::Value":$lock, + "xilinx::AIE::LockAction":$action, + "mlir::Value":$value), [{ + build($_builder, $_state, lock, action, value, /*blocking=*/nullptr); }]> ]; @@ -1405,7 +1418,9 @@ def AIE_UseLockOp: AIE_Op<"use_lock", []> { bool acquire() { return (getAction() == LockAction::Acquire); } bool acquireGE() { return (getAction() == LockAction::AcquireGreaterEqual); } bool release() { return (getAction() == LockAction::Release); } - int getLockValue() { return getValue().value_or(1); } + // Returns the compile-time constant lock value when `value` is defined by + // an arith.constant; otherwise emits an op error and returns failure. + mlir::FailureOr getConstantValue(); int getTimeout() { // LockBlocking is an EnumAttr. if (auto val = getBlocking()) diff --git a/lib/Dialect/AIE/IR/AIEDialect.cpp b/lib/Dialect/AIE/IR/AIEDialect.cpp index e20ad718830..69212c20f9f 100644 --- a/lib/Dialect/AIE/IR/AIEDialect.cpp +++ b/lib/Dialect/AIE/IR/AIEDialect.cpp @@ -8,9 +8,11 @@ #include "aie/Dialect/AIE/IR/AIEDialect.h" +#include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/IR/DialectImplementation.h" +#include "mlir/IR/Matchers.h" #include "mlir/IR/OpDefinition.h" #include "mlir/IR/SymbolTable.h" #include "mlir/Interfaces/FoldInterfaces.h" @@ -73,7 +75,15 @@ struct AIEDialectFoldInterface : DialectFoldInterface { // them with a core's identical constants, which would leave the core // referencing a device-level value that is erased when the core is // outlined. - return isa(region->getParentOp()); + // - aie.mem/aie.memtile_dma/aie.shim_dma bodies carry constant lock values + // (aie.use_lock operands). If these hoisted to the device, CSE would + // merge them with the identical constant kept local to a core, and since + // the device-level constant dominates the core, the core's use would be + // rewritten to reference it -- reintroducing the cross-region reference + // that breaks core outlining. Keeping them local avoids the dominating + // device-level duplicate entirely. + return isa( + region->getParentOp()); } }; @@ -2679,6 +2689,17 @@ LogicalResult LockOp::verify() { return success(); } +// Centralized lookup for the compile-time constant lock value: returns the +// integer if `op`'s value operand is defined by an arith.constant, otherwise +// std::nullopt. This is the single place that knows how a static lock value is +// recovered from the SSA operand. +static std::optional getConstantLockValue(UseLockOp op) { + if (auto constant = op.getValue().getDefiningOp()) + if (auto intAttr = llvm::dyn_cast(constant.getValue())) + return (int32_t)intAttr.getInt(); + return std::nullopt; +} + struct UsesOneLockInDMABlock { static LogicalResult verifyTrait(Operation *op) { auto *block = op->getBlock(); @@ -2700,16 +2721,21 @@ struct AcquireReleaseOneStateInDMABlock { auto *block = op->getBlock(); int acqValue = -1, relValue = -1; for (auto op : block->getOps()) { + // Non-constant lock values cannot be compared here; the passes that + // require a constant enforce that separately via getConstantValue(). + auto value = getConstantLockValue(op); + if (!value) + continue; if (op.acquire() || op.acquireGE()) { - if (acqValue != -1 && acqValue != op.getLockValue()) { + if (acqValue != -1 && acqValue != *value) { return failure(); } - acqValue = op.getLockValue(); + acqValue = *value; } else if (op.release()) { - if (relValue != -1 && relValue != op.getLockValue()) { + if (relValue != -1 && relValue != *value) { return failure(); } - relValue = op.getLockValue(); + relValue = *value; } } return success(); @@ -2737,6 +2763,15 @@ LogicalResult UseLockOp::verify() { return (*this)->emitOpError( "AcquireGreaterEqual is not supported in AIE1."); + // Locks used inside a DMA/BD block are configured via MMIO and therefore + // require a compile-time constant value (an arith.constant operand). + if (HasSomeParent::verifyTrait(*this) + .succeeded() && + !getConstantLockValue(*this)) + return (*this)->emitOpError( + "lock value in a DMA/BD block must be a compile-time constant " + "(defined by an arith.constant)."); + // Otherwise, AIE.useLock should be inside MemOp, MemTileDMAOp, or // ShimDMAOp, if (HasSomeParent::verifyTrait(*this) @@ -2821,9 +2856,80 @@ static void printTraceRegValue(OpAsmPrinter &printer, Operation *op, xilinx::AIE::printTraceEventEnum(printer, value); } +// Helper to parse a LockBlocking enum keyword. +static ParseResult parseLockBlockingKeyword(OpAsmParser &parser, + xilinx::AIE::LockBlockingAttr &blocking) { + StringRef keyword; + if (parser.parseKeyword(&keyword)) + return failure(); + auto symbol = xilinx::AIE::symbolizeLockBlocking(keyword); + if (!symbol) + return parser.emitError(parser.getCurrentLocation()) + << "invalid lock blocking value: " << keyword; + blocking = + xilinx::AIE::LockBlockingAttr::get(parser.getContext(), *symbol); + return success(); +} + +// Custom parser for the value slot of aie.use_lock. The lock value is a +// required `i32` SSA operand, optionally followed by a `blocking` keyword. The +// action keyword is parsed here as well so that the printed form has no stray +// space before the comma. +static ParseResult +parseUseLockValue(OpAsmParser &parser, xilinx::AIE::LockActionAttr &action, + OpAsmParser::UnresolvedOperand &value, + xilinx::AIE::LockBlockingAttr &blocking) { + // The action is accepted either as a bare keyword (`Acquire`) or, for + // backward compatibility with older textual IR, as a quoted string + // (`"Acquire"`). + StringRef actionKeyword; + std::string actionString; + if (succeeded(parser.parseOptionalKeyword(&actionKeyword))) { + // Parsed a bare keyword. + } else if (succeeded(parser.parseOptionalString(&actionString))) { + actionKeyword = actionString; + } else { + return parser.emitError(parser.getCurrentLocation()) + << "expected lock action keyword"; + } + auto actionSymbol = xilinx::AIE::symbolizeLockAction(actionKeyword); + if (!actionSymbol) + return parser.emitError(parser.getCurrentLocation()) + << "invalid lock action: " << actionKeyword; + action = xilinx::AIE::LockActionAttr::get(parser.getContext(), *actionSymbol); + + // The lock value SSA operand. + if (parser.parseComma() || parser.parseOperand(value)) + return failure(); + + // Optionally parse a trailing blocking keyword. + if (!parser.parseOptionalComma()) + return parseLockBlockingKeyword(parser, blocking); + return success(); +} + +// Custom printer for the value slot of aie.use_lock. +static void printUseLockValue(OpAsmPrinter &printer, Operation *op, + xilinx::AIE::LockActionAttr action, Value value, + xilinx::AIE::LockBlockingAttr blocking) { + printer << xilinx::AIE::stringifyLockAction(action.getValue()); + printer << ", "; + printer.printOperand(value); + if (blocking) + printer << ", " + << xilinx::AIE::stringifyLockBlocking(blocking.getValue()); +} + #define GET_OP_CLASSES #include "aie/Dialect/AIE/IR/AIEOps.cpp.inc" +FailureOr UseLockOp::getConstantValue() { + if (auto value = getConstantLockValue(*this)) + return *value; + return emitOpError("expected the lock value to be a compile-time constant " + "(defined by an arith.constant)."); +} + TileOp SwitchboxOp::getTileOp() { return cast(this->getOperation()).getTileOp(); } diff --git a/lib/Dialect/AIE/IR/CMakeLists.txt b/lib/Dialect/AIE/IR/CMakeLists.txt index e0ae5dfc541..b8517d55305 100644 --- a/lib/Dialect/AIE/IR/CMakeLists.txt +++ b/lib/Dialect/AIE/IR/CMakeLists.txt @@ -21,6 +21,7 @@ add_mlir_dialect_library(AIE LINK_LIBS PUBLIC MLIRAIEUtil + MLIRArithDialect MLIRIR MLIRSupport ) diff --git a/lib/Dialect/AIE/Transforms/AIECoreToStandard.cpp b/lib/Dialect/AIE/Transforms/AIECoreToStandard.cpp index face99510f8..3a3b6b2df7f 100644 --- a/lib/Dialect/AIE/Transforms/AIECoreToStandard.cpp +++ b/lib/Dialect/AIE/Transforms/AIECoreToStandard.cpp @@ -443,19 +443,19 @@ struct AIEUseLockToStdLowering : OpConversionPattern { return useLock.emitOpError("Could not find the intrinsic function!"); SmallVector args; - auto lockValue = useLock.getLockValue(); + auto i32Ty = IntegerType::get(rewriter.getContext(), 32); + args.push_back(arith::IndexCastOp::create(rewriter, useLock.getLoc(), + i32Ty, useLock.getLock())); - // AIE2 acquire greater equal is encoded as a negative value. + Value value = adaptor.getValue(); + // AIE2 acquire-greater-equal is encoded as a negative value, so negate + // it at runtime. if (useLock.acquireGE()) { - lockValue = -lockValue; + Value zero = arith::ConstantOp::create( + rewriter, useLock.getLoc(), i32Ty, rewriter.getI32IntegerAttr(0)); + value = arith::SubIOp::create(rewriter, useLock.getLoc(), zero, value); } - args.push_back(arith::IndexCastOp::create( - rewriter, useLock.getLoc(), - IntegerType::get(rewriter.getContext(), 32), useLock.getLock())); - args.push_back( - arith::ConstantOp::create(rewriter, useLock.getLoc(), - IntegerType::get(rewriter.getContext(), 32), - rewriter.getI32IntegerAttr(lockValue))); + args.push_back(value); func::CallOp::create(rewriter, useLock.getLoc(), useLockFunc, args); } diff --git a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp index 361862111c7..83b7a4dbebe 100644 --- a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp +++ b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp @@ -1458,575 +1458,6 @@ struct AIEObjectFifoStatefulTransformPass ValueRange(ArrayRef({index.getResult()}))); } - using FifoPort = std::pair; - - // Returns the innermost enclosing scf.for / scf.while that contains op - // without crossing another loop boundary, or null. For scf.while, only - // matches if op is in the after-region (the body); the before-region - // (the condition) is not analyzed. - Operation *innermostEnclosingLoop(Operation *op) { - Operation *cur = op->getParentOp(); - Region *prev = op->getParentRegion(); - while (cur) { - if (isa(cur)) - return cur; - if (auto w = dyn_cast(cur)) { - if (prev == &w.getAfter()) - return cur; - return nullptr; - } - if (isa(cur)) - return nullptr; - prev = cur->getParentRegion(); - cur = cur->getParentOp(); - } - return nullptr; - } - - // True if op is nested inside an scf.if / scf.index_switch anywhere - // strictly below loopOp. - bool isInsideIfInsideLoop(Operation *op, Operation *loopOp) { - Operation *cur = op->getParentOp(); - while (cur && cur != loopOp) { - if (isa(cur)) - return true; - cur = cur->getParentOp(); - } - return false; - } - - // Returns the child region of the innermost scf.if / scf.index_switch that - // encloses `op` strictly below `loopOp` (i.e. the specific branch/case `op` - // lives in), or null if `op` is not inside any conditional below loopOp. - // Used to group conditional acq/rel by branch so the per-branch net can be - // compared across all branches of the conditional. - Region *immediateCondRegion(Operation *op, Operation *loopOp) { - Operation *cur = op->getParentOp(); - Region *childRegion = op->getParentRegion(); - while (cur && cur != loopOp) { - if (isa(cur)) - return childRegion; - childRegion = cur->getParentRegion(); - cur = cur->getParentOp(); - } - return nullptr; - } - - // Conservative model of the lock-lowering's "currently held" count per - // (fifo, port) at the IR point immediately before `loopOp`. - // - // Scope: only the loop's immediate parent block is walked. Earlier - // peeled siblings show up correctly, but acq/rel in enclosing scopes - // outside the parent block are invisible. This relies on a contract - // with the lock-lowering: AcquireGreaterEqual semantics make it - // tolerant of an over-estimated peel-acquire (the runtime clamps - // against currently-held instead of acquiring redundantly), so a - // missed enclosing-scope acq/rel produces redundant IR rather than - // a producer-pool deadlock. If that lowering ever changes, this scope - // must be widened. - // - // Straight-line acq/rel update the count as expected. For nested ops we - // model what the lock-lowering would leave behind: - // - a nested loop body's net contribution to `held` is the body's - // per-iteration peak acquire size minus the in-body release sum, - // floored at 0. After the user's trailing-release drain (which - // appears as straight-line ops later in this same walk) the count - // returns to its true post-drain value. - // - a nested scf.if takes the max of its branches. - // - any other nested op containing acq/rel that we can't analyze - // marks the (fifo, port) "tainted" — the caller will not peel it. - llvm::MapVector - heldBeforeLoop(Operation *loopOp, llvm::SetVector &tainted) { - llvm::MapVector held; - std::function step; - step = [&](Operation &op) { - if (auto a = dyn_cast(&op)) { - FifoPort fp{a.getObjectFifo(), a.getPort()}; - held[fp] = std::max(held.lookup(fp), a.acqNumber()); - return; - } - if (auto r = dyn_cast(&op)) { - FifoPort fp{r.getObjectFifo(), r.getPort()}; - held[fp] = std::max(0, held.lookup(fp) - r.relNumber()); - return; - } - if (isa(&op)) { - // Per (fifo, port) used directly in the body: post-loop held delta - // is max(max_acq - sum_rel, 0). Bail (taint) on anything we can't - // see straight through (conditionals, nested loops in the body). - Region *body = isa(&op) - ? &cast(&op).getRegion() - : &cast(&op).getAfter(); - llvm::MapVector maxAcq, sumRel; - bool clean = true; - body->walk([&](Operation *inner) { - if (auto a = dyn_cast(inner)) { - if (innermostEnclosingLoop(a) != &op || - isInsideIfInsideLoop(a, &op)) { - tainted.insert({a.getObjectFifo(), a.getPort()}); - clean = false; - return; - } - FifoPort fp{a.getObjectFifo(), a.getPort()}; - maxAcq[fp] = std::max(maxAcq.lookup(fp), a.acqNumber()); - } else if (auto r = dyn_cast(inner)) { - if (innermostEnclosingLoop(r) != &op || - isInsideIfInsideLoop(r, &op)) { - tainted.insert({r.getObjectFifo(), r.getPort()}); - clean = false; - return; - } - FifoPort fp{r.getObjectFifo(), r.getPort()}; - sumRel[fp] = sumRel.lookup(fp) + r.relNumber(); - } - }); - if (!clean) - return; - for (const auto &kv : maxAcq) { - int delta = std::max(0, kv.second - sumRel.lookup(kv.first)); - held[kv.first] = std::max(held.lookup(kv.first), delta); - } - return; - } - // Any other op carrying acq/rel is unanalyzable. - bool unanalyzable = false; - op.walk([&](Operation *inner) { - if (auto a = dyn_cast(inner)) { - tainted.insert({a.getObjectFifo(), a.getPort()}); - unanalyzable = true; - } else if (auto r = dyn_cast(inner)) { - tainted.insert({r.getObjectFifo(), r.getPort()}); - unanalyzable = true; - } - }); - (void)unanalyzable; - }; - for (Operation &op : *loopOp->getBlock()) { - if (&op == loopOp) - break; - step(op); - } - return held; - } - - // Decide whether loopOp's body has positive cyclostatic carry on at least - // one (fifo, port). Conditionals (scf.if / scf.index_switch) whose branches - // all agree on the same per-fifo net are folded into the static carry (the - // delta is branch-independent, hence deterministic); only conditionals - // whose branches disagree are treated as unanalyzable. Diagnostics: - // - an in-body acq/rel inside a conditional whose branches are *unbalanced* - // (disagree on the net) for a (fifo, port) that also has an analyzable - // contribution (unconditional acq/rel, or a foldable conditional net) - // -> *condDiag is set and we return false (caller emits the diagnostic). - // Sets `taintedDiag` if peel must be skipped because a fifo's pre-loop - // held count cannot be analyzed (sibling loop / conditional touched the same - // fifo) — this is silent, not an error, since the lowering still produces - // correct (just unoptimized) code. - bool bodyHasCyclostaticCarry(Region *bodyRegion, Operation *loopOp, - Operation *&condDiag) { - llvm::MapVector maxAcq; - llvm::MapVector sumRel; - // For every conditional op (scf.if / scf.index_switch) directly below - // loopOp, accumulate the net (acquire - release) per (fifo, port) within - // each of its branch regions: - // condNet[condOp][branchRegion][fp] = net for that fifo on that path. - llvm::MapVector>> - condNet; - // Conditional acq/rel ops in walk order, for pointing the diagnostic at - // the first offending op of a fifo. - SmallVector> condOps; - condDiag = nullptr; - - bodyRegion->walk([&](Operation *op) { - if (auto a = dyn_cast(op)) { - if (innermostEnclosingLoop(a) != loopOp) - return; - FifoPort fp{a.getObjectFifo(), a.getPort()}; - if (Region *r = immediateCondRegion(a, loopOp)) { - condNet[r->getParentOp()][r][fp] += a.acqNumber(); - condOps.push_back({a, fp}); - } else { - maxAcq[fp] = std::max(maxAcq.lookup(fp), a.acqNumber()); - } - } else if (auto r = dyn_cast(op)) { - if (innermostEnclosingLoop(r) != loopOp) - return; - FifoPort fp{r.getObjectFifo(), r.getPort()}; - if (Region *reg = immediateCondRegion(r, loopOp)) { - condNet[reg->getParentOp()][reg][fp] -= r.relNumber(); - condOps.push_back({r, fp}); - } else { - sumRel[fp] = sumRel.lookup(fp) + r.relNumber(); - } - } - }); - - // Classify each conditional op's contribution per (fifo, port). - // - // A conditional whose branches all agree on the same net C for a fifo - // contributes a *deterministic* per-iteration delta of C, regardless of - // which branch runs. That is indistinguishable from an unconditional - // acquire/release of net C, so it can be folded into the static carry. - // C == 0 (a branch that acquires and releases the same amount) is just - // the special case that adds nothing. - // - // When the branches *disagree* the per-iteration delta is data - // dependent, so the fifo is "unbalanced-conditional": the straight-line - // carry computation cannot account for it. Every branch region of the - // conditional participates — a branch that never touches the fifo (or an - // empty/absent else branch) counts as net 0, so an asymmetric - // "acquire on one path only" is correctly flagged. - llvm::MapVector condCarry; // folded deterministic net - llvm::SetVector unbalancedCond; // branches disagree - for (auto &opEntry : condNet) { - Operation *condOp = opEntry.first; - auto &branchMap = opEntry.second; - llvm::SetVector touched; - for (auto ®Entry : branchMap) - for (auto &kv : regEntry.second) - touched.insert(kv.first); - for (const FifoPort &fp : touched) { - bool first = true, allEqual = true; - int common = 0; - for (Region ® : condOp->getRegions()) { - int net = 0; - auto it = branchMap.find(®); - if (it != branchMap.end()) - net = it->second.lookup(fp); - if (first) { - common = net; - first = false; - } else if (net != common) { - allEqual = false; - break; - } - } - if (allEqual) - condCarry[fp] += common; - else - unbalancedCond.insert(fp); - } - } - - // An unbalanced-conditional fifo is unanalyzable. We only *error* when it - // is mixed with an analyzable contribution for the same fifo — an - // unconditional acq/rel or a foldable conditional net — because then the - // peel would be based on an incomplete carry. A fifo that is *purely* - // unbalanced-conditional (no other use) is left alone: the lock-lowering - // tracks each path on its own and the loop still lowers correctly, - // just without the peel optimization. - for (const auto &fp : unbalancedCond) { - if (maxAcq.count(fp) || sumRel.count(fp) || condCarry.count(fp)) { - for (const auto &co : condOps) { - if (co.second != fp) - continue; - Region *reg = immediateCondRegion(co.first, loopOp); - Operation *condOp = reg ? reg->getParentOp() : nullptr; - // Point at an op living in a branch that disagrees with the rest. - auto opIt = condOp ? condNet.find(condOp) : condNet.end(); - if (opIt == condNet.end()) - continue; - bool opUnbalanced = false; - int common = 0; - bool first = true; - for (Region &r : condOp->getRegions()) { - int net = 0; - auto bit = opIt->second.find(&r); - if (bit != opIt->second.end()) - net = bit->second.lookup(fp); - if (first) { - common = net; - first = false; - } else if (net != common) { - opUnbalanced = true; - break; - } - } - if (opUnbalanced) { - condDiag = co.first; - break; - } - } - return false; // condDiag now points at the offending conditional op - } - } - - // Fold the deterministic conditional net into the static carry. For a - // pure-conditional fifo whose branches all agree, this is the whole - // carry (maxAcq/sumRel are zero); the peel still clones the entire - // iteration 0 including the conditional, so AcquireGreaterEqual clamping - // keeps it correct. - llvm::SetVector fifos; - for (const auto &kv : maxAcq) - fifos.insert(kv.first); - for (const auto &kv : condCarry) - fifos.insert(kv.first); - - llvm::SetVector tainted; - auto held = heldBeforeLoop(loopOp, tainted); - for (const FifoPort &fp : fifos) { - if (tainted.contains(fp)) - continue; - int carry = maxAcq.lookup(fp) - sumRel.lookup(fp) + condCarry.lookup(fp); - int peelCarry = carry - held.lookup(fp); - if (peelCarry > 0) - return true; - } - return false; - } - - // Detect cyclostatic acquire/release patterns inside loop bodies and peel - // iteration 0 in place so that the in-body acquire's emitted - // `AcquireGreaterEqual` value naturally becomes the steady-state delta. - // Peeling preserves the user's body ordering between operations on - // different fifos — critical for cross-core sync correctness. - // - // Walk order matters: peel inner loops first. `Operation::walk` defaults - // to post-order, so children are collected before their parents — relied - // on here. If an outer loop is peeled before its child, the cloned inner - // loop sitting in the peeled iter-0 body is not in `loopOps` and never - // gets peeled (the lock-lowering's AcquireGreaterEqual clamping keeps that - // correct, but the IR is redundant). Do not change to PreOrder. - LogicalResult peelCyclostaticAcquires(CoreOp coreOp, OpBuilder &builder) { - SmallVector loopOps; - coreOp.walk([&](Operation *op) { - if (isa(op)) - loopOps.push_back(op); - }); - - LogicalResult overall = success(); - for (Operation *loopOp : loopOps) { - Region *bodyRegion; - if (auto f = dyn_cast(loopOp)) - bodyRegion = &f.getRegion(); - else - bodyRegion = &cast(loopOp).getAfter(); - - Operation *condDiag = nullptr; - if (!bodyHasCyclostaticCarry(bodyRegion, loopOp, condDiag)) { - if (condDiag) { - condDiag->emitOpError( - "cannot statically analyze cyclostatic acquire pattern: " - "acquire/release is inside a conditional"); - overall = failure(); - } - continue; - } - - if (auto forOp = dyn_cast(loopOp)) { - if (failed(peelScfFor(forOp, builder))) - overall = failure(); - } else { - if (failed(peelScfWhile(cast(loopOp), builder))) - overall = failure(); - } - } - return overall; - } - - // Peel iteration 0 of `forOp` in place. The peeled body is inserted - // immediately before the loop; the loop's lb is advanced by step. When - // bounds are not statically known to execute at least once, the peeled - // body is wrapped in scf.if guarded by a runtime trip-count check. - // - // Returns success without peeling (a no-op) if the step sign cannot be - // determined at compile time, since the runtime guard predicate is - // sign-dependent. The loop still lowers correctly via the unoptimized - // path; only the AcquireGreaterEqual delta optimization is skipped. - LogicalResult peelScfFor(scf::ForOp forOp, OpBuilder &builder) { - Location loc = forOp.getLoc(); - Value lb = forOp.getLowerBound(); - Value ub = forOp.getUpperBound(); - Value step = forOp.getStep(); - OperandRange initArgs = forOp.getInitArgs(); - Type ivTy = lb.getType(); - assert(ivTy.isIndex() || ivTy.isSignlessInteger()); - - auto cLb = getConstantIntValue(lb); - auto cUb = getConstantIntValue(ub); - auto cStep = getConstantIntValue(step); - - // scf.for requires step != 0 with consistent sign progression. Without - // a known step sign we can't pick the right runtime guard predicate - // (positive: lb+step <= ub; negative: lb+step >= ub), so bail out. - // This is correctness, not just optimization: the wrong predicate on - // a negative-step loop would skip the entire trimmed loop body. - if (!cStep) - return success(); - bool positiveStep = *cStep > 0; - bool provablyAtLeastOne = - ivTy.isIndex() && cLb && cUb && positiveStep && (*cUb - *cLb) >= *cStep; - - builder.setInsertionPoint(forOp); - - auto cloneBody = [&](OpBuilder &b, - ValueRange ivAndArgs) -> SmallVector { - IRMapping map; - Block &srcBlock = forOp.getRegion().front(); - map.map(srcBlock.getArgument(0), ivAndArgs[0]); - for (unsigned i = 0; i < initArgs.size(); ++i) - map.map(srcBlock.getArgument(1 + i), ivAndArgs[1 + i]); - for (Operation &op : srcBlock.without_terminator()) - b.clone(op, map); - auto yieldOp = cast(srcBlock.getTerminator()); - SmallVector yielded; - for (Value v : yieldOp.getOperands()) - yielded.push_back(map.lookupOrDefault(v)); - return yielded; - }; - - SmallVector peelResults; - if (provablyAtLeastOne) { - SmallVector ivAndArgs{lb}; - ivAndArgs.append(initArgs.begin(), initArgs.end()); - peelResults = cloneBody(builder, ivAndArgs); - } else { - // Guard: (lb + step) does not pass ub. For positive step that's - // ub - lb >= step (sge); for negative step lb - ub >= -step (sge, - // with both sides flipped). step's sign is known at this point — - // the early return above bails out otherwise. - Value diff = positiveStep ? arith::SubIOp::create(builder, loc, ub, lb) - : arith::SubIOp::create(builder, loc, lb, ub); - Value absStep = - positiveStep - ? step - : arith::SubIOp::create( - builder, loc, - arith::ConstantOp::create( - builder, loc, - ivTy.isIndex() - ? cast(builder.getIndexAttr(0)) - : cast(builder.getIntegerAttr(ivTy, 0))), - step); - Value cond = arith::CmpIOp::create( - builder, loc, arith::CmpIPredicate::sge, diff, absStep); - SmallVector resultTypes(initArgs.getTypes()); - auto ifOp = scf::IfOp::create(builder, loc, resultTypes, cond, - /*withElseRegion=*/true); - Block &thenBlock = ifOp.getThenRegion().front(); - OpBuilder thenBuilder(&thenBlock, thenBlock.begin()); - SmallVector ivAndArgs{lb}; - ivAndArgs.append(initArgs.begin(), initArgs.end()); - SmallVector y = cloneBody(thenBuilder, ivAndArgs); - thenBlock.getTerminator()->erase(); - thenBuilder.setInsertionPointToEnd(&thenBlock); - scf::YieldOp::create(thenBuilder, loc, y); - - Block &elseBlock = ifOp.getElseRegion().front(); - elseBlock.getTerminator()->erase(); - OpBuilder elseBuilder(&elseBlock, elseBlock.end()); - scf::YieldOp::create(elseBuilder, loc, ValueRange(initArgs)); - - peelResults.assign(ifOp.getResults().begin(), ifOp.getResults().end()); - } - - Value newLb = arith::AddIOp::create(builder, loc, lb, step); - forOp.getLowerBoundMutable().assign(newLb); - if (!peelResults.empty()) { - assert(peelResults.size() == initArgs.size()); - forOp.getInitArgsMutable().assign(peelResults); - } - return success(); - } - - // Peel iteration 0 of `whileOp`. Strategy: clone the before-region inline - // to get the iter-0 condition and forwarded values, then build an - // scf.if(iter0Cond) whose then-branch runs iter-0 of the after-region and - // re-enters a fresh clone of the while-loop for iterations 1..N. The - // original while is erased. - LogicalResult peelScfWhile(scf::WhileOp whileOp, OpBuilder &builder) { - Location loc = whileOp.getLoc(); - Region &beforeRegion = whileOp.getBefore(); - Region &afterRegion = whileOp.getAfter(); - OperandRange initArgs = whileOp.getInits(); - - // Cloning the before-region twice would execute its side effects twice; - // bail out cleanly if any are present. - for (Operation &op : beforeRegion.front().without_terminator()) { - if (!isMemoryEffectFree(&op)) { - whileOp.emitWarning( - "cyclostatic acquire peel skipped: scf.while before-region has " - "side effects (duplicating it would change semantics); the loop " - "lowers correctly without the AcquireGreaterEqual delta " - "optimization. Rewrite as scf.for to enable it."); - return success(); - } - } - - builder.setInsertionPoint(whileOp); - - // Iter-0 condition + forwarded values (clone of before-region). - IRMapping beforeMap; - for (unsigned i = 0; i < initArgs.size(); ++i) - beforeMap.map(beforeRegion.front().getArgument(i), initArgs[i]); - for (Operation &op : beforeRegion.front().without_terminator()) - builder.clone(op, beforeMap); - auto beforeTerm = - cast(beforeRegion.front().getTerminator()); - Value iter0Cond = beforeMap.lookupOrDefault(beforeTerm.getCondition()); - SmallVector iter0Vals; - for (Value v : beforeTerm.getArgs()) - iter0Vals.push_back(beforeMap.lookupOrDefault(v)); - - SmallVector resultTypes(whileOp.getResultTypes()); - auto ifOp = scf::IfOp::create(builder, loc, resultTypes, iter0Cond, - /*withElseRegion=*/!resultTypes.empty()); - - // Then branch: peeled iter-0 body, followed by a fresh while running - // iterations 1..N seeded by the after-region's yielded values. - OpBuilder thenBuilder = ifOp.getThenBodyBuilder(); - IRMapping afterMap; - Block &abb = afterRegion.front(); - for (unsigned i = 0; i < iter0Vals.size(); ++i) - afterMap.map(abb.getArgument(i), iter0Vals[i]); - for (Operation &op : abb.without_terminator()) - thenBuilder.clone(op, afterMap); - auto afterYield = cast(abb.getTerminator()); - SmallVector nextInits; - for (Value v : afterYield.getOperands()) - nextInits.push_back(afterMap.lookupOrDefault(v)); - - auto trimmedWhile = - scf::WhileOp::create(thenBuilder, loc, resultTypes, nextInits); - { - IRMapping bMap; - trimmedWhile.getBefore().push_back(new Block()); - Block &nb = trimmedWhile.getBefore().front(); - for (auto t : initArgs.getTypes()) - nb.addArgument(t, loc); - for (unsigned i = 0; i < initArgs.size(); ++i) - bMap.map(beforeRegion.front().getArgument(i), nb.getArgument(i)); - OpBuilder b(&nb, nb.end()); - for (Operation &op : beforeRegion.front()) - b.clone(op, bMap); - } - { - IRMapping aMap; - trimmedWhile.getAfter().push_back(new Block()); - Block &na = trimmedWhile.getAfter().front(); - for (auto t : llvm::to_vector(beforeTerm.getArgs().getTypes())) - na.addArgument(t, loc); - for (unsigned i = 0; i < na.getNumArguments(); ++i) - aMap.map(afterRegion.front().getArgument(i), na.getArgument(i)); - OpBuilder b(&na, na.end()); - for (Operation &op : afterRegion.front()) - b.clone(op, aMap); - } - - if (!resultTypes.empty()) - scf::YieldOp::create(thenBuilder, loc, trimmedWhile.getResults()); - - if (!resultTypes.empty()) { - OpBuilder elseBuilder = ifOp.getElseBodyBuilder(); - scf::YieldOp::create(elseBuilder, loc, iter0Vals); - } - - whileOp.replaceAllUsesWith(ifOp.getResults()); - whileOp.erase(); - return success(); - } - // Function that generates the IR for objectfifo accesses to be handled at // runtime. LogicalResult dynamicGlobalObjectFifos(DeviceOp &device, OpBuilder &builder, @@ -2035,8 +1466,6 @@ struct AIEObjectFifoStatefulTransformPass for (auto coreOp : device.getOps()) { if (objectFifoTiles.count(coreOp.getTileOp()) <= 0) continue; - if (failed(peelCyclostaticAcquires(coreOp, builder))) - return failure(); if (objectFifoTiles.count(coreOp.getTileOp()) > 0) { // For each core: count the number of objectFifos and create // a global buffer just before the core to track index of @@ -2243,6 +1672,38 @@ struct AIEObjectFifoStatefulTransformPass } } + /// Emit a UseLockOp whose lock value is a runtime-computed SSA i32. Used by + /// the dynamic objectFifo lowering, where the number of locks to + /// acquire/release is not known at compile time. Only valid for AIE2 + /// semaphore locks (the dynamic lowering targets AIE2/AIE2p). + void createUseLocksRuntime(OpBuilder &builder, ObjectFifoCreateOp op, + ObjectFifoPort port, Value count, + LockAction lockAction, ObjectFifoState &state) { + ObjectFifoCreateOp target = op; + if (auto linkOp = getOptionalLinkOp(op)) + if (state.objFifoLinks.find(*linkOp) != state.objFifoLinks.end()) + target = state.objFifoLinks[*linkOp]; + + if (state.locksPerFifo[target].size() == 0) + return; + + // Select the correct lock based on the port and action, mirroring the + // semaphore-lock branch of createUseLocks(). + LockOp lock; + if (lockAction == LockAction::AcquireGreaterEqual) { + if (port == ObjectFifoPort::Produce) + lock = state.locksPerFifo[target][0]; + else + lock = state.locksPerFifo[target][1]; + } else { + if (port == ObjectFifoPort::Produce) + lock = state.locksPerFifo[target][1]; + else + lock = state.locksPerFifo[target][0]; + } + UseLockOp::create(builder, op.getLoc(), lock, lockAction, count); + } + /// Function used to check whether op is already contained in map. /// If it is then return the associated int, if not create new entry and /// return 0. @@ -2843,7 +2304,11 @@ struct AIEObjectFifoStatefulTransformPass //===------------------------------------------------------------------===// // Statically unroll for loops or use dynamic objectFifos //===------------------------------------------------------------------===// + // Tiles whose objectFifo accesses are lowered dynamically (runtime buffer + // addressing and runtime lock counts) rather than by static loop unrolling. + std::set dynamicLoweringTiles; if (clDynamicObjectFifos) { + dynamicLoweringTiles = objectFifoTiles; if (failed(dynamicGlobalObjectFifos(device, builder, objectFifoTiles, state))) return signalPassFailure(); @@ -2863,6 +2328,7 @@ struct AIEObjectFifoStatefulTransformPass } } } + dynamicLoweringTiles = dynamicTiles; if (failed( dynamicGlobalObjectFifos(device, builder, dynamicTiles, state))) return signalPassFailure(); @@ -2892,6 +2358,63 @@ struct AIEObjectFifoStatefulTransformPass relPerFifo; // maps each objFifo to its next index to release within // this CoreOp + //===----------------------------------------------------------------===// + // Dynamic lock bookkeeping setup + //===----------------------------------------------------------------===// + // For tiles using the dynamic objectFifo lowering, the number of locks + // to acquire is computed at runtime from a per-(fifo,port) "held" counter + // stored in a local buffer. This replaces the static (cyclostatic) + // accounting that cannot see through runtime-dependent control flow. + // Runtime lock counts require semaphore locks (AIE2+); on architectures + // with binary locks (AIE1) the dynamic lowering keeps static lock counts. + bool isDynamicCore = + dynamicLoweringTiles.count(coreOp.getTileOp()) > 0 && + device.getTargetModel().hasProperty( + AIETargetModel::UsesSemaphoreLocks); + BufferOp heldBuffer; + DenseMap, Value> heldSlotIndex; + if (isDynamicCore) { + DenseMap, int> heldSlot; + // Ordered list of (fifo, port) keys indexed by their slot number, so + // that the counter buffer is initialized deterministically (a plain + // DenseMap iteration order is not stable). + SmallVector> slotOrder; + auto assignSlot = [&](ObjectFifoCreateOp fifo, ObjectFifoPort p) { + int pn = p == ObjectFifoPort::Produce ? 0 : 1; + if (!heldSlot.count({fifo, pn})) { + heldSlot[{fifo, pn}] = slotOrder.size(); + slotOrder.push_back({fifo, pn}); + } + }; + coreOp.walk([&](ObjectFifoAcquireOp a) { + assignSlot(a.getObjectFifo(), a.getPort()); + }); + coreOp.walk([&](ObjectFifoReleaseOp r) { + assignSlot(r.getObjectFifo(), r.getPort()); + }); + if (!slotOrder.empty()) { + builder.setInsertionPoint(coreOp); + auto heldTy = + MemRefType::get(SmallVector{(int64_t)slotOrder.size()}, + builder.getI32Type()); + heldBuffer = BufferOp::create( + builder, coreOp.getLoc(), heldTy, coreOp.getTile(), + /*sym_name*/ nullptr, /*address*/ nullptr, + /*initial_value*/ nullptr, /*mem_bank*/ nullptr, + /*aligned*/ nullptr); + builder.setInsertionPointToStart(&(coreOp.getBody().front())); + Value zero = arith::ConstantOp::create( + builder, coreOp.getLoc(), builder.getI32IntegerAttr(0)); + for (int slot = 0; slot < (int)slotOrder.size(); ++slot) { + Value idx = arith::ConstantOp::create( + builder, coreOp.getLoc(), builder.getIndexAttr(slot)); + heldSlotIndex[slotOrder[slot]] = idx; + memref::StoreOp::create(builder, coreOp.getLoc(), zero, heldBuffer, + ValueRange(ArrayRef({idx}))); + } + } + } + //===----------------------------------------------------------------===// // Replace objectFifo.release ops //===----------------------------------------------------------------===// @@ -2930,6 +2453,21 @@ struct AIEObjectFifoStatefulTransformPass createUseLocks(builder, op, port, relPerFifo, numLocks, LockAction::Release, state); + // For dynamic tiles, decrement the runtime "held" counter by the + // number of released elements. + if (isDynamicCore && heldBuffer) { + Value idx = heldSlotIndex[{op, portNum}]; + Value held = memref::LoadOp::create(builder, releaseOp.getLoc(), + heldBuffer, + ValueRange(ArrayRef({idx}))); + Value m = arith::ConstantOp::create( + builder, releaseOp.getLoc(), builder.getI32IntegerAttr(numLocks)); + Value newHeld = + arith::SubIOp::create(builder, releaseOp.getLoc(), held, m); + memref::StoreOp::create(builder, releaseOp.getLoc(), newHeld, + heldBuffer, ValueRange(ArrayRef({idx}))); + } + // register release op if (releaseOps.find({op, portNum}) != releaseOps.end()) { releaseOps[{op, portNum}].push_back(releaseOp); @@ -2975,6 +2513,61 @@ struct AIEObjectFifoStatefulTransformPass acqPerFifo, {op, portNum}); // useful for keeping track of which // indices are acquired + // if objFifo was linked with others, find which objFifos + // elements to use + ObjectFifoCreateOp target = op; + if (linkOp) + if (state.objFifoLinks.find(*linkOp) != state.objFifoLinks.end()) + target = state.objFifoLinks[*linkOp]; + + // For dynamic tiles, compute the number of locks to acquire at runtime + // as max(0, acqNumber - held), using the runtime "held" counter. Buffer + // addressing for size > 1 fifos is handled separately (via runtime + // index_switch in dynamicGlobalObjectFifos); the subview references + // built below are only used for size-1 fifos. + if (isDynamicCore && heldBuffer) { + builder.setInsertionPointAfter(acquireOp); + int acqNum = acquireOp.acqNumber(); + int repeat = op.getRepeatCount().value_or(1); + Value idx = heldSlotIndex[{op, portNum}]; + Value held = memref::LoadOp::create(builder, acquireOp.getLoc(), + heldBuffer, + ValueRange(ArrayRef({idx}))); + Value nVal = arith::ConstantOp::create( + builder, acquireOp.getLoc(), builder.getI32IntegerAttr(acqNum)); + Value zero = arith::ConstantOp::create( + builder, acquireOp.getLoc(), builder.getI32IntegerAttr(0)); + Value rawDelta = + arith::SubIOp::create(builder, acquireOp.getLoc(), nVal, held); + Value delta = arith::MaxSIOp::create(builder, acquireOp.getLoc(), + rawDelta, zero); + if (repeat > 1) { + Value repeatVal = arith::ConstantOp::create( + builder, acquireOp.getLoc(), + builder.getI32IntegerAttr(repeat)); + delta = arith::MulIOp::create(builder, acquireOp.getLoc(), delta, + repeatVal); + } + createUseLocksRuntime(builder, op, port, delta, + LockAction::AcquireGreaterEqual, state); + Value newHeld = + arith::AddIOp::create(builder, acquireOp.getLoc(), held, delta); + memref::StoreOp::create(builder, acquireOp.getLoc(), newHeld, + heldBuffer, ValueRange(ArrayRef({idx}))); + + // Build the subview buffer references (used by the subview.access + // replacement below for size-1 fifos). + std::vector subviewRefs; + subviewRefs.reserve(acqNum); + for (int i = 0; i < acqNum; i++) { + subviewRefs.push_back(&state.buffersPerFifo[target][start]); + start = (start + 1) % op.size(); + } + subviews[acquireOp] = subviewRefs; + acqPerFifo[{op, portNum}] = start; + return WalkResult::advance(); + } + // check how many elements have been released in between this AcquireOp // and the previous one // !!! operations may not be in the same block !!! @@ -3043,13 +2636,6 @@ struct AIEObjectFifoStatefulTransformPass createUseLocks(builder, op, port, acqPerFifo, numCreate, LockAction::AcquireGreaterEqual, state); - // if objFifo was linked with others, find which objFifos - // elements to use - ObjectFifoCreateOp target = op; - if (linkOp) - if (state.objFifoLinks.find(*linkOp) != state.objFifoLinks.end()) - target = state.objFifoLinks[*linkOp]; - // create subview: buffers that were already acquired + new acquires for (int i = 0; i < numCreate; i++) { acquiredIndices.push_back(start); diff --git a/lib/Dialect/AIEX/Transforms/AIECreateLocks.cpp b/lib/Dialect/AIEX/Transforms/AIECreateLocks.cpp index d9c99bf9585..5bb3adf7c97 100644 --- a/lib/Dialect/AIEX/Transforms/AIECreateLocks.cpp +++ b/lib/Dialect/AIEX/Transforms/AIECreateLocks.cpp @@ -11,6 +11,7 @@ #include "aie/Dialect/AIEX/IR/AIEXDialect.h" #include "aie/Dialect/AIEX/Transforms/AIEXPasses.h" +#include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" @@ -136,6 +137,9 @@ static int getLockID(DenseMap, int> &locks, struct AIECreateLocksPass : public xilinx::AIEX::impl::AIECreateLocksBase { + void getDependentDialects(DialectRegistry ®istry) const override { + registry.insert(); + } void runOnOperation() override { DeviceOp device = getOperation(); diff --git a/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp b/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp index 7f8f13f2a54..1098d778a3a 100644 --- a/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp +++ b/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp @@ -161,6 +161,8 @@ struct AIEDMATasksToNPUPass [&](AIE::DMABDOp bd_op) { return WalkResult::advance(); }) .Case( [&](AIE::UseLockOp lock_op) { return WalkResult::advance(); }) + .Case( + [&](arith::ConstantOp const_op) { return WalkResult::advance(); }) .Case( [&](AIE::NextBDOp lock_op) { return WalkResult::advance(); }) .Case( @@ -536,7 +538,10 @@ struct AIEDMATasksToNPUPass if (acq_lock.getLockID().has_value()) { lock_acq_id = acq_lock.getLockID().value(); - lock_acq_val = acquire_op.getLockValue(); + auto value = acquire_op.getConstantValue(); + if (failed(value)) + return failure(); + lock_acq_val = *value; // For AcquireGreaterEqual, negate the value to signal the hardware // to use >= comparison instead of == comparison. if (acquire_op.acquireGE()) @@ -546,7 +551,10 @@ struct AIEDMATasksToNPUPass if (rel_lock.getLockID().has_value()) { lock_rel_id = rel_lock.getLockID().value(); - lock_rel_val = release_op.getLockValue(); + auto value = release_op.getConstantValue(); + if (failed(value)) + return failure(); + lock_rel_val = *value; } // For memtile, add lock offset using getLockLocalBaseIndex. diff --git a/lib/Dialect/AIEX/Transforms/AIELowerScratchpadParameters.cpp b/lib/Dialect/AIEX/Transforms/AIELowerScratchpadParameters.cpp index 2101bb467e5..93461e6c1ed 100644 --- a/lib/Dialect/AIEX/Transforms/AIELowerScratchpadParameters.cpp +++ b/lib/Dialect/AIEX/Transforms/AIELowerScratchpadParameters.cpp @@ -79,6 +79,10 @@ struct AIELowerScratchpadParametersPass AIELowerScratchpadParametersPass> { using AIELowerScratchpadParametersBase::AIELowerScratchpadParametersBase; + void getDependentDialects(DialectRegistry ®istry) const override { + registry.insert(); + } + // For each read_scratchpad_parameter of a unique parameter, create a 2xi32 // buffer and store a reference to it on the ReadScratchpadParameterOp as // the `buffer` attribute. diff --git a/lib/Targets/AIERT.cpp b/lib/Targets/AIERT.cpp index f3623a442eb..16957eb3e1d 100644 --- a/lib/Targets/AIERT.cpp +++ b/lib/Targets/AIERT.cpp @@ -319,18 +319,26 @@ LogicalResult configureLocksInBdBlock(const AIE::AIETargetModel &targetModel, lock = cast(op.getLock().getDefiningOp()); switch (op.getAction()) { case AIE::LockAction::Acquire: - case AIE::LockAction::AcquireGreaterEqual: + case AIE::LockAction::AcquireGreaterEqual: { acqEn = op.getAcqEn(); acqLockId = lock.getLockIDValue(); - acqValue = op.getLockValue(); + auto value = op.getConstantValue(); + if (failed(value)) + return failure(); + acqValue = *value; if (op.acquireGE()) acqValue.value() = -acqValue.value(); break; - case AIE::LockAction::Release: + } + case AIE::LockAction::Release: { relLockId = lock.getLockIDValue(); - relValue = op.getLockValue(); + auto value = op.getConstantValue(); + if (failed(value)) + return failure(); + relValue = *value; break; } + } } assert(acqValue && relValue && acqLockId && relLockId && diff --git a/lib/Targets/AIETargetXAIEV2.cpp b/lib/Targets/AIETargetXAIEV2.cpp index 50c59838c42..38c2c6656b6 100644 --- a/lib/Targets/AIETargetXAIEV2.cpp +++ b/lib/Targets/AIETargetXAIEV2.cpp @@ -167,13 +167,19 @@ static mlir::LogicalResult generateDMAConfig(OpType memOp, raw_ostream &output, if (op.acquire() || op.acquireGE()) { hasAcq = true; acqLockID = lockID; - acqValue = op.getLockValue(); + auto value = op.getConstantValue(); + if (failed(value)) + return failure(); + acqValue = *value; if (op.acquireGE()) acqValue = -acqValue; } else if (op.release()) { hasRel = true; relLockID = lockID; - relValue = op.getLockValue(); + auto value = op.getConstantValue(); + if (failed(value)) + return failure(); + relValue = *value; } else { // unreachable for current targets return op.emitOpError("unsupported lock action"); diff --git a/python/dialects/aie.py b/python/dialects/aie.py index 82cd9b97a61..fdef79b6205 100644 --- a/python/dialects/aie.py +++ b/python/dialects/aie.py @@ -79,6 +79,22 @@ register_dialect(get_dialect_registry()) assert _cext.globals._check_dialect_module_loaded("aie") +# The generated `use_lock` builder takes the lock value as an SSA i32 operand. +# Wrap it so callers may still pass a plain Python int (materialized as an +# arith.constant) or omit the value entirely (defaults to 1), while also +# accepting a Value for runtime-parameterized lock values. +from ._aie_ops_gen import use_lock as _use_lock + + +def use_lock(lock, action, value=None, *, blocking=None, acq_en=None, loc=None, ip=None): + if value is None: + value = 1 + if isinstance(value, int): + value = constant(value, T.i32()) + return _use_lock( + lock, action, value, blocking=blocking, acq_en=acq_en, loc=loc, ip=ip + ) + # Included in aie instead of aiex to avoid circular imports, as buffer uses this from ._aiex_ops_gen import NpuWriteRTPOp From c15c1d5f75284d9f37085ef07fc6f44164ad9ae8 Mon Sep 17 00:00:00 2001 From: andrej Date: Thu, 9 Jul 2026 10:43:45 -0600 Subject: [PATCH 2/9] AIE: tests for dynamic objectFifo lock lowering Update lock-bearing goldens for the new i32 SSA aie.use_lock value form, add dynamic_runtime_lock_* tests covering the runtime "held"-counter lock bookkeeping, add a bad-input test for a non-constant use_lock value where a constant is required, and drop the dynamic_cyclostatic_* goldens that exercised the removed static peel/held-before-loop lock accounting. --- .../assign-bd-ids/bad_bd_assignments.mlir | 36 +- test/Passes/assign-bd-ids/basic.mlir | 84 ++- test/Passes/assign-bd-ids/exhausted_bds.mlir | 150 +++-- test/Passes/assign-bd-ids/user_assigned.mlir | 144 +++-- .../Passes/lower-set-lock/lower_set_lock.mlir | 6 +- .../transform-bfp-types/bfp-invalid.mlir | 6 +- test/Passes/transform-bfp-types/bfp.mlir | 6 +- test/Targets/AIEGenerateXAIE/aie2_nd_DMA.mlir | 24 +- .../Targets/AIEGenerateXAIE/aie2_tileDMA.mlir | 6 +- .../AIEGenerateXAIE/aie2_tileDMA2.mlir | 3 +- .../AIEGenerateXAIE/aie2_tileDMA3.mlir | 3 +- .../AIEGenerateXAIE/aie2_tileDMA4.mlir | 6 +- .../AIEGenerateXAIE/aie2_tileDMA5.mlir | 24 +- .../AIEGenerateXAIE/aie2_tileDMA_locks.mlir | 15 +- test/Targets/AIEGenerateXAIE/memTileDMA.mlir | 24 +- test/Targets/AIEGenerateXAIE/memTileDMA2.mlir | 9 +- test/Targets/AIEGenerateXAIE/memTileDMA3.mlir | 24 +- .../AIEGenerateXAIE/packet_drop_header.mlir | 12 +- .../AIEGenerateXAIE/packet_shim_header.mlir | 12 +- test/Targets/AIEGenerateXAIE/shim.mlir | 6 +- .../AIEGenerateXAIE/shim_dma_packet.mlir | 6 +- .../test_error_dma_multi_lock.mlir | 12 +- .../test_error_dma_multi_state.mlir | 12 +- .../test_error_shimdma_multi_lock.mlir | 12 +- .../test_error_shimdma_multi_state.mlir | 12 +- test/Targets/AIEGenerateXAIE/test_xaie1.mlir | 6 +- test/Targets/AIEGenerateXAIE/test_xaie2.mlir | 12 +- test/Targets/AIEGenerateXAIE/test_xaie3.mlir | 6 +- test/Targets/AIEGenerateXAIE/test_xaie4.mlir | 12 +- test/Targets/AIEGenerateXAIE/tileDMA.mlir | 12 +- test/Targets/AIETargetCDODirect/shims.mlir | 6 +- ..._slice_lowering_equivalence.divergent.mlir | 6 +- ...core_slice_lowering_equivalence.slice.mlir | 6 +- ..._slice_lowering_equivalence.wrongcore.mlir | 6 +- .../per_core_slice_lowering_equivalence.mlir | 18 +- .../bad_alignment.mlir | 24 +- .../dma-tasks-to-npu/dma_task_with_locks.mlir | 48 +- .../materialize-bd-chains/good-2.mlir | 72 ++- .../01_DDR_SHIM_LM_FillRate/aie.mlir | 12 +- .../02_LM_SHIM_DDR_FillRate/aie.mlir | 12 +- test/benchmarks/03_Flood_DDR/aie.mlir | 192 ++++-- .../benchmarks/04_Tile_Tile_FillRate/aie.mlir | 12 +- test/benchmarks/07_Lock_Acquire/aie.mlir | 3 +- test/benchmarks/08_Lock_Release/aie.mlir | 3 +- test/benchmarks/12_Stream_Delay/aie.mlir | 12 +- test/create-flows/mmult.mlir | 96 ++- test/create-flows/vecmul_4x4_slow_test.mlir | 576 ++++++++++++------ test/create-locks/test_lock0.mlir | 26 +- test/create-locks/test_lock1.mlir | 37 +- test/create-locks/test_lock2.mlir | 72 ++- test/create-locks/test_lock3.mlir | 28 +- test/create-locks/test_lock4.mlir | 45 +- test/create-locks/test_lock5.mlir | 68 ++- test/create-locks/test_lock6.mlir | 66 +- test/dialect/AIE/bad_dma_op.mlir | 6 +- test/dialect/AIE/badlock.mlir | 12 +- test/dialect/AIE/badlockdma.mlir | 6 +- test/dialect/AIE/badlockfunc.mlir | 3 +- test/dialect/AIE/badmem.mlir | 33 +- test/dialect/AIE/badmemtiledma.mlir | 33 +- test/dialect/AIE/badmemtiledma2.mlir | 21 +- .../AIE/badmemtiledma_channel4lock.mlir | 6 +- test/dialect/AIE/badshimtiledma.mlir | 42 +- test/dialect/AIE/badtiledma.mlir | 15 +- test/dialect/AIE/badtiledma2.mlir | 12 +- test/dialect/AIE/badtiledma3.mlir | 12 +- test/dialect/AIE/badtiledma4.mlir | 9 +- .../dialect/AIE/baduselock_dynamic_value.mlir | 31 + test/dialect/AIE/canonicalize-mem.mlir | 142 +++-- test/dialect/AIE/example0.mlir | 48 +- test/dialect/AIE/memtiledma_channel4lock.mlir | 6 +- test/localize-locks/locks-ve2802.mlir | 72 ++- test/localize-locks/locks1.mlir | 72 ++- test/lower-to-standard/loc_preservation.mlir | 3 +- test/lower-to-standard/local_locks.mlir | 10 +- test/lower-to-standard/local_locks_aie2.mlir | 10 +- test/lower-to-standard/local_locks_aie2p.mlir | 10 +- .../lower_buffer_and_lock.mlir | 20 +- .../lower_cascade_put_get.mlir | 36 +- test/lower-to-standard/lower_dma.mlir | 24 +- test/lower-to-standard/useLock_in_func.mlir | 5 +- .../useLock_in_func_aie2.mlir | 5 +- .../useLock_in_func_aie2p.mlir | 5 +- .../aie.mlir | 48 +- .../aie.mlir | 96 ++- .../aie.mlir | 48 +- test/npu-xrt/add_314_using_dma_op/aie.mlir | 96 ++- .../aie.mlir | 96 ++- test/npu-xrt/add_blockwrite/aie.mlir | 48 +- test/npu-xrt/add_maskwrite/aie.mlir | 18 +- test/npu-xrt/add_one_ctrl_packet/aie.mlir | 24 +- .../add_one_ctrl_packet_4_cores/aie.mlir | 96 ++- .../add_one_ctrl_packet_col_overlay/aie.mlir | 96 ++- test/npu-xrt/add_one_using_dma/aie.mlir | 96 ++- .../dma_configure_task_lock/aie.mlir | 12 +- test/npu-xrt/ctrl_packet_reconfig/aie.mlir | 48 +- .../ctrl_packet_reconfig_1x4_cores/aie.mlir | 156 +++-- .../ctrl_packet_reconfig_4x1_cores/aie.mlir | 96 ++- .../npu-xrt/ctrl_packet_reconfig_elf/aie.mlir | 48 +- test/npu-xrt/dmabd_task_queue/aie.mlir | 96 ++- .../aie_bufferx4.mlir | 180 ++++-- .../aie_cascadex4.mlir | 180 ++++-- .../aie_plainx1.mlir | 72 ++- .../aie_plainx4.mlir | 210 ++++--- .../dma_configure_task_lock/aie.mlir | 30 +- .../npu-xrt/multi_source_packet_flow/aie.mlir | 24 +- test/npu-xrt/packet_flow/aie.mlir | 48 +- test/npu-xrt/packet_flow_fanin/aie.mlir | 78 ++- test/npu-xrt/packet_flow_fanout/aie.mlir | 96 ++- .../aie.mlir | 48 +- test/npu-xrt/scratchpad_regwrite/aie.mlir | 6 +- test/npu-xrt/shim_dma_bd_reuse/aie.mlir | 12 +- test/npu-xrt/static_L1_init/aie.mlir | 96 ++- .../npu-xrt/vec_vec_add_memtile_init/aie.mlir | 138 +++-- test/npu-xrt/vec_vec_add_tile_init/aie.mlir | 96 ++- test/npu-xrt/vector_scalar_using_dma/aie.mlir | 48 +- test/npu-xrt/xrt_handle_lifetime/aie.mlir | 96 ++- .../access_patterns/AIE2_cyclostatic_L1.mlir | 42 +- .../AIE2_cyclostatic_L1_dynamic.mlir | 6 +- .../access_patterns/AIE2_cyclostatic_L2.mlir | 126 ++-- .../access_patterns/AIE2_cyclostatic_dma.mlir | 72 ++- .../access_patterns/AIE2_delayed_release.mlir | 33 +- .../access_patterns/AIE2_dynamic_locks.mlir | 180 ++---- .../AIE2_single_multiple_release.mlir | 27 +- .../access_patterns/AIE2_static_L1.mlir | 48 +- .../cyclostatic_AIE2_sharedMem.mlir | 69 ++- .../same_core_producer_consumer_test.mlir | 21 +- .../access_patterns/subview_test_1.mlir | 18 +- .../access_patterns/subview_test_2.mlir | 69 ++- .../access_patterns/subview_test_3.mlir | 69 ++- .../onelargefifo_on_2memtile.mlir | 72 ++- .../twofifo_on_2memtile.mlir | 36 +- .../aie_stream/consumer_stream_AIE2.mlir | 12 +- .../aie_stream/link_to_stream_AIE2.mlir | 24 +- .../aie_stream/producer_stream_AIE2.mlir | 18 +- .../aie_stream/shim_to_stream_AIE2.mlir | 6 +- .../aie_stream/stream_to_link_AIE2.mlir | 24 +- .../base/base_test_AIE1.mlir | 24 +- .../base/base_test_AIE2.mlir | 24 +- .../base/base_test_shim.mlir | 12 +- .../base/lock_analysis_test.mlir | 36 +- .../base/memTile_test.mlir | 24 +- .../base/non_adjacency_test_1.mlir | 48 +- .../base/non_adjacency_test_2.mlir | 78 ++- .../base/non_adjacency_test_AIE2.mlir | 48 +- .../bd_chain_with_repeat_count.mlir | 24 +- .../broadcast_with_iterations.mlir | 78 ++- .../join_with_iterations.mlir | 108 ++-- .../bd_chain_on_memtile/repeat_chain.mlir | 24 +- .../bd_chain_on_memtile/single_iteration.mlir | 24 +- .../split_and_join_with_iterations.mlir | 144 +++-- .../split_with_iterations.mlir | 108 ++-- .../broadcast_enforced_depths.mlir | 195 ++++-- .../broadcast_self_adjusted_depths.mlir | 195 ++++-- .../link/link_test_AIE1.mlir | 18 +- .../link/link_test_DDR_to_L1_AIE2.mlir | 42 +- .../link/link_test_L1_to_DDR_AIE2.mlir | 42 +- .../link/link_test_broadcast.mlir | 126 ++-- .../link_test_broadcast_skip_connection.mlir | 78 ++- .../link/link_test_distribute_offsets.mlir | 108 ++-- .../link_test_distribute_output_sizes.mlir | 48 +- .../link/link_test_join_offsets.mlir | 108 ++-- .../link/link_via_shared_mem.mlir | 42 +- .../link/link_via_shared_mem2.mlir | 12 +- .../link/link_via_shared_mem3.mlir | 12 +- .../link/link_via_shared_mem_diff_memref.mlir | 36 +- .../link_via_shared_mem_padDimensions.mlir | 36 +- ...sable_synchronization_test_distribute.mlir | 12 +- .../disable_synchronization_test_join.mlir | 12 +- .../debug_features/via_DMA_test.mlir | 24 +- .../dma_channel_alloc/memtileDMA_test.mlir | 60 +- .../dma_channel_alloc/shimtileDMA_test.mlir | 54 +- .../shimtileDMA_test_bad.mlir | 18 +- .../shimtileDMA_test_bad2.mlir | 18 +- .../dma_channel_alloc/tileDMA_test.mlir | 72 ++- .../dma_channel_alloc/tileDMA_test_bad.mlir | 18 +- .../dma_channel_alloc/tileDMA_test_bad2.mlir | 18 +- .../memtile_padding_test.mlir | 84 ++- .../dma_transformations/nd_dma_base_AIE2.mlir | 72 ++- .../nd_dma_distribute_AIE2.mlir | 72 ++- .../nd_dma_distribute_broadcast_AIE2.mlir | 96 ++- .../nd_dma_fromStream_join.mlir | 84 ++- .../nd_dma_multiple_consumers_AIE2.mlir | 120 ++-- .../dynamic_cyclostatic_acquire_in_loop.mlir | 76 --- ...ynamic_cyclostatic_acquire_no_release.mlir | 47 -- ...amic_cyclostatic_balanced_conditional.mlir | 6 +- .../dynamic_cyclostatic_both_outer_inner.mlir | 64 -- ...namic_cyclostatic_conditional_release.mlir | 44 -- ..._cyclostatic_dynamic_bounds_zero_trip.mlir | 66 -- .../dynamic_cyclostatic_held_before_loop.mlir | 58 -- .../dynamic_cyclostatic_iter_args.mlir | 64 -- ...c_cyclostatic_multi_acquire_same_fifo.mlir | 56 -- .../dynamic_cyclostatic_multiple_fifos.mlir | 54 -- .../dynamic_cyclostatic_negative_step.mlir | 51 -- .../dynamic_cyclostatic_outer_only.mlir | 55 -- ...cyclostatic_peel_preserves_body_order.mlir | 76 --- .../dynamic_cyclostatic_produce_side.mlir | 45 -- .../dynamic_cyclostatic_pure_conditional.mlir | 50 -- .../dynamic_cyclostatic_scf_while.mlir | 73 --- ...ic_cyclostatic_scf_while_side_effects.mlir | 47 -- .../dynamic_cyclostatic_sibling_loops.mlir | 59 -- .../dynamic_cyclostatic_switch_balanced.mlir | 61 -- ...dynamic_cyclostatic_switch_unbalanced.mlir | 49 -- ...mic_cyclostatic_symmetric_conditional.mlir | 61 -- .../dynamic_loop_balanced_no_cyclostatic.mlir | 38 -- .../dynamic_lowering/core_flag_test.mlir | 323 +++++++--- .../depth_one_objectfifo_test.mlir | 116 ++-- .../different_depth_objectfifos_test.mlir | 502 +++++++++------ .../dynamic_lowering/pass_flag_test.mlir | 417 +++++++++---- .../same_depth_objectfifos_test.mlir | 461 ++++++++------ .../dynamic_runtime_lock_basic.mlir | 155 +++++ .../dynamic_runtime_lock_conditional.mlir | 157 +++++ .../dynamic_runtime_lock_multiple_fifos.mlir | 255 ++++++++ .../dynamic_runtime_lock_nested_loops.mlir | 267 ++++++++ .../dynamic_runtime_lock_producer.mlir | 103 ++++ .../dynamic_runtime_lock_scf_while.mlir | 179 ++++++ .../init_values_distribute_input_test.mlir | 84 ++- .../init_values_join_input_test.mlir | 72 ++- .../init_values_join_output_test.mlir | 72 ++- .../init_values/init_values_repeat_test.mlir | 48 +- .../init_values/init_values_test.mlir | 36 +- .../loop_unrolling/acquire_before_loop.mlir | 114 ++-- .../fully_divisible_loop_iter.mlir | 12 +- .../fully_divisible_loop_iter_dynamic.mlir | 6 +- .../loop_unrolling/fully_unroll_loop.mlir | 123 ++-- .../loop_unrolling/large_loop_step.mlir | 120 ++-- .../loop_unroll_with_remainder.mlir | 72 ++- .../nested_loop_acquire_release.mlir | 24 +- .../nested_loop_unroll_inner_then_outer.mlir | 72 ++- .../nested_loop_unroll_with_remainder.mlir | 108 ++-- .../unroll_factor_multiple_objectfifos.mlir | 170 +++--- .../matmul_test.mlir | 96 ++- .../packet_switched_flows/packet_id_test.mlir | 24 +- .../packet_switched_flows/pass_flag_test.mlir | 24 +- .../shim_dma_alloc_test.mlir | 12 +- .../no_register_external_buffers_test.mlir | 18 +- .../register_external_buffers_depth_test.mlir | 18 +- .../register_external_buffers_test.mlir | 33 +- .../shim_AIE2_test.mlir | 36 +- .../shim_broadcast_test.mlir | 42 +- .../link_distribute_repeat_count_test.mlir | 120 ++-- .../link_join_repeat_count_test.mlir | 36 +- .../repeat_count/link_repeat_count_test.mlir | 36 +- .../memtile_repeat_count_test.mlir | 12 +- .../repeat_count/repeat_count_test.mlir | 18 +- .../repeat_count_test_dynamic.mlir | 6 +- .../repeat_count_test.mlir | 36 +- test/python/barrier.py | 6 +- test/python/static_bd_config.py | 12 +- .../aie/02_lock_acquire_release/aie.mlir | 9 +- .../aie/03_sync_with_locks/aie.mlir | 12 +- test/unit_tests/aie/04_shared_memory/aie.mlir | 24 +- test/unit_tests/aie/05_tiledma/aie.mlir | 36 +- .../aie/08_stream_broadcast/aie.mlir | 72 ++- .../aie/09_simple_shim_dma/aie.mlir | 18 +- test/unit_tests/aie/14_stream_packet/aie.mlir | 18 +- test/unit_tests/aie/15_prime_sieve/aie.mlir | 39 +- test/unit_tests/aie/16_libm_expf/aie.mlir | 6 +- .../aie/17_shim_dma_with_core/aie.mlir | 62 +- .../aie/18_simple_shim_dma_routed/aie.mlir | 18 +- .../aie/19_shim_dma_with_core_routed/aie.mlir | 62 +- .../aie/20_shim_dma_broadcast/aie.mlir | 30 +- .../aie/21_shim_dma_packet/aie.mlir | 75 ++- test/unit_tests/aie/22_init_locks/aie.mlir | 12 +- .../aie/23_broadcast_packet/aie.mlir | 36 +- test/unit_tests/aie/23_packet_biShim/aie.mlir | 21 +- .../unit_tests/aie/25_host_multirate/aie.mlir | 6 +- .../aie/27_single_L1_single_lock/aie.mlir | 24 +- .../aie/27_single_L1_single_lock/aie2.mlir | 24 +- .../aieWithWorkaround.mlir | 48 +- .../multi_depth/aie.mlir | 12 +- .../single_depth/aie.mlir | 12 +- test/unit_tests/aie/31_stream_core/aie.mlir | 12 +- .../01_precompiled_core_function/aie.mlir | 12 +- .../aie2/03_cascade_core_functions/aie.mlir | 6 +- test/unit_tests/aie2/03_simple/aie.mlir | 6 +- .../unit_tests/aie2/04_shared_memory/aie.mlir | 24 +- .../aie2/04_shared_memory/aie_row.mlir | 24 +- .../aie2/05_shim_dma_core_function/aie.mlir | 60 +- .../aie.mlir | 60 +- test/unit_tests/aie2/08_tile_locks/aie.mlir | 24 +- .../unit_tests/aie2/09_memtile_locks/aie.mlir | 30 +- .../aie2/29_aie2_nd_dma_even_odd/aie.mlir | 15 +- .../30_aie2_nd_dma_transpose_repeat/aie.mlir | 15 +- .../01_precompiled_core_function/aie.mlir | 12 +- .../03_cascade_core_functions/aie.mlir | 12 +- .../04_shared_memory/aie.mlir | 24 +- .../04_shared_memory/aie_row.mlir | 24 +- .../04_shim_dma_kernel/aie.mlir | 36 +- .../05_shim_dma_core_function/aie.mlir | 60 +- .../aie.mlir | 62 +- .../08_tile_locks/aie.mlir | 24 +- .../01_precompiled_core_function/aie.mlir | 12 +- .../03_cascade_core_functions/aie.mlir | 6 +- .../03_simple/aie.mlir | 6 +- .../04_shared_memory/aie.mlir | 24 +- .../04_shared_memory/aie_row.mlir | 24 +- .../04_shim_dma_kernel/aie.mlir | 36 +- .../05_shim_dma_core_function/aie.mlir | 62 +- .../aie.mlir | 62 +- .../08_tile_locks/aie.mlir | 24 +- .../09_memtile_locks/aie.mlir | 30 +- 302 files changed, 10445 insertions(+), 6153 deletions(-) create mode 100644 test/dialect/AIE/baduselock_dynamic_value.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_in_loop.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_no_release.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_both_outer_inner.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_conditional_release.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_dynamic_bounds_zero_trip.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_held_before_loop.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_iter_args.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_multi_acquire_same_fifo.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_multiple_fifos.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_negative_step.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_outer_only.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_peel_preserves_body_order.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_produce_side.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_pure_conditional.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while_side_effects.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_sibling_loops.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_balanced.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_unbalanced.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_cyclostatic_symmetric_conditional.mlir delete mode 100644 test/objectFifo-stateful-transform/dynamic_loop_balanced_no_cyclostatic.mlir create mode 100644 test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir create mode 100644 test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir create mode 100644 test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir create mode 100644 test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir create mode 100644 test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir create mode 100644 test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir diff --git a/test/Passes/assign-bd-ids/bad_bd_assignments.mlir b/test/Passes/assign-bd-ids/bad_bd_assignments.mlir index 7bed8c0b4ed..5f0cf8e56b9 100644 --- a/test/Passes/assign-bd-ids/bad_bd_assignments.mlir +++ b/test/Passes/assign-bd-ids/bad_bd_assignments.mlir @@ -15,10 +15,12 @@ module { %lock_Y = aie.lock(%tile_0_2) {init = 0 : i32} %mem_0_2 = aie.mem(%tile_0_2) { %player_a = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_Y, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Acquire, %c0_ul0) // expected-error@+1 {{'aie.dma_bd' op bdId attribute exceeds max: 15}} aie.dma_bd(%double_buffer : memref<32xi32>, 0) {bd_id = 16 : i32, next_bd_id = 1 : i32} - aie.use_lock(%lock_Y, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Release, %c0_ul1) }] aie.end } @@ -34,10 +36,12 @@ module { %lock_X = aie.lock(%tile_0_2) {init = 0 : i32} %mem_0_2 = aie.mem(%tile_0_2) { %player_a = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_X, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_X, Acquire, %c1_ul2) // expected-error@+1 {{'aie.dma_bd' op nextBdId attribute exceeds max: 15}} aie.dma_bd(%double_buffer : memref<32xi32>) {bd_id = 1 : i32, next_bd_id = 16 : i32} - aie.use_lock(%lock_X, Release, -1) + %cn1_ul3 = arith.constant -1 : i32 + aie.use_lock(%lock_X, Release, %cn1_ul3) }] aie.end } @@ -54,10 +58,12 @@ module { %lock_0_1 = aie.lock(%tile_0_1) {init = 1 : i32} %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul4) // expected-error@+1 {{'aie.dma_bd' op bdId attribute exceeds max: 47}} aie.dma_bd(%buffer_0_1 : memref<32xi32>) {bd_id = 48 : i32, next_bd_id = 1 : i32} - aie.use_lock(%lock_0_1_0, Release) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul5) }] aie.end } @@ -74,10 +80,12 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) : memref<32xi32> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul6) // expected-error@+1 {{'aie.dma_bd' op nextBdId attribute exceeds max: 47}} aie.dma_bd(%buffer_0_1 : memref<32xi32>) {bd_id = 1 : i32, next_bd_id = 48 : i32} - aie.use_lock(%lock_0_1_0, Release) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul7) }] aie.end } @@ -95,10 +103,12 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) : memref<32xi32> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul8) // expected-error@+1 {{'aie.dma_bd' op nextBdId attribute exceeds max: 47}} aie.dma_bd(%buffer_0_1 : memref<32xi32>) {bd_id = 1 : i32, next_bd_id = 48 : i32} - aie.use_lock(%lock_0_1_0, Release) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul9) }] aie.end } @@ -115,10 +125,12 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) : memref<128xi16> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul10) // expected-error@+1 {{'aie.dma_bd' op transfer length must be multiple of 4 (i.e., represent 4 byte aligned address)}} aie.dma_bd(%buffer_0_1 : memref<128xi16>, 0, 129) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul11) }] aie.end } diff --git a/test/Passes/assign-bd-ids/basic.mlir b/test/Passes/assign-bd-ids/basic.mlir index 6f932056981..bdb67f02601 100644 --- a/test/Passes/assign-bd-ids/basic.mlir +++ b/test/Passes/assign-bd-ids/basic.mlir @@ -37,30 +37,42 @@ module { %lock_Y = aie.lock(%tile_0_2) {init = 0 : i32, sym_name = "lock_Y"} %mem_0_2 = aie.mem(%tile_0_2) { %player_a = aie.dma(S2MM, 0) {sym_name = "player_a"} [{ - aie.use_lock(%lock_Y, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Acquire, %c0_ul0) aie.dma_bd(%double_buffer : memref<32xi32>, 0) - aie.use_lock(%lock_Y, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Release, %c0_ul1) }, { - aie.use_lock(%lock_X, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_X, Acquire, %c1_ul2) aie.dma_bd(%double_buffer : memref<32xi32>) - aie.use_lock(%lock_X, Release, -1) + %cn1_ul3 = arith.constant -1 : i32 + aie.use_lock(%lock_X, Release, %cn1_ul3) }, { - aie.use_lock(%lock_Y, Acquire) {acq_en = false} + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul4) {acq_en = false} aie.dma_bd(%double_buffer : memref<32xi32>) - aie.use_lock(%lock_Y, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Release, %c1_ul5) }] %player_b = aie.dma(S2MM, 1) {sym_name = "player_b"} [{ - aie.use_lock(%lock_Y, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul6) aie.dma_bd(%double_buffer : memref<32xi32>, 0) - aie.use_lock(%lock_Y, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Release, %c0_ul7) }, { - aie.use_lock(%lock_X, Acquire, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_X, Acquire, %c1_ul8) aie.dma_bd(%double_buffer : memref<32xi32>) - aie.use_lock(%lock_X, Release, -1) + %cn1_ul9 = arith.constant -1 : i32 + aie.use_lock(%lock_X, Release, %cn1_ul9) }, { - aie.use_lock(%lock_Y, Acquire) {acq_en = false} + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul10) {acq_en = false} aie.dma_bd(%double_buffer : memref<32xi32>) - aie.use_lock(%lock_Y, Release, -1) + %cn1_ul11 = arith.constant -1 : i32 + aie.use_lock(%lock_Y, Release, %cn1_ul11) }] aie.end } @@ -68,26 +80,34 @@ module { %lock_0_1 = aie.lock(%tile_0_1) {init = 1 : i32} %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %0 = aie.dma(S2MM, 0) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_0, AcquireGreaterEqual) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1, Release) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul15) }] %lock_0_1_1 = aie.lock(%tile_0_1) {init = 1 : i32} %lock_0_1_2 = aie.lock(%tile_0_1) {init = 0 : i32} %2 = aie.dma(S2MM, 1) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1_2, Release) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, Release, %c1_ul17) }] %3 = aie.dma(MM2S, 1) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1_1, Release) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, Release, %c1_ul19) }] aie.end } @@ -126,24 +146,32 @@ module @aie_module { ^dma2: %dstDma = aie.dma_start(MM2S, 0, ^bd3, ^end) ^bd0: - aie.use_lock(%l01_0, "AcquireGreaterEqual", 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "AcquireGreaterEqual", %c1_ul20) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 128, [, , , ]) - aie.use_lock(%l01_1, "Release", 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "Release", %c1_ul21) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%l01_1, "AcquireGreaterEqual", 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "AcquireGreaterEqual", %c1_ul22) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_0, "Release", 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "Release", %c1_ul23) aie.next_bd ^bd1 ^bd2: - aie.use_lock(%l01_2, "AcquireGreaterEqual", 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "AcquireGreaterEqual", %c1_ul24) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_3, "Release", 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "Release", %c1_ul25) aie.next_bd ^bd2 ^bd3: - aie.use_lock(%l01_3, "AcquireGreaterEqual", 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "AcquireGreaterEqual", %c1_ul26) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_2, "Release", 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "Release", %c1_ul27) aie.next_bd ^bd3 ^end: aie.end diff --git a/test/Passes/assign-bd-ids/exhausted_bds.mlir b/test/Passes/assign-bd-ids/exhausted_bds.mlir index 5574f316ae3..faea2608696 100644 --- a/test/Passes/assign-bd-ids/exhausted_bds.mlir +++ b/test/Passes/assign-bd-ids/exhausted_bds.mlir @@ -20,106 +20,156 @@ module { %lock = aie.lock(%tile_0_1) {init = 1 : i32} %lock2 = aie.lock(%tile_0_1) {init = 0 : i32} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul1) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul3) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul7) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul9) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul11) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul13) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul15) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul17) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul19) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul21) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul23) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul25) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul27) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul29) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul31) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul32 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul32) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul33) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul34) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul35 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul35) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul36 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul36) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul37 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul37) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul38) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul39 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul39) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul40) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul41) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul42) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul43) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul44 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul44) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul45) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul46 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul46) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul47 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul47) }, { - aie.use_lock(%lock, AcquireGreaterEqual) + %c1_ul48 = arith.constant 1 : i32 + aie.use_lock(%lock, AcquireGreaterEqual, %c1_ul48) // expected-error@+1 {{'aie.dma_bd' op Allocator exhausted available BD IDs (maximum 24 available for channel 0).}} aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock2, Release) + %c1_ul49 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul49) }] aie.end } diff --git a/test/Passes/assign-bd-ids/user_assigned.mlir b/test/Passes/assign-bd-ids/user_assigned.mlir index 4b9dd18d4f7..e9122624955 100644 --- a/test/Passes/assign-bd-ids/user_assigned.mlir +++ b/test/Passes/assign-bd-ids/user_assigned.mlir @@ -35,30 +35,42 @@ module { %lock_Y = aie.lock(%tile_0_2) {init = 0 : i32, sym_name = "lock_Y"} %mem_0_2 = aie.mem(%tile_0_2) { %player_a = aie.dma(S2MM, 0) {sym_name = "player_a"} [{ - aie.use_lock(%lock_Y, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Acquire, %c0_ul0) aie.dma_bd(%double_buffer : memref<32xi32>, 0) {bd_id = 0 : i32} - aie.use_lock(%lock_Y, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Release, %c0_ul1) }, { - aie.use_lock(%lock_X, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_X, Acquire, %c1_ul2) aie.dma_bd(%double_buffer : memref<32xi32>) {bd_id = 1 : i32} - aie.use_lock(%lock_X, Release, -1) + %cn1_ul3 = arith.constant -1 : i32 + aie.use_lock(%lock_X, Release, %cn1_ul3) }, { - aie.use_lock(%lock_Y, Acquire) {acq_en = false} + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul4) {acq_en = false} aie.dma_bd(%double_buffer : memref<32xi32>) - aie.use_lock(%lock_Y, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Release, %c1_ul5) }] %player_b = aie.dma(S2MM, 1) {sym_name = "player_b"} [{ - aie.use_lock(%lock_Y, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul6) aie.dma_bd(%double_buffer : memref<32xi32>, 0) - aie.use_lock(%lock_Y, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Release, %c0_ul7) }, { - aie.use_lock(%lock_X, Acquire, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_X, Acquire, %c1_ul8) aie.dma_bd(%double_buffer : memref<32xi32>) {bd_id = 4 : i32} - aie.use_lock(%lock_X, Release, -1) + %cn1_ul9 = arith.constant -1 : i32 + aie.use_lock(%lock_X, Release, %cn1_ul9) }, { - aie.use_lock(%lock_Y, Acquire) {acq_en = false} + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul10) {acq_en = false} aie.dma_bd(%double_buffer : memref<32xi32>) - aie.use_lock(%lock_Y, Release, -1) + %cn1_ul11 = arith.constant -1 : i32 + aie.use_lock(%lock_Y, Release, %cn1_ul11) }] aie.end } @@ -66,26 +78,34 @@ module { %lock_0_1 = aie.lock(%tile_0_1) {init = 1 : i32} %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %0 = aie.dma(S2MM, 0) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_0, AcquireGreaterEqual) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1, Release) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul15) }] %lock_0_1_1 = aie.lock(%tile_0_1) {init = 1 : i32} %lock_0_1_2 = aie.lock(%tile_0_1) {init = 0 : i32} %2 = aie.dma(S2MM, 1) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buffer_0_1 : memref<32xi32>) {bd_id = 24 : i32} - aie.use_lock(%lock_0_1_2, Release) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, Release, %c1_ul17) }] %3 = aie.dma(MM2S, 1) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1_1, Release) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, Release, %c1_ul19) }] aie.end } @@ -123,24 +143,32 @@ module @aie_module { ^dma2: %dstDma = aie.dma_start(MM2S, 0, ^bd3, ^end) ^bd0: - aie.use_lock(%l01_0, "AcquireGreaterEqual", 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "AcquireGreaterEqual", %c1_ul20) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 128, [, , , ]) - aie.use_lock(%l01_1, "Release", 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "Release", %c1_ul21) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%l01_1, "AcquireGreaterEqual", 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "AcquireGreaterEqual", %c1_ul22) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 16) {bd_id = 24 : i32} - aie.use_lock(%l01_0, "Release", 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "Release", %c1_ul23) aie.next_bd ^bd1 ^bd2: - aie.use_lock(%l01_2, "AcquireGreaterEqual", 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "AcquireGreaterEqual", %c1_ul24) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_3, "Release", 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "Release", %c1_ul25) aie.next_bd ^bd2 ^bd3: - aie.use_lock(%l01_3, "AcquireGreaterEqual", 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "AcquireGreaterEqual", %c1_ul26) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) {bd_id = 1 : i32} - aie.use_lock(%l01_2, "Release", 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "Release", %c1_ul27) aie.next_bd ^bd3 ^end: aie.end @@ -178,30 +206,42 @@ module { %lock_Y = aie.lock(%tile_0_2) {init = 0 : i32, sym_name = "lock_Y"} %mem_0_2 = aie.mem(%tile_0_2) { %player_a = aie.dma(S2MM, 0) {sym_name = "player_a"} [{ - aie.use_lock(%lock_Y, Acquire, 0) + %c0_ul28 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Acquire, %c0_ul28) aie.dma_bd(%double_buffer : memref<32xi32>, 0) {bd_id = 5 : i32} - aie.use_lock(%lock_Y, Release, 0) + %c0_ul29 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Release, %c0_ul29) }, { - aie.use_lock(%lock_X, Acquire, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%lock_X, Acquire, %c1_ul30) aie.dma_bd(%double_buffer : memref<32xi32>) {bd_id = 4 : i32} - aie.use_lock(%lock_X, Release, -1) + %cn1_ul31 = arith.constant -1 : i32 + aie.use_lock(%lock_X, Release, %cn1_ul31) }, { - aie.use_lock(%lock_Y, Acquire) {acq_en = false} + %c1_ul32 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul32) {acq_en = false} aie.dma_bd(%double_buffer : memref<32xi32>) {bd_id = 3 : i32} - aie.use_lock(%lock_Y, Release, 1) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Release, %c1_ul33) }] %player_b = aie.dma(S2MM, 1) {sym_name = "player_b"} [{ - aie.use_lock(%lock_Y, Acquire, 1) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul34) aie.dma_bd(%double_buffer : memref<32xi32>, 0) {bd_id = 2 : i32} - aie.use_lock(%lock_Y, Release, 0) + %c0_ul35 = arith.constant 0 : i32 + aie.use_lock(%lock_Y, Release, %c0_ul35) }, { - aie.use_lock(%lock_X, Acquire, 1) + %c1_ul36 = arith.constant 1 : i32 + aie.use_lock(%lock_X, Acquire, %c1_ul36) aie.dma_bd(%double_buffer : memref<32xi32>) {bd_id = 1 : i32} - aie.use_lock(%lock_X, Release, -1) + %cn1_ul37 = arith.constant -1 : i32 + aie.use_lock(%lock_X, Release, %cn1_ul37) }, { - aie.use_lock(%lock_Y, Acquire) {acq_en = false} + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%lock_Y, Acquire, %c1_ul38) {acq_en = false} aie.dma_bd(%double_buffer : memref<32xi32>) {bd_id = 0 : i32} - aie.use_lock(%lock_Y, Release, -1) + %cn1_ul39 = arith.constant -1 : i32 + aie.use_lock(%lock_Y, Release, %cn1_ul39) }] aie.end } @@ -209,26 +249,34 @@ module { %lock_0_1 = aie.lock(%tile_0_1) {init = 1 : i32} %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %0 = aie.dma(S2MM, 0) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul40) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul41) }] %1 = aie.dma(MM2S, 0) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_0, AcquireGreaterEqual) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, AcquireGreaterEqual, %c1_ul42) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1, Release) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul43) }] %lock_0_1_1 = aie.lock(%tile_0_1) {init = 1 : i32} %lock_0_1_2 = aie.lock(%tile_0_1) {init = 0 : i32} %2 = aie.dma(S2MM, 1) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual) + %c1_ul44 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul44) aie.dma_bd(%buffer_0_1 : memref<32xi32>) {bd_id = 24 : i32} - aie.use_lock(%lock_0_1_2, Release) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, Release, %c1_ul45) }] %3 = aie.dma(MM2S, 1) {loop = false, repeat_count = 10 : i32} [{ - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual) + %c1_ul46 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul46) aie.dma_bd(%buffer_0_1 : memref<32xi32>) - aie.use_lock(%lock_0_1_1, Release) + %c1_ul47 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, Release, %c1_ul47) }] aie.end } diff --git a/test/Passes/lower-set-lock/lower_set_lock.mlir b/test/Passes/lower-set-lock/lower_set_lock.mlir index bda1b9d3867..1c3f187e5d0 100644 --- a/test/Passes/lower-set-lock/lower_set_lock.mlir +++ b/test/Passes/lower-set-lock/lower_set_lock.mlir @@ -21,8 +21,10 @@ module @test_simple_lock_set { %lock00_5 = aie.lock(%shimtile00, 5) {init = 1 : i32} %core22 = aie.core(%tile22) { - aie.use_lock(%lock22_0, "Acquire", 0) - aie.use_lock(%lock22_15, "Acquire", 1) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock22_0, "Acquire", %c0_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock22_15, "Acquire", %c1_ul1) // Do operations aie.end } diff --git a/test/Passes/transform-bfp-types/bfp-invalid.mlir b/test/Passes/transform-bfp-types/bfp-invalid.mlir index 845c5439c62..fd658def071 100644 --- a/test/Passes/transform-bfp-types/bfp-invalid.mlir +++ b/test/Passes/transform-bfp-types/bfp-invalid.mlir @@ -69,9 +69,11 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) {address = 0 : i32} : memref<7x!aiex.bfp<"v8bfp16ebs8">> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buffer_0_1 : memref<7x!aiex.bfp<"v8bfp16ebs8">>, 0) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul1) }] aie.end } diff --git a/test/Passes/transform-bfp-types/bfp.mlir b/test/Passes/transform-bfp-types/bfp.mlir index 2b19ae25b41..780ab14390b 100644 --- a/test/Passes/transform-bfp-types/bfp.mlir +++ b/test/Passes/transform-bfp-types/bfp.mlir @@ -60,9 +60,11 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) {address = 0 : i32} : memref<8x!aiex.bfp<"v8bfp16ebs8">> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buffer_0_1 : memref<8x!aiex.bfp<"v8bfp16ebs8">>, 0) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul1) }] aie.end } diff --git a/test/Targets/AIEGenerateXAIE/aie2_nd_DMA.mlir b/test/Targets/AIEGenerateXAIE/aie2_nd_DMA.mlir index 228fbe68c08..459a1d4826c 100644 --- a/test/Targets/AIEGenerateXAIE/aie2_nd_DMA.mlir +++ b/test/Targets/AIEGenerateXAIE/aie2_nd_DMA.mlir @@ -40,24 +40,32 @@ module @aie_module { ^dma2: %dstDma = aie.dma_start(MM2S, 0, ^bd3, ^end) ^bd0: - aie.use_lock(%l01_0, "AcquireGreaterEqual", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "AcquireGreaterEqual", %c1_ul0) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 128, [, , , ]) - aie.use_lock(%l01_1, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "Release", %c1_ul1) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%l01_1, "AcquireGreaterEqual", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "AcquireGreaterEqual", %c1_ul2) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_0, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "Release", %c1_ul3) aie.next_bd ^bd1 ^bd2: - aie.use_lock(%l01_2, "AcquireGreaterEqual", 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "AcquireGreaterEqual", %c1_ul4) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_3, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "Release", %c1_ul5) aie.next_bd ^bd2 ^bd3: - aie.use_lock(%l01_3, "AcquireGreaterEqual", 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "AcquireGreaterEqual", %c1_ul6) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_2, "Release", 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "Release", %c1_ul7) aie.next_bd ^bd3 ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/aie2_tileDMA.mlir b/test/Targets/AIEGenerateXAIE/aie2_tileDMA.mlir index 08b397f0ae4..c816cc4a540 100644 --- a/test/Targets/AIEGenerateXAIE/aie2_tileDMA.mlir +++ b/test/Targets/AIEGenerateXAIE/aie2_tileDMA.mlir @@ -31,9 +31,11 @@ module @aie_module { %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: // Note: acquire and release are different locks. - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_a_ping : memref<256xi32>, 0, 256) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul1) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/aie2_tileDMA2.mlir b/test/Targets/AIEGenerateXAIE/aie2_tileDMA2.mlir index 16953f474cb..f1c2f1e50e5 100644 --- a/test/Targets/AIEGenerateXAIE/aie2_tileDMA2.mlir +++ b/test/Targets/AIEGenerateXAIE/aie2_tileDMA2.mlir @@ -32,7 +32,8 @@ module @aie_module { %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: // Note: acquire and release are different locks. - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_a_ping : memref<256xi32>, 0, 256) // aie.use_lock(%lock_a_read, Release, 1) aie.next_bd ^end diff --git a/test/Targets/AIEGenerateXAIE/aie2_tileDMA3.mlir b/test/Targets/AIEGenerateXAIE/aie2_tileDMA3.mlir index 3cb113b5d9d..c929154e4fe 100644 --- a/test/Targets/AIEGenerateXAIE/aie2_tileDMA3.mlir +++ b/test/Targets/AIEGenerateXAIE/aie2_tileDMA3.mlir @@ -34,7 +34,8 @@ module @aie_module { // Note: acquire and release are different locks. //aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) aie.dma_bd(%buf_a_ping : memref<256xi32>, 0, 256) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul0) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/aie2_tileDMA4.mlir b/test/Targets/AIEGenerateXAIE/aie2_tileDMA4.mlir index 5cc1e6aea4e..eed96a43edd 100644 --- a/test/Targets/AIEGenerateXAIE/aie2_tileDMA4.mlir +++ b/test/Targets/AIEGenerateXAIE/aie2_tileDMA4.mlir @@ -31,9 +31,11 @@ %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end, repeat_count = 3) ^bd0: // Note: acquire and release are different locks. - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_a_ping : memref<256xi32>, 0, 256) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul1) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/aie2_tileDMA5.mlir b/test/Targets/AIEGenerateXAIE/aie2_tileDMA5.mlir index ee8800dbbe9..cda391aff60 100644 --- a/test/Targets/AIEGenerateXAIE/aie2_tileDMA5.mlir +++ b/test/Targets/AIEGenerateXAIE/aie2_tileDMA5.mlir @@ -24,32 +24,40 @@ module @aie_module { %mem_7_3 = aie.mem(%tile_7_3) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: // pred: ^bb0 - aie.use_lock(%lock_7_3, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf7 : memref<5xi32, 1 : i32>, 0, 5) - aie.use_lock(%lock_7_3_0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3_0, Release, %c1_ul1) aie.next_bd ^bb4 ^bb2: // pred: ^bb0 %1 = aie.dma_start(S2MM, 0, ^bb3, ^bb7, repeat_count = 7) ^bb3: // pred: ^bb2 - aie.use_lock(%lock_7_3, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf8 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_7_3_0, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3_0, Release, %c1_ul3) aie.next_bd ^bb4 ^bb4: // 5 preds: ^bb1, ^bb3, ^bb5, ^bb6, ^bb8 aie.end ^bb5: // pred: ^bb7 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb4, repeat_count = 7) ^bb6: // pred: ^bb5 - aie.use_lock(%lock_7_3_0, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3_0, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf8 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_7_3, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3, Release, %c1_ul5) aie.next_bd ^bb4 ^bb7: // pred: ^bb2 %3 = aie.dma_start(MM2S, 0, ^bb8, ^bb5) ^bb8: // pred: ^bb7 - aie.use_lock(%lock_7_3_0, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3_0, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf7 : memref<5xi32, 1 : i32>, 0, 5) - aie.use_lock(%lock_7_3, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_7_3, Release, %c1_ul7) aie.next_bd ^bb4 } } diff --git a/test/Targets/AIEGenerateXAIE/aie2_tileDMA_locks.mlir b/test/Targets/AIEGenerateXAIE/aie2_tileDMA_locks.mlir index 3ba27236eb6..3b1a6987aae 100644 --- a/test/Targets/AIEGenerateXAIE/aie2_tileDMA_locks.mlir +++ b/test/Targets/AIEGenerateXAIE/aie2_tileDMA_locks.mlir @@ -39,21 +39,26 @@ module @aie_module { %m73 = aie.mem(%t73) { %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock_l1, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_l1, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l2, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_l2, Release, %c1_ul1) aie.next_bd ^bd1 ^bd1: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l1, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_l1, Release, %c1_ul2) aie.next_bd ^bd2 ^bd2: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l1, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_l1, Release, %c1_ul3) aie.next_bd ^bd3 ^bd3: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l1, Release, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_l1, Release, %c1_ul4) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/memTileDMA.mlir b/test/Targets/AIEGenerateXAIE/memTileDMA.mlir index b5cee2309c9..3bef7664c88 100644 --- a/test/Targets/AIEGenerateXAIE/memTileDMA.mlir +++ b/test/Targets/AIEGenerateXAIE/memTileDMA.mlir @@ -54,24 +54,32 @@ module @aie_module { ^dma2: %dstDma = aie.dma_start(MM2S, 0, ^bd3, ^end) ^bd0: - aie.use_lock(%l01_0, "AcquireGreaterEqual", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "AcquireGreaterEqual", %c1_ul0) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_1, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "Release", %c1_ul1) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%l01_1, "AcquireGreaterEqual", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%l01_1, "AcquireGreaterEqual", %c1_ul2) aie.dma_bd(%buf01_0 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_0, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l01_0, "Release", %c1_ul3) aie.next_bd ^bd1 ^bd2: - aie.use_lock(%l01_2, "AcquireGreaterEqual", 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "AcquireGreaterEqual", %c1_ul4) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_3, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "Release", %c1_ul5) aie.next_bd ^bd2 ^bd3: - aie.use_lock(%l01_3, "AcquireGreaterEqual", 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%l01_3, "AcquireGreaterEqual", %c1_ul6) aie.dma_bd(%buf01_1 : memref<16xi32>, 0, 16) - aie.use_lock(%l01_2, "Release", 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%l01_2, "Release", %c1_ul7) aie.next_bd ^bd3 ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/memTileDMA2.mlir b/test/Targets/AIEGenerateXAIE/memTileDMA2.mlir index 36506e674fe..47d4cd51dc7 100644 --- a/test/Targets/AIEGenerateXAIE/memTileDMA2.mlir +++ b/test/Targets/AIEGenerateXAIE/memTileDMA2.mlir @@ -51,15 +51,18 @@ module @aie_module { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: aie.dma_bd(%buf_w : memref<16xi32>, 0, 16) - aie.use_lock(%lock_w, "Release", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_w, "Release", %c1_ul0) aie.next_bd ^bd1 ^bd1: aie.dma_bd(%buf_l : memref<16xi32>, 0, 16) - aie.use_lock(%lock_l, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_l, "Release", %c1_ul1) aie.next_bd ^bd2 ^bd2: aie.dma_bd(%buf_e : memref<16xi32>, 0, 16) - aie.use_lock(%lock_e, "Release", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_e, "Release", %c1_ul2) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/memTileDMA3.mlir b/test/Targets/AIEGenerateXAIE/memTileDMA3.mlir index a45b4834048..e6d45cc3d32 100644 --- a/test/Targets/AIEGenerateXAIE/memTileDMA3.mlir +++ b/test/Targets/AIEGenerateXAIE/memTileDMA3.mlir @@ -24,32 +24,40 @@ module @aie_module { %memtile_dma_2_1 = aie.memtile_dma(%tile_2_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: // pred: ^bb0 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf7 : memref<5xi32, 1 : i32>, 0, 5) - aie.use_lock(%lock_2_1_0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, Release, %c1_ul1) aie.next_bd ^bb4 ^bb2: // pred: ^bb0 %1 = aie.dma_start(S2MM, 0, ^bb3, ^bb7, repeat_count = 7) ^bb3: // pred: ^bb2 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf8 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_2_1_0, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, Release, %c1_ul3) aie.next_bd ^bb4 ^bb4: // 5 preds: ^bb1, ^bb3, ^bb5, ^bb6, ^bb8 aie.end ^bb5: // pred: ^bb7 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb4, repeat_count = 7) ^bb6: // pred: ^bb5 - aie.use_lock(%lock_2_1_0, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf8 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_2_1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, Release, %c1_ul5) aie.next_bd ^bb4 ^bb7: // pred: ^bb2 %3 = aie.dma_start(MM2S, 0, ^bb8, ^bb5) ^bb8: // pred: ^bb7 - aie.use_lock(%lock_2_1_0, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf7 : memref<5xi32, 1 : i32>, 0, 5) - aie.use_lock(%lock_2_1, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, Release, %c1_ul7) aie.next_bd ^bb4 } } diff --git a/test/Targets/AIEGenerateXAIE/packet_drop_header.mlir b/test/Targets/AIEGenerateXAIE/packet_drop_header.mlir index 31bdddcd21b..52ce2103c35 100644 --- a/test/Targets/AIEGenerateXAIE/packet_drop_header.mlir +++ b/test/Targets/AIEGenerateXAIE/packet_drop_header.mlir @@ -64,16 +64,20 @@ module @aie_module { ^bb1: // pred: ^bb0 %8 = aie.dma_start(MM2S, 0, ^bb3, ^bb4) ^bb2: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%4, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%4, Acquire, %c0_ul0) aie.dma_bd_packet(2, 3) aie.dma_bd(%5 : memref<16xi32, 2>, 0, 16) - aie.use_lock(%4, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%4, Release, %c1_ul1) aie.next_bd ^bb2 ^bb3: // 2 preds: ^bb1, ^bb3 - aie.use_lock(%4, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%4, Acquire, %c1_ul2) aie.dma_bd_packet(6, 10) aie.dma_bd(%5 : memref<16xi32, 2>, 0, 16) - aie.use_lock(%4, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%4, Release, %c0_ul3) aie.next_bd ^bb3 ^bb4: // pred: ^bb1 aie.end diff --git a/test/Targets/AIEGenerateXAIE/packet_shim_header.mlir b/test/Targets/AIEGenerateXAIE/packet_shim_header.mlir index 8708515829c..c9a488914ec 100644 --- a/test/Targets/AIEGenerateXAIE/packet_shim_header.mlir +++ b/test/Targets/AIEGenerateXAIE/packet_shim_header.mlir @@ -57,9 +57,11 @@ module @aie_module { %8 = aie.mem(%3) { %10 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%5, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%5, Acquire, %c0_ul0) aie.dma_bd(%6 : memref<32xi32, 2>, 0, 32) - aie.use_lock(%5, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%5, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb0 aie.end @@ -68,10 +70,12 @@ module @aie_module { %10 = aie.lock(%0, 1) %11 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%10, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%10, Acquire, %c1_ul2) aie.dma_bd_packet(6, 10) aie.dma_bd(%7 : memref<32xi32>, 0, 32) - aie.use_lock(%10, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%10, Release, %c0_ul3) aie.next_bd ^bb1 ^bb2: // pred: ^bb0 aie.end diff --git a/test/Targets/AIEGenerateXAIE/shim.mlir b/test/Targets/AIEGenerateXAIE/shim.mlir index 9033ee7c09f..c8b56f46e3d 100644 --- a/test/Targets/AIEGenerateXAIE/shim.mlir +++ b/test/Targets/AIEGenerateXAIE/shim.mlir @@ -60,9 +60,11 @@ module { ^dma0: aie.dma_start(MM2S, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock0, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock0, Acquire, %c0_ul0) aie.dma_bd(%buffer : memref<16 x f32>, 0, 16) - aie.use_lock(%lock0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock0, Release, %c1_ul1) aie.next_bd ^bd0 ^bd1: // aie.use_lock(%lock1, Acquire, 1) diff --git a/test/Targets/AIEGenerateXAIE/shim_dma_packet.mlir b/test/Targets/AIEGenerateXAIE/shim_dma_packet.mlir index 80127b95724..27e2607368e 100644 --- a/test/Targets/AIEGenerateXAIE/shim_dma_packet.mlir +++ b/test/Targets/AIEGenerateXAIE/shim_dma_packet.mlir @@ -32,10 +32,12 @@ module { %shimdma70 = aie.shim_dma(%tile70) { aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock70, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock70, Acquire, %c1_ul0) aie.dma_bd_packet(0, 2) aie.dma_bd(%buf : memref<32x32xi32>, 0, 1024) - aie.use_lock(%lock70, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock70, Release, %c0_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb0 aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_error_dma_multi_lock.mlir b/test/Targets/AIEGenerateXAIE/test_error_dma_multi_lock.mlir index d95a73038b5..fd108ca1ba8 100644 --- a/test/Targets/AIEGenerateXAIE/test_error_dma_multi_lock.mlir +++ b/test/Targets/AIEGenerateXAIE/test_error_dma_multi_lock.mlir @@ -16,11 +16,15 @@ module @test_error_dma_multi_lock { aie.mem(%t33) { aie.dma_start(MM2S, 0, ^bb1, ^end) ^bb1: - aie.use_lock(%l33_0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Acquire, %c1_ul0) // This should fail because only one lock can be used in a DmaBd - aie.use_lock(%l33_1, Acquire, 1) - aie.use_lock(%l33_0, Release, 0) - aie.use_lock(%l33_1, Release, 0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Acquire, %c1_ul1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Release, %c0_ul2) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%l33_1, Release, %c0_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_error_dma_multi_state.mlir b/test/Targets/AIEGenerateXAIE/test_error_dma_multi_state.mlir index 5ca926e7e44..4e9e639b3fd 100644 --- a/test/Targets/AIEGenerateXAIE/test_error_dma_multi_state.mlir +++ b/test/Targets/AIEGenerateXAIE/test_error_dma_multi_state.mlir @@ -15,11 +15,15 @@ module @test_error_dma_multi_state { aie.mem(%t33) { aie.dma_start(MM2S, 0, ^bb1, ^end) ^bb1: - aie.use_lock(%l33_0, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Acquire, %c0_ul0) // This should fail because only one state can be acquired in a DmaBd - aie.use_lock(%l33_0, Acquire, 1) - aie.use_lock(%l33_0, Release, 0) - aie.use_lock(%l33_0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Acquire, %c1_ul1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Release, %c0_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Release, %c1_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_lock.mlir b/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_lock.mlir index 15768e9ed54..c304f7a2ac2 100644 --- a/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_lock.mlir +++ b/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_lock.mlir @@ -16,11 +16,15 @@ module @test_error_shimdma_multi_lock { aie.shim_dma(%t30) { aie.dma_start(MM2S, 0, ^bb1, ^end) ^bb1: - aie.use_lock(%l30_0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l30_0, Acquire, %c1_ul0) // This should fail because only one state can be acquired in a ShimBd - aie.use_lock(%l30_1, Acquire, 1) - aie.use_lock(%l30_0, Release, 0) - aie.use_lock(%l30_1, Release, 0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l30_1, Acquire, %c1_ul1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l30_0, Release, %c0_ul2) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%l30_1, Release, %c0_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_state.mlir b/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_state.mlir index df8c8cdd745..083175c104e 100644 --- a/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_state.mlir +++ b/test/Targets/AIEGenerateXAIE/test_error_shimdma_multi_state.mlir @@ -15,11 +15,15 @@ module @test_error_shimdma_multi_state { aie.shim_dma(%t30) { aie.dma_start(MM2S, 0, ^bb1, ^end) ^bb1: - aie.use_lock(%l30_0, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l30_0, Acquire, %c0_ul0) // This should fail because only one lock can be used in a ShimBd - aie.use_lock(%l30_0, Acquire, 1) - aie.use_lock(%l30_0, Release, 0) - aie.use_lock(%l30_0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l30_0, Acquire, %c1_ul1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l30_0, Release, %c0_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l30_0, Release, %c1_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_xaie1.mlir b/test/Targets/AIEGenerateXAIE/test_xaie1.mlir index 839362e6ef2..5a80c33848c 100644 --- a/test/Targets/AIEGenerateXAIE/test_xaie1.mlir +++ b/test/Targets/AIEGenerateXAIE/test_xaie1.mlir @@ -28,9 +28,11 @@ module @test_xaie1 { %m33 = aie.mem(%t33) { %srcDma = aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l33_0, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Acquire, %c0_ul0) aie.dma_bd(%buf33_1 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Release, %c1_ul1) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_xaie2.mlir b/test/Targets/AIEGenerateXAIE/test_xaie2.mlir index dab7311371a..b60fbb68867 100644 --- a/test/Targets/AIEGenerateXAIE/test_xaie2.mlir +++ b/test/Targets/AIEGenerateXAIE/test_xaie2.mlir @@ -38,14 +38,18 @@ module @test_xaie2 { %m33 = aie.mem(%t33) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l33_0, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Acquire, %c0_ul0) aie.dma_bd(%buf33_0 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Release, %c1_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%l33_0, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Acquire, %c0_ul2) aie.dma_bd(%buf33_1 : memref<16xi32>, 0, 4) - aie.use_lock(%l33_0, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Release, %c1_ul3) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_xaie3.mlir b/test/Targets/AIEGenerateXAIE/test_xaie3.mlir index b00b473997f..679179e75ea 100644 --- a/test/Targets/AIEGenerateXAIE/test_xaie3.mlir +++ b/test/Targets/AIEGenerateXAIE/test_xaie3.mlir @@ -23,9 +23,11 @@ module @test_xaie3 { %m33 = aie.mem(%t33) { %srcDma = aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l33_0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Acquire, %c1_ul0) aie.dma_bd(%buf33_0 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Release, %c0_ul1) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/test_xaie4.mlir b/test/Targets/AIEGenerateXAIE/test_xaie4.mlir index 3ca658a569e..f9b65ce106a 100644 --- a/test/Targets/AIEGenerateXAIE/test_xaie4.mlir +++ b/test/Targets/AIEGenerateXAIE/test_xaie4.mlir @@ -43,14 +43,18 @@ module @test_xaie3 { ^dma0: %destDma = aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%l33_0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Acquire, %c1_ul0) aie.dma_bd(%buf33_0 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Release, %c0_ul1) aie.next_bd ^end ^bd1: - aie.use_lock(%l33_1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Acquire, %c1_ul2) aie.dma_bd(%buf33_1 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%l33_1, Release, %c0_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/Targets/AIEGenerateXAIE/tileDMA.mlir b/test/Targets/AIEGenerateXAIE/tileDMA.mlir index be3b4016ef7..4544fe82f88 100644 --- a/test/Targets/AIEGenerateXAIE/tileDMA.mlir +++ b/test/Targets/AIEGenerateXAIE/tileDMA.mlir @@ -30,18 +30,22 @@ module @aie_module { %28 = aie.mem(%0) { %38 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%25, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%25, Acquire, %c0_ul0) aie.dma_bd(%24 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%25, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%25, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %39 = aie.dma_start(MM2S, 0, ^bb4, ^bb2) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%27, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%27, Acquire, %c1_ul2) aie.dma_bd(%26 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%27, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%27, Release, %c0_ul3) aie.next_bd ^bb4 } } diff --git a/test/Targets/AIETargetCDODirect/shims.mlir b/test/Targets/AIETargetCDODirect/shims.mlir index 3df23509a3f..d045d8d40cd 100644 --- a/test/Targets/AIETargetCDODirect/shims.mlir +++ b/test/Targets/AIETargetCDODirect/shims.mlir @@ -119,9 +119,11 @@ module { ^dma0: aie.dma_start(MM2S, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock0, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock0, Acquire, %c0_ul0) aie.dma_bd(%buffer : memref<16 x f32>, 0, 16) {bd_id = 0 : i32} - aie.use_lock(%lock0, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock0, Release, %c1_ul1) aie.next_bd ^bd0 ^bd1: // aie.use_lock(%lock1, Acquire, 1) diff --git a/test/aiecc/Inputs/per_core_slice_lowering_equivalence.divergent.mlir b/test/aiecc/Inputs/per_core_slice_lowering_equivalence.divergent.mlir index fe1fc0c4196..da25bfa4eb4 100644 --- a/test/aiecc/Inputs/per_core_slice_lowering_equivalence.divergent.mlir +++ b/test/aiecc/Inputs/per_core_slice_lowering_equivalence.divergent.mlir @@ -19,11 +19,13 @@ module @slice_divergent { %l12 = aie.lock(%t12, 0) %b12 = aie.buffer(%t12) { sym_name = "a12" } : memref<16xi32> %c02 = aie.core(%t02) { - aie.use_lock(%l02, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l02, Acquire, %c0_ul0) %v = arith.constant 123 : i32 %i = arith.constant 3 : index memref.store %v, %b02[%i] : memref<16xi32> - aie.use_lock(%l02, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l02, Release, %c1_ul1) aie.end } } diff --git a/test/aiecc/Inputs/per_core_slice_lowering_equivalence.slice.mlir b/test/aiecc/Inputs/per_core_slice_lowering_equivalence.slice.mlir index a0a5e93089e..8fa9595d9a8 100644 --- a/test/aiecc/Inputs/per_core_slice_lowering_equivalence.slice.mlir +++ b/test/aiecc/Inputs/per_core_slice_lowering_equivalence.slice.mlir @@ -19,11 +19,13 @@ module @slice { %l12 = aie.lock(%t12, 0) %b12 = aie.buffer(%t12) { sym_name = "a12" } : memref<16xi32> %c02 = aie.core(%t02) { - aie.use_lock(%l02, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l02, Acquire, %c0_ul0) %v = arith.constant 7 : i32 %i = arith.constant 3 : index memref.store %v, %b02[%i] : memref<16xi32> - aie.use_lock(%l02, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l02, Release, %c1_ul1) aie.end } } diff --git a/test/aiecc/Inputs/per_core_slice_lowering_equivalence.wrongcore.mlir b/test/aiecc/Inputs/per_core_slice_lowering_equivalence.wrongcore.mlir index c54b97fdddc..7de341af6a4 100644 --- a/test/aiecc/Inputs/per_core_slice_lowering_equivalence.wrongcore.mlir +++ b/test/aiecc/Inputs/per_core_slice_lowering_equivalence.wrongcore.mlir @@ -16,11 +16,13 @@ module @slice_wrongcore { %l12 = aie.lock(%t12, 0) %b12 = aie.buffer(%t12) { sym_name = "a12" } : memref<16xi32> %c12 = aie.core(%t12) { - aie.use_lock(%l12, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l12, Acquire, %c0_ul0) %v = arith.constant 99 : i32 %i = arith.constant 5 : index memref.store %v, %b12[%i] : memref<16xi32> - aie.use_lock(%l12, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l12, Release, %c1_ul1) aie.end } } diff --git a/test/aiecc/per_core_slice_lowering_equivalence.mlir b/test/aiecc/per_core_slice_lowering_equivalence.mlir index 0dc5ca4b7ba..d156b85cc8b 100644 --- a/test/aiecc/per_core_slice_lowering_equivalence.mlir +++ b/test/aiecc/per_core_slice_lowering_equivalence.mlir @@ -48,19 +48,23 @@ module @full { %l12 = aie.lock(%t12, 0) %b12 = aie.buffer(%t12) { sym_name = "a12" } : memref<16xi32> %c02 = aie.core(%t02) { - aie.use_lock(%l02, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l02, Acquire, %c0_ul0) %v = arith.constant 7 : i32 %i = arith.constant 3 : index memref.store %v, %b02[%i] : memref<16xi32> - aie.use_lock(%l02, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l02, Release, %c1_ul1) aie.end } %c12 = aie.core(%t12) { - aie.use_lock(%l12, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l12, Acquire, %c0_ul2) %v = arith.constant 99 : i32 %i = arith.constant 5 : index memref.store %v, %b12[%i] : memref<16xi32> - aie.use_lock(%l12, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l12, Release, %c1_ul3) aie.end } aie.runtime_sequence @seq(%arg0 : memref<16xi32>) { @@ -75,11 +79,13 @@ module @full { %l12 = aie.lock(%t12, 0) %b22 = aie.buffer(%t12) { sym_name = "a22" } : memref<16xi32> %c12 = aie.core(%t12) { - aie.use_lock(%l12, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l12, Acquire, %c0_ul4) %v = arith.constant 42 : i32 %i = arith.constant 1 : index memref.store %v, %b22[%i] : memref<16xi32> - aie.use_lock(%l12, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l12, Release, %c1_ul5) aie.end } } diff --git a/test/assign-buffer-addresses/bad_alignment.mlir b/test/assign-buffer-addresses/bad_alignment.mlir index e84cb9e7a6d..4f15f091cc6 100644 --- a/test/assign-buffer-addresses/bad_alignment.mlir +++ b/test/assign-buffer-addresses/bad_alignment.mlir @@ -16,10 +16,12 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) {address = 1 : i32} : memref<128xi16> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul0) // expected-error@+1 {{'aie.dma_bd' op bd address must be 4 byte (32b) aligned; got base+offset: 1 (bytes)}} aie.dma_bd(%buffer_0_1 : memref<128xi16>, 0, 128) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul1) }] aie.end } @@ -36,10 +38,12 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) {address = 1 : i32} : memref<128xi16> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buffer_0_1 : memref<128xi16>, 3, 128) // expected-error@above {{'aie.dma_bd' op bd address must be 4 byte (32b) aligned; got base+offset: 7 (bytes)}} - aie.use_lock(%lock_0_1_0, Release) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul3) }] aie.end } @@ -61,10 +65,12 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) {address = 2 : i32} : memref<128xi16> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul4) // 2*6 + 2 = 8 bytes i.e., 4B aligned... aie.dma_bd(%buffer_0_1 : memref<128xi16>, 3, 128) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul5) }] aie.end } @@ -82,10 +88,12 @@ module { %lock_0_1_0 = aie.lock(%tile_0_1) {init = 0 : i32} %buffer_0_1 = aie.buffer(%tile_0_1) {address = 0 : i32} : memref<128xi16> %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1, AcquireGreaterEqual) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul6) // expected-error@below {{'aie.dma_bd' op bd address must be 4 byte (32b) aligned; got base+offset: 6 (bytes)}} aie.dma_bd(%buffer_0_1 : memref<128xi16>, 3, 128) - aie.use_lock(%lock_0_1_0, Release) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul7) }] aie.end } diff --git a/test/bd-chains-and-dma-tasks/dma-tasks-to-npu/dma_task_with_locks.mlir b/test/bd-chains-and-dma-tasks/dma-tasks-to-npu/dma_task_with_locks.mlir index c05dd96cc39..67000bc3249 100644 --- a/test/bd-chains-and-dma-tasks/dma-tasks-to-npu/dma_task_with_locks.mlir +++ b/test/bd-chains-and-dma-tasks/dma-tasks-to-npu/dma_task_with_locks.mlir @@ -30,9 +30,11 @@ module @test_core_tile_with_locks { aie.runtime_sequence(%arg0: memref<1024xi32>) { %t1 = aiex.dma_configure_task(%tile_0_2, S2MM, 0) { - aie.use_lock(%prod_lock, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Acquire, %c1_ul0) aie.dma_bd(%buf : memref<1024xi32>, 0, 1024) {bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul1) aie.end } } @@ -61,9 +63,11 @@ module @test_core_tile_looping_with_locks { aie.runtime_sequence(%arg0: memref<4096xi32>) { %t1 = aiex.dma_configure_task(%tile_0_2, S2MM, 0) { - aie.use_lock(%prod_lock, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Acquire, %c1_ul2) aie.dma_bd(%buf : memref<4096xi32>, 0, 4096) {bd_id = 0 : i32, next_bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul3) aie.end } } @@ -125,9 +129,11 @@ module @test_memtile_with_locks { aie.runtime_sequence(%arg0: memref<1024xi32>) { %t1 = aiex.dma_configure_task(%tile_0_1, S2MM, 0) { - aie.use_lock(%prod_lock, Acquire, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Acquire, %c1_ul4) aie.dma_bd(%buf : memref<1024xi32>, 0, 1024) {bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul5) aie.end } } @@ -160,9 +166,11 @@ module @test_memtile_looping_with_locks { aie.runtime_sequence(%arg0: memref<4096xi32>) { %t1 = aiex.dma_configure_task(%tile_0_1, S2MM, 0) { - aie.use_lock(%prod_lock, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Acquire, %c1_ul6) aie.dma_bd(%buf : memref<4096xi32>, 0, 4096) {bd_id = 0 : i32, next_bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul7) aie.end } } @@ -222,9 +230,11 @@ module @test_memtile_with_acquire_ge_lock { aie.runtime_sequence(%arg0: memref<2048xi32>) { %t1 = aiex.dma_configure_task(%tile_0_1, S2MM, 0) { - aie.use_lock(%prod_lock, AcquireGreaterEqual, 2) + %c2_ul8 = arith.constant 2 : i32 + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c2_ul8) aie.dma_bd(%buf : memref<2048xi32>, 0, 2048) {bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul9) aie.end } } @@ -262,14 +272,18 @@ module @test_memtile_chain_with_locks { aie.runtime_sequence(%arg0: memref<1024xi32>) { %t1 = aiex.dma_configure_task(%tile_0_1, S2MM, 0) { - aie.use_lock(%prod_lock, Acquire, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Acquire, %c1_ul10) aie.dma_bd(%buf0 : memref<512xi32>, 0, 512) {bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul11) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%prod_lock, Acquire, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Acquire, %c1_ul12) aie.dma_bd(%buf1 : memref<512xi32>, 0, 512) {bd_id = 1 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul13) aie.end } } @@ -301,9 +315,11 @@ module @test_memtile_different_lock_ids { aie.runtime_sequence(%arg0: memref<1024xi32>) { %t1 = aiex.dma_configure_task(%tile_0_1, S2MM, 0) { - aie.use_lock(%prod_lock, Acquire, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Acquire, %c1_ul14) aie.dma_bd(%buf : memref<1024xi32>, 0, 1024) {bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul15) aie.end } } diff --git a/test/bd-chains-and-dma-tasks/materialize-bd-chains/good-2.mlir b/test/bd-chains-and-dma-tasks/materialize-bd-chains/good-2.mlir index 766bcd38b1d..73e95212272 100644 --- a/test/bd-chains-and-dma-tasks/materialize-bd-chains/good-2.mlir +++ b/test/bd-chains-and-dma-tasks/materialize-bd-chains/good-2.mlir @@ -17,19 +17,25 @@ module { %lock_2 = aie.lock(%tile_0_0, 2) aie.bd_chain @simple_chain(%buf: memref<8xi16>, %l0: index, %l1: index, %l2: index) { - aie.use_lock(%l0, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l0, "Acquire", %c1_ul0) aie.dma_bd(%buf : memref<8xi16>, 0, 8) - aie.use_lock(%l1, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l1, "Release", %c1_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%l1, "Acquire", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%l1, "Acquire", %c1_ul2) aie.dma_bd(%buf : memref<8xi16>, 0, 8) - aie.use_lock(%l2, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l2, "Release", %c1_ul3) aie.next_bd ^bd2 ^bd2: - aie.use_lock(%l2, "Acquire", 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%l2, "Acquire", %c1_ul4) aie.dma_bd(%buf : memref<8xi16>, 0, 8) - aie.use_lock(%l0, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l0, "Release", %c1_ul5) aie.end } @@ -37,57 +43,75 @@ module { %t1 = aiex.dma_start_bd_chain @simple_chain(%buf, %lock_0, %lock_1, %lock_2) : (memref<8xi16>, index, index, index) on (%tile_0_0, MM2S, 0) // CHECK: %[[task1:.+]] = aiex.dma_configure_task(%tile_0_0, MM2S, 0) { - // CHECK: aie.use_lock(%lock_0, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<8xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_1, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_1, "Release", %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb1: - // CHECK: aie.use_lock(%lock_1, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_1, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<12xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_2, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_2, "Release", %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: - // CHECK: aie.use_lock(%lock_2, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_2, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<8xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_1, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_1, "Release", %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: aiex.dma_start_task(%[[task1]]) %t2 = aiex.dma_start_bd_chain @simple_chain(%buf, %lock_0, %lock_0, %lock_0) : (memref<8xi16>, index, index, index) on (%tile_0_0, MM2S, 1) // CHECK: %[[task2:.+]] = aiex.dma_configure_task(%tile_0_0, MM2S, 0) { - // CHECK: aie.use_lock(%lock_0, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<8xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_0, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Release", %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb1: - // CHECK: aie.use_lock(%lock_0, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<12xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_0, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Release", %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: - // CHECK: aie.use_lock(%lock_0, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<8xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_0, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Release", %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: aiex.dma_start_task(%[[task2]]) %t3 = aiex.dma_start_bd_chain @simple_chain(%buf, %lock_2, %lock_1, %lock_0) : (memref<8xi16>, index, index, index) on (%tile_0_0, S2MM, 0) // CHECK: %[[task3:.+]] = aiex.dma_configure_task(%tile_0_0, MM2S, 0) { - // CHECK: aie.use_lock(%lock_2, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_2, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<8xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_1, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_1, "Release", %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb1: - // CHECK: aie.use_lock(%lock_1, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_1, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<12xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_0, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Release", %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: - // CHECK: aie.use_lock(%lock_0, "Acquire", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_0, "Acquire", %{{.*}}) // CHECK: aie.dma_bd(%buf : memref<8xi16>, 0, 8) - // CHECK: aie.use_lock(%lock_2, "Release", 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%lock_2, "Release", %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: aiex.dma_start_task(%[[task3]]) diff --git a/test/benchmarks/01_DDR_SHIM_LM_FillRate/aie.mlir b/test/benchmarks/01_DDR_SHIM_LM_FillRate/aie.mlir index f8edd10c186..8f508a5b294 100644 --- a/test/benchmarks/01_DDR_SHIM_LM_FillRate/aie.mlir +++ b/test/benchmarks/01_DDR_SHIM_LM_FillRate/aie.mlir @@ -36,9 +36,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul0) aie.dma_bd(%buffer : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul1) aie.next_bd ^bd0 ^end: aie.end @@ -52,9 +54,11 @@ aie.device(xcvc1902) { %m71 = aie.mem(%t71) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l71_0, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l71_0, "Acquire", %c0_ul2) aie.dma_bd(%buf71_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l71_0, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l71_0, "Release", %c1_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/benchmarks/02_LM_SHIM_DDR_FillRate/aie.mlir b/test/benchmarks/02_LM_SHIM_DDR_FillRate/aie.mlir index c3a13ef2513..eff4f673490 100644 --- a/test/benchmarks/02_LM_SHIM_DDR_FillRate/aie.mlir +++ b/test/benchmarks/02_LM_SHIM_DDR_FillRate/aie.mlir @@ -25,9 +25,11 @@ aie.device(xcvc1902) { %m71 = aie.mem(%t71) { %srcDma = aie.dma_start(MM2S, 1, ^bd0, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul0) aie.dma_bd(%buf71_0 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul1) aie.next_bd ^end ^end: aie.end @@ -39,9 +41,11 @@ aie.device(xcvc1902) { aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buffer_out : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/benchmarks/03_Flood_DDR/aie.mlir b/test/benchmarks/03_Flood_DDR/aie.mlir index df7c6e8da3b..c85ff30e5a1 100644 --- a/test/benchmarks/03_Flood_DDR/aie.mlir +++ b/test/benchmarks/03_Flood_DDR/aie.mlir @@ -32,9 +32,11 @@ aie.device(xcvc1902) { %m21 = aie.mem(%t21) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l21_0, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l21_0, "Acquire", %c0_ul0) aie.dma_bd(%buf21_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l21_0, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l21_0, "Release", %c1_ul1) aie.next_bd ^end ^end: aie.end @@ -47,9 +49,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l20, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%l20, Acquire, %c1_ul2) aie.dma_bd(%buffer_out_20 : memref<7168xi32>, 0, 7168) - aie.use_lock(%l20, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%l20, Release, %c0_ul3) aie.next_bd ^bd0 ^end: aie.end @@ -75,9 +79,11 @@ aie.device(xcvc1902) { %m31 = aie.mem(%t31) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l31_0, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l31_0, "Acquire", %c0_ul4) aie.dma_bd(%buf31_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l31_0, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l31_0, "Release", %c1_ul5) aie.next_bd ^end ^end: aie.end @@ -91,9 +97,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul6) aie.dma_bd(%buffer_out_30 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul7) aie.next_bd ^bd0 ^end: aie.end @@ -119,9 +127,11 @@ aie.device(xcvc1902) { %m61 = aie.mem(%t61) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l61_0, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%l61_0, "Acquire", %c0_ul8) aie.dma_bd(%buf61_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l61_0, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%l61_0, "Release", %c1_ul9) aie.next_bd ^end ^end: aie.end @@ -134,9 +144,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul10) aie.dma_bd(%buffer_out_60 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul11 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul11) aie.next_bd ^bd0 ^end: aie.end @@ -165,9 +177,11 @@ aie.device(xcvc1902) { %m71 = aie.mem(%t71) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l71_0, "Acquire", 0) + %c0_ul12 = arith.constant 0 : i32 + aie.use_lock(%l71_0, "Acquire", %c0_ul12) aie.dma_bd(%buf71_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l71_0, "Release", 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%l71_0, "Release", %c1_ul13) aie.next_bd ^end ^end: aie.end @@ -181,9 +195,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul14) aie.dma_bd(%buffer_out_70 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul15) aie.next_bd ^bd0 ^end: aie.end @@ -212,9 +228,11 @@ aie.device(xcvc1902) { %m101 = aie.mem(%t101) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l101_0, "Acquire", 0) + %c0_ul16 = arith.constant 0 : i32 + aie.use_lock(%l101_0, "Acquire", %c0_ul16) aie.dma_bd(%buf101_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l101_0, "Release", 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%l101_0, "Release", %c1_ul17) aie.next_bd ^end ^end: aie.end @@ -227,9 +245,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul18) aie.dma_bd(%buffer_out_100 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul19) aie.next_bd ^bd0 ^end: aie.end @@ -255,9 +275,11 @@ aie.device(xcvc1902) { %m111 = aie.mem(%t111) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l111_0, "Acquire", 0) + %c0_ul20 = arith.constant 0 : i32 + aie.use_lock(%l111_0, "Acquire", %c0_ul20) aie.dma_bd(%buf111_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l111_0, "Release", 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%l111_0, "Release", %c1_ul21) aie.next_bd ^end ^end: aie.end @@ -270,9 +292,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul22) aie.dma_bd(%buffer_out_110 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul23 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul23) aie.next_bd ^bd0 ^end: aie.end @@ -298,9 +322,11 @@ aie.device(xcvc1902) { %m181 = aie.mem(%t181) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l181_0, "Acquire", 0) + %c0_ul24 = arith.constant 0 : i32 + aie.use_lock(%l181_0, "Acquire", %c0_ul24) aie.dma_bd(%buf181_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l181_0, "Release", 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%l181_0, "Release", %c1_ul25) aie.next_bd ^end ^end: aie.end @@ -314,9 +340,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul26) aie.dma_bd(%buffer_out_180 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul27 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul27) aie.next_bd ^bd0 ^end: aie.end @@ -343,9 +371,11 @@ aie.device(xcvc1902) { %m191 = aie.mem(%t191) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l191_0, "Acquire", 0) + %c0_ul28 = arith.constant 0 : i32 + aie.use_lock(%l191_0, "Acquire", %c0_ul28) aie.dma_bd(%buf191_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l191_0, "Release", 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%l191_0, "Release", %c1_ul29) aie.next_bd ^end ^end: aie.end @@ -358,9 +388,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul30) aie.dma_bd(%buffer_out_190 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul31 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul31) aie.next_bd ^bd0 ^end: aie.end @@ -386,9 +418,11 @@ aie.device(xcvc1902) { %m261 = aie.mem(%t261) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l261_0, "Acquire", 0) + %c0_ul32 = arith.constant 0 : i32 + aie.use_lock(%l261_0, "Acquire", %c0_ul32) aie.dma_bd(%buf261_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l261_0, "Release", 1) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%l261_0, "Release", %c1_ul33) aie.next_bd ^end ^end: aie.end @@ -402,9 +436,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul34) aie.dma_bd(%buffer_out_260 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul35 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul35) aie.next_bd ^bd0 ^end: aie.end @@ -431,9 +467,11 @@ aie.device(xcvc1902) { %m271 = aie.mem(%t271) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l271_0, "Acquire", 0) + %c0_ul36 = arith.constant 0 : i32 + aie.use_lock(%l271_0, "Acquire", %c0_ul36) aie.dma_bd(%buf271_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l271_0, "Release", 1) + %c1_ul37 = arith.constant 1 : i32 + aie.use_lock(%l271_0, "Release", %c1_ul37) aie.next_bd ^end ^end: aie.end @@ -447,9 +485,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul38) aie.dma_bd(%buffer_out_270 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul39 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul39) aie.next_bd ^bd0 ^end: aie.end @@ -475,9 +515,11 @@ aie.device(xcvc1902) { %m341 = aie.mem(%t341) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l341_0, "Acquire", 0) + %c0_ul40 = arith.constant 0 : i32 + aie.use_lock(%l341_0, "Acquire", %c0_ul40) aie.dma_bd(%buf341_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l341_0, "Release", 1) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%l341_0, "Release", %c1_ul41) aie.next_bd ^end ^end: aie.end @@ -490,9 +532,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul42) aie.dma_bd(%buffer_out_340 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul43 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul43) aie.next_bd ^bd0 ^end: aie.end @@ -518,9 +562,11 @@ aie.device(xcvc1902) { %m351 = aie.mem(%t351) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l351_0, "Acquire", 0) + %c0_ul44 = arith.constant 0 : i32 + aie.use_lock(%l351_0, "Acquire", %c0_ul44) aie.dma_bd(%buf351_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l351_0, "Release", 1) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%l351_0, "Release", %c1_ul45) aie.next_bd ^end ^end: aie.end @@ -533,9 +579,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul46 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul46) aie.dma_bd(%buffer_out_350 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul47 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul47) aie.next_bd ^bd0 ^end: aie.end @@ -554,9 +602,11 @@ aie.device(xcvc1902) { %m421 = aie.mem(%t421) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l421, "Acquire", 0) + %c0_ul48 = arith.constant 0 : i32 + aie.use_lock(%l421, "Acquire", %c0_ul48) aie.dma_bd(%buf421_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l421, "Release", 1) + %c1_ul49 = arith.constant 1 : i32 + aie.use_lock(%l421, "Release", %c1_ul49) aie.next_bd ^end ^end: aie.end @@ -570,9 +620,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul50 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul50) aie.dma_bd(%buffer_out_420 : memref<7168xi32>, 0, 7168) - aie.use_lock(%lock1, Release, 0) + %c0_ul51 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul51) aie.next_bd ^bd0 ^end: aie.end @@ -598,9 +650,11 @@ aie.device(xcvc1902) { %m431 = aie.mem(%t431) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l431_0, "Acquire", 0) + %c0_ul52 = arith.constant 0 : i32 + aie.use_lock(%l431_0, "Acquire", %c0_ul52) aie.dma_bd(%buf431_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l431_0, "Release", 1) + %c1_ul53 = arith.constant 1 : i32 + aie.use_lock(%l431_0, "Release", %c1_ul53) aie.next_bd ^end ^end: aie.end @@ -614,9 +668,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l430, Acquire, 1) + %c1_ul54 = arith.constant 1 : i32 + aie.use_lock(%l430, Acquire, %c1_ul54) aie.dma_bd(%buffer_out_430 : memref<7168xi32>, 0, 7168) - aie.use_lock(%l430, Release, 0) + %c0_ul55 = arith.constant 0 : i32 + aie.use_lock(%l430, Release, %c0_ul55) aie.next_bd ^bd0 ^end: aie.end @@ -643,9 +699,11 @@ aie.device(xcvc1902) { %m461 = aie.mem(%t461) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l461_0, "Acquire", 0) + %c0_ul56 = arith.constant 0 : i32 + aie.use_lock(%l461_0, "Acquire", %c0_ul56) aie.dma_bd(%buf461_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l461_0, "Release", 1) + %c1_ul57 = arith.constant 1 : i32 + aie.use_lock(%l461_0, "Release", %c1_ul57) aie.next_bd ^end ^end: aie.end @@ -658,9 +716,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l460, Acquire, 1) + %c1_ul58 = arith.constant 1 : i32 + aie.use_lock(%l460, Acquire, %c1_ul58) aie.dma_bd(%buffer_out_460 : memref<7168xi32>, 0, 7168) - aie.use_lock(%l460, Release, 0) + %c0_ul59 = arith.constant 0 : i32 + aie.use_lock(%l460, Release, %c0_ul59) aie.next_bd ^bd0 ^end: aie.end @@ -687,9 +747,11 @@ aie.device(xcvc1902) { %m471 = aie.mem(%t471) { %srcDma = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l471_0, "Acquire", 0) + %c0_ul60 = arith.constant 0 : i32 + aie.use_lock(%l471_0, "Acquire", %c0_ul60) aie.dma_bd(%buf471_0 : memref< 7168xi32>, 0, 7168) - aie.use_lock(%l471_0, "Release", 1) + %c1_ul61 = arith.constant 1 : i32 + aie.use_lock(%l471_0, "Release", %c1_ul61) aie.next_bd ^end ^end: aie.end @@ -703,9 +765,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l470, Acquire, 1) + %c1_ul62 = arith.constant 1 : i32 + aie.use_lock(%l470, Acquire, %c1_ul62) aie.dma_bd(%buffer_out_470 : memref<7168xi32>, 0, 7168) - aie.use_lock(%l470, Release, 0) + %c0_ul63 = arith.constant 0 : i32 + aie.use_lock(%l470, Release, %c0_ul63) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/benchmarks/04_Tile_Tile_FillRate/aie.mlir b/test/benchmarks/04_Tile_Tile_FillRate/aie.mlir index 9fc68ddd8e8..45e5ab49325 100755 --- a/test/benchmarks/04_Tile_Tile_FillRate/aie.mlir +++ b/test/benchmarks/04_Tile_Tile_FillRate/aie.mlir @@ -28,9 +28,11 @@ aie.device(xcvc1902) { %mem13 = aie.mem(%tile13) { %dma0 = aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock13_5, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Acquire", %c1_ul0) aie.dma_bd(%buf13_0 : memref<512xi32>, 0, 512) - aie.use_lock(%lock13_5, "Release", 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Release", %c0_ul1) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end @@ -44,9 +46,11 @@ aie.device(xcvc1902) { %mem14 = aie.mem(%tile14) { %dma0 = aie.dma_start(S2MM, 1, ^bd0, ^end) ^bd0: - aie.use_lock(%lock14_6, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock14_6, "Acquire", %c0_ul2) aie.dma_bd(%buf14_0: memref<512xi32>, 0, 512) - aie.use_lock(%lock14_6, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock14_6, "Release", %c1_ul3) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end diff --git a/test/benchmarks/07_Lock_Acquire/aie.mlir b/test/benchmarks/07_Lock_Acquire/aie.mlir index 0212cdb1d90..c3ba6223df7 100755 --- a/test/benchmarks/07_Lock_Acquire/aie.mlir +++ b/test/benchmarks/07_Lock_Acquire/aie.mlir @@ -17,7 +17,8 @@ aie.device(xcvc1902) { %l13_0 = aie.lock(%tile13, 0) aie.core(%tile13) { - aie.use_lock(%l13_0, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l13_0, "Acquire", %c0_ul0) aie.end } diff --git a/test/benchmarks/08_Lock_Release/aie.mlir b/test/benchmarks/08_Lock_Release/aie.mlir index aba6149df0b..d6dc85a7c70 100755 --- a/test/benchmarks/08_Lock_Release/aie.mlir +++ b/test/benchmarks/08_Lock_Release/aie.mlir @@ -17,7 +17,8 @@ aie.device(xcvc1902) { %l13_0 = aie.lock(%tile13, 0) aie.core(%tile13) { - aie.use_lock(%l13_0, "Release", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l13_0, "Release", %c0_ul0) aie.end } diff --git a/test/benchmarks/12_Stream_Delay/aie.mlir b/test/benchmarks/12_Stream_Delay/aie.mlir index f815c385597..de3d477b0b5 100755 --- a/test/benchmarks/12_Stream_Delay/aie.mlir +++ b/test/benchmarks/12_Stream_Delay/aie.mlir @@ -32,9 +32,11 @@ aie.device(xcvc1902) { %mem13 = aie.mem(%tile13) { %dma0 = aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock13_5, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Acquire", %c1_ul0) aie.dma_bd(%buf13_0 : memref<512xi32>, 0, 512) - aie.use_lock(%lock13_5, "Release", 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Release", %c0_ul1) aie.next_bd ^end ^end: aie.end @@ -50,9 +52,11 @@ aie.device(xcvc1902) { %dma0 = aie.dma_start(S2MM, 1, ^bd0, ^end) ^bd0: - aie.use_lock(%lock43_6, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock43_6, "Acquire", %c0_ul2) aie.dma_bd(%buf43_0: memref<512xi32>, 0, 512) - aie.use_lock(%lock43_6, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock43_6, "Release", %c1_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/create-flows/mmult.mlir b/test/create-flows/mmult.mlir index c20062279cc..bbbe41ebd79 100644 --- a/test/create-flows/mmult.mlir +++ b/test/create-flows/mmult.mlir @@ -50,28 +50,36 @@ module @aie.herd_0 { %11 = aie.mem(%3) { %63 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%9, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%9, Acquire, %c0_ul0) aie.dma_bd(%10 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%9, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%9, Release, %c1_ul1) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%4, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%4, Acquire, %c0_ul2) aie.dma_bd(%6 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%4, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%4, Release, %c1_ul3) aie.next_bd ^bb1 ^bb3: // pred: ^bb5 %64 = aie.dma_start(S2MM, 1, ^bb4, ^bb7) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%7, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%7, Acquire, %c0_ul4) aie.dma_bd(%8 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%7, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%7, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %65 = aie.dma_start(MM2S, 0, ^bb6, ^bb3) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%5, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%5, Acquire, %c1_ul6) aie.dma_bd(%6 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%5, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%5, Release, %c0_ul7) aie.next_bd ^bb6 ^bb7: // pred: ^bb3 aie.end @@ -91,28 +99,36 @@ module @aie.herd_0 { %25 = aie.mem(%17) { %63 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%23, Acquire, 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%23, Acquire, %c0_ul8) aie.dma_bd(%24 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%23, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%23, Release, %c1_ul9) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%18, Acquire, 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%18, Acquire, %c0_ul10) aie.dma_bd(%20 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%18, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%18, Release, %c1_ul11) aie.next_bd ^bb1 ^bb3: // pred: ^bb5 %64 = aie.dma_start(S2MM, 1, ^bb4, ^bb7) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%21, Acquire, 0) + %c0_ul12 = arith.constant 0 : i32 + aie.use_lock(%21, Acquire, %c0_ul12) aie.dma_bd(%22 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%21, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%21, Release, %c1_ul13) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %65 = aie.dma_start(MM2S, 0, ^bb6, ^bb3) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%19, Acquire, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%19, Acquire, %c1_ul14) aie.dma_bd(%20 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%19, Release, 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%19, Release, %c0_ul15) aie.next_bd ^bb6 ^bb7: // pred: ^bb3 aie.end @@ -132,28 +148,36 @@ module @aie.herd_0 { %39 = aie.mem(%31) { %63 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%37, Acquire, 0) + %c0_ul16 = arith.constant 0 : i32 + aie.use_lock(%37, Acquire, %c0_ul16) aie.dma_bd(%38 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%37, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%37, Release, %c1_ul17) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%32, Acquire, 0) + %c0_ul18 = arith.constant 0 : i32 + aie.use_lock(%32, Acquire, %c0_ul18) aie.dma_bd(%34 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%32, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%32, Release, %c1_ul19) aie.next_bd ^bb1 ^bb3: // pred: ^bb5 %64 = aie.dma_start(S2MM, 1, ^bb4, ^bb7) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%35, Acquire, 0) + %c0_ul20 = arith.constant 0 : i32 + aie.use_lock(%35, Acquire, %c0_ul20) aie.dma_bd(%36 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%35, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%35, Release, %c1_ul21) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %65 = aie.dma_start(MM2S, 0, ^bb6, ^bb3) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%33, Acquire, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%33, Acquire, %c1_ul22) aie.dma_bd(%34 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%33, Release, 0) + %c0_ul23 = arith.constant 0 : i32 + aie.use_lock(%33, Release, %c0_ul23) aie.next_bd ^bb6 ^bb7: // pred: ^bb3 aie.end @@ -173,28 +197,36 @@ module @aie.herd_0 { %53 = aie.mem(%45) { %63 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%51, Acquire, 0) + %c0_ul24 = arith.constant 0 : i32 + aie.use_lock(%51, Acquire, %c0_ul24) aie.dma_bd(%52 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%51, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%51, Release, %c1_ul25) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%46, Acquire, 0) + %c0_ul26 = arith.constant 0 : i32 + aie.use_lock(%46, Acquire, %c0_ul26) aie.dma_bd(%48 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%46, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%46, Release, %c1_ul27) aie.next_bd ^bb1 ^bb3: // pred: ^bb5 %64 = aie.dma_start(S2MM, 1, ^bb4, ^bb7) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%49, Acquire, 0) + %c0_ul28 = arith.constant 0 : i32 + aie.use_lock(%49, Acquire, %c0_ul28) aie.dma_bd(%50 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%49, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%49, Release, %c1_ul29) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %65 = aie.dma_start(MM2S, 0, ^bb6, ^bb3) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%47, Acquire, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%47, Acquire, %c1_ul30) aie.dma_bd(%48 : memref<16x16xf32, 2>, 0, 256) - aie.use_lock(%47, Release, 0) + %c0_ul31 = arith.constant 0 : i32 + aie.use_lock(%47, Release, %c0_ul31) aie.next_bd ^bb6 ^bb7: // pred: ^bb3 aie.end diff --git a/test/create-flows/vecmul_4x4_slow_test.mlir b/test/create-flows/vecmul_4x4_slow_test.mlir index 935677d099b..1507127b674 100644 --- a/test/create-flows/vecmul_4x4_slow_test.mlir +++ b/test/create-flows/vecmul_4x4_slow_test.mlir @@ -111,23 +111,29 @@ module @vecmul_4x4 { %11 = aie.mem(%4) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%9, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%9, Acquire, %c0_ul0) aie.dma_bd(%10 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%9, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%9, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%7, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%7, Acquire, %c0_ul2) aie.dma_bd(%8 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%7, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%7, Release, %c1_ul3) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%5, Acquire, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%5, Acquire, %c1_ul4) aie.dma_bd(%6 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%5, Release, 0) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%5, Release, %c0_ul5) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -137,18 +143,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%9, Acquire, 1) - aie.use_lock(%7, Acquire, 1) - aie.use_lock(%5, Acquire, 0) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%9, Acquire, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%7, Acquire, %c1_ul7) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%5, Acquire, %c0_ul8) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %10[%arg0] : memref<64xi32, 2> // %201 = affine.load %8[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %6[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%5, Release, 1) - aie.use_lock(%7, Release, 0) - aie.use_lock(%9, Release, 0) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%5, Release, %c1_ul9) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%7, Release, %c0_ul10) + %c0_ul11 = arith.constant 0 : i32 + aie.use_lock(%9, Release, %c0_ul11) cf.br ^bb1 } %13 = aie.tile(46, 2) @@ -165,23 +177,29 @@ module @vecmul_4x4 { %24 = aie.mem(%17) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%22, Acquire, 0) + %c0_ul12 = arith.constant 0 : i32 + aie.use_lock(%22, Acquire, %c0_ul12) aie.dma_bd(%23 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%22, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%22, Release, %c1_ul13) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%20, Acquire, 0) + %c0_ul14 = arith.constant 0 : i32 + aie.use_lock(%20, Acquire, %c0_ul14) aie.dma_bd(%21 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%20, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%20, Release, %c1_ul15) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%18, Acquire, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%18, Acquire, %c1_ul16) aie.dma_bd(%19 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%18, Release, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%18, Release, %c0_ul17) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -191,18 +209,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%22, Acquire, 1) - aie.use_lock(%20, Acquire, 1) - aie.use_lock(%18, Acquire, 0) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%22, Acquire, %c1_ul18) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%20, Acquire, %c1_ul19) + %c0_ul20 = arith.constant 0 : i32 + aie.use_lock(%18, Acquire, %c0_ul20) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %23[%arg0] : memref<64xi32, 2> // %201 = affine.load %21[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %19[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%18, Release, 1) - aie.use_lock(%20, Release, 0) - aie.use_lock(%22, Release, 0) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%18, Release, %c1_ul21) + %c0_ul22 = arith.constant 0 : i32 + aie.use_lock(%20, Release, %c0_ul22) + %c0_ul23 = arith.constant 0 : i32 + aie.use_lock(%22, Release, %c0_ul23) cf.br ^bb1 } %26 = aie.tile(43, 2) @@ -219,23 +243,29 @@ module @vecmul_4x4 { %37 = aie.mem(%30) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%35, Acquire, 0) + %c0_ul24 = arith.constant 0 : i32 + aie.use_lock(%35, Acquire, %c0_ul24) aie.dma_bd(%36 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%35, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%35, Release, %c1_ul25) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%33, Acquire, 0) + %c0_ul26 = arith.constant 0 : i32 + aie.use_lock(%33, Acquire, %c0_ul26) aie.dma_bd(%34 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%33, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%33, Release, %c1_ul27) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%31, Acquire, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%31, Acquire, %c1_ul28) aie.dma_bd(%32 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%31, Release, 0) + %c0_ul29 = arith.constant 0 : i32 + aie.use_lock(%31, Release, %c0_ul29) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -245,18 +275,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%35, Acquire, 1) - aie.use_lock(%33, Acquire, 1) - aie.use_lock(%31, Acquire, 0) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%35, Acquire, %c1_ul30) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%33, Acquire, %c1_ul31) + %c0_ul32 = arith.constant 0 : i32 + aie.use_lock(%31, Acquire, %c0_ul32) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %36[%arg0] : memref<64xi32, 2> // %201 = affine.load %34[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %32[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%31, Release, 1) - aie.use_lock(%33, Release, 0) - aie.use_lock(%35, Release, 0) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%31, Release, %c1_ul33) + %c0_ul34 = arith.constant 0 : i32 + aie.use_lock(%33, Release, %c0_ul34) + %c0_ul35 = arith.constant 0 : i32 + aie.use_lock(%35, Release, %c0_ul35) cf.br ^bb1 } %39 = aie.tile(42, 2) @@ -273,23 +309,29 @@ module @vecmul_4x4 { %50 = aie.mem(%43) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%48, Acquire, 0) + %c0_ul36 = arith.constant 0 : i32 + aie.use_lock(%48, Acquire, %c0_ul36) aie.dma_bd(%49 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%48, Release, 1) + %c1_ul37 = arith.constant 1 : i32 + aie.use_lock(%48, Release, %c1_ul37) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%46, Acquire, 0) + %c0_ul38 = arith.constant 0 : i32 + aie.use_lock(%46, Acquire, %c0_ul38) aie.dma_bd(%47 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%46, Release, 1) + %c1_ul39 = arith.constant 1 : i32 + aie.use_lock(%46, Release, %c1_ul39) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%44, Acquire, 1) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%44, Acquire, %c1_ul40) aie.dma_bd(%45 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%44, Release, 0) + %c0_ul41 = arith.constant 0 : i32 + aie.use_lock(%44, Release, %c0_ul41) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -299,18 +341,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%48, Acquire, 1) - aie.use_lock(%46, Acquire, 1) - aie.use_lock(%44, Acquire, 0) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%48, Acquire, %c1_ul42) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%46, Acquire, %c1_ul43) + %c0_ul44 = arith.constant 0 : i32 + aie.use_lock(%44, Acquire, %c0_ul44) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %49[%arg0] : memref<64xi32, 2> // %201 = affine.load %47[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %45[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%44, Release, 1) - aie.use_lock(%46, Release, 0) - aie.use_lock(%48, Release, 0) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%44, Release, %c1_ul45) + %c0_ul46 = arith.constant 0 : i32 + aie.use_lock(%46, Release, %c0_ul46) + %c0_ul47 = arith.constant 0 : i32 + aie.use_lock(%48, Release, %c0_ul47) cf.br ^bb1 } %52 = aie.tile(35, 2) @@ -326,23 +374,29 @@ module @vecmul_4x4 { %62 = aie.mem(%55) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%60, Acquire, 0) + %c0_ul48 = arith.constant 0 : i32 + aie.use_lock(%60, Acquire, %c0_ul48) aie.dma_bd(%61 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%60, Release, 1) + %c1_ul49 = arith.constant 1 : i32 + aie.use_lock(%60, Release, %c1_ul49) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%58, Acquire, 0) + %c0_ul50 = arith.constant 0 : i32 + aie.use_lock(%58, Acquire, %c0_ul50) aie.dma_bd(%59 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%58, Release, 1) + %c1_ul51 = arith.constant 1 : i32 + aie.use_lock(%58, Release, %c1_ul51) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%56, Acquire, 1) + %c1_ul52 = arith.constant 1 : i32 + aie.use_lock(%56, Acquire, %c1_ul52) aie.dma_bd(%57 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%56, Release, 0) + %c0_ul53 = arith.constant 0 : i32 + aie.use_lock(%56, Release, %c0_ul53) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -352,18 +406,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%60, Acquire, 1) - aie.use_lock(%58, Acquire, 1) - aie.use_lock(%56, Acquire, 0) + %c1_ul54 = arith.constant 1 : i32 + aie.use_lock(%60, Acquire, %c1_ul54) + %c1_ul55 = arith.constant 1 : i32 + aie.use_lock(%58, Acquire, %c1_ul55) + %c0_ul56 = arith.constant 0 : i32 + aie.use_lock(%56, Acquire, %c0_ul56) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %61[%arg0] : memref<64xi32, 2> // %201 = affine.load %59[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %57[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%56, Release, 1) - aie.use_lock(%58, Release, 0) - aie.use_lock(%60, Release, 0) + %c1_ul57 = arith.constant 1 : i32 + aie.use_lock(%56, Release, %c1_ul57) + %c0_ul58 = arith.constant 0 : i32 + aie.use_lock(%58, Release, %c0_ul58) + %c0_ul59 = arith.constant 0 : i32 + aie.use_lock(%60, Release, %c0_ul59) cf.br ^bb1 } %64 = aie.tile(34, 2) @@ -379,23 +439,29 @@ module @vecmul_4x4 { %74 = aie.mem(%67) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%72, Acquire, 0) + %c0_ul60 = arith.constant 0 : i32 + aie.use_lock(%72, Acquire, %c0_ul60) aie.dma_bd(%73 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%72, Release, 1) + %c1_ul61 = arith.constant 1 : i32 + aie.use_lock(%72, Release, %c1_ul61) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%70, Acquire, 0) + %c0_ul62 = arith.constant 0 : i32 + aie.use_lock(%70, Acquire, %c0_ul62) aie.dma_bd(%71 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%70, Release, 1) + %c1_ul63 = arith.constant 1 : i32 + aie.use_lock(%70, Release, %c1_ul63) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%68, Acquire, 1) + %c1_ul64 = arith.constant 1 : i32 + aie.use_lock(%68, Acquire, %c1_ul64) aie.dma_bd(%69 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%68, Release, 0) + %c0_ul65 = arith.constant 0 : i32 + aie.use_lock(%68, Release, %c0_ul65) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -405,18 +471,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%72, Acquire, 1) - aie.use_lock(%70, Acquire, 1) - aie.use_lock(%68, Acquire, 0) + %c1_ul66 = arith.constant 1 : i32 + aie.use_lock(%72, Acquire, %c1_ul66) + %c1_ul67 = arith.constant 1 : i32 + aie.use_lock(%70, Acquire, %c1_ul67) + %c0_ul68 = arith.constant 0 : i32 + aie.use_lock(%68, Acquire, %c0_ul68) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %73[%arg0] : memref<64xi32, 2> // %201 = affine.load %71[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %69[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%68, Release, 1) - aie.use_lock(%70, Release, 0) - aie.use_lock(%72, Release, 0) + %c1_ul69 = arith.constant 1 : i32 + aie.use_lock(%68, Release, %c1_ul69) + %c0_ul70 = arith.constant 0 : i32 + aie.use_lock(%70, Release, %c0_ul70) + %c0_ul71 = arith.constant 0 : i32 + aie.use_lock(%72, Release, %c0_ul71) cf.br ^bb1 } %76 = aie.tile(27, 2) @@ -433,23 +505,29 @@ module @vecmul_4x4 { %87 = aie.mem(%80) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%85, Acquire, 0) + %c0_ul72 = arith.constant 0 : i32 + aie.use_lock(%85, Acquire, %c0_ul72) aie.dma_bd(%86 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%85, Release, 1) + %c1_ul73 = arith.constant 1 : i32 + aie.use_lock(%85, Release, %c1_ul73) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%83, Acquire, 0) + %c0_ul74 = arith.constant 0 : i32 + aie.use_lock(%83, Acquire, %c0_ul74) aie.dma_bd(%84 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%83, Release, 1) + %c1_ul75 = arith.constant 1 : i32 + aie.use_lock(%83, Release, %c1_ul75) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%81, Acquire, 1) + %c1_ul76 = arith.constant 1 : i32 + aie.use_lock(%81, Acquire, %c1_ul76) aie.dma_bd(%82 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%81, Release, 0) + %c0_ul77 = arith.constant 0 : i32 + aie.use_lock(%81, Release, %c0_ul77) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -459,18 +537,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%85, Acquire, 1) - aie.use_lock(%83, Acquire, 1) - aie.use_lock(%81, Acquire, 0) + %c1_ul78 = arith.constant 1 : i32 + aie.use_lock(%85, Acquire, %c1_ul78) + %c1_ul79 = arith.constant 1 : i32 + aie.use_lock(%83, Acquire, %c1_ul79) + %c0_ul80 = arith.constant 0 : i32 + aie.use_lock(%81, Acquire, %c0_ul80) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %86[%arg0] : memref<64xi32, 2> // %201 = affine.load %84[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %82[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%81, Release, 1) - aie.use_lock(%83, Release, 0) - aie.use_lock(%85, Release, 0) + %c1_ul81 = arith.constant 1 : i32 + aie.use_lock(%81, Release, %c1_ul81) + %c0_ul82 = arith.constant 0 : i32 + aie.use_lock(%83, Release, %c0_ul82) + %c0_ul83 = arith.constant 0 : i32 + aie.use_lock(%85, Release, %c0_ul83) cf.br ^bb1 } %89 = aie.tile(26, 2) @@ -487,23 +571,29 @@ module @vecmul_4x4 { %100 = aie.mem(%93) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%98, Acquire, 0) + %c0_ul84 = arith.constant 0 : i32 + aie.use_lock(%98, Acquire, %c0_ul84) aie.dma_bd(%99 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%98, Release, 1) + %c1_ul85 = arith.constant 1 : i32 + aie.use_lock(%98, Release, %c1_ul85) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%96, Acquire, 0) + %c0_ul86 = arith.constant 0 : i32 + aie.use_lock(%96, Acquire, %c0_ul86) aie.dma_bd(%97 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%96, Release, 1) + %c1_ul87 = arith.constant 1 : i32 + aie.use_lock(%96, Release, %c1_ul87) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%94, Acquire, 1) + %c1_ul88 = arith.constant 1 : i32 + aie.use_lock(%94, Acquire, %c1_ul88) aie.dma_bd(%95 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%94, Release, 0) + %c0_ul89 = arith.constant 0 : i32 + aie.use_lock(%94, Release, %c0_ul89) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -513,18 +603,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%98, Acquire, 1) - aie.use_lock(%96, Acquire, 1) - aie.use_lock(%94, Acquire, 0) + %c1_ul90 = arith.constant 1 : i32 + aie.use_lock(%98, Acquire, %c1_ul90) + %c1_ul91 = arith.constant 1 : i32 + aie.use_lock(%96, Acquire, %c1_ul91) + %c0_ul92 = arith.constant 0 : i32 + aie.use_lock(%94, Acquire, %c0_ul92) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %99[%arg0] : memref<64xi32, 2> // %201 = affine.load %97[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %95[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%94, Release, 1) - aie.use_lock(%96, Release, 0) - aie.use_lock(%98, Release, 0) + %c1_ul93 = arith.constant 1 : i32 + aie.use_lock(%94, Release, %c1_ul93) + %c0_ul94 = arith.constant 0 : i32 + aie.use_lock(%96, Release, %c0_ul94) + %c0_ul95 = arith.constant 0 : i32 + aie.use_lock(%98, Release, %c0_ul95) cf.br ^bb1 } %102 = aie.tile(19, 2) @@ -540,23 +636,29 @@ module @vecmul_4x4 { %112 = aie.mem(%105) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%110, Acquire, 0) + %c0_ul96 = arith.constant 0 : i32 + aie.use_lock(%110, Acquire, %c0_ul96) aie.dma_bd(%111 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%110, Release, 1) + %c1_ul97 = arith.constant 1 : i32 + aie.use_lock(%110, Release, %c1_ul97) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%108, Acquire, 0) + %c0_ul98 = arith.constant 0 : i32 + aie.use_lock(%108, Acquire, %c0_ul98) aie.dma_bd(%109 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%108, Release, 1) + %c1_ul99 = arith.constant 1 : i32 + aie.use_lock(%108, Release, %c1_ul99) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%106, Acquire, 1) + %c1_ul100 = arith.constant 1 : i32 + aie.use_lock(%106, Acquire, %c1_ul100) aie.dma_bd(%107 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%106, Release, 0) + %c0_ul101 = arith.constant 0 : i32 + aie.use_lock(%106, Release, %c0_ul101) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -566,18 +668,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%110, Acquire, 1) - aie.use_lock(%108, Acquire, 1) - aie.use_lock(%106, Acquire, 0) + %c1_ul102 = arith.constant 1 : i32 + aie.use_lock(%110, Acquire, %c1_ul102) + %c1_ul103 = arith.constant 1 : i32 + aie.use_lock(%108, Acquire, %c1_ul103) + %c0_ul104 = arith.constant 0 : i32 + aie.use_lock(%106, Acquire, %c0_ul104) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %111[%arg0] : memref<64xi32, 2> // %201 = affine.load %109[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %107[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%106, Release, 1) - aie.use_lock(%108, Release, 0) - aie.use_lock(%110, Release, 0) + %c1_ul105 = arith.constant 1 : i32 + aie.use_lock(%106, Release, %c1_ul105) + %c0_ul106 = arith.constant 0 : i32 + aie.use_lock(%108, Release, %c0_ul106) + %c0_ul107 = arith.constant 0 : i32 + aie.use_lock(%110, Release, %c0_ul107) cf.br ^bb1 } %114 = aie.tile(18, 2) @@ -593,23 +701,29 @@ module @vecmul_4x4 { %124 = aie.mem(%117) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%122, Acquire, 0) + %c0_ul108 = arith.constant 0 : i32 + aie.use_lock(%122, Acquire, %c0_ul108) aie.dma_bd(%123 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%122, Release, 1) + %c1_ul109 = arith.constant 1 : i32 + aie.use_lock(%122, Release, %c1_ul109) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%120, Acquire, 0) + %c0_ul110 = arith.constant 0 : i32 + aie.use_lock(%120, Acquire, %c0_ul110) aie.dma_bd(%121 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%120, Release, 1) + %c1_ul111 = arith.constant 1 : i32 + aie.use_lock(%120, Release, %c1_ul111) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%118, Acquire, 1) + %c1_ul112 = arith.constant 1 : i32 + aie.use_lock(%118, Acquire, %c1_ul112) aie.dma_bd(%119 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%118, Release, 0) + %c0_ul113 = arith.constant 0 : i32 + aie.use_lock(%118, Release, %c0_ul113) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -619,18 +733,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%122, Acquire, 1) - aie.use_lock(%120, Acquire, 1) - aie.use_lock(%118, Acquire, 0) + %c1_ul114 = arith.constant 1 : i32 + aie.use_lock(%122, Acquire, %c1_ul114) + %c1_ul115 = arith.constant 1 : i32 + aie.use_lock(%120, Acquire, %c1_ul115) + %c0_ul116 = arith.constant 0 : i32 + aie.use_lock(%118, Acquire, %c0_ul116) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %123[%arg0] : memref<64xi32, 2> // %201 = affine.load %121[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %119[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%118, Release, 1) - aie.use_lock(%120, Release, 0) - aie.use_lock(%122, Release, 0) + %c1_ul117 = arith.constant 1 : i32 + aie.use_lock(%118, Release, %c1_ul117) + %c0_ul118 = arith.constant 0 : i32 + aie.use_lock(%120, Release, %c0_ul118) + %c0_ul119 = arith.constant 0 : i32 + aie.use_lock(%122, Release, %c0_ul119) cf.br ^bb1 } %126 = aie.tile(11, 2) @@ -647,23 +767,29 @@ module @vecmul_4x4 { %137 = aie.mem(%130) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%135, Acquire, 0) + %c0_ul120 = arith.constant 0 : i32 + aie.use_lock(%135, Acquire, %c0_ul120) aie.dma_bd(%136 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%135, Release, 1) + %c1_ul121 = arith.constant 1 : i32 + aie.use_lock(%135, Release, %c1_ul121) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%133, Acquire, 0) + %c0_ul122 = arith.constant 0 : i32 + aie.use_lock(%133, Acquire, %c0_ul122) aie.dma_bd(%134 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%133, Release, 1) + %c1_ul123 = arith.constant 1 : i32 + aie.use_lock(%133, Release, %c1_ul123) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%131, Acquire, 1) + %c1_ul124 = arith.constant 1 : i32 + aie.use_lock(%131, Acquire, %c1_ul124) aie.dma_bd(%132 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%131, Release, 0) + %c0_ul125 = arith.constant 0 : i32 + aie.use_lock(%131, Release, %c0_ul125) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -673,18 +799,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%135, Acquire, 1) - aie.use_lock(%133, Acquire, 1) - aie.use_lock(%131, Acquire, 0) + %c1_ul126 = arith.constant 1 : i32 + aie.use_lock(%135, Acquire, %c1_ul126) + %c1_ul127 = arith.constant 1 : i32 + aie.use_lock(%133, Acquire, %c1_ul127) + %c0_ul128 = arith.constant 0 : i32 + aie.use_lock(%131, Acquire, %c0_ul128) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %136[%arg0] : memref<64xi32, 2> // %201 = affine.load %134[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %132[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%131, Release, 1) - aie.use_lock(%133, Release, 0) - aie.use_lock(%135, Release, 0) + %c1_ul129 = arith.constant 1 : i32 + aie.use_lock(%131, Release, %c1_ul129) + %c0_ul130 = arith.constant 0 : i32 + aie.use_lock(%133, Release, %c0_ul130) + %c0_ul131 = arith.constant 0 : i32 + aie.use_lock(%135, Release, %c0_ul131) cf.br ^bb1 } %139 = aie.tile(10, 1) @@ -700,23 +832,29 @@ module @vecmul_4x4 { %149 = aie.mem(%142) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%147, Acquire, 0) + %c0_ul132 = arith.constant 0 : i32 + aie.use_lock(%147, Acquire, %c0_ul132) aie.dma_bd(%148 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%147, Release, 1) + %c1_ul133 = arith.constant 1 : i32 + aie.use_lock(%147, Release, %c1_ul133) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%145, Acquire, 0) + %c0_ul134 = arith.constant 0 : i32 + aie.use_lock(%145, Acquire, %c0_ul134) aie.dma_bd(%146 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%145, Release, 1) + %c1_ul135 = arith.constant 1 : i32 + aie.use_lock(%145, Release, %c1_ul135) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%143, Acquire, 1) + %c1_ul136 = arith.constant 1 : i32 + aie.use_lock(%143, Acquire, %c1_ul136) aie.dma_bd(%144 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%143, Release, 0) + %c0_ul137 = arith.constant 0 : i32 + aie.use_lock(%143, Release, %c0_ul137) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -726,18 +864,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%147, Acquire, 1) - aie.use_lock(%145, Acquire, 1) - aie.use_lock(%143, Acquire, 0) + %c1_ul138 = arith.constant 1 : i32 + aie.use_lock(%147, Acquire, %c1_ul138) + %c1_ul139 = arith.constant 1 : i32 + aie.use_lock(%145, Acquire, %c1_ul139) + %c0_ul140 = arith.constant 0 : i32 + aie.use_lock(%143, Acquire, %c0_ul140) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %148[%arg0] : memref<64xi32, 2> // %201 = affine.load %146[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %144[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%143, Release, 1) - aie.use_lock(%145, Release, 0) - aie.use_lock(%147, Release, 0) + %c1_ul141 = arith.constant 1 : i32 + aie.use_lock(%143, Release, %c1_ul141) + %c0_ul142 = arith.constant 0 : i32 + aie.use_lock(%145, Release, %c0_ul142) + %c0_ul143 = arith.constant 0 : i32 + aie.use_lock(%147, Release, %c0_ul143) cf.br ^bb1 } %151 = aie.tile(7, 1) @@ -752,23 +896,29 @@ module @vecmul_4x4 { %160 = aie.mem(%153) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%158, Acquire, 0) + %c0_ul144 = arith.constant 0 : i32 + aie.use_lock(%158, Acquire, %c0_ul144) aie.dma_bd(%159 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%158, Release, 1) + %c1_ul145 = arith.constant 1 : i32 + aie.use_lock(%158, Release, %c1_ul145) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%156, Acquire, 0) + %c0_ul146 = arith.constant 0 : i32 + aie.use_lock(%156, Acquire, %c0_ul146) aie.dma_bd(%157 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%156, Release, 1) + %c1_ul147 = arith.constant 1 : i32 + aie.use_lock(%156, Release, %c1_ul147) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%154, Acquire, 1) + %c1_ul148 = arith.constant 1 : i32 + aie.use_lock(%154, Acquire, %c1_ul148) aie.dma_bd(%155 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%154, Release, 0) + %c0_ul149 = arith.constant 0 : i32 + aie.use_lock(%154, Release, %c0_ul149) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -778,18 +928,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%158, Acquire, 1) - aie.use_lock(%156, Acquire, 1) - aie.use_lock(%154, Acquire, 0) + %c1_ul150 = arith.constant 1 : i32 + aie.use_lock(%158, Acquire, %c1_ul150) + %c1_ul151 = arith.constant 1 : i32 + aie.use_lock(%156, Acquire, %c1_ul151) + %c0_ul152 = arith.constant 0 : i32 + aie.use_lock(%154, Acquire, %c0_ul152) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %159[%arg0] : memref<64xi32, 2> // %201 = affine.load %157[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %155[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%154, Release, 1) - aie.use_lock(%156, Release, 0) - aie.use_lock(%158, Release, 0) + %c1_ul153 = arith.constant 1 : i32 + aie.use_lock(%154, Release, %c1_ul153) + %c0_ul154 = arith.constant 0 : i32 + aie.use_lock(%156, Release, %c0_ul154) + %c0_ul155 = arith.constant 0 : i32 + aie.use_lock(%158, Release, %c0_ul155) cf.br ^bb1 } %162 = aie.tile(6, 2) @@ -805,23 +961,29 @@ module @vecmul_4x4 { %172 = aie.mem(%165) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%170, Acquire, 0) + %c0_ul156 = arith.constant 0 : i32 + aie.use_lock(%170, Acquire, %c0_ul156) aie.dma_bd(%171 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%170, Release, 1) + %c1_ul157 = arith.constant 1 : i32 + aie.use_lock(%170, Release, %c1_ul157) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%168, Acquire, 0) + %c0_ul158 = arith.constant 0 : i32 + aie.use_lock(%168, Acquire, %c0_ul158) aie.dma_bd(%169 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%168, Release, 1) + %c1_ul159 = arith.constant 1 : i32 + aie.use_lock(%168, Release, %c1_ul159) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%166, Acquire, 1) + %c1_ul160 = arith.constant 1 : i32 + aie.use_lock(%166, Acquire, %c1_ul160) aie.dma_bd(%167 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%166, Release, 0) + %c0_ul161 = arith.constant 0 : i32 + aie.use_lock(%166, Release, %c0_ul161) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -831,18 +993,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%170, Acquire, 1) - aie.use_lock(%168, Acquire, 1) - aie.use_lock(%166, Acquire, 0) + %c1_ul162 = arith.constant 1 : i32 + aie.use_lock(%170, Acquire, %c1_ul162) + %c1_ul163 = arith.constant 1 : i32 + aie.use_lock(%168, Acquire, %c1_ul163) + %c0_ul164 = arith.constant 0 : i32 + aie.use_lock(%166, Acquire, %c0_ul164) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %171[%arg0] : memref<64xi32, 2> // %201 = affine.load %169[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %167[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%166, Release, 1) - aie.use_lock(%168, Release, 0) - aie.use_lock(%170, Release, 0) + %c1_ul165 = arith.constant 1 : i32 + aie.use_lock(%166, Release, %c1_ul165) + %c0_ul166 = arith.constant 0 : i32 + aie.use_lock(%168, Release, %c0_ul166) + %c0_ul167 = arith.constant 0 : i32 + aie.use_lock(%170, Release, %c0_ul167) cf.br ^bb1 } %174 = aie.tile(3, 2) @@ -859,23 +1027,29 @@ module @vecmul_4x4 { %185 = aie.mem(%178) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%183, Acquire, 0) + %c0_ul168 = arith.constant 0 : i32 + aie.use_lock(%183, Acquire, %c0_ul168) aie.dma_bd(%184 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%183, Release, 1) + %c1_ul169 = arith.constant 1 : i32 + aie.use_lock(%183, Release, %c1_ul169) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%181, Acquire, 0) + %c0_ul170 = arith.constant 0 : i32 + aie.use_lock(%181, Acquire, %c0_ul170) aie.dma_bd(%182 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%181, Release, 1) + %c1_ul171 = arith.constant 1 : i32 + aie.use_lock(%181, Release, %c1_ul171) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%179, Acquire, 1) + %c1_ul172 = arith.constant 1 : i32 + aie.use_lock(%179, Acquire, %c1_ul172) aie.dma_bd(%180 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%179, Release, 0) + %c0_ul173 = arith.constant 0 : i32 + aie.use_lock(%179, Release, %c0_ul173) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -885,18 +1059,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%183, Acquire, 1) - aie.use_lock(%181, Acquire, 1) - aie.use_lock(%179, Acquire, 0) + %c1_ul174 = arith.constant 1 : i32 + aie.use_lock(%183, Acquire, %c1_ul174) + %c1_ul175 = arith.constant 1 : i32 + aie.use_lock(%181, Acquire, %c1_ul175) + %c0_ul176 = arith.constant 0 : i32 + aie.use_lock(%179, Acquire, %c0_ul176) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %184[%arg0] : memref<64xi32, 2> // %201 = affine.load %182[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %180[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%179, Release, 1) - aie.use_lock(%181, Release, 0) - aie.use_lock(%183, Release, 0) + %c1_ul177 = arith.constant 1 : i32 + aie.use_lock(%179, Release, %c1_ul177) + %c0_ul178 = arith.constant 0 : i32 + aie.use_lock(%181, Release, %c0_ul178) + %c0_ul179 = arith.constant 0 : i32 + aie.use_lock(%183, Release, %c0_ul179) cf.br ^bb1 } %187 = aie.tile(2, 2) @@ -913,23 +1093,29 @@ module @vecmul_4x4 { %198 = aie.mem(%191) { %200 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%196, Acquire, 0) + %c0_ul180 = arith.constant 0 : i32 + aie.use_lock(%196, Acquire, %c0_ul180) aie.dma_bd(%197 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%196, Release, 1) + %c1_ul181 = arith.constant 1 : i32 + aie.use_lock(%196, Release, %c1_ul181) aie.next_bd ^bb1 ^bb2: // pred: ^bb4 %201 = aie.dma_start(S2MM, 1, ^bb3, ^bb6) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%194, Acquire, 0) + %c0_ul182 = arith.constant 0 : i32 + aie.use_lock(%194, Acquire, %c0_ul182) aie.dma_bd(%195 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%194, Release, 1) + %c1_ul183 = arith.constant 1 : i32 + aie.use_lock(%194, Release, %c1_ul183) aie.next_bd ^bb3 ^bb4: // pred: ^bb0 %202 = aie.dma_start(MM2S, 0, ^bb5, ^bb2) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%192, Acquire, 1) + %c1_ul184 = arith.constant 1 : i32 + aie.use_lock(%192, Acquire, %c1_ul184) aie.dma_bd(%193 : memref<64xi32, 2>, 0, 64) - aie.use_lock(%192, Release, 0) + %c0_ul185 = arith.constant 0 : i32 + aie.use_lock(%192, Release, %c0_ul185) aie.next_bd ^bb5 ^bb6: // pred: ^bb2 aie.end @@ -939,18 +1125,24 @@ module @vecmul_4x4 { ^bb1: // 2 preds: ^bb0, ^bb2 cf.br ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%196, Acquire, 1) - aie.use_lock(%194, Acquire, 1) - aie.use_lock(%192, Acquire, 0) + %c1_ul186 = arith.constant 1 : i32 + aie.use_lock(%196, Acquire, %c1_ul186) + %c1_ul187 = arith.constant 1 : i32 + aie.use_lock(%194, Acquire, %c1_ul187) + %c0_ul188 = arith.constant 0 : i32 + aie.use_lock(%192, Acquire, %c0_ul188) // affine.for %arg0 = 0 to 64 { // %200 = affine.load %197[%arg0] : memref<64xi32, 2> // %201 = affine.load %195[%arg0] : memref<64xi32, 2> // %202 = arith.muli %200, %201 : i32 // affine.store %202, %193[%arg0] : memref<64xi32, 2> // } - aie.use_lock(%192, Release, 1) - aie.use_lock(%194, Release, 0) - aie.use_lock(%196, Release, 0) + %c1_ul189 = arith.constant 1 : i32 + aie.use_lock(%192, Release, %c1_ul189) + %c0_ul190 = arith.constant 0 : i32 + aie.use_lock(%194, Release, %c0_ul190) + %c0_ul191 = arith.constant 0 : i32 + aie.use_lock(%196, Release, %c0_ul191) cf.br ^bb1 } aie.flow(%189, DMA : 0, %191, DMA : 0) diff --git a/test/create-locks/test_lock0.mlir b/test/create-locks/test_lock0.mlir index 41fd2a3304f..97d446d73d6 100644 --- a/test/create-locks/test_lock0.mlir +++ b/test/create-locks/test_lock0.mlir @@ -8,23 +8,31 @@ // RUN: aie-opt --aie-create-locks %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { +// CHECK-LABEL: module @test_lock0 { +// CHECK: aie.device(xcvc1902) { // CHECK: %[[VAL_0:.*]] = aie.tile(3, 3) // CHECK: %[[VAL_1:.*]] = aie.tile(2, 3) -// CHECK: %[[VAL_2:.*]] = aie.lock(%[[VAL_1]], 0) +// CHECK: %[[VAL_2:.*]] = aie.lock(%[[VAL_1]], 0) {init = 0 : i32} +// CHECK: aiex.token(0) {sym_name = "token0"} +// CHECK: %[[VAL_3:.*]] = aie.mem(%[[VAL_0]]) { +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_4:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: aie.end +// CHECK: } // CHECK: %[[VAL_5:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: aiex.useToken @token0(Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 1) +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_6:.*]] = aie.core(%[[VAL_1]]) { -// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 0) +// CHECK: aiex.useToken @token0(Acquire, 1) +// CHECK: aiex.useToken @token0(Release, 2) +// CHECK: aie.end // CHECK: } // CHECK: } +// CHECK: } -// Generate LockOp in the top-level module -// Lower UseTokenOp to UseLockOp -// Tile-Tile module @test_lock0 { aie.device(xcvc1902) { %t33 = aie.tile(3, 3) diff --git a/test/create-locks/test_lock1.mlir b/test/create-locks/test_lock1.mlir index d6e475ebb51..4840a5244ed 100644 --- a/test/create-locks/test_lock1.mlir +++ b/test/create-locks/test_lock1.mlir @@ -8,32 +8,41 @@ // RUN: aie-opt --aie-create-locks %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { +// CHECK-LABEL: module @test_lock1 { +// CHECK: aie.device(xcvc1902) { // CHECK: %[[VAL_0:.*]] = aie.tile(3, 3) -// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) +// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32} // CHECK: %[[VAL_2:.*]] = aie.tile(2, 3) -// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) +// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) {init = 0 : i32} // CHECK: %[[VAL_4:.*]] = aie.tile(4, 3) // CHECK: aiex.token(0) {sym_name = "token0"} +// CHECK: %[[VAL_5:.*]] = aie.mem(%[[VAL_0]]) { +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_6:.*]] = aie.mem(%[[VAL_2]]) { +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_7:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: aie.end +// CHECK: } // CHECK: %[[VAL_8:.*]] = aie.core(%[[VAL_2]]) { -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: aiex.useToken @token0(Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 1) +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_9:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) +// CHECK: aiex.useToken @token0(Acquire, 1) +// CHECK: aiex.useToken @token0(Release, 2) +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_10:.*]] = aie.core(%[[VAL_4]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 0) +// CHECK: aiex.useToken @token0(Acquire, 2) +// CHECK: aiex.useToken @token0(Release, 3) +// CHECK: aie.end // CHECK: } // CHECK: } +// CHECK: } -// Generate LockOp in the top-level module -// Lower UseTokenOp to UseLockOp -// Tile-Tile-Tile module @test_lock1 { aie.device(xcvc1902) { %t33 = aie.tile(3, 3) diff --git a/test/create-locks/test_lock2.mlir b/test/create-locks/test_lock2.mlir index 7d6164c18f0..bef53e43bb6 100644 --- a/test/create-locks/test_lock2.mlir +++ b/test/create-locks/test_lock2.mlir @@ -8,56 +8,70 @@ // RUN: aie-opt --aie-create-locks %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { +// CHECK-LABEL: module @test_lock2 { +// CHECK: aie.device(xcvc1902) { // CHECK: %[[VAL_0:.*]] = aie.tile(3, 3) -// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) +// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32} // CHECK: %[[VAL_2:.*]] = aie.tile(2, 3) -// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) +// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) {init = 0 : i32} // CHECK: %[[VAL_4:.*]] = aie.tile(3, 4) -// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_4]], 0) +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_4]], 0) {init = 0 : i32} // CHECK: %[[VAL_6:.*]] = aie.tile(4, 3) // CHECK: %[[VAL_7:.*]] = aie.tile(3, 2) -// CHECK: %[[VAL_8:.*]] = aie.lock(%[[VAL_7]], 0) +// CHECK: %[[VAL_8:.*]] = aie.lock(%[[VAL_7]], 0) {init = 0 : i32} // CHECK: aiex.token(0) {sym_name = "token0"} // CHECK: aiex.token(0) {sym_name = "token1"} // CHECK: aiex.token(0) {sym_name = "token2"} // CHECK: aiex.token(0) {sym_name = "token3"} +// CHECK: %[[VAL_9:.*]] = aie.mem(%[[VAL_0]]) { +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_10:.*]] = aie.mem(%[[VAL_2]]) { +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_11:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_12:.*]] = aie.mem(%[[VAL_6]]) { +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_13:.*]] = aie.mem(%[[VAL_7]]) { +// CHECK: aie.end +// CHECK: } // CHECK: %[[VAL_14:.*]] = aie.core(%[[VAL_2]]) { -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 0) +// CHECK: aiex.useToken @token0(Acquire, 1) +// CHECK: aiex.useToken @token0(Release, 2) +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_15:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: aiex.useToken @token3(Acquire, 0) +// CHECK: aiex.useToken @token2(Acquire, 0) +// CHECK: aiex.useToken @token1(Acquire, 0) +// CHECK: aiex.useToken @token0(Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 1) +// CHECK: aiex.useToken @token1(Release, 1) +// CHECK: aiex.useToken @token2(Release, 1) +// CHECK: aiex.useToken @token3(Release, 1) +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_16:.*]] = aie.core(%[[VAL_4]]) { -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 0) +// CHECK: aiex.useToken @token1(Acquire, 1) +// CHECK: aiex.useToken @token1(Release, 2) +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_17:.*]] = aie.core(%[[VAL_6]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 0) +// CHECK: aiex.useToken @token2(Acquire, 1) +// CHECK: aiex.useToken @token2(Release, 2) +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_18:.*]] = aie.core(%[[VAL_7]]) { -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) +// CHECK: aiex.useToken @token3(Acquire, 1) +// CHECK: aiex.useToken @token3(Release, 2) +// CHECK: aie.end // CHECK: } // CHECK: } +// CHECK: } -// Generate LockOp in the top-level module -// Lower UseTokenOp to UseLockOp -// Tile -// | -// Tile-Tile-Tile -// | -// Tile -// single producer (tile(3, 3)), multiple consumers module @test_lock2 { aie.device(xcvc1902) { %t33 = aie.tile(3, 3) diff --git a/test/create-locks/test_lock3.mlir b/test/create-locks/test_lock3.mlir index af62e052fdb..1b5536cdff6 100644 --- a/test/create-locks/test_lock3.mlir +++ b/test/create-locks/test_lock3.mlir @@ -8,20 +8,21 @@ // RUN: aie-opt --aie-create-locks %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { +// CHECK-LABEL: module @test_lock3 { +// CHECK: aie.device(xcvc1902) { // CHECK: %[[VAL_0:.*]] = aie.tile(4, 4) -// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) +// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32} // CHECK: %[[VAL_2:.*]] = aie.tile(3, 3) -// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) +// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) {init = 0 : i32} // CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_2]]) : memref<256xi32> // CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_0]]) : memref<256xi32> // CHECK: aiex.token(0) {sym_name = "token0"} // CHECK: %[[VAL_6:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_7:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1) +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 0) +// CHECK: aiex.useToken @token0(Release, 2) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // CHECK: aie.end @@ -29,30 +30,27 @@ // CHECK: %[[VAL_8:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_9:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 0) +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) +// CHECK: aiex.useToken @token0(Release, 2) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_10:.*]] = aie.core(%[[VAL_2]]) { -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: aiex.useToken @token0(Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 1) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_11:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 0) +// CHECK: aiex.useToken @token0(Acquire, 2) +// CHECK: aiex.useToken @token0(Release, 3) // CHECK: aie.end // CHECK: } // CHECK: aie.flow(%[[VAL_2]], DMA : 0, %[[VAL_0]], DMA : 0) // CHECK: } +// CHECK: } -// Generate LockOp in the top-level module -// Lower UseTokenOp to UseLockOp -// [Core-Mem] ---> [Core-Mem] (non-neighboring tiles) -// single producer, single consumer module @test_lock3 { aie.device(xcvc1902) { %t44 = aie.tile(4, 4) diff --git a/test/create-locks/test_lock4.mlir b/test/create-locks/test_lock4.mlir index 00ae3912cfb..aab0ae7cd25 100644 --- a/test/create-locks/test_lock4.mlir +++ b/test/create-locks/test_lock4.mlir @@ -8,14 +8,15 @@ // RUN: aie-opt --aie-create-locks %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { +// CHECK-LABEL: module @test_lock4 { +// CHECK: aie.device(xcvc1902) { // CHECK: %[[VAL_0:.*]] = aie.tile(5, 5) -// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) +// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32} // CHECK: %[[VAL_2:.*]] = aie.tile(4, 4) -// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 1) -// CHECK: %[[VAL_4:.*]] = aie.lock(%[[VAL_2]], 0) +// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 1) {init = 0 : i32} +// CHECK: %[[VAL_4:.*]] = aie.lock(%[[VAL_2]], 0) {init = 0 : i32} // CHECK: %[[VAL_5:.*]] = aie.tile(3, 3) -// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_5]], 0) +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_5]], 0) {init = 0 : i32} // CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_5]]) : memref<256xi32> // CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_2]]) : memref<256xi32> // CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) : memref<256xi32> @@ -23,9 +24,9 @@ // CHECK: %[[VAL_10:.*]] = aie.mem(%[[VAL_5]]) { // CHECK: %[[VAL_11:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 0) +// CHECK: aiex.useToken @token0(Release, 2) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // CHECK: aie.end @@ -35,14 +36,14 @@ // CHECK: ^bb1: // CHECK: %[[VAL_14:.*]] = aie.dma_start(MM2S, 0, ^bb3, ^bb4) // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: aiex.useToken @token0(Release, 2) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb3: -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1) +// CHECK: aiex.useToken @token0(Acquire, 3) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 0) +// CHECK: aiex.useToken @token0(Release, 4) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // CHECK: aie.end @@ -50,37 +51,33 @@ // CHECK: %[[VAL_15:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_16:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 0) +// CHECK: aiex.useToken @token0(Acquire, 3) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) +// CHECK: aiex.useToken @token0(Release, 4) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_17:.*]] = aie.core(%[[VAL_5]]) { -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: aiex.useToken @token0(Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 1) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_18:.*]] = aie.core(%[[VAL_2]]) { -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: aiex.useToken @token0(Acquire, 2) +// CHECK: aiex.useToken @token0(Release, 3) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_19:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 0) +// CHECK: aiex.useToken @token0(Acquire, 4) +// CHECK: aiex.useToken @token0(Release, 5) // CHECK: aie.end // CHECK: } // CHECK: aie.flow(%[[VAL_5]], DMA : 0, %[[VAL_2]], DMA : 0) // CHECK: aie.flow(%[[VAL_2]], DMA : 0, %[[VAL_0]], DMA : 0) // CHECK: } +// CHECK: } -// Generate LockOp in the top-level module -// Lower UseTokenOp to UseLockOp -// [Core-Mem] ---> [Core-Mem] ---> [Core-Mem] (non-neighboring tiles) module @test_lock4 { aie.device(xcvc1902) { %t55 = aie.tile(5, 5) diff --git a/test/create-locks/test_lock5.mlir b/test/create-locks/test_lock5.mlir index bba7a7ec0a4..db5d19c0afe 100644 --- a/test/create-locks/test_lock5.mlir +++ b/test/create-locks/test_lock5.mlir @@ -8,63 +8,79 @@ // RUN: aie-opt --aie-create-locks %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { +// CHECK-LABEL: module @test_lock5 { +// CHECK: aie.device(xcvc1902) { // CHECK: %[[VAL_0:.*]] = aie.tile(5, 5) -// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) +// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32} // CHECK: %[[VAL_2:.*]] = aie.tile(4, 4) -// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) +// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_2]], 0) {init = 0 : i32} // CHECK: %[[VAL_4:.*]] = aie.tile(3, 3) -// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_4]], 1) -// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_4]], 0) +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_4]], 1) {init = 0 : i32} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_4]], 0) {init = 0 : i32} // CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_4]]) : memref<256xi32> // CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_2]]) : memref<256xi32> // CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) : memref<256xi32> +// CHECK: aiex.token(0) {sym_name = "token0"} +// CHECK: aiex.token(0) {sym_name = "token1"} // CHECK: %[[VAL_10:.*]] = aie.mem(%[[VAL_4]]) { -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 1) +// CHECK: %[[VAL_11:.*]] = aie.dma_start(MM2S, 0, ^bb2, ^bb1) +// CHECK: ^bb1: +// CHECK: %[[VAL_12:.*]] = aie.dma_start(MM2S, 1, ^bb3, ^bb4) +// CHECK: ^bb2: +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) +// CHECK: aiex.useToken @token0(Release, 2) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb3: +// CHECK: aiex.useToken @token1(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 0) +// CHECK: aiex.useToken @token1(Release, 2) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: +// CHECK: aie.end // CHECK: } // CHECK: %[[VAL_13:.*]] = aie.mem(%[[VAL_2]]) { -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) +// CHECK: %[[VAL_14:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) +// CHECK: ^bb1: +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: aiex.useToken @token0(Release, 2) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_15:.*]] = aie.mem(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 0) +// CHECK: %[[VAL_16:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) +// CHECK: ^bb1: +// CHECK: aiex.useToken @token1(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) +// CHECK: aiex.useToken @token1(Release, 2) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_17:.*]] = aie.core(%[[VAL_4]]) { -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: aiex.useToken @token1(Acquire, 0) +// CHECK: aiex.useToken @token0(Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 1) +// CHECK: aiex.useToken @token1(Release, 1) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_18:.*]] = aie.core(%[[VAL_2]]) { -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 0) +// CHECK: aiex.useToken @token0(Acquire, 2) +// CHECK: aiex.useToken @token0(Release, 3) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_19:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 0) +// CHECK: aiex.useToken @token1(Acquire, 2) +// CHECK: aiex.useToken @token1(Release, 3) // CHECK: aie.end // CHECK: } // CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_2]], DMA : 0) // CHECK: aie.flow(%[[VAL_4]], DMA : 1, %[[VAL_0]], DMA : 0) // CHECK: } +// CHECK: } -// Generate LockOp in the top-level module -// Lower UseTokenOp to UseLockOp -// [Core-Mem] ---> [Core-Mem] (non-neighboring tiles) -// |---------> [Core-Mem] -// single producer, multipler consumers module @test_lock5 { aie.device(xcvc1902) { %t55 = aie.tile(5, 5) diff --git a/test/create-locks/test_lock6.mlir b/test/create-locks/test_lock6.mlir index bef47da0b2f..0a25d6bfee9 100644 --- a/test/create-locks/test_lock6.mlir +++ b/test/create-locks/test_lock6.mlir @@ -8,14 +8,15 @@ // RUN: aie-opt --aie-create-locks %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { +// CHECK-LABEL: module @test_lock6 { +// CHECK: aie.device(xcvc1902) { // CHECK: %[[VAL_0:.*]] = aie.tile(5, 5) -// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 1) -// CHECK: %[[VAL_2:.*]] = aie.lock(%[[VAL_0]], 0) +// CHECK: %[[VAL_1:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32} +// CHECK: %[[VAL_2:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32} // CHECK: %[[VAL_3:.*]] = aie.tile(4, 4) -// CHECK: %[[VAL_4:.*]] = aie.lock(%[[VAL_3]], 0) +// CHECK: %[[VAL_4:.*]] = aie.lock(%[[VAL_3]], 0) {init = 0 : i32} // CHECK: %[[VAL_5:.*]] = aie.tile(3, 3) -// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_5]], 0) +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_5]], 0) {init = 0 : i32} // CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_5]]) : memref<256xi32> // CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_3]]) : memref<256xi32> // CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) : memref<256xi32> @@ -23,53 +24,64 @@ // CHECK: aiex.token(0) {sym_name = "token0"} // CHECK: aiex.token(0) {sym_name = "token1"} // CHECK: %[[VAL_11:.*]] = aie.mem(%[[VAL_5]]) { -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) +// CHECK: %[[VAL_12:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) +// CHECK: ^bb1: +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 0) +// CHECK: aiex.useToken @token0(Release, 2) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_13:.*]] = aie.mem(%[[VAL_3]]) { -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 1) +// CHECK: %[[VAL_14:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) +// CHECK: ^bb1: +// CHECK: aiex.useToken @token1(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 0) +// CHECK: aiex.useToken @token1(Release, 2) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_15:.*]] = aie.mem(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 0) +// CHECK: %[[VAL_16:.*]] = aie.dma_start(S2MM, 0, ^bb2, ^bb1) +// CHECK: ^bb1: +// CHECK: %[[VAL_17:.*]] = aie.dma_start(S2MM, 1, ^bb3, ^bb4) +// CHECK: ^bb2: +// CHECK: aiex.useToken @token0(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 2) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb3: +// CHECK: aiex.useToken @token1(Acquire, 1) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) +// CHECK: aiex.useToken @token1(Release, 2) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_18:.*]] = aie.core(%[[VAL_5]]) { -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: aiex.useToken @token0(Acquire, 0) +// CHECK: aiex.useToken @token0(Release, 1) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_19:.*]] = aie.core(%[[VAL_3]]) { -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: aiex.useToken @token1(Acquire, 0) +// CHECK: aiex.useToken @token1(Release, 1) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_20:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 0) +// CHECK: aiex.useToken @token1(Acquire, 2) +// CHECK: aiex.useToken @token0(Acquire, 2) +// CHECK: aiex.useToken @token0(Release, 3) +// CHECK: aiex.useToken @token1(Release, 3) // CHECK: aie.end // CHECK: } // CHECK: aie.flow(%[[VAL_5]], DMA : 0, %[[VAL_0]], DMA : 0) // CHECK: aie.flow(%[[VAL_3]], DMA : 0, %[[VAL_0]], DMA : 1) // CHECK: } +// CHECK: } -// Generate LockOp in the top-level module -// Lower UseTokenOp to UseLockOp -// [Core-Mem] ---\ -// [Core-Mem] (non-neighboring tiles) -// [Core-Mem] ---/ -// multiple producers, single consumer module @test_lock6 { aie.device(xcvc1902) { %t55 = aie.tile(5, 5) diff --git a/test/dialect/AIE/bad_dma_op.mlir b/test/dialect/AIE/bad_dma_op.mlir index ef3c75b2875..1acb9d77ba2 100644 --- a/test/dialect/AIE/bad_dma_op.mlir +++ b/test/dialect/AIE/bad_dma_op.mlir @@ -18,9 +18,11 @@ module { %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) { ^bb0: aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul1) }] aie.next_bd ^bb1 ^bb1: diff --git a/test/dialect/AIE/badlock.mlir b/test/dialect/AIE/badlock.mlir index c38f1c27767..ceafa9310a1 100644 --- a/test/dialect/AIE/badlock.mlir +++ b/test/dialect/AIE/badlock.mlir @@ -14,7 +14,8 @@ aie.device(xcvc1902) { %lock = aie.lock(%t2, 3) { sym_name = "lock1" } // expected-error@-1 {{'aie.lock' op in Column 4 and Row 4 is accessed from an unreachable tile in Column 1 and Row 1}} aie.core(%t1) { - aie.use_lock(%lock, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock, "Acquire", %c1_ul0) // expected-note@-1 {{user}} aie.end } @@ -25,7 +26,8 @@ aie.device(xcvc1902) { aie.device(xcvc1902) { %t = aie.tile(2, 2) %l = aie.lock(%t, 3) - aie.use_lock(%l, "Acquire", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l, "Acquire", %c1_ul1) // expected-error@-1 {{'aie.use_lock' op must be used in a core or memory operation.}} } @@ -36,7 +38,8 @@ aie.device(xcvc1902) { %lock = aie.lock(%t1, -3) { sym_name = "lock1" } // expected-error@-1 {{'aie.lock' op attribute 'lockID' failed to satisfy constraint: 32-bit signless integer attribute whose minimum value is 0}} aie.core(%t1) { - aie.use_lock(%lock, "Acquire", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock, "Acquire", %c1_ul2) aie.end } } @@ -47,8 +50,9 @@ aie.device(xcvc1902) { %t = aie.tile(3, 3) %l = aie.lock(%t, 0) aie.core(%t) { + %c1_ul3 = arith.constant 1 : i32 // expected-error@+1 {{'aie.use_lock' op AcquireGreaterEqual is not supported in AIE1.}} - aie.use_lock(%l, AcquireGreaterEqual, 1) + aie.use_lock(%l, AcquireGreaterEqual, %c1_ul3) aie.end } } \ No newline at end of file diff --git a/test/dialect/AIE/badlockdma.mlir b/test/dialect/AIE/badlockdma.mlir index a9b44ecfa66..ee9fef67f21 100644 --- a/test/dialect/AIE/badlockdma.mlir +++ b/test/dialect/AIE/badlockdma.mlir @@ -16,8 +16,10 @@ module @test { %mem13 = aie.mem(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock, "Acquire", 1) - aie.use_lock(%lock, "Release", 0) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock, "Acquire", %c1_ul0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock, "Release", %c0_ul1) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end diff --git a/test/dialect/AIE/badlockfunc.mlir b/test/dialect/AIE/badlockfunc.mlir index 3f549e4c250..5da6af6dabb 100644 --- a/test/dialect/AIE/badlockfunc.mlir +++ b/test/dialect/AIE/badlockfunc.mlir @@ -14,7 +14,8 @@ module @test { %lock = aie.lock(%t2, 3) { sym_name = "lock1" } func.func @task3() -> () { - aie.use_lock(%lock, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock, "Acquire", %c1_ul0) return } } diff --git a/test/dialect/AIE/badmem.mlir b/test/dialect/AIE/badmem.mlir index 9670bad9530..206698c0523 100644 --- a/test/dialect/AIE/badmem.mlir +++ b/test/dialect/AIE/badmem.mlir @@ -32,11 +32,14 @@ module @test { %mem13 = aie.mem(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul0 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%lock, Acquire, 1) - aie.use_lock(%lock, Acquire, 1) + aie.use_lock(%lock, Acquire, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock, Acquire, %c1_ul1) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%lock, Release, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock, Release, %c0_ul2) aie.next_bd ^bd0 ^end: aie.end @@ -56,11 +59,14 @@ module @test { %mem13 = aie.mem(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul3 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) - aie.use_lock(%prod_lock_test, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%prod_lock_test, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul5) aie.next_bd ^bd0 ^end: aie.end @@ -81,11 +87,14 @@ module @test { %mem13 = aie.mem(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul6 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) - aie.use_lock(%cons_lock_test, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul7) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%cons_lock_test, Release, %c1_ul8) aie.next_bd ^bd0 ^end: aie.end @@ -106,11 +115,13 @@ module @test { %mem13 = aie.mem(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul9 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul9) aie.dma_bd(%buff : memref<16xi32>, 0, 16) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul10) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/dialect/AIE/badmemtiledma.mlir b/test/dialect/AIE/badmemtiledma.mlir index fb2b49d9779..7b18c04f2be 100644 --- a/test/dialect/AIE/badmemtiledma.mlir +++ b/test/dialect/AIE/badmemtiledma.mlir @@ -30,11 +30,14 @@ module @test { %mem13 = aie.memtile_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul0 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%lock, Acquire, 1) - aie.use_lock(%lock, Acquire, 1) + aie.use_lock(%lock, Acquire, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock, Acquire, %c1_ul1) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%lock, Release, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock, Release, %c0_ul2) aie.next_bd ^bd0 ^end: aie.end @@ -55,11 +58,14 @@ module @test { %mem13 = aie.memtile_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul3 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) - aie.use_lock(%prod_lock_test, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%prod_lock_test, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul5) aie.next_bd ^bd0 ^end: aie.end @@ -80,11 +86,14 @@ module @test { %mem13 = aie.memtile_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul6 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) - aie.use_lock(%cons_lock_test, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul7) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%cons_lock_test, Release, %c1_ul8) aie.next_bd ^bd0 ^end: aie.end @@ -105,11 +114,13 @@ module @test { %mem13 = aie.memtile_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul9 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul9) aie.dma_bd(%buff : memref<16xi32>, 0, 16) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul10) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/dialect/AIE/badmemtiledma2.mlir b/test/dialect/AIE/badmemtiledma2.mlir index 16d1e5e3a61..69ab6ef4acc 100644 --- a/test/dialect/AIE/badmemtiledma2.mlir +++ b/test/dialect/AIE/badmemtiledma2.mlir @@ -45,31 +45,38 @@ module @test { %dma6 = aie.dma_start("MM2S", 6, ^bd6, ^end) ^bd0: aie.dma_bd(%buf_0 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_0, Release, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Release, %c1_ul0) aie.next_bd ^bd0 ^bd1: aie.dma_bd(%buf_1 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_1, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_1, Release, %c1_ul1) aie.next_bd ^bd1 ^bd2: aie.dma_bd(%buf_2 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_2, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_2, Release, %c1_ul2) aie.next_bd ^bd2 ^bd3: aie.dma_bd(%buf_3 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_3, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_3, Release, %c1_ul3) aie.next_bd ^bd3 ^bd4: aie.dma_bd(%buf_4 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_4, Release, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_4, Release, %c1_ul4) aie.next_bd ^bd4 ^bd5: aie.dma_bd(%buf_5 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_5, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_5, Release, %c1_ul5) aie.next_bd ^bd5 ^bd6: aie.dma_bd(%buf_6 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_6, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_6, Release, %c1_ul6) aie.next_bd ^bd6 ^end: aie.end diff --git a/test/dialect/AIE/badmemtiledma_channel4lock.mlir b/test/dialect/AIE/badmemtiledma_channel4lock.mlir index 0ce571b5dba..d710c0b6468 100644 --- a/test/dialect/AIE/badmemtiledma_channel4lock.mlir +++ b/test/dialect/AIE/badmemtiledma_channel4lock.mlir @@ -23,11 +23,13 @@ aie.device(xcve2802) { ^dma1: aie.dma_start("MM2S", 1, ^bd1, ^dma1) ^bd0: - aie.use_lock(%lock2, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock2, "Acquire", %c1_ul0) aie.dma_bd(%buf1 : memref<256xi32>, 0, 256) aie.next_bd ^bd2 ^bd1: - aie.use_lock(%lock1, "Acquire", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock1, "Acquire", %c1_ul1) aie.dma_bd(%buf1 : memref<256xi32>, 0, 256) aie.next_bd ^bd2 ^bd2: diff --git a/test/dialect/AIE/badshimtiledma.mlir b/test/dialect/AIE/badshimtiledma.mlir index 6b451dd18ee..53514610007 100644 --- a/test/dialect/AIE/badshimtiledma.mlir +++ b/test/dialect/AIE/badshimtiledma.mlir @@ -29,15 +29,18 @@ module @test { %dma3 = aie.dma_start("S2MM", 2, ^bd2, ^end) ^bd0: aie.dma_bd(%buf_e : memref<256xi32>, 1, 256) - aie.use_lock(%lock_e, Release, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_e, Release, %c1_ul0) aie.next_bd ^bd0 ^bd1: aie.dma_bd(%buf_l : memref<256xi32>, 1, 256) - aie.use_lock(%lock_l, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_l, Release, %c1_ul1) aie.next_bd ^bd1 ^bd2: aie.dma_bd(%buf_n : memref<256xi32>, 1, 256) - aie.use_lock(%lock_n, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_n, Release, %c1_ul2) aie.next_bd ^bd2 ^end: aie.end @@ -57,11 +60,14 @@ module @test { %mem13 = aie.shim_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul3 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%lock, Acquire, 1) - aie.use_lock(%lock, Acquire, 1) + aie.use_lock(%lock, Acquire, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock, Acquire, %c1_ul4) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%lock, Release, 0) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock, Release, %c0_ul5) aie.next_bd ^bd0 ^end: aie.end @@ -82,11 +88,14 @@ module @test { %mem13 = aie.shim_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul6 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) - aie.use_lock(%prod_lock_test, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%prod_lock_test, AcquireGreaterEqual, %c1_ul7) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul8) aie.next_bd ^bd0 ^end: aie.end @@ -107,11 +116,14 @@ module @test { %mem13 = aie.shim_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul9 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul9) aie.dma_bd(%buff : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) - aie.use_lock(%cons_lock_test, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%cons_lock_test, Release, %c1_ul11) aie.next_bd ^bd0 ^end: aie.end @@ -132,11 +144,13 @@ module @test { %mem13 = aie.shim_dma(%t1) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: + %c1_ul12 = arith.constant 1 : i32 // expected-note@+1 {{in this BD block}} - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buff : memref<16xi32>, 0, 16) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%cons_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul13) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/dialect/AIE/badtiledma.mlir b/test/dialect/AIE/badtiledma.mlir index 84fdc50b08a..95877204876 100644 --- a/test/dialect/AIE/badtiledma.mlir +++ b/test/dialect/AIE/badtiledma.mlir @@ -30,21 +30,26 @@ module @test { ^dma1: %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_l, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_l, Acquire, %c0_ul0) aie.dma_bd(%buf_e : memref<256xi32>, 0, 256) - aie.use_lock(%lock_e, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_e, Release, %c1_ul1) aie.next_bd ^bd1 ^bd1: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_l, Release, %c1_ul2) aie.next_bd ^end ^bd2: aie.dma_bd(%buf_n : memref<256xi32>, 0, 256) - aie.use_lock(%lock_n, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_n, Release, %c1_ul3) aie.next_bd ^bd3 ^bd3: aie.dma_bd(%buf_s : memref<256xi32>, 0, 256) - aie.use_lock(%lock_s, Release, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_s, Release, %c1_ul4) aie.next_bd ^end ^end: aie.end diff --git a/test/dialect/AIE/badtiledma2.mlir b/test/dialect/AIE/badtiledma2.mlir index cab519ef245..d89d17992c0 100644 --- a/test/dialect/AIE/badtiledma2.mlir +++ b/test/dialect/AIE/badtiledma2.mlir @@ -31,19 +31,23 @@ module @test { %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: aie.dma_bd(%buf_e : memref<256xi32>, 0, 256) - aie.use_lock(%lock_e, Release, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_e, Release, %c1_ul0) aie.next_bd ^bd1 ^bd1: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_l, Release, %c1_ul1) aie.next_bd ^end ^bd2: aie.dma_bd(%buf_n : memref<256xi32>, 0, 256) - aie.use_lock(%lock_n, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_n, Release, %c1_ul2) aie.next_bd ^bd3 ^bd3: aie.dma_bd(%buf_s : memref<256xi32>, 0, 256) - aie.use_lock(%lock_s, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_s, Release, %c1_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/dialect/AIE/badtiledma3.mlir b/test/dialect/AIE/badtiledma3.mlir index 58acf2a45e4..f9ae1a9df60 100644 --- a/test/dialect/AIE/badtiledma3.mlir +++ b/test/dialect/AIE/badtiledma3.mlir @@ -31,19 +31,23 @@ module @test { %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_e, Release, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_e, Release, %c1_ul0) aie.next_bd ^bd1 ^bd1: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_l, Release, %c1_ul1) aie.next_bd ^end ^bd2: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_n, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_n, Release, %c1_ul2) aie.next_bd ^bd3 ^bd3: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_s, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_s, Release, %c1_ul3) aie.next_bd ^end ^end: aie.end diff --git a/test/dialect/AIE/badtiledma4.mlir b/test/dialect/AIE/badtiledma4.mlir index 2a79535d349..277d0b0625d 100644 --- a/test/dialect/AIE/badtiledma4.mlir +++ b/test/dialect/AIE/badtiledma4.mlir @@ -29,15 +29,18 @@ module @test { %dma3 = aie.dma_start("MM2S", 2, ^bd2, ^end) ^bd0: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_e, Release, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_e, Release, %c1_ul0) aie.next_bd ^bd0 ^bd1: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_l, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_l, Release, %c1_ul1) aie.next_bd ^bd1 ^bd2: aie.dma_bd(%buf_l : memref<256xi32>, 0, 256) - aie.use_lock(%lock_n, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_n, Release, %c1_ul2) aie.next_bd ^bd2 ^end: aie.end diff --git a/test/dialect/AIE/baduselock_dynamic_value.mlir b/test/dialect/AIE/baduselock_dynamic_value.mlir new file mode 100644 index 00000000000..b1307d96570 --- /dev/null +++ b/test/dialect/AIE/baduselock_dynamic_value.mlir @@ -0,0 +1,31 @@ +//===- baduselock_dynamic_value.mlir ---------------------------*- MLIR -*-===// +// +// Copyright (C) 2026 Advanced Micro Devices, Inc. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Verifier tests for lock values used inside DMA/BD blocks. Locks there are +// configured via MMIO, so the value must be a compile-time constant defined by +// an arith.constant. + +// RUN: aie-opt -split-input-file -verify-diagnostics %s + +// A non-constant lock value inside a DMA/BD block is rejected. +module { + aie.device(npu1) { + %tile = aie.tile(1, 2) + %lock = aie.lock(%tile, 0) + %mem = aie.mem(%tile) { + %dma = aie.dma_start(MM2S, 0, ^bd, ^end) + ^bd: + %v = arith.constant 1 : i32 + %w = arith.addi %v, %v : i32 + // expected-error@+1 {{lock value in a DMA/BD block must be a compile-time constant (defined by an arith.constant)}} + aie.use_lock(%lock, Acquire, %w) + aie.next_bd ^end + ^end: + aie.end + } + } +} diff --git a/test/dialect/AIE/canonicalize-mem.mlir b/test/dialect/AIE/canonicalize-mem.mlir index bb3fd88f306..78987326fb0 100644 --- a/test/dialect/AIE/canonicalize-mem.mlir +++ b/test/dialect/AIE/canonicalize-mem.mlir @@ -9,50 +9,56 @@ // RUN: aie-opt --canonicalize %s | FileCheck %s // Verify that canonicalize does not remove chained aie.next_bd -// CHECK-LABEL: module @test { -// CHECK-NEXT: %[[VAL_0:.*]] = aie.tile(1, 1) -// CHECK-NEXT: %[[VAL_1:.*]] = aie.mem(%[[VAL_0]]) { -// CHECK-NEXT: %[[VAL_2:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) -// CHECK-NEXT: ^bb1: // pred: ^bb0 -// CHECK-NEXT: aie.next_bd ^bb2 -// CHECK-NEXT: ^bb2: // pred: ^bb1 -// CHECK-NEXT: aie.next_bd ^bb3 -// CHECK-NEXT: ^bb3: // 2 preds: ^bb0, ^bb2 -// CHECK-NEXT: aie.end -// CHECK-NEXT: } - -// CHECK: %[[TILE_1_2:.*]] = aie.tile(1, 2) -// CHECK-DAG: %[[BUF_0:.*]] = aie.buffer(%[[TILE_1_2]]) {sym_name = "buf_0"} : memref<256xi32> -// CHECK-DAG: %[[BUF_1:.*]] = aie.buffer(%[[TILE_1_2]]) {sym_name = "buf_1"} : memref<256xi32> -// CHECK-DAG: %[[BUF_2:.*]] = aie.buffer(%[[TILE_1_2]]) {sym_name = "buf_2"} : memref<256xi32> -// CHECK-DAG: %[[BUF_3:.*]] = aie.buffer(%[[TILE_1_2]]) {sym_name = "buf_3"} : memref<256xi32> -// CHECK-DAG: %[[LOCK_0:.*]] = aie.lock(%{{.*}}, 0) -// CHECK: aie.mem(%[[TILE_1_2]]) { -// CHECK-NEXT: %[[VAL_0:.*]] = aie.dma_start(MM2S, 0, ^bb2, ^bb1) -// CHECK-NEXT: ^bb1: // pred: ^bb0 -// CHECK-NEXT: %[[VAL_1:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb4) -// CHECK-NEXT: ^bb2: // 2 preds: ^bb0, ^bb3 -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Acquire, 1) -// CHECK-NEXT: aie.dma_bd(%[[BUF_0]] : memref<256xi32>, 0, 256) -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 0) -// CHECK-NEXT: aie.next_bd ^bb3 -// CHECK-NEXT: ^bb3: // pred: ^bb2 -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Acquire, 1) -// CHECK-NEXT: aie.dma_bd(%[[BUF_1]] : memref<256xi32>, 0, 256) -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 0) -// CHECK-NEXT: aie.next_bd ^bb2 -// CHECK-NEXT: ^bb4: // pred: ^bb1 -// CHECK-NEXT: aie.end -// CHECK-NEXT: ^bb5: // 2 preds: ^bb1, ^bb6 -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Acquire, 1) -// CHECK-NEXT: aie.dma_bd(%[[BUF_2]] : memref<256xi32>, 0, 128) -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 0) -// CHECK-NEXT: aie.next_bd ^bb6 -// CHECK-NEXT: ^bb6: // pred: ^bb5 -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Acquire, 1) -// CHECK-NEXT: aie.dma_bd(%[[BUF_2]] : memref<256xi32>, 128, 128) -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 0) -// CHECK-NEXT: aie.next_bd ^bb5 +// CHECK-LABEL: module @test { +// CHECK: %[[VAL_0:.*]] = aie.tile(1, 1) +// CHECK: %[[VAL_1:.*]] = aie.mem(%[[VAL_0]]) { +// CHECK: %[[VAL_2:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) +// CHECK: ^bb1: +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_3:.*]] = aie.tile(1, 2) +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "buf_0"} : memref<256xi32> +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "buf_1"} : memref<256xi32> +// CHECK: %[[VAL_6:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "buf_2"} : memref<256xi32> +// CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "buf_3"} : memref<256xi32> +// CHECK: %[[VAL_8:.*]] = aie.lock(%[[VAL_3]], 0) +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_3]], 1) +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_3]], 0) +// CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_3]], 0) +// CHECK: %[[VAL_12:.*]] = aie.mem(%[[VAL_3]]) { +// CHECK: %[[VAL_13:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_14:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_15:.*]] = aie.dma_start(MM2S, 0, ^bb2, ^bb1) +// CHECK: ^bb1: +// CHECK: %[[VAL_16:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb4) +// CHECK: ^bb2: +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %[[VAL_14]]) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<256xi32>, 0, 256) +// CHECK: aie.use_lock(%[[VAL_8]], Release, %[[VAL_13]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %[[VAL_14]]) +// CHECK: aie.dma_bd(%[[VAL_5]] : memref<256xi32>, 0, 256) +// CHECK: aie.use_lock(%[[VAL_8]], Release, %[[VAL_13]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb4: +// CHECK: aie.end +// CHECK: ^bb5: +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %[[VAL_14]]) +// CHECK: aie.dma_bd(%[[VAL_6]] : memref<256xi32>, 0, 128) +// CHECK: aie.use_lock(%[[VAL_8]], Release, %[[VAL_13]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb6: +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %[[VAL_14]]) +// CHECK: aie.dma_bd(%[[VAL_6]] : memref<256xi32>, 128, 128) +// CHECK: aie.use_lock(%[[VAL_8]], Release, %[[VAL_13]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: } +// CHECK: } module @test { %t1 = aie.tile(1, 1) @@ -85,46 +91,62 @@ module @test { ^dma0: %start2 = aie.dma_start("MM2S", 1, ^bd4, ^end) ^bd0: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul0) aie.dma_bd(%buf_0 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul2) aie.dma_bd(%buf_1 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_0, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul3) aie.next_bd ^bd2 ^bd2: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul4) aie.dma_bd(%buf_0 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_0, Release, 0) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul5) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul6) aie.dma_bd(%buf_1 : memref<256xi32>, 0, 256) - aie.use_lock(%lock_0, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul7) aie.next_bd ^bd0 ^end: aie.end ^bd4: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul8) aie.dma_bd(%buf_2 : memref<256xi32>, 0, 128) - aie.use_lock(%lock_0, Release, 0) + %c0_ul9 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul9) aie.next_bd ^bd5 ^bd5: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul10) aie.dma_bd(%buf_2 : memref<256xi32>, 128, 128) - aie.use_lock(%lock_0, Release, 0) + %c0_ul11 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul11) aie.next_bd ^bd6 ^bd6: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul12) aie.dma_bd(%buf_2 : memref<256xi32>, 0, 128) - aie.use_lock(%lock_0, Release, 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul13) aie.next_bd ^bd7 ^bd7: - aie.use_lock(%lock_0, Acquire, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_0, Acquire, %c1_ul14) aie.dma_bd(%buf_2 : memref<256xi32>, 128, 128) - aie.use_lock(%lock_0, Release, 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock_0, Release, %c0_ul15) aie.next_bd ^bd4 } } diff --git a/test/dialect/AIE/example0.mlir b/test/dialect/AIE/example0.mlir index 618989ddb3f..b3e6fdfed4c 100644 --- a/test/dialect/AIE/example0.mlir +++ b/test/dialect/AIE/example0.mlir @@ -46,14 +46,18 @@ module @example0 { ^dma0: %dmaSt1 = aie.dma_start("MM2S", 1, ^bd1, ^end) ^bd0: - aie.use_lock(%l33_0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Acquire, %c1_ul0) aie.dma_bd(%buf33 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Release, %c0_ul1) aie.next_bd ^end ^bd1: - aie.use_lock(%l33_1, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l33_1, Acquire, %c0_ul2) aie.dma_bd(%buf33 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_1, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul3) aie.next_bd ^end ^end: aie.end @@ -62,9 +66,11 @@ module @example0 { %m42 = aie.mem(%t42) { %dmaSt = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l42_0, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l42_0, Acquire, %c0_ul4) aie.dma_bd(%buf42 : memref<256xi32>, 0, 256) - aie.use_lock(%l42_0, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l42_0, Release, %c1_ul5) aie.next_bd ^end ^end: aie.end @@ -73,9 +79,11 @@ module @example0 { %m44 = aie.mem(%t44) { %dmaSt = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l44_0, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%l44_0, Acquire, %c1_ul6) aie.dma_bd(%buf44 : memref<256xi32>, 0, 256) - aie.use_lock(%l44_0, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%l44_0, Release, %c0_ul7) aie.next_bd ^end ^end: aie.end @@ -95,8 +103,10 @@ module @example0 { } %c33 = aie.core(%t33) { - aie.use_lock(%l33_1, Acquire, 0) - aie.use_lock(%l33_0, Acquire, 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%l33_1, Acquire, %c0_ul8) + %c0_ul9 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Acquire, %c0_ul9) // code %val0 = arith.constant 16 : i32 @@ -106,27 +116,33 @@ module @example0 { %val2 = arith.constant 1 : i384 aie.put_cascade(%val2: i384) - aie.use_lock(%l33_0, Release, 1) - aie.use_lock(%l33_1, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul11) aie.end } %c42 = aie.core(%t42) { - aie.use_lock(%l42_0, Acquire, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%l42_0, Acquire, %c1_ul12) // code - aie.use_lock(%l42_0, Release, 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%l42_0, Release, %c0_ul13) aie.end } %c44 = aie.core(%t44) { - aie.use_lock(%l44_0, Acquire, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%l44_0, Acquire, %c1_ul14) // code - aie.use_lock(%l44_0, Release, 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%l44_0, Release, %c0_ul15) aie.end } } diff --git a/test/dialect/AIE/memtiledma_channel4lock.mlir b/test/dialect/AIE/memtiledma_channel4lock.mlir index be3d49a02e5..5cd921f2ba1 100644 --- a/test/dialect/AIE/memtiledma_channel4lock.mlir +++ b/test/dialect/AIE/memtiledma_channel4lock.mlir @@ -23,11 +23,13 @@ aie.device(xcve2802) { ^dma1: aie.dma_start("MM2S", 1, ^bd1, ^dma1) ^bd0: - aie.use_lock(%lock1, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock1, "Acquire", %c1_ul0) aie.dma_bd(%buf1 : memref<256xi32>, 0, 256) aie.next_bd ^bd2 ^bd1: - aie.use_lock(%lock2, "Acquire", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock2, "Acquire", %c1_ul1) aie.dma_bd(%buf1 : memref<256xi32>, 0, 256) aie.next_bd ^bd2 ^bd2: diff --git a/test/localize-locks/locks-ve2802.mlir b/test/localize-locks/locks-ve2802.mlir index bffb485465a..93849164d28 100644 --- a/test/localize-locks/locks-ve2802.mlir +++ b/test/localize-locks/locks-ve2802.mlir @@ -18,35 +18,47 @@ // CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_4]], 8) // CHECK: %[[VAL_8:.*]] = aie.core(%[[VAL_0]]) { // CHECK: %[[VAL_9:.*]] = arith.constant 48 : index -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_10:.*]] = aie.core(%[[VAL_1]]) { // CHECK: %[[VAL_11:.*]] = arith.constant 8 : index -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_12:.*]] = aie.core(%[[VAL_2]]) { // CHECK: %[[VAL_13:.*]] = arith.constant 40 : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_14:.*]] = aie.core(%[[VAL_3]]) { // CHECK: %[[VAL_15:.*]] = arith.constant 56 : index -// CHECK: aie.use_lock(%[[VAL_15]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_16:.*]] = aie.core(%[[VAL_4]]) { // CHECK: %[[VAL_17:.*]] = arith.constant 56 : index // CHECK: %[[VAL_18:.*]] = arith.constant 24 : index -// CHECK: aie.use_lock(%[[VAL_18]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_18]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_17]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } @@ -64,30 +76,42 @@ module @test_xaie0 { %l43_8 = aie.lock(%t44, 8) aie.core(%t13) { - aie.use_lock(%l11_8, Acquire, 0) - aie.use_lock(%l11_8, Release, 1) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l11_8, Acquire, %c0_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l11_8, Release, %c1_ul1) aie.end } aie.core(%t35) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul3) aie.end } aie.core(%t33) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul5) aie.end } aie.core(%t34) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul7) aie.end } aie.core(%t44) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) - aie.use_lock(%l43_8, Acquire, 0) - aie.use_lock(%l43_8, Release, 1) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul8) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul9) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%l43_8, Acquire, %c0_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%l43_8, Release, %c1_ul11) aie.end } } diff --git a/test/localize-locks/locks1.mlir b/test/localize-locks/locks1.mlir index 58ec650db22..9f36d21ea03 100644 --- a/test/localize-locks/locks1.mlir +++ b/test/localize-locks/locks1.mlir @@ -18,35 +18,47 @@ // CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_4]], 8) // CHECK: %[[VAL_8:.*]] = aie.core(%[[VAL_0]]) { // CHECK: %[[VAL_9:.*]] = arith.constant 48 : index -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_10:.*]] = aie.core(%[[VAL_1]]) { // CHECK: %[[VAL_11:.*]] = arith.constant 8 : index -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_12:.*]] = aie.core(%[[VAL_2]]) { // CHECK: %[[VAL_13:.*]] = arith.constant 40 : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_14:.*]] = aie.core(%[[VAL_3]]) { // CHECK: %[[VAL_15:.*]] = arith.constant 56 : index -// CHECK: aie.use_lock(%[[VAL_15]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_16:.*]] = aie.core(%[[VAL_4]]) { // CHECK: %[[VAL_17:.*]] = arith.constant 56 : index // CHECK: %[[VAL_18:.*]] = arith.constant 24 : index -// CHECK: aie.use_lock(%[[VAL_18]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_18]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_17]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } @@ -64,30 +76,42 @@ module @test_xaie0 { %l43_8 = aie.lock(%t43, 8) aie.core(%t11) { - aie.use_lock(%l11_8, Acquire, 0) - aie.use_lock(%l11_8, Release, 1) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l11_8, Acquire, %c0_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l11_8, Release, %c1_ul1) aie.end } aie.core(%t34) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul3) aie.end } aie.core(%t32) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul5) aie.end } aie.core(%t33) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul7) aie.end } aie.core(%t43) { - aie.use_lock(%l33_8, Acquire, 0) - aie.use_lock(%l33_8, Release, 1) - aie.use_lock(%l43_8, Acquire, 0) - aie.use_lock(%l43_8, Release, 1) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%l33_8, Acquire, %c0_ul8) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%l33_8, Release, %c1_ul9) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%l43_8, Acquire, %c0_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%l43_8, Release, %c1_ul11) aie.end } } diff --git a/test/lower-to-standard/loc_preservation.mlir b/test/lower-to-standard/loc_preservation.mlir index 607ee3f2303..25806272060 100644 --- a/test/lower-to-standard/loc_preservation.mlir +++ b/test/lower-to-standard/loc_preservation.mlir @@ -20,7 +20,8 @@ module @loc_test { %buf13 = aie.buffer(%tile13) {sym_name = "my_buf"} : memref<16xi32> loc(#buf_loc) func.func private @kernel(%lock : index) { - aie.use_lock(%lock, "Acquire", 0) loc(#user_loc) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock, "Acquire", %c0_ul0) loc(#user_loc) return } diff --git a/test/lower-to-standard/local_locks.mlir b/test/lower-to-standard/local_locks.mlir index 25cb2b2fc98..0d7200f0074 100644 --- a/test/lower-to-standard/local_locks.mlir +++ b/test/lower-to-standard/local_locks.mlir @@ -10,11 +10,11 @@ // CHECK33: func.func @core_3_3() { // CHECK33: %c56 = arith.constant 56 : index -// CHECK33: %0 = arith.index_cast %c56 : index to i32 // CHECK33: %c0_i32 = arith.constant 0 : i32 +// CHECK33: %0 = arith.index_cast %c56 : index to i32 // CHECK33: call @llvm.aie.lock.acquire.reg(%0, %c0_i32) : (i32, i32) -> () -// CHECK33: %1 = arith.index_cast %c56 : index to i32 // CHECK33: %c1_i32 = arith.constant 1 : i32 +// CHECK33: %1 = arith.index_cast %c56 : index to i32 // CHECK33: call @llvm.aie.lock.release.reg(%1, %c1_i32) : (i32, i32) -> () // CHECK33: return // CHECK33: } @@ -24,8 +24,10 @@ module @local_locks { %3 = aie.tile(3, 3) %11 = aie.core(%3) { %c56 = arith.constant 56 : index - aie.use_lock(%c56, Acquire, 0) - aie.use_lock(%c56, Release, 1) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%c56, Acquire, %c0_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%c56, Release, %c1_ul1) aie.end } } diff --git a/test/lower-to-standard/local_locks_aie2.mlir b/test/lower-to-standard/local_locks_aie2.mlir index 2ef9040caac..3cab661cc81 100644 --- a/test/lower-to-standard/local_locks_aie2.mlir +++ b/test/lower-to-standard/local_locks_aie2.mlir @@ -9,11 +9,11 @@ // CHECK33: func.func @core_3_3() { // CHECK33: %c56 = arith.constant 56 : index -// CHECK33: %0 = arith.index_cast %c56 : index to i32 // CHECK33: %c0_i32 = arith.constant 0 : i32 +// CHECK33: %0 = arith.index_cast %c56 : index to i32 // CHECK33: call @llvm.aie2.acquire(%0, %c0_i32) : (i32, i32) -> () -// CHECK33: %1 = arith.index_cast %c56 : index to i32 // CHECK33: %c1_i32 = arith.constant 1 : i32 +// CHECK33: %1 = arith.index_cast %c56 : index to i32 // CHECK33: call @llvm.aie2.release(%1, %c1_i32) : (i32, i32) -> () // CHECK33: return // CHECK33: } @@ -23,8 +23,10 @@ module @local_locks { %3 = aie.tile(3, 3) %11 = aie.core(%3) { %c56 = arith.constant 56 : index - aie.use_lock(%c56, Acquire, 0) - aie.use_lock(%c56, Release, 1) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%c56, Acquire, %c0_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%c56, Release, %c1_ul1) aie.end } } diff --git a/test/lower-to-standard/local_locks_aie2p.mlir b/test/lower-to-standard/local_locks_aie2p.mlir index 38d1528ddae..e4eefe7ba7d 100644 --- a/test/lower-to-standard/local_locks_aie2p.mlir +++ b/test/lower-to-standard/local_locks_aie2p.mlir @@ -9,11 +9,11 @@ // CHECK33: func.func @core_3_3() { // CHECK33: %c56 = arith.constant 56 : index -// CHECK33: %0 = arith.index_cast %c56 : index to i32 // CHECK33: %c0_i32 = arith.constant 0 : i32 +// CHECK33: %0 = arith.index_cast %c56 : index to i32 // CHECK33: call @llvm.aie2p.acquire(%0, %c0_i32) : (i32, i32) -> () -// CHECK33: %1 = arith.index_cast %c56 : index to i32 // CHECK33: %c1_i32 = arith.constant 1 : i32 +// CHECK33: %1 = arith.index_cast %c56 : index to i32 // CHECK33: call @llvm.aie2p.release(%1, %c1_i32) : (i32, i32) -> () // CHECK33: return // CHECK33: } @@ -23,8 +23,10 @@ module @local_locks { %3 = aie.tile(3, 3) %11 = aie.core(%3) { %c56 = arith.constant 56 : index - aie.use_lock(%c56, Acquire, 0) - aie.use_lock(%c56, Release, 1) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%c56, Acquire, %c0_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%c56, Release, %c1_ul1) aie.end } } diff --git a/test/lower-to-standard/lower_buffer_and_lock.mlir b/test/lower-to-standard/lower_buffer_and_lock.mlir index a0dca1f902f..61a3424257e 100644 --- a/test/lower-to-standard/lower_buffer_and_lock.mlir +++ b/test/lower-to-standard/lower_buffer_and_lock.mlir @@ -20,16 +20,16 @@ module @test_core_llvm1 { // CHECK11: memref.global "public" @a : memref<256xi32> // CHECK11: func.func @core_1_1() { // CHECK11: %c56 = arith.constant 56 : index -// CHECK11: %0 = arith.index_cast %c56 : index to i32 // CHECK11: %c0_i32 = arith.constant 0 : i32 +// CHECK11: %0 = arith.index_cast %c56 : index to i32 // CHECK11: call @llvm.aie.lock.acquire.reg(%0, %c0_i32) : (i32, i32) -> () // CHECK11: %c1_i32 = arith.constant 1 : i32 // CHECK11: %c16 = arith.constant 16 : index // CHECK11: %1 = memref.get_global @a : memref<256xi32> // CHECK11: memref.assume_alignment %1, 32 : memref<256xi32> // CHECK11: memref.store %c1_i32, %1[%c16] : memref<256xi32> -// CHECK11: %2 = arith.index_cast %c56 : index to i32 // CHECK11: %c1_i32_0 = arith.constant 1 : i32 +// CHECK11: %2 = arith.index_cast %c56 : index to i32 // CHECK11: call @llvm.aie.lock.release.reg(%2, %c1_i32_0) : (i32, i32) -> () // CHECK11: return // CHECK11: } @@ -37,15 +37,15 @@ module @test_core_llvm1 { // CHECK12: memref.global "public" @a : memref<256xi32> // CHECK12: func.func @core_1_2() { // CHECK12: %c8 = arith.constant 8 : index -// CHECK12: %0 = arith.index_cast %c8 : index to i32 // CHECK12: %c1_i32 = arith.constant 1 : i32 +// CHECK12: %0 = arith.index_cast %c8 : index to i32 // CHECK12: call @llvm.aie.lock.acquire.reg(%0, %c1_i32) : (i32, i32) -> () // CHECK12: %c16 = arith.constant 16 : index // CHECK12: %1 = memref.get_global @a : memref<256xi32> // CHECK12: memref.assume_alignment %1, 32 : memref<256xi32> // CHECK12: %2 = memref.load %1[%c16] : memref<256xi32> -// CHECK12: %3 = arith.index_cast %c8 : index to i32 // CHECK12: %c0_i32 = arith.constant 0 : i32 +// CHECK12: %3 = arith.index_cast %c8 : index to i32 // CHECK12: call @llvm.aie.lock.release.reg(%3, %c0_i32) : (i32, i32) -> () // CHECK12: return // CHECK12: } @@ -56,19 +56,23 @@ module @test_core_llvm1 { %buf11_0 = aie.buffer(%tile11) { sym_name = "a" } : memref<256xi32> %core11 = aie.core(%tile11) { - aie.use_lock(%lock11_8, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock11_8, Acquire, %c0_ul0) %0 = arith.constant 1 : i32 %i = arith.constant 16 : index memref.store %0, %buf11_0[%i] : memref<256xi32> - aie.use_lock(%lock11_8, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock11_8, Release, %c1_ul1) aie.end } %core12 = aie.core(%tile12) { - aie.use_lock(%lock11_8, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock11_8, Acquire, %c1_ul2) %i = arith.constant 16 : index %0 = memref.load %buf11_0[%i] : memref<256xi32> - aie.use_lock(%lock11_8, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock11_8, Release, %c0_ul3) aie.end } } diff --git a/test/lower-to-standard/lower_cascade_put_get.mlir b/test/lower-to-standard/lower_cascade_put_get.mlir index 0aa45b48333..ad34ef2f9be 100644 --- a/test/lower-to-standard/lower_cascade_put_get.mlir +++ b/test/lower-to-standard/lower_cascade_put_get.mlir @@ -22,7 +22,8 @@ module @example0 { %buf152 = aie.buffer(%t33) { sym_name = "a" } : memref<32x64xbf16, 2 : i32> aie.core(%t33) { - aie.use_lock(%l33_0, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l33_0, AcquireGreaterEqual, %c1_ul0) // code %cst = arith.constant 0.000000e+00 : bf16 %c0 = arith.constant 0 : index @@ -30,7 +31,8 @@ module @example0 { %collapse_shape_111 = memref.collapse_shape %subview [[0, 1]] : memref<1x32xbf16, strided<[64, 1]>, 2 : i32> into memref<32xbf16, strided<[1]>, 2 : i32> %4 = vector.transfer_read %collapse_shape_111[%c0], %cst {in_bounds = [true]} : memref<32xbf16, strided<[1]>, 2 : i32>, vector<32xbf16> aie.put_cascade(%4 : vector<32xbf16>) - aie.use_lock(%l33_1, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul1) aie.end } } @@ -53,13 +55,15 @@ module @example1 { %buf = aie.buffer(%t33) { sym_name = "b" } : memref<32xbf16, 2 : i32> aie.core(%t33) { - aie.use_lock(%l33_0, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%l33_0, AcquireGreaterEqual, %c1_ul2) // simpler code - no subview or collapse_shape %cst = arith.constant 0.000000e+00 : bf16 %c0 = arith.constant 0 : index %vec = vector.transfer_read %buf[%c0], %cst {in_bounds = [true]} : memref<32xbf16, 2 : i32>, vector<32xbf16> aie.put_cascade(%vec : vector<32xbf16>) - aie.use_lock(%l33_1, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul3) aie.end } } @@ -82,7 +86,8 @@ module @example2 { %buf152 = aie.buffer(%t33) { sym_name = "c" } : memref<32x64xbf16, 2 : i32> aie.core(%t33) { - aie.use_lock(%l33_0, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%l33_0, AcquireGreaterEqual, %c1_ul4) // code with get_cascade %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index @@ -90,7 +95,8 @@ module @example2 { %4 = aie.get_cascade() : vector<32xbf16> %collapse_shape_111 = memref.collapse_shape %subview [[0, 1]] : memref<1x32xbf16, strided<[64, 1], offset: ?>, 2 : i32> into memref<32xbf16, strided<[1], offset: ?>, 2 : i32> vector.transfer_write %4, %collapse_shape_111[%c0] {in_bounds = [true]} : vector<32xbf16>, memref<32xbf16, strided<[1], offset: ?>, 2 : i32> - aie.use_lock(%l33_1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul5) aie.end } } @@ -113,12 +119,14 @@ module @example3 { %buf = aie.buffer(%t33) { sym_name = "d" } : memref<32xbf16, 2 : i32> aie.core(%t33) { - aie.use_lock(%l33_0, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%l33_0, AcquireGreaterEqual, %c1_ul6) // simpler code - no subview or collapse_shape, direct get_cascade %c0 = arith.constant 0 : index %vec = aie.get_cascade() : vector<32xbf16> vector.transfer_write %vec, %buf[%c0] {in_bounds = [true]} : vector<32xbf16>, memref<32xbf16, 2 : i32> - aie.use_lock(%l33_1, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul7) aie.end } } @@ -140,13 +148,15 @@ module @example4 { %buf = aie.buffer(%t33) { sym_name = "e" } : memref<16xi32, 2 : i32> aie.core(%t33) { - aie.use_lock(%l33_0, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%l33_0, AcquireGreaterEqual, %c1_ul8) // put_cascade with vector<16xi32> - no bitcast needed %c0_i32 = arith.constant 0 : i32 %c0 = arith.constant 0 : index %vec = vector.transfer_read %buf[%c0], %c0_i32 {in_bounds = [true]} : memref<16xi32, 2 : i32>, vector<16xi32> aie.put_cascade(%vec : vector<16xi32>) - aie.use_lock(%l33_1, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul9) aie.end } } @@ -168,12 +178,14 @@ module @example5 { %buf = aie.buffer(%t33) { sym_name = "f" } : memref<16xi32, 2 : i32> aie.core(%t33) { - aie.use_lock(%l33_0, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%l33_0, AcquireGreaterEqual, %c1_ul10) // get_cascade with vector<16xi32> - no bitcast needed %c0 = arith.constant 0 : index %vec = aie.get_cascade() : vector<16xi32> vector.transfer_write %vec, %buf[%c0] {in_bounds = [true]} : vector<16xi32>, memref<16xi32, 2 : i32> - aie.use_lock(%l33_1, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%l33_1, Release, %c1_ul11) aie.end } } diff --git a/test/lower-to-standard/lower_dma.mlir b/test/lower-to-standard/lower_dma.mlir index c4d7579b178..7d2b9a03ef8 100644 --- a/test/lower-to-standard/lower_dma.mlir +++ b/test/lower-to-standard/lower_dma.mlir @@ -38,9 +38,11 @@ module @example0 { %m33 = aie.mem(%t33) { %dmaSt0 = aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l33_0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Acquire, %c1_ul0) aie.dma_bd(%buf33 : memref<256xi32>, 0, 256) - aie.use_lock(%l33_0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Release, %c0_ul1) aie.next_bd ^end ^end: aie.end @@ -49,9 +51,11 @@ module @example0 { %m43 = aie.mem(%t43) { %dmaSt = aie.dma_start(S2MM, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l43_0, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l43_0, Acquire, %c0_ul2) aie.dma_bd(%buf43 : memref<256xi32>, 0, 256) - aie.use_lock(%l43_0, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l43_0, Release, %c1_ul3) aie.next_bd ^end ^end: aie.end @@ -66,7 +70,8 @@ module @example0 { } %c33 = aie.core(%t33) { - aie.use_lock(%l33_0, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l33_0, Acquire, %c0_ul4) // code %val0 = arith.constant 16 : i32 %0 = arith.constant 0 : i32 @@ -74,16 +79,19 @@ module @example0 { %val1 = aie.get_stream(%0 : i32) : i128 %val2 = arith.constant 1 : i384 aie.put_cascade(%val2: i384) - aie.use_lock(%l33_0, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l33_0, Release, %c1_ul5) aie.end } %c43 = aie.core(%t43) { - aie.use_lock(%l43_0, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%l43_0, Acquire, %c1_ul6) // code - aie.use_lock(%l43_0, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%l43_0, Release, %c0_ul7) aie.end } } diff --git a/test/lower-to-standard/useLock_in_func.mlir b/test/lower-to-standard/useLock_in_func.mlir index ad401382a65..a21d62c5fcc 100644 --- a/test/lower-to-standard/useLock_in_func.mlir +++ b/test/lower-to-standard/useLock_in_func.mlir @@ -5,8 +5,8 @@ // CHECK: module @test attributes {llvm.target_triple = "aie"} { // CHECK: func.func private @kernel(%arg0: index) { -// CHECK-NEXT: %0 = arith.index_cast %arg0 : index to i32 // CHECK-NEXT: %c0_i32 = arith.constant 0 : i32 +// CHECK-NEXT: %0 = arith.index_cast %arg0 : index to i32 // CHECK-NEXT: call @llvm.aie.lock.acquire.reg(%0, %c0_i32) : (i32, i32) -> () // CHECK-NEXT: return // CHECK: } @@ -23,7 +23,8 @@ module @test { %lock13_3 = aie.lock(%tile13, 0) func.func private @kernel(%lock : index) { - aie.use_lock(%lock, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock, "Acquire", %c0_ul0) return } diff --git a/test/lower-to-standard/useLock_in_func_aie2.mlir b/test/lower-to-standard/useLock_in_func_aie2.mlir index c99cdcdc449..95e86219317 100644 --- a/test/lower-to-standard/useLock_in_func_aie2.mlir +++ b/test/lower-to-standard/useLock_in_func_aie2.mlir @@ -9,8 +9,8 @@ // CHECK: module @test attributes {llvm.target_triple = "aie2"} { // CHECK: func.func private @kernel(%arg0: index) { -// CHECK-NEXT: %0 = arith.index_cast %arg0 : index to i32 // CHECK-NEXT: %c0_i32 = arith.constant 0 : i32 +// CHECK-NEXT: %0 = arith.index_cast %arg0 : index to i32 // CHECK-NEXT: call @llvm.aie2.acquire(%0, %c0_i32) : (i32, i32) -> () // CHECK-NEXT: return // CHECK: } @@ -27,7 +27,8 @@ module @test { %lock13_3 = aie.lock(%tile13, 0) func.func private @kernel(%lock : index) { - aie.use_lock(%lock, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock, "Acquire", %c0_ul0) return } diff --git a/test/lower-to-standard/useLock_in_func_aie2p.mlir b/test/lower-to-standard/useLock_in_func_aie2p.mlir index ccd097e0450..22af248e0e1 100644 --- a/test/lower-to-standard/useLock_in_func_aie2p.mlir +++ b/test/lower-to-standard/useLock_in_func_aie2p.mlir @@ -9,8 +9,8 @@ // CHECK: module @test attributes {llvm.target_triple = "aie2p"} { // CHECK: func.func private @kernel(%arg0: index) { -// CHECK-NEXT: %0 = arith.index_cast %arg0 : index to i32 // CHECK-NEXT: %c0_i32 = arith.constant 0 : i32 +// CHECK-NEXT: %0 = arith.index_cast %arg0 : index to i32 // CHECK-NEXT: call @llvm.aie2p.acquire(%0, %c0_i32) : (i32, i32) -> () // CHECK-NEXT: return // CHECK: } @@ -27,7 +27,8 @@ module @test { %lock13_3 = aie.lock(%tile13, 0) func.func private @kernel(%lock : index) { - aie.use_lock(%lock, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock, "Acquire", %c0_ul0) return } diff --git a/test/npu-xrt/add_12_i8_using_2d_dma_op_with_padding/aie.mlir b/test/npu-xrt/add_12_i8_using_2d_dma_op_with_padding/aie.mlir index 425f14f00a6..636653eca8a 100644 --- a/test/npu-xrt/add_12_i8_using_2d_dma_op_with_padding/aie.mlir +++ b/test/npu-xrt/add_12_i8_using_2d_dma_op_with_padding/aie.mlir @@ -34,8 +34,10 @@ module { %c12_i8 = arith.constant 12 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -43,8 +45,10 @@ module { memref.store %1, %objFifo_out1_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) aie.end } @@ -71,24 +75,32 @@ module { %objFifo_out0_prod_lock = aie.lock(%tile_0_1, 2) {init = 1 : i32, sym_name = "objFifo_out0_prod_lock"} %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>, 0, 3416) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul5) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>, 0, 4096, [, ], [, ]) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul7) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul9) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul11) }] aie.end } @@ -97,14 +109,18 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_out1_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul15) }] aie.end } diff --git a/test/npu-xrt/add_21_i8_using_dma_op_with_padding/aie.mlir b/test/npu-xrt/add_21_i8_using_dma_op_with_padding/aie.mlir index 41d59d75050..303af6c15a6 100644 --- a/test/npu-xrt/add_21_i8_using_dma_op_with_padding/aie.mlir +++ b/test/npu-xrt/add_21_i8_using_dma_op_with_padding/aie.mlir @@ -34,24 +34,32 @@ module { %c21_i8 = arith.constant 21 : i8 %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c8 step %c2 { - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1] : memref<8xi8> %1 = arith.addi %0, %c21_i8 : i8 memref.store %1, %objFifo_out1_buff_0[%arg1] : memref<8xi8> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_1[%arg1] : memref<8xi8> %1 = arith.addi %0, %c21_i8 : i8 memref.store %1, %objFifo_out1_buff_1[%arg1] : memref<8xi8> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul7) } aie.end } @@ -78,40 +86,56 @@ module { %objFifo_out0_prod_lock = aie.lock(%tile_0_1, 2) {init = 2 : i32, sym_name = "objFifo_out0_prod_lock"} %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi8>, 0, 8) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul9) }, { - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi8>, 0, 8) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul11) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi8>, 0, 16, [], []) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul13) }, { - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi8>, 0, 16, [], []) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul15) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi8>) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul17) }, { - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi8>) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul19) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul21) }, { - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul23) }] aie.end } @@ -120,22 +144,30 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<8xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul25) }, { - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%objFifo_in1_cons_buff_1 : memref<8xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul27) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%objFifo_out1_buff_0 : memref<8xi8>) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul29) }, { - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%objFifo_out1_buff_1 : memref<8xi8>) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul31) }] aie.end } diff --git a/test/npu-xrt/add_256_using_dma_op_no_double_buffering/aie.mlir b/test/npu-xrt/add_256_using_dma_op_no_double_buffering/aie.mlir index 401c444e2ca..e6a4df6b8f6 100644 --- a/test/npu-xrt/add_256_using_dma_op_no_double_buffering/aie.mlir +++ b/test/npu-xrt/add_256_using_dma_op_no_double_buffering/aie.mlir @@ -32,15 +32,19 @@ module { // the core op %c256_i32 = arith.constant 256 : i32 affine.for %arg0 = 0 to 4 step 1 { - aie.use_lock(%lock_0_2_1, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_2, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_1, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_2, AcquireGreaterEqual, %c1_ul1) affine.for %arg1 = 0 to 16 step 1 { %0 = memref.load %buffer_0_2[%arg1] : memref<16xi32> %1 = arith.addi %0, %c256_i32: i32 memref.store %1, %buffer_0_2_1[%arg1] : memref<16xi32> } - aie.use_lock(%lock_0_2_0, Release, 1) - aie.use_lock(%lock_0_2_3, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_0, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_3, Release, %c1_ul3) } aie.end } @@ -55,25 +59,33 @@ module { // forward %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_1_0, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buffer_0_1 : memref<16xi32>) - aie.use_lock(%lock_0_1_1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, Release, %c1_ul5) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buffer_0_1 : memref<16xi32>) - aie.use_lock(%lock_0_1_0, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_0, Release, %c1_ul7) }] // backward %2 = aie.dma(S2MM, 1) [{ - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buffer_0_1_0 : memref<16xi32>) - aie.use_lock(%lock_0_1_3, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_3, Release, %c1_ul9) }] %3 = aie.dma(MM2S, 1) [{ - aie.use_lock(%lock_0_1_3, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_3, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%buffer_0_1_0 : memref<16xi32>) - aie.use_lock(%lock_0_1_2, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, Release, %c1_ul11) }] aie.end } @@ -81,15 +93,19 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { // in %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%lock_0_2_0, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_0, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buffer_0_2 : memref<16xi32>) - aie.use_lock(%lock_0_2_1, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_1, Release, %c1_ul13) }] // out %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%lock_0_2_3, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_3, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buffer_0_2_1 : memref<16xi32>) - aie.use_lock(%lock_0_2_2, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_2, Release, %c1_ul15) }] aie.end } diff --git a/test/npu-xrt/add_314_using_dma_op/aie.mlir b/test/npu-xrt/add_314_using_dma_op/aie.mlir index 919e5cab888..ebce841f662 100644 --- a/test/npu-xrt/add_314_using_dma_op/aie.mlir +++ b/test/npu-xrt/add_314_using_dma_op/aie.mlir @@ -34,24 +34,32 @@ module { %c2_i32 = arith.constant 314 : i32 %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c8 step %c2 { - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1] : memref<8xi32> %1 = arith.addi %0, %c2_i32 : i32 memref.store %1, %objFifo_out1_buff_0[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_1[%arg1] : memref<8xi32> %1 = arith.addi %0, %c2_i32 : i32 memref.store %1, %objFifo_out1_buff_1[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul7) } aie.end } @@ -77,40 +85,56 @@ module { %objFifo_out0_prod_lock = aie.lock(%tile_0_1, 2) {init = 2 : i32, sym_name = "objFifo_out0_prod_lock"} %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul9) }, { - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul11) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul13) }, { - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul15) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul17) }, { - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul19) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul21) }, { - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul23) }] aie.end } @@ -119,22 +143,30 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<8xi32>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul25) }, { - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%objFifo_in1_cons_buff_1 : memref<8xi32>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul27) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%objFifo_out1_buff_0 : memref<8xi32>) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul29) }, { - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%objFifo_out1_buff_1 : memref<8xi32>) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul31) }] aie.end } diff --git a/test/npu-xrt/add_378_i32_using_dma_op_with_padding/aie.mlir b/test/npu-xrt/add_378_i32_using_dma_op_with_padding/aie.mlir index 70afe1dca8c..819e6d1920a 100644 --- a/test/npu-xrt/add_378_i32_using_dma_op_with_padding/aie.mlir +++ b/test/npu-xrt/add_378_i32_using_dma_op_with_padding/aie.mlir @@ -34,24 +34,32 @@ module { %c378_i32 = arith.constant 378 : i32 %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c8 step %c2 { - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1] : memref<8xi32> %1 = arith.addi %0, %c378_i32 : i32 memref.store %1, %objFifo_out1_buff_0[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_1[%arg1] : memref<8xi32> %1 = arith.addi %0, %c378_i32 : i32 memref.store %1, %objFifo_out1_buff_1[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul7) } aie.end } @@ -78,40 +86,56 @@ module { %objFifo_out0_prod_lock = aie.lock(%tile_0_1, 2) {init = 2 : i32, sym_name = "objFifo_out0_prod_lock"} %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>, 0, 13) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul9) }, { - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>, 0, 13) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul11) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>, 0, 16, [], []) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul13) }, { - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>, 0, 16, [], []) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul15) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul17) }, { - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul19) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul21) }, { - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul23) }] aie.end } @@ -120,22 +144,30 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<8xi32>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul25) }, { - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%objFifo_in1_cons_buff_1 : memref<8xi32>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul27) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%objFifo_out1_buff_0 : memref<8xi32>) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul29) }, { - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%objFifo_out1_buff_1 : memref<8xi32>) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul31) }] aie.end } diff --git a/test/npu-xrt/add_blockwrite/aie.mlir b/test/npu-xrt/add_blockwrite/aie.mlir index 7cb680dbdc5..2dc8f2ddf0c 100644 --- a/test/npu-xrt/add_blockwrite/aie.mlir +++ b/test/npu-xrt/add_blockwrite/aie.mlir @@ -32,8 +32,10 @@ module { %c1_i32 = arith.constant 1 : i32 %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c8 step %c2 { - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1] : memref<8xi32> @@ -42,11 +44,15 @@ module { memref.store %2, %objFifo_out1_buff_0[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_1[%arg1] : memref<8xi32> @@ -55,8 +61,10 @@ module { memref.store %2, %objFifo_out1_buff_1[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul7) } aie.end } @@ -83,26 +91,34 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul9) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in1_cons_buff_1 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul11) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) ^bb4: // 2 preds: ^bb3, ^bb5 - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_out1_buff_0 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul13) aie.next_bd ^bb5 ^bb5: // pred: ^bb4 - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_out1_buff_1 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul15) aie.next_bd ^bb4 ^bb6: // pred: ^bb3 aie.end diff --git a/test/npu-xrt/add_maskwrite/aie.mlir b/test/npu-xrt/add_maskwrite/aie.mlir index 4787d8b7169..e66cfe74be8 100644 --- a/test/npu-xrt/add_maskwrite/aie.mlir +++ b/test/npu-xrt/add_maskwrite/aie.mlir @@ -32,15 +32,19 @@ module { scf.for %arg1 = %c0 to %c8 step %c1 { memref.store %c3_i32, %input_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_lock0, AcquireGreaterEqual, 1) - aie.use_lock(%output_lock1, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%input_lock0, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%output_lock1, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %output_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_lock0, Release, 1) - aie.use_lock(%input_lock1, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%output_lock0, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%input_lock1, Release, %c1_ul3) } aie.end } @@ -48,9 +52,11 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: - aie.use_lock(%output_lock0, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%output_lock0, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%output_buffer : memref<8xi32>) { len = 8 : i32 } - aie.use_lock(%output_lock1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%output_lock1, Release, %c1_ul5) aie.next_bd ^bb1 ^bb2: aie.end diff --git a/test/npu-xrt/add_one_ctrl_packet/aie.mlir b/test/npu-xrt/add_one_ctrl_packet/aie.mlir index 6071123ffb0..c33744533e6 100644 --- a/test/npu-xrt/add_one_ctrl_packet/aie.mlir +++ b/test/npu-xrt/add_one_ctrl_packet/aie.mlir @@ -49,28 +49,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_lock0, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%input_lock0, AcquireGreaterEqual, %c1_ul0) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_lock0, AcquireGreaterEqual, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%input_lock0, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_lock2, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%input_lock2, AcquireGreaterEqual, %c1_ul2) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_lock2, AcquireGreaterEqual, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%input_lock2, AcquireGreaterEqual, %c1_ul3) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_buffer[%arg1] : memref<8xi32> @@ -78,14 +82,16 @@ module { memref.store %2, %input_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_lock5, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%output_lock5, AcquireGreaterEqual, %c1_ul4) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_buffer[%arg1] : memref<8xi32> memref.store %1, %output_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %other_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_lock4, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%output_lock4, Release, %c1_ul5) } aie.end } @@ -93,9 +99,11 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_lock4, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%output_lock4, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%output_buffer : memref<8xi32>, 0, 8) {packet = #aie.packet_info} - aie.use_lock(%output_lock5, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%output_lock5, Release, %c1_ul7) aie.next_bd ^bb1 ^bb2: aie.end diff --git a/test/npu-xrt/add_one_ctrl_packet_4_cores/aie.mlir b/test/npu-xrt/add_one_ctrl_packet_4_cores/aie.mlir index 127ce74d780..18620d5d7c3 100644 --- a/test/npu-xrt/add_one_ctrl_packet_4_cores/aie.mlir +++ b/test/npu-xrt/add_one_ctrl_packet_4_cores/aie.mlir @@ -83,28 +83,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, %c1_ul0) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, %c1_ul2) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, %c1_ul3) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> @@ -112,12 +116,14 @@ module { memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_2_lock5, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock5, AcquireGreaterEqual, %c1_ul4) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_2_lock4, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock4, Release, %c1_ul5) } aie.end } @@ -125,9 +131,11 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_2_lock4, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock4, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%output_0_2_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_2_lock5, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock5, Release, %c1_ul7) aie.next_bd ^bb1 ^bb2: aie.end @@ -147,28 +155,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, %c1_ul8) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, %c1_ul9) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, %c1_ul10) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, %c1_ul11) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> @@ -176,12 +188,14 @@ module { memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_3_lock5, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock5, AcquireGreaterEqual, %c1_ul12) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_3_lock4, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock4, Release, %c1_ul13) } aie.end } @@ -189,9 +203,11 @@ module { %mem_0_3 = aie.mem(%tile_0_3) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_3_lock4, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock4, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%output_0_3_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_3_lock5, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock5, Release, %c1_ul15) aie.next_bd ^bb1 ^bb2: aie.end @@ -211,28 +227,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, %c1_ul16) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, %c1_ul17) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, %c1_ul18) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, %c1_ul19) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> @@ -240,12 +260,14 @@ module { memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_4_lock5, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock5, AcquireGreaterEqual, %c1_ul20) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_4_lock4, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock4, Release, %c1_ul21) } aie.end } @@ -253,9 +275,11 @@ module { %mem_0_4 = aie.mem(%tile_0_4) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_4_lock4, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock4, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%output_0_4_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_4_lock5, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock5, Release, %c1_ul23) aie.next_bd ^bb1 ^bb2: aie.end @@ -275,28 +299,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, %c1_ul24) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, %c1_ul25) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, %c1_ul26) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, %c1_ul27) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> @@ -304,12 +332,14 @@ module { memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_5_lock5, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock5, AcquireGreaterEqual, %c1_ul28) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_5_lock4, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock4, Release, %c1_ul29) } aie.end } @@ -317,9 +347,11 @@ module { %mem_0_5 = aie.mem(%tile_0_5) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_5_lock4, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock4, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%output_0_5_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_5_lock5, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock5, Release, %c1_ul31) aie.next_bd ^bb1 ^bb2: aie.end diff --git a/test/npu-xrt/add_one_ctrl_packet_col_overlay/aie.mlir b/test/npu-xrt/add_one_ctrl_packet_col_overlay/aie.mlir index a7fd3218579..9dc99895430 100644 --- a/test/npu-xrt/add_one_ctrl_packet_col_overlay/aie.mlir +++ b/test/npu-xrt/add_one_ctrl_packet_col_overlay/aie.mlir @@ -67,28 +67,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, %c1_ul0) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock0, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, %c1_ul2) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%input_0_2_lock2, AcquireGreaterEqual, %c1_ul3) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> @@ -96,12 +100,14 @@ module { memref.store %2, %input_0_2_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_2_lock5, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock5, AcquireGreaterEqual, %c1_ul4) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_2_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_2_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_2_lock4, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock4, Release, %c1_ul5) } aie.end } @@ -109,9 +115,11 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_2_lock4, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock4, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%output_0_2_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_2_lock5, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%output_0_2_lock5, Release, %c1_ul7) aie.next_bd ^bb1 ^bb2: aie.end @@ -131,28 +139,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, %c1_ul8) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock0, AcquireGreaterEqual, %c1_ul9) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, %c1_ul10) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%input_0_3_lock2, AcquireGreaterEqual, %c1_ul11) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> @@ -160,12 +172,14 @@ module { memref.store %2, %input_0_3_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_3_lock5, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock5, AcquireGreaterEqual, %c1_ul12) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_3_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_3_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_3_lock4, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock4, Release, %c1_ul13) } aie.end } @@ -173,9 +187,11 @@ module { %mem_0_3 = aie.mem(%tile_0_3) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_3_lock4, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock4, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%output_0_3_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_3_lock5, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%output_0_3_lock5, Release, %c1_ul15) aie.next_bd ^bb1 ^bb2: aie.end @@ -195,28 +211,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, %c1_ul16) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock0, AcquireGreaterEqual, %c1_ul17) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, %c1_ul18) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%input_0_4_lock2, AcquireGreaterEqual, %c1_ul19) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> @@ -224,12 +244,14 @@ module { memref.store %2, %input_0_4_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_4_lock5, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock5, AcquireGreaterEqual, %c1_ul20) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_4_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_4_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_4_lock4, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock4, Release, %c1_ul21) } aie.end } @@ -237,9 +259,11 @@ module { %mem_0_4 = aie.mem(%tile_0_4) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_4_lock4, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock4, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%output_0_4_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_4_lock5, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%output_0_4_lock5, Release, %c1_ul23) aie.next_bd ^bb1 ^bb2: aie.end @@ -259,28 +283,32 @@ module { } %c4294967295 = arith.constant 4294967295 : index scf.for %arg0 = %c0 to %c4294967295 step %c1 { - aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, %c1_ul24) scf.for %arg1 = %c0 to %c8 step %c1 { // 4 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock0, AcquireGreaterEqual, %c1_ul25) scf.for %arg1 = %c0 to %c8 step %c1 { // 5 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, %c1_ul26) scf.for %arg1 = %c0 to %c8 step %c1 { // 6 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> %2 = arith.addi %1, %c1_i32 : i32 memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%input_0_5_lock2, AcquireGreaterEqual, %c1_ul27) scf.for %arg1 = %c0 to %c8 step %c1 { // 7 %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> @@ -288,12 +316,14 @@ module { memref.store %2, %input_0_5_buffer[%arg1] : memref<8xi32> } // write to output buffer - aie.use_lock(%output_0_5_lock5, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock5, AcquireGreaterEqual, %c1_ul28) scf.for %arg1 = %c0 to %c8 step %c1 { %1 = memref.load %input_0_5_buffer[%arg1] : memref<8xi32> memref.store %1, %output_0_5_buffer[%arg1] : memref<8xi32> } - aie.use_lock(%output_0_5_lock4, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock4, Release, %c1_ul29) } aie.end } @@ -301,9 +331,11 @@ module { %mem_0_5 = aie.mem(%tile_0_5) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%output_0_5_lock4, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock4, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%output_0_5_buffer : memref<8xi32>, 0, 8) - aie.use_lock(%output_0_5_lock5, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%output_0_5_lock5, Release, %c1_ul31) aie.next_bd ^bb1 ^bb2: aie.end diff --git a/test/npu-xrt/add_one_using_dma/aie.mlir b/test/npu-xrt/add_one_using_dma/aie.mlir index 57b250db087..ebea46f6412 100644 --- a/test/npu-xrt/add_one_using_dma/aie.mlir +++ b/test/npu-xrt/add_one_using_dma/aie.mlir @@ -34,8 +34,10 @@ module { %c1_i32 = arith.constant 1 : i32 %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c8 step %c2 { - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1] : memref<8xi32> @@ -43,11 +45,15 @@ module { memref.store %1, %objFifo_out1_buff_0[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_1[%arg1] : memref<8xi32> @@ -55,8 +61,10 @@ module { memref.store %1, %objFifo_out1_buff_1[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul7) } aie.end } @@ -84,50 +92,66 @@ module { %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul9) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul11) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) ^bb4: // 2 preds: ^bb3, ^bb5 - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul13) aie.next_bd ^bb5 ^bb5: // pred: ^bb4 - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul15) aie.next_bd ^bb4 ^bb6: // pred: ^bb3 %2 = aie.dma_start(MM2S, 1, ^bb7, ^bb9) ^bb7: // 2 preds: ^bb6, ^bb8 - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul17) aie.next_bd ^bb8 ^bb8: // pred: ^bb7 - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul19) aie.next_bd ^bb7 ^bb9: // pred: ^bb6 %3 = aie.dma_start(S2MM, 1, ^bb10, ^bb12) ^bb10: // 2 preds: ^bb9, ^bb11 - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul21) aie.next_bd ^bb11 ^bb11: // pred: ^bb10 - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul23) aie.next_bd ^bb10 ^bb12: // pred: ^bb9 aie.end @@ -138,26 +162,34 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul25) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%objFifo_in1_cons_buff_1 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul27) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) ^bb4: // 2 preds: ^bb3, ^bb5 - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%objFifo_out1_buff_0 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul29) aie.next_bd ^bb5 ^bb5: // pred: ^bb4 - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%objFifo_out1_buff_1 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul31) aie.next_bd ^bb4 ^bb6: // pred: ^bb3 aie.end diff --git a/test/npu-xrt/core_dmas/dma_configure_task_lock/aie.mlir b/test/npu-xrt/core_dmas/dma_configure_task_lock/aie.mlir index a742c49f1f2..f1e6f837af3 100644 --- a/test/npu-xrt/core_dmas/dma_configure_task_lock/aie.mlir +++ b/test/npu-xrt/core_dmas/dma_configure_task_lock/aie.mlir @@ -30,9 +30,11 @@ module { // Configure core DMA to receive from shim %t3 = aiex.dma_configure_task(%tile_0_2, S2MM, 0) { - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%in_buff : memref<1024xi32>, 0, 1024) {bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul1) aie.end } @@ -42,9 +44,11 @@ module { // Configure core DMA to send to memtile %t4 = aiex.dma_configure_task(%tile_0_2, MM2S, 0) { - aie.use_lock(%cons_lock, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%in_buff : memref<1024xi32>, 0, 1024) {bd_id = 1 : i32} - aie.use_lock(%prod_lock, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, Release, %c1_ul3) aie.end } diff --git a/test/npu-xrt/ctrl_packet_reconfig/aie.mlir b/test/npu-xrt/ctrl_packet_reconfig/aie.mlir index bb2e1975ead..633a33a56db 100644 --- a/test/npu-xrt/ctrl_packet_reconfig/aie.mlir +++ b/test/npu-xrt/ctrl_packet_reconfig/aie.mlir @@ -50,8 +50,10 @@ module { %c12_i8 = arith.constant 12 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -59,8 +61,10 @@ module { memref.store %1, %objFifo_out1_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) aie.end } @@ -89,24 +93,32 @@ module { %objFifo_out0_prod_lock = aie.lock(%tile_0_1, 2) {init = 1 : i32, sym_name = "objFifo_out0_prod_lock"} %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul5) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul7) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul9) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul11) }] aie.end } @@ -115,14 +127,18 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_out1_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul15) }] aie.end } diff --git a/test/npu-xrt/ctrl_packet_reconfig_1x4_cores/aie.mlir b/test/npu-xrt/ctrl_packet_reconfig_1x4_cores/aie.mlir index 0c23860acf5..4cb3b4715ad 100644 --- a/test/npu-xrt/ctrl_packet_reconfig_1x4_cores/aie.mlir +++ b/test/npu-xrt/ctrl_packet_reconfig_1x4_cores/aie.mlir @@ -86,8 +86,10 @@ module { %c12_i8 = arith.constant 12 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_0_2_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_0_2_lock_1, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_3, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_1, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_0_2_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -95,21 +97,27 @@ module { memref.store %1, %tile_0_2_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_0_2_lock_0, Release, 1) - aie.use_lock(%tile_0_2_lock_2, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_0, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_2, Release, %c1_ul3) aie.end } %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_0_2_lock_0, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_0, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%tile_0_2_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_0_2_lock_1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_1, Release, %c1_ul5) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_0_2_lock_2, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_2, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%tile_0_2_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_0_2_lock_3, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_3, Release, %c1_ul7) }] aie.end } @@ -122,8 +130,10 @@ module { %c13_i8 = arith.constant 13 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_0_3_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_0_3_lock_1, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_3, AcquireGreaterEqual, %c1_ul8) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_1, AcquireGreaterEqual, %c1_ul9) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_0_3_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -131,21 +141,27 @@ module { memref.store %1, %tile_0_3_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_0_3_lock_0, Release, 1) - aie.use_lock(%tile_0_3_lock_2, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_0, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_2, Release, %c1_ul11) aie.end } %mem_0_3 = aie.mem(%tile_0_3) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_0_3_lock_0, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_0, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%tile_0_3_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_0_3_lock_1, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_1, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_0_3_lock_2, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_2, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%tile_0_3_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_0_3_lock_3, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%tile_0_3_lock_3, Release, %c1_ul15) }] aie.end } @@ -158,8 +174,10 @@ module { %c14_i8 = arith.constant 14 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_0_4_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_0_4_lock_1, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_3, AcquireGreaterEqual, %c1_ul16) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_1, AcquireGreaterEqual, %c1_ul17) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_0_4_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -167,21 +185,27 @@ module { memref.store %1, %tile_0_4_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_0_4_lock_0, Release, 1) - aie.use_lock(%tile_0_4_lock_2, Release, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_0, Release, %c1_ul18) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_2, Release, %c1_ul19) aie.end } %mem_0_4 = aie.mem(%tile_0_4) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_0_4_lock_0, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_0, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%tile_0_4_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_0_4_lock_1, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_1, Release, %c1_ul21) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_0_4_lock_2, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_2, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%tile_0_4_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_0_4_lock_3, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%tile_0_4_lock_3, Release, %c1_ul23) }] aie.end } @@ -194,8 +218,10 @@ module { %c15_i8 = arith.constant 15 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_0_5_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_0_5_lock_1, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_3, AcquireGreaterEqual, %c1_ul24) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_1, AcquireGreaterEqual, %c1_ul25) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_0_5_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -203,21 +229,27 @@ module { memref.store %1, %tile_0_5_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_0_5_lock_0, Release, 1) - aie.use_lock(%tile_0_5_lock_2, Release, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_0, Release, %c1_ul26) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_2, Release, %c1_ul27) aie.end } %mem_0_5 = aie.mem(%tile_0_5) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_0_5_lock_0, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_0, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%tile_0_5_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_0_5_lock_1, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_1, Release, %c1_ul29) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_0_5_lock_2, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_2, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%tile_0_5_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_0_5_lock_3, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%tile_0_5_lock_3, Release, %c1_ul31) }] aie.end } @@ -230,55 +262,75 @@ module { %memtile_lock_2 = aie.lock(%tile_0_1, 2) {init = 0 : i32, sym_name = "memtile_lock_2"} %memtile_lock_3 = aie.lock(%tile_0_1, 3) {init = 4 : i32, sym_name = "memtile_lock_3"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%memtile_lock_0, AcquireGreaterEqual, 4) + %c4_ul32 = arith.constant 4 : i32 + aie.use_lock(%memtile_lock_0, AcquireGreaterEqual, %c4_ul32) aie.dma_bd(%buff_0 : memref<4x64x64xi8>, 0, 16384) - aie.use_lock(%memtile_lock_1, Release, 4) + %c4_ul33 = arith.constant 4 : i32 + aie.use_lock(%memtile_lock_1, Release, %c4_ul33) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, 1) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, %c1_ul34) aie.dma_bd(%buff_0 : memref<4x64x64xi8>, 0, 4096) - aie.use_lock(%memtile_lock_0, Release, 1) + %c1_ul35 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_0, Release, %c1_ul35) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, 1) + %c1_ul36 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, %c1_ul36) aie.dma_bd(%buff_0 : memref<4x64x64xi8>, 4096, 4096) - aie.use_lock(%memtile_lock_0, Release, 1) + %c1_ul37 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_0, Release, %c1_ul37) }] %3 = aie.dma(MM2S, 2) [{ - aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, 1) + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, %c1_ul38) aie.dma_bd(%buff_0 : memref<4x64x64xi8>, 8192, 4096) - aie.use_lock(%memtile_lock_0, Release, 1) + %c1_ul39 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_0, Release, %c1_ul39) }] %4 = aie.dma(MM2S, 3) [{ - aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, 1) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_1, AcquireGreaterEqual, %c1_ul40) aie.dma_bd(%buff_0 : memref<4x64x64xi8>, 12288, 4096) - aie.use_lock(%memtile_lock_0, Release, 1) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_0, Release, %c1_ul41) }] %5 = aie.dma(S2MM, 1) [{ - aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, 1) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, %c1_ul42) aie.dma_bd(%buff_1 : memref<4x64x64xi8>, 0, 4096) - aie.use_lock(%memtile_lock_2, Release, 1) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_2, Release, %c1_ul43) }] %6 = aie.dma(S2MM, 2) [{ - aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, 1) + %c1_ul44 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, %c1_ul44) aie.dma_bd(%buff_1 : memref<4x64x64xi8>, 4096, 4096) - aie.use_lock(%memtile_lock_2, Release, 1) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_2, Release, %c1_ul45) }] %7 = aie.dma(S2MM, 3) [{ - aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, 1) + %c1_ul46 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, %c1_ul46) aie.dma_bd(%buff_1 : memref<4x64x64xi8>, 8192, 4096) - aie.use_lock(%memtile_lock_2, Release, 1) + %c1_ul47 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_2, Release, %c1_ul47) }] %8 = aie.dma(S2MM, 4) [{ - aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, 1) + %c1_ul48 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_3, AcquireGreaterEqual, %c1_ul48) aie.dma_bd(%buff_1 : memref<4x64x64xi8>, 12288, 4096) - aie.use_lock(%memtile_lock_2, Release, 1) + %c1_ul49 = arith.constant 1 : i32 + aie.use_lock(%memtile_lock_2, Release, %c1_ul49) }] %9 = aie.dma(MM2S, 4) [{ - aie.use_lock(%memtile_lock_2, AcquireGreaterEqual, 4) + %c4_ul50 = arith.constant 4 : i32 + aie.use_lock(%memtile_lock_2, AcquireGreaterEqual, %c4_ul50) aie.dma_bd(%buff_1 : memref<4x64x64xi8>, 0, 16384) - aie.use_lock(%memtile_lock_3, Release, 4) + %c4_ul51 = arith.constant 4 : i32 + aie.use_lock(%memtile_lock_3, Release, %c4_ul51) }] aie.end } diff --git a/test/npu-xrt/ctrl_packet_reconfig_4x1_cores/aie.mlir b/test/npu-xrt/ctrl_packet_reconfig_4x1_cores/aie.mlir index 200c904f1d9..566789db407 100644 --- a/test/npu-xrt/ctrl_packet_reconfig_4x1_cores/aie.mlir +++ b/test/npu-xrt/ctrl_packet_reconfig_4x1_cores/aie.mlir @@ -104,8 +104,10 @@ module { %c12_i8 = arith.constant 12 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_0_2_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_0_2_lock_1, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_3, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_1, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_0_2_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -113,21 +115,27 @@ module { memref.store %1, %tile_0_2_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_0_2_lock_0, Release, 1) - aie.use_lock(%tile_0_2_lock_2, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_0, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_2, Release, %c1_ul3) aie.end } %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_0_2_lock_0, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_0, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%tile_0_2_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_0_2_lock_1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_1, Release, %c1_ul5) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_0_2_lock_2, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_2, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%tile_0_2_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_0_2_lock_3, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%tile_0_2_lock_3, Release, %c1_ul7) }] aie.end } @@ -140,8 +148,10 @@ module { %c13_i8 = arith.constant 13 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_1_2_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_1_2_lock_1, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_3, AcquireGreaterEqual, %c1_ul8) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_1, AcquireGreaterEqual, %c1_ul9) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_1_2_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -149,21 +159,27 @@ module { memref.store %1, %tile_1_2_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_1_2_lock_0, Release, 1) - aie.use_lock(%tile_1_2_lock_2, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_0, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_2, Release, %c1_ul11) aie.end } %mem_1_2 = aie.mem(%tile_1_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_1_2_lock_0, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_0, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%tile_1_2_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_1_2_lock_1, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_1, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_1_2_lock_2, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_2, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%tile_1_2_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_1_2_lock_3, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%tile_1_2_lock_3, Release, %c1_ul15) }] aie.end } @@ -176,8 +192,10 @@ module { %c14_i8 = arith.constant 14 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_2_2_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_2_2_lock_1, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_3, AcquireGreaterEqual, %c1_ul16) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_1, AcquireGreaterEqual, %c1_ul17) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_2_2_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -185,21 +203,27 @@ module { memref.store %1, %tile_2_2_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_2_2_lock_0, Release, 1) - aie.use_lock(%tile_2_2_lock_2, Release, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_0, Release, %c1_ul18) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_2, Release, %c1_ul19) aie.end } %mem_2_2 = aie.mem(%tile_2_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_2_2_lock_0, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_0, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%tile_2_2_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_2_2_lock_1, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_1, Release, %c1_ul21) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_2_2_lock_2, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_2, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%tile_2_2_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_2_2_lock_3, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%tile_2_2_lock_3, Release, %c1_ul23) }] aie.end } @@ -212,8 +236,10 @@ module { %c15_i8 = arith.constant 15 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%tile_3_2_lock_3, AcquireGreaterEqual, 1) - aie.use_lock(%tile_3_2_lock_1, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_3, AcquireGreaterEqual, %c1_ul24) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_1, AcquireGreaterEqual, %c1_ul25) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %tile_3_2_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -221,21 +247,27 @@ module { memref.store %1, %tile_3_2_buff_1[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%tile_3_2_lock_0, Release, 1) - aie.use_lock(%tile_3_2_lock_2, Release, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_0, Release, %c1_ul26) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_2, Release, %c1_ul27) aie.end } %mem_3_2 = aie.mem(%tile_3_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%tile_3_2_lock_0, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_0, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%tile_3_2_buff_0 : memref<64x64xi8>) - aie.use_lock(%tile_3_2_lock_1, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_1, Release, %c1_ul29) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%tile_3_2_lock_2, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_2, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%tile_3_2_buff_1 : memref<64x64xi8>) - aie.use_lock(%tile_3_2_lock_3, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%tile_3_2_lock_3, Release, %c1_ul31) }] aie.end } diff --git a/test/npu-xrt/ctrl_packet_reconfig_elf/aie.mlir b/test/npu-xrt/ctrl_packet_reconfig_elf/aie.mlir index 827233c537c..ddd525f692b 100644 --- a/test/npu-xrt/ctrl_packet_reconfig_elf/aie.mlir +++ b/test/npu-xrt/ctrl_packet_reconfig_elf/aie.mlir @@ -47,8 +47,10 @@ module { %c3_i8 = arith.constant 3 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -56,8 +58,10 @@ module { memref.store %1, %objFifo_out1_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) aie.end } @@ -86,24 +90,32 @@ module { %objFifo_out0_prod_lock = aie.lock(%tile_0_1, 2) {init = 1 : i32, sym_name = "objFifo_out0_prod_lock"} %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul5) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul7) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul9) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul11) }] aie.end } @@ -112,14 +124,18 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_out1_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul15) }] aie.end } diff --git a/test/npu-xrt/dmabd_task_queue/aie.mlir b/test/npu-xrt/dmabd_task_queue/aie.mlir index 3202df3fa25..2e7c3ef7cbe 100644 --- a/test/npu-xrt/dmabd_task_queue/aie.mlir +++ b/test/npu-xrt/dmabd_task_queue/aie.mlir @@ -37,32 +37,40 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: // pred: ^bb0 - aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf3 : memref<5xi32, 2 : i32>, 0, 5) - aie.use_lock(%lock_0_2_5, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, Release, %c1_ul1) aie.next_bd ^bb4 ^bb2: // pred: ^bb0 %1 = aie.dma_start(S2MM, 0, ^bb3, ^bb7, repeat_count = 7) ^bb3: // pred: ^bb2 - aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf4 : memref<12xi32, 2 : i32>, 0, 12) - aie.use_lock(%lock_0_2_5, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, Release, %c1_ul3) aie.next_bd ^bb4 ^bb4: // 3 preds: ^bb1, ^bb3, ^bb5 aie.end ^bb5: // pred: ^bb7 %2 = aie.dma_start(S2MM, 1, ^bb6, ^bb4, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_0_2, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf1 : memref<12xi32, 2 : i32>, 0, 12) - aie.use_lock(%lock_0_2_3, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_3, Release, %c1_ul5) aie.next_bd ^bb6 ^bb7: // pred: ^bb2 %3 = aie.dma_start(MM2S, 0, ^bb8, ^bb5, repeat_count = 1) ^bb8: // 2 preds: ^bb7, ^bb8 - aie.use_lock(%lock_0_2_7, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_7, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf2 : memref<9xi32, 2 : i32>, 0, 9) - aie.use_lock(%lock_0_2_6, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, Release, %c1_ul7) aie.next_bd ^bb8 } %core_0_2 = aie.core(%tile_0_2) { @@ -74,21 +82,26 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, %c1_ul8) scf.for %arg0 = %c0 to %c9 step %c1 { memref.store %c0_i32, %buf2[%arg0] : memref<9xi32, 2 : i32> } - aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, %c1_ul9) scf.for %arg0 = %c0 to %c5 step %c1 { %0 = memref.load %buf2[%c0] : memref<9xi32, 2 : i32> %1 = memref.load %buf3[%arg0] : memref<5xi32, 2 : i32> %2 = arith.addi %0, %1 : i32 memref.store %2, %buf2[%c0] : memref<9xi32, 2 : i32> } - aie.use_lock(%lock_0_2_4, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, Release, %c1_ul10) scf.for %arg0 = %c1 to %c9 step %c1 { - aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_3, AcquireGreaterEqual, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, %c1_ul11) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_3, AcquireGreaterEqual, %c1_ul12) scf.for %arg1 = %c0 to %c12 step %c1 { %0 = memref.load %buf4[%arg1] : memref<12xi32, 2 : i32> %1 = memref.load %buf1[%arg1] : memref<12xi32, 2 : i32> @@ -97,10 +110,13 @@ module { %4 = arith.addi %3, %2 : i32 memref.store %4, %buf2[%arg0] : memref<9xi32, 2 : i32> } - aie.use_lock(%lock_0_2, Release, 1) - aie.use_lock(%lock_0_2_4, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, Release, %c1_ul13) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, Release, %c1_ul14) } - aie.use_lock(%lock_0_2_7, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_7, Release, %c1_ul15) cf.br ^bb1 } aie.flow(%tile_0_0, DMA : 0, %tile_0_1, DMA : 0) @@ -112,66 +128,82 @@ module { %memtile_dma_2_1 = aie.memtile_dma(%tile_2_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buf5 : memref<9xi32, 1 : i32>, 0, 9) - aie.use_lock(%lock_2_1_2, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_2, Release, %c1_ul17) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_2_1_2, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_2, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buf5 : memref<9xi32, 1 : i32>, 0, 9) - aie.use_lock(%lock_2_1, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, Release, %c1_ul19) aie.next_bd ^bb4 } %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: // pred: ^bb0 - aie.use_lock(%lock_0_1, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%buf7 : memref<5xi32, 1 : i32>, 0, 5) - aie.use_lock(%lock_0_1_1, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, Release, %c1_ul21) aie.next_bd ^bb4 ^bb2: // pred: ^bb0 %1 = aie.dma_start(S2MM, 0, ^bb3, ^bb5, repeat_count = 7) ^bb3: // pred: ^bb2 - aie.use_lock(%lock_0_1, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%buf8 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_0_1_1, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, Release, %c1_ul23) aie.next_bd ^bb4 ^bb4: // 5 preds: ^bb1, ^bb3, ^bb6, ^bb7, ^bb8 aie.end ^bb5: // pred: ^bb2 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb7) ^bb6: // pred: ^bb5 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%buf7 : memref<5xi32, 1 : i32>, 0, 5) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul25) aie.next_bd ^bb4 ^bb7: // pred: ^bb5 %3 = aie.dma_start(MM2S, 0, ^bb8, ^bb4, repeat_count = 7) ^bb8: // pred: ^bb7 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%buf8 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul27) aie.next_bd ^bb4 } %memtile_dma_1_1 = aie.memtile_dma(%tile_1_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_1, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%buf6 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_1_1_0, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, Release, %c1_ul29) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%buf6 : memref<12xi32, 1 : i32>, 0, 12) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul31) aie.next_bd ^bb4 } aie.shim_dma_allocation @airMemcpyId12 (%tile_2_0, S2MM, 0) diff --git a/test/npu-xrt/matrix_multiplication_using_cascade/aie_bufferx4.mlir b/test/npu-xrt/matrix_multiplication_using_cascade/aie_bufferx4.mlir index 80a3d64588e..85d464d552c 100644 --- a/test/npu-xrt/matrix_multiplication_using_cascade/aie_bufferx4.mlir +++ b/test/npu-xrt/matrix_multiplication_using_cascade/aie_bufferx4.mlir @@ -69,18 +69,22 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf2 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_0_2_6, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_2, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf1 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_0_2_4, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, Release, %c1_ul3) aie.next_bd ^bb4 } %core_0_2 = aie.core(%tile_0_2) { @@ -92,8 +96,10 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, %c1_ul5) // func.call @event_0() : () -> () // @@ -144,8 +150,10 @@ module { } } } - aie.use_lock(%lock_0_2_5, Release, 1) - aie.use_lock(%lock_0_2, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, Release, %c1_ul7) // func.call @flush_trace() : () -> () // @@ -154,18 +162,22 @@ module { %mem_1_2 = aie.mem(%tile_1_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_2_8, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_8, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buf5 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_1_2_9, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_9, Release, %c1_ul9) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_2, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%buf4 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_1_2_7, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_7, Release, %c1_ul11) aie.next_bd ^bb4 } %core_1_2 = aie.core(%tile_1_2) { @@ -177,8 +189,10 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_2_9, AcquireGreaterEqual, 1) - aie.use_lock(%lock_1_2_7, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_9, AcquireGreaterEqual, %c1_ul12) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_7, AcquireGreaterEqual, %c1_ul13) // func.call @event_0() : () -> () // @@ -237,8 +251,10 @@ module { } } } - aie.use_lock(%lock_1_2_8, Release, 1) - aie.use_lock(%lock_1_2, Release, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_8, Release, %c1_ul14) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2, Release, %c1_ul15) // func.call @flush_trace() : () -> () // @@ -247,18 +263,22 @@ module { %mem_2_2 = aie.mem(%tile_2_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_2_11, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_11, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buf8 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_2_2_12, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_12, Release, %c1_ul17) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_2_2, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buf7 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_2_2_10, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_10, Release, %c1_ul19) aie.next_bd ^bb4 } %core_2_2 = aie.core(%tile_2_2) { @@ -270,8 +290,10 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_2_12, AcquireGreaterEqual, 1) - aie.use_lock(%lock_2_2_10, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_12, AcquireGreaterEqual, %c1_ul20) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_10, AcquireGreaterEqual, %c1_ul21) // func.call @event_0() : () -> () // @@ -330,8 +352,10 @@ module { } } } - aie.use_lock(%lock_2_2_11, Release, 1) - aie.use_lock(%lock_2_2, Release, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_11, Release, %c1_ul22) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2, Release, %c1_ul23) // func.call @flush_trace() : () -> () // @@ -340,25 +364,31 @@ module { %mem_3_2 = aie.mem(%tile_3_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_3_2_14, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_14, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%buf11 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_3_2_15, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_15, Release, %c1_ul25) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_3_2, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%buf10 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_3_2_13, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_13, Release, %c1_ul27) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_3_2_17, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_17, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%buf9 : memref<4x4x4x4xi32, 2 : i32>, 0, 256, [, , ]) - aie.use_lock(%lock_3_2_16, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_16, Release, %c1_ul29) aie.next_bd ^bb6 } %core_3_2 = aie.core(%tile_3_2) { @@ -370,9 +400,12 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_3_2_16, AcquireGreaterEqual, 1) - aie.use_lock(%lock_3_2_15, AcquireGreaterEqual, 1) - aie.use_lock(%lock_3_2_13, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_16, AcquireGreaterEqual, %c1_ul30) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_15, AcquireGreaterEqual, %c1_ul31) + %c1_ul32 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_13, AcquireGreaterEqual, %c1_ul32) // func.call @event_0() : () -> () // @@ -423,9 +456,12 @@ module { } } } - aie.use_lock(%lock_3_2_17, Release, 1) - aie.use_lock(%lock_3_2_14, Release, 1) - aie.use_lock(%lock_3_2, Release, 1) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_17, Release, %c1_ul33) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_14, Release, %c1_ul34) + %c1_ul35 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2, Release, %c1_ul35) // func.call @flush_trace() : () -> () // @@ -475,91 +511,115 @@ module { %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb13, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_1, AcquireGreaterEqual, 4) + %c4_ul36 = arith.constant 4 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c4_ul36) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_1, Release, 4) + %c4_ul37 = arith.constant 4 : i32 + aie.use_lock(%lock_0_1_1, Release, %c4_ul37) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, 1) + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul38) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_3, Release, 1) + %c1_ul39 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_3, Release, %c1_ul39) aie.next_bd ^bb4 ^bb5: // pred: ^bb5 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul40) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul41) aie.next_bd ^bb6 ^bb7: // pred: ^bb7 %3 = aie.dma_start(MM2S, 1, ^bb8, ^bb5, repeat_count = 1) ^bb8: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul42) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 4, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul43) aie.next_bd ^bb8 ^bb9: // pred: ^bb9 %4 = aie.dma_start(MM2S, 2, ^bb10, ^bb7, repeat_count = 1) ^bb10: // 2 preds: ^bb7, ^bb8 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul44 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul44) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 8, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul45) aie.next_bd ^bb10 ^bb11: // pred: ^bb0 %5 = aie.dma_start(MM2S, 3, ^bb12, ^bb9, repeat_count = 1) ^bb12: // 2 preds: ^bb9, ^bb10 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul46 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul46) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 12, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul47 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul47) aie.next_bd ^bb12 ^bb13: // pred: ^bb0 %6 = aie.dma_start(MM2S, 4, ^bb14, ^bb11, repeat_count = 1) ^bb14: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_3, AcquireGreaterEqual, 1) + %c1_ul48 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_3, AcquireGreaterEqual, %c1_ul48) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_2, Release, 1) + %c1_ul49 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, Release, %c1_ul49) aie.next_bd ^bb14 } %memtile_dma_1_1 = aie.memtile_dma(%tile_1_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb9, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_1, AcquireGreaterEqual, 4) + %c4_ul50 = arith.constant 4 : i32 + aie.use_lock(%lock_1_1, AcquireGreaterEqual, %c4_ul50) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_1_1_0, Release, 4) + %c4_ul51 = arith.constant 4 : i32 + aie.use_lock(%lock_1_1_0, Release, %c4_ul51) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul52 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul52) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul53 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul53) aie.next_bd ^bb4 ^bb5: // pred: ^bb7 %2 = aie.dma_start(MM2S, 1, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul54 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul54) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 64, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul55 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul55) aie.next_bd ^bb6 ^bb7: // pred: ^bb9 %3 = aie.dma_start(MM2S, 2, ^bb8, ^bb5, repeat_count = 1) ^bb8: // 2 preds: ^bb7, ^bb8 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul56 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul56) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 128, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul57 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul57) aie.next_bd ^bb8 ^bb9: // pred: ^bb0 %4 = aie.dma_start(MM2S, 3, ^bb10, ^bb7, repeat_count = 1) ^bb10: // 2 preds: ^bb9, ^bb10 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul58 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul58) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 192, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul59 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul59) aie.next_bd ^bb10 } aie.shim_dma_allocation @airMemcpyId12 (%tile_0_0, S2MM, 0) diff --git a/test/npu-xrt/matrix_multiplication_using_cascade/aie_cascadex4.mlir b/test/npu-xrt/matrix_multiplication_using_cascade/aie_cascadex4.mlir index 9aad2047b85..ab49396ad60 100644 --- a/test/npu-xrt/matrix_multiplication_using_cascade/aie_cascadex4.mlir +++ b/test/npu-xrt/matrix_multiplication_using_cascade/aie_cascadex4.mlir @@ -69,18 +69,22 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf2 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_0_2_6, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_2, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf1 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_0_2_4, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, Release, %c1_ul3) aie.next_bd ^bb4 } %core_0_2 = aie.core(%tile_0_2) { @@ -92,8 +96,10 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, %c1_ul5) // func.call @event_0() : () -> () // @@ -110,8 +116,10 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_put_4x1x4_4x4x4_i32_i32(%buf2, %buf1, %buf0) : (memref<1x4x4x4xi32, 2 : i32>, memref<4x1x4x4xi32, 2 : i32>, memref<4x4x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_0_2_5, Release, 1) - aie.use_lock(%lock_0_2, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, Release, %c1_ul7) // func.call @flush_trace() : () -> () // @@ -120,18 +128,22 @@ module { %mem_1_2 = aie.mem(%tile_1_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_2_8, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_8, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buf5 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_1_2_9, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_9, Release, %c1_ul9) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_2, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%buf4 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_1_2_7, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_7, Release, %c1_ul11) aie.next_bd ^bb4 } %core_1_2 = aie.core(%tile_1_2) { @@ -143,8 +155,10 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_2_9, AcquireGreaterEqual, 1) - aie.use_lock(%lock_1_2_7, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_9, AcquireGreaterEqual, %c1_ul12) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_7, AcquireGreaterEqual, %c1_ul13) // func.call @event_0() : () -> () // @@ -161,8 +175,10 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_put_get_4x1x4_4x4x4_i32_i32(%buf5, %buf4, %buf3) : (memref<1x4x4x4xi32, 2 : i32>, memref<4x1x4x4xi32, 2 : i32>, memref<4x4x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_1_2_8, Release, 1) - aie.use_lock(%lock_1_2, Release, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_8, Release, %c1_ul14) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2, Release, %c1_ul15) // func.call @flush_trace() : () -> () // @@ -171,18 +187,22 @@ module { %mem_2_2 = aie.mem(%tile_2_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_2_11, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_11, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buf8 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_2_2_12, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_12, Release, %c1_ul17) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_2_2, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buf7 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_2_2_10, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_10, Release, %c1_ul19) aie.next_bd ^bb4 } %core_2_2 = aie.core(%tile_2_2) { @@ -194,8 +214,10 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_2_12, AcquireGreaterEqual, 1) - aie.use_lock(%lock_2_2_10, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_12, AcquireGreaterEqual, %c1_ul20) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_10, AcquireGreaterEqual, %c1_ul21) // func.call @event_0() : () -> () // @@ -212,8 +234,10 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_put_get_4x1x4_4x4x4_i32_i32(%buf8, %buf7, %buf6) : (memref<1x4x4x4xi32, 2 : i32>, memref<4x1x4x4xi32, 2 : i32>, memref<4x4x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_2_2_11, Release, 1) - aie.use_lock(%lock_2_2, Release, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_11, Release, %c1_ul22) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2, Release, %c1_ul23) // func.call @flush_trace() : () -> () // @@ -222,25 +246,31 @@ module { %mem_3_2 = aie.mem(%tile_3_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_3_2_14, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_14, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%buf11 : memref<1x4x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_3_2_15, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_15, Release, %c1_ul25) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_3_2, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%buf10 : memref<4x1x4x4xi32, 2 : i32>, 0, 64) - aie.use_lock(%lock_3_2_13, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_13, Release, %c1_ul27) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_3_2_17, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_17, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%buf9 : memref<4x4x4x4xi32, 2 : i32>, 0, 256, [, , ]) - aie.use_lock(%lock_3_2_16, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_16, Release, %c1_ul29) aie.next_bd ^bb6 } %core_3_2 = aie.core(%tile_3_2) { @@ -252,9 +282,12 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_3_2_16, AcquireGreaterEqual, 1) - aie.use_lock(%lock_3_2_15, AcquireGreaterEqual, 1) - aie.use_lock(%lock_3_2_13, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_16, AcquireGreaterEqual, %c1_ul30) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_15, AcquireGreaterEqual, %c1_ul31) + %c1_ul32 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_13, AcquireGreaterEqual, %c1_ul32) // func.call @event_0() : () -> () // @@ -271,9 +304,12 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_get_4x1x4_4x4x4_i32_i32(%buf11, %buf10, %buf9) : (memref<1x4x4x4xi32, 2 : i32>, memref<4x1x4x4xi32, 2 : i32>, memref<4x4x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_3_2_17, Release, 1) - aie.use_lock(%lock_3_2_14, Release, 1) - aie.use_lock(%lock_3_2, Release, 1) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_17, Release, %c1_ul33) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_14, Release, %c1_ul34) + %c1_ul35 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2, Release, %c1_ul35) // func.call @flush_trace() : () -> () // @@ -323,91 +359,115 @@ module { %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb13, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_1, AcquireGreaterEqual, 4) + %c4_ul36 = arith.constant 4 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c4_ul36) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_1, Release, 4) + %c4_ul37 = arith.constant 4 : i32 + aie.use_lock(%lock_0_1_1, Release, %c4_ul37) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, 1) + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul38) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_3, Release, 1) + %c1_ul39 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_3, Release, %c1_ul39) aie.next_bd ^bb4 ^bb5: // pred: ^bb5 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul40) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul41) aie.next_bd ^bb6 ^bb7: // pred: ^bb7 %3 = aie.dma_start(MM2S, 1, ^bb8, ^bb5, repeat_count = 1) ^bb8: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul42) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 4, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul43) aie.next_bd ^bb8 ^bb9: // pred: ^bb9 %4 = aie.dma_start(MM2S, 2, ^bb10, ^bb7, repeat_count = 1) ^bb10: // 2 preds: ^bb7, ^bb8 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul44 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul44) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 8, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul45) aie.next_bd ^bb10 ^bb11: // pred: ^bb0 %5 = aie.dma_start(MM2S, 3, ^bb12, ^bb9, repeat_count = 1) ^bb12: // 2 preds: ^bb9, ^bb10 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul46 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul46) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 12, 64, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul47 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul47) aie.next_bd ^bb12 ^bb13: // pred: ^bb0 %6 = aie.dma_start(MM2S, 4, ^bb14, ^bb11, repeat_count = 1) ^bb14: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_3, AcquireGreaterEqual, 1) + %c1_ul48 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_3, AcquireGreaterEqual, %c1_ul48) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_2, Release, 1) + %c1_ul49 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, Release, %c1_ul49) aie.next_bd ^bb14 } %memtile_dma_1_1 = aie.memtile_dma(%tile_1_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb9, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_1, AcquireGreaterEqual, 4) + %c4_ul50 = arith.constant 4 : i32 + aie.use_lock(%lock_1_1, AcquireGreaterEqual, %c4_ul50) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_1_1_0, Release, 4) + %c4_ul51 = arith.constant 4 : i32 + aie.use_lock(%lock_1_1_0, Release, %c4_ul51) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul52 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul52) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul53 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul53) aie.next_bd ^bb4 ^bb5: // pred: ^bb7 %2 = aie.dma_start(MM2S, 1, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul54 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul54) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 64, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul55 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul55) aie.next_bd ^bb6 ^bb7: // pred: ^bb9 %3 = aie.dma_start(MM2S, 2, ^bb8, ^bb5, repeat_count = 1) ^bb8: // 2 preds: ^bb7, ^bb8 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul56 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul56) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 128, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul57 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul57) aie.next_bd ^bb8 ^bb9: // pred: ^bb0 %4 = aie.dma_start(MM2S, 3, ^bb10, ^bb7, repeat_count = 1) ^bb10: // 2 preds: ^bb9, ^bb10 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul58 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul58) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 192, 64, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul59 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul59) aie.next_bd ^bb10 } aie.shim_dma_allocation @airMemcpyId12 (%tile_0_0, S2MM, 0) diff --git a/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx1.mlir b/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx1.mlir index c6cd82f636d..117bf4c6f0d 100644 --- a/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx1.mlir +++ b/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx1.mlir @@ -35,25 +35,31 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf2 : memref<2x4x4x8xi32, 2 : i32>, 0, 256) - aie.use_lock(%lock_0_2_5, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_2, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf1 : memref<4x2x8x4xi32, 2 : i32>, 0, 256) - aie.use_lock(%lock_0_2_3, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_3, Release, %c1_ul3) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_0_2_7, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_7, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf0 : memref<4x4x4x4xi32, 2 : i32>, 0, 256, [, , ]) - aie.use_lock(%lock_0_2_6, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, Release, %c1_ul5) aie.next_bd ^bb6 } %core_0_2 = aie.core(%tile_0_2) { @@ -65,9 +71,12 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_3, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, %c1_ul7) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_3, AcquireGreaterEqual, %c1_ul8) // func.call @event_0() : () -> () // @@ -84,9 +93,12 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_4x2x4_4x8x4_i32_i32(%buf2, %buf1, %buf0) : (memref<2x4x4x8xi32, 2 : i32>, memref<4x2x8x4xi32, 2 : i32>, memref<4x4x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_0_2_7, Release, 1) - aie.use_lock(%lock_0_2_4, Release, 1) - aie.use_lock(%lock_0_2, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_7, Release, %c1_ul9) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, Release, %c1_ul11) // func.call @flush_trace() : () -> () // @@ -111,52 +123,64 @@ module { %memtile_dma_2_1 = aie.memtile_dma(%tile_2_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buf3 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_2_1_2, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_2, Release, %c1_ul13) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_2_1_2, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_2, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buf3 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_2_1, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, Release, %c1_ul15) aie.next_bd ^bb4 } %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_1, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buf5 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_1, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, Release, %c1_ul17) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_1, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buf5 : memref<16x16xi32, 1 : i32>, 0, 256, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul19) aie.next_bd ^bb4 } %memtile_dma_1_1 = aie.memtile_dma(%tile_1_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_1, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%buf4 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_1_1_0, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, Release, %c1_ul21) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_0, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%buf4 : memref<16x16xi32, 1 : i32>, 0, 256, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul23) aie.next_bd ^bb4 } aie.shim_dma_allocation @airMemcpyId12 (%tile_0_0, S2MM, 0) diff --git a/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx4.mlir b/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx4.mlir index c0f89035b22..d965b0f4cb2 100644 --- a/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx4.mlir +++ b/test/npu-xrt/matrix_multiplication_using_cascade/aie_plainx4.mlir @@ -70,25 +70,31 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf11 : memref<2x2x4x8xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_0_2_6, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_2, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf10 : memref<2x2x8x4xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_0_2_4, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, Release, %c1_ul3) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_0_2_8, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_8, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf9 : memref<2x2x4x4xi32, 2 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_0_2_7, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_7, Release, %c1_ul5) aie.next_bd ^bb6 } %core_0_2 = aie.core(%tile_0_2) { @@ -100,9 +106,12 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_2_7, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, 1) - aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_7, AcquireGreaterEqual, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_6, AcquireGreaterEqual, %c1_ul7) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_4, AcquireGreaterEqual, %c1_ul8) // func.call @event_0() : () -> () // @@ -119,9 +128,12 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_2x2x2_4x8x4_i32_i32(%buf11, %buf10, %buf9) : (memref<2x2x4x8xi32, 2 : i32>, memref<2x2x8x4xi32, 2 : i32>, memref<2x2x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_0_2_8, Release, 1) - aie.use_lock(%lock_0_2_5, Release, 1) - aie.use_lock(%lock_0_2, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_8, Release, %c1_ul9) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2_5, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_0_2, Release, %c1_ul11) // func.call @flush_trace() : () -> () // @@ -130,25 +142,31 @@ module { %mem_1_2 = aie.mem(%tile_1_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_2_10, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_10, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buf8 : memref<2x2x4x8xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_1_2_11, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_11, Release, %c1_ul13) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_2, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buf7 : memref<2x2x8x4xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_1_2_9, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_9, Release, %c1_ul15) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_1_2_13, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_13, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buf6 : memref<2x2x4x4xi32, 2 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_1_2_12, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_12, Release, %c1_ul17) aie.next_bd ^bb6 } %core_1_2 = aie.core(%tile_1_2) { @@ -160,9 +178,12 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_2_12, AcquireGreaterEqual, 1) - aie.use_lock(%lock_1_2_11, AcquireGreaterEqual, 1) - aie.use_lock(%lock_1_2_9, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_12, AcquireGreaterEqual, %c1_ul18) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_11, AcquireGreaterEqual, %c1_ul19) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_9, AcquireGreaterEqual, %c1_ul20) // func.call @event_0() : () -> () // @@ -179,9 +200,12 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_2x2x2_4x8x4_i32_i32(%buf8, %buf7, %buf6) : (memref<2x2x4x8xi32, 2 : i32>, memref<2x2x8x4xi32, 2 : i32>, memref<2x2x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_1_2_13, Release, 1) - aie.use_lock(%lock_1_2_10, Release, 1) - aie.use_lock(%lock_1_2, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_13, Release, %c1_ul21) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2_10, Release, %c1_ul22) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%lock_1_2, Release, %c1_ul23) // func.call @flush_trace() : () -> () // @@ -190,25 +214,31 @@ module { %mem_2_2 = aie.mem(%tile_2_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_2_15, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_15, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%buf5 : memref<2x2x4x8xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_2_2_16, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_16, Release, %c1_ul25) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_2_2, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%buf4 : memref<2x2x8x4xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_2_2_14, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_14, Release, %c1_ul27) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_2_2_18, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_18, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%buf3 : memref<2x2x4x4xi32, 2 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_2_2_17, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_17, Release, %c1_ul29) aie.next_bd ^bb6 } %core_2_2 = aie.core(%tile_2_2) { @@ -220,9 +250,12 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_2_17, AcquireGreaterEqual, 1) - aie.use_lock(%lock_2_2_16, AcquireGreaterEqual, 1) - aie.use_lock(%lock_2_2_14, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_17, AcquireGreaterEqual, %c1_ul30) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_16, AcquireGreaterEqual, %c1_ul31) + %c1_ul32 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_14, AcquireGreaterEqual, %c1_ul32) // func.call @event_0() : () -> () // @@ -239,9 +272,12 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_2x2x2_4x8x4_i32_i32(%buf5, %buf4, %buf3) : (memref<2x2x4x8xi32, 2 : i32>, memref<2x2x8x4xi32, 2 : i32>, memref<2x2x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_2_2_18, Release, 1) - aie.use_lock(%lock_2_2_15, Release, 1) - aie.use_lock(%lock_2_2, Release, 1) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_18, Release, %c1_ul33) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2_15, Release, %c1_ul34) + %c1_ul35 = arith.constant 1 : i32 + aie.use_lock(%lock_2_2, Release, %c1_ul35) // func.call @flush_trace() : () -> () // @@ -250,25 +286,31 @@ module { %mem_3_2 = aie.mem(%tile_3_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_3_2_20, AcquireGreaterEqual, 1) + %c1_ul36 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_20, AcquireGreaterEqual, %c1_ul36) aie.dma_bd(%buf2 : memref<2x2x4x8xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_3_2_21, Release, 1) + %c1_ul37 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_21, Release, %c1_ul37) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_3_2, AcquireGreaterEqual, 1) + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2, AcquireGreaterEqual, %c1_ul38) aie.dma_bd(%buf1 : memref<2x2x8x4xi32, 2 : i32>, 0, 128) - aie.use_lock(%lock_3_2_19, Release, 1) + %c1_ul39 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_19, Release, %c1_ul39) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_3_2_23, AcquireGreaterEqual, 1) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_23, AcquireGreaterEqual, %c1_ul40) aie.dma_bd(%buf0 : memref<2x2x4x4xi32, 2 : i32>, 0, 64, [, , ]) - aie.use_lock(%lock_3_2_22, Release, 1) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_22, Release, %c1_ul41) aie.next_bd ^bb6 } %core_3_2 = aie.core(%tile_3_2) { @@ -280,9 +322,12 @@ module { %c0 = arith.constant 0 : index cf.br ^bb1 ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_3_2_22, AcquireGreaterEqual, 1) - aie.use_lock(%lock_3_2_21, AcquireGreaterEqual, 1) - aie.use_lock(%lock_3_2_19, AcquireGreaterEqual, 1) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_22, AcquireGreaterEqual, %c1_ul42) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_21, AcquireGreaterEqual, %c1_ul43) + %c1_ul44 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_19, AcquireGreaterEqual, %c1_ul44) // func.call @event_0() : () -> () // @@ -299,9 +344,12 @@ module { func.call @event_1() : () -> () // func.call @matmul_scalar_2x2x2_4x8x4_i32_i32(%buf2, %buf1, %buf0) : (memref<2x2x4x8xi32, 2 : i32>, memref<2x2x8x4xi32, 2 : i32>, memref<2x2x4x4xi32, 2 : i32>) -> () - aie.use_lock(%lock_3_2_23, Release, 1) - aie.use_lock(%lock_3_2_20, Release, 1) - aie.use_lock(%lock_3_2, Release, 1) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_23, Release, %c1_ul45) + %c1_ul46 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2_20, Release, %c1_ul46) + %c1_ul47 = arith.constant 1 : i32 + aie.use_lock(%lock_3_2, Release, %c1_ul47) // func.call @flush_trace() : () -> () // @@ -355,88 +403,110 @@ module { %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_0_1, AcquireGreaterEqual, 2) + %c2_ul48 = arith.constant 2 : i32 + aie.use_lock(%lock_0_1, AcquireGreaterEqual, %c2_ul48) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_0_1_2, Release, 2) + %c2_ul49 = arith.constant 2 : i32 + aie.use_lock(%lock_0_1_2, Release, %c2_ul49) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, 1) + %c1_ul50 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul50) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 0, 128, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul51 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul51) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 1, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, 1) + %c1_ul52 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1_2, AcquireGreaterEqual, %c1_ul52) aie.dma_bd(%buf14 : memref<16x16xi32, 1 : i32>, 128, 128, [, , ]) - aie.use_lock(%lock_0_1, Release, 1) + %c1_ul53 = arith.constant 1 : i32 + aie.use_lock(%lock_0_1, Release, %c1_ul53) aie.next_bd ^bb6 } %memtile_dma_1_1 = aie.memtile_dma(%tile_1_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_1_1, AcquireGreaterEqual, 2) + %c2_ul54 = arith.constant 2 : i32 + aie.use_lock(%lock_1_1, AcquireGreaterEqual, %c2_ul54) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_1_1_1, Release, 2) + %c2_ul55 = arith.constant 2 : i32 + aie.use_lock(%lock_1_1_1, Release, %c2_ul55) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_1_1_1, AcquireGreaterEqual, 1) + %c1_ul56 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_1, AcquireGreaterEqual, %c1_ul56) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 0, 128, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul57 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul57) aie.next_bd ^bb4 ^bb5: // pred: ^bb0 %2 = aie.dma_start(MM2S, 1, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_1_1_1, AcquireGreaterEqual, 1) + %c1_ul58 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1_1, AcquireGreaterEqual, %c1_ul58) aie.dma_bd(%buf13 : memref<16x16xi32, 1 : i32>, 8, 128, [, , ]) - aie.use_lock(%lock_1_1, Release, 1) + %c1_ul59 = arith.constant 1 : i32 + aie.use_lock(%lock_1_1, Release, %c1_ul59) aie.next_bd ^bb6 } %memtile_dma_2_1 = aie.memtile_dma(%tile_2_1) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb9, repeat_count = 1) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul60 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul60) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 0, 64, [, ]) - aie.use_lock(%lock_2_1_0, Release, 1) + %c1_ul61 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, Release, %c1_ul61) aie.next_bd ^bb1 ^bb2: // pred: ^bb3 aie.end ^bb3: // pred: ^bb5 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1) ^bb4: // 2 preds: ^bb3, ^bb4 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul62 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul62) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 8, 64, [, ]) - aie.use_lock(%lock_2_1_0, Release, 1) + %c1_ul63 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, Release, %c1_ul63) aie.next_bd ^bb4 ^bb5: // pred: ^bb7 %2 = aie.dma_start(S2MM, 2, ^bb6, ^bb3, repeat_count = 1) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul64 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul64) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 128, 64, [, ]) - aie.use_lock(%lock_2_1_0, Release, 1) + %c1_ul65 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, Release, %c1_ul65) aie.next_bd ^bb6 ^bb7: // pred: ^bb9 %3 = aie.dma_start(S2MM, 3, ^bb8, ^bb5, repeat_count = 1) ^bb8: // 2 preds: ^bb7, ^bb8 - aie.use_lock(%lock_2_1, AcquireGreaterEqual, 1) + %c1_ul66 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1, AcquireGreaterEqual, %c1_ul66) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 136, 64, [, ]) - aie.use_lock(%lock_2_1_0, Release, 1) + %c1_ul67 = arith.constant 1 : i32 + aie.use_lock(%lock_2_1_0, Release, %c1_ul67) aie.next_bd ^bb8 ^bb9: // pred: ^bb0 %4 = aie.dma_start(MM2S, 0, ^bb10, ^bb7, repeat_count = 1) ^bb10: // 2 preds: ^bb9, ^bb10 - aie.use_lock(%lock_2_1_0, AcquireGreaterEqual, 4) + %c4_ul68 = arith.constant 4 : i32 + aie.use_lock(%lock_2_1_0, AcquireGreaterEqual, %c4_ul68) aie.dma_bd(%buf12 : memref<16x16xi32, 1 : i32>, 0, 256) - aie.use_lock(%lock_2_1, Release, 4) + %c4_ul69 = arith.constant 4 : i32 + aie.use_lock(%lock_2_1, Release, %c4_ul69) aie.next_bd ^bb10 } aie.shim_dma_allocation @airMemcpyId12 (%tile_0_0, S2MM, 0) diff --git a/test/npu-xrt/memtile_dmas/dma_configure_task_lock/aie.mlir b/test/npu-xrt/memtile_dmas/dma_configure_task_lock/aie.mlir index fb3c30584f1..06a11929504 100644 --- a/test/npu-xrt/memtile_dmas/dma_configure_task_lock/aie.mlir +++ b/test/npu-xrt/memtile_dmas/dma_configure_task_lock/aie.mlir @@ -29,24 +29,32 @@ module { // Configure memtile DMA to receive from shim %t1 = aiex.dma_configure_task(%tile_0_1, S2MM, 0) { - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%out_buff : memref<4096xi32>, 1024, 1024) {bd_id = 0 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul1) aie.next_bd ^bb1 ^bb1: - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%out_buff : memref<4096xi32>, 3072, 1024) {bd_id = 1 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul3) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%out_buff : memref<4096xi32>, 0, 1024) {bd_id = 2 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul5) aie.next_bd ^bb3 ^bb3: - aie.use_lock(%prod_lock, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%prod_lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%out_buff : memref<4096xi32>, 2048, 1024) {bd_id = 3 : i32} - aie.use_lock(%cons_lock, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%cons_lock, Release, %c1_ul7) aie.end } @@ -55,9 +63,11 @@ module { // Configure memtile DMA to send data to shim %t2 = aiex.dma_configure_task(%tile_0_1, MM2S, 0) { - aie.use_lock(%cons_lock, AcquireGreaterEqual, 4) + %c4_ul8 = arith.constant 4 : i32 + aie.use_lock(%cons_lock, AcquireGreaterEqual, %c4_ul8) aie.dma_bd(%out_buff : memref<4096xi32>, 0, 4096) {bd_id = 4 : i32} - aie.use_lock(%prod_lock, Release, 4) + %c4_ul9 = arith.constant 4 : i32 + aie.use_lock(%prod_lock, Release, %c4_ul9) aie.end } diff --git a/test/npu-xrt/multi_source_packet_flow/aie.mlir b/test/npu-xrt/multi_source_packet_flow/aie.mlir index dde4127dc23..a1e47b4d8d2 100644 --- a/test/npu-xrt/multi_source_packet_flow/aie.mlir +++ b/test/npu-xrt/multi_source_packet_flow/aie.mlir @@ -61,13 +61,15 @@ module { %c1 = arith.constant 1 : index %c8 = arith.constant 8 : index %c1_i32 = arith.constant 1 : i32 - aie.use_lock(%prod_lock_2, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%prod_lock_2, AcquireGreaterEqual, %c1_ul0) scf.for %i = %c0 to %c8 step %c1 { %i_i32 = arith.index_cast %i : index to i32 %val = arith.addi %i_i32, %c1_i32 : i32 memref.store %val, %buf_2[%i] : memref<8xi32> } - aie.use_lock(%cons_lock_2, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%cons_lock_2, Release, %c1_ul1) aie.end } @@ -77,13 +79,15 @@ module { %c1 = arith.constant 1 : index %c8 = arith.constant 8 : index %c101_i32 = arith.constant 101 : i32 - aie.use_lock(%prod_lock_3, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%prod_lock_3, AcquireGreaterEqual, %c1_ul2) scf.for %i = %c0 to %c8 step %c1 { %i_i32 = arith.index_cast %i : index to i32 %val = arith.addi %i_i32, %c101_i32 : i32 memref.store %val, %buf_3[%i] : memref<8xi32> } - aie.use_lock(%cons_lock_3, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%cons_lock_3, Release, %c1_ul3) aie.end } @@ -93,9 +97,11 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%cons_lock_2, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%cons_lock_2, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf_2 : memref<8xi32>, 0, 8) {packet = #aie.packet_info} - aie.use_lock(%prod_lock_2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%prod_lock_2, Release, %c1_ul5) aie.next_bd ^bd0 ^end: aie.end @@ -105,9 +111,11 @@ module { %mem_0_3 = aie.mem(%tile_0_3) { %0 = aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%cons_lock_3, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%cons_lock_3, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf_3 : memref<8xi32>, 0, 8) {packet = #aie.packet_info} - aie.use_lock(%prod_lock_3, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%prod_lock_3, Release, %c1_ul7) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/npu-xrt/packet_flow/aie.mlir b/test/npu-xrt/packet_flow/aie.mlir index b7e80d2bb85..b9f0f4e905b 100644 --- a/test/npu-xrt/packet_flow/aie.mlir +++ b/test/npu-xrt/packet_flow/aie.mlir @@ -46,8 +46,10 @@ module { %c12_i8 = arith.constant 12 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -55,8 +57,10 @@ module { memref.store %1, %objFifo_out1_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) aie.end } @@ -83,24 +87,32 @@ module { %objFifo_out0_prod_lock = aie.lock(%tile_0_1, 2) {init = 1 : i32, sym_name = "objFifo_out0_prod_lock"} %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul5) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul7) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul9) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul11) }] aie.end } @@ -109,14 +121,18 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul13) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_out1_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul15) }] aie.end } diff --git a/test/npu-xrt/packet_flow_fanin/aie.mlir b/test/npu-xrt/packet_flow_fanin/aie.mlir index f1788ec02d0..4362c677fd0 100644 --- a/test/npu-xrt/packet_flow_fanin/aie.mlir +++ b/test/npu-xrt/packet_flow_fanin/aie.mlir @@ -57,8 +57,10 @@ module { %c12_i8 = arith.constant 12 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%objFifo_core02_prod_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_core02_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_prod_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_cons_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_core02_cons_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -66,10 +68,14 @@ module { memref.store %1, %objFifo_core02_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_core02_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_core02_cons_lock, Release, 1) - aie.use_lock(%objFifo_core02_prod_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_core02_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_lock, Release, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_prod_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_cons_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_core02_cons_buff_1[%arg1, %arg2] : memref<64x64xi8> @@ -77,8 +83,10 @@ module { memref.store %1, %objFifo_core02_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_core02_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_core02_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_lock, Release, %c1_ul7) aie.end } @@ -108,35 +116,47 @@ module { %objFifo_in1_cons_prod_lock = aie.lock(%tile_0_1, 4) {init = 1 : i32, sym_name = "objFifo_in1_cons_prod_lock"} %objFifo_in1_cons_cons_lock = aie.lock(%tile_0_1, 5) {init = 0 : i32, sym_name = "objFifo_in1_cons_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul9) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul11) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul13) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul15) }] %4 = aie.dma(S2MM, 2) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul17) }] %5 = aie.dma(MM2S, 2) [{ - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul19) }] aie.end } @@ -145,18 +165,24 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_core02_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_prod_lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%objFifo_core02_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_core02_cons_cons_lock, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_cons_lock, Release, %c1_ul21) }, { - aie.use_lock(%objFifo_core02_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_prod_lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%objFifo_core02_cons_buff_1 : memref<64x64xi8>) - aie.use_lock(%objFifo_core02_cons_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_cons_lock, Release, %c1_ul23) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_core02_cons_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%objFifo_core02_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_core02_prod_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_prod_lock, Release, %c1_ul25) }] aie.end } diff --git a/test/npu-xrt/packet_flow_fanout/aie.mlir b/test/npu-xrt/packet_flow_fanout/aie.mlir index 50f303206b3..7edff54dbba 100644 --- a/test/npu-xrt/packet_flow_fanout/aie.mlir +++ b/test/npu-xrt/packet_flow_fanout/aie.mlir @@ -74,8 +74,10 @@ module { %c12_i8 = arith.constant 12 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%objFifo_core02_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_core02_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_core02_cons_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -83,8 +85,10 @@ module { memref.store %1, %objFifo_core02_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_core02_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_core02_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_lock, Release, %c1_ul3) aie.end } @@ -95,8 +99,10 @@ module { %c7_i8 = arith.constant 7 : i8 %c2 = arith.constant 2 : index %c64 = arith.constant 64 : index - aie.use_lock(%objFifo_core03_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_core03_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c64 step %c1 { scf.for %arg2 = %c0 to %c64 step %c1 { %0 = memref.load %objFifo_core03_cons_buff_0[%arg1, %arg2] : memref<64x64xi8> @@ -104,8 +110,10 @@ module { memref.store %1, %objFifo_core03_buff_0[%arg1, %arg2] : memref<64x64xi8> } } - aie.use_lock(%objFifo_core03_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_core03_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_cons_lock, Release, %c1_ul7) aie.end } @@ -143,45 +151,61 @@ module { %objFifo_out1_prod_lock = aie.lock(%tile_0_1, 6) {init = 1 : i32, sym_name = "objFifo_out1_prod_lock"} %objFifo_out1_cons_lock = aie.lock(%tile_0_1, 7) {init = 0 : i32, sym_name = "objFifo_out1_cons_lock"} %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul9) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul11) }] %2 = aie.dma(MM2S, 1) [{ - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul13) }] %3 = aie.dma(S2MM, 1) [{ - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_out0_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul15) }] %4 = aie.dma(S2MM, 2) [{ - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul17) }] %5 = aie.dma(MM2S, 2) [{ - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul19) }] %6 = aie.dma(MM2S, 3) [{ - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%objFifo_out1_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul21) }] %7 = aie.dma(S2MM, 3) [{ - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%objFifo_out1_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul23) }] aie.end } @@ -191,28 +215,36 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_core02_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%objFifo_core02_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_core02_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_cons_lock, Release, %c1_ul25) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_core02_cons_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_cons_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%objFifo_core02_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_core02_prod_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core02_prod_lock, Release, %c1_ul27) }] aie.end } %mem_0_3 = aie.mem(%tile_0_3) { %0 = aie.dma(S2MM, 0) [{ - aie.use_lock(%objFifo_core03_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_cons_prod_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%objFifo_core03_cons_buff_0 : memref<64x64xi8>) - aie.use_lock(%objFifo_core03_cons_cons_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_cons_cons_lock, Release, %c1_ul29) }] %1 = aie.dma(MM2S, 0) [{ - aie.use_lock(%objFifo_core03_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%objFifo_core03_buff_0 : memref<64x64xi8>) {packet = #aie.packet_info} - aie.use_lock(%objFifo_core03_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%objFifo_core03_prod_lock, Release, %c1_ul31) }] aie.end } diff --git a/test/npu-xrt/reconfigure_loadpdi_persistent_memtile/aie.mlir b/test/npu-xrt/reconfigure_loadpdi_persistent_memtile/aie.mlir index c70ca7c5c4a..1787cab333e 100644 --- a/test/npu-xrt/reconfigure_loadpdi_persistent_memtile/aie.mlir +++ b/test/npu-xrt/reconfigure_loadpdi_persistent_memtile/aie.mlir @@ -56,16 +56,20 @@ module { %t12_dma = aie.mem(%t12) { %dma1 = aie.dma_start(S2MM, 0, ^dma1_bd0, ^dma2) ^dma1_bd0: - aie.use_lock(%t12_lock_input_produce, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_produce, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%t12_buf_inp : memref<4xi32>, 0, 4, []) - aie.use_lock(%t12_lock_input_consume, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_consume, Release, %c1_ul1) aie.next_bd ^dma1_bd0 ^dma2: %dma2 = aie.dma_start("MM2S", 0, ^dma2_bd0, ^end) ^dma2_bd0: - aie.use_lock(%t12_lock_output_consume, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_consume, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%t12_buf_out : memref<4xi32>, 0, 4, []) - aie.use_lock(%t12_lock_output_produce, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_produce, Release, %c1_ul3) aie.next_bd ^dma2_bd0 ^end: aie.end @@ -84,11 +88,15 @@ module { %c_intmax = arith.constant 0xFFFFFE : index scf.for %niter = %c0 to %c_intmax step %c1 { - aie.use_lock(%t12_lock_input_consume, AcquireGreaterEqual, 1) - aie.use_lock(%t12_lock_output_produce, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_consume, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_produce, AcquireGreaterEqual, %c1_ul5) memref.copy %t12_buf_inp, %t12_buf_out : memref<4xi32> to memref<4xi32> - aie.use_lock(%t12_lock_input_produce, Release, 1) - aie.use_lock(%t12_lock_output_consume, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_produce, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_consume, Release, %c1_ul7) } aie.end } @@ -133,16 +141,20 @@ module { %t12_dma = aie.mem(%t12) { %dma1 = aie.dma_start(S2MM, 0, ^dma1_bd0, ^dma2) ^dma1_bd0: - aie.use_lock(%t12_lock_input_produce, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_produce, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%t12_buf_inp : memref<4xi32>, 0, 4, []) - aie.use_lock(%t12_lock_input_consume, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_consume, Release, %c1_ul9) aie.next_bd ^dma1_bd0 ^dma2: %dma2 = aie.dma_start("MM2S", 0, ^dma2_bd0, ^end) ^dma2_bd0: - aie.use_lock(%t12_lock_output_consume, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_consume, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%t12_buf_out : memref<4xi32>, 0, 4, []) - aie.use_lock(%t12_lock_output_produce, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_produce, Release, %c1_ul11) aie.next_bd ^dma2_bd0 ^end: aie.end @@ -161,11 +173,15 @@ module { %c_intmax = arith.constant 0xFFFFFE : index scf.for %niter = %c0 to %c_intmax step %c1 { - aie.use_lock(%t12_lock_input_consume, AcquireGreaterEqual, 1) - aie.use_lock(%t12_lock_output_produce, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_consume, AcquireGreaterEqual, %c1_ul12) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_produce, AcquireGreaterEqual, %c1_ul13) memref.copy %t12_buf_inp, %t12_buf_out : memref<4xi32> to memref<4xi32> - aie.use_lock(%t12_lock_input_produce, Release, 1) - aie.use_lock(%t12_lock_output_consume, Release, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_input_produce, Release, %c1_ul14) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%t12_lock_output_consume, Release, %c1_ul15) } aie.end } diff --git a/test/npu-xrt/scratchpad_regwrite/aie.mlir b/test/npu-xrt/scratchpad_regwrite/aie.mlir index 77f30112d77..c423a1904ef 100644 --- a/test/npu-xrt/scratchpad_regwrite/aie.mlir +++ b/test/npu-xrt/scratchpad_regwrite/aie.mlir @@ -45,13 +45,15 @@ module { %c2_i32 = arith.constant 2 : i32 // Block until run-time parameters are ready - aie.use_lock(%sync_lock, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%sync_lock, Acquire, %c1_ul0) // Read the parameter written by UPDATE_REG %raw_val = memref.load %params_buf[%c0] : memref<2xi32> // Reset run-time parameter lock for next iteration - aie.use_lock(%sync_lock, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%sync_lock, Release, %c0_ul1) // Undo the left-shift-by-2 that was applied to survive the 0xFFFFFFFC masking in the firmware %val = arith.shrui %raw_val, %c2_i32 : i32 diff --git a/test/npu-xrt/shim_dma_bd_reuse/aie.mlir b/test/npu-xrt/shim_dma_bd_reuse/aie.mlir index 5ec80d8208c..c3cb5b359e7 100644 --- a/test/npu-xrt/shim_dma_bd_reuse/aie.mlir +++ b/test/npu-xrt/shim_dma_bd_reuse/aie.mlir @@ -41,16 +41,20 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^s2mm, ^mm2s_entry) ^s2mm: - aie.use_lock(%lock_in, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_in, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%core_buf : memref<256xi32>, 0, 256) - aie.use_lock(%lock_out, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_out, Release, %c1_ul1) aie.next_bd ^s2mm ^mm2s_entry: %1 = aie.dma_start(MM2S, 0, ^mm2s, ^end) ^mm2s: - aie.use_lock(%lock_out, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_out, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%core_buf : memref<256xi32>, 0, 256) - aie.use_lock(%lock_in, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_in, Release, %c1_ul3) aie.next_bd ^mm2s ^end: aie.end diff --git a/test/npu-xrt/static_L1_init/aie.mlir b/test/npu-xrt/static_L1_init/aie.mlir index 95ddea6bdb5..3d4c439db84 100644 --- a/test/npu-xrt/static_L1_init/aie.mlir +++ b/test/npu-xrt/static_L1_init/aie.mlir @@ -32,8 +32,10 @@ module { %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c9223372036854775806 step %c2 { scf.for %arg1 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg2 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg2] : memref<16xi32> %2 = arith.muli %arg1, %c16 : index @@ -42,11 +44,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg2] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul3) %0 = arith.addi %arg1, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg2 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg2] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -62,12 +68,16 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul7) } scf.for %arg1 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul8) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul9) scf.for %arg2 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg2] : memref<16xi32> %2 = arith.muli %arg1, %c16 : index @@ -76,11 +86,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg2] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul11) %0 = arith.addi %arg1, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul12) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul13) scf.for %arg2 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg2] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -96,13 +110,17 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul14) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul15) } } scf.for %arg0 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul16) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul17) scf.for %arg1 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg1] : memref<16xi32> %2 = arith.muli %arg0, %c16 : index @@ -111,11 +129,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg1] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul18) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul19) %0 = arith.addi %arg0, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul20) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul21) scf.for %arg1 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg1] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -131,8 +153,10 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul22) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul23) } aie.end } @@ -145,26 +169,34 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%in1_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%in1_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, Release, %c1_ul25) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%in1_cons_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%in1_cons_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, Release, %c1_ul27) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb7, ^bb9) ^bb7: // 2 preds: ^bb6, ^bb8 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%out_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul29) aie.next_bd ^bb8 ^bb8: // pred: ^bb7 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%out_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul31) aie.next_bd ^bb7 ^bb9: // pred: ^bb6 aie.end diff --git a/test/npu-xrt/vec_vec_add_memtile_init/aie.mlir b/test/npu-xrt/vec_vec_add_memtile_init/aie.mlir index 692bc984acb..82eff2893da 100644 --- a/test/npu-xrt/vec_vec_add_memtile_init/aie.mlir +++ b/test/npu-xrt/vec_vec_add_memtile_init/aie.mlir @@ -36,10 +36,13 @@ module { %c9223372036854775806 = arith.constant 9223372036854775806 : index %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c9223372036854775806 step %c2 { - aie.use_lock(%in2_mem_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) scf.for %arg1 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul2) scf.for %arg2 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg2] : memref<16xi32> %2 = arith.muli %arg1, %c16 : index @@ -48,11 +51,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg2] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul4) %0 = arith.addi %arg1, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul5) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul6) scf.for %arg2 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg2] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -68,14 +75,20 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul7) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul8) } - aie.use_lock(%in2_mem_cons_prod_lock, Release, 1) - aie.use_lock(%in2_mem_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_prod_lock, Release, %c1_ul9) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_cons_lock, AcquireGreaterEqual, %c1_ul10) scf.for %arg1 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul11) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul12) scf.for %arg2 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg2] : memref<16xi32> %2 = arith.muli %arg1, %c16 : index @@ -84,11 +97,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg2] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul13) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul14) %0 = arith.addi %arg1, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul15) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul16) scf.for %arg2 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg2] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -104,15 +121,21 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul17) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul18) } - aie.use_lock(%in2_mem_cons_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_prod_lock, Release, %c1_ul19) } - aie.use_lock(%in2_mem_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_cons_lock, AcquireGreaterEqual, %c1_ul20) scf.for %arg0 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul21) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul22) scf.for %arg1 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg1] : memref<16xi32> %2 = arith.muli %arg0, %c16 : index @@ -121,11 +144,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg1] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul23) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul24) %0 = arith.addi %arg0, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul25) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul26) scf.for %arg1 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg1] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -141,10 +168,13 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul27) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul28) } - aie.use_lock(%in2_mem_cons_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_prod_lock, Release, %c1_ul29) aie.end } aie.shim_dma_allocation @in1 (%tile_0_0, MM2S, 0) @@ -156,38 +186,50 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%in1_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%in1_cons_cons_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, Release, %c1_ul31) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul32 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul32) aie.dma_bd(%in1_cons_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%in1_cons_cons_lock, Release, 1) + %c1_ul33 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, Release, %c1_ul33) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb6) ^bb4: // 2 preds: ^bb3, ^bb5 - aie.use_lock(%in2_mem_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul34 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_prod_lock, AcquireGreaterEqual, %c1_ul34) aie.dma_bd(%in2_mem_cons_buff_0 : memref<256xi32>, 0, 256) - aie.use_lock(%in2_mem_cons_cons_lock, Release, 1) + %c1_ul35 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_cons_lock, Release, %c1_ul35) aie.next_bd ^bb5 ^bb5: // pred: ^bb4 - aie.use_lock(%in2_mem_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul36 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_prod_lock, AcquireGreaterEqual, %c1_ul36) aie.dma_bd(%in2_mem_cons_buff_1 : memref<256xi32>, 0, 256) - aie.use_lock(%in2_mem_cons_cons_lock, Release, 1) + %c1_ul37 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_cons_lock, Release, %c1_ul37) aie.next_bd ^bb4 ^bb6: // pred: ^bb3 %2 = aie.dma_start(MM2S, 0, ^bb7, ^bb9) ^bb7: // 2 preds: ^bb6, ^bb8 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul38 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul38) aie.dma_bd(%out_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul39 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul39) aie.next_bd ^bb8 ^bb8: // pred: ^bb7 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul40 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul40) aie.dma_bd(%out_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul41 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul41) aie.next_bd ^bb7 ^bb9: // pred: ^bb6 aie.end @@ -196,14 +238,18 @@ module { %memtile_dma_0_1 = aie.memtile_dma(%tile_0_1) { %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) ^bb1: - aie.use_lock(%in2_mem_cons_lock, AcquireGreaterEqual, 1) + %c1_ul42 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_lock, AcquireGreaterEqual, %c1_ul42) aie.dma_bd(%in2_mem_buff_0 : memref<256xi32>, 0, 256) - aie.use_lock(%in2_mem_prod_lock, Release, 1) + %c1_ul43 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_prod_lock, Release, %c1_ul43) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%in2_mem_cons_lock, AcquireGreaterEqual, 1) + %c1_ul44 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_cons_lock, AcquireGreaterEqual, %c1_ul44) aie.dma_bd(%in2_mem_buff_1 : memref<256xi32>, 0, 256) - aie.use_lock(%in2_mem_prod_lock, Release, 1) + %c1_ul45 = arith.constant 1 : i32 + aie.use_lock(%in2_mem_prod_lock, Release, %c1_ul45) aie.next_bd ^bb1 ^bb3: aie.end diff --git a/test/npu-xrt/vec_vec_add_tile_init/aie.mlir b/test/npu-xrt/vec_vec_add_tile_init/aie.mlir index 80c588bb8b5..c431ddfc1d1 100644 --- a/test/npu-xrt/vec_vec_add_tile_init/aie.mlir +++ b/test/npu-xrt/vec_vec_add_tile_init/aie.mlir @@ -28,8 +28,10 @@ module { %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c9223372036854775806 step %c2 { scf.for %arg1 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg2 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg2] : memref<16xi32> %2 = arith.muli %arg1, %c16 : index @@ -38,11 +40,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg2] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul3) %0 = arith.addi %arg1, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg2 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg2] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -58,12 +64,16 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul7) } scf.for %arg1 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul8) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul9) scf.for %arg2 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg2] : memref<16xi32> %2 = arith.muli %arg1, %c16 : index @@ -72,11 +82,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg2] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul11) %0 = arith.addi %arg1, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul12) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul13) scf.for %arg2 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg2] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -92,13 +106,17 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul14) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul15) } } scf.for %arg0 = %c0 to %c16 step %c2 { - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul16) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul17) scf.for %arg1 = %c0 to %c16 step %c1 { %1 = memref.load %in1_cons_buff_0[%arg1] : memref<16xi32> %2 = arith.muli %arg0, %c16 : index @@ -107,11 +125,15 @@ module { %5 = arith.addi %1, %4 : i32 memref.store %5, %out_buff_0[%arg1] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul18) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul19) %0 = arith.addi %arg0, %c1 : index - aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul20) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul21) scf.for %arg1 = %c0 to %c16 step %c2 { %1 = memref.load %in1_cons_buff_1[%arg1] : memref<16xi32> %2 = arith.muli %0, %c16 : index @@ -127,8 +149,10 @@ module { %11 = arith.addi %7, %10 : i32 memref.store %11, %out_buff_1[%6] : memref<16xi32> } - aie.use_lock(%in1_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, Release, %c1_ul22) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul23) } aie.end } @@ -141,26 +165,34 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%in1_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%in1_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, Release, %c1_ul25) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%in1_cons_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%in1_cons_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%in1_cons_cons_lock, Release, %c1_ul27) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %2 = aie.dma_start(MM2S, 0, ^bb7, ^bb9) ^bb7: // 2 preds: ^bb6, ^bb8 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%out_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul29) aie.next_bd ^bb8 ^bb8: // pred: ^bb7 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%out_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul31) aie.next_bd ^bb7 ^bb9: // pred: ^bb6 aie.end diff --git a/test/npu-xrt/vector_scalar_using_dma/aie.mlir b/test/npu-xrt/vector_scalar_using_dma/aie.mlir index 9787fabc34b..c9658cddc25 100644 --- a/test/npu-xrt/vector_scalar_using_dma/aie.mlir +++ b/test/npu-xrt/vector_scalar_using_dma/aie.mlir @@ -39,17 +39,25 @@ module { scf.for %arg0 = %c0 to %c9223372036854775807 step %c1 { scf.for %arg1 = %c0 to %c4 step %c2 { - aie.use_lock(%in_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%in_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul1) func.call @scale_int32(%in_cons_buff_0, %out_buff_0) : (memref<1024xi32>, memref<1024xi32>) -> () - aie.use_lock(%in_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%in_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul3) - aie.use_lock(%out_prod_lock, AcquireGreaterEqual, 1) - aie.use_lock(%in_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%in_cons_cons_lock, AcquireGreaterEqual, %c1_ul5) func.call @scale_int32(%in_cons_buff_1, %out_buff_1) : (memref<1024xi32>, memref<1024xi32>) -> () - aie.use_lock(%in_cons_prod_lock, Release, 1) - aie.use_lock(%out_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%in_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, Release, %c1_ul7) } } aie.end @@ -71,26 +79,34 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%in_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%in_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%in_cons_buff_0 : memref<1024xi32>, 0, 1024) - aie.use_lock(%in_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%in_cons_cons_lock, Release, %c1_ul9) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%in_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%in_cons_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%in_cons_buff_1 : memref<1024xi32>, 0, 1024) - aie.use_lock(%in_cons_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%in_cons_cons_lock, Release, %c1_ul11) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) ^bb4: // 2 preds: ^bb3, ^bb5 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%out_buff_0 : memref<1024xi32>, 0, 1024) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul13) aie.next_bd ^bb5 ^bb5: // pred: ^bb4 - aie.use_lock(%out_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%out_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%out_buff_1 : memref<1024xi32>, 0, 1024) - aie.use_lock(%out_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%out_prod_lock, Release, %c1_ul15) aie.next_bd ^bb4 ^bb6: // pred: ^bb3 aie.end diff --git a/test/npu-xrt/xrt_handle_lifetime/aie.mlir b/test/npu-xrt/xrt_handle_lifetime/aie.mlir index 5d4d5cc5e84..f14d0b3d677 100644 --- a/test/npu-xrt/xrt_handle_lifetime/aie.mlir +++ b/test/npu-xrt/xrt_handle_lifetime/aie.mlir @@ -34,8 +34,10 @@ module { %c1_i32 = arith.constant 1 : i32 %c2 = arith.constant 2 : index scf.for %arg0 = %c0 to %c8 step %c2 { - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul1) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_0[%arg1] : memref<8xi32> @@ -43,11 +45,15 @@ module { memref.store %1, %objFifo_out1_buff_0[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul3) - aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, 1) - aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, AcquireGreaterEqual, %c1_ul4) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, AcquireGreaterEqual, %c1_ul5) scf.for %arg1 = %c0 to %c8 step %c1 { %0 = memref.load %objFifo_in1_cons_buff_1[%arg1] : memref<8xi32> @@ -55,8 +61,10 @@ module { memref.store %1, %objFifo_out1_buff_1[%arg1] : memref<8xi32> } - aie.use_lock(%objFifo_in1_cons_prod_lock, Release, 1) - aie.use_lock(%objFifo_out1_cons_lock, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, Release, %c1_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, Release, %c1_ul7) } aie.end } @@ -84,50 +92,66 @@ module { %objFifo_out0_cons_lock = aie.lock(%tile_0_1, 3) {init = 0 : i32, sym_name = "objFifo_out0_cons_lock"} %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul9) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_cons_lock, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, Release, %c1_ul11) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) ^bb4: // 2 preds: ^bb3, ^bb5 - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%objFifo_in0_cons_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul13) aie.next_bd ^bb5 ^bb5: // pred: ^bb4 - aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_cons_lock, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%objFifo_in0_cons_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_in0_cons_prod_lock, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in0_cons_prod_lock, Release, %c1_ul15) aie.next_bd ^bb4 ^bb6: // pred: ^bb3 %2 = aie.dma_start(MM2S, 1, ^bb7, ^bb9) ^bb7: // 2 preds: ^bb6, ^bb8 - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul17) aie.next_bd ^bb8 ^bb8: // pred: ^bb7 - aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_prod_lock, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, Release, %c1_ul19) aie.next_bd ^bb7 ^bb9: // pred: ^bb6 %3 = aie.dma_start(S2MM, 1, ^bb10, ^bb12) ^bb10: // 2 preds: ^bb9, ^bb11 - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul20) aie.dma_bd(%objFifo_out0_buff_0 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul21) aie.next_bd ^bb11 ^bb11: // pred: ^bb10 - aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_prod_lock, AcquireGreaterEqual, %c1_ul22) aie.dma_bd(%objFifo_out0_buff_1 : memref<16xi32>, 0, 16) - aie.use_lock(%objFifo_out0_cons_lock, Release, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out0_cons_lock, Release, %c1_ul23) aie.next_bd ^bb10 ^bb12: // pred: ^bb9 aie.end @@ -138,26 +162,34 @@ module { %mem_0_2 = aie.mem(%tile_0_2) { %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: // 2 preds: ^bb0, ^bb2 - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul24 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul24) aie.dma_bd(%objFifo_in1_cons_buff_0 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul25 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul25) aie.next_bd ^bb2 ^bb2: // pred: ^bb1 - aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, 1) + %c1_ul26 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_prod_lock, AcquireGreaterEqual, %c1_ul26) aie.dma_bd(%objFifo_in1_cons_buff_1 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_in1_cons_cons_lock, Release, 1) + %c1_ul27 = arith.constant 1 : i32 + aie.use_lock(%objFifo_in1_cons_cons_lock, Release, %c1_ul27) aie.next_bd ^bb1 ^bb3: // pred: ^bb0 %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) ^bb4: // 2 preds: ^bb3, ^bb5 - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul28 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul28) aie.dma_bd(%objFifo_out1_buff_0 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul29 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul29) aie.next_bd ^bb5 ^bb5: // pred: ^bb4 - aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, 1) + %c1_ul30 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_cons_lock, AcquireGreaterEqual, %c1_ul30) aie.dma_bd(%objFifo_out1_buff_1 : memref<8xi32>, 0, 8) - aie.use_lock(%objFifo_out1_prod_lock, Release, 1) + %c1_ul31 = arith.constant 1 : i32 + aie.use_lock(%objFifo_out1_prod_lock, Release, %c1_ul31) aie.next_bd ^bb4 ^bb6: // pred: ^bb3 aie.end diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1.mlir index ea74cc68ecd..22feabed2a4 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1.mlir @@ -17,23 +17,37 @@ // CHECK: %[[PL:.*]] = aie.lock(%[[t0]], 0) {init = 4 : i32, sym_name = "fifo_prod_lock_0"} // CHECK: %[[CL:.*]] = aie.lock(%[[t0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} // CHECK: %[[c0:.*]] = aie.core(%[[t0]]) { -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[c1:.*]] = aie.core(%[[t1]]) { -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[PL]], Release, 1) -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%[[PL]], Release, 2) -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[PL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1_dynamic.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1_dynamic.mlir index 1a87282ff50..b32842eccb4 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1_dynamic.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L1_dynamic.mlir @@ -15,9 +15,11 @@ // Consumer pattern {1,2,1} over a depth-4 fifo: each acquire resolves its buffer // through a runtime index_switch (the hallmark of dynamic lowering). // CHECK: %core_2_3 = aie.core -// CHECK: aie.use_lock(%{{.*}}, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%{{.*}}, AcquireGreaterEqual, %{{.*}}) // CHECK: scf.index_switch -// CHECK: aie.use_lock(%{{.*}}, AcquireGreaterEqual, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%{{.*}}, AcquireGreaterEqual, %{{.*}}) // CHECK: scf.index_switch // CHECK: scf.index_switch // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L2.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L2.mlir index 9f1d6771957..34e53dc7e41 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L2.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_L2.mlir @@ -87,18 +87,26 @@ // CHECK: %[[c0:.*]] = aie.core(%[[t0]]) { // CHECK: %c0 = arith.constant 0 : index -// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %c55_i32, %[[fifo0_buff_0]][%c0] : memref<1xi32> -// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, 1) -// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %c66_i32, %[[fifo0_buff_1]][%c0] : memref<1xi32> -// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, 1) -// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %c77_i32, %[[fifo0_buff_0]][%c0] : memref<1xi32> -// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, 1) -// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %c88_i32, %[[fifo0_buff_1]][%c0] : memref<1xi32> -// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_lock]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } @@ -117,24 +125,30 @@ // DMA received an object from the stream and wrote it to the buffer. First, // we only want to consume one object, so it suffices to acquire this lock // with a value of 1: -// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[load0:.*]] = memref.load %[[fifo1_cons_buff_0]][%c0] : memref<1xi32> -// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], Release, %{{.*}}) // We released the lock above, meaning we are done with the one object we // received. Now we want 2 _new_ objects, so the cons_cons lock is acquired // twice, meaning it has to be released twice before both acquires succeed; // this, again, meaning that the DMA has received two objects on the stream // and put them in the respective buffers. -// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], AcquireGreaterEqual, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[load1:.*]] = memref.load %[[fifo1_cons_buff_1]][%c0] : memref<1xi32> // CHECK: %[[load2:.*]] = memref.load %[[fifo1_cons_buff_2]][%c0] : memref<1xi32> -// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], Release, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], Release, %{{.*}}) // Lastly, receive just one object: -// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[load3:.*]] = memref.load %[[fifo1_cons_buff_3]][%c0] : memref<1xi32> -// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } @@ -149,17 +163,21 @@ // Memory to stream: As soon as we get an object in fifo0_buff_0, put it onto // the stream, then move on to bb2. // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[fifo0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_buff_0]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // Now, if we get 4 bytes in fifo0_buff_1, put that on the stream, then // go back to bb1. Ping-pong. // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[fifo0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_buff_1]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 @@ -178,48 +196,64 @@ // allocated inside the memory tile, one by one (round robin) as we receive // things through the stream: // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_0]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_1]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_2]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_3]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // Now map everything we read in back out onto the stream towards tile 2: // CHECK: ^bb5: // pred: ^bb0 // CHECK: %[[VAL_26:.*]] = aie.dma_start(MM2S, 0, ^bb6, ^bb10) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb9 -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_0]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_1]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: // pred: ^bb7 -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_2]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb9: // pred: ^bb8 -// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo0_cons_buff_3]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo0_cons_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb10: // pred: ^bb5 // CHECK: aie.end @@ -238,24 +272,32 @@ // CHECK: %[[mem2:.*]] = aie.mem(%[[t2]]) { // CHECK: %[[dma2:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo1_cons_buff_0]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo1_cons_buff_1]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo1_cons_buff_2]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[fifo1_cons_buff_3]] : memref<1xi32>, 0, 1) -// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_dma.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_dma.mlir index 88927ca79d8..f8b86ece766 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_dma.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_cyclostatic_dma.mlir @@ -24,36 +24,54 @@ // CHECK: %[[CL:.*]] = aie.lock(%[[t0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} // CHECK: aie.flow(%[[t0]], DMA : 0, %[[t1]], DMA : 0) // CHECK: %[[c0:.*]] = aie.core(%[[t0]]) { -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[c1:.*]] = aie.core(%[[t1]]) { -// CHECK: aie.use_lock(%[[C_CL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[C_PL]], Release, 1) -// CHECK: aie.use_lock(%[[C_CL]], AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%[[C_PL]], Release, 2) -// CHECK: aie.use_lock(%[[C_CL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[C_PL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_PL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[C_CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[C_PL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_PL]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[m0:.*]] = aie.mem(%[[t0]]) { // CHECK: %[[dma0:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[buf0_0]] : memref, 0, 1) -// CHECK: aie.use_lock(%[[PL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[buf0_1:.*]] : memref, 0, 1) -// CHECK: aie.use_lock(%[[PL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -61,19 +79,25 @@ // CHECK: %[[m1:.*]] = aie.mem(%[[t1]]) { // CHECK: %[[dma1:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[C_PL]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_PL]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[buf1_0:.*]] : memref, 0, 1) -// CHECK: aie.use_lock(%[[C_CL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_CL]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[C_PL]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_PL]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[buf1_1]] : memref, 0, 1) -// CHECK: aie.use_lock(%[[C_CL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_CL]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[C_PL]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_PL]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[buf1_2]] : memref, 0, 1) -// CHECK: aie.use_lock(%[[C_CL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[C_CL]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_delayed_release.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_delayed_release.mlir index af5a2d92852..7fd7dbb9baf 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_delayed_release.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_delayed_release.mlir @@ -45,31 +45,39 @@ // CHECK: %c4 = arith.constant 4 : index // # Objects Held: 0 # Objects Requested: 1 # Acquire Needed: 1 -// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, %{{.*}}) // # Objects Held: 1 // CHECK: memref.store %c99_i32, %[[fifo_buff_0]][] : memref -// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, %{{.*}}) // # Objects Held: 0 (After release) // # Objects Held: 0 # Objects Requested: 1 # Acquire Needed: 1 -// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, %{{.*}}) // # Objects Held: 1 // CHECK: memref.store %c99_i32, %[[fifo_buff_1]][] : memref -// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, %{{.*}}) // # Objects Held: 0 (After release) // # Objects Held: 0 # Objects Requested: 1 # Acquire Needed: 1 -// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, %{{.*}}) // # Objects Held: 1 // CHECK: memref.store %c99_i32, %[[fifo_buff_2]][] : memref -// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, %{{.*}}) // # Objects Held: 0 (After release) // # Objects Held: 0 # Objects Requested: 1 # Acquire Needed: 1 -// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, %{{.*}}) // # Objects Held: 1 // CHECK: memref.store %c99_i32, %[[fifo_buff_3]][] : memref -// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, %{{.*}}) // # Objects Held: 0 (After release) // CHECK: aie.end // CHECK: } @@ -82,7 +90,8 @@ // -- Requested: 2 -- // # Objects Held: 0 # Objects Requested: 2 # Acquire Needed: 2 -// CHECK: aie.use_lock(%[[fifo_cons_lock]], AcquireGreaterEqual, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[fifo_cons_lock]], AcquireGreaterEqual, %{{.*}}) // # Objects Held: 2 // CHECK: %[[VAL_11:.*]] = memref.load %[[fifo_buff_0]][] : memref @@ -97,7 +106,8 @@ // -- Requested: 3 -- // Since we already hold 2 and are requesting 3, we expect one acquire here. // # Objects Held: 2 # Objects Requested: 3 # Acquire Needed: 1 -// CHECK: aie.use_lock(%[[fifo_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[fifo_cons_lock]], AcquireGreaterEqual, %{{.*}}) // # Objects Held: 3 // CHECK: %[[VAL_13:.*]] = memref.load %[[fifo_buff_0]][] : memref // CHECK: memref.store %[[VAL_13]], %[[buf23]][%c2] : memref<4xi32> @@ -108,7 +118,8 @@ // CHECK: memref.store %[[VAL_14]], %[[buf23]][%c3] : memref<4xi32> // These releases should all succeed. -// CHECK: aie.use_lock(%[[fifo_prod_lock]], Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[fifo_prod_lock]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_dynamic_locks.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_dynamic_locks.mlir index 33cdfcc9053..74ed579e44b 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_dynamic_locks.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_dynamic_locks.mlir @@ -27,136 +27,58 @@ // like, where lock acquire/release numbers are not known statically. The // test currently fails because this is only a concept and not yet implemented: -// CHECK: module @aie2_dynamic_locks { -// CHECK: aie.device(xcve2302) { -// CHECK: %[[tile23:.*]] = aie.tile(2, 2) -// CHECK: %[[tile43:.*]] = aie.tile(4, 3) - -// The setup for flows, locks, and buffers can be the same in the dynamic case: -// CHECK: %[[fifo_buff_0:.*]] = aie.buffer(%[[tile23]]) {sym_name = "fifo_buff_0"} : memref -// CHECK: %[[fifo_prod_lock:.*]] = aie.lock(%[[tile23]], 0) {init = 1 : i32, sym_name = "fifo_prod_lock_0"} -// CHECK: %[[fifo_cons_lock:.*]] = aie.lock(%[[tile23]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} -// CHECK: %[[fifo_cons_buff_0:.*]] = aie.buffer(%[[tile43]]) {sym_name = "fifo_cons_buff_0"} : memref -// CHECK: %[[fifo_cons_prod_lock:.*]] = aie.lock(%[[tile43]], 0) {init = 1 : i32, sym_name = "fifo_cons_prod_lock_0"} -// CHECK: %[[fifo_cons_cons_lock:.*]] = aie.lock(%[[tile43]], 1) {init = 0 : i32, sym_name = "fifo_cons_cons_lock_0"} -// CHECK: aie.flow(%[[tile23]], DMA : 0, %[[tile43]], DMA : 0) - -// CHECK: %[[ssa8:.*]] = aie.core(%[[tile23]]) { -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c3 = arith.constant 3 : index -// CHECK: %c16 = arith.constant 16 : index -// CHECK: %c1_i64 = arith.constant 1 : i64 - -// We need a SSA value that keeps track of the number of objects currently -// held so the lock acquire can be appropriately increased/decreased. -// At a lower level, we would do this with PHI nodes, which in MLIR look like -// arguments to the basic blocks. The "scf" dialect can also generated phi -// nodes by using iter_args, and scf.yield, which we use here (untested, -// and I have not used this before so it may be wrong, but the idea is to -// have the value change from iteration to iteration). - -// This is what currently is being generated: -// aie.use_lock(%[[fifo_prod_lock]], AcquireGreaterEqual, 1) -// Instead: -// Initialize the number of objects held, which is always zero at the -// beginning before any acquires: -// CHECK: %[[lock0_num0:.*]] = arith.constant 0 : i32 -// The number of objects to acquire is statically encoded as a constant (this -// is XXX copied straight from the argument to acquire(..., XXX)) -// CHECK: %[[uselock0_target:.*]] = arith.constant 1 : i32 -// Calculate the difference between currently held objects and how many we -// target, then acquire that many: -// CHECK: %[[uselock0_diff:.*]] = arith.subi %[[lock0_num0]], %[[uselock0_target:.*]] : i32 -// If the difference is greater than zero, this means we want more objects -// than we already hold. Therefore we need to acquire a lock. If it is smaller -// (the below SSA evaluates to false), no additional locks need to be -// acquired. -// CHECK: %[[uselock0_need_acq:.*]] = arith.cmpi "sgt" %[[uselock0_diff]], 1 : i32 -// If we enter the if condition, we acquire more objects, thus must update our -// SSA value for the number of objects currently held. -// CHECK: %[[lock0_num1:.*]] = scf.if %[[uselock0_need_acq]] -> (i32) { -// The only thing that is different about acquiring the lock is that we use -// a new useLockDyn that takes an SSA value instead of a constant for the -// lock value, so that it can be dynamic. -// CHECK: aiex.useLockDyn(%[[fifo_prod_lock]], AcquireGreaterEqual, %[[uselock0_diff]]) -// We also need to update how many elements we hold now that we acquired more: -// CHECK: %[[uselock0_newnum:.*]] = arith.addi %[[lock0_num0]], 1 : i32 -// CHECK: scf.yield %[[uselock0_newnum]] -// CHECK: } else { -// The number of objects held remains unchanged since we did not need to -// acquire any additional ones: -// CHECK: scf.yield %[[lock0_num0]] -// } - -// No release in input code here, so there's nothing for lowering it here -// either. Let's go into the loop. - -// CHECK: %c1_0 = arith.constant 1 : index - -// The number of objects held varies from iteration to iteration. In scf we -// can treat this as if the loop was a function and the number of locks held -// were an argument to the loop function. `scf.yield` tells what the value for -// that argument will be on the next iteration. The value assigned in the -// `iter_args()` is the value it will hold on the first iteration. -// CHECK: %[[lock0_num2]] = scf.for %arg0 = %c0 to %c3 step %c1_0 iter_args(%[[lock0_num_iter:.*]] = %[[lock0_num1]]) -> (i32) { - -// Acquire inside loop: -// The current implementation does not generate a lock acquire here at all. -// We need one, but only on the second iteration. The same code as above will -// figure this out: -// CHECK: %[[uselock1_target:.*]] = arith.constant 1 : i32 -// CHECK: %[[uselock1_diff:.*]] = arith.subi %[[lock0_num_iter]], %[[uselock1_target:.*]] : i32 -// CHECK: %[[uselock1_need_acq:.*]] = arith.cmpi "sgt" %[[uselock1_diff]], 1 : i32 -// CHECK: %[[lock0_num3:.*]] = scf.if %[[uselock1_need_acq]] -> (i32) { -// CHECK: aiex.useLockDyn(%[[fifo_prod_lock]], AcquireGreaterEqual, %[[uselock1_diff]]) -// CHECK: %[[uselock1_newnum:.*]] = arith.addi %[[lock0_num_iter]], 1 : i32 -// CHECK: scf.yield %[[uselock1_newnum]] -// CHECK: } else { -// CHECK: scf.yield %[[lock0_num_iter]] -// } -// CHECK: memref.store %c1_i64, %[[fifo_buff_0]][] : memref - -// Release inside loop: -// The release will always release, but additionally to -// CHECK: aie.use_lock(%[[fifo_cons_lock]], Release, 1) -// CHECK: %[[lock0_num4:.*]] = arith.subi %[[lock0_num3]], 1 : i32 - -// At the very end of the loop, we need to yield how many objects are being held -// after all the acquires and releases inside the loop: -// CHECK: scf.yield %lock0_num4 +// CHECK-LABEL: module @aie2_dynamic_locks { +// CHECK: aie.device(xcve2302) { +// CHECK: %[[VAL_0:.*]] = aie.tile(2, 2) +// CHECK: %[[VAL_1:.*]] = aie.tile(4, 3) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_0"} : memref +// CHECK: %[[VAL_3:.*]] = aie.lock(%[[VAL_1]], 0) {init = 1 : i32, sym_name = "fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_4:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_0"} : memref +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_0]], 0) {init = 1 : i32, sym_name = "fifo_prod_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) +// CHECK: %[[VAL_8:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_9:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_10:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_11:.*]] = arith.constant 3 : index +// CHECK: %[[VAL_12:.*]] = arith.constant 16 : index +// CHECK: %[[VAL_13:.*]] = arith.constant 1 : i64 +// CHECK: %[[VAL_14:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_14]]) +// CHECK: scf.for %[[VAL_15:.*]] = %[[VAL_9]] to %[[VAL_11]] step %[[VAL_10]] { +// CHECK: memref.store %[[VAL_13]], %[[VAL_5]][] : memref +// CHECK: %[[VAL_16:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_16]]) +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_17:.*]] = aie.mem(%[[VAL_0]]) { +// CHECK: %[[VAL_18:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) +// CHECK: ^bb1: +// CHECK: %[[VAL_19:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_19]]) +// CHECK: aie.dma_bd(%[[VAL_5]] : memref, 0, 1) +// CHECK: %[[VAL_20:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_20]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb2: +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_21:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_22:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) +// CHECK: ^bb1: +// CHECK: %[[VAL_23:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, %[[VAL_23]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref, 0, 1) +// CHECK: %[[VAL_24:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %[[VAL_24]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb2: +// CHECK: aie.end +// CHECK: } +// CHECK: } // CHECK: } -// CHECK: aie.end -// CHECK: } - -// The DMAs should remain all the same and will be configured statically: -// CHECK: %[[ssa9:.*]] = aie.mem(%[[tile23]]) { -// CHECK: %11 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) -// CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[fifo_cons_lock]], AcquireGreaterEqual, 1) -// CHECK: aie.dma_bd(%[[fifo_buff_0]] : memref, 0, 1) -// CHECK: aie.use_lock(%[[fifo_prod_lock]], Release, 1) -// CHECK: aie.next_bd ^bb1 -// CHECK: ^bb2: // pred: ^bb0 -// CHECK: aie.end -// CHECK: } -// CHECK: %10 = aie.mem(%[[tile43]]) { -// CHECK: %11 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) -// CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[fifo_cons_prod_lock]], AcquireGreaterEqual, 1) -// CHECK: aie.dma_bd(%[[fifo_cons_buff_0]] : memref, 0, 1) -// CHECK: aie.use_lock(%[[fifo_cons_cons_lock]], Release, 1) -// CHECK: aie.next_bd ^bb1 -// CHECK: ^bb2: // pred: ^bb0 -// CHECK: aie.end -// CHECK: } -// CHECK: } -// CHECK: } - - -// Again, none of this has been implemented yet, so we expect this all to fail: -// XFAIL: * - module @aie2_dynamic_locks { aie.device(xcve2302) { diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_single_multiple_release.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_single_multiple_release.mlir index 19e7da09f46..415786021ac 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_single_multiple_release.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_single_multiple_release.mlir @@ -26,24 +26,33 @@ // CHECK: return // CHECK: } // CHECK: %[[VAL_15:.*]] = aie.core(%[[VAL_1]]) { -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 2) -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_12]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_16:.*]] = aie.core(%[[VAL_2]]) { -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_4]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_5]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } diff --git a/test/objectFifo-stateful-transform/access_patterns/AIE2_static_L1.mlir b/test/objectFifo-stateful-transform/access_patterns/AIE2_static_L1.mlir index e75643c24b9..5dd43889fe1 100644 --- a/test/objectFifo-stateful-transform/access_patterns/AIE2_static_L1.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/AIE2_static_L1.mlir @@ -20,25 +20,41 @@ // CHECK: %[[PL:.*]] = aie.lock(%[[t0]], 0) {init = 4 : i32, sym_name = "fifo_prod_lock_0"} // CHECK: %[[CL:.*]] = aie.lock(%[[t0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} // CHECK: %[[c0:.*]] = aie.core(%[[t0]]) { -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) -// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[CL]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[PL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[CL]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[c1:.*]] = aie.core(%[[t1]]) { -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%[[PL]], Release, 2) -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%[[PL]], Release, 2) -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%[[PL]], Release, 2) -// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%[[PL]], Release, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[CL]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[PL]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } diff --git a/test/objectFifo-stateful-transform/access_patterns/cyclostatic_AIE2_sharedMem.mlir b/test/objectFifo-stateful-transform/access_patterns/cyclostatic_AIE2_sharedMem.mlir index 45ff4fc107a..de983fc4d74 100644 --- a/test/objectFifo-stateful-transform/access_patterns/cyclostatic_AIE2_sharedMem.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/cyclostatic_AIE2_sharedMem.mlir @@ -26,63 +26,86 @@ // CHECK: %[[VAL_13:.*]] = arith.constant 8 : index // CHECK: %[[VAL_14:.*]] = arith.constant 4 : index // CHECK: scf.for %[[VAL_15:.*]] = %[[VAL_10]] to %[[VAL_13]] step %[[VAL_14]] { -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %[[VAL_9]], %[[VAL_2]]{{\[}}%[[VAL_10]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %[[VAL_9]], %[[VAL_3]]{{\[}}%[[VAL_10]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %[[VAL_9]], %[[VAL_4]]{{\[}}%[[VAL_10]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %[[VAL_9]], %[[VAL_5]]{{\[}}%[[VAL_10]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: } -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %[[VAL_9]], %[[VAL_2]]{{\[}}%[[VAL_10]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_16:.*]] = aie.core(%[[VAL_1]]) { // CHECK: %[[VAL_17:.*]] = arith.constant 0 : index // CHECK: %[[VAL_18:.*]] = arith.constant 1 : index // CHECK: %[[VAL_19:.*]] = arith.constant 9 : index -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[VAL_20:.*]] = memref.load %[[VAL_2]]{{\[}}%[[VAL_17]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: %[[VAL_21:.*]] = arith.constant 8 : index // CHECK: %[[VAL_22:.*]] = arith.constant 4 : index // CHECK: scf.for %[[VAL_23:.*]] = %[[VAL_17]] to %[[VAL_21]] step %[[VAL_22]] { -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[VAL_24:.*]] = memref.load %[[VAL_3]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_25:.*]] = memref.load %[[VAL_4]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_26:.*]] = memref.load %[[VAL_5]]{{\[}}%[[VAL_17]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[VAL_27:.*]] = memref.load %[[VAL_4]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_28:.*]] = memref.load %[[VAL_5]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_29:.*]] = memref.load %[[VAL_2]]{{\[}}%[[VAL_17]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[VAL_30:.*]] = memref.load %[[VAL_5]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_31:.*]] = memref.load %[[VAL_2]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_32:.*]] = memref.load %[[VAL_3]]{{\[}}%[[VAL_17]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[VAL_33:.*]] = memref.load %[[VAL_2]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_34:.*]] = memref.load %[[VAL_3]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_35:.*]] = memref.load %[[VAL_4]]{{\[}}%[[VAL_17]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: } -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: %[[VAL_36:.*]] = memref.load %[[VAL_3]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_4]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_38:.*]] = memref.load %[[VAL_5]]{{\[}}%[[VAL_17]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: %[[VAL_39:.*]] = memref.load %[[VAL_4]]{{\[}}%[[VAL_17]]] : memref<16xi32> // CHECK: %[[VAL_40:.*]] = memref.load %[[VAL_5]]{{\[}}%[[VAL_17]]] : memref<16xi32> -// CHECK: aie.use_lock(%[[VAL_6]], Release, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } diff --git a/test/objectFifo-stateful-transform/access_patterns/same_core_producer_consumer_test.mlir b/test/objectFifo-stateful-transform/access_patterns/same_core_producer_consumer_test.mlir index 3d8f4198079..a2b99964f18 100644 --- a/test/objectFifo-stateful-transform/access_patterns/same_core_producer_consumer_test.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/same_core_producer_consumer_test.mlir @@ -20,18 +20,25 @@ // CHECK: return // CHECK: } // CHECK: %[[VAL_7:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 2) +// CHECK: %{{.*}} = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_1]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_1]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } diff --git a/test/objectFifo-stateful-transform/access_patterns/subview_test_1.mlir b/test/objectFifo-stateful-transform/access_patterns/subview_test_1.mlir index ba5f34993da..95c26222661 100644 --- a/test/objectFifo-stateful-transform/access_patterns/subview_test_1.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/subview_test_1.mlir @@ -25,17 +25,23 @@ // CHECK: return // CHECK: } // CHECK: %[[VAL_11:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_4]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_4]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_5]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_4]]) : (memref<16xi32>) -> () diff --git a/test/objectFifo-stateful-transform/access_patterns/subview_test_2.mlir b/test/objectFifo-stateful-transform/access_patterns/subview_test_2.mlir index bf8a05147b5..069474732ce 100644 --- a/test/objectFifo-stateful-transform/access_patterns/subview_test_2.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/subview_test_2.mlir @@ -31,45 +31,68 @@ // CHECK: return // CHECK: } // CHECK: %[[VAL_17:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_15]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_4]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_18:.*]] = aie.core(%[[VAL_1]]) { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } diff --git a/test/objectFifo-stateful-transform/access_patterns/subview_test_3.mlir b/test/objectFifo-stateful-transform/access_patterns/subview_test_3.mlir index 65aaa9b741e..798e464b8f2 100644 --- a/test/objectFifo-stateful-transform/access_patterns/subview_test_3.mlir +++ b/test/objectFifo-stateful-transform/access_patterns/subview_test_3.mlir @@ -31,45 +31,68 @@ // CHECK: return // CHECK: } // CHECK: %[[VAL_17:.*]] = aie.core(%[[VAL_0]]) { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_15]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_4]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_18:.*]] = aie.core(%[[VAL_1]]) { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } diff --git a/test/objectFifo-stateful-transform/adjacent_memtile_allocation/onelargefifo_on_2memtile.mlir b/test/objectFifo-stateful-transform/adjacent_memtile_allocation/onelargefifo_on_2memtile.mlir index ddc4be820de..6e56a7b5a41 100644 --- a/test/objectFifo-stateful-transform/adjacent_memtile_allocation/onelargefifo_on_2memtile.mlir +++ b/test/objectFifo-stateful-transform/adjacent_memtile_allocation/onelargefifo_on_2memtile.mlir @@ -35,50 +35,66 @@ // CHECK: %{{.*}} = aie.memtile_dma(%[[MEM_TILE_0_1]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN0_CONS_BUFF_0]] : memref<96000xi32>, 0, 96000) -// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN0_CONS_BUFF_1]] : memref<96000xi32>, 0, 96000) -// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN0_CONS_BUFF_0]] : memref<96000xi32>, 0, 96000) -// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN0_CONS_BUFF_1]] : memref<96000xi32>, 0, 96000) -// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.dma_start(MM2S, 1, ^bb7, ^bb9) // CHECK: ^bb7: -// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_0]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: -// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_1]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb9: // CHECK: aie.dma_start(S2MM, 1, ^bb10, ^bb12) // CHECK: ^bb10: -// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_0]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb11: -// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_1]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb12: // CHECK: aie.end @@ -86,26 +102,34 @@ // CHECK: %{{.*}} = aie.mem(%[[TILE_0_2]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_CONS_BUFF_0]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_CONS_BUFF_1]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_BUFF_0]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_BUFF_1]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/adjacent_memtile_allocation/twofifo_on_2memtile.mlir b/test/objectFifo-stateful-transform/adjacent_memtile_allocation/twofifo_on_2memtile.mlir index e9d0f12dd80..16703c412e6 100644 --- a/test/objectFifo-stateful-transform/adjacent_memtile_allocation/twofifo_on_2memtile.mlir +++ b/test/objectFifo-stateful-transform/adjacent_memtile_allocation/twofifo_on_2memtile.mlir @@ -35,40 +35,52 @@ // CHECK: %{{.*}} = aie.memtile_dma(%[[MEM_TILE_0_1]]) { // CHECK: aie.dma_start(S2MM, 1, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN0_CONS_BUFF_0]] : memref<64000xi32>, 0, 64000) -// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: ^bb3: // CHECK: aie.dma_start(MM2S, 1, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN0_CONS_BUFF_0]] : memref<64000xi32>, 0, 64000) -// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN0_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: ^bb6: // CHECK: aie.dma_start(MM2S, 0, ^bb7, ^bb9) // CHECK: ^bb7: -// CHECK: aie.use_lock(%[[OUT0_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT0_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT0_BUFF_0]] : memref<64000xi32>, 0, 64000) -// CHECK: aie.use_lock(%[[OUT0_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT0_PROD_LOCK]], Release, %{{.*}}) // CHECK: ^bb9: // CHECK: aie.dma_start(S2MM, 0, ^bb10, ^bb12) // CHECK: ^bb10: -// CHECK: aie.use_lock(%[[OUT0_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT0_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT0_BUFF_0]] : memref<64000xi32>, 0, 64000) -// CHECK: aie.use_lock(%[[OUT0_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT0_CONS_LOCK]], Release, %{{.*}}) // CHECK: } // CHECK: %{{.*}} = aie.mem(%[[TILE_0_2]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_CONS_BUFF_0]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: ^bb3: // CHECK: aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_BUFF_0]] : memref<8xi32>, 0, 8) -// CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, %{{.*}}) // CHECK: } // CHECK: aie.shim_dma_allocation @out0_shim_alloc(%[[SHIM_NOC_TILE_0_0]], S2MM, 0) // CHECK: } diff --git a/test/objectFifo-stateful-transform/aie_stream/consumer_stream_AIE2.mlir b/test/objectFifo-stateful-transform/aie_stream/consumer_stream_AIE2.mlir index f7057f8c56b..71e0c74293a 100644 --- a/test/objectFifo-stateful-transform/aie_stream/consumer_stream_AIE2.mlir +++ b/test/objectFifo-stateful-transform/aie_stream/consumer_stream_AIE2.mlir @@ -20,14 +20,18 @@ // CHECK: %mem_1_2 = aie.mem(%tile_1_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%of_consumer_stream_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_consumer_stream_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_consumer_stream_buff_0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_consumer_stream_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_consumer_stream_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%of_consumer_stream_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_consumer_stream_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_consumer_stream_buff_1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_consumer_stream_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_consumer_stream_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/aie_stream/link_to_stream_AIE2.mlir b/test/objectFifo-stateful-transform/aie_stream/link_to_stream_AIE2.mlir index 884810b1686..fe7b8e47ff7 100644 --- a/test/objectFifo-stateful-transform/aie_stream/link_to_stream_AIE2.mlir +++ b/test/objectFifo-stateful-transform/aie_stream/link_to_stream_AIE2.mlir @@ -24,26 +24,34 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%mem_tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_in_cons_buff_0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_in_cons_buff_1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_in_cons_buff_0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_in_cons_buff_1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_in_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/aie_stream/producer_stream_AIE2.mlir b/test/objectFifo-stateful-transform/aie_stream/producer_stream_AIE2.mlir index 31089cb2807..57b023b2eb0 100644 --- a/test/objectFifo-stateful-transform/aie_stream/producer_stream_AIE2.mlir +++ b/test/objectFifo-stateful-transform/aie_stream/producer_stream_AIE2.mlir @@ -21,19 +21,25 @@ // CHECK: %mem_1_3 = aie.mem(%tile_1_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%of_producer_stream_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_producer_stream_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_producer_stream_cons_buff_0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_producer_stream_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_producer_stream_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%of_producer_stream_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_producer_stream_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_producer_stream_cons_buff_1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_producer_stream_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_producer_stream_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%of_producer_stream_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_producer_stream_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_producer_stream_cons_buff_2 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_producer_stream_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_producer_stream_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/aie_stream/shim_to_stream_AIE2.mlir b/test/objectFifo-stateful-transform/aie_stream/shim_to_stream_AIE2.mlir index 715f46067a5..e87d96a1141 100644 --- a/test/objectFifo-stateful-transform/aie_stream/shim_to_stream_AIE2.mlir +++ b/test/objectFifo-stateful-transform/aie_stream/shim_to_stream_AIE2.mlir @@ -18,9 +18,11 @@ // CHECK: %shim_dma_2_0 = aie.shim_dma(%shim_noc_tile_2_0) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%of_stream_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%ext_buffer_in : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_stream_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/aie_stream/stream_to_link_AIE2.mlir b/test/objectFifo-stateful-transform/aie_stream/stream_to_link_AIE2.mlir index dd55e5bbb8b..f07639b2a04 100644 --- a/test/objectFifo-stateful-transform/aie_stream/stream_to_link_AIE2.mlir +++ b/test/objectFifo-stateful-transform/aie_stream/stream_to_link_AIE2.mlir @@ -23,26 +23,34 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%mem_tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_stream_cons_buff_0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_stream_cons_buff_1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_stream_cons_buff_0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%of_stream_cons_buff_1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%of_stream_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/base/base_test_AIE1.mlir b/test/objectFifo-stateful-transform/base/base_test_AIE1.mlir index 3f70172ec5b..c18652bdf89 100644 --- a/test/objectFifo-stateful-transform/base/base_test_AIE1.mlir +++ b/test/objectFifo-stateful-transform/base/base_test_AIE1.mlir @@ -35,14 +35,18 @@ // CHECK: %[[VAL_19:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_10]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -50,14 +54,18 @@ // CHECK: %[[VAL_20:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/base/base_test_AIE2.mlir b/test/objectFifo-stateful-transform/base/base_test_AIE2.mlir index eaeee643ea9..c0b96ff7eab 100644 --- a/test/objectFifo-stateful-transform/base/base_test_AIE2.mlir +++ b/test/objectFifo-stateful-transform/base/base_test_AIE2.mlir @@ -33,14 +33,18 @@ // CHECK: %[[VAL_17:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -48,14 +52,18 @@ // CHECK: %[[VAL_18:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/base/base_test_shim.mlir b/test/objectFifo-stateful-transform/base/base_test_shim.mlir index d9270e2f295..c4c459a8983 100644 --- a/test/objectFifo-stateful-transform/base/base_test_shim.mlir +++ b/test/objectFifo-stateful-transform/base/base_test_shim.mlir @@ -20,14 +20,18 @@ // CHECK: %[[VAL_6:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/base/lock_analysis_test.mlir b/test/objectFifo-stateful-transform/base/lock_analysis_test.mlir index 3ebb90f59a9..b386f5e46d5 100644 --- a/test/objectFifo-stateful-transform/base/lock_analysis_test.mlir +++ b/test/objectFifo-stateful-transform/base/lock_analysis_test.mlir @@ -26,21 +26,27 @@ // CHECK: %test_cons_lock = aie.lock(%{{.*}}tile_1_2, 1) {init = 0 : i32, sym_name = "test_cons_lock"} // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%test_prod_lock, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%test_prod_lock, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%test_buff : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%test_cons_lock, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%test_cons_lock, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb3, ^bb5) // CHECK: ^bb3: // 2 preds: ^bb2, ^bb4 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb5: // pred: ^bb2 // CHECK: aie.end @@ -48,14 +54,18 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -77,9 +87,11 @@ module @lockAnalysis { %test_cons_lock = aie.lock(%tile12, 1) {init = 0 : i32, sym_name = "test_cons_lock"} %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: - aie.use_lock(%test_prod_lock, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%test_prod_lock, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%test_buff : memref<16xi32>, 0, 16) - aie.use_lock(%test_cons_lock, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%test_cons_lock, Release, %c1_ul1) aie.next_bd ^bb1 ^bb2: aie.end diff --git a/test/objectFifo-stateful-transform/base/memTile_test.mlir b/test/objectFifo-stateful-transform/base/memTile_test.mlir index 248dae092de..11386087373 100644 --- a/test/objectFifo-stateful-transform/base/memTile_test.mlir +++ b/test/objectFifo-stateful-transform/base/memTile_test.mlir @@ -25,14 +25,18 @@ // CHECK: %[[VAL_10:.*]] = aie.memtile_dma(%[[VAL_0]]) { // CHECK: %[[VAL_11:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -40,14 +44,18 @@ // CHECK: %[[VAL_12:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_13:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/base/non_adjacency_test_1.mlir b/test/objectFifo-stateful-transform/base/non_adjacency_test_1.mlir index cd7cf951411..80de0640289 100644 --- a/test/objectFifo-stateful-transform/base/non_adjacency_test_1.mlir +++ b/test/objectFifo-stateful-transform/base/non_adjacency_test_1.mlir @@ -31,12 +31,16 @@ // CHECK: %[[VAL_14:.*]] = arith.constant 12 : index // CHECK: %[[VAL_15:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_16:.*]] = %[[VAL_12]] to %[[VAL_14]] step %[[VAL_15]] { -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_6]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_7]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -46,26 +50,34 @@ // CHECK: %[[VAL_20:.*]] = arith.constant 12 : index // CHECK: %[[VAL_21:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_22:.*]] = %[[VAL_18]] to %[[VAL_20]] step %[[VAL_21]] { -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_23:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_24:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -73,14 +85,18 @@ // CHECK: %[[VAL_25:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_26:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/base/non_adjacency_test_2.mlir b/test/objectFifo-stateful-transform/base/non_adjacency_test_2.mlir index fbd4ecf568d..c15ff6d8007 100644 --- a/test/objectFifo-stateful-transform/base/non_adjacency_test_2.mlir +++ b/test/objectFifo-stateful-transform/base/non_adjacency_test_2.mlir @@ -35,12 +35,16 @@ // CHECK: %[[VAL_18:.*]] = arith.constant 12 : index // CHECK: %[[VAL_19:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_20:.*]] = %[[VAL_16]] to %[[VAL_18]] step %[[VAL_19]] { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -50,34 +54,48 @@ // CHECK: %[[VAL_24:.*]] = arith.constant 12 : index // CHECK: %[[VAL_25:.*]] = arith.constant 4 : index // CHECK: scf.for %[[VAL_26:.*]] = %[[VAL_22]] to %[[VAL_24]] step %[[VAL_25]] { -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_7]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_4]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_5]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_27:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_28:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -85,24 +103,32 @@ // CHECK: %[[VAL_29:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_30:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/base/non_adjacency_test_AIE2.mlir b/test/objectFifo-stateful-transform/base/non_adjacency_test_AIE2.mlir index 45d979acf30..843cd21ba0b 100644 --- a/test/objectFifo-stateful-transform/base/non_adjacency_test_AIE2.mlir +++ b/test/objectFifo-stateful-transform/base/non_adjacency_test_AIE2.mlir @@ -31,12 +31,16 @@ // CHECK: %[[VAL_14:.*]] = arith.constant 12 : index // CHECK: %[[VAL_15:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_16:.*]] = %[[VAL_12]] to %[[VAL_14]] step %[[VAL_15]] { -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_6]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_7]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -46,26 +50,34 @@ // CHECK: %[[VAL_20:.*]] = arith.constant 12 : index // CHECK: %[[VAL_21:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_22:.*]] = %[[VAL_18]] to %[[VAL_20]] step %[[VAL_21]] { -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_23:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_24:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -73,14 +85,18 @@ // CHECK: %[[VAL_25:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_26:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/bd_chain_on_memtile/bd_chain_with_repeat_count.mlir b/test/objectFifo-stateful-transform/bd_chain_on_memtile/bd_chain_with_repeat_count.mlir index c4dacd3bb7b..f2bc913677d 100644 --- a/test/objectFifo-stateful-transform/bd_chain_on_memtile/bd_chain_with_repeat_count.mlir +++ b/test/objectFifo-stateful-transform/bd_chain_on_memtile/bd_chain_with_repeat_count.mlir @@ -22,19 +22,25 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb5, repeat_count = 4) // CHECK: ^bb1: // pred: ^bb0 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 // CHECK: aie.end @@ -44,9 +50,11 @@ // CHECK: %mem_1_3 = aie.mem(%{{.*}}tile_1_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/bd_chain_on_memtile/broadcast_with_iterations.mlir b/test/objectFifo-stateful-transform/bd_chain_on_memtile/broadcast_with_iterations.mlir index f20a941eeb4..38d458a7119 100644 --- a/test/objectFifo-stateful-transform/bd_chain_on_memtile/broadcast_with_iterations.mlir +++ b/test/objectFifo-stateful-transform/bd_chain_on_memtile/broadcast_with_iterations.mlir @@ -10,26 +10,34 @@ // CHECK: %memtile_dma_0_1 = aie.memtile_dma(%mem_tile_0_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_input_cons_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_input_cons_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb7, repeat_count = 7) // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_input_cons_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_input_cons_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_input_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 // CHECK: aie.end @@ -39,19 +47,25 @@ // CHECK: %mem_0_2 = aie.mem(%tile_0_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%broadcast_output_0_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_0_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_0_cons_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_0_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_0_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%broadcast_output_0_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_0_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_0_cons_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_0_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_0_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%broadcast_output_0_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_0_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_0_cons_buff_2 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_0_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_0_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end @@ -59,19 +73,25 @@ // CHECK: %mem_0_3 = aie.mem(%tile_0_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%broadcast_output_1_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_1_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_1_cons_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_1_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_1_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%broadcast_output_1_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_1_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_1_cons_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_1_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_1_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%broadcast_output_1_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_1_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_1_cons_buff_2 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_1_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_1_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end @@ -79,19 +99,25 @@ // CHECK: %mem_0_4 = aie.mem(%tile_0_4) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%broadcast_output_2_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_2_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_2_cons_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_2_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_2_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%broadcast_output_2_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_2_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_2_cons_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_2_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_2_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%broadcast_output_2_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_2_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%broadcast_output_2_cons_buff_2 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%broadcast_output_2_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%broadcast_output_2_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/bd_chain_on_memtile/join_with_iterations.mlir b/test/objectFifo-stateful-transform/bd_chain_on_memtile/join_with_iterations.mlir index b64e9e87b32..4f5fdb9512f 100644 --- a/test/objectFifo-stateful-transform/bd_chain_on_memtile/join_with_iterations.mlir +++ b/test/objectFifo-stateful-transform/bd_chain_on_memtile/join_with_iterations.mlir @@ -10,14 +10,18 @@ // CHECK: %mem_0_2 = aie.mem(%tile_0_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%input_small_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_small_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%input_small_buff_0 : memref<256xui8>, 0, 256) -// CHECK: aie.use_lock(%input_small_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_small_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%input_small_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_small_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%input_small_buff_1 : memref<256xui8>, 0, 256) -// CHECK: aie.use_lock(%input_small_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_small_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -25,76 +29,100 @@ // CHECK: %memtile_dma_0_1 = aie.memtile_dma(%mem_tile_0_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb4, repeat_count = 3) // CHECK: ^bb1: // pred: ^bb0 -// CHECK: aie.use_lock(%combined_output_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_0 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%combined_output_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%combined_output_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_1 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%combined_output_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 // CHECK: aie.end // CHECK: ^bb4: // pred: ^bb0 // CHECK: %1 = aie.dma_start(S2MM, 1, ^bb5, ^bb8, repeat_count = 5) // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%combined_output_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_0 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%combined_output_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%combined_output_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_1 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%combined_output_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 // CHECK: aie.end // CHECK: ^bb8: // pred: ^bb4 // CHECK: %2 = aie.dma_start(S2MM, 2, ^bb9, ^bb12, repeat_count = 7) // CHECK: ^bb9: // pred: ^bb8 -// CHECK: aie.use_lock(%combined_output_prod_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_0 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%combined_output_cons_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: // pred: ^bb9 -// CHECK: aie.use_lock(%combined_output_prod_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_1 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%combined_output_cons_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb11: // pred: ^bb10 // CHECK: aie.end // CHECK: ^bb12: // pred: ^bb8 // CHECK: %3 = aie.dma_start(MM2S, 0, ^bb13, ^bb19) // CHECK: ^bb13: // 2 preds: ^bb12, ^bb18 -// CHECK: aie.use_lock(%combined_output_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_0 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%combined_output_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb14 // CHECK: ^bb14: // pred: ^bb13 -// CHECK: aie.use_lock(%combined_output_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_0 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%combined_output_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb15 // CHECK: ^bb15: // pred: ^bb14 -// CHECK: aie.use_lock(%combined_output_cons_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_0 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%combined_output_prod_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb16 // CHECK: ^bb16: // pred: ^bb15 -// CHECK: aie.use_lock(%combined_output_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_1 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%combined_output_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb17 // CHECK: ^bb17: // pred: ^bb16 -// CHECK: aie.use_lock(%combined_output_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_1 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%combined_output_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb18 // CHECK: ^bb18: // pred: ^bb17 -// CHECK: aie.use_lock(%combined_output_cons_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_cons_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%combined_output_buff_1 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%combined_output_prod_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%combined_output_prod_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb13 // CHECK: ^bb19: // pred: ^bb12 // CHECK: aie.end @@ -102,14 +130,18 @@ // CHECK: %mem_0_3 = aie.mem(%tile_0_3) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%input_medium_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_medium_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%input_medium_buff_0 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%input_medium_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_medium_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%input_medium_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_medium_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%input_medium_buff_1 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%input_medium_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_medium_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -117,14 +149,18 @@ // CHECK: %mem_0_4 = aie.mem(%tile_0_4) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%input_large_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_large_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%input_large_buff_0 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%input_large_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_large_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%input_large_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_large_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%input_large_buff_1 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%input_large_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%input_large_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/bd_chain_on_memtile/repeat_chain.mlir b/test/objectFifo-stateful-transform/bd_chain_on_memtile/repeat_chain.mlir index 2009c7cf6ab..81d9f88bae8 100644 --- a/test/objectFifo-stateful-transform/bd_chain_on_memtile/repeat_chain.mlir +++ b/test/objectFifo-stateful-transform/bd_chain_on_memtile/repeat_chain.mlir @@ -20,28 +20,36 @@ // CHECK: %[[MEMTILE_DMA:.*]] = aie.memtile_dma(%[[MEM_TILE]]) { // CHECK: %[[S2MM_START:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4, repeat_count = 4) // CHECK: ^bb1: // pred: ^bb0 -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_0]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_1]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 // CHECK: aie.end // CHECK: ^bb4: // pred: ^bb0 // CHECK: %[[MM2S_START:.*]] = aie.dma_start(MM2S, 0, ^bb5, ^bb7) // CHECK: ^bb5: // 2 preds: ^bb4, ^bb6 -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_0]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_1]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb7: // pred: ^bb4 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/bd_chain_on_memtile/single_iteration.mlir b/test/objectFifo-stateful-transform/bd_chain_on_memtile/single_iteration.mlir index fb66169b1de..067fb2973a5 100644 --- a/test/objectFifo-stateful-transform/bd_chain_on_memtile/single_iteration.mlir +++ b/test/objectFifo-stateful-transform/bd_chain_on_memtile/single_iteration.mlir @@ -20,28 +20,36 @@ // CHECK: %[[MEMTILE_DMA:.*]] = aie.memtile_dma(%[[MEM_TILE]]) { // CHECK: %[[S2MM_START:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // pred: ^bb0 -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_0]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_1]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 // CHECK: aie.end // CHECK: ^bb4: // pred: ^bb0 // CHECK: %[[MM2S_START:.*]] = aie.dma_start(MM2S, 0, ^bb5, ^bb7) // CHECK: ^bb5: // 2 preds: ^bb4, ^bb6 -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_0]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN_CONS_BUFF_1]] : memref<1024xi32>, 0, 1024) -// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[IN_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb7: // pred: ^bb4 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_and_join_with_iterations.mlir b/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_and_join_with_iterations.mlir index a89391837db..53a7355a2fb 100644 --- a/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_and_join_with_iterations.mlir +++ b/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_and_join_with_iterations.mlir @@ -10,102 +10,134 @@ // CHECK: %memtile_dma_0_1 = aie.memtile_dma(%mem_tile_0_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%in_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_0 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%in_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%in_cons_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_0 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%in_cons_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%in_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_1 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%in_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%in_cons_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_1 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%in_cons_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb6, ^bb9, repeat_count = 7) // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%in_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_0 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%in_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%in_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_1 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%in_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: // pred: ^bb7 // CHECK: aie.end // CHECK: ^bb9: // pred: ^bb5 // CHECK: %2 = aie.dma_start(MM2S, 1, ^bb10, ^bb13, repeat_count = 7) // CHECK: ^bb10: // pred: ^bb9 -// CHECK: aie.use_lock(%in_cons_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_0 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%in_cons_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb11: // pred: ^bb10 -// CHECK: aie.use_lock(%in_cons_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%in_cons_buff_1 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%in_cons_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%in_cons_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb12 // CHECK: ^bb12: // pred: ^bb11 // CHECK: aie.end // CHECK: ^bb13: // pred: ^bb9 // CHECK: %3 = aie.dma_start(S2MM, 1, ^bb14, ^bb17, repeat_count = 7) // CHECK: ^bb14: // pred: ^bb13 -// CHECK: aie.use_lock(%out_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_0 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%out_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb15 // CHECK: ^bb15: // pred: ^bb14 -// CHECK: aie.use_lock(%out_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_1 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%out_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb16 // CHECK: ^bb16: // pred: ^bb15 // CHECK: aie.end // CHECK: ^bb17: // pred: ^bb13 // CHECK: %4 = aie.dma_start(S2MM, 2, ^bb18, ^bb21, repeat_count = 7) // CHECK: ^bb18: // pred: ^bb17 -// CHECK: aie.use_lock(%out_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_0 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%out_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb19 // CHECK: ^bb19: // pred: ^bb18 -// CHECK: aie.use_lock(%out_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_1 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%out_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb20 // CHECK: ^bb20: // pred: ^bb19 // CHECK: aie.end // CHECK: ^bb21: // pred: ^bb17 // CHECK: %5 = aie.dma_start(MM2S, 2, ^bb22, ^bb26) // CHECK: ^bb22: // 2 preds: ^bb21, ^bb25 -// CHECK: aie.use_lock(%out_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_0 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%out_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb23 // CHECK: ^bb23: // pred: ^bb22 -// CHECK: aie.use_lock(%out_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_0 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%out_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb24 // CHECK: ^bb24: // pred: ^bb23 -// CHECK: aie.use_lock(%out_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_1 : memref<1024xui8>, 0, 512) -// CHECK: aie.use_lock(%out_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb25 // CHECK: ^bb25: // pred: ^bb24 -// CHECK: aie.use_lock(%out_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%out_buff_1 : memref<1024xui8>, 512, 512) -// CHECK: aie.use_lock(%out_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%out_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb22 // CHECK: ^bb26: // pred: ^bb21 // CHECK: aie.end @@ -113,26 +145,34 @@ // CHECK: %mem_0_2 = aie.mem(%tile_0_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%split_0_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_0_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%split_0_cons_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%split_0_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_0_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%split_0_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_0_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%split_0_cons_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%split_0_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_0_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%join_0_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_0_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%join_0_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%join_0_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_0_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%join_0_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_0_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%join_0_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%join_0_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_0_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end @@ -140,26 +180,34 @@ // CHECK: %mem_0_3 = aie.mem(%tile_0_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%split_1_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_1_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%split_1_cons_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%split_1_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_1_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%split_1_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_1_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%split_1_cons_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%split_1_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%split_1_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%join_1_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_1_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%join_1_buff_0 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%join_1_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_1_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%join_1_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_1_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%join_1_buff_1 : memref<512xui8>, 0, 512) -// CHECK: aie.use_lock(%join_1_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%join_1_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_with_iterations.mlir b/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_with_iterations.mlir index f29d1fe3ed8..5bf39fdaa16 100644 --- a/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_with_iterations.mlir +++ b/test/objectFifo-stateful-transform/bd_chain_on_memtile/split_with_iterations.mlir @@ -10,74 +10,98 @@ // CHECK: %memtile_dma_0_1 = aie.memtile_dma(%mem_tile_0_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb7) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb6 -// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_0 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_0 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_0 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_1 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_1 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_1 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb7: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb8, ^bb11, repeat_count = 2) // CHECK: ^bb8: // pred: ^bb7 -// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_0 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb9: // pred: ^bb8 -// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_1 : memref<1024xui8>, 0, 256) -// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: // pred: ^bb9 // CHECK: aie.end // CHECK: ^bb11: // pred: ^bb7 // CHECK: %2 = aie.dma_start(MM2S, 1, ^bb12, ^bb15, repeat_count = 3) // CHECK: ^bb12: // pred: ^bb11 -// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_0 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb13 // CHECK: ^bb13: // pred: ^bb12 -// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_1, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_1 : memref<1024xui8>, 256, 384) -// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb14 // CHECK: ^bb14: // pred: ^bb13 // CHECK: aie.end // CHECK: ^bb15: // pred: ^bb11 // CHECK: %3 = aie.dma_start(MM2S, 2, ^bb16, ^bb19, repeat_count = 4) // CHECK: ^bb16: // pred: ^bb15 -// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_0 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb17 // CHECK: ^bb17: // pred: ^bb16 -// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_cons_lock_2, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_input_cons_buff_1 : memref<1024xui8>, 640, 384) -// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_input_cons_prod_lock_2, Release, %{{.*}}) // CHECK: aie.next_bd ^bb18 // CHECK: ^bb18: // pred: ^bb17 // CHECK: aie.end @@ -87,14 +111,18 @@ // CHECK: %mem_0_2 = aie.mem(%tile_0_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%small_output_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%small_output_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%small_output_cons_buff_0 : memref<256xui8>, 0, 256) -// CHECK: aie.use_lock(%small_output_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%small_output_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%small_output_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%small_output_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%small_output_cons_buff_1 : memref<256xui8>, 0, 256) -// CHECK: aie.use_lock(%small_output_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%small_output_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -102,14 +130,18 @@ // CHECK: %mem_0_3 = aie.mem(%tile_0_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%medium_output_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%medium_output_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%medium_output_cons_buff_0 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%medium_output_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%medium_output_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%medium_output_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%medium_output_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%medium_output_cons_buff_1 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%medium_output_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%medium_output_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -117,14 +149,18 @@ // CHECK: %mem_0_4 = aie.mem(%tile_0_4) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%large_output_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_output_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_output_cons_buff_0 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%large_output_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_output_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%large_output_cons_prod_lock_0, AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_output_cons_prod_lock_0, AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%large_output_cons_buff_1 : memref<384xui8>, 0, 384) -// CHECK: aie.use_lock(%large_output_cons_cons_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%large_output_cons_cons_lock_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_enforced_depths.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_enforced_depths.mlir index f60fcc11f70..72f4a92a570 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_enforced_depths.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_enforced_depths.mlir @@ -57,12 +57,16 @@ // CHECK: %[[VAL_37:.*]] = arith.constant 12 : index // CHECK: %[[VAL_38:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_39:.*]] = %[[VAL_35]] to %[[VAL_37]] step %[[VAL_38]] { -// CHECK: aie.use_lock(%[[VAL_31]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_29]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_31]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_32]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_30]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_32]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -72,12 +76,16 @@ // CHECK: %[[VAL_43:.*]] = arith.constant 12 : index // CHECK: %[[VAL_44:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_45:.*]] = %[[VAL_41]] to %[[VAL_43]] step %[[VAL_44]] { -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_5]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_7]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_6]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -87,24 +95,36 @@ // CHECK: %[[VAL_49:.*]] = arith.constant 12 : index // CHECK: %[[VAL_50:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_51:.*]] = %[[VAL_47]] to %[[VAL_49]] step %[[VAL_50]] { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_14]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -114,28 +134,38 @@ // CHECK: %[[VAL_55:.*]] = arith.constant 12 : index // CHECK: %[[VAL_56:.*]] = arith.constant 4 : index // CHECK: scf.for %[[VAL_57:.*]] = %[[VAL_53]] to %[[VAL_55]] step %[[VAL_56]] { -// CHECK: aie.use_lock(%[[VAL_19]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_20]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_21]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_15]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_16]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_17]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_19]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_22]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_16]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_17]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_18]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_20]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_19]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_17]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_18]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_15]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_21]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_20]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_18]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_15]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_16]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_22]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -145,33 +175,44 @@ // CHECK: %[[VAL_61:.*]] = arith.constant 12 : index // CHECK: %[[VAL_62:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_63:.*]] = %[[VAL_59]] to %[[VAL_61]] step %[[VAL_62]] { -// CHECK: aie.use_lock(%[[VAL_26]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_27]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_23]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_24]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_26]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_28]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_24]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_25]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_27]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_26]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_25]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_23]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_28]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_64:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_65:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_31]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_29]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_31]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_32]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_30]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_32]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -179,14 +220,18 @@ // CHECK: %[[VAL_66:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_67:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -194,19 +239,25 @@ // CHECK: %[[VAL_68:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_69:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end @@ -214,24 +265,32 @@ // CHECK: %[[VAL_70:.*]] = aie.mem(%[[VAL_3]]) { // CHECK: %[[VAL_71:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[VAL_19]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_15]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_19]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_20]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_16]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_20]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_21]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_17]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_22]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_18]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: aie.end @@ -239,19 +298,25 @@ // CHECK: %[[VAL_72:.*]] = aie.mem(%[[VAL_4]]) { // CHECK: %[[VAL_73:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_26]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_23]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_26]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_27]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_24]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_27]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_28]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_25]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_28]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_self_adjusted_depths.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_self_adjusted_depths.mlir index 10906b54804..0d9563af09a 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_self_adjusted_depths.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/broadcast_self_adjusted_depths.mlir @@ -57,12 +57,16 @@ // CHECK: %[[VAL_37:.*]] = arith.constant 12 : index // CHECK: %[[VAL_38:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_39:.*]] = %[[VAL_35]] to %[[VAL_37]] step %[[VAL_38]] { -// CHECK: aie.use_lock(%[[VAL_31]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_29]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_31]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_32]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_30]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_32]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -72,12 +76,16 @@ // CHECK: %[[VAL_43:.*]] = arith.constant 12 : index // CHECK: %[[VAL_44:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_45:.*]] = %[[VAL_41]] to %[[VAL_43]] step %[[VAL_44]] { -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_5]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_7]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_6]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -87,24 +95,36 @@ // CHECK: %[[VAL_49:.*]] = arith.constant 12 : index // CHECK: %[[VAL_50:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_51:.*]] = %[[VAL_47]] to %[[VAL_49]] step %[[VAL_50]] { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_9]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_14]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_11]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -114,28 +134,38 @@ // CHECK: %[[VAL_55:.*]] = arith.constant 12 : index // CHECK: %[[VAL_56:.*]] = arith.constant 4 : index // CHECK: scf.for %[[VAL_57:.*]] = %[[VAL_53]] to %[[VAL_55]] step %[[VAL_56]] { -// CHECK: aie.use_lock(%[[VAL_19]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_20]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_21]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_15]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_16]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_17]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_19]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_22]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_16]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_17]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_18]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_20]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_19]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_17]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_18]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_15]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_21]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_20]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_18]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_15]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_16]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_22]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } @@ -145,33 +175,44 @@ // CHECK: %[[VAL_61:.*]] = arith.constant 12 : index // CHECK: %[[VAL_62:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_63:.*]] = %[[VAL_59]] to %[[VAL_61]] step %[[VAL_62]] { -// CHECK: aie.use_lock(%[[VAL_26]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_27]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_23]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_24]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_26]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_28]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_24]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_25]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_27]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_26]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_25]]) : (memref<16xi32>) -> () // CHECK: func.call @some_work(%[[VAL_23]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_28]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_64:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_65:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_31]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_29]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_31]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_31]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_32]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_30]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_32]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_32]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -179,14 +220,18 @@ // CHECK: %[[VAL_66:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_67:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -194,19 +239,25 @@ // CHECK: %[[VAL_68:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_69:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end @@ -214,24 +265,32 @@ // CHECK: %[[VAL_70:.*]] = aie.mem(%[[VAL_3]]) { // CHECK: %[[VAL_71:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[VAL_19]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_15]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_19]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_20]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_16]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_20]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_21]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_17]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_22]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_18]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: aie.end @@ -239,19 +298,25 @@ // CHECK: %[[VAL_72:.*]] = aie.mem(%[[VAL_4]]) { // CHECK: %[[VAL_73:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_26]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_23]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_26]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_27]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_24]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_27]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_27]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_28]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_25]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_28]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_28]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_AIE1.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_AIE1.mlir index d04b114bc4a..a4800c881dd 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_AIE1.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_AIE1.mlir @@ -23,9 +23,11 @@ // CHECK: %[[VAL_9:.*]] = aie.shim_dma(%[[VAL_0]]) { // CHECK: %[[VAL_10:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -34,14 +36,18 @@ // CHECK: %[[VAL_11:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_12:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_DDR_to_L1_AIE2.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_DDR_to_L1_AIE2.mlir index 6351f5b6c83..09b2504c1de 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_DDR_to_L1_AIE2.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_DDR_to_L1_AIE2.mlir @@ -29,9 +29,11 @@ // CHECK: %[[VAL_14:.*]] = aie.shim_dma(%[[VAL_0]]) { // CHECK: %[[VAL_15:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -40,26 +42,34 @@ // CHECK: %[[VAL_16:.*]] = aie.memtile_dma(%[[VAL_1]]) { // CHECK: %[[VAL_17:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %[[VAL_18:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end @@ -67,14 +77,18 @@ // CHECK: %[[VAL_19:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_20:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_L1_to_DDR_AIE2.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_L1_to_DDR_AIE2.mlir index b9e43fd76cf..d2dfff77fd4 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_L1_to_DDR_AIE2.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_L1_to_DDR_AIE2.mlir @@ -29,14 +29,18 @@ // CHECK: %[[VAL_14:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_15:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -44,26 +48,34 @@ // CHECK: %[[VAL_16:.*]] = aie.memtile_dma(%[[VAL_1]]) { // CHECK: %[[VAL_17:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %[[VAL_18:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end @@ -71,9 +83,11 @@ // CHECK: %[[VAL_19:.*]] = aie.shim_dma(%[[VAL_0]]) { // CHECK: %[[VAL_20:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast.mlir index ccce987168f..7f851ba3aef 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast.mlir @@ -39,14 +39,16 @@ // CHECK: %[[VAL_25:.*]] = aie.core(%[[VAL_2]]) { // CHECK: %[[VAL_26:.*]] = arith.constant 11 : i32 // CHECK: %[[VAL_27:.*]] = arith.constant 0 : index -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %[[VAL_26]], %[[VAL_10]]{{\[}}%[[VAL_27]]] : memref<3000xi32> // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_28:.*]] = aie.core(%[[VAL_3]]) { // CHECK: %[[VAL_29:.*]] = arith.constant 11 : i32 // CHECK: %[[VAL_30:.*]] = arith.constant 0 : index -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: memref.store %[[VAL_29]], %[[VAL_4]]{{\[}}%[[VAL_30]]] : memref<3000xi32> // CHECK: aie.end // CHECK: } @@ -54,14 +56,18 @@ // CHECK: %[[VAL_31:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_32:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -69,76 +75,104 @@ // CHECK: %[[VAL_33:.*]] = aie.memtile_dma(%[[VAL_1]]) { // CHECK: %[[VAL_34:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb8) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb7 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_14]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_15]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_16]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_17]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_18]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_19]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_20]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_22]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb8: // pred: ^bb0 // CHECK: %[[VAL_35:.*]] = aie.dma_start(MM2S, 0, ^bb9, ^bb16) // CHECK: ^bb9: // 2 preds: ^bb8, ^bb15 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_14]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: // pred: ^bb9 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_15]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb11: // pred: ^bb10 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_16]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb12 // CHECK: ^bb12: // pred: ^bb11 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_17]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb13 // CHECK: ^bb13: // pred: ^bb12 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_18]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb14 // CHECK: ^bb14: // pred: ^bb13 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_19]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb15 // CHECK: ^bb15: // pred: ^bb14 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_20]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_21]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb16: // pred: ^bb8 // CHECK: aie.end @@ -146,24 +180,32 @@ // CHECK: %[[VAL_36:.*]] = aie.mem(%[[VAL_3]]) { // CHECK: %[[VAL_37:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<3000xi32>, 0, 3000) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast_skip_connection.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast_skip_connection.mlir index d920aa0b7ad..11c8dc1e3fc 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast_skip_connection.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_broadcast_skip_connection.mlir @@ -43,26 +43,34 @@ // CHECK: %[[VAL_27:.*]] = aie.memtile_dma(%[[VAL_1]]) { // CHECK: %[[VAL_28:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_23]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_23]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_21]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_24]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_24]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_23]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_23]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_22]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_24]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_24]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %[[VAL_29:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%[[VAL_24]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_24]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_21]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_23]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_23]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_24]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_24]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_22]] : memref<48xi32>, 0, 48) -// CHECK: aie.use_lock(%[[VAL_23]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_23]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end @@ -70,26 +78,34 @@ // CHECK: %[[VAL_30:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_31:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %[[VAL_32:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end @@ -97,31 +113,41 @@ // CHECK: %[[VAL_33:.*]] = aie.mem(%[[VAL_3]]) { // CHECK: %[[VAL_34:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_16]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_20]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_17]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_20]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_18]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_20]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: %[[VAL_35:.*]] = aie.dma_start(S2MM, 1, ^bb5, ^bb7) // CHECK: ^bb5: // 2 preds: ^bb4, ^bb6 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb7: // pred: ^bb4 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_offsets.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_offsets.mlir index 1216d29d11d..a7fd9c8994b 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_offsets.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_offsets.mlir @@ -44,70 +44,94 @@ // CHECK: %memtile_dma_2_1 = aie.memtile_dma(%{{.*}}tile_2_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb7) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb6 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_18]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[VAL_19]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%[[VAL_18]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[VAL_19]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb7: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb8, ^bb10) // CHECK: ^bb8: // 2 preds: ^bb7, ^bb9 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb9: // pred: ^bb8 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_14]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb10: // pred: ^bb7 // CHECK: %2 = aie.dma_start(MM2S, 1, ^bb11, ^bb13) // CHECK: ^bb11: // 2 preds: ^bb10, ^bb12 -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb12 // CHECK: ^bb12: // pred: ^bb11 -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb13: // pred: ^bb10 // CHECK: %3 = aie.dma_start(MM2S, 2, ^bb14, ^bb16) // CHECK: ^bb14: // 2 preds: ^bb13, ^bb15 -// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[VAL_18]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb15 // CHECK: ^bb15: // pred: ^bb14 -// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_19]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[VAL_18]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_18]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb14 // CHECK: ^bb16: // pred: ^bb13 // CHECK: aie.end @@ -115,14 +139,18 @@ // CHECK: %mem_2_2 = aie.mem(%{{.*}}tile_2_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<4x4xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<4x4xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -130,14 +158,18 @@ // CHECK: %mem_2_3 = aie.mem(%{{.*}}tile_2_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<20xi32>, 0, 20) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<20xi32>, 0, 20) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -145,14 +177,18 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<12xi32>, 0, 12) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<12xi32>, 0, 12) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_output_sizes.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_output_sizes.mlir index 69f39fe3fd0..07944ddb942 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_output_sizes.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_distribute_output_sizes.mlir @@ -35,28 +35,36 @@ // CHECK: %memtile_dma_2_1 = aie.memtile_dma(%{{.*}}tile_2_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<64xi32>, 0, 32) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<64xi32>, 32, 32) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb5) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb4 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<64xi32>, 0, 32) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb5: // pred: ^bb3 // CHECK: %2 = aie.dma_start(MM2S, 1, ^bb6, ^bb7) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb6 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<64xi32>, 32, 32) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb7: // pred: ^bb5 // CHECK: aie.end @@ -64,14 +72,18 @@ // CHECK: %mem_2_2 = aie.mem(%{{.*}}tile_2_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -79,14 +91,18 @@ // CHECK: %mem_2_3 = aie.mem(%{{.*}}tile_2_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_join_offsets.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_join_offsets.mlir index 1b5bb558fb3..5be483e1672 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_join_offsets.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_join_offsets.mlir @@ -43,14 +43,18 @@ // CHECK: %mem_2_2 = aie.mem(%{{.*}}tile_2_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[LINK1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK1_BUFF_0]] : memref<4x4xi32>, 0, 16) -// CHECK: aie.use_lock(%[[LINK1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[LINK1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK1_BUFF_1]] : memref<4x4xi32>, 0, 16) -// CHECK: aie.use_lock(%[[LINK1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -58,70 +62,94 @@ // CHECK: %memtile_dma_2_1 = aie.memtile_dma(%{{.*}}tile_2_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_0]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_1]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_0]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_1]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: %2 = aie.dma_start(S2MM, 2, ^bb7, ^bb9) // CHECK: ^bb7: -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_0]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_1]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb9: // CHECK: %3 = aie.dma_start(MM2S, 0, ^bb10, ^bb16) // CHECK: ^bb10: -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_0]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb11: -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_0]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb12 // CHECK: ^bb12: -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_0]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb13 // CHECK: ^bb13: -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_1]] : memref<48xi32>, 0, 16) -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb14 // CHECK: ^bb14: -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_1]] : memref<48xi32>, 16, 20) -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb15 // CHECK: ^bb15: -// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_CONS_LOCK_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK4_BUFF_1]] : memref<48xi32>, 36, 12) -// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK4_PROD_LOCK_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb16: // CHECK: aie.end @@ -129,14 +157,18 @@ // CHECK: %mem_2_3 = aie.mem(%{{.*}}tile_2_3) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[LINK2_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK2_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK2_BUFF_0]] : memref<20xi32>, 0, 20) -// CHECK: aie.use_lock(%[[LINK2_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK2_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[LINK2_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK2_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK2_BUFF_1]] : memref<20xi32>, 0, 20) -// CHECK: aie.use_lock(%[[LINK2_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK2_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -144,14 +176,18 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[LINK3_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK3_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK3_BUFF_0]] : memref<12xi32>, 0, 12) -// CHECK: aie.use_lock(%[[LINK3_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK3_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[LINK3_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK3_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK3_BUFF_1]] : memref<12xi32>, 0, 12) -// CHECK: aie.use_lock(%[[LINK3_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK3_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem.mlir index cb6cac0dbe8..5ce1adfd4f4 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem.mlir @@ -28,35 +28,45 @@ //CHECK: return //CHECK: } //CHECK: %core_2_2 = aie.core(%{{.*}}tile_2_2) { -//CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, %{{.*}}) //CHECK: func.call @some_work(%[[VAL_0]]) : (memref<16xi32>) -> () -//CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) //CHECK: aie.end //CHECK: } //CHECK: aie.shim_dma_allocation @of1_shim_alloc(%shim_noc_tile_2_0, MM2S, 0) //CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { //CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) //CHECK: ^bb1: -//CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb2 //CHECK: ^bb2: -//CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb1 //CHECK: ^bb3: //CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) //CHECK: ^bb4: -//CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb5 //CHECK: ^bb5: -//CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb4 //CHECK: ^bb6: //CHECK: aie.end @@ -64,14 +74,18 @@ //CHECK: %mem_2_2 = aie.mem(%{{.*}}tile_2_2) { //CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) //CHECK: ^bb1: -//CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb2 //CHECK: ^bb2: -//CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb1 //CHECK: ^bb3: //CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem2.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem2.mlir index 695231b3e60..2563fee17c5 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem2.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem2.mlir @@ -20,14 +20,18 @@ //CHECK: %[[VAL_11:.*]] = aie.mem(%[[VAL_1]]) { //CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) //CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -//CHECK: aie.use_lock(%[[VAL_5:.*]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_5:.*]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_3:.*]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_6:.*]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_6:.*]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb2 //CHECK: ^bb2: // pred: ^bb1 -//CHECK: aie.use_lock(%[[VAL_5:.*]], AcquireGreaterEqual, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_5:.*]], AcquireGreaterEqual, %{{.*}}) //CHECK: aie.dma_bd(%[[VAL_4:.*]] : memref<16xi32>, 0, 16) -//CHECK: aie.use_lock(%[[VAL_6:.*]], Release, 1) +//CHECK: %{{.*}} = arith.constant 1 : i32 +//CHECK: aie.use_lock(%[[VAL_6:.*]], Release, %{{.*}}) //CHECK: aie.next_bd ^bb1 //CHECK: ^bb3: // pred: ^bb0 //CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem3.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem3.mlir index be263747a95..7736c92f642 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem3.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem3.mlir @@ -19,14 +19,18 @@ // CHECK: %[[VAL_6:.*]] = aie.mem(%{{.*}}tile_1_2) { // CHECK: %[[VAL_7:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_diff_memref.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_diff_memref.mlir index a6b3b55e3ca..32e37e43a4f 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_diff_memref.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_diff_memref.mlir @@ -26,26 +26,34 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<32xi32>, 0, 32) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<32xi32>, 0, 32) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end @@ -53,14 +61,18 @@ // CHECK: %mem_2_2 = aie.mem(%{{.*}}tile_2_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_padDimensions.mlir b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_padDimensions.mlir index 065ab63586c..d2fe0f16060 100644 --- a/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_padDimensions.mlir +++ b/test/objectFifo-stateful-transform/data_movement_patterns/link/link_via_shared_mem_padDimensions.mlir @@ -34,28 +34,36 @@ // CHECK: %memtile_dma_0_1 = aie.memtile_dma(%{{.*}}tile_0_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[MT_PROD]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_PROD]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[MT_BUF0]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[MT_CONS]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_CONS]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[MT_PROD]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_PROD]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[MT_BUF1]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[MT_CONS]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_CONS]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // MemTile DMA: MM2S sends 512 elements with padding (output size) // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[MT_CONS]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_CONS]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[MT_BUF0]] : memref<256xi32>, 0, 512, [, ], [, ]) -// CHECK: aie.use_lock(%[[MT_PROD]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_PROD]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[MT_CONS]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_CONS]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[MT_BUF1]] : memref<256xi32>, 0, 512, [, ], [, ]) -// CHECK: aie.use_lock(%[[MT_PROD]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[MT_PROD]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end @@ -65,14 +73,18 @@ // CHECK: %mem_0_2 = aie.mem(%{{.*}}tile_0_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OUT_PROD]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT_PROD]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT_BUF0]] : memref<512xi32>, 0, 512) -// CHECK: aie.use_lock(%[[OUT_CONS]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT_CONS]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OUT_PROD]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT_PROD]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT_BUF1]] : memref<512xi32>, 0, 512) -// CHECK: aie.use_lock(%[[OUT_CONS]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OUT_CONS]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_distribute.mlir b/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_distribute.mlir index d589154a272..eeb450c310b 100644 --- a/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_distribute.mlir +++ b/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_distribute.mlir @@ -26,9 +26,11 @@ // CHECK: %{{.*}} = aie.mem(%[[TILE_2_2]]) { // CHECK: %{{.*}} = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[LINK1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK1_BUFF]] : memref<4x4xi32>, 0, 16) -// CHECK: aie.use_lock(%[[LINK1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: aie.end @@ -57,9 +59,11 @@ // CHECK: %{{.*}} = aie.mem(%[[TILE_2_3]]) { // CHECK: %{{.*}} = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[LINK2_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK2_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[LINK2_BUFF]] : memref<20xi32>, 0, 20) -// CHECK: aie.use_lock(%[[LINK2_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LINK2_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_join.mlir b/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_join.mlir index 50ea3d4492e..f905174da44 100644 --- a/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_join.mlir +++ b/test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_join.mlir @@ -48,9 +48,11 @@ // CHECK: %mem_2_2 = aie.mem(%{{.*}}tile_2_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<4x4xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -58,9 +60,11 @@ // CHECK: %mem_2_3 = aie.mem(%{{.*}}tile_2_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<20xi32>, 0, 20) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/debug_features/via_DMA_test.mlir b/test/objectFifo-stateful-transform/debug_features/via_DMA_test.mlir index 903e5eff48f..5c1879f90a9 100644 --- a/test/objectFifo-stateful-transform/debug_features/via_DMA_test.mlir +++ b/test/objectFifo-stateful-transform/debug_features/via_DMA_test.mlir @@ -27,14 +27,18 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -42,14 +46,18 @@ // CHECK: %mem_1_3 = aie.mem(%{{.*}}tile_1_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/dma_channel_alloc/memtileDMA_test.mlir b/test/objectFifo-stateful-transform/dma_channel_alloc/memtileDMA_test.mlir index 3839bbcd8ac..761d148f597 100644 --- a/test/objectFifo-stateful-transform/dma_channel_alloc/memtileDMA_test.mlir +++ b/test/objectFifo-stateful-transform/dma_channel_alloc/memtileDMA_test.mlir @@ -28,33 +28,43 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(MM2S, 1, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%lock_1_1, Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%lock_1_1, Acquire, %{{.*}}) // CHECK: aie.dma_bd(%buffer_1_1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%lock_1_1, Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%lock_1_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%lock_1_1_1, Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%lock_1_1_1, Acquire, %{{.*}}) // CHECK: aie.dma_bd(%buffer_1_1_0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%lock_1_1_1, Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%lock_1_1_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %1 = aie.dma_start(S2MM, 0, ^bb4, ^bb5) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb4 -// CHECK: aie.use_lock(%lock_1_1_3, Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%lock_1_1_3, Acquire, %{{.*}}) // CHECK: aie.dma_bd(%buffer_1_1_2 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%lock_1_1_3, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%lock_1_1_3, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb5: // pred: ^bb3 // CHECK: %2 = aie.dma_start(MM2S, 0, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: aie.end @@ -62,14 +72,18 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -93,21 +107,27 @@ module @memtileDMA_channels { %mem12 = aie.memtile_dma(%tile11) { %dma1 = aie.dma_start(MM2S, 1, ^bb1, ^bb3) ^bb1: - aie.use_lock(%lock0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock0, Acquire, %c1_ul0) aie.dma_bd(%buff0 : memref<16xi32>, 0, 16) - aie.use_lock(%lock0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock0, Release, %c0_ul1) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buff1 : memref<16xi32>, 0, 16) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bb1 ^bb3: %dma2 = aie.dma_start(S2MM, 0, ^bb4, ^bb5) ^bb4: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul4) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%lock2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: aie.end diff --git a/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test.mlir b/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test.mlir index b82f1bdbdf7..f9731f87dcd 100644 --- a/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test.mlir +++ b/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test.mlir @@ -27,28 +27,36 @@ // CHECK: %shim_dma_2_0 = aie.shim_dma(%{{.*}}tile_2_0) { // CHECK: %3 = aie.dma_start(MM2S, 1, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%lock_2_0, Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%lock_2_0, Acquire, %{{.*}}) // CHECK: aie.dma_bd(%0 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%lock_2_0, Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%lock_2_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%lock_2_0_0, Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%lock_2_0_0, Acquire, %{{.*}}) // CHECK: aie.dma_bd(%1 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%lock_2_0_0, Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%lock_2_0_0, Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %4 = aie.dma_start(S2MM, 0, ^bb4, ^bb5) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb4 -// CHECK: aie.use_lock(%lock_2_0_1, Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%lock_2_0_1, Acquire, %{{.*}}) // CHECK: aie.dma_bd(%2 : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%lock_2_0_1, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%lock_2_0_1, Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb5: // pred: ^bb3 // CHECK: %5 = aie.dma_start(MM2S, 0, ^bb6, ^bb7) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb6 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%ext_buffer_in : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb7: // pred: ^bb5 // CHECK: aie.end @@ -57,14 +65,18 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %3 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -91,21 +103,27 @@ module @shimtileDMA_channels { %mem12 = aie.shim_dma(%tile20) { %dma1 = aie.dma_start(MM2S, 1, ^bb1, ^bb3) ^bb1: - aie.use_lock(%lock0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock0, Acquire, %c1_ul0) aie.dma_bd(%buff0 : memref<16xi32>, 0, 16) - aie.use_lock(%lock0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock0, Release, %c0_ul1) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buff1 : memref<16xi32>, 0, 16) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bb1 ^bb3: %dma2 = aie.dma_start(S2MM, 0, ^bb4, ^bb5) ^bb4: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul4) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%lock2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: aie.end diff --git a/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad.mlir b/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad.mlir index 94742b3d585..29871ab3199 100644 --- a/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad.mlir +++ b/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad.mlir @@ -26,21 +26,27 @@ module @shimtileDMA_channels { %mem12 = aie.shim_dma(%tile20) { %dma1 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) ^bb1: - aie.use_lock(%lock0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock0, Acquire, %c1_ul0) aie.dma_bd(%buff0 : memref<16xi32>, 0, 16) - aie.use_lock(%lock0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock0, Release, %c0_ul1) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buff1 : memref<16xi32>, 0, 16) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bb1 ^bb3: %dma2 = aie.dma_start(MM2S, 1, ^bb4, ^bb5) ^bb4: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul4) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%lock2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: aie.end diff --git a/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad2.mlir b/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad2.mlir index 5e8620cb6d6..779ec11c089 100644 --- a/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad2.mlir +++ b/test/objectFifo-stateful-transform/dma_channel_alloc/shimtileDMA_test_bad2.mlir @@ -26,21 +26,27 @@ module @shimtileDMA_channels { %mem12 = aie.shim_dma(%tile20) { %dma1 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: - aie.use_lock(%lock0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock0, Acquire, %c1_ul0) aie.dma_bd(%buff0 : memref<16xi32>, 0, 16) - aie.use_lock(%lock0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock0, Release, %c0_ul1) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buff1 : memref<16xi32>, 0, 16) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bb1 ^bb3: %dma2 = aie.dma_start(S2MM, 1, ^bb4, ^bb5) ^bb4: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul4) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%lock2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: aie.end diff --git a/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test.mlir b/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test.mlir index a7e63edb01d..71821139eb7 100644 --- a/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test.mlir +++ b/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test.mlir @@ -37,45 +37,59 @@ // CHECK: %[[VAL_20:.*]] = arith.constant 12 : index // CHECK: %[[VAL_21:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_22:.*]] = %[[VAL_18]] to %[[VAL_20]] step %[[VAL_21]] { -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_6]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_7]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_23:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_24:.*]] = aie.dma_start(MM2S, 1, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %[[VAL_25:.*]] = aie.dma_start(S2MM, 0, ^bb4, ^bb5) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb4 -// CHECK: aie.use_lock(%[[VAL_15]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_14]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb5: // pred: ^bb3 // CHECK: %[[VAL_26:.*]] = aie.dma_start(MM2S, 0, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: aie.end @@ -83,14 +97,18 @@ // CHECK: %[[VAL_27:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_28:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -133,21 +151,27 @@ module @tileDMA_channels { %mem12 = aie.mem(%tile12) { %dma1 = aie.dma_start(MM2S, 1, ^bb1, ^bb3) ^bb1: - aie.use_lock(%lock0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock0, Acquire, %c1_ul0) aie.dma_bd(%buff0 : memref<16xi32>, 0, 16) - aie.use_lock(%lock0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock0, Release, %c0_ul1) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buff1 : memref<16xi32>, 0, 16) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bb1 ^bb3: %dma2 = aie.dma_start(S2MM, 0, ^bb4, ^bb5) ^bb4: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul4) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%lock2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: aie.end diff --git a/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad.mlir b/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad.mlir index db7438c3709..f5c338c7ec6 100644 --- a/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad.mlir +++ b/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad.mlir @@ -26,21 +26,27 @@ module @tileDMA_channels { %mem12 = aie.mem(%tile12) { %dma1 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) ^bb1: - aie.use_lock(%lock0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock0, Acquire, %c1_ul0) aie.dma_bd(%buff0 : memref<16xi32>, 0, 16) - aie.use_lock(%lock0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock0, Release, %c0_ul1) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buff1 : memref<16xi32>, 0, 16) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bb1 ^bb3: %dma2 = aie.dma_start(MM2S, 1, ^bb4, ^bb5) ^bb4: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul4) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%lock2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: aie.end diff --git a/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad2.mlir b/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad2.mlir index 9df7796e42d..518682f2080 100644 --- a/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad2.mlir +++ b/test/objectFifo-stateful-transform/dma_channel_alloc/tileDMA_test_bad2.mlir @@ -26,21 +26,27 @@ module @tileDMA_channels { %mem12 = aie.mem(%tile12) { %dma1 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) ^bb1: - aie.use_lock(%lock0, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock0, Acquire, %c1_ul0) aie.dma_bd(%buff0 : memref<16xi32>, 0, 16) - aie.use_lock(%lock0, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock0, Release, %c0_ul1) aie.next_bd ^bb2 ^bb2: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul2) aie.dma_bd(%buff1 : memref<16xi32>, 0, 16) - aie.use_lock(%lock1, Release, 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul3) aie.next_bd ^bb1 ^bb3: %dma2 = aie.dma_start(S2MM, 1, ^bb4, ^bb5) ^bb4: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul4) aie.dma_bd(%buff2 : memref<16xi32>, 0, 16) - aie.use_lock(%lock2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul5) aie.next_bd ^bb4 ^bb5: aie.end diff --git a/test/objectFifo-stateful-transform/dma_transformations/memtile_padding_test.mlir b/test/objectFifo-stateful-transform/dma_transformations/memtile_padding_test.mlir index 0129c558b7b..d4334ecec5a 100644 --- a/test/objectFifo-stateful-transform/dma_transformations/memtile_padding_test.mlir +++ b/test/objectFifo-stateful-transform/dma_transformations/memtile_padding_test.mlir @@ -34,8 +34,10 @@ // CHECK-DAG: aie.flow(%[[COMP_TILE]], DMA : 0, %[[MEM_TILE]], DMA : 1) // CHECK-DAG: aie.flow(%[[MEM_TILE]], DMA : 1, %[[SHIM_TILE]], DMA : 0) // CHECK: %core_0_2 = aie.core(%[[COMP_TILE]]) { - // CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) - // CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: %c0 = arith.constant 0 : index // CHECK: %c1 = arith.constant 1 : index // CHECK: %c64 = arith.constant 64 : index @@ -47,8 +49,10 @@ // CHECK: memref.store %1, %[[IN1_CONS_BUFF_0]][%arg0, %arg1] : memref<64x64xi8> // CHECK: } // CHECK: } - // CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], Release, 1) - // CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], Release, %{{.*}}) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: aie.runtime_sequence(%arg0: memref<61x56xi8>, %arg1: memref<32xi8>, %arg2: memref<64x64xi8>) { @@ -60,50 +64,66 @@ // CHECK: %memtile_dma_0_1 = aie.memtile_dma(%[[MEM_TILE]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: - // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_BUFF_0]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: - // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_BUFF_1]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: - // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_BUFF_0]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: - // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_BUFF_1]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: %2 = aie.dma_start(S2MM, 1, ^bb7, ^bb9) // CHECK: ^bb7: - // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_0]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: - // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_1]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb9: // CHECK: %3 = aie.dma_start(MM2S, 1, ^bb10, ^bb12) // CHECK: ^bb10: - // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_0]] : memref<64x64xi8>, 0, 4096, [, ], [, ]) - // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb11: - // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_CONS_BUFF_1]] : memref<64x64xi8>, 0, 4096, [, ], [, ]) - // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb12: // CHECK: aie.end @@ -111,26 +131,34 @@ // CHECK: %mem_0_2 = aie.mem(%[[COMP_TILE]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: - // CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_CONS_BUFF_0]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: - // CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[IN1_CONS_BUFF_1]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[IN1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: - // CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_BUFF_0]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: - // CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OUT1_BUFF_1]] : memref<64x64xi8>, 0, 4096) - // CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, 1) + // CHECK: %{{.*}} = arith.constant 1 : i32 + // CHECK: aie.use_lock(%[[OUT1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_base_AIE2.mlir b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_base_AIE2.mlir index 2537dd19436..2509b081105 100644 --- a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_base_AIE2.mlir +++ b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_base_AIE2.mlir @@ -40,36 +40,48 @@ // CHECK: %[[VAL_23:.*]] = aie.mem(%[[tile_1_2]]) { // CHECK: %[[VAL_26:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_0]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_1]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_2]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_3]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %[[VAL_27:.*]] = aie.dma_start(MM2S, 1, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_buff_0]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_buff_1]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: aie.end @@ -77,24 +89,32 @@ // CHECK: %[[VAL_24:.*]] = aie.mem(%[[tile_1_3]]) { // CHECK: %[[VAL_26:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_cons_buff_0]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_cons_buff_1]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_cons_buff_2]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_cons_buff_3]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: aie.end @@ -102,14 +122,18 @@ // CHECK: %[[VAL_25:.*]] = aie.mem(%[[tile_3_3]]) { // CHECK: %[[VAL_26:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_cons_buff_0]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_cons_buff_1]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_AIE2.mlir b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_AIE2.mlir index c2117ff3625..9ffba7e767d 100644 --- a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_AIE2.mlir +++ b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_AIE2.mlir @@ -38,48 +38,64 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 128, 128) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<256xi32>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<256xi32>, 128, 128) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 0, 128, [, , , ]) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<256xi32>, 0, 128, [, , , ]) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: %2 = aie.dma_start(MM2S, 1, ^bb9, ^bb11) // CHECK: ^bb9: // 2 preds: ^bb8, ^bb10 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<256xi32>, 512, 128, [, , , ]) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: // pred: ^bb9 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<256xi32>, 512, 128, [, , , ]) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb11: // pred: ^bb8 // CHECK: aie.end @@ -87,14 +103,18 @@ // CHECK: %mem_2_2 = aie.mem(%[[tile_2_2:.*]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -102,14 +122,18 @@ // CHECK: %mem_2_3 = aie.mem(%[[tile_2_3:.*]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_broadcast_AIE2.mlir b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_broadcast_AIE2.mlir index e380b725f4f..3ee780d2f4d 100644 --- a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_broadcast_AIE2.mlir +++ b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_distribute_broadcast_AIE2.mlir @@ -45,48 +45,64 @@ // CHECK: %{{.+}} = aie.memtile_dma(%[[TILE_1_1]]) { // CHECK: %[[VAL_0:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_0]] : memref<256xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_0]] : memref<256xi32>, 128, 128) -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_1]] : memref<256xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_1]] : memref<256xi32>, 128, 128) -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %[[VAL_1:.*]] = aie.dma_start(MM2S, 0, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_0]] : memref<256xi32>, 0, 128, [, , , ]) -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_1]] : memref<256xi32>, 0, 128, [, , , ]) -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: %[[VAL_2:.*]] = aie.dma_start(MM2S, 1, ^bb9, ^bb11) // CHECK: ^bb9: // 2 preds: ^bb8, ^bb10 -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_0]] : memref<256xi32>, 128, 128, [, , , ]) -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: // pred: ^bb9 -// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_CONS_BUFF_1]] : memref<256xi32>, 128, 128, [, , , ]) -// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb11: // pred: ^bb8 // CHECK: aie.end @@ -94,14 +110,18 @@ // CHECK: %{{.+}} = aie.mem(%[[TILE_1_2]]) { // CHECK: %{{.+}} = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF1_0_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_0_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_0_CONS_BUFF_0]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF1_0_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_0_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF1_0_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_0_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_0_CONS_BUFF_1]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF1_0_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_0_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -109,14 +129,18 @@ // CHECK: %{{.+}} = aie.mem(%[[TILE_2_2]]) { // CHECK: %{{.+}} = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF1_1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_1_CONS_BUFF_0]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF1_1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF1_1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_1_CONS_BUFF_1]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF1_1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -124,14 +148,18 @@ // CHECK: %{{.+}} = aie.mem(%[[TILE_1_3]]) { // CHECK: %{{.+}} = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_0_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_0_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_0_CONS_BUFF_0]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF2_0_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_0_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF2_0_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_0_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_0_CONS_BUFF_1]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF2_0_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_0_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -139,14 +167,18 @@ // CHECK: %{{.+}} = aie.mem(%[[TILE_2_3]]) { // CHECK: %{{.+}} = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_1_CONS_BUFF_0]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF2_1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF2_1_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_1_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_1_CONS_BUFF_1]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF2_1_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_1_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_fromStream_join.mlir b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_fromStream_join.mlir index 3426e63660a..77626420dec 100644 --- a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_fromStream_join.mlir +++ b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_fromStream_join.mlir @@ -37,14 +37,18 @@ // CHECK: %mem_1_2 = aie.mem(%[[TILE_1_2]]) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_BUFF_0]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_BUFF_1]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -52,48 +56,64 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%[[TILE_1_1]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<256xi32>, 0, 128, []) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<256xi32>, 0, 128, []) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<256xi32>, 128, 128, []) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<256xi32>, 128, 128, []) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: %2 = aie.dma_start(MM2S, 0, ^bb7, ^bb11) // CHECK: ^bb7: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<256xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<256xi32>, 128, 128) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb9: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<256xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<256xi32>, 128, 128) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb11: // CHECK: aie.end @@ -101,14 +121,18 @@ // CHECK: %mem_3_3 = aie.mem(%[[TILE_3_3]]) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_BUFF_0]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_BUFF_1]] : memref<128xi32>, 0, 128) -// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -116,14 +140,18 @@ // CHECK: %mem_2_3 = aie.mem(%[[TILE_2_3]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_CONS_BUFF_0]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[OF2_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF2_CONS_PROD_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_PROD_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_CONS_BUFF_1]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[OF2_CONS_CONS_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_CONS_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_multiple_consumers_AIE2.mlir b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_multiple_consumers_AIE2.mlir index c5e2897e4a8..2308d46811f 100644 --- a/test/objectFifo-stateful-transform/dma_transformations/nd_dma_multiple_consumers_AIE2.mlir +++ b/test/objectFifo-stateful-transform/dma_transformations/nd_dma_multiple_consumers_AIE2.mlir @@ -58,36 +58,48 @@ // CHECK: %[[VAL_39:.*]] = aie.mem(%[[tile_1_2]]) { // CHECK: %[[VAL_44:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_0]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_1]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_2]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_buff_3]] : memref<256xi32>, 0, 256, [, , ]) -// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %[[VAL_45:.*]] = aie.dma_start(MM2S, 1, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_buff_0]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_buff_1]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: aie.end @@ -95,24 +107,32 @@ // CHECK: %[[VAL_40:.*]] = aie.mem(%[[tile_1_3]]) { // CHECK: %[[VAL_44:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_0_cons_buff_0]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_0_cons_buff_1]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_0_cons_buff_2]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_0_cons_buff_3]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_0_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: aie.end @@ -120,36 +140,48 @@ // CHECK: %[[VAL_41:.*]] = aie.mem(%[[tile_3_3]]) { // CHECK: %[[VAL_44:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_1_cons_buff_0]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_1_cons_buff_1]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_1_cons_buff_2]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of0_1_cons_buff_3]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of0_1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %[[VAL_45:.*]] = aie.dma_start(S2MM, 1, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_cons_buff_0]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of1_cons_buff_1]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of1_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: aie.end @@ -157,14 +189,18 @@ // CHECK: %[[VAL_42:.*]] = aie.mem(%[[tile_2_2]]) { // CHECK: %[[VAL_44:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[of3_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of3_buff_0]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[of3_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of3_cons_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_cons_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of3_buff_1]] : memref<256xi32>, 0, 256) -// CHECK: aie.use_lock(%[[of3_prod_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_prod_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -172,14 +208,18 @@ // CHECK: %[[VAL_43:.*]] = aie.mem(%[[tile_2_3]]) { // CHECK: %[[VAL_44:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[of3_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of3_cons_buff_0]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of3_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[of3_cons_prod_lock]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_cons_prod_lock]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[of3_cons_buff_1]] : memref<256xi32>, 0, 256, []) -// CHECK: aie.use_lock(%[[of3_cons_cons_lock]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[of3_cons_cons_lock]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_in_loop.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_in_loop.mlir deleted file mode 100644 index 907532b78a5..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_in_loop.mlir +++ /dev/null @@ -1,76 +0,0 @@ -//===- dynamic_cyclostatic_acquire_in_loop.mlir ---------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Regression for https://github.com/Xilinx/mlir-aie/issues/2463. -// -// ObjectFifo `acquire(N)` means "ensure the core holds N total items" -// (see test/objectFifo-stateful-transform/access_patterns/AIE2_delayed_release.mlir). -// The emitted `aie.use_lock(..., AcquireGreaterEqual, K)` value K is the -// delta `N - currently_held`, not N itself. -// -// In the cyclostatic pattern below: -// for i in 0..14: -// acquire(3) // hold 3 -// release(1) // drop 1, still holding 2 -// -// At loop-body entry: -// - First iteration: held = 0 => emit AcquireGreaterEqual(3). -// - Iterations 1..13: held = 2 => emit AcquireGreaterEqual(1). -// -// The static-unroll path (`dynamic-objFifos=false`) does this correctly: it -// unrolls by LCM(consumer fifo sizes) and emits the per-position delta. -// -// The dynamic-objFifos path (default) keeps the scf.for and emits the user's -// literal value `AcquireGreaterEqual(3)` on every iteration. That over- -// acquires by 2 per iter, exhausting the producer pool after ~2 iterations -// and deadlocking on hardware. -// -// This test asserts the correct dynamic-path lowering. It will fail until the -// dynamic-objFifos lowering subtracts the steady-state held count (or peels -// the first iteration). - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// The inner scf.for is preserved. -// CHECK: aie.core -// CHECK: scf.for -// CHECK: scf.for {{.*}} to {{.*}} step - -// Inside the inner loop body, the steady-state acquire delta is 1, NOT 3: -// the previous iteration's release(1) left 2 items held, and acquire(3) -// only needs 1 more. -// CHECK-NEXT: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) - -// The release(1) inside the body stays at 1. -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) - -// The trailing release(2) after the loop stays at 2. -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %cmax = arith.constant 9223372036854775807 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %cmax step %c1 { - scf.for %arg1 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 2) - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_no_release.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_no_release.mlir deleted file mode 100644 index 4b02de14d3e..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_acquire_no_release.mlir +++ /dev/null @@ -1,47 +0,0 @@ -//===- dynamic_cyclostatic_acquire_no_release.mlir ------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Edge case: loop body has acquire(N) but NO release. -// -// `acquire(N)` semantics: "ensure I hold at least N items." If the loop body -// acquires N once and never releases, every iteration's acquire is a no-op -// after the first (held already == N). The peel correctly handles this: -// iter-0 takes the full acquire(N); the trimmed loop's acquires lower to -// `AcquireGreaterEqual(0)` deltas, which the lock lowering elides. -// -// Net effect: the lowered loop body contains NO use_lock op for this fifo, -// which is exactly what the source program means. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Peeled iter-0 has the user's full acquire(3). -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// Trimmed loop body has NO use_lock for the fifo's consumer side: the -// per-iter delta is 0 and the lock lowering elides the no-op. -// CHECK: scf.for -// CHECK-NOT: aie.use_lock -// CHECK: } - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 4 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_balanced_conditional.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_balanced_conditional.mlir index 4b4e4db2af6..a0722adea77 100644 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_balanced_conditional.mlir +++ b/test/objectFifo-stateful-transform/dynamic_cyclostatic_balanced_conditional.mlir @@ -27,8 +27,10 @@ // CHECK: scf.if // Both the unconditional and conditional acquires lower to a plain // AcquireGreaterEqual(1) / Release(1) pair; no hoisted peel-acquire appears. -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, %{{.*}}) module { aie.device(npu2) { diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_both_outer_inner.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_both_outer_inner.mlir deleted file mode 100644 index 89ed45ceafb..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_both_outer_inner.mlir +++ /dev/null @@ -1,64 +0,0 @@ -//===- dynamic_cyclostatic_both_outer_inner.mlir --------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Nested loops with cyclostatic patterns on BOTH levels, different fifos: -// outer carry on W: acquire(2) + release(1) per outer iter, drain at end. -// inner carry on X: acquire(3) + release(1) per inner iter, drain at end. -// -// The fix must hoist a pre-acquire before each loop independently, processing -// innermost-first so that the inner pattern's hoisted acquire is not -// double-counted as part of the outer body's analysis. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Peeled outer iter-0 body: contains user's W acquire (full size 2), then -// peeled inner iter-0 (X AcqGE(3), Release X 1), then trimmed inner for -// (X AcqGE(1), Release X 1), then user's post-inner releases. -// CHECK: aie.use_lock(%inOF_W{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 2) -// Peeled inner iter-0 (inside peeled outer iter-0). -// CHECK: aie.use_lock(%inOF_X{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%inOF_X{{.*}}_cons_prod_lock_0, Release, 1) -// Trimmed inner for inside peeled outer iter-0: per-iter delta of 1. -// CHECK: scf.for -// CHECK: aie.use_lock(%inOF_X{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%inOF_X{{.*}}_cons_prod_lock_0, Release, 1) -// Post-inner X drain (release 2) and W release inside peeled outer iter-0. -// CHECK: aie.use_lock(%inOF_X{{.*}}_cons_prod_lock_0, Release, 2) -// CHECK: aie.use_lock(%inOF_W{{.*}}_cons_prod_lock_0, Release, 1) -// Trimmed outer for: per-iter W delta of 1. -// CHECK: scf.for -// CHECK: aie.use_lock(%inOF_W{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// Trailing drain release after the trimmed outer for. -// CHECK: aie.use_lock(%inOF_W{{.*}}_cons_prod_lock_0, Release, 1) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @inOF_W(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - aie.objectfifo @inOF_X(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %w = aie.objectfifo.acquire @inOF_W(Consume, 2) : !aie.objectfifosubview> - scf.for %arg1 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @inOF_X(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @inOF_X(Consume, 1) - } - aie.objectfifo.release @inOF_X(Consume, 2) - aie.objectfifo.release @inOF_W(Consume, 1) - } - aie.objectfifo.release @inOF_W(Consume, 1) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_conditional_release.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_conditional_release.mlir deleted file mode 100644 index 512679754d9..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_conditional_release.mlir +++ /dev/null @@ -1,44 +0,0 @@ -//===- dynamic_cyclostatic_conditional_release.mlir -----------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Negative test: release is conditional on a runtime predicate, so we can't -// statically compute the per-iter carry. The fix should detect this and -// either (a) emit a diagnostic and leave alone, or (b) be conservative and -// not hoist. -// -// Today, the pass silently lowers to AcquireGE(3) every iter (broken). After -// the fix, the user should at least know their program is suspect. The -// expected-error directive below pins the desired diagnostic. -// -// Until the diagnostic is implemented, this test will fail because no error -// is emitted. Once the diagnostic lands, this CHECK will pass. - -// RUN: aie-opt --verify-diagnostics --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - %true = arith.constant true - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - scf.if %true { - // expected-error@+1 {{cannot statically analyze cyclostatic acquire pattern: acquire/release is inside a conditional}} - aie.objectfifo.release @fifo(Consume, 1) - } - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_dynamic_bounds_zero_trip.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_dynamic_bounds_zero_trip.mlir deleted file mode 100644 index 1c53b9667e6..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_dynamic_bounds_zero_trip.mlir +++ /dev/null @@ -1,66 +0,0 @@ -//===- dynamic_cyclostatic_dynamic_bounds_zero_trip.mlir ------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Pre-implementation spec for the cyclostatic-acquire peel rewrite. -// -// When the loop's trip count is not statically provable to be >= 1, the -// peeled iteration 0 must be wrapped in an `scf.if (ub - lb >= step)` -// guard. Otherwise a zero-trip loop would over-acquire and deadlock — a -// regression from today's broken-but-not-deadlocked behavior on zero-trip. -// -// The user's trailing `release(carry)` is left where they wrote it. If they -// wrote it unconditionally and the loop can run zero times, that is a -// pre-existing bug in user code, not introduced by peeling. -// -// E2E coverage gap: a runtime zero-trip test would need first-class -// runtime scalar args on @iron.jit to drive the trip count from the host -// (project_iron_jit_rtp deferred work). For now the IR shape is pinned by -// the scf.if + arith.cmpi check below. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// The peeled iter-0 body must be guarded by an scf.if that fires only when -// the loop body executes at least once: (ub - lb) >= step. -// CHECK: arith.subi -// CHECK: arith.cmpi sge -// CHECK: scf.if -// Inside the guard: the peeled iter-0 acquire (full size, 3). -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trimmed loop: per-iter delta of 1 (3 - carry=2). -// CHECK: scf.for -// CHECK-NEXT: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trailing drain release(2) is user code, emitted unconditionally as -// written. (If the user's loop can be zero-trip, the trailing release is -// their bug; peel does not fix or hide it.) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - %ub_buf = aie.buffer(%tile_0_2) {sym_name = "ub_buf"} : memref<1xindex> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - // Dynamic upper bound loaded from a buffer so the trip count is not - // statically known to be >= 1. - %ub = memref.load %ub_buf[%c0] : memref<1xindex> - scf.for %arg0 = %c0 to %ub step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_held_before_loop.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_held_before_loop.mlir deleted file mode 100644 index 5227cb45fe7..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_held_before_loop.mlir +++ /dev/null @@ -1,58 +0,0 @@ -//===- dynamic_cyclostatic_held_before_loop.mlir --------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// The peel decision subtracts the pre-loop "held" count from the in-body -// carry: if the user already holds N items before entering the loop, the -// in-body steady-state acquire is already a delta of (carry - N) and no -// peel is needed. -// -// Here a pre-loop acquire(2) leaves held=2 on entry; the loop body's -// acquire(3) - release(1) has carry 2; carry - held = 0 → no peel. -// (Without this analysis the peel would fire and produce an off-by-one -// duplicate acquire that desynchronizes the consumer-side lock.) - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core - -// Pre-loop user acquire (full size from cold start). -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 2) - -// No peeled iter-0 here — the next op must be the scf.for itself, not a -// second AcquireGreaterEqual. -// CHECK-NOT: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual -// CHECK: scf.for - -// Inside the loop: in-body acquire emits as delta-from-held = 3 - 2 = 1. -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) - -// Trailing drain. -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - // Pre-loop acquire establishes held = 2. - %pre = aie.objectfifo.acquire @fifo(Consume, 2) : !aie.objectfifosubview> - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_iter_args.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_iter_args.mlir deleted file mode 100644 index 30ab6973335..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_iter_args.mlir +++ /dev/null @@ -1,64 +0,0 @@ -//===- dynamic_cyclostatic_iter_args.mlir ---------------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Pre-implementation spec for the cyclostatic-acquire peel rewrite. -// -// When the loop carries iter_args via scf.yield, peeling iteration 0 must: -// 1. Substitute the iter_args init values for the iter_arg block args in -// the cloned iter-0 body. -// 2. Capture the scf.yield results from the peeled iter-0 body and pass -// them as the iter_args init of the trimmed loop. -// -// Without this, the trimmed loop would re-start from the original init, -// silently discarding iter 0's computation. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Iter 0 peeled body sees the user's original iter_args init (constant 7). -// It computes iter_arg + 1 and that becomes the trimmed loop's init. -// Use a constant the lowering won't fold away so we can grep for it. -// CHECK-DAG: %[[INIT:.+]] = arith.constant 7 : i32 -// CHECK-DAG: %[[STEP:.+]] = arith.constant 1 : i32 - -// The peeled iter-0 body executes the user's add and uses the init value. -// (Order in IR is INIT, then peeled body, then trimmed loop.) -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: %[[AFTER0:.+]] = arith.addi %[[INIT]], %[[STEP]] : i32 -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) - -// The trimmed loop's iter_args init is the AFTER0 SSA value from the peel, -// NOT the original constant 7. -// CHECK: scf.for {{.*}} iter_args(%{{.*}} = %[[AFTER0]]) -> (i32) -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: arith.addi -// CHECK: scf.yield - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - %init = arith.constant 7 : i32 - %step_i32 = arith.constant 1 : i32 - %final = scf.for %arg0 = %c0 to %c14 step %c1 iter_args(%acc = %init) -> (i32) { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - %new_acc = arith.addi %acc, %step_i32 : i32 - aie.objectfifo.release @fifo(Consume, 1) - scf.yield %new_acc : i32 - } - aie.objectfifo.release @fifo(Consume, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_multi_acquire_same_fifo.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_multi_acquire_same_fifo.mlir deleted file mode 100644 index 47eca49eb14..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_multi_acquire_same_fifo.mlir +++ /dev/null @@ -1,56 +0,0 @@ -//===- dynamic_cyclostatic_multi_acquire_same_fifo.mlir -------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Same fifo acquired multiple times in body (delayed-release pattern): -// acquire(3) // "ensure I hold 3" -// acquire(5) // "ensure I hold 5" (incremental: +2) -// release(1) -// -// Per AIE2_delayed_release.mlir semantics, the max-held count in the body is -// 5, and the per-iter release is 1, so carry = max_acq - sum_rel = 5 - 1 = 4. -// The fix must hoist `acquire(4)` before the loop. In-body acquires then -// become AcquireGreaterEqual(1) and AcquireGreaterEqual(2) — exactly the -// deltas to grow held from 4 -> 5, then refill to 5 after release. -// -// NOTE: This pattern requires fifo depth >= 5; use depth 5 here so the test -// is well-formed. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Peeled iter-0: user's acq(3), then acq(5)'s incremental AcqGE(2), then rel(1). -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trimmed loop: per-iter steady-state delta. -// CHECK: scf.for -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trailing user release(4). -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 4) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 5 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %a = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - %b = aie.objectfifo.acquire @fifo(Consume, 5) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 4) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_multiple_fifos.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_multiple_fifos.mlir deleted file mode 100644 index 0dcea781d80..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_multiple_fifos.mlir +++ /dev/null @@ -1,54 +0,0 @@ -//===- dynamic_cyclostatic_multiple_fifos.mlir ----------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Two fifos in the same inner loop body, each cyclostatic with a different -// carry: X acquires 3 / releases 1 (carry 2), Y acquires 2 / releases 1 -// (carry 1). The fix must hoist independent pre-acquires for each fifo. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Peeled iter-0 body: full-size acquires in source order (X before Y), then -// releases in source order. -// CHECK: aie.use_lock(%fifoX_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%fifoY_cons_cons_lock_0, AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 1) -// CHECK: aie.use_lock(%fifoY_cons_prod_lock_0, Release, 1) -// Trimmed loop: per-iter deltas (X: 3-2=1; Y: 2-1=1) in source order. -// CHECK: scf.for -// CHECK: aie.use_lock(%fifoX_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%fifoY_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 1) -// CHECK: aie.use_lock(%fifoY_cons_prod_lock_0, Release, 1) -// Trailing user releases stay as written. -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 2) -// CHECK: aie.use_lock(%fifoY_cons_prod_lock_0, Release, 1) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifoX(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - aie.objectfifo @fifoY(%tile_0_1, {%tile_0_2}, 2 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifoX(Consume, 3) : !aie.objectfifosubview> - %y = aie.objectfifo.acquire @fifoY(Consume, 2) : !aie.objectfifosubview> - aie.objectfifo.release @fifoX(Consume, 1) - aie.objectfifo.release @fifoY(Consume, 1) - } - aie.objectfifo.release @fifoX(Consume, 2) - aie.objectfifo.release @fifoY(Consume, 1) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_negative_step.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_negative_step.mlir deleted file mode 100644 index d6bf49f17ad..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_negative_step.mlir +++ /dev/null @@ -1,51 +0,0 @@ -//===- dynamic_cyclostatic_negative_step.mlir -----------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// scf.for with non-constant step (sign unknown at compile time): the peel -// rewrite must bail out and leave the loop intact, because emitting a -// positive-step runtime guard against a negative-step loop would skip the -// trimmed loop body entirely after rewrite. -// -// The lock-lowering still produces correct (just unoptimized) IR for the -// in-body acquire: AcquireGreaterEqual emits at the user's literal value. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// No pre-loop peeled iter-0 — peel bailed out on unknown step sign. -// CHECK-NOT: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// The scf.for is preserved as-is, no scf.if guard wrapping a peeled body. -// CHECK: scf.for -// In-body acquire emits at the user's literal size (unoptimized but correct). -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trailing user drain. -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - %step_buf = aie.buffer(%tile_0_2) {sym_name = "step_buf"} : memref<1xindex> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c14 = arith.constant 14 : index - // Step is loaded at runtime → sign cannot be proven at compile time, - // so peel must bail out. - %step = memref.load %step_buf[%c0] : memref<1xindex> - scf.for %arg0 = %c0 to %c14 step %step { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_outer_only.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_outer_only.mlir deleted file mode 100644 index b78fab0da13..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_outer_only.mlir +++ /dev/null @@ -1,55 +0,0 @@ -//===- dynamic_cyclostatic_outer_only.mlir --------------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Cyclostatic acquire(3)+release(1) on the OUTER loop. Inner loop has no -// fifo ops (just per-element work over the held window). -// -// Correct lowering should hoist `acquire(2)` before the outer loop so the -// outer body's `acquire(3)` lowers to `AcquireGreaterEqual(1)`. After the -// outer loop, the trailing release(2) drains the carry. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Peeled iter-0 body (full-size acquire) before the trimmed loop. -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trimmed loop: per-iter delta of 1. -// CHECK: scf.for -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trailing drain release(2) after the trimmed loop. -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - %buf = aie.buffer(%tile_0_2) {sym_name = "buf"} : memref<8xi8> - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c8 = arith.constant 8 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - %x0 = aie.objectfifo.subview.access %x[0] : !aie.objectfifosubview> -> memref<8xi8> - // Inner loop does per-byte work but no fifo ops. - scf.for %arg1 = %c0 to %c8 step %c1 { - %v = memref.load %x0[%arg1] : memref<8xi8> - memref.store %v, %buf[%arg1] : memref<8xi8> - } - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_peel_preserves_body_order.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_peel_preserves_body_order.mlir deleted file mode 100644 index e0f35ca74ba..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_peel_preserves_body_order.mlir +++ /dev/null @@ -1,76 +0,0 @@ -//===- dynamic_cyclostatic_peel_preserves_body_order.mlir -----*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// A naive "hoist one acquire(carry) per fifo" rewrite groups the pre-loop -// acquires by fifo and reorders them relative to each other and to in-body -// ops on other fifos. That can deadlock cross-core when the relative order -// of acq/rel between fifos was load-bearing. Peel iter-0 must clone the -// body verbatim so the order is preserved. -// -// This test uses an interleaving that no per-fifo hoist could reproduce: -// acquire fifoX(3) -// acquire fifoY(2) -// release fifoX(1) -// acquire fifoX(3) <-- second acquire of fifoX BETWEEN Y's acq/rel -// release fifoY(1) -// release fifoX(1) -// The peeled iter-0 must contain exactly this op sequence. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core - -// Peeled iter-0: exact source order. The lock-lowering tracks "currently -// held" and emits each AcquireGE as a delta from the prior held count, so -// the second X acquire (after one release) emits AcquireGE 1 rather than -// 3 — but it stays in source position between Y's acquire and release. -// CHECK: aie.use_lock(%fifoX_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%fifoY_cons_cons_lock_0, AcquireGreaterEqual, 2) -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 1) -// CHECK: aie.use_lock(%fifoX_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%fifoY_cons_prod_lock_0, Release, 1) -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 1) - -// Trimmed loop: same interleaving, per-iter deltas. -// CHECK: scf.for -// CHECK: aie.use_lock(%fifoX_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%fifoY_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 1) -// CHECK: aie.use_lock(%fifoX_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%fifoY_cons_prod_lock_0, Release, 1) -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 1) - -// User trailing drains. -// CHECK: aie.use_lock(%fifoX_cons_prod_lock_0, Release, 2) -// CHECK: aie.use_lock(%fifoY_cons_prod_lock_0, Release, 1) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifoX(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - aie.objectfifo @fifoY(%tile_0_1, {%tile_0_2}, 2 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %x1 = aie.objectfifo.acquire @fifoX(Consume, 3) : !aie.objectfifosubview> - %y = aie.objectfifo.acquire @fifoY(Consume, 2) : !aie.objectfifosubview> - aie.objectfifo.release @fifoX(Consume, 1) - %x2 = aie.objectfifo.acquire @fifoX(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifoY(Consume, 1) - aie.objectfifo.release @fifoX(Consume, 1) - } - aie.objectfifo.release @fifoX(Consume, 2) - aie.objectfifo.release @fifoY(Consume, 1) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_produce_side.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_produce_side.mlir deleted file mode 100644 index 4d3e9af198e..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_produce_side.mlir +++ /dev/null @@ -1,45 +0,0 @@ -//===- dynamic_cyclostatic_produce_side.mlir ------------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Producer-side cyclostatic: a core acquires multiple producer slots and -// releases them one at a time per iteration. Same logic as consumer-side, -// just on the opposite port. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Peeled iter-0: producer-side prod_lock full acquire(3). -// CHECK: aie.use_lock(%{{.*}}_prod_lock_0, AcquireGreaterEqual, 3) -// Per-iter release into consumer. -// CHECK: aie.use_lock(%{{.*}}_cons_lock_0, Release, 1) -// Trimmed loop: per-iter delta of 1 (3 - carry=2). -// CHECK: scf.for -// CHECK: aie.use_lock(%{{.*}}_prod_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_lock_0, Release, 1) -// Trailing drain release(2). -// CHECK: aie.use_lock(%{{.*}}_cons_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_2 = aie.tile(0, 2) - %tile_0_3 = aie.tile(0, 3) - - aie.objectfifo @fifo(%tile_0_2, {%tile_0_3}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Produce, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Produce, 1) - } - aie.objectfifo.release @fifo(Produce, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_pure_conditional.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_pure_conditional.mlir deleted file mode 100644 index ca913847c51..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_pure_conditional.mlir +++ /dev/null @@ -1,50 +0,0 @@ -//===- dynamic_cyclostatic_pure_conditional.mlir --------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Edge case: ALL acq/rel of (fifo, port) in the loop body are inside -// scf.if. Sibling test dynamic_cyclostatic_conditional_release.mlir covers -// the MIXED case (some conditional, some not), which triggers a diagnostic. -// -// Pure-conditional is well-formed: each conditional path is its own -// straight-line acq/rel sequence that the lock-lowering tracks correctly on -// its own. There is no cyclostatic carry to analyze (no unconditional ops -// to compute max_acq / sum_rel over), so peel must NOT fire and must NOT -// emit a diagnostic. The lowering proceeds as normal. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// scf.for is preserved as-is (no peeled iter-0 cloned before it). -// CHECK: scf.for -// scf.if inside the loop body is preserved. -// CHECK: scf.if -// The user's conditional acq/rel lowered to a conditional use_lock. -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - %true = arith.constant true - scf.for %arg0 = %c0 to %c14 step %c1 { - scf.if %true { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while.mlir deleted file mode 100644 index 35949f449b1..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while.mlir +++ /dev/null @@ -1,73 +0,0 @@ -//===- dynamic_cyclostatic_scf_while.mlir ---------------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Same cyclostatic pattern as dynamic_cyclostatic_acquire_in_loop.mlir, but -// the surrounding loop is scf.while instead of scf.for. The peel: -// 1. clones the (side-effect-free) before-region inline to compute the -// iter-0 cond and forwarded values; -// 2. wraps the iter-0 after-region clone + a fresh trimmed scf.while in -// an scf.if guarded by the iter-0 cond; -// 3. else-branch yields iter0Vals (what the original while would have -// returned if the cond was false on entry); -// 4. rewires external uses of the original whileOp's results to the -// ifOp's results, then erases the original whileOp. -// -// The test exercises (3) and (4) by consuming the while's result after the -// loop (`memref.store %r, %buf`) — that consumer must end up reading the -// ifOp's result, not a dangling reference to the deleted whileOp. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// Iter-0 cond cloned at top, then scf.if guards the peel + trimmed while. -// CHECK: %[[ITER0_COND:.*]] = arith.cmpi -// CHECK: %[[IFRES:.*]] = scf.if %[[ITER0_COND]] -// Peeled iter-0: full-size acquire and user release inside the then branch. -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Trimmed scf.while inside the then branch, steady-state delta of 1. -// CHECK: scf.while -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Else branch yields the iter-0 forwarded values (the original init). -// CHECK: else -// CHECK: scf.yield %c0 -// External consumer of the original while's result reads from the ifOp. -// CHECK: memref.store %[[IFRES]] -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - %buf = aie.buffer(%tile_0_2) {sym_name = "buf"} : memref<1xindex> - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - %r = scf.while (%arg0 = %c0) : (index) -> index { - %cond = arith.cmpi slt, %arg0, %c14 : index - scf.condition(%cond) %arg0 : index - } do { - ^bb0(%arg1: index): - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - %next = arith.addi %arg1, %c1 : index - scf.yield %next : index - } - // External consumer of the while result — must be rewired to the - // peel's outer scf.if result (not left dangling against the erased - // original whileOp). - memref.store %r, %buf[%c0] : memref<1xindex> - aie.objectfifo.release @fifo(Consume, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while_side_effects.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while_side_effects.mlir deleted file mode 100644 index 826768e02cc..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_scf_while_side_effects.mlir +++ /dev/null @@ -1,47 +0,0 @@ -//===- dynamic_cyclostatic_scf_while_side_effects.mlir --------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// scf.while whose before-region contains a side-effecting op (memref.load). -// Cloning the before-region would execute the load twice, which can change -// program semantics if the loaded value is expected to vary between calls. -// The peel skips this loop with a warning; the lowering still produces -// correct (un-optimized) code. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s 2>&1 | FileCheck %s - -// CHECK: warning: {{.*}}cyclostatic acquire peel skipped{{.*}}scf.while before-region has side effects -// CHECK: aie.core -// scf.while is preserved unchanged (no scf.if wrapper, no peeled iter-0). -// CHECK: scf.while -// In-body acquire stays at the user's literal value (no per-iter delta). -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - %flag = aie.buffer(%tile_0_2) {sym_name = "flag"} : memref<1xi32> - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c0_i32 = arith.constant 0 : i32 - scf.while : () -> () { - // Side-effecting op in before-region. - %v = memref.load %flag[%c0] : memref<1xi32> - %cond = arith.cmpi ne, %v, %c0_i32 : i32 - scf.condition(%cond) - } do { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - scf.yield - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_sibling_loops.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_sibling_loops.mlir deleted file mode 100644 index 0156ec705a3..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_sibling_loops.mlir +++ /dev/null @@ -1,59 +0,0 @@ -//===- dynamic_cyclostatic_sibling_loops.mlir -----------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Two sibling loops in the same scope, each cyclostatic on the same fifo. -// Each loop's carry is independent: the first loop's trailing release(2) -// drains its hoisted carry before the second loop begins, so the second loop -// gets its own hoisted acquire(2). - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// First loop's peeled iter-0 (full acquire + release). -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// First trimmed loop: per-iter delta. -// CHECK: scf.for -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// First trailing drain (user code). -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) -// Second loop's peeled iter-0. -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Second trimmed loop. -// CHECK: scf.for -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// Second trailing drain. -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 2) - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.objectfifo.release @fifo(Consume, 2) - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_balanced.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_balanced.mlir deleted file mode 100644 index 6de4ed2dd04..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_balanced.mlir +++ /dev/null @@ -1,61 +0,0 @@ -//===- dynamic_cyclostatic_switch_balanced.mlir --------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// The net-equal cyclostatic analysis treats scf.index_switch the same way as -// scf.if: every case region *and* the default region is a branch, and they -// are compared against each other. Here a (fifo, port) is used unconditionally -// and inside an scf.index_switch whose every branch (case 0, case 1, default) -// is balanced (acquire 1 / release 1, net 0). All branches agree, so the -// conditional contributes zero deterministic carry and the pass must NOT emit -// "cannot statically analyze cyclostatic acquire pattern"; the loop lowers -// normally with the switch preserved. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// CHECK: scf.for -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) -// CHECK: scf.index_switch - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 4 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - // Unconditional, balanced: net 0. - %u = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - // Every branch (including default) has the same net 0. - scf.index_switch %arg0 - case 0 { - %a = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - scf.yield - } - case 1 { - %b = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - scf.yield - } - default { - %d = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - scf.yield - } - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_unbalanced.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_unbalanced.mlir deleted file mode 100644 index 96aa72d3eca..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_switch_unbalanced.mlir +++ /dev/null @@ -1,49 +0,0 @@ -//===- dynamic_cyclostatic_switch_unbalanced.mlir ------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Negative test for scf.index_switch: the branches *disagree* on their per-fifo -// net (case 0 nets +1: acquire 2 / release 1; the default nets 0: acquire 1 / -// release 1). Because the delta is data dependent (it varies with the runtime -// switch value) the carry cannot be computed statically. Since the same fifo -// is also used unconditionally, the pass must emit the diagnostic rather than -// peel on an incomplete carry. - -// RUN: aie-opt --verify-diagnostics --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 4 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %u = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - scf.index_switch %arg0 - case 0 { - // net +1 on this path - %a = aie.objectfifo.acquire @fifo(Consume, 2) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - scf.yield - } - default { - // net 0 on this path -> branches disagree -> unanalyzable - // expected-error@+1 {{cannot statically analyze cyclostatic acquire pattern: acquire/release is inside a conditional}} - %d = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - scf.yield - } - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_cyclostatic_symmetric_conditional.mlir b/test/objectFifo-stateful-transform/dynamic_cyclostatic_symmetric_conditional.mlir deleted file mode 100644 index 66959f4f51a..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_cyclostatic_symmetric_conditional.mlir +++ /dev/null @@ -1,61 +0,0 @@ -//===- dynamic_cyclostatic_symmetric_conditional.mlir --------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// A (fifo, port) is used unconditionally AND inside an scf.if whose *both* -// branches have the SAME non-zero net effect (each acquires 2 and releases 1, -// i.e. net +1). Because every branch contributes the same delta, that delta -// is branch-independent (deterministic) and folds into the loop's static -// cyclostatic carry exactly like an unconditional net +1. The pass must -// therefore NOT emit "cannot statically analyze cyclostatic acquire pattern"; -// instead it must peel iteration 0 so the steady-state AcquireGreaterEqual -// value becomes the per-iteration delta. -// -// This exercises the net-equal folding: only a conditional whose branches -// *disagree* is unanalyzable; matching (even non-zero) branch nets are fine. - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// The peeled iteration 0 (including its clone of the conditional) is emitted -// *before* the trimmed loop, so an scf.if appears ahead of the scf.for: -// CHECK: aie.core -// CHECK: scf.if -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 2) -// CHECK: scf.for -// The steady-state body retains the unconditional acquire and the conditional: -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: scf.if -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 2) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 4 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - %true = arith.constant true - scf.for %arg0 = %c0 to %c14 step %c1 { - // Unconditional, balanced: net 0. - %u = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - // Conditional: both branches share the same non-zero net (+1). - scf.if %true { - %a = aie.objectfifo.acquire @fifo(Consume, 2) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } else { - %b = aie.objectfifo.acquire @fifo(Consume, 2) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_loop_balanced_no_cyclostatic.mlir b/test/objectFifo-stateful-transform/dynamic_loop_balanced_no_cyclostatic.mlir deleted file mode 100644 index 3d694ca053a..00000000000 --- a/test/objectFifo-stateful-transform/dynamic_loop_balanced_no_cyclostatic.mlir +++ /dev/null @@ -1,38 +0,0 @@ -//===- dynamic_loop_balanced_no_cyclostatic.mlir --------------*- MLIR -*-===// -// -// Copyright (C) 2026 Advanced Micro Devices, Inc. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Negative test: per-iter acquire == per-iter release. No carry, no hoisting. -// The fix must leave this unchanged (today's behavior is already correct). - -// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s - -// CHECK: aie.core -// No hoisted pre-acquire before the loop. -// CHECK-NOT: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, -// CHECK: scf.for -// CHECK: aie.use_lock(%{{.*}}_cons_cons_lock_0, AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%{{.*}}_cons_prod_lock_0, Release, 1) - -module { - aie.device(npu2) { - %tile_0_1 = aie.tile(0, 1) - %tile_0_2 = aie.tile(0, 2) - - aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> - - %core_0_2 = aie.core(%tile_0_2) { - %c0 = arith.constant 0 : index - %c1 = arith.constant 1 : index - %c14 = arith.constant 14 : index - scf.for %arg0 = %c0 to %c14 step %c1 { - %x = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> - aie.objectfifo.release @fifo(Consume, 1) - } - aie.end - } - } -} diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir index a4c95a03dd4..531ce1afae2 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir @@ -7,105 +7,234 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "output_fifo2_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_3:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "output_fifo2_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_0_4, 2) {init = 2 : i32, sym_name = "output_fifo2_prod_lock_0"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_0_4, 3) {init = 0 : i32, sym_name = "output_fifo2_cons_lock_0"} -// CHECK: %[[VAL_6:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "input_fifo2_cons_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_7:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "input_fifo2_cons_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_8:.*]] = aie.lock(%{{.*}}tile_0_4, 0) {init = 2 : i32, sym_name = "input_fifo2_cons_prod_lock_0"} -// CHECK: %[[VAL_9:.*]] = aie.lock(%{{.*}}tile_0_4, 1) {init = 0 : i32, sym_name = "input_fifo2_cons_cons_lock_0"} -// CHECK: %[[VAL_14:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_15:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_16:.*]] = aie.lock(%{{.*}}tile_0_2, 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} -// CHECK: %[[VAL_17:.*]] = aie.lock(%{{.*}}tile_0_2, 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} -// CHECK: %[[VAL_18:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_19:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_20:.*]] = aie.lock(%{{.*}}tile_0_2, 0) {init = 2 : i32, sym_name = "input_fifo_cons_prod_lock_0"} -// CHECK: %[[VAL_21:.*]] = aie.lock(%{{.*}}tile_0_2, 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} -// CHECK: aie.flow(%{{.*}}tile_0_0, DMA : 0, %{{.*}}tile_0_2, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_2, DMA : 0, %{{.*}}tile_0_0, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_0, DMA : 1, %{{.*}}tile_0_4, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_4, DMA : 0, %{{.*}}tile_0_0, DMA : 1) -// CHECK: %buffer_0_2 = aie.buffer(%{{.*}}tile_0_2) : memref<2xi32> -// CHECK: %core_0_2 = aie.core(%{{.*}}tile_0_2) { -// CHECK: %c0_i32 = arith.constant 0 : i32 -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c2_i32 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c2_i32_0 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c0_1 = arith.constant 0 : index -// CHECK: %c1_2 = arith.constant 1 : index -// CHECK: %c10 = arith.constant 10 : index -// CHECK: scf.for %arg0 = %c0_1 to %c10 step %c1_2 { -// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, 1) -// CHECK: %0 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %1 = arith.index_cast %0 : i32 to index -// CHECK: %2 = scf.index_switch %1 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_14]] : memref<10xi32> +// CHECK-LABEL: module { +// CHECK: aie.device(npu1_1col) { +// CHECK: func.func @passthrough_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>) { +// CHECK: return +// CHECK: } +// CHECK: %[[VAL_2:.*]] = aie.tile(0, 0) +// CHECK: %[[VAL_3:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_4:.*]] = aie.tile(0, 4) +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_2]], 6) {init = 0 : i32, sym_name = "output_fifo2_cons_prod_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_2]], 7) {init = 0 : i32, sym_name = "output_fifo2_cons_cons_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo2_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo2_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_4]], 2) {init = 2 : i32, sym_name = "output_fifo2_prod_lock_0"} +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_4]], 3) {init = 0 : i32, sym_name = "output_fifo2_cons_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo2_cons_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_12:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo2_cons_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_13:.*]] = aie.lock(%[[VAL_4]], 0) {init = 2 : i32, sym_name = "input_fifo2_cons_prod_lock_0"} +// CHECK: %[[VAL_14:.*]] = aie.lock(%[[VAL_4]], 1) {init = 0 : i32, sym_name = "input_fifo2_cons_cons_lock_0"} +// CHECK: %[[VAL_15:.*]] = aie.lock(%[[VAL_2]], 4) {init = 0 : i32, sym_name = "input_fifo2_prod_lock_0"} +// CHECK: %[[VAL_16:.*]] = aie.lock(%[[VAL_2]], 5) {init = 0 : i32, sym_name = "input_fifo2_cons_lock_0"} +// CHECK: %[[VAL_17:.*]] = aie.lock(%[[VAL_2]], 2) {init = 0 : i32, sym_name = "output_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_18:.*]] = aie.lock(%[[VAL_2]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_19:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "output_fifo_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_20:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "output_fifo_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_21:.*]] = aie.lock(%[[VAL_3]], 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} +// CHECK: %[[VAL_22:.*]] = aie.lock(%[[VAL_3]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} +// CHECK: %[[VAL_23:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_24:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_25:.*]] = aie.lock(%[[VAL_3]], 0) {init = 2 : i32, sym_name = "input_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_26:.*]] = aie.lock(%[[VAL_3]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_27:.*]] = aie.lock(%[[VAL_2]], 0) {init = 0 : i32, sym_name = "input_fifo_prod_lock_0"} +// CHECK: %[[VAL_28:.*]] = aie.lock(%[[VAL_2]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_2]], DMA : 0, %[[VAL_3]], DMA : 0) +// CHECK: aie.flow(%[[VAL_3]], DMA : 0, %[[VAL_2]], DMA : 0) +// CHECK: aie.flow(%[[VAL_2]], DMA : 1, %[[VAL_4]], DMA : 0) +// CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_2]], DMA : 1) +// CHECK: %[[VAL_29:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> +// CHECK: %[[VAL_30:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> +// CHECK: %[[VAL_31:.*]] = aie.core(%[[VAL_3]]) { +// CHECK: %[[VAL_32:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_33:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_34:.*]] = arith.constant 1 : index +// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_35:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_36:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_37:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_39:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_40:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_41:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_42:.*]] = arith.constant 10 : index +// CHECK: scf.for %[[VAL_43:.*]] = %[[VAL_40]] to %[[VAL_42]] step %[[VAL_41]] { +// CHECK: %[[VAL_44:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_46:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_45]], %[[VAL_44]] : i32 +// CHECK: %[[VAL_48:.*]] = arith.maxsi %[[VAL_47]], %[[VAL_46]] : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_48]]) +// CHECK: %[[VAL_49:.*]] = arith.addi %[[VAL_44]], %[[VAL_48]] : i32 +// CHECK: memref.store %[[VAL_49]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_51:.*]] = arith.index_cast %[[VAL_50]] : i32 to index +// CHECK: %[[VAL_52:.*]] = scf.index_switch %[[VAL_51]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_19]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_20]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_19]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_55:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_56:.*]] = arith.subi %[[VAL_54]], %[[VAL_53]] : i32 +// CHECK: %[[VAL_57:.*]] = arith.maxsi %[[VAL_56]], %[[VAL_55]] : i32 +// CHECK: aie.use_lock(%[[VAL_26]], AcquireGreaterEqual, %[[VAL_57]]) +// CHECK: %[[VAL_58:.*]] = arith.addi %[[VAL_53]], %[[VAL_57]] : i32 +// CHECK: memref.store %[[VAL_58]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_59:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_60:.*]] = arith.index_cast %[[VAL_59]] : i32 to index +// CHECK: %[[VAL_61:.*]] = scf.index_switch %[[VAL_60]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_23]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_24]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_23]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @passthrough_10_i32(%[[VAL_61]], %[[VAL_52]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], Release, %[[VAL_62]]) +// CHECK: %[[VAL_63:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_64:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_65:.*]] = arith.subi %[[VAL_63]], %[[VAL_64]] : i32 +// CHECK: memref.store %[[VAL_65]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_66:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_67:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_68:.*]] = arith.addi %[[VAL_66]], %[[VAL_67]] : i32 +// CHECK: %[[VAL_69:.*]] = arith.cmpi sge, %[[VAL_68]], %[[VAL_39]] : i32 +// CHECK: %[[VAL_70:.*]] = arith.subi %[[VAL_68]], %[[VAL_39]] : i32 +// CHECK: %[[VAL_71:.*]] = arith.select %[[VAL_69]], %[[VAL_70]], %[[VAL_68]] : i32 +// CHECK: memref.store %[[VAL_71]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_72:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %[[VAL_72]]) +// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_74:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_75:.*]] = arith.subi %[[VAL_73]], %[[VAL_74]] : i32 +// CHECK: memref.store %[[VAL_75]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_76:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_77:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_78:.*]] = arith.addi %[[VAL_76]], %[[VAL_77]] : i32 +// CHECK: %[[VAL_79:.*]] = arith.cmpi sge, %[[VAL_78]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_80:.*]] = arith.subi %[[VAL_78]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_81:.*]] = arith.select %[[VAL_79]], %[[VAL_80]], %[[VAL_78]] : i32 +// CHECK: memref.store %[[VAL_81]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: } +// CHECK: aie.end +// CHECK: } {dynamic_objfifo_lowering = true} +// CHECK: %[[VAL_82:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_83:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_84:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_85:.*]] = arith.constant 10 : index +// CHECK: %[[VAL_86:.*]] = arith.constant 2 : index +// CHECK: scf.for %[[VAL_87:.*]] = %[[VAL_83]] to %[[VAL_85]] step %[[VAL_86]] { +// CHECK: %[[VAL_88:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_88]]) +// CHECK: %[[VAL_89:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_89]]) +// CHECK: func.call @passthrough_10_i32(%[[VAL_11]], %[[VAL_7]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_90:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_90]]) +// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_91]]) +// CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_92]]) +// CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_93]]) +// CHECK: func.call @passthrough_10_i32(%[[VAL_12]], %[[VAL_8]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_94]]) +// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_95]]) +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_2]], MM2S, 0) +// CHECK: %[[VAL_96:.*]] = aie.mem(%[[VAL_3]]) { +// CHECK: %[[VAL_97:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: ^bb1: +// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_98]]) +// CHECK: aie.dma_bd(%[[VAL_23]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_99:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_99]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_100]]) +// CHECK: aie.dma_bd(%[[VAL_24]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_101]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb3: +// CHECK: %[[VAL_102:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: ^bb4: +// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_103]]) +// CHECK: aie.dma_bd(%[[VAL_19]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_104:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_104]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb5: +// CHECK: %[[VAL_105:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_105]]) +// CHECK: aie.dma_bd(%[[VAL_20]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_106:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_106]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb6: +// CHECK: aie.end +// CHECK: } +// CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_2]], S2MM, 0) +// CHECK: aie.shim_dma_allocation @input_fifo2_shim_alloc(%[[VAL_2]], MM2S, 1) +// CHECK: %[[VAL_107:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_108:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: ^bb1: +// CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_109]]) +// CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_110:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_110]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_111]]) +// CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_112:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_112]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb3: +// CHECK: %[[VAL_113:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: ^bb4: +// CHECK: %[[VAL_114:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_114]]) +// CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_115]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb5: +// CHECK: %[[VAL_116:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_116]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_117]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb6: +// CHECK: aie.end +// CHECK: } +// CHECK: aie.shim_dma_allocation @output_fifo2_shim_alloc(%[[VAL_2]], S2MM, 1) // CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_15]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_14]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) -// CHECK: %3 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %4 = arith.index_cast %3 : i32 to index -// CHECK: %5 = scf.index_switch %4 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_18]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_19]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_18]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @passthrough_10_i32(%5, %2) : (memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_20]], Release, 1) -// CHECK: %6 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c1_i32 = arith.constant 1 : i32 -// CHECK: %7 = arith.addi %6, %c1_i32 : i32 -// CHECK: %8 = arith.cmpi sge, %7, %c2_i32_0 : i32 -// CHECK: %9 = arith.subi %7, %c2_i32_0 : i32 -// CHECK: %10 = arith.select %8, %9, %7 : i32 -// CHECK: memref.store %10, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) -// CHECK: %11 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32_3 = arith.constant 1 : i32 -// CHECK: %12 = arith.addi %11, %c1_i32_3 : i32 -// CHECK: %13 = arith.cmpi sge, %12, %c2_i32 : i32 -// CHECK: %14 = arith.subi %12, %c2_i32 : i32 -// CHECK: %15 = arith.select %13, %14, %12 : i32 -// CHECK: memref.store %15, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: } -// CHECK: aie.end -// CHECK: } {dynamic_objfifo_lowering = true} -// CHECK: %core_0_4 = aie.core(%{{.*}}tile_0_4) { -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c10 = arith.constant 10 : index -// CHECK: %c2 = arith.constant 2 : index -// CHECK: scf.for %arg0 = %c0 to %c10 step %c2 { -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) -// CHECK: func.call @passthrough_10_i32(%[[VAL_6]], %[[VAL_2]]) : (memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) -// CHECK: func.call @passthrough_10_i32(%[[VAL_7]], %[[VAL_3]]) : (memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) // CHECK: } -// CHECK: aie.end -// CHECK: } -// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%shim_noc_tile_0_0, MM2S, 0) module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir index 0f5d586bbec..53048df3a94 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir @@ -7,54 +7,74 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK: module { -// CHECK: aie.device(npu1_1col) { -// CHECK: func.func @passthrough_10_i32(%arg0: memref<10xi32>) { -// CHECK: return -// CHECK: } -// CHECK: %{{.*}}tile_0_0 = aie.tile(0, 0) -// CHECK: %{{.*}}tile_0_2 = aie.tile(0, 2) -// CHECK: %{{.*}}tile_0_4 = aie.tile(0, 4) -// CHECK: %[[VAL_0:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_1:.*]] = aie.lock(%{{.*}}tile_0_2, 0) {init = 1 : i32, sym_name = "input_fifo_cons_prod_lock_0"} -// CHECK: %[[VAL_2:.*]] = aie.lock(%{{.*}}tile_0_2, 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} -// CHECK: aie.flow(%{{.*}}tile_0_0, DMA : 0, %{{.*}}tile_0_2, DMA : 0) -// CHECK: %buffer_0_2 = aie.buffer(%{{.*}}tile_0_2) : memref<1xi32> -// CHECK: %core_0_2 = aie.core(%{{.*}}tile_0_2) { -// CHECK: %c0_i32 = arith.constant 0 : i32 -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c1_i32 = arith.constant 1 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c0] : memref<1xi32> -// CHECK: %c0_0 = arith.constant 0 : index -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c10 = arith.constant 10 : index -// CHECK: scf.for %arg0 = %c0_0 to %c10 step %c1 { -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) -// CHECK: func.call @passthrough_10_i32(%[[VAL_0]]) : (memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) -// CHECK: %0 = memref.load %buffer_0_2[%c0] : memref<1xi32> -// CHECK: %c1_i32_1 = arith.constant 1 : i32 -// CHECK: %1 = arith.addi %0, %c1_i32_1 : i32 -// CHECK: %2 = arith.cmpi sge, %1, %c1_i32 : i32 -// CHECK: %3 = arith.subi %1, %c1_i32 : i32 -// CHECK: %4 = arith.select %2, %3, %1 : i32 -// CHECK: memref.store %4, %buffer_0_2[%c0] : memref<1xi32> -// CHECK: } -// CHECK: aie.end -// CHECK: } {dynamic_objfifo_lowering = true} -// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%shim_noc_tile_0_0, MM2S, 0) -// CHECK: %mem_0_2 = aie.mem(%{{.*}}tile_0_2) { -// CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) -// CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) -// CHECK: aie.dma_bd(%[[VAL_0]] : memref<10xi32>, 0, 10) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) -// CHECK: aie.next_bd ^bb1 -// CHECK: ^bb2: // pred: ^bb0 -// CHECK: aie.end -// CHECK: } -// CHECK: } -// CHECK: } +// CHECK-LABEL: module { +// CHECK: aie.device(npu1_1col) { +// CHECK: func.func @passthrough_10_i32(%[[VAL_0:.*]]: memref<10xi32>) { +// CHECK: return +// CHECK: } +// CHECK: %[[VAL_1:.*]] = aie.tile(0, 0) +// CHECK: %[[VAL_2:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_3:.*]] = aie.tile(0, 4) +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_2]]) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_2]], 0) {init = 1 : i32, sym_name = "input_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_2]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_1]], 0) {init = 0 : i32, sym_name = "input_fifo_prod_lock_0"} +// CHECK: %[[VAL_8:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_1]], DMA : 0, %[[VAL_2]], DMA : 0) +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_2]]) : memref<1xi32> +// CHECK: %[[VAL_10:.*]] = aie.buffer(%[[VAL_2]]) : memref<1xi32> +// CHECK: %[[VAL_11:.*]] = aie.core(%[[VAL_2]]) { +// CHECK: %[[VAL_12:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_13:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_12]], %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: %[[VAL_14:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_15:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_16:.*]] = arith.constant 1 : i32 +// CHECK: memref.store %[[VAL_14]], %[[VAL_9]]{{\[}}%[[VAL_15]]] : memref<1xi32> +// CHECK: %[[VAL_17:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_18:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_19:.*]] = arith.constant 10 : index +// CHECK: scf.for %[[VAL_20:.*]] = %[[VAL_17]] to %[[VAL_19]] step %[[VAL_18]] { +// CHECK: %[[VAL_21:.*]] = memref.load %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: %[[VAL_22:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_23:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_24:.*]] = arith.subi %[[VAL_22]], %[[VAL_21]] : i32 +// CHECK: %[[VAL_25:.*]] = arith.maxsi %[[VAL_24]], %[[VAL_23]] : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_25]]) +// CHECK: %[[VAL_26:.*]] = arith.addi %[[VAL_21]], %[[VAL_25]] : i32 +// CHECK: memref.store %[[VAL_26]], %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: func.call @passthrough_10_i32(%[[VAL_4]]) : (memref<10xi32>) -> () +// CHECK: %[[VAL_27:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_27]]) +// CHECK: %[[VAL_28:.*]] = memref.load %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: %[[VAL_29:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_30:.*]] = arith.subi %[[VAL_28]], %[[VAL_29]] : i32 +// CHECK: memref.store %[[VAL_30]], %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: %[[VAL_31:.*]] = memref.load %[[VAL_9]]{{\[}}%[[VAL_15]]] : memref<1xi32> +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_33:.*]] = arith.addi %[[VAL_31]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_34:.*]] = arith.cmpi sge, %[[VAL_33]], %[[VAL_16]] : i32 +// CHECK: %[[VAL_35:.*]] = arith.subi %[[VAL_33]], %[[VAL_16]] : i32 +// CHECK: %[[VAL_36:.*]] = arith.select %[[VAL_34]], %[[VAL_35]], %[[VAL_33]] : i32 +// CHECK: memref.store %[[VAL_36]], %[[VAL_9]]{{\[}}%[[VAL_15]]] : memref<1xi32> +// CHECK: } +// CHECK: aie.end +// CHECK: } {dynamic_objfifo_lowering = true} +// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_1]], MM2S, 0) +// CHECK: %[[VAL_37:.*]] = aie.mem(%[[VAL_2]]) { +// CHECK: %[[VAL_38:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) +// CHECK: ^bb1: +// CHECK: %[[VAL_39:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_39]]) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_40:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_40]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb2: +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir index 3bffeeb3b7b..58c220f6950 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir @@ -7,201 +7,323 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform=dynamic-objFifos %s | FileCheck %s -// CHECK: aie.device(npu1_1col) { -// CHECK: func.func @add_10_i32(%arg0: memref<10xi32>, %arg1: memref<10xi32>, %arg2: memref<10xi32>) { -// CHECK: return -// CHECK: } -// CHECK: %{{.*}}tile_0_0 = aie.tile(0, 0) -// CHECK: %{{.*}}tile_0_2 = aie.tile(0, 2) -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_3:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_0_2, 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_0_2, 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} -// CHECK: %[[VAL_6:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_7:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_8:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_2"} : memref<10xi32> -// CHECK: %[[VAL_9:.*]] = aie.lock(%{{.*}}tile_0_2, 0) {init = 3 : i32, sym_name = "input_fifo_cons_prod_lock_0"} -// CHECK: %[[VAL_10:.*]] = aie.lock(%{{.*}}tile_0_2, 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} -// CHECK: aie.flow(%{{.*}}tile_0_0, DMA : 0, %{{.*}}tile_0_2, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_2, DMA : 0, %{{.*}}tile_0_0, DMA : 0) -// CHECK: %buffer_0_2 = aie.buffer(%{{.*}}tile_0_2) : memref<2xi32> -// CHECK: %core_0_2 = aie.core(%{{.*}}tile_0_2) { -// CHECK: %c0_i32 = arith.constant 0 : i32 -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c2_i32 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c3_i32 = arith.constant 3 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c0_0 = arith.constant 0 : index -// CHECK: %c1_1 = arith.constant 1 : index -// CHECK: %c9 = arith.constant 9 : index -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: %0 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %1 = arith.index_cast %0 : i32 to index -// CHECK: %2 = scf.index_switch %1 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_3]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) -// CHECK: %3 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %4 = arith.index_cast %3 : i32 to index -// CHECK: %5 = scf.index_switch %4 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: case 2 { -// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @add_10_i32(%5, %5, %2) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %6 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32 = arith.constant 1 : i32 -// CHECK: %7 = arith.addi %6, %c1_i32 : i32 -// CHECK: %8 = arith.cmpi sge, %7, %c2_i32 : i32 -// CHECK: %9 = arith.subi %7, %c2_i32 : i32 -// CHECK: %10 = arith.select %8, %9, %7 : i32 -// CHECK: memref.store %10, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: scf.for %arg0 = %c0_0 to %c9 step %c1_1 { -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: %30 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %31 = arith.index_cast %30 : i32 to index -// CHECK: %32 = scf.index_switch %31 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_3]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) -// CHECK: %33 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %34 = arith.index_cast %33 : i32 to index -// CHECK: %35 = scf.index_switch %34 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: case 2 { -// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> +// CHECK-LABEL: module { +// CHECK: aie.device(npu1_1col) { +// CHECK: func.func @add_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>, %[[VAL_2:.*]]: memref<10xi32>) { +// CHECK: return // CHECK: } -// CHECK: %36 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %37 = arith.index_cast %36 : i32 to index -// CHECK: %38 = scf.index_switch %37 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: %[[VAL_3:.*]] = aie.tile(0, 0) +// CHECK: %[[VAL_4:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_3]], 2) {init = 0 : i32, sym_name = "output_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_3]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_4]], 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_4]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_12:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo_cons_buff_2"} : memref<10xi32> +// CHECK: %[[VAL_14:.*]] = aie.lock(%[[VAL_4]], 0) {init = 3 : i32, sym_name = "input_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_15:.*]] = aie.lock(%[[VAL_4]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_16:.*]] = aie.lock(%[[VAL_3]], 0) {init = 0 : i32, sym_name = "input_fifo_prod_lock_0"} +// CHECK: %[[VAL_17:.*]] = aie.lock(%[[VAL_3]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_3]], DMA : 0, %[[VAL_4]], DMA : 0) +// CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_3]], DMA : 0) +// CHECK: %[[VAL_18:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> +// CHECK: %[[VAL_19:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> +// CHECK: %[[VAL_20:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_21:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_21]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_23:.*]] = arith.constant 1 : index +// CHECK: memref.store %[[VAL_21]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_24:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_25:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_26:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_24]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_27:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_28:.*]] = arith.constant 3 : i32 +// CHECK: memref.store %[[VAL_24]], %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_29:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_30:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_31:.*]] = arith.constant 9 : index +// CHECK: %[[VAL_32:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_33:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_34:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_35:.*]] = arith.subi %[[VAL_33]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_36:.*]] = arith.maxsi %[[VAL_35]], %[[VAL_34]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_36]]) +// CHECK: %[[VAL_37:.*]] = arith.addi %[[VAL_32]], %[[VAL_36]] : i32 +// CHECK: memref.store %[[VAL_37]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_38:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_39:.*]] = arith.index_cast %[[VAL_38]] : i32 to index +// CHECK: %[[VAL_40:.*]] = scf.index_switch %[[VAL_39]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_41:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_42:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_43:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_44:.*]] = arith.subi %[[VAL_42]], %[[VAL_41]] : i32 +// CHECK: %[[VAL_45:.*]] = arith.maxsi %[[VAL_44]], %[[VAL_43]] : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_45]]) +// CHECK: %[[VAL_46:.*]] = arith.addi %[[VAL_41]], %[[VAL_45]] : i32 +// CHECK: memref.store %[[VAL_46]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_47:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_48:.*]] = arith.index_cast %[[VAL_47]] : i32 to index +// CHECK: %[[VAL_49:.*]] = scf.index_switch %[[VAL_48]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: case 2 { +// CHECK: scf.yield %[[VAL_13]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @add_10_i32(%[[VAL_49]], %[[VAL_49]], %[[VAL_40]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_50:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_50]]) +// CHECK: %[[VAL_51:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_53:.*]] = arith.subi %[[VAL_51]], %[[VAL_52]] : i32 +// CHECK: memref.store %[[VAL_53]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_54:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_56:.*]] = arith.addi %[[VAL_54]], %[[VAL_55]] : i32 +// CHECK: %[[VAL_57:.*]] = arith.cmpi sge, %[[VAL_56]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_58:.*]] = arith.subi %[[VAL_56]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_59:.*]] = arith.select %[[VAL_57]], %[[VAL_58]], %[[VAL_56]] : i32 +// CHECK: memref.store %[[VAL_59]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: scf.for %[[VAL_60:.*]] = %[[VAL_29]] to %[[VAL_31]] step %[[VAL_30]] { +// CHECK: %[[VAL_61:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_63:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_64:.*]] = arith.subi %[[VAL_62]], %[[VAL_61]] : i32 +// CHECK: %[[VAL_65:.*]] = arith.maxsi %[[VAL_64]], %[[VAL_63]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_65]]) +// CHECK: %[[VAL_66:.*]] = arith.addi %[[VAL_61]], %[[VAL_65]] : i32 +// CHECK: memref.store %[[VAL_66]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_67:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_68:.*]] = arith.index_cast %[[VAL_67]] : i32 to index +// CHECK: %[[VAL_69:.*]] = scf.index_switch %[[VAL_68]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_70:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_71:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_72:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_73:.*]] = arith.subi %[[VAL_71]], %[[VAL_70]] : i32 +// CHECK: %[[VAL_74:.*]] = arith.maxsi %[[VAL_73]], %[[VAL_72]] : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_74]]) +// CHECK: %[[VAL_75:.*]] = arith.addi %[[VAL_70]], %[[VAL_74]] : i32 +// CHECK: memref.store %[[VAL_75]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_76:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_77:.*]] = arith.index_cast %[[VAL_76]] : i32 to index +// CHECK: %[[VAL_78:.*]] = scf.index_switch %[[VAL_77]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: case 2 { +// CHECK: scf.yield %[[VAL_13]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_79:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_80:.*]] = arith.index_cast %[[VAL_79]] : i32 to index +// CHECK: %[[VAL_81:.*]] = scf.index_switch %[[VAL_80]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_13]] : memref<10xi32> +// CHECK: } +// CHECK: case 2 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @add_10_i32(%[[VAL_78]], %[[VAL_81]], %[[VAL_69]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_82:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_82]]) +// CHECK: %[[VAL_83:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_84:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_85:.*]] = arith.subi %[[VAL_83]], %[[VAL_84]] : i32 +// CHECK: memref.store %[[VAL_85]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_86:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_87:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_88:.*]] = arith.addi %[[VAL_86]], %[[VAL_87]] : i32 +// CHECK: %[[VAL_89:.*]] = arith.cmpi sge, %[[VAL_88]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_90:.*]] = arith.subi %[[VAL_88]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_91:.*]] = arith.select %[[VAL_89]], %[[VAL_90]], %[[VAL_88]] : i32 +// CHECK: memref.store %[[VAL_91]], %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_92]]) +// CHECK: %[[VAL_93:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_95:.*]] = arith.subi %[[VAL_93]], %[[VAL_94]] : i32 +// CHECK: memref.store %[[VAL_95]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_96:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_97:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_98:.*]] = arith.addi %[[VAL_96]], %[[VAL_97]] : i32 +// CHECK: %[[VAL_99:.*]] = arith.cmpi sge, %[[VAL_98]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_100:.*]] = arith.subi %[[VAL_98]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_101:.*]] = arith.select %[[VAL_99]], %[[VAL_100]], %[[VAL_98]] : i32 +// CHECK: memref.store %[[VAL_101]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: } +// CHECK: %[[VAL_102:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_104:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_105:.*]] = arith.subi %[[VAL_103]], %[[VAL_102]] : i32 +// CHECK: %[[VAL_106:.*]] = arith.maxsi %[[VAL_105]], %[[VAL_104]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_106]]) +// CHECK: %[[VAL_107:.*]] = arith.addi %[[VAL_102]], %[[VAL_106]] : i32 +// CHECK: memref.store %[[VAL_107]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_108:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_109:.*]] = arith.index_cast %[[VAL_108]] : i32 to index +// CHECK: %[[VAL_110:.*]] = scf.index_switch %[[VAL_109]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_111:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_112:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_113:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_114:.*]] = arith.subi %[[VAL_112]], %[[VAL_111]] : i32 +// CHECK: %[[VAL_115:.*]] = arith.maxsi %[[VAL_114]], %[[VAL_113]] : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_115]]) +// CHECK: %[[VAL_116:.*]] = arith.addi %[[VAL_111]], %[[VAL_115]] : i32 +// CHECK: memref.store %[[VAL_116]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_117:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_118:.*]] = arith.index_cast %[[VAL_117]] : i32 to index +// CHECK: %[[VAL_119:.*]] = scf.index_switch %[[VAL_118]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: case 2 { +// CHECK: scf.yield %[[VAL_13]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_120:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_121:.*]] = arith.index_cast %[[VAL_120]] : i32 to index +// CHECK: %[[VAL_122:.*]] = scf.index_switch %[[VAL_121]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_13]] : memref<10xi32> +// CHECK: } +// CHECK: case 2 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @add_10_i32(%[[VAL_119]], %[[VAL_122]], %[[VAL_110]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_123:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_123]]) +// CHECK: %[[VAL_124:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_125:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_126:.*]] = arith.subi %[[VAL_124]], %[[VAL_125]] : i32 +// CHECK: memref.store %[[VAL_126]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_127:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_128:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_129:.*]] = arith.addi %[[VAL_127]], %[[VAL_128]] : i32 +// CHECK: %[[VAL_130:.*]] = arith.cmpi sge, %[[VAL_129]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_131:.*]] = arith.subi %[[VAL_129]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_132:.*]] = arith.select %[[VAL_130]], %[[VAL_131]], %[[VAL_129]] : i32 +// CHECK: memref.store %[[VAL_132]], %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_133:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_133]]) +// CHECK: %[[VAL_134:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_135:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_136:.*]] = arith.subi %[[VAL_134]], %[[VAL_135]] : i32 +// CHECK: memref.store %[[VAL_136]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_137:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_138:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_139:.*]] = arith.addi %[[VAL_137]], %[[VAL_138]] : i32 +// CHECK: %[[VAL_140:.*]] = arith.cmpi sge, %[[VAL_139]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_141:.*]] = arith.subi %[[VAL_139]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_142:.*]] = arith.select %[[VAL_140]], %[[VAL_141]], %[[VAL_139]] : i32 +// CHECK: memref.store %[[VAL_142]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: aie.end // CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_3]], MM2S, 0) +// CHECK: %[[VAL_143:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_144:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) +// CHECK: ^bb1: +// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_145]]) +// CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_146:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_146]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_147:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_147]]) +// CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_148:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_148]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_149:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_149]]) +// CHECK: aie.dma_bd(%[[VAL_13]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_150:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_150]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb4: +// CHECK: %[[VAL_151:.*]] = aie.dma_start(MM2S, 0, ^bb5, ^bb7) +// CHECK: ^bb5: +// CHECK: %[[VAL_152:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_152]]) +// CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_153:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_153]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb6: +// CHECK: %[[VAL_154:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_154]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_155:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_155]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb7: +// CHECK: aie.end // CHECK: } -// CHECK: case 2 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @add_10_i32(%35, %38, %32) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) -// CHECK: %39 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c1_i32_4 = arith.constant 1 : i32 -// CHECK: %40 = arith.addi %39, %c1_i32_4 : i32 -// CHECK: %41 = arith.cmpi sge, %40, %c3_i32 : i32 -// CHECK: %42 = arith.subi %40, %c3_i32 : i32 -// CHECK: %43 = arith.select %41, %42, %40 : i32 -// CHECK: memref.store %43, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %44 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32_5 = arith.constant 1 : i32 -// CHECK: %45 = arith.addi %44, %c1_i32_5 : i32 -// CHECK: %46 = arith.cmpi sge, %45, %c2_i32 : i32 -// CHECK: %47 = arith.subi %45, %c2_i32 : i32 -// CHECK: %48 = arith.select %46, %47, %45 : i32 -// CHECK: memref.store %48, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: %11 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %12 = arith.index_cast %11 : i32 to index -// CHECK: %13 = scf.index_switch %12 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_3]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) -// CHECK: %14 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %15 = arith.index_cast %14 : i32 to index -// CHECK: %16 = scf.index_switch %15 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_3]], S2MM, 0) // CHECK: } -// CHECK: case 2 { -// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: %17 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %18 = arith.index_cast %17 : i32 to index -// CHECK: %19 = scf.index_switch %18 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> -// CHECK: } -// CHECK: case 2 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @add_10_i32(%16, %19, %13) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 2) -// CHECK: %20 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c2_i32_2 = arith.constant 2 : i32 -// CHECK: %21 = arith.addi %20, %c2_i32_2 : i32 -// CHECK: %22 = arith.cmpi sge, %21, %c3_i32 : i32 -// CHECK: %23 = arith.subi %21, %c3_i32 : i32 -// CHECK: %24 = arith.select %22, %23, %21 : i32 -// CHECK: memref.store %24, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %25 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32_3 = arith.constant 1 : i32 -// CHECK: %26 = arith.addi %25, %c1_i32_3 : i32 -// CHECK: %27 = arith.cmpi sge, %26, %c2_i32 : i32 -// CHECK: %28 = arith.subi %26, %c2_i32 : i32 -// CHECK: %29 = arith.select %27, %28, %26 : i32 -// CHECK: memref.store %29, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: aie.end // CHECK: } -// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%shim_noc_tile_0_0, MM2S, 0) - module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir index 0d5d2a0ba5e..be37de92d3e 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir @@ -7,143 +7,296 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform=dynamic-objFifos %s | FileCheck %s -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "output_fifo2_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_3:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "output_fifo2_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_0_4, 2) {init = 2 : i32, sym_name = "output_fifo2_prod_lock_0"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_0_4, 3) {init = 0 : i32, sym_name = "output_fifo2_cons_lock_0"} -// CHECK: %[[VAL_6:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "input_fifo2_cons_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_7:.*]] = aie.buffer(%{{.*}}tile_0_4) {sym_name = "input_fifo2_cons_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_8:.*]] = aie.lock(%{{.*}}tile_0_4, 0) {init = 2 : i32, sym_name = "input_fifo2_cons_prod_lock_0"} -// CHECK: %[[VAL_9:.*]] = aie.lock(%{{.*}}tile_0_4, 1) {init = 0 : i32, sym_name = "input_fifo2_cons_cons_lock_0"} -// CHECK: %[[VAL_14:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_15:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_16:.*]] = aie.lock(%{{.*}}tile_0_2, 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} -// CHECK: %[[VAL_17:.*]] = aie.lock(%{{.*}}tile_0_2, 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} -// CHECK: %[[VAL_18:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_19:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_20:.*]] = aie.lock(%{{.*}}tile_0_2, 0) {init = 2 : i32, sym_name = "input_fifo_cons_prod_lock_0"} -// CHECK: %[[VAL_21:.*]] = aie.lock(%{{.*}}tile_0_2, 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} -// CHECK: aie.flow(%{{.*}}tile_0_0, DMA : 0, %{{.*}}tile_0_2, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_2, DMA : 0, %{{.*}}tile_0_0, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_0, DMA : 1, %{{.*}}tile_0_4, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_4, DMA : 0, %{{.*}}tile_0_0, DMA : 1) -// CHECK: %core_0_2 = aie.core(%{{.*}}tile_0_2) { -// CHECK: %c0_i32 = arith.constant 0 : i32 -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c2_i32 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c2_i32_0 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c0_1 = arith.constant 0 : index -// CHECK: %c1_2 = arith.constant 1 : index -// CHECK: %c10 = arith.constant 10 : index -// CHECK: scf.for %arg0 = %c0_1 to %c10 step %c1_2 { -// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, 1) -// CHECK: %0 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %1 = arith.index_cast %0 : i32 to index -// CHECK: %2 = scf.index_switch %1 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_14]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_15]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_14]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, 1) -// CHECK: %3 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %4 = arith.index_cast %3 : i32 to index -// CHECK: %5 = scf.index_switch %4 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_18]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_19]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_18]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @passthrough_10_i32(%5, %2) : (memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_20]], Release, 1) -// CHECK: %6 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c1_i32 = arith.constant 1 : i32 -// CHECK: %7 = arith.addi %6, %c1_i32 : i32 -// CHECK: %8 = arith.cmpi sge, %7, %c2_i32_0 : i32 -// CHECK: %9 = arith.subi %7, %c2_i32_0 : i32 -// CHECK: %10 = arith.select %8, %9, %7 : i32 -// CHECK: memref.store %10, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) -// CHECK: %11 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32_3 = arith.constant 1 : i32 -// CHECK: %12 = arith.addi %11, %c1_i32_3 : i32 -// CHECK: %13 = arith.cmpi sge, %12, %c2_i32 : i32 -// CHECK: %14 = arith.subi %12, %c2_i32 : i32 -// CHECK: %15 = arith.select %13, %14, %12 : i32 -// CHECK: memref.store %15, %buffer_0_2[%c0] : memref<2xi32> +// CHECK-LABEL: module { +// CHECK: aie.device(npu1_1col) { +// CHECK: func.func @passthrough_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>) { +// CHECK: return // CHECK: } -// CHECK: aie.end -// CHECK: } {dynamic_objfifo_lowering = false} -// CHECK: %buffer_0_4 = aie.buffer(%{{.*}}tile_0_4) : memref<2xi32> -// CHECK: %core_0_4 = aie.core(%{{.*}}tile_0_4) { -// CHECK: %c0_i32 = arith.constant 0 : i32 -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c2_i32 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_4[%c0] : memref<2xi32> -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c2_i32_0 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_4[%c1] : memref<2xi32> -// CHECK: %c0_1 = arith.constant 0 : index -// CHECK: %c1_2 = arith.constant 1 : index -// CHECK: %c10 = arith.constant 10 : index -// CHECK: scf.for %arg0 = %c0_1 to %c10 step %c1_2 { -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: %0 = memref.load %buffer_0_4[%c0] : memref<2xi32> -// CHECK: %1 = arith.index_cast %0 : i32 to index -// CHECK: %2 = scf.index_switch %1 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> +// CHECK: %[[VAL_2:.*]] = aie.tile(0, 0) +// CHECK: %[[VAL_3:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_4:.*]] = aie.tile(0, 4) +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_2]], 6) {init = 0 : i32, sym_name = "output_fifo2_cons_prod_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_2]], 7) {init = 0 : i32, sym_name = "output_fifo2_cons_cons_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo2_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo2_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_4]], 2) {init = 2 : i32, sym_name = "output_fifo2_prod_lock_0"} +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_4]], 3) {init = 0 : i32, sym_name = "output_fifo2_cons_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo2_cons_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_12:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo2_cons_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_13:.*]] = aie.lock(%[[VAL_4]], 0) {init = 2 : i32, sym_name = "input_fifo2_cons_prod_lock_0"} +// CHECK: %[[VAL_14:.*]] = aie.lock(%[[VAL_4]], 1) {init = 0 : i32, sym_name = "input_fifo2_cons_cons_lock_0"} +// CHECK: %[[VAL_15:.*]] = aie.lock(%[[VAL_2]], 4) {init = 0 : i32, sym_name = "input_fifo2_prod_lock_0"} +// CHECK: %[[VAL_16:.*]] = aie.lock(%[[VAL_2]], 5) {init = 0 : i32, sym_name = "input_fifo2_cons_lock_0"} +// CHECK: %[[VAL_17:.*]] = aie.lock(%[[VAL_2]], 2) {init = 0 : i32, sym_name = "output_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_18:.*]] = aie.lock(%[[VAL_2]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_19:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "output_fifo_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_20:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "output_fifo_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_21:.*]] = aie.lock(%[[VAL_3]], 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} +// CHECK: %[[VAL_22:.*]] = aie.lock(%[[VAL_3]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} +// CHECK: %[[VAL_23:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_24:.*]] = aie.buffer(%[[VAL_3]]) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_25:.*]] = aie.lock(%[[VAL_3]], 0) {init = 2 : i32, sym_name = "input_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_26:.*]] = aie.lock(%[[VAL_3]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_27:.*]] = aie.lock(%[[VAL_2]], 0) {init = 0 : i32, sym_name = "input_fifo_prod_lock_0"} +// CHECK: %[[VAL_28:.*]] = aie.lock(%[[VAL_2]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_2]], DMA : 0, %[[VAL_3]], DMA : 0) +// CHECK: aie.flow(%[[VAL_3]], DMA : 0, %[[VAL_2]], DMA : 0) +// CHECK: aie.flow(%[[VAL_2]], DMA : 1, %[[VAL_4]], DMA : 0) +// CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_2]], DMA : 1) +// CHECK: %[[VAL_29:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> +// CHECK: %[[VAL_30:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> +// CHECK: %[[VAL_31:.*]] = aie.core(%[[VAL_3]]) { +// CHECK: %[[VAL_32:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_33:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_34:.*]] = arith.constant 1 : index +// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_35:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_36:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_37:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_39:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_40:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_41:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_42:.*]] = arith.constant 10 : index +// CHECK: scf.for %[[VAL_43:.*]] = %[[VAL_40]] to %[[VAL_42]] step %[[VAL_41]] { +// CHECK: %[[VAL_44:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_46:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_45]], %[[VAL_44]] : i32 +// CHECK: %[[VAL_48:.*]] = arith.maxsi %[[VAL_47]], %[[VAL_46]] : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_48]]) +// CHECK: %[[VAL_49:.*]] = arith.addi %[[VAL_44]], %[[VAL_48]] : i32 +// CHECK: memref.store %[[VAL_49]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_51:.*]] = arith.index_cast %[[VAL_50]] : i32 to index +// CHECK: %[[VAL_52:.*]] = scf.index_switch %[[VAL_51]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_19]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_20]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_19]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_55:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_56:.*]] = arith.subi %[[VAL_54]], %[[VAL_53]] : i32 +// CHECK: %[[VAL_57:.*]] = arith.maxsi %[[VAL_56]], %[[VAL_55]] : i32 +// CHECK: aie.use_lock(%[[VAL_26]], AcquireGreaterEqual, %[[VAL_57]]) +// CHECK: %[[VAL_58:.*]] = arith.addi %[[VAL_53]], %[[VAL_57]] : i32 +// CHECK: memref.store %[[VAL_58]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_59:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_60:.*]] = arith.index_cast %[[VAL_59]] : i32 to index +// CHECK: %[[VAL_61:.*]] = scf.index_switch %[[VAL_60]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_23]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_24]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_23]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @passthrough_10_i32(%[[VAL_61]], %[[VAL_52]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], Release, %[[VAL_62]]) +// CHECK: %[[VAL_63:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_64:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_65:.*]] = arith.subi %[[VAL_63]], %[[VAL_64]] : i32 +// CHECK: memref.store %[[VAL_65]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_66:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_67:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_68:.*]] = arith.addi %[[VAL_66]], %[[VAL_67]] : i32 +// CHECK: %[[VAL_69:.*]] = arith.cmpi sge, %[[VAL_68]], %[[VAL_39]] : i32 +// CHECK: %[[VAL_70:.*]] = arith.subi %[[VAL_68]], %[[VAL_39]] : i32 +// CHECK: %[[VAL_71:.*]] = arith.select %[[VAL_69]], %[[VAL_70]], %[[VAL_68]] : i32 +// CHECK: memref.store %[[VAL_71]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> +// CHECK: %[[VAL_72:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %[[VAL_72]]) +// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_74:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_75:.*]] = arith.subi %[[VAL_73]], %[[VAL_74]] : i32 +// CHECK: memref.store %[[VAL_75]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_76:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_77:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_78:.*]] = arith.addi %[[VAL_76]], %[[VAL_77]] : i32 +// CHECK: %[[VAL_79:.*]] = arith.cmpi sge, %[[VAL_78]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_80:.*]] = arith.subi %[[VAL_78]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_81:.*]] = arith.select %[[VAL_79]], %[[VAL_80]], %[[VAL_78]] : i32 +// CHECK: memref.store %[[VAL_81]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> // CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_3]] : memref<10xi32> +// CHECK: aie.end +// CHECK: } {dynamic_objfifo_lowering = false} +// CHECK: %[[VAL_82:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> +// CHECK: %[[VAL_83:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> +// CHECK: %[[VAL_84:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_85:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_86:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_85]], %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> +// CHECK: %[[VAL_87:.*]] = arith.constant 1 : index +// CHECK: memref.store %[[VAL_85]], %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> +// CHECK: %[[VAL_88:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_89:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_90:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_88]], %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> +// CHECK: %[[VAL_91:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_92:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_88]], %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> +// CHECK: %[[VAL_93:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_94:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_95:.*]] = arith.constant 10 : index +// CHECK: scf.for %[[VAL_96:.*]] = %[[VAL_93]] to %[[VAL_95]] step %[[VAL_94]] { +// CHECK: %[[VAL_97:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> +// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_99:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_100:.*]] = arith.subi %[[VAL_98]], %[[VAL_97]] : i32 +// CHECK: %[[VAL_101:.*]] = arith.maxsi %[[VAL_100]], %[[VAL_99]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_101]]) +// CHECK: %[[VAL_102:.*]] = arith.addi %[[VAL_97]], %[[VAL_101]] : i32 +// CHECK: memref.store %[[VAL_102]], %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> +// CHECK: %[[VAL_103:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> +// CHECK: %[[VAL_104:.*]] = arith.index_cast %[[VAL_103]] : i32 to index +// CHECK: %[[VAL_105:.*]] = scf.index_switch %[[VAL_104]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_106:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> +// CHECK: %[[VAL_107:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_108:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_109:.*]] = arith.subi %[[VAL_107]], %[[VAL_106]] : i32 +// CHECK: %[[VAL_110:.*]] = arith.maxsi %[[VAL_109]], %[[VAL_108]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_110]]) +// CHECK: %[[VAL_111:.*]] = arith.addi %[[VAL_106]], %[[VAL_110]] : i32 +// CHECK: memref.store %[[VAL_111]], %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> +// CHECK: %[[VAL_112:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> +// CHECK: %[[VAL_113:.*]] = arith.index_cast %[[VAL_112]] : i32 to index +// CHECK: %[[VAL_114:.*]] = scf.index_switch %[[VAL_113]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @passthrough_10_i32(%[[VAL_114]], %[[VAL_105]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_115]]) +// CHECK: %[[VAL_116:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> +// CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_118:.*]] = arith.subi %[[VAL_116]], %[[VAL_117]] : i32 +// CHECK: memref.store %[[VAL_118]], %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> +// CHECK: %[[VAL_119:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> +// CHECK: %[[VAL_120:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_121:.*]] = arith.addi %[[VAL_119]], %[[VAL_120]] : i32 +// CHECK: %[[VAL_122:.*]] = arith.cmpi sge, %[[VAL_121]], %[[VAL_92]] : i32 +// CHECK: %[[VAL_123:.*]] = arith.subi %[[VAL_121]], %[[VAL_92]] : i32 +// CHECK: %[[VAL_124:.*]] = arith.select %[[VAL_122]], %[[VAL_123]], %[[VAL_121]] : i32 +// CHECK: memref.store %[[VAL_124]], %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> +// CHECK: %[[VAL_125:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_125]]) +// CHECK: %[[VAL_126:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> +// CHECK: %[[VAL_127:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_128:.*]] = arith.subi %[[VAL_126]], %[[VAL_127]] : i32 +// CHECK: memref.store %[[VAL_128]], %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> +// CHECK: %[[VAL_129:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> +// CHECK: %[[VAL_130:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_131:.*]] = arith.addi %[[VAL_129]], %[[VAL_130]] : i32 +// CHECK: %[[VAL_132:.*]] = arith.cmpi sge, %[[VAL_131]], %[[VAL_90]] : i32 +// CHECK: %[[VAL_133:.*]] = arith.subi %[[VAL_131]], %[[VAL_90]] : i32 +// CHECK: %[[VAL_134:.*]] = arith.select %[[VAL_132]], %[[VAL_133]], %[[VAL_131]] : i32 +// CHECK: memref.store %[[VAL_134]], %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> // CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) -// CHECK: %3 = memref.load %buffer_0_4[%c1] : memref<2xi32> -// CHECK: %4 = arith.index_cast %3 : i32 to index -// CHECK: %5 = scf.index_switch %4 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @passthrough_10_i32(%5, %2) : (memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) -// CHECK: %6 = memref.load %buffer_0_4[%c1] : memref<2xi32> -// CHECK: %c1_i32 = arith.constant 1 : i32 -// CHECK: %7 = arith.addi %6, %c1_i32 : i32 -// CHECK: %8 = arith.cmpi sge, %7, %c2_i32_0 : i32 -// CHECK: %9 = arith.subi %7, %c2_i32_0 : i32 -// CHECK: %10 = arith.select %8, %9, %7 : i32 -// CHECK: memref.store %10, %buffer_0_4[%c1] : memref<2xi32> -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %11 = memref.load %buffer_0_4[%c0] : memref<2xi32> -// CHECK: %c1_i32_3 = arith.constant 1 : i32 -// CHECK: %12 = arith.addi %11, %c1_i32_3 : i32 -// CHECK: %13 = arith.cmpi sge, %12, %c2_i32 : i32 -// CHECK: %14 = arith.subi %12, %c2_i32 : i32 -// CHECK: %15 = arith.select %13, %14, %12 : i32 -// CHECK: memref.store %15, %buffer_0_4[%c0] : memref<2xi32> +// CHECK: aie.end +// CHECK: } +// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_2]], MM2S, 0) +// CHECK: %[[VAL_135:.*]] = aie.mem(%[[VAL_3]]) { +// CHECK: %[[VAL_136:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: ^bb1: +// CHECK: %[[VAL_137:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_137]]) +// CHECK: aie.dma_bd(%[[VAL_23]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_138:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_138]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_139:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_139]]) +// CHECK: aie.dma_bd(%[[VAL_24]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_140:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_140]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb3: +// CHECK: %[[VAL_141:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: ^bb4: +// CHECK: %[[VAL_142:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_142]]) +// CHECK: aie.dma_bd(%[[VAL_19]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_143:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_143]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb5: +// CHECK: %[[VAL_144:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_144]]) +// CHECK: aie.dma_bd(%[[VAL_20]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_145]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb6: +// CHECK: aie.end +// CHECK: } +// CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_2]], S2MM, 0) +// CHECK: aie.shim_dma_allocation @input_fifo2_shim_alloc(%[[VAL_2]], MM2S, 1) +// CHECK: %[[VAL_146:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_147:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: ^bb1: +// CHECK: %[[VAL_148:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_148]]) +// CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_149:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_149]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_150:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_150]]) +// CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_151:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_151]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb3: +// CHECK: %[[VAL_152:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: ^bb4: +// CHECK: %[[VAL_153:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_153]]) +// CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_154:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_154]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb5: +// CHECK: %[[VAL_155:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_155]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_156:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_156]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb6: +// CHECK: aie.end // CHECK: } -// CHECK: aie.end +// CHECK: aie.shim_dma_allocation @output_fifo2_shim_alloc(%[[VAL_2]], S2MM, 1) // CHECK: } +// CHECK: } module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir index 65e8354d85c..927ca6b88a9 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir @@ -7,182 +7,299 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform=dynamic-objFifos %s | FileCheck %s -// CHECK: aie.device(npu1_1col) { -// CHECK: func.func @add_10_i32(%arg0: memref<10xi32>, %arg1: memref<10xi32>, %arg2: memref<10xi32>) { -// CHECK: return -// CHECK: } -// CHECK: %{{.*}}tile_0_0 = aie.tile(0, 0) -// CHECK: %{{.*}}tile_0_2 = aie.tile(0, 2) -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_3:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "output_fifo_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_0_2, 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_0_2, 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} -// CHECK: %[[VAL_6:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> -// CHECK: %[[VAL_7:.*]] = aie.buffer(%{{.*}}tile_0_2) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> -// CHECK: %[[VAL_8:.*]] = aie.lock(%{{.*}}tile_0_2, 0) {init = 2 : i32, sym_name = "input_fifo_cons_prod_lock_0"} -// CHECK: %[[VAL_9:.*]] = aie.lock(%{{.*}}tile_0_2, 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} -// CHECK: aie.flow(%{{.*}}tile_0_0, DMA : 0, %{{.*}}tile_0_2, DMA : 0) -// CHECK: aie.flow(%{{.*}}tile_0_2, DMA : 0, %{{.*}}tile_0_0, DMA : 0) -// CHECK: %buffer_0_2 = aie.buffer(%{{.*}}tile_0_2) : memref<2xi32> -// CHECK: %core_0_2 = aie.core(%{{.*}}tile_0_2) { -// CHECK: %c0_i32 = arith.constant 0 : i32 -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c2_i32 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c2_i32_0 = arith.constant 2 : i32 -// CHECK: memref.store %c0_i32, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c0_1 = arith.constant 0 : index -// CHECK: %c1_2 = arith.constant 1 : index -// CHECK: %c9 = arith.constant 9 : index -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: %0 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %1 = arith.index_cast %0 : i32 to index -// CHECK: %2 = scf.index_switch %1 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_3]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) -// CHECK: %3 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %4 = arith.index_cast %3 : i32 to index -// CHECK: %5 = scf.index_switch %4 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @add_10_i32(%5, %5, %2) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %6 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32 = arith.constant 1 : i32 -// CHECK: %7 = arith.addi %6, %c1_i32 : i32 -// CHECK: %8 = arith.cmpi sge, %7, %c2_i32 : i32 -// CHECK: %9 = arith.subi %7, %c2_i32 : i32 -// CHECK: %10 = arith.select %8, %9, %7 : i32 -// CHECK: memref.store %10, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: scf.for %arg0 = %c0_1 to %c9 step %c1_2 { -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: %30 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %31 = arith.index_cast %30 : i32 to index -// CHECK: %32 = scf.index_switch %31 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_3]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) -// CHECK: %33 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %34 = arith.index_cast %33 : i32 to index -// CHECK: %35 = scf.index_switch %34 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK-LABEL: module { +// CHECK: aie.device(npu1_1col) { +// CHECK: func.func @add_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>, %[[VAL_2:.*]]: memref<10xi32>) { +// CHECK: return // CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> +// CHECK: %[[VAL_3:.*]] = aie.tile(0, 0) +// CHECK: %[[VAL_4:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_3]], 2) {init = 0 : i32, sym_name = "output_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_3]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "output_fifo_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_4]], 2) {init = 2 : i32, sym_name = "output_fifo_prod_lock_0"} +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_4]], 3) {init = 0 : i32, sym_name = "output_fifo_cons_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo_cons_buff_0"} : memref<10xi32> +// CHECK: %[[VAL_12:.*]] = aie.buffer(%[[VAL_4]]) {sym_name = "input_fifo_cons_buff_1"} : memref<10xi32> +// CHECK: %[[VAL_13:.*]] = aie.lock(%[[VAL_4]], 0) {init = 2 : i32, sym_name = "input_fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_14:.*]] = aie.lock(%[[VAL_4]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_15:.*]] = aie.lock(%[[VAL_3]], 0) {init = 0 : i32, sym_name = "input_fifo_prod_lock_0"} +// CHECK: %[[VAL_16:.*]] = aie.lock(%[[VAL_3]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_3]], DMA : 0, %[[VAL_4]], DMA : 0) +// CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_3]], DMA : 0) +// CHECK: %[[VAL_17:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> +// CHECK: %[[VAL_18:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> +// CHECK: %[[VAL_19:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_20:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_21:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_20]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_22:.*]] = arith.constant 1 : index +// CHECK: memref.store %[[VAL_20]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_23:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_24:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_25:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_23]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_26:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_27:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_23]], %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_28:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_29:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_30:.*]] = arith.constant 9 : index +// CHECK: %[[VAL_31:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_33:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_34:.*]] = arith.subi %[[VAL_32]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_35:.*]] = arith.maxsi %[[VAL_34]], %[[VAL_33]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_35]]) +// CHECK: %[[VAL_36:.*]] = arith.addi %[[VAL_31]], %[[VAL_35]] : i32 +// CHECK: memref.store %[[VAL_36]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_38:.*]] = arith.index_cast %[[VAL_37]] : i32 to index +// CHECK: %[[VAL_39:.*]] = scf.index_switch %[[VAL_38]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_40:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_41:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_42:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_43:.*]] = arith.subi %[[VAL_41]], %[[VAL_40]] : i32 +// CHECK: %[[VAL_44:.*]] = arith.maxsi %[[VAL_43]], %[[VAL_42]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_44]]) +// CHECK: %[[VAL_45:.*]] = arith.addi %[[VAL_40]], %[[VAL_44]] : i32 +// CHECK: memref.store %[[VAL_45]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_46:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_47:.*]] = arith.index_cast %[[VAL_46]] : i32 to index +// CHECK: %[[VAL_48:.*]] = scf.index_switch %[[VAL_47]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @add_10_i32(%[[VAL_48]], %[[VAL_48]], %[[VAL_39]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_49]]) +// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_52:.*]] = arith.subi %[[VAL_50]], %[[VAL_51]] : i32 +// CHECK: memref.store %[[VAL_52]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_55:.*]] = arith.addi %[[VAL_53]], %[[VAL_54]] : i32 +// CHECK: %[[VAL_56:.*]] = arith.cmpi sge, %[[VAL_55]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_57:.*]] = arith.subi %[[VAL_55]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_58:.*]] = arith.select %[[VAL_56]], %[[VAL_57]], %[[VAL_55]] : i32 +// CHECK: memref.store %[[VAL_58]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: scf.for %[[VAL_59:.*]] = %[[VAL_28]] to %[[VAL_30]] step %[[VAL_29]] { +// CHECK: %[[VAL_60:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_62:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_63:.*]] = arith.subi %[[VAL_61]], %[[VAL_60]] : i32 +// CHECK: %[[VAL_64:.*]] = arith.maxsi %[[VAL_63]], %[[VAL_62]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_64]]) +// CHECK: %[[VAL_65:.*]] = arith.addi %[[VAL_60]], %[[VAL_64]] : i32 +// CHECK: memref.store %[[VAL_65]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_66:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_67:.*]] = arith.index_cast %[[VAL_66]] : i32 to index +// CHECK: %[[VAL_68:.*]] = scf.index_switch %[[VAL_67]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_69:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_70:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_71:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_72:.*]] = arith.subi %[[VAL_70]], %[[VAL_69]] : i32 +// CHECK: %[[VAL_73:.*]] = arith.maxsi %[[VAL_72]], %[[VAL_71]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_73]]) +// CHECK: %[[VAL_74:.*]] = arith.addi %[[VAL_69]], %[[VAL_73]] : i32 +// CHECK: memref.store %[[VAL_74]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_75:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_76:.*]] = arith.index_cast %[[VAL_75]] : i32 to index +// CHECK: %[[VAL_77:.*]] = scf.index_switch %[[VAL_76]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_78:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_79:.*]] = arith.index_cast %[[VAL_78]] : i32 to index +// CHECK: %[[VAL_80:.*]] = scf.index_switch %[[VAL_79]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @add_10_i32(%[[VAL_77]], %[[VAL_80]], %[[VAL_68]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_81:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_81]]) +// CHECK: %[[VAL_82:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_83:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_84:.*]] = arith.subi %[[VAL_82]], %[[VAL_83]] : i32 +// CHECK: memref.store %[[VAL_84]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_85:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_86:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_87:.*]] = arith.addi %[[VAL_85]], %[[VAL_86]] : i32 +// CHECK: %[[VAL_88:.*]] = arith.cmpi sge, %[[VAL_87]], %[[VAL_27]] : i32 +// CHECK: %[[VAL_89:.*]] = arith.subi %[[VAL_87]], %[[VAL_27]] : i32 +// CHECK: %[[VAL_90:.*]] = arith.select %[[VAL_88]], %[[VAL_89]], %[[VAL_87]] : i32 +// CHECK: memref.store %[[VAL_90]], %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_91]]) +// CHECK: %[[VAL_92:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_94:.*]] = arith.subi %[[VAL_92]], %[[VAL_93]] : i32 +// CHECK: memref.store %[[VAL_94]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_95:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_97:.*]] = arith.addi %[[VAL_95]], %[[VAL_96]] : i32 +// CHECK: %[[VAL_98:.*]] = arith.cmpi sge, %[[VAL_97]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_99:.*]] = arith.subi %[[VAL_97]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_100:.*]] = arith.select %[[VAL_98]], %[[VAL_99]], %[[VAL_97]] : i32 +// CHECK: memref.store %[[VAL_100]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: } +// CHECK: %[[VAL_101:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_102:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_103:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_104:.*]] = arith.subi %[[VAL_102]], %[[VAL_101]] : i32 +// CHECK: %[[VAL_105:.*]] = arith.maxsi %[[VAL_104]], %[[VAL_103]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_105]]) +// CHECK: %[[VAL_106:.*]] = arith.addi %[[VAL_101]], %[[VAL_105]] : i32 +// CHECK: memref.store %[[VAL_106]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_107:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_108:.*]] = arith.index_cast %[[VAL_107]] : i32 to index +// CHECK: %[[VAL_109:.*]] = scf.index_switch %[[VAL_108]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_8]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_110:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_111:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_112:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_113:.*]] = arith.subi %[[VAL_111]], %[[VAL_110]] : i32 +// CHECK: %[[VAL_114:.*]] = arith.maxsi %[[VAL_113]], %[[VAL_112]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_114]]) +// CHECK: %[[VAL_115:.*]] = arith.addi %[[VAL_110]], %[[VAL_114]] : i32 +// CHECK: memref.store %[[VAL_115]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_116:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_117:.*]] = arith.index_cast %[[VAL_116]] : i32 to index +// CHECK: %[[VAL_118:.*]] = scf.index_switch %[[VAL_117]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: %[[VAL_119:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_120:.*]] = arith.index_cast %[[VAL_119]] : i32 to index +// CHECK: %[[VAL_121:.*]] = scf.index_switch %[[VAL_120]] -> memref<10xi32> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_11]] : memref<10xi32> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_12]] : memref<10xi32> +// CHECK: } +// CHECK: func.call @add_10_i32(%[[VAL_118]], %[[VAL_121]], %[[VAL_109]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_122:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_122]]) +// CHECK: %[[VAL_123:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_124:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_125:.*]] = arith.subi %[[VAL_123]], %[[VAL_124]] : i32 +// CHECK: memref.store %[[VAL_125]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_126:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_127:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_128:.*]] = arith.addi %[[VAL_126]], %[[VAL_127]] : i32 +// CHECK: %[[VAL_129:.*]] = arith.cmpi sge, %[[VAL_128]], %[[VAL_27]] : i32 +// CHECK: %[[VAL_130:.*]] = arith.subi %[[VAL_128]], %[[VAL_27]] : i32 +// CHECK: %[[VAL_131:.*]] = arith.select %[[VAL_129]], %[[VAL_130]], %[[VAL_128]] : i32 +// CHECK: memref.store %[[VAL_131]], %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_132:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_132]]) +// CHECK: %[[VAL_133:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_134:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_135:.*]] = arith.subi %[[VAL_133]], %[[VAL_134]] : i32 +// CHECK: memref.store %[[VAL_135]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> +// CHECK: %[[VAL_136:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_137:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_138:.*]] = arith.addi %[[VAL_136]], %[[VAL_137]] : i32 +// CHECK: %[[VAL_139:.*]] = arith.cmpi sge, %[[VAL_138]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_140:.*]] = arith.subi %[[VAL_138]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_141:.*]] = arith.select %[[VAL_139]], %[[VAL_140]], %[[VAL_138]] : i32 +// CHECK: memref.store %[[VAL_141]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: aie.end // CHECK: } -// CHECK: %36 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %37 = arith.index_cast %36 : i32 to index -// CHECK: %38 = scf.index_switch %37 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_3]], MM2S, 0) +// CHECK: %[[VAL_142:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_143:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: ^bb1: +// CHECK: %[[VAL_144:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_144]]) +// CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_145]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_146:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_146]]) +// CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_147:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_147]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb3: +// CHECK: %[[VAL_148:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: ^bb4: +// CHECK: %[[VAL_149:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_149]]) +// CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_150:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_150]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb5: +// CHECK: %[[VAL_151:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_151]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) +// CHECK: %[[VAL_152:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_152]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb6: +// CHECK: aie.end // CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: func.call @add_10_i32(%35, %38, %32) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) -// CHECK: %39 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c1_i32_5 = arith.constant 1 : i32 -// CHECK: %40 = arith.addi %39, %c1_i32_5 : i32 -// CHECK: %41 = arith.cmpi sge, %40, %c2_i32_0 : i32 -// CHECK: %42 = arith.subi %40, %c2_i32_0 : i32 -// CHECK: %43 = arith.select %41, %42, %40 : i32 -// CHECK: memref.store %43, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %44 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32_6 = arith.constant 1 : i32 -// CHECK: %45 = arith.addi %44, %c1_i32_6 : i32 -// CHECK: %46 = arith.cmpi sge, %45, %c2_i32 : i32 -// CHECK: %47 = arith.subi %45, %c2_i32 : i32 -// CHECK: %48 = arith.select %46, %47, %45 : i32 -// CHECK: memref.store %48, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1) -// CHECK: %11 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %12 = arith.index_cast %11 : i32 to index -// CHECK: %13 = scf.index_switch %12 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_3]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_2]] : memref<10xi32> -// CHECK: } -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) -// CHECK: %14 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %15 = arith.index_cast %14 : i32 to index -// CHECK: %16 = scf.index_switch %15 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: %17 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %18 = arith.index_cast %17 : i32 to index -// CHECK: %19 = scf.index_switch %18 -> memref<10xi32> -// CHECK: case 0 { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> -// CHECK: } -// CHECK: case 1 { -// CHECK: scf.yield %[[VAL_6]] : memref<10xi32> -// CHECK: } -// CHECK: default { -// CHECK: scf.yield %[[VAL_7]] : memref<10xi32> +// CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_3]], S2MM, 0) // CHECK: } -// CHECK: func.call @add_10_i32(%16, %19, %13) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 2) -// CHECK: %20 = memref.load %buffer_0_2[%c1] : memref<2xi32> -// CHECK: %c2_i32_3 = arith.constant 2 : i32 -// CHECK: %21 = arith.addi %20, %c2_i32_3 : i32 -// CHECK: %22 = arith.cmpi sge, %21, %c2_i32_0 : i32 -// CHECK: %23 = arith.subi %21, %c2_i32_0 : i32 -// CHECK: %24 = arith.select %22, %23, %21 : i32 -// CHECK: memref.store %24, %buffer_0_2[%c1] : memref<2xi32> -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %25 = memref.load %buffer_0_2[%c0] : memref<2xi32> -// CHECK: %c1_i32_4 = arith.constant 1 : i32 -// CHECK: %26 = arith.addi %25, %c1_i32_4 : i32 -// CHECK: %27 = arith.cmpi sge, %26, %c2_i32 : i32 -// CHECK: %28 = arith.subi %26, %c2_i32 : i32 -// CHECK: %29 = arith.select %27, %28, %26 : i32 -// CHECK: memref.store %29, %buffer_0_2[%c0] : memref<2xi32> -// CHECK: aie.end // CHECK: } module { diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir new file mode 100644 index 00000000000..94595249885 --- /dev/null +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir @@ -0,0 +1,155 @@ +//===- dynamic_runtime_lock_basic.mlir ------------------------*- MLIR -*-===// +// +// Copyright (C) 2026 Advanced Micro Devices, Inc. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Dynamic objectFifo lowering emits runtime lock bookkeeping. Each acquire +// tracks how many elements are already held in a per-fifo i32 counter and +// acquires only the delta at runtime via a value-carrying +// `AcquireGreaterEqual`. Each release decrements the same counter. This +// replaces the old static cyclostatic analysis / loop peeling. + +// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s + +// CHECK-LABEL: module { +// CHECK: aie.device(npu2) { +// CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) +// CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_4:.*]] = aie.lock(%[[VAL_1]], 0) {init = 2 : i32, sym_name = "fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_3"} : memref<8xi8> +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_0]], 0) {init = 4 : i32, sym_name = "fifo_prod_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) +// CHECK: %[[VAL_12:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> +// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> +// CHECK: %[[VAL_14:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_15:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_16:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_15]], %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: %[[VAL_17:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_18:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_19:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_17]], %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_20:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_21:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_22:.*]] = arith.constant 14 : index +// CHECK: scf.for %[[VAL_23:.*]] = %[[VAL_20]] to %[[VAL_22]] step %[[VAL_21]] { +// CHECK: %[[VAL_24:.*]] = memref.load %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: %[[VAL_25:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_26:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_27:.*]] = arith.subi %[[VAL_25]], %[[VAL_24]] : i32 +// CHECK: %[[VAL_28:.*]] = arith.maxsi %[[VAL_27]], %[[VAL_26]] : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_28]]) +// CHECK: %[[VAL_29:.*]] = arith.addi %[[VAL_24]], %[[VAL_28]] : i32 +// CHECK: memref.store %[[VAL_29]], %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: %[[VAL_30:.*]] = memref.load %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_31:.*]] = arith.index_cast %[[VAL_30]] : i32 to index +// CHECK: %[[VAL_32:.*]] = scf.index_switch %[[VAL_31]] -> memref<8xi8> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_2]] : memref<8xi8> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_3]] : memref<8xi8> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_2]] : memref<8xi8> +// CHECK: } +// CHECK: %[[VAL_33:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %[[VAL_33]]) +// CHECK: %[[VAL_34:.*]] = memref.load %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: %[[VAL_35:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_36:.*]] = arith.subi %[[VAL_34]], %[[VAL_35]] : i32 +// CHECK: memref.store %[[VAL_36]], %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_39:.*]] = arith.addi %[[VAL_37]], %[[VAL_38]] : i32 +// CHECK: %[[VAL_40:.*]] = arith.cmpi sge, %[[VAL_39]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_41:.*]] = arith.subi %[[VAL_39]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_42:.*]] = arith.select %[[VAL_40]], %[[VAL_41]], %[[VAL_39]] : i32 +// CHECK: memref.store %[[VAL_42]], %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_43:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_44:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb5) +// CHECK: ^bb1: +// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_45]]) +// CHECK: aie.dma_bd(%[[VAL_6]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_46:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_46]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_47:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_47]]) +// CHECK: aie.dma_bd(%[[VAL_7]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_48:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_48]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_49]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_50:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_50]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: +// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_51]]) +// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_52]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb5: +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_53:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_54:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: ^bb1: +// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %[[VAL_55]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_56]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_57:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %[[VAL_57]]) +// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_58]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb3: +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } + +module { + aie.device(npu2) { + %tile_0_1 = aie.tile(0, 1) + %tile_0_2 = aie.tile(0, 2) + + aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 4 : i32) : !aie.objectfifo> + + %core_0_2 = aie.core(%tile_0_2) { + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %c14 = arith.constant 14 : index + scf.for %arg0 = %c0 to %c14 step %c1 { + %a = aie.objectfifo.acquire @fifo(Consume, 1) : !aie.objectfifosubview> + %e = aie.objectfifo.subview.access %a[0] : !aie.objectfifosubview> -> memref<8xi8> + aie.objectfifo.release @fifo(Consume, 1) + } + aie.end + } + } +} diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir new file mode 100644 index 00000000000..1d72765ec4a --- /dev/null +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir @@ -0,0 +1,157 @@ +//===- dynamic_runtime_lock_conditional.mlir ------------------*- MLIR -*-===// +// +// Copyright (C) 2026 Advanced Micro Devices, Inc. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// An acquire in the loop body with a release nested in an `scf.if`. The +// runtime held-counter bookkeeping handles conditional acquire/release with +// no static analysis: the held decrement and the buffer-index update are +// emitted inside the `scf.if`, so they only run when the branch is taken. +// The next iteration's acquire computes its delta from the current held +// value, so it acquires nothing extra when the release did not fire. + +// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s + +// CHECK-LABEL: module { +// CHECK: aie.device(npu2) { +// CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) +// CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_3"} : memref<8xi8> +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_1]], 0) {init = 4 : i32, sym_name = "fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_10:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_0]], 0) {init = 3 : i32, sym_name = "fifo_prod_lock_0"} +// CHECK: %[[VAL_12:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) +// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> +// CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> +// CHECK: %[[VAL_15:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_16:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_17:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_16]], %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> +// CHECK: %[[VAL_18:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_19:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_20:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_18]], %[[VAL_13]]{{\[}}%[[VAL_19]]] : memref<1xi32> +// CHECK: %[[VAL_21:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_22:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_23:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_24:.*]] = arith.constant true +// CHECK: scf.for %[[VAL_25:.*]] = %[[VAL_21]] to %[[VAL_23]] step %[[VAL_22]] { +// CHECK: %[[VAL_26:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> +// CHECK: %[[VAL_27:.*]] = arith.constant 3 : i32 +// CHECK: %[[VAL_28:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_29:.*]] = arith.subi %[[VAL_27]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_30:.*]] = arith.maxsi %[[VAL_29]], %[[VAL_28]] : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_30]]) +// CHECK: %[[VAL_31:.*]] = arith.addi %[[VAL_26]], %[[VAL_30]] : i32 +// CHECK: memref.store %[[VAL_31]], %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> +// CHECK: scf.if %[[VAL_24]] { +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_32]]) +// CHECK: %[[VAL_33:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> +// CHECK: %[[VAL_34:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_35:.*]] = arith.subi %[[VAL_33]], %[[VAL_34]] : i32 +// CHECK: memref.store %[[VAL_35]], %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> +// CHECK: %[[VAL_36:.*]] = memref.load %[[VAL_13]]{{\[}}%[[VAL_19]]] : memref<1xi32> +// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_38:.*]] = arith.addi %[[VAL_36]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_39:.*]] = arith.cmpi sge, %[[VAL_38]], %[[VAL_20]] : i32 +// CHECK: %[[VAL_40:.*]] = arith.subi %[[VAL_38]], %[[VAL_20]] : i32 +// CHECK: %[[VAL_41:.*]] = arith.select %[[VAL_39]], %[[VAL_40]], %[[VAL_38]] : i32 +// CHECK: memref.store %[[VAL_41]], %[[VAL_13]]{{\[}}%[[VAL_19]]] : memref<1xi32> +// CHECK: } +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_42:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_43:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: ^bb1: +// CHECK: %[[VAL_44:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_44]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_45]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_46:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_46]]) +// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_47:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_47]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_48:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_48]]) +// CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_49]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb4: +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_50:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_51:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) +// CHECK: ^bb1: +// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_52]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_53]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_54]]) +// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_55]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_56]]) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_57:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_57]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: +// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_58]]) +// CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_59]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb5: +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } + +module { + aie.device(npu2) { + %tile_0_1 = aie.tile(0, 1) + %tile_0_2 = aie.tile(0, 2) + + aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> + + %core_0_2 = aie.core(%tile_0_2) { + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %c14 = arith.constant 14 : index + %true = arith.constant true + scf.for %arg0 = %c0 to %c14 step %c1 { + %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> + scf.if %true { + aie.objectfifo.release @fifo(Consume, 1) + } + } + aie.end + } + } +} diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir new file mode 100644 index 00000000000..92d49e5c723 --- /dev/null +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir @@ -0,0 +1,255 @@ +//===- dynamic_runtime_lock_multiple_fifos.mlir ---------------*- MLIR -*-===// +// +// Copyright (C) 2026 Advanced Micro Devices, Inc. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Two objectFifos acquired/released with different counts in the same loop +// body. Each fifo gets its own runtime held counter and its own +// value-carrying `AcquireGreaterEqual`; the trailing post-loop releases +// decrement the respective counters. + +// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s + +// CHECK-LABEL: module { +// CHECK: aie.device(npu2) { +// CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) +// CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoY_cons_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoY_cons_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoY_cons_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_1]], 2) {init = 3 : i32, sym_name = "fifoY_cons_prod_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_1]], 3) {init = 0 : i32, sym_name = "fifoY_cons_cons_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifoY_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifoY_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_0]], 2) {init = 2 : i32, sym_name = "fifoY_prod_lock_0"} +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_0]], 3) {init = 0 : i32, sym_name = "fifoY_cons_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoX_cons_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_12:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoX_cons_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoX_cons_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoX_cons_buff_3"} : memref<8xi8> +// CHECK: %[[VAL_15:.*]] = aie.lock(%[[VAL_1]], 0) {init = 4 : i32, sym_name = "fifoX_cons_prod_lock_0"} +// CHECK: %[[VAL_16:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "fifoX_cons_cons_lock_0"} +// CHECK: %[[VAL_17:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifoX_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_18:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifoX_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_19:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifoX_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_20:.*]] = aie.lock(%[[VAL_0]], 0) {init = 3 : i32, sym_name = "fifoX_prod_lock_0"} +// CHECK: %[[VAL_21:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifoX_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) +// CHECK: aie.flow(%[[VAL_0]], DMA : 1, %[[VAL_1]], DMA : 1) +// CHECK: %[[VAL_22:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> +// CHECK: %[[VAL_23:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> +// CHECK: %[[VAL_24:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_25:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_26:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_25]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_27:.*]] = arith.constant 1 : index +// CHECK: memref.store %[[VAL_25]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_28:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_29:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_30:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_28]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: %[[VAL_31:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_32:.*]] = arith.constant 3 : i32 +// CHECK: memref.store %[[VAL_28]], %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> +// CHECK: %[[VAL_33:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_34:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_35:.*]] = arith.constant 14 : index +// CHECK: scf.for %[[VAL_36:.*]] = %[[VAL_33]] to %[[VAL_35]] step %[[VAL_34]] { +// CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 3 : i32 +// CHECK: %[[VAL_39:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_40:.*]] = arith.subi %[[VAL_38]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_41:.*]] = arith.maxsi %[[VAL_40]], %[[VAL_39]] : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_41]]) +// CHECK: %[[VAL_42:.*]] = arith.addi %[[VAL_37]], %[[VAL_41]] : i32 +// CHECK: memref.store %[[VAL_42]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_43:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_44:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_45:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_46:.*]] = arith.subi %[[VAL_44]], %[[VAL_43]] : i32 +// CHECK: %[[VAL_47:.*]] = arith.maxsi %[[VAL_46]], %[[VAL_45]] : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_47]]) +// CHECK: %[[VAL_48:.*]] = arith.addi %[[VAL_43]], %[[VAL_47]] : i32 +// CHECK: memref.store %[[VAL_48]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_49]]) +// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_52:.*]] = arith.subi %[[VAL_50]], %[[VAL_51]] : i32 +// CHECK: memref.store %[[VAL_52]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_55:.*]] = arith.addi %[[VAL_53]], %[[VAL_54]] : i32 +// CHECK: %[[VAL_56:.*]] = arith.cmpi sge, %[[VAL_55]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_57:.*]] = arith.subi %[[VAL_55]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_58:.*]] = arith.select %[[VAL_56]], %[[VAL_57]], %[[VAL_55]] : i32 +// CHECK: memref.store %[[VAL_58]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_59]]) +// CHECK: %[[VAL_60:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_62:.*]] = arith.subi %[[VAL_60]], %[[VAL_61]] : i32 +// CHECK: memref.store %[[VAL_62]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_63:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> +// CHECK: %[[VAL_64:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_65:.*]] = arith.addi %[[VAL_63]], %[[VAL_64]] : i32 +// CHECK: %[[VAL_66:.*]] = arith.cmpi sge, %[[VAL_65]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_67:.*]] = arith.subi %[[VAL_65]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_68:.*]] = arith.select %[[VAL_66]], %[[VAL_67]], %[[VAL_65]] : i32 +// CHECK: memref.store %[[VAL_68]], %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> +// CHECK: } +// CHECK: %[[VAL_69:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_69]]) +// CHECK: %[[VAL_70:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_71:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_72:.*]] = arith.subi %[[VAL_70]], %[[VAL_71]] : i32 +// CHECK: memref.store %[[VAL_72]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: %[[VAL_74:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_75:.*]] = arith.addi %[[VAL_73]], %[[VAL_74]] : i32 +// CHECK: %[[VAL_76:.*]] = arith.cmpi sge, %[[VAL_75]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_77:.*]] = arith.subi %[[VAL_75]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_78:.*]] = arith.select %[[VAL_76]], %[[VAL_77]], %[[VAL_75]] : i32 +// CHECK: memref.store %[[VAL_78]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: %[[VAL_79:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_79]]) +// CHECK: %[[VAL_80:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_81:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_82:.*]] = arith.subi %[[VAL_80]], %[[VAL_81]] : i32 +// CHECK: memref.store %[[VAL_82]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_83:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> +// CHECK: %[[VAL_84:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_85:.*]] = arith.addi %[[VAL_83]], %[[VAL_84]] : i32 +// CHECK: %[[VAL_86:.*]] = arith.cmpi sge, %[[VAL_85]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_87:.*]] = arith.subi %[[VAL_85]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_88:.*]] = arith.select %[[VAL_86]], %[[VAL_87]], %[[VAL_85]] : i32 +// CHECK: memref.store %[[VAL_88]], %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_89:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_90:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: ^bb1: +// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_91]]) +// CHECK: aie.dma_bd(%[[VAL_17]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_92]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_93]]) +// CHECK: aie.dma_bd(%[[VAL_18]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_94]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_95]]) +// CHECK: aie.dma_bd(%[[VAL_19]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_96]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb4: +// CHECK: %[[VAL_97:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb7) +// CHECK: ^bb5: +// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_98]]) +// CHECK: aie.dma_bd(%[[VAL_7]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_99:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_99]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb6: +// CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_100]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_101]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb7: +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_102:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_103:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) +// CHECK: ^bb1: +// CHECK: %[[VAL_104:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_104]]) +// CHECK: aie.dma_bd(%[[VAL_11]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_105:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_105]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_106:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_106]]) +// CHECK: aie.dma_bd(%[[VAL_12]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_107:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_107]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_108:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_108]]) +// CHECK: aie.dma_bd(%[[VAL_13]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_109]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: +// CHECK: %[[VAL_110:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_110]]) +// CHECK: aie.dma_bd(%[[VAL_14]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_111]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb5: +// CHECK: %[[VAL_112:.*]] = aie.dma_start(S2MM, 1, ^bb6, ^bb9) +// CHECK: ^bb6: +// CHECK: %[[VAL_113:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_113]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_114:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_114]]) +// CHECK: aie.next_bd ^bb7 +// CHECK: ^bb7: +// CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_115]]) +// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_116:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_116]]) +// CHECK: aie.next_bd ^bb8 +// CHECK: ^bb8: +// CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_117]]) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_118:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_118]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb9: +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } + +module { + aie.device(npu2) { + %tile_0_1 = aie.tile(0, 1) + %tile_0_2 = aie.tile(0, 2) + + aie.objectfifo @fifoX(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> + aie.objectfifo @fifoY(%tile_0_1, {%tile_0_2}, 2 : i32) : !aie.objectfifo> + + %core_0_2 = aie.core(%tile_0_2) { + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %c14 = arith.constant 14 : index + scf.for %arg0 = %c0 to %c14 step %c1 { + %x = aie.objectfifo.acquire @fifoX(Consume, 3) : !aie.objectfifosubview> + %y = aie.objectfifo.acquire @fifoY(Consume, 2) : !aie.objectfifosubview> + aie.objectfifo.release @fifoX(Consume, 1) + aie.objectfifo.release @fifoY(Consume, 1) + } + aie.objectfifo.release @fifoX(Consume, 2) + aie.objectfifo.release @fifoY(Consume, 1) + aie.end + } + } +} diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir new file mode 100644 index 00000000000..d580f8fa460 --- /dev/null +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir @@ -0,0 +1,267 @@ +//===- dynamic_runtime_lock_nested_loops.mlir -----------------*- MLIR -*-===// +// +// Copyright (C) 2026 Advanced Micro Devices, Inc. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Acquires/releases at both the outer and inner loop levels on two fifos. +// The runtime held counters are shared across the loop nest, so the inner +// loop's per-iteration acquire delta and the outer loop's acquire delta are +// each computed from the current held value regardless of loop depth. + +// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s + +// CHECK-LABEL: module { +// CHECK: aie.device(npu2) { +// CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) +// CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_X_cons_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_X_cons_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_X_cons_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_X_cons_buff_3"} : memref<8xi8> +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_1]], 2) {init = 4 : i32, sym_name = "inOF_X_cons_prod_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_1]], 3) {init = 0 : i32, sym_name = "inOF_X_cons_cons_lock_0"} +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "inOF_X_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "inOF_X_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_10:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "inOF_X_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_0]], 2) {init = 3 : i32, sym_name = "inOF_X_prod_lock_0"} +// CHECK: %[[VAL_12:.*]] = aie.lock(%[[VAL_0]], 3) {init = 0 : i32, sym_name = "inOF_X_cons_lock_0"} +// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_W_cons_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_W_cons_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_15:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_W_cons_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_16:.*]] = aie.lock(%[[VAL_1]], 0) {init = 3 : i32, sym_name = "inOF_W_cons_prod_lock_0"} +// CHECK: %[[VAL_17:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "inOF_W_cons_cons_lock_0"} +// CHECK: %[[VAL_18:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "inOF_W_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_19:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "inOF_W_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_20:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "inOF_W_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_21:.*]] = aie.lock(%[[VAL_0]], 0) {init = 3 : i32, sym_name = "inOF_W_prod_lock_0"} +// CHECK: %[[VAL_22:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "inOF_W_cons_lock_0"} +// CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) +// CHECK: aie.flow(%[[VAL_0]], DMA : 1, %[[VAL_1]], DMA : 1) +// CHECK: %[[VAL_23:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> +// CHECK: %[[VAL_24:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> +// CHECK: %[[VAL_25:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_26:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_27:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_26]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_28:.*]] = arith.constant 1 : index +// CHECK: memref.store %[[VAL_26]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_29:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_30:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_31:.*]] = arith.constant 3 : i32 +// CHECK: memref.store %[[VAL_29]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_33:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_29]], %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: %[[VAL_34:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_35:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_36:.*]] = arith.constant 14 : index +// CHECK: scf.for %[[VAL_37:.*]] = %[[VAL_34]] to %[[VAL_36]] step %[[VAL_35]] { +// CHECK: %[[VAL_38:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_39:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_40:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_41:.*]] = arith.subi %[[VAL_39]], %[[VAL_38]] : i32 +// CHECK: %[[VAL_42:.*]] = arith.maxsi %[[VAL_41]], %[[VAL_40]] : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %[[VAL_42]]) +// CHECK: %[[VAL_43:.*]] = arith.addi %[[VAL_38]], %[[VAL_42]] : i32 +// CHECK: memref.store %[[VAL_43]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: scf.for %[[VAL_44:.*]] = %[[VAL_34]] to %[[VAL_36]] step %[[VAL_35]] { +// CHECK: %[[VAL_45:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_46:.*]] = arith.constant 3 : i32 +// CHECK: %[[VAL_47:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_48:.*]] = arith.subi %[[VAL_46]], %[[VAL_45]] : i32 +// CHECK: %[[VAL_49:.*]] = arith.maxsi %[[VAL_48]], %[[VAL_47]] : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_49]]) +// CHECK: %[[VAL_50:.*]] = arith.addi %[[VAL_45]], %[[VAL_49]] : i32 +// CHECK: memref.store %[[VAL_50]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_51]]) +// CHECK: %[[VAL_52:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_54:.*]] = arith.subi %[[VAL_52]], %[[VAL_53]] : i32 +// CHECK: memref.store %[[VAL_54]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_55:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_57:.*]] = arith.addi %[[VAL_55]], %[[VAL_56]] : i32 +// CHECK: %[[VAL_58:.*]] = arith.cmpi sge, %[[VAL_57]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_59:.*]] = arith.subi %[[VAL_57]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_60:.*]] = arith.select %[[VAL_58]], %[[VAL_59]], %[[VAL_57]] : i32 +// CHECK: memref.store %[[VAL_60]], %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: } +// CHECK: %[[VAL_61:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_61]]) +// CHECK: %[[VAL_62:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_63:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_64:.*]] = arith.subi %[[VAL_62]], %[[VAL_63]] : i32 +// CHECK: memref.store %[[VAL_64]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_65:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: %[[VAL_66:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_67:.*]] = arith.addi %[[VAL_65]], %[[VAL_66]] : i32 +// CHECK: %[[VAL_68:.*]] = arith.cmpi sge, %[[VAL_67]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_69:.*]] = arith.subi %[[VAL_67]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_70:.*]] = arith.select %[[VAL_68]], %[[VAL_69]], %[[VAL_67]] : i32 +// CHECK: memref.store %[[VAL_70]], %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: %[[VAL_71:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_71]]) +// CHECK: %[[VAL_72:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_73:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_74:.*]] = arith.subi %[[VAL_72]], %[[VAL_73]] : i32 +// CHECK: memref.store %[[VAL_74]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_75:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_76:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_77:.*]] = arith.addi %[[VAL_75]], %[[VAL_76]] : i32 +// CHECK: %[[VAL_78:.*]] = arith.cmpi sge, %[[VAL_77]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_79:.*]] = arith.subi %[[VAL_77]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_80:.*]] = arith.select %[[VAL_78]], %[[VAL_79]], %[[VAL_77]] : i32 +// CHECK: memref.store %[[VAL_80]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: } +// CHECK: %[[VAL_81:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_81]]) +// CHECK: %[[VAL_82:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_83:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_84:.*]] = arith.subi %[[VAL_82]], %[[VAL_83]] : i32 +// CHECK: memref.store %[[VAL_84]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_85:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_86:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_87:.*]] = arith.addi %[[VAL_85]], %[[VAL_86]] : i32 +// CHECK: %[[VAL_88:.*]] = arith.cmpi sge, %[[VAL_87]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_89:.*]] = arith.subi %[[VAL_87]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_90:.*]] = arith.select %[[VAL_88]], %[[VAL_89]], %[[VAL_87]] : i32 +// CHECK: memref.store %[[VAL_90]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_91:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_92:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: ^bb1: +// CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_93]]) +// CHECK: aie.dma_bd(%[[VAL_18]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_94]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_95]]) +// CHECK: aie.dma_bd(%[[VAL_19]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_96]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_97:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_97]]) +// CHECK: aie.dma_bd(%[[VAL_20]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_98]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb4: +// CHECK: %[[VAL_99:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb8) +// CHECK: ^bb5: +// CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_100]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_101]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb6: +// CHECK: %[[VAL_102:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_102]]) +// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_103]]) +// CHECK: aie.next_bd ^bb7 +// CHECK: ^bb7: +// CHECK: %[[VAL_104:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_104]]) +// CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_105:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_105]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb8: +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_106:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_107:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) +// CHECK: ^bb1: +// CHECK: %[[VAL_108:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_108]]) +// CHECK: aie.dma_bd(%[[VAL_13]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %[[VAL_109]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_110:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_110]]) +// CHECK: aie.dma_bd(%[[VAL_14]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %[[VAL_111]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_112:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_112]]) +// CHECK: aie.dma_bd(%[[VAL_15]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_113:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %[[VAL_113]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb4: +// CHECK: %[[VAL_114:.*]] = aie.dma_start(S2MM, 1, ^bb5, ^bb9) +// CHECK: ^bb5: +// CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_115]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_116:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_116]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb6: +// CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_117]]) +// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_118:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_118]]) +// CHECK: aie.next_bd ^bb7 +// CHECK: ^bb7: +// CHECK: %[[VAL_119:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_119]]) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_120:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_120]]) +// CHECK: aie.next_bd ^bb8 +// CHECK: ^bb8: +// CHECK: %[[VAL_121:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_121]]) +// CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_122:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_122]]) +// CHECK: aie.next_bd ^bb5 +// CHECK: ^bb9: +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } + +module { + aie.device(npu2) { + %tile_0_1 = aie.tile(0, 1) + %tile_0_2 = aie.tile(0, 2) + + aie.objectfifo @inOF_W(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> + aie.objectfifo @inOF_X(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> + + %core_0_2 = aie.core(%tile_0_2) { + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %c14 = arith.constant 14 : index + scf.for %arg0 = %c0 to %c14 step %c1 { + %w = aie.objectfifo.acquire @inOF_W(Consume, 2) : !aie.objectfifosubview> + scf.for %arg1 = %c0 to %c14 step %c1 { + %x = aie.objectfifo.acquire @inOF_X(Consume, 3) : !aie.objectfifosubview> + aie.objectfifo.release @inOF_X(Consume, 1) + } + aie.objectfifo.release @inOF_X(Consume, 2) + aie.objectfifo.release @inOF_W(Consume, 1) + } + aie.objectfifo.release @inOF_W(Consume, 1) + aie.end + } + } +} diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir new file mode 100644 index 00000000000..fe4cd015129 --- /dev/null +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir @@ -0,0 +1,103 @@ +//===- dynamic_runtime_lock_producer.mlir ---------------------*- MLIR -*-===// +// +// Copyright (C) 2026 Advanced Micro Devices, Inc. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Producer-side acquire/release also uses the runtime held counter. The +// producer acquires the producer lock with a value-carrying +// `AcquireGreaterEqual` (the sign of the value is applied later during the +// core-to-standard lock lowering) and releases the consumer lock. + +// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s + +// CHECK-LABEL: module { +// CHECK: aie.device(npu2) { +// CHECK: %[[VAL_0:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_1:.*]] = aie.tile(0, 3) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_3"} : memref<8xi8> +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_0]], 0) {init = 4 : i32, sym_name = "fifo_prod_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) : memref<1xi32> +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) : memref<1xi32> +// CHECK: %[[VAL_10:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_11:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_12:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_11]], %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: %[[VAL_13:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_14:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_15:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_13]], %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> +// CHECK: %[[VAL_16:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_17:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_18:.*]] = arith.constant 14 : index +// CHECK: scf.for %[[VAL_19:.*]] = %[[VAL_16]] to %[[VAL_18]] step %[[VAL_17]] { +// CHECK: %[[VAL_20:.*]] = memref.load %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: %[[VAL_21:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_23:.*]] = arith.subi %[[VAL_21]], %[[VAL_20]] : i32 +// CHECK: %[[VAL_24:.*]] = arith.maxsi %[[VAL_23]], %[[VAL_22]] : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_24]]) +// CHECK: %[[VAL_25:.*]] = arith.addi %[[VAL_20]], %[[VAL_24]] : i32 +// CHECK: memref.store %[[VAL_25]], %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: %[[VAL_26:.*]] = memref.load %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> +// CHECK: %[[VAL_27:.*]] = arith.index_cast %[[VAL_26]] : i32 to index +// CHECK: %[[VAL_28:.*]] = scf.index_switch %[[VAL_27]] -> memref<8xi8> +// CHECK: case 0 { +// CHECK: scf.yield %[[VAL_2]] : memref<8xi8> +// CHECK: } +// CHECK: case 1 { +// CHECK: scf.yield %[[VAL_3]] : memref<8xi8> +// CHECK: } +// CHECK: case 2 { +// CHECK: scf.yield %[[VAL_4]] : memref<8xi8> +// CHECK: } +// CHECK: case 3 { +// CHECK: scf.yield %[[VAL_5]] : memref<8xi8> +// CHECK: } +// CHECK: default { +// CHECK: scf.yield %[[VAL_2]] : memref<8xi8> +// CHECK: } +// CHECK: %[[VAL_29:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_29]]) +// CHECK: %[[VAL_30:.*]] = memref.load %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: %[[VAL_31:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_32:.*]] = arith.subi %[[VAL_30]], %[[VAL_31]] : i32 +// CHECK: memref.store %[[VAL_32]], %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: %[[VAL_33:.*]] = memref.load %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> +// CHECK: %[[VAL_34:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_35:.*]] = arith.addi %[[VAL_33]], %[[VAL_34]] : i32 +// CHECK: %[[VAL_36:.*]] = arith.cmpi sge, %[[VAL_35]], %[[VAL_15]] : i32 +// CHECK: %[[VAL_37:.*]] = arith.subi %[[VAL_35]], %[[VAL_15]] : i32 +// CHECK: %[[VAL_38:.*]] = arith.select %[[VAL_36]], %[[VAL_37]], %[[VAL_35]] : i32 +// CHECK: memref.store %[[VAL_38]], %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } + +module { + aie.device(npu2) { + %tile_0_2 = aie.tile(0, 2) + %tile_0_3 = aie.tile(0, 3) + + aie.objectfifo @fifo(%tile_0_2, {%tile_0_3}, 4 : i32) : !aie.objectfifo> + + %core_0_2 = aie.core(%tile_0_2) { + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %c14 = arith.constant 14 : index + scf.for %arg0 = %c0 to %c14 step %c1 { + %a = aie.objectfifo.acquire @fifo(Produce, 1) : !aie.objectfifosubview> + %e = aie.objectfifo.subview.access %a[0] : !aie.objectfifosubview> -> memref<8xi8> + aie.objectfifo.release @fifo(Produce, 1) + } + aie.end + } + } +} diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir new file mode 100644 index 00000000000..14d109043e6 --- /dev/null +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir @@ -0,0 +1,179 @@ +//===- dynamic_runtime_lock_scf_while.mlir --------------------*- MLIR -*-===// +// +// Copyright (C) 2026 Advanced Micro Devices, Inc. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Acquire/release inside an scf.while body. The runtime held-counter approach +// needs no loop peeling or trip-count reasoning: the counter lives across +// iterations, so the while body lowers directly with a value-carrying +// `AcquireGreaterEqual`. A post-loop release decrements the counter. + +// RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s + +// CHECK-LABEL: module { +// CHECK: aie.device(npu2) { +// CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) +// CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_3"} : memref<8xi8> +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_1]], 0) {init = 4 : i32, sym_name = "fifo_cons_prod_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "fifo_cons_cons_lock_0"} +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_0"} : memref<8xi8> +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_1"} : memref<8xi8> +// CHECK: %[[VAL_10:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_2"} : memref<8xi8> +// CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_0]], 0) {init = 3 : i32, sym_name = "fifo_prod_lock_0"} +// CHECK: %[[VAL_12:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} +// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "buf"} : memref<1xindex> +// CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) +// CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> +// CHECK: %[[VAL_15:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> +// CHECK: %[[VAL_16:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_17:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_18:.*]] = arith.constant 0 : index +// CHECK: memref.store %[[VAL_17]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_19:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_20:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_21:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_19]], %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_23:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_24:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_25:.*]] = scf.while (%[[VAL_26:.*]] = %[[VAL_22]]) : (index) -> index { +// CHECK: %[[VAL_27:.*]] = arith.cmpi slt, %[[VAL_26]], %[[VAL_24]] : index +// CHECK: scf.condition(%[[VAL_27]]) %[[VAL_26]] : index +// CHECK: } do { +// CHECK: ^bb0(%[[VAL_28:.*]]: index): +// CHECK: %[[VAL_29:.*]] = memref.load %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_30:.*]] = arith.constant 3 : i32 +// CHECK: %[[VAL_31:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_32:.*]] = arith.subi %[[VAL_30]], %[[VAL_29]] : i32 +// CHECK: %[[VAL_33:.*]] = arith.maxsi %[[VAL_32]], %[[VAL_31]] : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_33]]) +// CHECK: %[[VAL_34:.*]] = arith.addi %[[VAL_29]], %[[VAL_33]] : i32 +// CHECK: memref.store %[[VAL_34]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_35:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_35]]) +// CHECK: %[[VAL_36:.*]] = memref.load %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_38:.*]] = arith.subi %[[VAL_36]], %[[VAL_37]] : i32 +// CHECK: memref.store %[[VAL_38]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_39:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> +// CHECK: %[[VAL_40:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_41:.*]] = arith.addi %[[VAL_39]], %[[VAL_40]] : i32 +// CHECK: %[[VAL_42:.*]] = arith.cmpi sge, %[[VAL_41]], %[[VAL_21]] : i32 +// CHECK: %[[VAL_43:.*]] = arith.subi %[[VAL_41]], %[[VAL_21]] : i32 +// CHECK: %[[VAL_44:.*]] = arith.select %[[VAL_42]], %[[VAL_43]], %[[VAL_41]] : i32 +// CHECK: memref.store %[[VAL_44]], %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> +// CHECK: %[[VAL_45:.*]] = arith.addi %[[VAL_28]], %[[VAL_23]] : index +// CHECK: scf.yield %[[VAL_45]] : index +// CHECK: } +// CHECK: memref.store %[[VAL_25]], %[[VAL_13]]{{\[}}%[[VAL_22]]] : memref<1xindex> +// CHECK: %[[VAL_46:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_46]]) +// CHECK: %[[VAL_47:.*]] = memref.load %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_48:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_49:.*]] = arith.subi %[[VAL_47]], %[[VAL_48]] : i32 +// CHECK: memref.store %[[VAL_49]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> +// CHECK: %[[VAL_51:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_52:.*]] = arith.addi %[[VAL_50]], %[[VAL_51]] : i32 +// CHECK: %[[VAL_53:.*]] = arith.cmpi sge, %[[VAL_52]], %[[VAL_21]] : i32 +// CHECK: %[[VAL_54:.*]] = arith.subi %[[VAL_52]], %[[VAL_21]] : i32 +// CHECK: %[[VAL_55:.*]] = arith.select %[[VAL_53]], %[[VAL_54]], %[[VAL_52]] : i32 +// CHECK: memref.store %[[VAL_55]], %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_56:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_57:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: ^bb1: +// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_58]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_59]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_60:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_60]]) +// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_61]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_62]]) +// CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_63:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_63]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb4: +// CHECK: aie.end +// CHECK: } +// CHECK: %[[VAL_64:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_65:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) +// CHECK: ^bb1: +// CHECK: %[[VAL_66:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_66]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_67:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_67]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: +// CHECK: %[[VAL_68:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_68]]) +// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_69:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_69]]) +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: +// CHECK: %[[VAL_70:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_70]]) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_71:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_71]]) +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: +// CHECK: %[[VAL_72:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_72]]) +// CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_73:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_73]]) +// CHECK: aie.next_bd ^bb1 +// CHECK: ^bb5: +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } + +module { + aie.device(npu2) { + %tile_0_1 = aie.tile(0, 1) + %tile_0_2 = aie.tile(0, 2) + %buf = aie.buffer(%tile_0_2) {sym_name = "buf"} : memref<1xindex> + + aie.objectfifo @fifo(%tile_0_1, {%tile_0_2}, 3 : i32) : !aie.objectfifo> + + %core_0_2 = aie.core(%tile_0_2) { + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %c14 = arith.constant 14 : index + %r = scf.while (%arg0 = %c0) : (index) -> index { + %cond = arith.cmpi slt, %arg0, %c14 : index + scf.condition(%cond) %arg0 : index + } do { + ^bb0(%arg1: index): + %x = aie.objectfifo.acquire @fifo(Consume, 3) : !aie.objectfifosubview> + aie.objectfifo.release @fifo(Consume, 1) + %next = arith.addi %arg1, %c1 : index + scf.yield %next : index + } + memref.store %r, %buf[%c0] : memref<1xindex> + aie.objectfifo.release @fifo(Consume, 2) + aie.end + } + } +} diff --git a/test/objectFifo-stateful-transform/init_values/init_values_distribute_input_test.mlir b/test/objectFifo-stateful-transform/init_values/init_values_distribute_input_test.mlir index c47dd68b1b6..c67a5b5f6d7 100644 --- a/test/objectFifo-stateful-transform/init_values/init_values_distribute_input_test.mlir +++ b/test/objectFifo-stateful-transform/init_values/init_values_distribute_input_test.mlir @@ -37,14 +37,18 @@ // CHECK: %mem_1_3 = aie.mem(%{{.*}}tile_1_3) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_14]] : memref<4xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_15]] : memref<4xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -52,48 +56,64 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb6, ^bb8) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb7 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb8: // pred: ^bb5 // CHECK: %2 = aie.dma_start(MM2S, 1, ^bb9, ^bb11) // CHECK: ^bb9: // 2 preds: ^bb8, ^bb10 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: // pred: ^bb9 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb11: // pred: ^bb8 // CHECK: aie.end @@ -101,14 +121,18 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -116,14 +140,18 @@ // CHECK: %mem_2_3 = aie.mem(%{{.*}}tile_2_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/init_values/init_values_join_input_test.mlir b/test/objectFifo-stateful-transform/init_values/init_values_join_input_test.mlir index 4a49f351682..b338f6f65d4 100644 --- a/test/objectFifo-stateful-transform/init_values/init_values_join_input_test.mlir +++ b/test/objectFifo-stateful-transform/init_values/init_values_join_input_test.mlir @@ -33,14 +33,18 @@ // CHECK: %mem_1_2 = aie.mem(%[[TILE_1_2]]) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_BUFF_0]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_BUFF_1]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -48,48 +52,64 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%[[MEM_TILE]]) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<8xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<8xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<8xi32>, 4, 4) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<8xi32>, 4, 4) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: %2 = aie.dma_start(MM2S, 0, ^bb7, ^bb11) // CHECK: ^bb7: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<8xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<8xi32>, 4, 4) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb9: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<8xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<8xi32>, 4, 4) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb11: // CHECK: aie.end @@ -97,14 +117,18 @@ // CHECK: %mem_2_3 = aie.mem(%[[TILE_2_3]]) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_BUFF_0]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_BUFF_1]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/init_values/init_values_join_output_test.mlir b/test/objectFifo-stateful-transform/init_values/init_values_join_output_test.mlir index 8ecfd3ab482..4a5e83c25e3 100644 --- a/test/objectFifo-stateful-transform/init_values/init_values_join_output_test.mlir +++ b/test/objectFifo-stateful-transform/init_values/init_values_join_output_test.mlir @@ -33,14 +33,18 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_BUFF_0]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_BUFF_1]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end @@ -48,48 +52,64 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: %1 = aie.dma_start(S2MM, 1, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: %2 = aie.dma_start(MM2S, 0, ^bb7, ^bb11) // CHECK: ^bb7: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_0]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb9: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<4xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: -// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS_LOCK_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUFF_1]] : memref<4xi32>, 2, 2) -// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD_LOCK_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb11: // CHECK: aie.end @@ -97,14 +117,18 @@ // CHECK: %mem_2_3 = aie.mem(%{{.*}}tile_2_3) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_BUFF_0]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_CONS_LOCK]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_BUFF_1]] : memref<2xi32>, 0, 2) -// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_PROD_LOCK]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/init_values/init_values_repeat_test.mlir b/test/objectFifo-stateful-transform/init_values/init_values_repeat_test.mlir index ccd3e7194e4..fe6a6b7ffb4 100644 --- a/test/objectFifo-stateful-transform/init_values/init_values_repeat_test.mlir +++ b/test/objectFifo-stateful-transform/init_values/init_values_repeat_test.mlir @@ -23,34 +23,46 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb7) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb6 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: // pred: ^bb5 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb7: // pred: ^bb0 // CHECK: aie.end @@ -58,14 +70,18 @@ // CHECK: %mem_1_3 = aie.mem(%{{.*}}tile_1_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/init_values/init_values_test.mlir b/test/objectFifo-stateful-transform/init_values/init_values_test.mlir index 6a735cf7fa2..9e1d3d858a5 100644 --- a/test/objectFifo-stateful-transform/init_values/init_values_test.mlir +++ b/test/objectFifo-stateful-transform/init_values/init_values_test.mlir @@ -25,19 +25,25 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end @@ -45,19 +51,25 @@ // CHECK: %mem_2_3 = aie.mem(%{{.*}}tile_2_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<2x2xi32>, 0, 4) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/loop_unrolling/acquire_before_loop.mlir b/test/objectFifo-stateful-transform/loop_unrolling/acquire_before_loop.mlir index 9dbdaa60998..2c08bc1fc22 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/acquire_before_loop.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/acquire_before_loop.mlir @@ -10,58 +10,68 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK: module { -// CHECK: aie.device(xcvc1902) { -// CHECK: %{{.*}}tile_1_2 = aie.tile(1, 2) -// CHECK: %{{.*}}tile_1_3 = aie.tile(1, 3) -// CHECK: %[[VAL_0:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_0"} : memref<16xi32> -// CHECK: %[[VAL_1:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_1"} : memref<16xi32> -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_2"} : memref<16xi32> -// CHECK: %[[VAL_3:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_3"} : memref<16xi32> -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_1_2, 0) {init = 0 : i32, sym_name = "loop_of_lock_0"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_1_2, 1) {init = 0 : i32, sym_name = "loop_of_lock_1"} -// CHECK: %[[VAL_6:.*]] = aie.lock(%{{.*}}tile_1_2, 2) {init = 0 : i32, sym_name = "loop_of_lock_2"} -// CHECK: %[[VAL_7:.*]] = aie.lock(%{{.*}}tile_1_2, 3) {init = 0 : i32, sym_name = "loop_of_lock_3"} -// CHECK: func.func @some_work(%arg0: memref<16xi32>, %arg1: index) { -// CHECK: return -// CHECK: } -// CHECK: %core_1_2 = aie.core(%{{.*}}tile_1_2) { -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c2 = arith.constant 2 : index -// CHECK: %c4 = arith.constant 4 : index -// CHECK: %c9 = arith.constant 9 : index -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_0]], %c0) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: %c4_0 = arith.constant 4 : index -// CHECK: scf.for %arg0 = %c1 to %c9 step %c4_0 { -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_1]], %arg0) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %c1_1 = arith.constant 1 : index -// CHECK: %0 = arith.muli %c1, %c1_1 : index -// CHECK: %1 = arith.addi %arg0, %0 : index -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_2]], %1) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: %c2_2 = arith.constant 2 : index -// CHECK: %2 = arith.muli %c1, %c2_2 : index -// CHECK: %3 = arith.addi %arg0, %2 : index -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_3]], %3) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) -// CHECK: %c3 = arith.constant 3 : index -// CHECK: %4 = arith.muli %c1, %c3 : index -// CHECK: %5 = arith.addi %arg0, %4 : index -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_0]], %5) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: } -// CHECK: aie.end -// CHECK: } -// CHECK: } -// CHECK: } +// CHECK-LABEL: module { +// CHECK: aie.device(xcvc1902) { +// CHECK: %[[VAL_0:.*]] = aie.tile(1, 2) +// CHECK: %[[VAL_1:.*]] = aie.tile(1, 3) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_0"} : memref<16xi32> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_1"} : memref<16xi32> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_2"} : memref<16xi32> +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_3"} : memref<16xi32> +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32, sym_name = "loop_of_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "loop_of_lock_1"} +// CHECK: %[[VAL_8:.*]] = aie.lock(%[[VAL_0]], 2) {init = 0 : i32, sym_name = "loop_of_lock_2"} +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_0]], 3) {init = 0 : i32, sym_name = "loop_of_lock_3"} +// CHECK: func.func @some_work(%[[VAL_10:.*]]: memref<16xi32>, %[[VAL_11:.*]]: index) { +// CHECK: return +// CHECK: } +// CHECK: %[[VAL_12:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_13:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_14:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_15:.*]] = arith.constant 2 : index +// CHECK: %[[VAL_16:.*]] = arith.constant 4 : index +// CHECK: %[[VAL_17:.*]] = arith.constant 9 : index +// CHECK: %[[VAL_18:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %[[VAL_18]]) +// CHECK: func.call @some_work(%[[VAL_2]], %[[VAL_13]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_19:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_19]]) +// CHECK: %[[VAL_20:.*]] = arith.constant 4 : index +// CHECK: scf.for %[[VAL_21:.*]] = %[[VAL_14]] to %[[VAL_17]] step %[[VAL_20]] { +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %[[VAL_22]]) +// CHECK: func.call @some_work(%[[VAL_3]], %[[VAL_21]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_23:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_23]]) +// CHECK: %[[VAL_24:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_25:.*]] = arith.muli %[[VAL_14]], %[[VAL_24]] : index +// CHECK: %[[VAL_26:.*]] = arith.addi %[[VAL_21]], %[[VAL_25]] : index +// CHECK: %[[VAL_27:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %[[VAL_27]]) +// CHECK: func.call @some_work(%[[VAL_4]], %[[VAL_26]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_28:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %[[VAL_28]]) +// CHECK: %[[VAL_29:.*]] = arith.constant 2 : index +// CHECK: %[[VAL_30:.*]] = arith.muli %[[VAL_14]], %[[VAL_29]] : index +// CHECK: %[[VAL_31:.*]] = arith.addi %[[VAL_21]], %[[VAL_30]] : index +// CHECK: %[[VAL_32:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %[[VAL_32]]) +// CHECK: func.call @some_work(%[[VAL_5]], %[[VAL_31]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_33:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_33]]) +// CHECK: %[[VAL_34:.*]] = arith.constant 3 : index +// CHECK: %[[VAL_35:.*]] = arith.muli %[[VAL_14]], %[[VAL_34]] : index +// CHECK: %[[VAL_36:.*]] = arith.addi %[[VAL_21]], %[[VAL_35]] : index +// CHECK: %[[VAL_37:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %[[VAL_37]]) +// CHECK: func.call @some_work(%[[VAL_2]], %[[VAL_36]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_38]]) +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } module { aie.device(xcvc1902) { diff --git a/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter.mlir b/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter.mlir index 8414f71f338..8fdfc47151e 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter.mlir @@ -24,15 +24,19 @@ // CHECK: %c4 = arith.constant 4 : index // CHECK: %c2 = arith.constant 2 : index // CHECK: scf.for %arg0 = %c0 to %c4 step %c2 { -// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_0]], %arg0) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: %c1_0 = arith.constant 1 : index // CHECK: %0 = arith.muli %c1, %c1_0 : index // CHECK: %1 = arith.addi %arg0, %0 : index -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_1]], %1) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } diff --git a/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter_dynamic.mlir b/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter_dynamic.mlir index 7d390487d0c..6adac2cd698 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter_dynamic.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/fully_divisible_loop_iter_dynamic.mlir @@ -16,11 +16,13 @@ // CHECK: %[[C1:.*]] = arith.constant 1 : index // CHECK: %[[C4:.*]] = arith.constant 4 : index // CHECK: scf.for %{{.*}} = %{{.*}} to %[[C4]] step %[[C1]] { -// CHECK: aie.use_lock(%{{.*}}, Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%{{.*}}, Acquire, %{{.*}}) // Runtime buffer selection via index_switch is the hallmark of dynamic lowering. // CHECK: scf.index_switch // CHECK: func.call @some_work -// CHECK: aie.use_lock(%{{.*}}, Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%{{.*}}, Release, %{{.*}}) // CHECK: } // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/loop_unrolling/fully_unroll_loop.mlir b/test/objectFifo-stateful-transform/loop_unrolling/fully_unroll_loop.mlir index 4ecf6a1cdca..624aa2f80f6 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/fully_unroll_loop.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/fully_unroll_loop.mlir @@ -7,58 +7,77 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK-LABEL: aie.device(xcvc1902) { -// CHECK: %{{.*}}tile_1_2 = aie.tile(1, 2) -// CHECK: %{{.*}}tile_1_3 = aie.tile(1, 3) -// CHECK: %[[VAL_0:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "of_2_buff_0"} : memref<16xi32> -// CHECK: %[[VAL_1:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "of_2_buff_1"} : memref<16xi32> -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "of_2_buff_2"} : memref<16xi32> -// CHECK: %[[VAL_3:.*]] = aie.lock(%{{.*}}tile_1_2, 0) {init = 0 : i32, sym_name = "of_2_lock_0"} -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_1_2, 1) {init = 0 : i32, sym_name = "of_2_lock_1"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_1_2, 2) {init = 0 : i32, sym_name = "of_2_lock_2"} -// CHECK: %[[VAL_6:.*]] = aie.buffer(%{{.*}}tile_1_3) {sym_name = "of_1_buff_0"} : memref<16xi32> -// CHECK: %[[VAL_7:.*]] = aie.buffer(%{{.*}}tile_1_3) {sym_name = "of_1_buff_1"} : memref<16xi32> -// CHECK: %[[VAL_8:.*]] = aie.lock(%{{.*}}tile_1_3, 0) {init = 0 : i32, sym_name = "of_1_lock_0"} -// CHECK: %[[VAL_9:.*]] = aie.lock(%{{.*}}tile_1_3, 1) {init = 0 : i32, sym_name = "of_1_lock_1"} -// CHECK: func.func @some_work(%arg0: memref<16xi32>, %arg1: memref<16xi32>, %arg2: index) { -// CHECK: return -// CHECK: } -// CHECK: %core_1_2 = aie.core(%{{.*}}tile_1_2) { -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c4 = arith.constant 4 : index -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_6]], %[[VAL_0]], %c0) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) -// CHECK: %c1_1 = arith.constant 1 : index -// CHECK: %0 = arith.muli %c1, %c1_1 : index -// CHECK: %1 = arith.addi %c0, %0 : index -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_7]], %[[VAL_1]], %1) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: %c2 = arith.constant 2 : index -// CHECK: %2 = arith.muli %c1, %c2 : index -// CHECK: %3 = arith.addi %c0, %2 : index -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_6]], %[[VAL_2]], %3) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %c3 = arith.constant 3 : index -// CHECK: %4 = arith.muli %c1, %c3 : index -// CHECK: %5 = arith.addi %c0, %4 : index -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_7]], %[[VAL_0]], %5) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) -// CHECK: aie.end -// CHECK: } -// CHECK: } +// CHECK-LABEL: module { +// CHECK: aie.device(xcvc1902) { +// CHECK: %[[VAL_0:.*]] = aie.tile(1, 2) +// CHECK: %[[VAL_1:.*]] = aie.tile(1, 3) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "of_2_buff_0"} : memref<16xi32> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "of_2_buff_1"} : memref<16xi32> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "of_2_buff_2"} : memref<16xi32> +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32, sym_name = "of_2_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "of_2_lock_1"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_0]], 2) {init = 0 : i32, sym_name = "of_2_lock_2"} +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "of_1_buff_0"} : memref<16xi32> +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "of_1_buff_1"} : memref<16xi32> +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_1]], 0) {init = 0 : i32, sym_name = "of_1_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "of_1_lock_1"} +// CHECK: func.func @some_work(%[[VAL_12:.*]]: memref<16xi32>, %[[VAL_13:.*]]: memref<16xi32>, %[[VAL_14:.*]]: index) { +// CHECK: return +// CHECK: } +// CHECK: %[[VAL_15:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_16:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_17:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_18:.*]] = arith.constant 4 : index +// CHECK: %[[VAL_19:.*]] = arith.constant 4 : index +// CHECK: %[[VAL_20:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Acquire, %[[VAL_20]]) +// CHECK: %[[VAL_21:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %[[VAL_21]]) +// CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_2]], %[[VAL_16]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_22]]) +// CHECK: %[[VAL_23:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_23]]) +// CHECK: %[[VAL_24:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_25:.*]] = arith.muli %[[VAL_17]], %[[VAL_24]] : index +// CHECK: %[[VAL_26:.*]] = arith.addi %[[VAL_16]], %[[VAL_25]] : index +// CHECK: %[[VAL_27:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %[[VAL_27]]) +// CHECK: %[[VAL_28:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %[[VAL_28]]) +// CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_3]], %[[VAL_26]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_29:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_29]]) +// CHECK: %[[VAL_30:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_30]]) +// CHECK: %[[VAL_31:.*]] = arith.constant 2 : index +// CHECK: %[[VAL_32:.*]] = arith.muli %[[VAL_17]], %[[VAL_31]] : index +// CHECK: %[[VAL_33:.*]] = arith.addi %[[VAL_16]], %[[VAL_32]] : index +// CHECK: %[[VAL_34:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Acquire, %[[VAL_34]]) +// CHECK: %[[VAL_35:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %[[VAL_35]]) +// CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_4]], %[[VAL_33]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_36:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_36]]) +// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_37]]) +// CHECK: %[[VAL_38:.*]] = arith.constant 3 : index +// CHECK: %[[VAL_39:.*]] = arith.muli %[[VAL_17]], %[[VAL_38]] : index +// CHECK: %[[VAL_40:.*]] = arith.addi %[[VAL_16]], %[[VAL_39]] : index +// CHECK: %[[VAL_41:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %[[VAL_41]]) +// CHECK: %[[VAL_42:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %[[VAL_42]]) +// CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_2]], %[[VAL_40]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_43:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_43]]) +// CHECK: %[[VAL_44:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_44]]) +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } module { aie.device(xcvc1902) { diff --git a/test/objectFifo-stateful-transform/loop_unrolling/large_loop_step.mlir b/test/objectFifo-stateful-transform/loop_unrolling/large_loop_step.mlir index 8c4465dbca8..ddfcaaa4650 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/large_loop_step.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/large_loop_step.mlir @@ -7,61 +7,71 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK: module { -// CHECK: aie.device(xcvc1902) { -// CHECK: %{{.*}}tile_1_2 = aie.tile(1, 2) -// CHECK: %{{.*}}tile_1_3 = aie.tile(1, 3) -// CHECK: %[[VAL_0:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_0"} : memref<16xi32> -// CHECK: %[[VAL_1:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_1"} : memref<16xi32> -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_2"} : memref<16xi32> -// CHECK: %[[VAL_3:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "loop_of_buff_3"} : memref<16xi32> -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_1_2, 0) {init = 0 : i32, sym_name = "loop_of_lock_0"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_1_2, 1) {init = 0 : i32, sym_name = "loop_of_lock_1"} -// CHECK: %[[VAL_6:.*]] = aie.lock(%{{.*}}tile_1_2, 2) {init = 0 : i32, sym_name = "loop_of_lock_2"} -// CHECK: %[[VAL_7:.*]] = aie.lock(%{{.*}}tile_1_2, 3) {init = 0 : i32, sym_name = "loop_of_lock_3"} -// CHECK: func.func @some_work(%arg0: memref<16xi32>, %arg1: index) { -// CHECK: return -// CHECK: } -// CHECK: %core_1_2 = aie.core(%{{.*}}tile_1_2) { -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c2 = arith.constant 2 : index -// CHECK: %c4 = arith.constant 4 : index -// CHECK: %c21 = arith.constant 21 : index -// CHECK: %c17 = arith.constant 17 : index -// CHECK: %c8 = arith.constant 8 : index -// CHECK: scf.for %arg0 = %c1 to %c17 step %c8 { -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_0]], %arg0) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: %c1_0 = arith.constant 1 : index -// CHECK: %0 = arith.muli %c2, %c1_0 : index -// CHECK: %1 = arith.addi %arg0, %0 : index -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_1]], %1) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %c2_1 = arith.constant 2 : index -// CHECK: %2 = arith.muli %c2, %c2_1 : index -// CHECK: %3 = arith.addi %arg0, %2 : index -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_2]], %3) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) -// CHECK: %c3 = arith.constant 3 : index -// CHECK: %4 = arith.muli %c2, %c3 : index -// CHECK: %5 = arith.addi %arg0, %4 : index -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_3]], %5) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) -// CHECK: } -// CHECK: scf.for %arg0 = %c17 to %c21 step %c2 { -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_0]], %arg0) : (memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: } -// CHECK: aie.end -// CHECK: } -// CHECK: } -// CHECK: } +// CHECK-LABEL: module { +// CHECK: aie.device(xcvc1902) { +// CHECK: %[[VAL_0:.*]] = aie.tile(1, 2) +// CHECK: %[[VAL_1:.*]] = aie.tile(1, 3) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_0"} : memref<16xi32> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_1"} : memref<16xi32> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_2"} : memref<16xi32> +// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "loop_of_buff_3"} : memref<16xi32> +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32, sym_name = "loop_of_lock_0"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "loop_of_lock_1"} +// CHECK: %[[VAL_8:.*]] = aie.lock(%[[VAL_0]], 2) {init = 0 : i32, sym_name = "loop_of_lock_2"} +// CHECK: %[[VAL_9:.*]] = aie.lock(%[[VAL_0]], 3) {init = 0 : i32, sym_name = "loop_of_lock_3"} +// CHECK: func.func @some_work(%[[VAL_10:.*]]: memref<16xi32>, %[[VAL_11:.*]]: index) { +// CHECK: return +// CHECK: } +// CHECK: %[[VAL_12:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_13:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_14:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_15:.*]] = arith.constant 2 : index +// CHECK: %[[VAL_16:.*]] = arith.constant 4 : index +// CHECK: %[[VAL_17:.*]] = arith.constant 21 : index +// CHECK: %[[VAL_18:.*]] = arith.constant 17 : index +// CHECK: %[[VAL_19:.*]] = arith.constant 8 : index +// CHECK: scf.for %[[VAL_20:.*]] = %[[VAL_14]] to %[[VAL_18]] step %[[VAL_19]] { +// CHECK: %[[VAL_21:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %[[VAL_21]]) +// CHECK: func.call @some_work(%[[VAL_2]], %[[VAL_20]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_22:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_22]]) +// CHECK: %[[VAL_23:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_24:.*]] = arith.muli %[[VAL_15]], %[[VAL_23]] : index +// CHECK: %[[VAL_25:.*]] = arith.addi %[[VAL_20]], %[[VAL_24]] : index +// CHECK: %[[VAL_26:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %[[VAL_26]]) +// CHECK: func.call @some_work(%[[VAL_3]], %[[VAL_25]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_27:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_27]]) +// CHECK: %[[VAL_28:.*]] = arith.constant 2 : index +// CHECK: %[[VAL_29:.*]] = arith.muli %[[VAL_15]], %[[VAL_28]] : index +// CHECK: %[[VAL_30:.*]] = arith.addi %[[VAL_20]], %[[VAL_29]] : index +// CHECK: %[[VAL_31:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %[[VAL_31]]) +// CHECK: func.call @some_work(%[[VAL_4]], %[[VAL_30]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %[[VAL_32]]) +// CHECK: %[[VAL_33:.*]] = arith.constant 3 : index +// CHECK: %[[VAL_34:.*]] = arith.muli %[[VAL_15]], %[[VAL_33]] : index +// CHECK: %[[VAL_35:.*]] = arith.addi %[[VAL_20]], %[[VAL_34]] : index +// CHECK: %[[VAL_36:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %[[VAL_36]]) +// CHECK: func.call @some_work(%[[VAL_5]], %[[VAL_35]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_37]]) +// CHECK: } +// CHECK: scf.for %[[VAL_38:.*]] = %[[VAL_18]] to %[[VAL_17]] step %[[VAL_15]] { +// CHECK: %[[VAL_39:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %[[VAL_39]]) +// CHECK: func.call @some_work(%[[VAL_2]], %[[VAL_38]]) : (memref<16xi32>, index) -> () +// CHECK: %[[VAL_40:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_40]]) +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } module { aie.device(xcvc1902) { diff --git a/test/objectFifo-stateful-transform/loop_unrolling/loop_unroll_with_remainder.mlir b/test/objectFifo-stateful-transform/loop_unrolling/loop_unroll_with_remainder.mlir index 2430deca069..5f01bd68392 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/loop_unroll_with_remainder.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/loop_unroll_with_remainder.mlir @@ -32,50 +32,74 @@ // CHECK: %[[VAL_21:.*]] = arith.constant 8 : index // CHECK: %[[VAL_22:.*]] = arith.constant 4 : index // CHECK: scf.for %[[VAL_23:.*]] = %[[VAL_18]] to %[[VAL_21]] step %[[VAL_22]] { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_2]], %[[VAL_23]]) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: %[[VAL_24:.*]] = arith.constant 1 : index // CHECK: %[[VAL_25:.*]] = arith.muli %[[VAL_19]], %[[VAL_24]] : index // CHECK: %[[VAL_26:.*]] = arith.addi %[[VAL_23]], %[[VAL_25]] : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_11]], %[[VAL_3]], %[[VAL_26]]) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: %[[VAL_27:.*]] = arith.constant 2 : index // CHECK: %[[VAL_28:.*]] = arith.muli %[[VAL_19]], %[[VAL_27]] : index // CHECK: %[[VAL_29:.*]] = arith.addi %[[VAL_23]], %[[VAL_28]] : index -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_4]], %[[VAL_29]]) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: %[[VAL_30:.*]] = arith.constant 3 : index // CHECK: %[[VAL_31:.*]] = arith.muli %[[VAL_19]], %[[VAL_30]] : index // CHECK: %[[VAL_32:.*]] = arith.addi %[[VAL_23]], %[[VAL_31]] : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_11]], %[[VAL_5]], %[[VAL_32]]) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: } // CHECK: %[[VAL_33:.*]] = arith.constant 2 : index -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_2]], %[[VAL_21]]) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: %[[VAL_34:.*]] = arith.constant 1 : index // CHECK: %[[VAL_35:.*]] = arith.muli %[[VAL_19]], %[[VAL_34]] : index // CHECK: %[[VAL_36:.*]] = arith.addi %[[VAL_21]], %[[VAL_35]] : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_11]], %[[VAL_3]], %[[VAL_36]]) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: } diff --git a/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_acquire_release.mlir b/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_acquire_release.mlir index 4e87c0885ce..cceeda83d2d 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_acquire_release.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_acquire_release.mlir @@ -27,23 +27,31 @@ // CHECK: %c13 = arith.constant 13 : index // CHECK: scf.for %arg0 = %c0 to %c12 step %c1 { // CHECK: scf.for %arg1 = %c0 to %c13 step %c1 { -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: scf.for %arg2 = %c0 to %c13 step %c1 { -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]], %[[VAL_0]], %arg0, %arg1) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: } -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: } // CHECK: } // CHECK: scf.for %arg0 = %c0 to %c13 step %c1 { -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: scf.for %arg1 = %c0 to %c13 step %c1 { -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]], %[[VAL_0]], %c0, %arg0) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: } -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } diff --git a/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_inner_then_outer.mlir b/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_inner_then_outer.mlir index 21c4f06cef1..2c8d367638e 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_inner_then_outer.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_inner_then_outer.mlir @@ -25,73 +25,97 @@ // CHECK-DAG: %[[C4294967294:.*]] = arith.constant 4294967294 : index // CHECK-DAG: %[[C2_0:.*]] = arith.constant 2 : index // CHECK: scf.for %[[ARG0:.+]] = %[[C0]] to %[[C4294967294]] step %[[C2_0]] { -// CHECK: aie.use_lock(%[[LOCK_0]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[LOCK_0]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_0:.+]] = memref.reinterpret_cast %[[BUFF_0]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_0]], %[[C0]]) : (memref<4x4xi32>, index) -> () -// CHECK: aie.use_lock(%[[LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LOCK_0]], Release, %{{.*}}) // CHECK-DAG: %[[C2_4:.*]] = arith.constant 2 : index // CHECK: scf.for %[[ARG1:.+]] = %[[C1]] to %[[C21]] step %[[C2_4]] { -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Acquire, 0) +// CHECK-NEXT: %{{.*}} = arith.constant 0 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_1:.+]] = memref.reinterpret_cast %[[BUFF_1]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_1]], %[[ARG1]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, %{{.*}}) // CHECK-DAG: %[[C1_1:.*]] = arith.constant 1 : index // CHECK-DAG: %[[MUL_0:.*]] = arith.muli %[[C1]], %[[C1_1]] : index // CHECK-DAG: %[[ADD_0:.*]] = arith.addi %[[ARG1]], %[[MUL_0]] : index -// CHECK-DAG: aie.use_lock(%[[LOCK_0]], Acquire, 0) +// CHECK-DAG: %{{.*}} = arith.constant 0 : i32 +// CHECK-DAG: aie.use_lock(%[[LOCK_0]], Acquire, %{{.*}}) // CHECK: %[[REINTERPRET_2:.+]] = memref.reinterpret_cast %[[BUFF_0]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_2]], %[[ADD_0]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, %{{.*}}) // CHECK-NEXT: } -// CHECK: aie.use_lock(%[[LOCK_1]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[LOCK_1]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_3:.+]] = memref.reinterpret_cast %[[BUFF_1]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_3]], %[[C0]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, 1) -// CHECK: aie.use_lock(%[[LOCK_0]], Acquire, 0) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[LOCK_0]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_4:.+]] = memref.reinterpret_cast %[[BUFF_0]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_4]], %[[C0]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, %{{.*}}) // CHECK: %[[C2_3:.*]] = arith.constant 2 : index // CHECK: scf.for %[[ARG1:.+]] = %[[C1]] to %[[C21]] step %[[C2_3]] { -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Acquire, 0) +// CHECK-NEXT: %{{.*}} = arith.constant 0 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_5:.+]] = memref.reinterpret_cast %[[BUFF_1]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_5]], %[[ARG1]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, %{{.*}}) // CHECK-DAG: %[[C1_1:.*]] = arith.constant 1 : index // CHECK-DAG: %[[MUL_1:.*]] = arith.muli %[[C1]], %[[C1_1]] : index // CHECK-DAG: %[[ADD_1:.*]] = arith.addi %[[ARG1]], %[[MUL_1]] : index -// CHECK-DAG: aie.use_lock(%[[LOCK_0]], Acquire, 0) +// CHECK-DAG: %{{.*}} = arith.constant 0 : i32 +// CHECK-DAG: aie.use_lock(%[[LOCK_0]], Acquire, %{{.*}}) // CHECK: %[[REINTERPRET_6:.+]] = memref.reinterpret_cast %[[BUFF_0]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_6]], %[[ADD_1]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, %{{.*}}) // CHECK-NEXT: } -// CHECK: aie.use_lock(%[[LOCK_1]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[LOCK_1]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_7:.+]] = memref.reinterpret_cast %[[BUFF_1]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_7]], %[[C0]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, %{{.*}}) // CHECK-NEXT: } -// CHECK: aie.use_lock(%[[LOCK_0]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[LOCK_0]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_8:.+]] = memref.reinterpret_cast %[[BUFF_0]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_8]], %[[C0]]) : (memref<4x4xi32>, index) -> () -// CHECK: aie.use_lock(%[[LOCK_0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[LOCK_0]], Release, %{{.*}}) // CHECK: %[[C2_4:.*]] = arith.constant 2 : index // CHECK: scf.for %[[ARG0:.+]] = %[[C1]] to %[[C21]] step %[[C2_4]] { -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Acquire, 0) +// CHECK-NEXT: %{{.*}} = arith.constant 0 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_9:.+]] = memref.reinterpret_cast %[[BUFF_1]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_9]], %[[ARG0]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, %{{.*}}) // CHECK-DAG: %[[C1_4:.*]] = arith.constant 1 : index // CHECK-DAG: %[[MUL_2:.*]] = arith.muli %[[C1]], %[[C1_4]] : index // CHECK-DAG: %[[ADD_2:.*]] = arith.addi %[[ARG0]], %[[MUL_2]] : index -// CHECK-DAG: aie.use_lock(%[[LOCK_0]], Acquire, 0) +// CHECK-DAG: %{{.*}} = arith.constant 0 : i32 +// CHECK-DAG: aie.use_lock(%[[LOCK_0]], Acquire, %{{.*}}) // CHECK: %[[REINTERPRET_10:.+]] = memref.reinterpret_cast %[[BUFF_0]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_10]], %[[ADD_1]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_0]], Release, %{{.*}}) // CHECK-NEXT: } -// CHECK: aie.use_lock(%[[LOCK_1]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[LOCK_1]], Acquire, %{{.*}}) // CHECK-NEXT: %[[REINTERPRET_11:.+]] = memref.reinterpret_cast %[[BUFF_1]] to offset: [0], sizes: [4, 4], strides: [4, 1] : memref<16xi32> to memref<4x4xi32> // CHECK-NEXT: func.call @some_work(%[[REINTERPRET_11]], %[[C0]]) : (memref<4x4xi32>, index) -> () -// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, 1) +// CHECK-NEXT: %{{.*}} = arith.constant 1 : i32 +// CHECK-NEXT: aie.use_lock(%[[LOCK_1]], Release, %{{.*}}) module { aie.device(xcvc1902) { %tile12 = aie.tile(1, 2) diff --git a/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_with_remainder.mlir b/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_with_remainder.mlir index c1b18dcd5f2..43e90e94157 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_with_remainder.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/nested_loop_unroll_with_remainder.mlir @@ -32,105 +32,141 @@ // CHECK: %[[VAL_22:.*]] = arith.constant 9 : index // CHECK: %[[VAL_23:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_24:.*]] = %[[VAL_19]] to %[[VAL_22]] step %[[VAL_23]] { -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: %[[VAL_25:.*]] = arith.constant 6 : index // CHECK: %[[VAL_26:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_27:.*]] = %[[VAL_19]] to %[[VAL_25]] step %[[VAL_26]] { -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_2]], %[[VAL_24]], %[[VAL_27]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_11]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: %[[VAL_28:.*]] = arith.constant 1 : index // CHECK: %[[VAL_29:.*]] = arith.muli %[[VAL_20]], %[[VAL_28]] : index // CHECK: %[[VAL_30:.*]] = arith.addi %[[VAL_27]], %[[VAL_29]] : index -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_2]], %[[VAL_24]], %[[VAL_30]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: %[[VAL_31:.*]] = arith.constant 2 : index // CHECK: %[[VAL_32:.*]] = arith.muli %[[VAL_20]], %[[VAL_31]] : index // CHECK: %[[VAL_33:.*]] = arith.addi %[[VAL_27]], %[[VAL_32]] : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_2]], %[[VAL_24]], %[[VAL_33]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: } // CHECK: %[[VAL_34:.*]] = arith.constant 2 : index -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_2]], %[[VAL_24]], %[[VAL_25]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_11]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: %[[VAL_35:.*]] = arith.constant 1 : index // CHECK: %[[VAL_36:.*]] = arith.muli %[[VAL_20]], %[[VAL_35]] : index // CHECK: %[[VAL_37:.*]] = arith.addi %[[VAL_25]], %[[VAL_36]] : index -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_2]], %[[VAL_24]], %[[VAL_37]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: %[[VAL_38:.*]] = arith.constant 1 : index // CHECK: %[[VAL_39:.*]] = arith.muli %[[VAL_20]], %[[VAL_38]] : index // CHECK: %[[VAL_40:.*]] = arith.addi %[[VAL_24]], %[[VAL_39]] : index -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: %[[VAL_41:.*]] = arith.constant 6 : index // CHECK: %[[VAL_42:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_43:.*]] = %[[VAL_19]] to %[[VAL_41]] step %[[VAL_42]] { -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_3]], %[[VAL_40]], %[[VAL_43]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: %[[VAL_44:.*]] = arith.constant 1 : index // CHECK: %[[VAL_45:.*]] = arith.muli %[[VAL_20]], %[[VAL_44]] : index // CHECK: %[[VAL_46:.*]] = arith.addi %[[VAL_43]], %[[VAL_45]] : index -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_3]], %[[VAL_40]], %[[VAL_46]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_11]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: %[[VAL_47:.*]] = arith.constant 2 : index // CHECK: %[[VAL_48:.*]] = arith.muli %[[VAL_20]], %[[VAL_47]] : index // CHECK: %[[VAL_49:.*]] = arith.addi %[[VAL_43]], %[[VAL_48]] : index -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_3]], %[[VAL_40]], %[[VAL_49]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: } // CHECK: %[[VAL_50:.*]] = arith.constant 2 : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_3]], %[[VAL_40]], %[[VAL_41]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: %[[VAL_51:.*]] = arith.constant 1 : index // CHECK: %[[VAL_52:.*]] = arith.muli %[[VAL_20]], %[[VAL_51]] : index // CHECK: %[[VAL_53:.*]] = arith.addi %[[VAL_41]], %[[VAL_52]] : index -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_3]], %[[VAL_40]], %[[VAL_53]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_11]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: %[[VAL_54:.*]] = arith.constant 2 : index // CHECK: %[[VAL_55:.*]] = arith.muli %[[VAL_20]], %[[VAL_54]] : index // CHECK: %[[VAL_56:.*]] = arith.addi %[[VAL_24]], %[[VAL_55]] : index -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: %[[VAL_57:.*]] = arith.constant 6 : index // CHECK: %[[VAL_58:.*]] = arith.constant 3 : index // CHECK: scf.for %[[VAL_59:.*]] = %[[VAL_19]] to %[[VAL_57]] step %[[VAL_58]] { -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_4]], %[[VAL_56]], %[[VAL_59]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: %[[VAL_60:.*]] = arith.constant 1 : index // CHECK: %[[VAL_61:.*]] = arith.muli %[[VAL_20]], %[[VAL_60]] : index // CHECK: %[[VAL_62:.*]] = arith.addi %[[VAL_59]], %[[VAL_61]] : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_4]], %[[VAL_56]], %[[VAL_62]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: %[[VAL_63:.*]] = arith.constant 2 : index // CHECK: %[[VAL_64:.*]] = arith.muli %[[VAL_20]], %[[VAL_63]] : index // CHECK: %[[VAL_65:.*]] = arith.addi %[[VAL_59]], %[[VAL_64]] : index -// CHECK: aie.use_lock(%[[VAL_11]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_4]], %[[VAL_56]], %[[VAL_65]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_11]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: } // CHECK: %[[VAL_66:.*]] = arith.constant 2 : index -// CHECK: aie.use_lock(%[[VAL_12]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_4]], %[[VAL_56]], %[[VAL_57]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_12]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: %[[VAL_67:.*]] = arith.constant 1 : index // CHECK: %[[VAL_68:.*]] = arith.muli %[[VAL_20]], %[[VAL_67]] : index // CHECK: %[[VAL_69:.*]] = arith.addi %[[VAL_57]], %[[VAL_68]] : index -// CHECK: aie.use_lock(%[[VAL_13]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_10]], %[[VAL_4]], %[[VAL_56]], %[[VAL_69]]) : (memref<16xi32>, memref<16xi32>, index, index) -> () -// CHECK: aie.use_lock(%[[VAL_13]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } diff --git a/test/objectFifo-stateful-transform/loop_unrolling/unroll_factor_multiple_objectfifos.mlir b/test/objectFifo-stateful-transform/loop_unrolling/unroll_factor_multiple_objectfifos.mlir index eb15fb4657f..37a06f4197f 100644 --- a/test/objectFifo-stateful-transform/loop_unrolling/unroll_factor_multiple_objectfifos.mlir +++ b/test/objectFifo-stateful-transform/loop_unrolling/unroll_factor_multiple_objectfifos.mlir @@ -7,79 +7,103 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK: module { -// CHECK: aie.device(xcvc1902) { -// CHECK: %{{.*}}tile_1_2 = aie.tile(1, 2) -// CHECK: %{{.*}}tile_1_3 = aie.tile(1, 3) -// CHECK: %[[VAL_0:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "of_2_buff_0"} : memref<16xi32> -// CHECK: %[[VAL_1:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "of_2_buff_1"} : memref<16xi32> -// CHECK: %[[VAL_2:.*]] = aie.buffer(%{{.*}}tile_1_2) {sym_name = "of_2_buff_2"} : memref<16xi32> -// CHECK: %[[VAL_3:.*]] = aie.lock(%{{.*}}tile_1_2, 0) {init = 0 : i32, sym_name = "of_2_lock_0"} -// CHECK: %[[VAL_4:.*]] = aie.lock(%{{.*}}tile_1_2, 1) {init = 0 : i32, sym_name = "of_2_lock_1"} -// CHECK: %[[VAL_5:.*]] = aie.lock(%{{.*}}tile_1_2, 2) {init = 0 : i32, sym_name = "of_2_lock_2"} -// CHECK: %[[VAL_6:.*]] = aie.buffer(%{{.*}}tile_1_3) {sym_name = "of_1_buff_0"} : memref<16xi32> -// CHECK: %[[VAL_7:.*]] = aie.buffer(%{{.*}}tile_1_3) {sym_name = "of_1_buff_1"} : memref<16xi32> -// CHECK: %[[VAL_8:.*]] = aie.lock(%{{.*}}tile_1_3, 0) {init = 0 : i32, sym_name = "of_1_lock_0"} -// CHECK: %[[VAL_9:.*]] = aie.lock(%{{.*}}tile_1_3, 1) {init = 0 : i32, sym_name = "of_1_lock_1"} -// CHECK: func.func @some_work(%arg0: memref<16xi32>, %arg1: memref<16xi32>, %arg2: index) { -// CHECK: return -// CHECK: } -// CHECK: %core_1_2 = aie.core(%{{.*}}tile_1_2) { -// CHECK: %c0 = arith.constant 0 : index -// CHECK: %c1 = arith.constant 1 : index -// CHECK: %c12 = arith.constant 12 : index -// CHECK: %c6 = arith.constant 6 : index -// CHECK: scf.for %arg0 = %c0 to %c12 step %c6 { -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_6]], %[[VAL_0]], %arg0) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) -// CHECK: %c1_0 = arith.constant 1 : index -// CHECK: %0 = arith.muli %c1, %c1_0 : index -// CHECK: %1 = arith.addi %arg0, %0 : index -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_7]], %[[VAL_1]], %1) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: %c2 = arith.constant 2 : index -// CHECK: %2 = arith.muli %c1, %c2 : index -// CHECK: %3 = arith.addi %arg0, %2 : index -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_6]], %[[VAL_2]], %3) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: %c3 = arith.constant 3 : index -// CHECK: %4 = arith.muli %c1, %c3 : index -// CHECK: %5 = arith.addi %arg0, %4 : index -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_7]], %[[VAL_0]], %5) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) -// CHECK: %c4 = arith.constant 4 : index -// CHECK: %6 = arith.muli %c1, %c4 : index -// CHECK: %7 = arith.addi %arg0, %6 : index -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_6]], %[[VAL_1]], %7) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) -// CHECK: %c5 = arith.constant 5 : index -// CHECK: %8 = arith.muli %c1, %c5 : index -// CHECK: %9 = arith.addi %arg0, %8 : index -// CHECK: aie.use_lock(%[[VAL_9]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) -// CHECK: func.call @some_work(%[[VAL_7]], %[[VAL_2]], %9) : (memref<16xi32>, memref<16xi32>, index) -> () -// CHECK: aie.use_lock(%[[VAL_9]], Release, 0) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) -// CHECK: } -// CHECK: aie.end -// CHECK: } -// CHECK: } -// CHECK: } +// CHECK-LABEL: module { +// CHECK: aie.device(xcvc1902) { +// CHECK: %[[VAL_0:.*]] = aie.tile(1, 2) +// CHECK: %[[VAL_1:.*]] = aie.tile(1, 3) +// CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "of_2_buff_0"} : memref<16xi32> +// CHECK: %[[VAL_3:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "of_2_buff_1"} : memref<16xi32> +// CHECK: %[[VAL_4:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "of_2_buff_2"} : memref<16xi32> +// CHECK: %[[VAL_5:.*]] = aie.lock(%[[VAL_0]], 0) {init = 0 : i32, sym_name = "of_2_lock_0"} +// CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "of_2_lock_1"} +// CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_0]], 2) {init = 0 : i32, sym_name = "of_2_lock_2"} +// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "of_1_buff_0"} : memref<16xi32> +// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "of_1_buff_1"} : memref<16xi32> +// CHECK: %[[VAL_10:.*]] = aie.lock(%[[VAL_1]], 0) {init = 0 : i32, sym_name = "of_1_lock_0"} +// CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "of_1_lock_1"} +// CHECK: func.func @some_work(%[[VAL_12:.*]]: memref<16xi32>, %[[VAL_13:.*]]: memref<16xi32>, %[[VAL_14:.*]]: index) { +// CHECK: return +// CHECK: } +// CHECK: %[[VAL_15:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_16:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_17:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_18:.*]] = arith.constant 12 : index +// CHECK: %[[VAL_19:.*]] = arith.constant 6 : index +// CHECK: scf.for %[[VAL_20:.*]] = %[[VAL_16]] to %[[VAL_18]] step %[[VAL_19]] { +// CHECK: %[[VAL_21:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Acquire, %[[VAL_21]]) +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %[[VAL_22]]) +// CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_2]], %[[VAL_20]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_23:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_23]]) +// CHECK: %[[VAL_24:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_24]]) +// CHECK: %[[VAL_25:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_26:.*]] = arith.muli %[[VAL_17]], %[[VAL_25]] : index +// CHECK: %[[VAL_27:.*]] = arith.addi %[[VAL_20]], %[[VAL_26]] : index +// CHECK: %[[VAL_28:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %[[VAL_28]]) +// CHECK: %[[VAL_29:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %[[VAL_29]]) +// CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_3]], %[[VAL_27]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_30:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_30]]) +// CHECK: %[[VAL_31:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_31]]) +// CHECK: %[[VAL_32:.*]] = arith.constant 2 : index +// CHECK: %[[VAL_33:.*]] = arith.muli %[[VAL_17]], %[[VAL_32]] : index +// CHECK: %[[VAL_34:.*]] = arith.addi %[[VAL_20]], %[[VAL_33]] : index +// CHECK: %[[VAL_35:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Acquire, %[[VAL_35]]) +// CHECK: %[[VAL_36:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %[[VAL_36]]) +// CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_4]], %[[VAL_34]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_37:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_37]]) +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_38]]) +// CHECK: %[[VAL_39:.*]] = arith.constant 3 : index +// CHECK: %[[VAL_40:.*]] = arith.muli %[[VAL_17]], %[[VAL_39]] : index +// CHECK: %[[VAL_41:.*]] = arith.addi %[[VAL_20]], %[[VAL_40]] : index +// CHECK: %[[VAL_42:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %[[VAL_42]]) +// CHECK: %[[VAL_43:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %[[VAL_43]]) +// CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_2]], %[[VAL_41]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_44:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_44]]) +// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_45]]) +// CHECK: %[[VAL_46:.*]] = arith.constant 4 : index +// CHECK: %[[VAL_47:.*]] = arith.muli %[[VAL_17]], %[[VAL_46]] : index +// CHECK: %[[VAL_48:.*]] = arith.addi %[[VAL_20]], %[[VAL_47]] : index +// CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Acquire, %[[VAL_49]]) +// CHECK: %[[VAL_50:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %[[VAL_50]]) +// CHECK: func.call @some_work(%[[VAL_8]], %[[VAL_3]], %[[VAL_48]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_51:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_51]]) +// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_52]]) +// CHECK: %[[VAL_53:.*]] = arith.constant 5 : index +// CHECK: %[[VAL_54:.*]] = arith.muli %[[VAL_17]], %[[VAL_53]] : index +// CHECK: %[[VAL_55:.*]] = arith.addi %[[VAL_20]], %[[VAL_54]] : index +// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Acquire, %[[VAL_56]]) +// CHECK: %[[VAL_57:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %[[VAL_57]]) +// CHECK: func.call @some_work(%[[VAL_9]], %[[VAL_4]], %[[VAL_55]]) : (memref<16xi32>, memref<16xi32>, index) -> () +// CHECK: %[[VAL_58:.*]] = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_58]]) +// CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_59]]) +// CHECK: } +// CHECK: aie.end +// CHECK: } +// CHECK: } +// CHECK: } module { aie.device(xcvc1902) { diff --git a/test/objectFifo-stateful-transform/matmul_test.mlir b/test/objectFifo-stateful-transform/matmul_test.mlir index 70618c824fa..18097582803 100644 --- a/test/objectFifo-stateful-transform/matmul_test.mlir +++ b/test/objectFifo-stateful-transform/matmul_test.mlir @@ -40,38 +40,58 @@ // CHECK: scf.for %[[VAL_29:.*]] = %[[VAL_25]] to %[[VAL_28]] step %[[VAL_26]] { // CHECK: %[[VAL_30:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_31:.*]] = %[[VAL_25]] to %[[VAL_27]] step %[[VAL_30]] { -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @zero_scalar_i16(%[[VAL_4]]) : (memref<16x16xi16>) -> () // CHECK: %[[VAL_32:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_33:.*]] = %[[VAL_25]] to %[[VAL_27]] step %[[VAL_32]] { -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @matmul_scalar_i16_i16(%[[VAL_14]], %[[VAL_8]], %[[VAL_4]]) : (memref<16x8xi16>, memref<8x16xi16>, memref<16x16xi16>) -> () -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @matmul_scalar_i16_i16(%[[VAL_15]], %[[VAL_9]], %[[VAL_4]]) : (memref<16x8xi16>, memref<8x16xi16>, memref<16x16xi16>) -> () -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: } -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @zero_scalar_i16(%[[VAL_5]]) : (memref<16x16xi16>) -> () // CHECK: %[[VAL_34:.*]] = arith.constant 2 : index // CHECK: scf.for %[[VAL_35:.*]] = %[[VAL_25]] to %[[VAL_27]] step %[[VAL_34]] { -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @matmul_scalar_i16_i16(%[[VAL_14]], %[[VAL_8]], %[[VAL_5]]) : (memref<16x8xi16>, memref<8x16xi16>, memref<16x16xi16>) -> () -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @matmul_scalar_i16_i16(%[[VAL_15]], %[[VAL_9]], %[[VAL_5]]) : (memref<16x8xi16>, memref<8x16xi16>, memref<16x16xi16>) -> () -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: } -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: } // CHECK: } // CHECK: aie.end @@ -80,38 +100,50 @@ // CHECK: %[[VAL_36:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_37:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_14]] : memref<16x8xi16>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_15]] : memref<16x8xi16>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_17]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %[[VAL_38:.*]] = aie.dma_start(S2MM, 1, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<8x16xi16>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<8x16xi16>, 0, 128) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: %[[VAL_39:.*]] = aie.dma_start(MM2S, 0, ^bb7, ^bb9) // CHECK: ^bb7: // 2 preds: ^bb6, ^bb8 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16x16xi16>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: // pred: ^bb7 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16x16xi16>, 0, 256) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb9: // pred: ^bb6 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/packet_switched_flows/packet_id_test.mlir b/test/objectFifo-stateful-transform/packet_switched_flows/packet_id_test.mlir index 50751a79bf4..8ceaeeea6c0 100644 --- a/test/objectFifo-stateful-transform/packet_switched_flows/packet_id_test.mlir +++ b/test/objectFifo-stateful-transform/packet_switched_flows/packet_id_test.mlir @@ -32,16 +32,20 @@ // CHECK: %[[VAL_13:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd_packet(0, 2) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd_packet(0, 2) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -49,14 +53,18 @@ // CHECK: %[[VAL_14:.*]] = aie.mem(%[[VAL_4]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/packet_switched_flows/pass_flag_test.mlir b/test/objectFifo-stateful-transform/packet_switched_flows/pass_flag_test.mlir index f84de88e5ef..77397522054 100644 --- a/test/objectFifo-stateful-transform/packet_switched_flows/pass_flag_test.mlir +++ b/test/objectFifo-stateful-transform/packet_switched_flows/pass_flag_test.mlir @@ -26,16 +26,20 @@ // CHECK: %[[VAL_11:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd_packet(0, 0) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd_packet(0, 0) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_9]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -43,14 +47,18 @@ // CHECK: %[[VAL_12:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/packet_switched_flows/shim_dma_alloc_test.mlir b/test/objectFifo-stateful-transform/packet_switched_flows/shim_dma_alloc_test.mlir index 9868f341189..4ee3d35d185 100644 --- a/test/objectFifo-stateful-transform/packet_switched_flows/shim_dma_alloc_test.mlir +++ b/test/objectFifo-stateful-transform/packet_switched_flows/shim_dma_alloc_test.mlir @@ -23,14 +23,18 @@ // CHECK: %[[VAL_12:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/register_external_buffers/no_register_external_buffers_test.mlir b/test/objectFifo-stateful-transform/register_external_buffers/no_register_external_buffers_test.mlir index 7f3be7bd2b3..fdab79e6448 100644 --- a/test/objectFifo-stateful-transform/register_external_buffers/no_register_external_buffers_test.mlir +++ b/test/objectFifo-stateful-transform/register_external_buffers/no_register_external_buffers_test.mlir @@ -21,19 +21,25 @@ // CHECK: %mem_7_2 = aie.mem(%{{.*}}tile_7_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_depth_test.mlir b/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_depth_test.mlir index 9765345957a..30bcddeabd4 100644 --- a/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_depth_test.mlir +++ b/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_depth_test.mlir @@ -20,14 +20,18 @@ // CHECK: %shim_dma_7_0 = aie.shim_dma(%{{.*}}tile_7_0) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%ext_buffer_in0 : memref<64xi32>, 0, 64) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%ext_buffer_in1 : memref<64xi32>, 0, 64) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -36,9 +40,11 @@ // CHECK: %mem_7_1 = aie.mem(%{{.*}}tile_7_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_1]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_test.mlir b/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_test.mlir index 70c45940bf8..8e14082782b 100644 --- a/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_test.mlir +++ b/test/objectFifo-stateful-transform/register_external_buffers/register_external_buffers_test.mlir @@ -29,18 +29,23 @@ // CHECK: %[[VAL_13:.*]] = arith.constant 0 : index // CHECK: %[[VAL_14:.*]] = arith.constant 1 : index // CHECK: %[[VAL_15:.*]] = arith.constant 12 : index -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 1) -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_2]], %[[VAL_3]]) : (memref<16xi32>, memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.end // CHECK: } // CHECK: %[[VAL_16:.*]] = aie.shim_dma(%[[VAL_1]]) { // CHECK: %[[VAL_17:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_8]], Acquire, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<64xi32>, 0, 64) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -49,19 +54,25 @@ // CHECK: %[[VAL_18:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_19:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb3 -// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_7]], Acquire, 0) +// CHECK: %{{.*}} = arith.constant 0 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Acquire, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/register_external_buffers/shim_AIE2_test.mlir b/test/objectFifo-stateful-transform/register_external_buffers/shim_AIE2_test.mlir index dad8a043543..96e4bb538a3 100644 --- a/test/objectFifo-stateful-transform/register_external_buffers/shim_AIE2_test.mlir +++ b/test/objectFifo-stateful-transform/register_external_buffers/shim_AIE2_test.mlir @@ -31,16 +31,20 @@ // CHECK: %[[VAL_16:.*]] = aie.shim_dma(%[[VAL_1]]) { // CHECK: %[[VAL_17:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_14]] : memref<64xi32>, 0, 64) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: %[[VAL_18:.*]] = aie.dma_start(S2MM, 0, ^bb3, ^bb4) // CHECK: ^bb3: // 2 preds: ^bb2, ^bb3 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_15]] : memref<64xi32>, 0, 64) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb4: // pred: ^bb2 // CHECK: aie.end @@ -49,26 +53,34 @@ // CHECK: %[[VAL_19:.*]] = aie.mem(%[[VAL_0]]) { // CHECK: %[[VAL_20:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: %[[VAL_21:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: // 2 preds: ^bb3, ^bb5 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: // pred: ^bb4 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_6]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // pred: ^bb3 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/register_external_buffers/shim_broadcast_test.mlir b/test/objectFifo-stateful-transform/register_external_buffers/shim_broadcast_test.mlir index e4c67bfcbab..9cd440809ac 100644 --- a/test/objectFifo-stateful-transform/register_external_buffers/shim_broadcast_test.mlir +++ b/test/objectFifo-stateful-transform/register_external_buffers/shim_broadcast_test.mlir @@ -35,9 +35,11 @@ // CHECK: %[[VAL_19:.*]] = aie.shim_dma(%[[VAL_0]]) { // CHECK: %[[VAL_20:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_18]] : memref<64xi32>, 0, 64) -// CHECK: aie.use_lock(%[[VAL_16]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -46,14 +48,18 @@ // CHECK: %[[VAL_21:.*]] = aie.mem(%[[VAL_1]]) { // CHECK: %[[VAL_22:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -61,14 +67,18 @@ // CHECK: %[[VAL_23:.*]] = aie.mem(%[[VAL_2]]) { // CHECK: %[[VAL_24:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -76,14 +86,18 @@ // CHECK: %[[VAL_25:.*]] = aie.mem(%[[VAL_3]]) { // CHECK: %[[VAL_26:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_15]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/repeat_count/link_distribute_repeat_count_test.mlir b/test/objectFifo-stateful-transform/repeat_count/link_distribute_repeat_count_test.mlir index 24d58f9c47c..976c84a1bb3 100644 --- a/test/objectFifo-stateful-transform/repeat_count/link_distribute_repeat_count_test.mlir +++ b/test/objectFifo-stateful-transform/repeat_count/link_distribute_repeat_count_test.mlir @@ -34,88 +34,120 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb4 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: // pred: ^bb2 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_11]], Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: // pred: ^bb3 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_13]], Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb6, ^bb12) // CHECK: ^bb6: // 2 preds: ^bb5, ^bb11 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: // pred: ^bb6 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: // pred: ^bb7 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb9 // CHECK: ^bb9: // pred: ^bb8 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb10 // CHECK: ^bb10: // pred: ^bb9 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb11 // CHECK: ^bb11: // pred: ^bb10 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb12: // pred: ^bb5 // CHECK: %2 = aie.dma_start(MM2S, 1, ^bb13, ^bb19) // CHECK: ^bb13: // 2 preds: ^bb12, ^bb18 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb14 // CHECK: ^bb14: // pred: ^bb13 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb15 // CHECK: ^bb15: // pred: ^bb14 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb16 // CHECK: ^bb16: // pred: ^bb15 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb17 // CHECK: ^bb17: // pred: ^bb16 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb18 // CHECK: ^bb18: // pred: ^bb17 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[VAL_12]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb13 // CHECK: ^bb19: // pred: ^bb12 // CHECK: aie.end @@ -123,14 +155,18 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end @@ -138,14 +174,18 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb2 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: // pred: ^bb1 -// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_1]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_3]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_3]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/repeat_count/link_join_repeat_count_test.mlir b/test/objectFifo-stateful-transform/repeat_count/link_join_repeat_count_test.mlir index af8a794ed6c..30f93b40ede 100644 --- a/test/objectFifo-stateful-transform/repeat_count/link_join_repeat_count_test.mlir +++ b/test/objectFifo-stateful-transform/repeat_count/link_join_repeat_count_test.mlir @@ -30,9 +30,11 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2, repeat_count = 2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF0_CONS]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_CONS]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0_BUF]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[OF0_PROD]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0_PROD]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: aie.end @@ -40,28 +42,36 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_PROD0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUF]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[OF2_CONS0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: %1 = aie.dma_start(S2MM, 1, ^bb3, ^bb4) // CHECK: ^bb3: -// CHECK: aie.use_lock(%[[OF2_PROD1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUF]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[OF2_CONS1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb4: // CHECK: %2 = aie.dma_start(MM2S, 0, ^bb5, ^bb7) // CHECK: ^bb5: -// CHECK: aie.use_lock(%[[OF2_CONS0]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS0]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUF]] : memref<32xi32>, 0, 16) -// CHECK: aie.use_lock(%[[OF2_PROD0]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD0]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: -// CHECK: aie.use_lock(%[[OF2_CONS1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUF]] : memref<32xi32>, 16, 16) -// CHECK: aie.use_lock(%[[OF2_PROD1]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD1]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb7: // CHECK: aie.end @@ -69,9 +79,11 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2, repeat_count = 2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF1_CONS]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_CONS]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1_BUF]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[OF1_PROD]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1_PROD]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/repeat_count/link_repeat_count_test.mlir b/test/objectFifo-stateful-transform/repeat_count/link_repeat_count_test.mlir index 976b23548e0..873167a69f3 100644 --- a/test/objectFifo-stateful-transform/repeat_count/link_repeat_count_test.mlir +++ b/test/objectFifo-stateful-transform/repeat_count/link_repeat_count_test.mlir @@ -24,16 +24,20 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF0C_PROD]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[OF0C_PROD]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0C_BUF]] : memref<32xi32>, 0, 32) -// CHECK: aie.use_lock(%[[OF0C_CONS]], Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[OF0C_CONS]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb3, ^bb4, repeat_count = 2) // CHECK: ^bb3: -// CHECK: aie.use_lock(%[[OF0C_CONS]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0C_CONS]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF0C_BUF]] : memref<32xi32>, 0, 32) -// CHECK: aie.use_lock(%[[OF0C_PROD]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF0C_PROD]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb4: // CHECK: aie.end @@ -41,9 +45,11 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF1C_PROD]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1C_PROD]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF1C_BUF]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[OF1C_CONS]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF1C_CONS]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: aie.end @@ -51,9 +57,11 @@ // CHECK: %mem_3_3 = aie.mem(%{{.*}}tile_3_3) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2, repeat_count = 2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2_CONS]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_CONS]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2_BUF]] : memref<32xi32>, 0, 32) -// CHECK: aie.use_lock(%[[OF2_PROD]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2_PROD]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: aie.end @@ -61,16 +69,20 @@ // CHECK: %memtile_dma_2_1 = aie.memtile_dma(%{{.*}}tile_2_1) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: aie.use_lock(%[[OF2C_PROD]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2C_PROD]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2C_BUF]] : memref<32xi32>, 0, 32) -// CHECK: aie.use_lock(%[[OF2C_CONS]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2C_CONS]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb3, ^bb4) // CHECK: ^bb3: -// CHECK: aie.use_lock(%[[OF2C_CONS]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2C_CONS]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[OF2C_BUF]] : memref<32xi32>, 0, 32) -// CHECK: aie.use_lock(%[[OF2C_PROD]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[OF2C_PROD]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb4: // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/repeat_count/memtile_repeat_count_test.mlir b/test/objectFifo-stateful-transform/repeat_count/memtile_repeat_count_test.mlir index 5ba8a83eca6..0e92e189898 100644 --- a/test/objectFifo-stateful-transform/repeat_count/memtile_repeat_count_test.mlir +++ b/test/objectFifo-stateful-transform/repeat_count/memtile_repeat_count_test.mlir @@ -21,9 +21,11 @@ // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2, repeat_count = 2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -31,9 +33,11 @@ // CHECK: %mem_1_3 = aie.mem(%{{.*}}tile_1_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/repeat_count/repeat_count_test.mlir b/test/objectFifo-stateful-transform/repeat_count/repeat_count_test.mlir index 438ab65a68a..fcd4fd48cc4 100644 --- a/test/objectFifo-stateful-transform/repeat_count/repeat_count_test.mlir +++ b/test/objectFifo-stateful-transform/repeat_count/repeat_count_test.mlir @@ -26,18 +26,22 @@ // CHECK: %c1 = arith.constant 1 : index // CHECK: %c12 = arith.constant 12 : index // CHECK: scf.for %arg0 = %c0 to %c12 step %c1 { -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work(%[[VAL_3]]) : (memref<16xi32>) -> () -// CHECK: aie.use_lock(%[[VAL_5]], Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2, repeat_count = 2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -45,9 +49,11 @@ // CHECK: %mem_1_3 = aie.mem(%{{.*}}tile_1_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/repeat_count/repeat_count_test_dynamic.mlir b/test/objectFifo-stateful-transform/repeat_count/repeat_count_test_dynamic.mlir index 167860308b8..4392be1565f 100644 --- a/test/objectFifo-stateful-transform/repeat_count/repeat_count_test_dynamic.mlir +++ b/test/objectFifo-stateful-transform/repeat_count/repeat_count_test_dynamic.mlir @@ -14,9 +14,11 @@ // CHECK: %[[C12:.*]] = arith.constant 12 : index // CHECK: scf.for %{{.*}} = %{{.*}} to %[[C12]] step %{{.*}} { // repeat_count = 3 surfaces as a count-3 acquire/release, not a multiplied loop. -// CHECK: aie.use_lock(%{{.*}}, AcquireGreaterEqual, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%{{.*}}, AcquireGreaterEqual, %{{.*}}) // CHECK: func.call @some_work -// CHECK: aie.use_lock(%{{.*}}, Release, 3) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%{{.*}}, Release, %{{.*}}) // CHECK: } // CHECK: aie.end diff --git a/test/objectFifo-stateful-transform/repeat_count_test.mlir b/test/objectFifo-stateful-transform/repeat_count_test.mlir index b3df4c54963..71618095fca 100644 --- a/test/objectFifo-stateful-transform/repeat_count_test.mlir +++ b/test/objectFifo-stateful-transform/repeat_count_test.mlir @@ -31,19 +31,25 @@ // CHECK: %c1 = arith.constant 1 : index // CHECK: %c12 = arith.constant 12 : index // CHECK: scf.for %arg0 = %c0 to %c12 step %c1 { -// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, 1) -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 3) -// CHECK: aie.use_lock(%[[VAL_5]], Release, 3) -// CHECK: aie.use_lock(%[[VAL_7]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 3 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %{{.*}}) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %{{.*}}) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: %memtile_dma_1_1 = aie.memtile_dma(%{{.*}}tile_1_1) { // CHECK: %0 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_10]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end @@ -51,16 +57,20 @@ // CHECK: %mem_1_2 = aie.mem(%{{.*}}tile_1_2) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_6]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_8]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_8]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: %1 = aie.dma_start(MM2S, 0, ^bb3, ^bb4, repeat_count = 2) // CHECK: ^bb3: -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_4]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb4: // CHECK: aie.end @@ -68,9 +78,11 @@ // CHECK: %mem_1_3 = aie.mem(%{{.*}}tile_1_3) { // CHECK: %0 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: // 2 preds: ^bb0, ^bb1 -// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_1]], AcquireGreaterEqual, %{{.*}}) // CHECK: aie.dma_bd(%[[VAL_0]] : memref<16xi32>, 0, 16) -// CHECK: aie.use_lock(%[[VAL_2]], Release, 1) +// CHECK: %{{.*}} = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_2]], Release, %{{.*}}) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // pred: ^bb0 // CHECK: aie.end diff --git a/test/python/barrier.py b/test/python/barrier.py index 9aaffa38c4d..6bbe7b98ab6 100644 --- a/test/python/barrier.py +++ b/test/python/barrier.py @@ -20,8 +20,10 @@ # CHECK: %[[TILE:.*]] = aie.logical_tile(?, ?) # CHECK: %[[LOCK:.*]] = aie.lock(%[[TILE]]) # CHECK: %{{.*}} = aie.core(%[[TILE]]) { -# CHECK: aie.use_lock(%[[LOCK]], Acquire, 1) -# CHECK: aie.use_lock(%[[LOCK]], Release, 1) +# CHECK: %{{.*}} = arith.constant 1 : i32 +# CHECK: aie.use_lock(%[[LOCK]], Acquire, %{{.*}}) +# CHECK: %{{.*}} = arith.constant 1 : i32 +# CHECK: aie.use_lock(%[[LOCK]], Release, %{{.*}}) # CHECK: } # CHECK: aie.runtime_sequence(%arg0: memref<16xi32>) { # CHECK: aiex.set_lock(%[[LOCK]], 1) diff --git a/test/python/static_bd_config.py b/test/python/static_bd_config.py index db4dbf84112..fc546958546 100644 --- a/test/python/static_bd_config.py +++ b/test/python/static_bd_config.py @@ -25,16 +25,20 @@ def device_body(): # CHECK: %{{.+}} = aie.mem(%[[tile_0_2]]) { # CHECK: %0 = aie.dma_start(S2MM, 1, ^bb1, ^bb2) # CHECK: ^bb1: // pred: ^bb0 - # CHECK: aie.use_lock(%[[lock0]], AcquireGreaterEqual, 1) + # CHECK: %{{.*}} = arith.constant 1 : i32 + # CHECK: aie.use_lock(%[[lock0]], AcquireGreaterEqual, %{{.*}}) # CHECK: aie.dma_bd(%[[buf0]] : memref<16xi32>) - # CHECK: aie.use_lock(%[[lock1]], Release, 1) + # CHECK: %{{.*}} = arith.constant 1 : i32 + # CHECK: aie.use_lock(%[[lock1]], Release, %{{.*}}) # CHECK: aie.end # CHECK: ^bb2: // pred: ^bb0 # CHECK: %1 = aie.dma_start(MM2S, 0, ^bb3, ^bb4) # CHECK: ^bb3: // pred: ^bb2 - # CHECK: aie.use_lock(%[[lock1]], AcquireGreaterEqual, 1) + # CHECK: %{{.*}} = arith.constant 1 : i32 + # CHECK: aie.use_lock(%[[lock1]], AcquireGreaterEqual, %{{.*}}) # CHECK: aie.dma_bd(%[[buf1]] : memref<16xi32>) - # CHECK: aie.use_lock(%[[lock0]], Release, 1) + # CHECK: %{{.*}} = arith.constant 1 : i32 + # CHECK: aie.use_lock(%[[lock0]], Release, %{{.*}}) # CHECK: aie.end # CHECK: ^bb4: // pred: ^bb2 # CHECK: aie.end diff --git a/test/unit_tests/aie/02_lock_acquire_release/aie.mlir b/test/unit_tests/aie/02_lock_acquire_release/aie.mlir index fa58eef654e..2eff9528333 100644 --- a/test/unit_tests/aie/02_lock_acquire_release/aie.mlir +++ b/test/unit_tests/aie/02_lock_acquire_release/aie.mlir @@ -20,9 +20,12 @@ aie.device(xcvc1902) { %lock13_5 = aie.lock(%tile13, 5) { sym_name = "lock2" } %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 0) // acquire for write (e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write (e.g. input ping) - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Acquire", %c0_ul0) // acquire for write (e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write (e.g. input ping) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul2) // release for read aie.end } diff --git a/test/unit_tests/aie/03_sync_with_locks/aie.mlir b/test/unit_tests/aie/03_sync_with_locks/aie.mlir index 2d1c9b66d46..2684bf4a9cc 100644 --- a/test/unit_tests/aie/03_sync_with_locks/aie.mlir +++ b/test/unit_tests/aie/03_sync_with_locks/aie.mlir @@ -21,8 +21,10 @@ aie.device(xcvc1902) { %lock13_5 = aie.lock(%tile13, 5) { sym_name = "lock2" } %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -31,8 +33,10 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } } diff --git a/test/unit_tests/aie/04_shared_memory/aie.mlir b/test/unit_tests/aie/04_shared_memory/aie.mlir index e7c0875b370..d1b6464d44f 100644 --- a/test/unit_tests/aie/04_shared_memory/aie.mlir +++ b/test/unit_tests/aie/04_shared_memory/aie.mlir @@ -24,8 +24,10 @@ aie.device(xcvc1902) { %lock14_7 = aie.lock(%tile14, 7) { sym_name = "output_lock" } // output buffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -34,14 +36,18 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } %core14 = aie.core(%tile14) { - aie.use_lock(%lock13_5, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock14_7, "Acquire", 0) // acquire for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Acquire", %c1_ul4) // acquire for read(e.g. input ping) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock14_7, "Acquire", %c0_ul5) // acquire for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf13_1[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -50,8 +56,10 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf14_0[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, "Release", 0) // release for write - aie.use_lock(%lock14_7, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock14_7, "Release", %c1_ul7) // release for read aie.end } } diff --git a/test/unit_tests/aie/05_tiledma/aie.mlir b/test/unit_tests/aie/05_tiledma/aie.mlir index e0080eff78a..9dab4ee0b58 100644 --- a/test/unit_tests/aie/05_tiledma/aie.mlir +++ b/test/unit_tests/aie/05_tiledma/aie.mlir @@ -31,8 +31,10 @@ aie.device(xcvc1902) { aie.switchbox(%tile33) { aie.connect<"West": 3, "DMA": 1> } %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -41,14 +43,18 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } %core33 = aie.core(%tile33) { - aie.use_lock(%lock33_6, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock33_7, "Acquire", 0) // acquire for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock33_6, "Acquire", %c1_ul4) // acquire for read(e.g. input ping) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock33_7, "Acquire", %c0_ul5) // acquire for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf33_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -57,17 +63,21 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf33_1[%idx2] : memref<256xi32> - aie.use_lock(%lock33_6, "Release", 0) // release for write - aie.use_lock(%lock33_7, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock33_6, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock33_7, "Release", %c1_ul7) // release for read aie.end } %mem13 = aie.mem(%tile13) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock13_5, "Acquire", 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Acquire", %c1_ul8) aie.dma_bd(%buf13_1 : memref<256xi32>, 0, 256) - aie.use_lock(%lock13_5, "Release", 0) + %c0_ul9 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Release", %c0_ul9) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end @@ -76,9 +86,11 @@ aie.device(xcvc1902) { %mem33 = aie.mem(%tile33) { %dma0 = aie.dma_start("S2MM", 1, ^bd0, ^end) ^bd0: - aie.use_lock(%lock33_6, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock33_6, "Acquire", %c0_ul10) aie.dma_bd(%buf33_0: memref<256xi32>, 0, 256) - aie.use_lock(%lock33_6, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock33_6, "Release", %c1_ul11) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end diff --git a/test/unit_tests/aie/08_stream_broadcast/aie.mlir b/test/unit_tests/aie/08_stream_broadcast/aie.mlir index c23997b4549..94403df46a1 100644 --- a/test/unit_tests/aie/08_stream_broadcast/aie.mlir +++ b/test/unit_tests/aie/08_stream_broadcast/aie.mlir @@ -41,8 +41,10 @@ aie.device(xcvc1902) { %lock13_5 = aie.lock(%tile13, 5) { sym_name = "interlock_1" } // interbuffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -51,17 +53,21 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } %mem13 = aie.mem(%tile13) { %dma0 = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock13_5, "Acquire", 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Acquire", %c1_ul4) aie.dma_bd(%buf13_1 : memref<256xi32>, 0, 256) - aie.use_lock(%lock13_5, "Release", 0) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Release", %c0_ul5) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end @@ -77,8 +83,10 @@ aie.device(xcvc1902) { %lock32_7 = aie.lock(%tile32, 7) { sym_name = "output_lock1" } // output buffer lock %core32 = aie.core(%tile32) { - aie.use_lock(%lock32_6, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock32_7, "Acquire", 0) // acquire for write + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock32_6, "Acquire", %c1_ul6) // acquire for read(e.g. input ping) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%lock32_7, "Acquire", %c0_ul7) // acquire for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf32_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -87,8 +95,10 @@ aie.device(xcvc1902) { // %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %3, %buf32_1[%idx2] : memref<256xi32> - aie.use_lock(%lock32_6, "Release", 0) // release for write - aie.use_lock(%lock32_7, "Release", 1) // release for read + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock32_6, "Release", %c0_ul8) // release for write + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock32_7, "Release", %c1_ul9) // release for read aie.end } @@ -96,9 +106,11 @@ aie.device(xcvc1902) { %mem32 = aie.mem(%tile32) { %dma0 = aie.dma_start("S2MM", 1, ^bd0, ^end) ^bd0: - aie.use_lock(%lock32_6, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock32_6, "Acquire", %c0_ul10) aie.dma_bd(%buf32_0 : memref<256xi32>, 0, 256) - aie.use_lock(%lock32_6, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock32_6, "Release", %c1_ul11) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end @@ -112,8 +124,10 @@ aie.device(xcvc1902) { %lock33_7 = aie.lock(%tile33, 7) { sym_name = "output_lock2" } // output buffer lock %core33 = aie.core(%tile33) { - aie.use_lock(%lock33_6, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock33_7, "Acquire", 0) // acquire for write + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock33_6, "Acquire", %c1_ul12) // acquire for read(e.g. input ping) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock33_7, "Acquire", %c0_ul13) // acquire for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf33_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -122,8 +136,10 @@ aie.device(xcvc1902) { // %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %4, %buf33_1[%idx2] : memref<256xi32> - aie.use_lock(%lock33_6, "Release", 0) // release for write - aie.use_lock(%lock33_7, "Release", 1) // release for read + %c0_ul14 = arith.constant 0 : i32 + aie.use_lock(%lock33_6, "Release", %c0_ul14) // release for write + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock33_7, "Release", %c1_ul15) // release for read aie.end } @@ -131,9 +147,11 @@ aie.device(xcvc1902) { %mem33 = aie.mem(%tile33) { %dma0 = aie.dma_start("S2MM", 1, ^bd0, ^end) ^bd0: - aie.use_lock(%lock33_6, "Acquire", 0) + %c0_ul16 = arith.constant 0 : i32 + aie.use_lock(%lock33_6, "Acquire", %c0_ul16) aie.dma_bd(%buf33_0 : memref<256xi32>, 0, 256) - aie.use_lock(%lock33_6, "Release", 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock33_6, "Release", %c1_ul17) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end @@ -147,8 +165,10 @@ aie.device(xcvc1902) { %lock34_7 = aie.lock(%tile34, 7) { sym_name = "output_lock3" } // output buffer lock %core34 = aie.core(%tile34) { - aie.use_lock(%lock34_6, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock34_7, "Acquire", 0) // acquire for write + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock34_6, "Acquire", %c1_ul18) // acquire for read(e.g. input ping) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock34_7, "Acquire", %c0_ul19) // acquire for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf34_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -157,8 +177,10 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf34_1[%idx2] : memref<256xi32> - aie.use_lock(%lock34_6, "Release", 0) // release for write - aie.use_lock(%lock34_7, "Release", 1) // release for read + %c0_ul20 = arith.constant 0 : i32 + aie.use_lock(%lock34_6, "Release", %c0_ul20) // release for write + %c1_ul21 = arith.constant 1 : i32 + aie.use_lock(%lock34_7, "Release", %c1_ul21) // release for read aie.end } @@ -166,9 +188,11 @@ aie.device(xcvc1902) { %mem34 = aie.mem(%tile34) { %dma0 = aie.dma_start("S2MM", 1, ^bd0, ^end) ^bd0: - aie.use_lock(%lock34_6, "Acquire", 0) + %c0_ul22 = arith.constant 0 : i32 + aie.use_lock(%lock34_6, "Acquire", %c0_ul22) aie.dma_bd(%buf34_0 : memref<256xi32>, 0, 256) - aie.use_lock(%lock34_6, "Release", 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%lock34_6, "Release", %c1_ul23) aie.next_bd ^end // point to the next BD, or termination ^end: aie.end diff --git a/test/unit_tests/aie/09_simple_shim_dma/aie.mlir b/test/unit_tests/aie/09_simple_shim_dma/aie.mlir index cb6732bc30f..0d7a4729f61 100644 --- a/test/unit_tests/aie/09_simple_shim_dma/aie.mlir +++ b/test/unit_tests/aie/09_simple_shim_dma/aie.mlir @@ -31,9 +31,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul0) aie.dma_bd(%buffer : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul1) aie.next_bd ^bd0 ^end: aie.end @@ -50,14 +52,18 @@ aie.device(xcvc1902) { %m72 = aie.mem(%t72) { %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l72_0, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l72_0, "Acquire", %c0_ul2) aie.dma_bd(%buf72_0 : memref<256xi32>, 0, 256) - aie.use_lock(%l72_0, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l72_0, "Release", %c1_ul3) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%l72_1, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l72_1, "Acquire", %c0_ul4) aie.dma_bd(%buf72_1 : memref<256xi32>, 0, 256) - aie.use_lock(%l72_1, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l72_1, "Release", %c1_ul5) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/unit_tests/aie/14_stream_packet/aie.mlir b/test/unit_tests/aie/14_stream_packet/aie.mlir index 5697ec6bd5c..b372d23d22d 100644 --- a/test/unit_tests/aie/14_stream_packet/aie.mlir +++ b/test/unit_tests/aie/14_stream_packet/aie.mlir @@ -52,10 +52,12 @@ aie.device(xcvc1902) { %m73 = aie.mem(%t73) { %srcDma = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l73, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%l73, "Acquire", %c0_ul0) aie.dma_bd_packet(0x5, 0xD) aie.dma_bd(%buf73 : memref<256xi32>, 0, 256) - aie.use_lock(%l73, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%l73, "Release", %c1_ul1) aie.next_bd ^end ^end: aie.end @@ -64,10 +66,12 @@ aie.device(xcvc1902) { %m71 = aie.mem(%t71) { %srcDma = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l71, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l71, "Acquire", %c0_ul2) aie.dma_bd_packet(0x4, 0xC) aie.dma_bd(%buf71 : memref<256xi32>, 0, 256) - aie.use_lock(%l71, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l71, "Release", %c1_ul3) aie.next_bd ^end ^end: aie.end @@ -85,9 +89,11 @@ aie.device(xcvc1902) { //^dma: // %srcDma1 = aie.dma_start("S2MM", 1, ^bd1, ^end) ^bd0: - aie.use_lock(%l62, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l62, "Acquire", %c0_ul4) aie.dma_bd(%buf62 : memref<512xi32>, 0, 512) - aie.use_lock(%l62, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l62, "Release", %c1_ul5) aie.next_bd ^end //^bd1: // aie.use_lock(%l62_1, "Acquire", 0) diff --git a/test/unit_tests/aie/15_prime_sieve/aie.mlir b/test/unit_tests/aie/15_prime_sieve/aie.mlir index e20d5dc1a9a..1f8e989b65f 100644 --- a/test/unit_tests/aie/15_prime_sieve/aie.mlir +++ b/test/unit_tests/aie/15_prime_sieve/aie.mlir @@ -40,7 +40,8 @@ aie.device(xcvc1902) { memref.store %sum_iter, %buf13_0[%arg0] : memref<256xi32> scf.yield %sum_next : i32 } - aie.use_lock(%lock13_0, "Release", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_0, "Release", %c1_ul0) aie.end } func.func @do_sieve(%bufin: memref<256xi32>, %bufout:memref<256xi32>) -> () { @@ -89,27 +90,39 @@ aie.device(xcvc1902) { } %core14 = aie.core(%tile14) { - aie.use_lock(%lock13_0, "Acquire", 1) - aie.use_lock(%lock14_0, "Acquire", 0) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock13_0, "Acquire", %c1_ul1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock14_0, "Acquire", %c0_ul2) func.call @do_sieve(%buf13_0, %buf14_0) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock13_0, "Release", 0) - aie.use_lock(%lock14_0, "Release", 1) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock13_0, "Release", %c0_ul3) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock14_0, "Release", %c1_ul4) aie.end } %core15 = aie.core(%tile15) { - aie.use_lock(%lock14_0, "Acquire", 1) - aie.use_lock(%lock15_0, "Acquire", 0) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock14_0, "Acquire", %c1_ul5) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock15_0, "Acquire", %c0_ul6) func.call @do_sieve(%buf14_0, %buf15_0) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock14_0, "Release", 0) - aie.use_lock(%lock15_0, "Release", 1) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%lock14_0, "Release", %c0_ul7) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock15_0, "Release", %c1_ul8) aie.end } %core16 = aie.core(%tile16) { - aie.use_lock(%lock15_0, "Acquire", 1) - aie.use_lock(%lock16_0, "Acquire", 0) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock15_0, "Acquire", %c1_ul9) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock16_0, "Acquire", %c0_ul10) func.call @do_sieve(%buf15_0, %buf16_0) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock15_0, "Release", 0) - aie.use_lock(%lock16_0, "Release", 1) + %c0_ul11 = arith.constant 0 : i32 + aie.use_lock(%lock15_0, "Release", %c0_ul11) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock16_0, "Release", %c1_ul12) aie.end } diff --git a/test/unit_tests/aie/16_libm_expf/aie.mlir b/test/unit_tests/aie/16_libm_expf/aie.mlir index d7fecaa01c0..a81d25c30ad 100644 --- a/test/unit_tests/aie/16_libm_expf/aie.mlir +++ b/test/unit_tests/aie/16_libm_expf/aie.mlir @@ -23,13 +23,15 @@ aie.device(xcvc1902) { func.func private @func(%A: memref<256xf32>, %B: memref<256xf32>) -> () %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire affine.for %arg0 = 0 to 256 { %val1 = affine.load %buf_a[%arg0] : memref<256xf32> %val2 = math.exp %val1 : f32 affine.store %val2, %buf_b[%arg0] : memref<256xf32> } - aie.use_lock(%lock13_3, "Release", 0) // release for write + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul1) // release for write aie.end } } diff --git a/test/unit_tests/aie/17_shim_dma_with_core/aie.mlir b/test/unit_tests/aie/17_shim_dma_with_core/aie.mlir index 5febc728e45..6ff07ef5dc2 100644 --- a/test/unit_tests/aie/17_shim_dma_with_core/aie.mlir +++ b/test/unit_tests/aie/17_shim_dma_with_core/aie.mlir @@ -43,8 +43,10 @@ aie.device(xcvc1902) { %c64 = arith.constant 64 : index scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_ping, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_ping, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c1_ul0) // acquire for read + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c0_ul1) // acquire for write // copy loop scf.for %arg0 = %c0 to %c64 step %c1 iter_args(%sum_iter = %sum_0) -> (i32) { @@ -54,11 +56,15 @@ aie.device(xcvc1902) { scf.yield %i : i32 } // func.call @func(%buf_a_ping, %buf_b_ping,%buffer_size) : (memref<256xi32>, memref<256xi32>,i32) -> () - aie.use_lock(%lock_a_ping, "Release", 0) // release for write - aie.use_lock(%lock_b_ping, "Release", 1) // release for read - - aie.use_lock(%lock_a_pong, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_pong, "Acquire", 0) // acquire for write + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Release", %c1_ul3) // release for read + + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c1_ul4) // acquire for read + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c0_ul5) // acquire for write scf.for %arg0 = %c0 to %c64 step %c1 iter_args(%sum_iter = %sum_0) -> (i32) { %i = memref.load %buf_a_pong[%arg0] : memref<64xi32> @@ -66,8 +72,10 @@ aie.device(xcvc1902) { memref.store %i2, %buf_b_pong[%arg0] : memref<64xi32> scf.yield %i : i32 } - aie.use_lock(%lock_a_pong, "Release", 0) // release for write - aie.use_lock(%lock_b_pong, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Release", %c1_ul7) // release for read } aie.end @@ -79,24 +87,32 @@ aie.device(xcvc1902) { ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul8) aie.dma_bd(%buf_a_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_pong, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c0_ul10) aie.dma_bd(%buf_a_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_pong, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Release", %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_ping, "Acquire", 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c1_ul12) aie.dma_bd(%buf_b_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_ping, "Release", 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Release", %c0_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_pong, "Acquire", 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c1_ul14) aie.dma_bd(%buf_b_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_pong, "Release", 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Release", %c0_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -126,14 +142,18 @@ aie.device(xcvc1902) { ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul16) aie.dma_bd(%buffer_in : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2, Acquire, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2, Acquire, %c1_ul18) aie.dma_bd(%buffer_out : memref<512 x i32>, 0, 512) - aie.use_lock(%lock2, Release, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock2, Release, %c0_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/aie/18_simple_shim_dma_routed/aie.mlir b/test/unit_tests/aie/18_simple_shim_dma_routed/aie.mlir index c88c775013f..7daafe5b04a 100644 --- a/test/unit_tests/aie/18_simple_shim_dma_routed/aie.mlir +++ b/test/unit_tests/aie/18_simple_shim_dma_routed/aie.mlir @@ -22,9 +22,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul0) aie.dma_bd(%buffer : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul1) aie.next_bd ^bd0 ^end: aie.end @@ -41,14 +43,18 @@ aie.device(xcvc1902) { %m72 = aie.mem(%t72) { %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l72_0, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l72_0, "Acquire", %c0_ul2) aie.dma_bd(%buf72_0 : memref<256xi32>, 0, 256) - aie.use_lock(%l72_0, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l72_0, "Release", %c1_ul3) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%l72_1, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l72_1, "Acquire", %c0_ul4) aie.dma_bd(%buf72_1 : memref<256xi32>, 0, 256) - aie.use_lock(%l72_1, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l72_1, "Release", %c1_ul5) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/unit_tests/aie/19_shim_dma_with_core_routed/aie.mlir b/test/unit_tests/aie/19_shim_dma_with_core_routed/aie.mlir index a443b121198..70bf9235d69 100644 --- a/test/unit_tests/aie/19_shim_dma_with_core_routed/aie.mlir +++ b/test/unit_tests/aie/19_shim_dma_with_core_routed/aie.mlir @@ -41,8 +41,10 @@ aie.device(xcvc1902) { %c64 = arith.constant 64 : index scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_ping, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_ping, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c1_ul0) // acquire for read + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c0_ul1) // acquire for write // copy loop scf.for %arg0 = %c0 to %c64 step %c1 iter_args(%sum_iter = %sum_0) -> (i32) { @@ -52,11 +54,15 @@ aie.device(xcvc1902) { scf.yield %i : i32 } // func.call @func(%buf_a_ping, %buf_b_ping,%buffer_size) : (memref<256xi32>, memref<256xi32>,i32) -> () - aie.use_lock(%lock_a_ping, "Release", 0) // release for write - aie.use_lock(%lock_b_ping, "Release", 1) // release for read - - aie.use_lock(%lock_a_pong, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_pong, "Acquire", 0) // acquire for write + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Release", %c1_ul3) // release for read + + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c1_ul4) // acquire for read + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c0_ul5) // acquire for write scf.for %arg0 = %c0 to %c64 step %c1 iter_args(%sum_iter = %sum_0) -> (i32) { %i = memref.load %buf_a_pong[%arg0] : memref<64xi32> @@ -64,8 +70,10 @@ aie.device(xcvc1902) { memref.store %i2, %buf_b_pong[%arg0] : memref<64xi32> scf.yield %i : i32 } - aie.use_lock(%lock_a_pong, "Release", 0) // release for write - aie.use_lock(%lock_b_pong, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Release", %c1_ul7) // release for read } aie.end @@ -77,24 +85,32 @@ aie.device(xcvc1902) { ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul8) aie.dma_bd(%buf_a_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_pong, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c0_ul10) aie.dma_bd(%buf_a_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_pong, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Release", %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_ping, "Acquire", 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c1_ul12) aie.dma_bd(%buf_b_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_ping, "Release", 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Release", %c0_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_pong, "Acquire", 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c1_ul14) aie.dma_bd(%buf_b_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_pong, "Release", 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Release", %c0_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -117,14 +133,18 @@ aie.device(xcvc1902) { ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul16) aie.dma_bd(%buffer_in : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2, Acquire, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2, Acquire, %c1_ul18) aie.dma_bd(%buffer_out : memref<512 x i32>, 0, 512) - aie.use_lock(%lock2, Release, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock2, Release, %c0_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/aie/20_shim_dma_broadcast/aie.mlir b/test/unit_tests/aie/20_shim_dma_broadcast/aie.mlir index 2759719ed1b..407a4d7e178 100644 --- a/test/unit_tests/aie/20_shim_dma_broadcast/aie.mlir +++ b/test/unit_tests/aie/20_shim_dma_broadcast/aie.mlir @@ -22,9 +22,11 @@ aie.device(xcvc1902) { aie.dma_start(MM2S, 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul0) aie.dma_bd(%buffer : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul1) aie.next_bd ^bd0 ^end: aie.end @@ -41,14 +43,18 @@ aie.device(xcvc1902) { %m72 = aie.mem(%t72) { %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l72_0, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%l72_0, "Acquire", %c0_ul2) aie.dma_bd(%buf72_0 : memref<256xi32>, 0, 256) - aie.use_lock(%l72_0, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%l72_0, "Release", %c1_ul3) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%l72_1, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%l72_1, "Acquire", %c0_ul4) aie.dma_bd(%buf72_1 : memref<256xi32>, 0, 256) - aie.use_lock(%l72_1, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%l72_1, "Release", %c1_ul5) aie.next_bd ^bd0 ^end: aie.end @@ -65,14 +71,18 @@ aie.device(xcvc1902) { %m73 = aie.mem(%t73) { %srcDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%l73_0, "Acquire", 0) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%l73_0, "Acquire", %c0_ul6) aie.dma_bd(%buf73_0 : memref<256xi32>, 0, 256) - aie.use_lock(%l73_0, "Release", 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%l73_0, "Release", %c1_ul7) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%l73_1, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%l73_1, "Acquire", %c0_ul8) aie.dma_bd(%buf73_1 : memref<256xi32>, 0, 256) - aie.use_lock(%l73_1, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%l73_1, "Release", %c1_ul9) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/unit_tests/aie/21_shim_dma_packet/aie.mlir b/test/unit_tests/aie/21_shim_dma_packet/aie.mlir index 9ae3936482c..5ba563f72a5 100644 --- a/test/unit_tests/aie/21_shim_dma_packet/aie.mlir +++ b/test/unit_tests/aie/21_shim_dma_packet/aie.mlir @@ -31,10 +31,12 @@ aie.device(xcvc1902) { %8 = aie.shim_dma(%3) { %43 = aie.dma_start(MM2S, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%5, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%5, Acquire, %c1_ul0) aie.dma_bd_packet(0, 2) aie.dma_bd(%6 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%5, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%5, Release, %c0_ul1) aie.next_bd ^bb1 ^bb2: // pred: ^bb0 aie.end @@ -62,24 +64,30 @@ aie.device(xcvc1902) { %18 = aie.shim_dma(%9) { %43 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%13, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%13, Acquire, %c0_ul2) aie.dma_bd(%16 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%13, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%13, Release, %c1_ul3) aie.next_bd ^bb1 ^bb2: // pred: ^bb0 %44 = aie.dma_start(MM2S, 0, ^bb3, ^bb4) ^bb3: // 2 preds: ^bb2, ^bb3 - aie.use_lock(%11, Acquire, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%11, Acquire, %c1_ul4) aie.dma_bd(%15 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%11, Release, 0) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%11, Release, %c0_ul5) aie.next_bd ^bb3 ^bb4: // pred: ^bb2 %45 = aie.dma_start(MM2S, 1, ^bb5, ^bb6) ^bb5: // 2 preds: ^bb4, ^bb5 - aie.use_lock(%12, Acquire, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%12, Acquire, %c1_ul6) aie.dma_bd_packet(0, 3) aie.dma_bd(%14 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%12, Release, 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%12, Release, %c0_ul7) aie.next_bd ^bb5 ^bb6: // pred: ^bb4 aie.end @@ -104,10 +112,14 @@ aie.device(xcvc1902) { %30 = aie.buffer(%19) {sym_name = "A"} : memref<32x32xi32> %31 = aie.buffer(%19) {sym_name = "B"} : memref<32x32xi32> %32 = aie.core(%19) { - aie.use_lock(%23, Acquire, 1) - aie.use_lock(%24, Acquire, 1) - aie.use_lock(%25, Acquire, 0) - aie.use_lock(%22, Acquire, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%23, Acquire, %c1_ul8) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%24, Acquire, %c1_ul9) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%25, Acquire, %c0_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%22, Acquire, %c1_ul11) affine.for %arg0 = 0 to 32 { affine.for %arg1 = 0 to 32 { %43 = affine.load %29[%arg0, %arg1] : memref<32x32xi32> @@ -122,40 +134,53 @@ aie.device(xcvc1902) { } } } - aie.use_lock(%22, Release, 0) - aie.use_lock(%25, Release, 1) - aie.use_lock(%24, Release, 0) - aie.use_lock(%23, Release, 0) - aie.use_lock(%20, Release, 1) + %c0_ul12 = arith.constant 0 : i32 + aie.use_lock(%22, Release, %c0_ul12) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%25, Release, %c1_ul13) + %c0_ul14 = arith.constant 0 : i32 + aie.use_lock(%24, Release, %c0_ul14) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%23, Release, %c0_ul15) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%20, Release, %c1_ul16) aie.end } %33 = aie.mem(%19) { %43 = aie.dma_start(S2MM, 0, ^bb1, ^bb2) ^bb1: // 2 preds: ^bb0, ^bb1 - aie.use_lock(%22, Acquire, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%22, Acquire, %c0_ul17) aie.dma_bd(%31 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%22, Release, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%22, Release, %c1_ul18) aie.next_bd ^bb1 ^bb2: // pred: ^bb0 %44 = aie.dma_start(S2MM, 1, ^bb3, ^bb5) ^bb3: // 2 preds: ^bb2, ^bb4 - aie.use_lock(%24, Acquire, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%24, Acquire, %c0_ul19) aie.dma_bd_packet(0, 2) aie.dma_bd(%29 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%24, Release, 1) + %c1_ul20 = arith.constant 1 : i32 + aie.use_lock(%24, Release, %c1_ul20) aie.next_bd ^bb4 ^bb4: // pred: ^bb3 - aie.use_lock(%23, Acquire, 0) + %c0_ul21 = arith.constant 0 : i32 + aie.use_lock(%23, Acquire, %c0_ul21) aie.dma_bd_packet(0, 3) aie.dma_bd(%30 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%23, Release, 1) + %c1_ul22 = arith.constant 1 : i32 + aie.use_lock(%23, Release, %c1_ul22) aie.next_bd ^bb3 ^bb5: // pred: ^bb2 %45 = aie.dma_start(MM2S, 0, ^bb6, ^bb7) ^bb6: // 2 preds: ^bb5, ^bb6 - aie.use_lock(%25, Acquire, 1) + %c1_ul23 = arith.constant 1 : i32 + aie.use_lock(%25, Acquire, %c1_ul23) aie.dma_bd(%26 : memref<32x32xi32>, 0, 1024) - aie.use_lock(%25, Release, 0) + %c0_ul24 = arith.constant 0 : i32 + aie.use_lock(%25, Release, %c0_ul24) aie.next_bd ^bb6 ^bb7: // pred: ^bb5 aie.end diff --git a/test/unit_tests/aie/22_init_locks/aie.mlir b/test/unit_tests/aie/22_init_locks/aie.mlir index 025f8506846..267eb677dbc 100644 --- a/test/unit_tests/aie/22_init_locks/aie.mlir +++ b/test/unit_tests/aie/22_init_locks/aie.mlir @@ -21,8 +21,10 @@ aie.device(xcvc1902) { %lock13_5 = aie.lock(%tile13, 5) { sym_name = "lock_b" } %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -31,8 +33,10 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } } diff --git a/test/unit_tests/aie/23_broadcast_packet/aie.mlir b/test/unit_tests/aie/23_broadcast_packet/aie.mlir index 9fae415621d..22dc11d62fb 100644 --- a/test/unit_tests/aie/23_broadcast_packet/aie.mlir +++ b/test/unit_tests/aie/23_broadcast_packet/aie.mlir @@ -43,16 +43,20 @@ aie.device(xcvc1902) { %lock72_5 = aie.lock(%t72, 5) aie.dma_start("MM2S", 0, ^bd4, ^end) ^bd4: - aie.use_lock(%lock72_4, "Acquire", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock72_4, "Acquire", %c1_ul0) aie.dma_bd_packet(0x0, 0x0) aie.dma_bd(%buf72_0 : memref<1024xi32>, 0, 1024) - aie.use_lock(%lock72_4, "Release", 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock72_4, "Release", %c0_ul1) aie.next_bd ^bd5 ^bd5: - aie.use_lock(%lock72_5, "Acquire", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock72_5, "Acquire", %c1_ul2) aie.dma_bd_packet(0x1, 0x1) aie.dma_bd(%buf72_1 : memref<1024xi32>, 0, 1024) - aie.use_lock(%lock72_5, "Release", 0) + %c0_ul3 = arith.constant 0 : i32 + aie.use_lock(%lock72_5, "Release", %c0_ul3) aie.next_bd ^bd4 ^end: aie.end @@ -62,9 +66,11 @@ aie.device(xcvc1902) { %m63 = aie.mem(%t63) { aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock63_0, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock63_0, Acquire, %c0_ul4) aie.dma_bd(%buf63_0 : memref<1024xi32>, 0, 1024) - aie.use_lock(%lock63_0, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock63_0, Release, %c1_ul5) aie.next_bd ^bd0 ^end: aie.end @@ -75,9 +81,11 @@ aie.device(xcvc1902) { %m64 = aie.mem(%t64) { aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock64_0, Acquire, 0) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock64_0, Acquire, %c0_ul6) aie.dma_bd(%buf64_0 : memref<1024xi32>, 0, 1024) - aie.use_lock(%lock64_0, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock64_0, Release, %c1_ul7) aie.next_bd ^bd0 ^end: aie.end @@ -88,9 +96,11 @@ aie.device(xcvc1902) { %m73 = aie.mem(%t73) { aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock73_0, Acquire, 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock73_0, Acquire, %c0_ul8) aie.dma_bd(%buf73_0 : memref<1024xi32>, 0, 1024) - aie.use_lock(%lock73_0, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock73_0, Release, %c1_ul9) aie.next_bd ^bd0 ^end: aie.end @@ -101,9 +111,11 @@ aie.device(xcvc1902) { aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock74_0, Acquire, 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock74_0, Acquire, %c0_ul10) aie.dma_bd(%buf74_0 : memref<1024xi32>, 0, 1024) - aie.use_lock(%lock74_0, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock74_0, Release, %c1_ul11) aie.next_bd ^bd0 ^end: aie.end diff --git a/test/unit_tests/aie/23_packet_biShim/aie.mlir b/test/unit_tests/aie/23_packet_biShim/aie.mlir index 83d22fc9c4c..8241621a151 100644 --- a/test/unit_tests/aie/23_packet_biShim/aie.mlir +++ b/test/unit_tests/aie/23_packet_biShim/aie.mlir @@ -26,12 +26,15 @@ aie.device(xcvc1902) { ^dma0: %dstDma = aie.dma_start("MM2S", 0, ^bb3, ^end) ^bb2: - aie.use_lock(%10, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%10, Acquire, %c0_ul0) aie.dma_bd(%11 : memref<256xi32>, 0, 256) - aie.use_lock(%10, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%10, Release, %c1_ul1) aie.next_bd ^bb2 ^bb3: - aie.use_lock(%10, Acquire, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%10, Acquire, %c1_ul2) aie.dma_bd_packet(0x6, 10) aie.dma_bd(%11 : memref<256xi32>, 0, 256) aie.next_bd ^bb3 @@ -44,15 +47,19 @@ aie.device(xcvc1902) { ^dma0: aie.dma_start("S2MM", 0, ^bb1, ^end) ^bb0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul3) aie.dma_bd_packet(0x2, 3) aie.dma_bd(%buf_i : memref<256xi32>, 0, 256) - aie.use_lock(%lock1, Release, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul4) aie.next_bd ^bb0 ^bb1: - aie.use_lock(%lock2, Acquire, 0) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock2, Acquire, %c0_ul5) aie.dma_bd(%buf_o : memref<257xi32>, 0, 257) - aie.use_lock(%lock2, Release, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock2, Release, %c1_ul6) aie.next_bd ^bb1 ^end: aie.end diff --git a/test/unit_tests/aie/25_host_multirate/aie.mlir b/test/unit_tests/aie/25_host_multirate/aie.mlir index f276776bc43..656e5da3bf5 100755 --- a/test/unit_tests/aie/25_host_multirate/aie.mlir +++ b/test/unit_tests/aie/25_host_multirate/aie.mlir @@ -46,7 +46,8 @@ aie.device(xcvc1902) { ^bb0(%arg2: i32): %next = func.call @payload(%arg2) : (i32) -> i32 - aie.use_lock(%hostLock, Acquire, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%hostLock, Acquire, %c1_ul0) %inputSubview = aie.objectfifo.acquire @of_in (Consume, 1) : !aie.objectfifosubview> %outputSubview = aie.objectfifo.acquire @of_out (Produce, 1) : !aie.objectfifosubview> @@ -62,7 +63,8 @@ aie.device(xcvc1902) { aie.objectfifo.release @of_in (Consume, 1) aie.objectfifo.release @of_out (Produce, 1) - aie.use_lock(%hostLock, Release, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%hostLock, Release, %c0_ul1) scf.yield %next : i32 } diff --git a/test/unit_tests/aie/27_single_L1_single_lock/aie.mlir b/test/unit_tests/aie/27_single_L1_single_lock/aie.mlir index 2e8a654c34a..65e03c521f5 100644 --- a/test/unit_tests/aie/27_single_L1_single_lock/aie.mlir +++ b/test/unit_tests/aie/27_single_L1_single_lock/aie.mlir @@ -25,21 +25,29 @@ module @test27_simple_shim_dma_single_lock { %constant43 = arith.constant 43 : i32 %constant47 = arith.constant 47 : i32 - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul0) memref.store %constant7, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul1) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul2) memref.store %constant13, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul3) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul4) memref.store %constant43, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul5) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul6) memref.store %constant47, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul7) aie.end } diff --git a/test/unit_tests/aie/27_single_L1_single_lock/aie2.mlir b/test/unit_tests/aie/27_single_L1_single_lock/aie2.mlir index 85c19212224..99a13a329b7 100644 --- a/test/unit_tests/aie/27_single_L1_single_lock/aie2.mlir +++ b/test/unit_tests/aie/27_single_L1_single_lock/aie2.mlir @@ -26,21 +26,29 @@ module @test27_simple_shim_dma_single_lock { %constant43 = arith.constant 43 : i32 %constant47 = arith.constant 47 : i32 - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul0) memref.store %constant7, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul1) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul2) memref.store %constant13, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul3) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul4) memref.store %constant43, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul5) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul6) memref.store %constant47, %buf72_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul7) aie.end } diff --git a/test/unit_tests/aie/27_single_L1_single_lock/aieWithWorkaround.mlir b/test/unit_tests/aie/27_single_L1_single_lock/aieWithWorkaround.mlir index bb060d33f11..3124f6ce2d5 100644 --- a/test/unit_tests/aie/27_single_L1_single_lock/aieWithWorkaround.mlir +++ b/test/unit_tests/aie/27_single_L1_single_lock/aieWithWorkaround.mlir @@ -27,39 +27,55 @@ aie.device(xcvc1902) { %constant43 = arith.constant 43 : i32 %constant47 = arith.constant 47 : i32 - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul0) memref.store %constant7, %buf73_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul1) - aie.use_lock(%lockCore, "Acquire", 0) - aie.use_lock(%lockCore, "Release", 1) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul2) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul3) // aie.use_lock(%dummyLock, "Acquire", 0) // aie.use_lock(%dummyLock, "Release", 0) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul4) memref.store %constant13, %buf73_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul5) - aie.use_lock(%lockCore, "Acquire", 0) - aie.use_lock(%lockCore, "Release", 1) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul6) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul7) // aie.use_lock(%dummyLock, "Acquire", 0) // aie.use_lock(%dummyLock, "Release", 0) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul8) memref.store %constant43, %buf73_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul9) - aie.use_lock(%lockCore, "Acquire", 0) - aie.use_lock(%lockCore, "Release", 1) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul10) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul11) // aie.use_lock(%dummyLock, "Acquire", 0) // aie.use_lock(%dummyLock, "Release", 0) - aie.use_lock(%lockCore, "Acquire", 0) + %c0_ul12 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul12) memref.store %constant47, %buf73_0[%c0] : memref<16xi32> - aie.use_lock(%lockCore, "Release", 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul13) - aie.use_lock(%lockCore, "Acquire", 0) - aie.use_lock(%lockCore, "Release", 1) + %c0_ul14 = arith.constant 0 : i32 + aie.use_lock(%lockCore, "Acquire", %c0_ul14) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lockCore, "Release", %c1_ul15) // aie.use_lock(%dummyLock, "Acquire", 0) // aie.use_lock(%dummyLock, "Release", 0) diff --git a/test/unit_tests/aie/28_multidepth_objectFifos/multi_depth/aie.mlir b/test/unit_tests/aie/28_multidepth_objectFifos/multi_depth/aie.mlir index 4d9f3b2185d..2a5c2016c7f 100755 --- a/test/unit_tests/aie/28_multidepth_objectFifos/multi_depth/aie.mlir +++ b/test/unit_tests/aie/28_multidepth_objectFifos/multi_depth/aie.mlir @@ -81,9 +81,11 @@ module @multi_depth { %height = arith.constant 32 : index %iter_max = arith.constant 4 : index - aie.use_lock(%lock_pc, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_pc, Acquire, %c0_ul0) - aie.use_lock(%lock_out, Acquire, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_out, Acquire, %c0_ul1) scf.for %iter = %c0 to %iter_max step %c1 { %subviewIn_21 = aie.objectfifo.acquire @of_in (Consume, 1) : !aie.objectfifosubview> @@ -98,9 +100,11 @@ module @multi_depth { aie.objectfifo.release @of_inter (Consume, 1) } - aie.use_lock(%lock_out, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_out, Release, %c1_ul2) - aie.use_lock(%lock_pc, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_pc, Release, %c1_ul3) aie.end } diff --git a/test/unit_tests/aie/28_multidepth_objectFifos/single_depth/aie.mlir b/test/unit_tests/aie/28_multidepth_objectFifos/single_depth/aie.mlir index 9e54d53e27e..8d45639848c 100755 --- a/test/unit_tests/aie/28_multidepth_objectFifos/single_depth/aie.mlir +++ b/test/unit_tests/aie/28_multidepth_objectFifos/single_depth/aie.mlir @@ -82,9 +82,11 @@ module @single_depth { %height = arith.constant 32 : index %iter_max = arith.constant 4 : index - aie.use_lock(%lock_pc, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_pc, Acquire, %c0_ul0) - aie.use_lock(%lock_out, Acquire, 0) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_out, Acquire, %c0_ul1) scf.for %iter = %c0 to %iter_max step %c1 { %subviewIn_21 = aie.objectfifo.acquire @of_in (Consume, 1) : !aie.objectfifosubview> @@ -99,9 +101,11 @@ module @single_depth { aie.objectfifo.release @of_inter (Consume, 1) } - aie.use_lock(%lock_out, Release, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_out, Release, %c1_ul2) - aie.use_lock(%lock_pc, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_pc, Release, %c1_ul3) aie.end } diff --git a/test/unit_tests/aie/31_stream_core/aie.mlir b/test/unit_tests/aie/31_stream_core/aie.mlir index 683ddc47138..1b346459c75 100644 --- a/test/unit_tests/aie/31_stream_core/aie.mlir +++ b/test/unit_tests/aie/31_stream_core/aie.mlir @@ -38,20 +38,24 @@ aie.device(xcvc1902) { %core13 = aie.core(%tile13) { %0 = arith.constant 0 : i32 %idx0 = arith.constant 3 : index - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) %val = memref.load %buf13[%idx0] : memref<256xi32> aie.put_stream(%0 : i32, %val : i32) - aie.use_lock(%lock13_3, "Release", 0) // release for write + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul1) // release for write aie.end } %core23 = aie.core(%tile23) { %0 = arith.constant 0 : i32 %idx0 = arith.constant 3 : index - aie.use_lock(%lock23_7, "Acquire", 0) // acquire for write + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock23_7, "Acquire", %c0_ul2) // acquire for write %val = aie.get_stream(%0 : i32) : i32 memref.store %val, %buf23[%idx0] : memref<256xi32> - aie.use_lock(%lock23_7, "Release", 1) // release for read + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock23_7, "Release", %c1_ul3) // release for read aie.end } diff --git a/test/unit_tests/aie2/01_precompiled_core_function/aie.mlir b/test/unit_tests/aie2/01_precompiled_core_function/aie.mlir index 37aeda9b8de..73e90d93be5 100644 --- a/test/unit_tests/aie2/01_precompiled_core_function/aie.mlir +++ b/test/unit_tests/aie2/01_precompiled_core_function/aie.mlir @@ -23,11 +23,15 @@ module @test_chesss_01_precompiled_core_function { func.func private @func(%A: memref<256xi32>, %B: memref<256xi32>) -> () attributes {link_with = "kernel.o"} %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write func.call @func(%buf13_0, %buf13_1) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } } diff --git a/test/unit_tests/aie2/03_cascade_core_functions/aie.mlir b/test/unit_tests/aie2/03_cascade_core_functions/aie.mlir index 9f106422132..79b89cf0c4a 100644 --- a/test/unit_tests/aie2/03_cascade_core_functions/aie.mlir +++ b/test/unit_tests/aie2/03_cascade_core_functions/aie.mlir @@ -27,7 +27,8 @@ module { func.func private @do_mac(%A: memref<256xi32>) -> () attributes {link_with = "kernel.o"} %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, AcquireGreaterEqual, 1) // acquire for read(e.g. input ping) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, AcquireGreaterEqual, %c1_ul0) // acquire for read(e.g. input ping) func.call @do_mul(%buf13_0) : (memref<256xi32>) -> () aie.end } @@ -37,7 +38,8 @@ module { // %idx1 = arith.constant 0 : index // memref.store %val1, %buf14_0[%idx1] : memref<256xi32> func.call @do_mac(%buf23_0) : (memref<256xi32>) -> () - aie.use_lock(%lock23_7, Release, 1) // release for read + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock23_7, Release, %c1_ul1) // release for read aie.end } } diff --git a/test/unit_tests/aie2/03_simple/aie.mlir b/test/unit_tests/aie2/03_simple/aie.mlir index 060971efb37..406a85ab887 100644 --- a/test/unit_tests/aie2/03_simple/aie.mlir +++ b/test/unit_tests/aie2/03_simple/aie.mlir @@ -26,7 +26,8 @@ module @test04_shared_memory { %lock13_5 = aie.lock(%tile13, 5) { sym_name = "output_lock" } // output buffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, AcquireGreaterEqual, %c1_ul0) %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -35,7 +36,8 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, Release, %c1_ul1) aie.end } } diff --git a/test/unit_tests/aie2/04_shared_memory/aie.mlir b/test/unit_tests/aie2/04_shared_memory/aie.mlir index 48b8c7b4059..5d2da39d73d 100644 --- a/test/unit_tests/aie2/04_shared_memory/aie.mlir +++ b/test/unit_tests/aie2/04_shared_memory/aie.mlir @@ -31,8 +31,10 @@ module @test04_shared_memory { %lock14_8 = aie.lock(%tile14, 8) { sym_name = "output_read_lock" } // output buffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_4, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock13_5, AcquireGreaterEqual, 1) // acquire input for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_4, AcquireGreaterEqual, %c1_ul0) // acquire input for read(e.g. input ping) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, AcquireGreaterEqual, %c1_ul1) // acquire input for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -41,14 +43,18 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, Release, 1) // release input for write - aie.use_lock(%lock13_6, Release, 1) // release output for read + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, Release, %c1_ul2) // release input for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, Release, %c1_ul3) // release output for read aie.end } %core14 = aie.core(%tile14) { - aie.use_lock(%lock13_6, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock14_7, AcquireGreaterEqual, 1) // acquire output for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, AcquireGreaterEqual, %c1_ul4) // acquire input for read(e.g. input ping) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock14_7, AcquireGreaterEqual, %c1_ul5) // acquire output for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf13_1[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -57,8 +63,10 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf14_0[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, Release, 1) // release input for write - aie.use_lock(%lock14_8, Release, 1) // release output for read + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, Release, %c1_ul6) // release input for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock14_8, Release, %c1_ul7) // release output for read aie.end } } diff --git a/test/unit_tests/aie2/04_shared_memory/aie_row.mlir b/test/unit_tests/aie2/04_shared_memory/aie_row.mlir index 09a48f97410..fd5d8029517 100644 --- a/test/unit_tests/aie2/04_shared_memory/aie_row.mlir +++ b/test/unit_tests/aie2/04_shared_memory/aie_row.mlir @@ -34,8 +34,10 @@ module @test04_shared_memory { %lock23_8 = aie.lock(%tile33, 8) { sym_name = "output_read_lock" } // output buffer lock %core13 = aie.core(%tile23) { - aie.use_lock(%lock13_4, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock13_5, AcquireGreaterEqual, 1) // acquire input for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_4, AcquireGreaterEqual, %c1_ul0) // acquire input for read(e.g. input ping) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, AcquireGreaterEqual, %c1_ul1) // acquire input for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -44,14 +46,18 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, Release, 1) // release input for write - aie.use_lock(%lock13_6, Release, 1) // release output for read + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, Release, %c1_ul2) // release input for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, Release, %c1_ul3) // release output for read aie.end } %core23 = aie.core(%tile33) { - aie.use_lock(%lock13_6, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock23_7, AcquireGreaterEqual, 1) // acquire output for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, AcquireGreaterEqual, %c1_ul4) // acquire input for read(e.g. input ping) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock23_7, AcquireGreaterEqual, %c1_ul5) // acquire output for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf13_1[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -60,8 +66,10 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf23_0[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, Release, 1) // release input for write - aie.use_lock(%lock23_8, Release, 1) // release output for read + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, Release, %c1_ul6) // release input for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock23_8, Release, %c1_ul7) // release output for read aie.end } } diff --git a/test/unit_tests/aie2/05_shim_dma_core_function/aie.mlir b/test/unit_tests/aie2/05_shim_dma_core_function/aie.mlir index 68802c9042c..9b0daed25f7 100644 --- a/test/unit_tests/aie2/05_shim_dma_core_function/aie.mlir +++ b/test/unit_tests/aie2/05_shim_dma_core_function/aie.mlir @@ -37,17 +37,25 @@ module @test_chess_05_shim_dma_core_function { %step = arith.constant 1 : index scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_read, AcquireGreaterEqual, 1) // acquire for read - aie.use_lock(%lock_b_write, AcquireGreaterEqual, 1) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, AcquireGreaterEqual, %c1_ul0) // acquire for read + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, AcquireGreaterEqual, %c1_ul1) // acquire for write func.call @func(%buf_a_ping, %buf_b_ping) : (memref<16xi32>, memref<16xi32>) -> () - aie.use_lock(%lock_a_write, Release, 1) // release for write - aie.use_lock(%lock_b_read, Release, 1) // release for read + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, Release, %c1_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, Release, %c1_ul3) // release for read - aie.use_lock(%lock_a_read, AcquireGreaterEqual, 1) // acquire for read - aie.use_lock(%lock_b_write, AcquireGreaterEqual, 1) // acquire for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, AcquireGreaterEqual, %c1_ul4) // acquire for read + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, AcquireGreaterEqual, %c1_ul5) // acquire for write func.call @func(%buf_a_pong, %buf_b_pong) : (memref<16xi32>, memref<16xi32>) -> () - aie.use_lock(%lock_a_write, Release, 1) // release for write - aie.use_lock(%lock_b_read, Release, 1) // release for read + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, Release, %c1_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, Release, %c1_ul7) // release for read } aie.end @@ -59,24 +67,32 @@ module @test_chess_05_shim_dma_core_function { ^dma0: %dstDma = aie.dma_start("MM2S", 0, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buf_a_ping : memref<16xi32>, 0, 16) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%buf_a_pong : memref<16xi32>, 0, 16) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_read, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buf_b_ping : memref<16xi32>, 0, 16) - aie.use_lock(%lock_b_write, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, Release, %c1_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_read, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buf_b_pong : memref<16xi32>, 0, 16) - aie.use_lock(%lock_b_write, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, Release, %c1_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -100,14 +116,18 @@ module @test_chess_05_shim_dma_core_function { ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1_read, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1_read, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buffer_in : memref<32 x i32>, 0, 32) - aie.use_lock(%lock1_write, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock1_write, Release, %c1_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2_write, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2_write, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buffer_out : memref<32 x i32>, 0, 32) - aie.use_lock(%lock2_read, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock2_read, Release, %c1_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/aie2/07_shim_dma_core_function_with_loop/aie.mlir b/test/unit_tests/aie2/07_shim_dma_core_function_with_loop/aie.mlir index edf17cd9f20..83c28187025 100644 --- a/test/unit_tests/aie2/07_shim_dma_core_function_with_loop/aie.mlir +++ b/test/unit_tests/aie2/07_shim_dma_core_function_with_loop/aie.mlir @@ -43,17 +43,25 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ %c64 = arith.constant 64 : index scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_ping, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_ping, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c1_ul0) // acquire for read + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c0_ul1) // acquire for write func.call @func(%buf_a_ping, %buf_b_ping,%buffer_size) : (memref<64xi32>, memref<64xi32>,i32) -> () - aie.use_lock(%lock_a_ping, "Release", 0) // release for write - aie.use_lock(%lock_b_ping, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Release", %c1_ul3) // release for read - aie.use_lock(%lock_a_pong, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_pong, "Acquire", 0) // acquire for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c1_ul4) // acquire for read + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c0_ul5) // acquire for write func.call @func(%buf_a_pong, %buf_b_pong,%buffer_size) : (memref<64xi32>, memref<64xi32>,i32) -> () - aie.use_lock(%lock_a_pong, "Release", 0) // release for write - aie.use_lock(%lock_b_pong, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Release", %c1_ul7) // release for read } aie.end @@ -65,24 +73,32 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul8) aie.dma_bd(%buf_a_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_pong, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c0_ul10) aie.dma_bd(%buf_a_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_pong, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Release", %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_ping, "Acquire", 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c1_ul12) aie.dma_bd(%buf_b_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_ping, "Release", 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Release", %c0_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_pong, "Acquire", 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c1_ul14) aie.dma_bd(%buf_b_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_pong, "Release", 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Release", %c0_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -112,14 +128,18 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul16) aie.dma_bd(%buffer_in : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2, Acquire, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2, Acquire, %c1_ul18) aie.dma_bd(%buffer_out : memref<512 x i32>, 0, 512) - aie.use_lock(%lock2, Release, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock2, Release, %c0_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/aie2/08_tile_locks/aie.mlir b/test/unit_tests/aie2/08_tile_locks/aie.mlir index 451d829400d..6fef5fd099b 100644 --- a/test/unit_tests/aie2/08_tile_locks/aie.mlir +++ b/test/unit_tests/aie2/08_tile_locks/aie.mlir @@ -65,24 +65,32 @@ module @test_chess_08_tile_locks { ^dma1: %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_l : memref<256xi32>, 0, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf_l : memref<256xi32>, 4, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul3) aie.next_bd ^end ^bd2: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf_l : memref<256xi32>, 8, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul5) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf_l : memref<256xi32>, 12, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul7) aie.next_bd ^end ^end: aie.end diff --git a/test/unit_tests/aie2/09_memtile_locks/aie.mlir b/test/unit_tests/aie2/09_memtile_locks/aie.mlir index 76c8c9aa613..497c1205e63 100644 --- a/test/unit_tests/aie2/09_memtile_locks/aie.mlir +++ b/test/unit_tests/aie2/09_memtile_locks/aie.mlir @@ -54,9 +54,11 @@ module @test_chess_08_tile_locks { aie.memtile_dma(%t81) { %srcDma = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock_d2, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_e : memref<256xi32>, 0, 2) - aie.use_lock(%lock_s2, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, Release, %c1_ul1) aie.next_bd ^end ^end: aie.end @@ -67,24 +69,32 @@ module @test_chess_08_tile_locks { ^dma1: %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf_w : memref<256xi32>, 0, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul3) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf_w : memref<256xi32>, 4, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul5) aie.next_bd ^end ^bd2: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf_e : memref<256xi32>, 8, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul7) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buf_e : memref<256xi32>, 12, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul9) aie.next_bd ^end ^end: aie.end diff --git a/test/unit_tests/aie2/29_aie2_nd_dma_even_odd/aie.mlir b/test/unit_tests/aie2/29_aie2_nd_dma_even_odd/aie.mlir index d53f2cae1bd..9d0bdb62e09 100644 --- a/test/unit_tests/aie2/29_aie2_nd_dma_even_odd/aie.mlir +++ b/test/unit_tests/aie2/29_aie2_nd_dma_even_odd/aie.mlir @@ -59,7 +59,8 @@ module @tutorial_2b { scf.yield %cp : i32 } - aie.use_lock(%lock14_done, "Release", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock14_done, "Release", %c1_ul0) aie.end } @@ -77,12 +78,14 @@ module @tutorial_2b { %mem14 = aie.mem(%tile14) { %srcDma = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock14_done, "AcquireGreaterEqual", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock14_done, "AcquireGreaterEqual", %c1_ul1) ////////// new ////////// aie.dma_bd(%buf14 : memref<128xi32>, 0, 128, [, , ]) // w, s w, s w, s // dim 2, dim 1, dim 0 - aie.use_lock(%lock14_sent, "Release", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock14_sent, "Release", %c1_ul2) aie.next_bd ^end ^end: aie.end @@ -91,9 +94,11 @@ module @tutorial_2b { %mem34 = aie.mem(%tile34) { %dstDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock34_wait, "AcquireGreaterEqual", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock34_wait, "AcquireGreaterEqual", %c1_ul3) aie.dma_bd(%buf34 : memref<128xi32>, 0, 128) - aie.use_lock(%lock34_recv, "Release", 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock34_recv, "Release", %c1_ul4) aie.next_bd ^end ^end: aie.end diff --git a/test/unit_tests/aie2/30_aie2_nd_dma_transpose_repeat/aie.mlir b/test/unit_tests/aie2/30_aie2_nd_dma_transpose_repeat/aie.mlir index 2c2bd856359..502073e86bf 100644 --- a/test/unit_tests/aie2/30_aie2_nd_dma_transpose_repeat/aie.mlir +++ b/test/unit_tests/aie2/30_aie2_nd_dma_transpose_repeat/aie.mlir @@ -45,7 +45,8 @@ module @tutorial_2b { scf.yield %cp : i32 } - aie.use_lock(%lock14_done, "Release", 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock14_done, "Release", %c1_ul0) aie.end } @@ -57,12 +58,14 @@ module @tutorial_2b { %mem14 = aie.mem(%tile14) { %srcDma = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock14_done, "AcquireGreaterEqual", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock14_done, "AcquireGreaterEqual", %c1_ul1) ////////// new ////////// aie.dma_bd(%buf14 : memref<128xi32>, 0, 128, [, , ]) // w, s w, s w, s // dim 2, dim 1, dim 0 - aie.use_lock(%lock14_sent, "Release", 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock14_sent, "Release", %c1_ul2) aie.next_bd ^end ^end: aie.end @@ -71,9 +74,11 @@ module @tutorial_2b { %mem34 = aie.mem(%tile34) { %dstDma = aie.dma_start("S2MM", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock34_wait, "AcquireGreaterEqual", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock34_wait, "AcquireGreaterEqual", %c1_ul3) aie.dma_bd(%buf34 : memref<128xi32>, 0, 128) - aie.use_lock(%lock34_recv, "Release", 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock34_recv, "Release", %c1_ul4) aie.next_bd ^end ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests/01_precompiled_core_function/aie.mlir b/test/unit_tests/chess_compiler_tests/01_precompiled_core_function/aie.mlir index cfd6f369187..9f322473bae 100644 --- a/test/unit_tests/chess_compiler_tests/01_precompiled_core_function/aie.mlir +++ b/test/unit_tests/chess_compiler_tests/01_precompiled_core_function/aie.mlir @@ -29,11 +29,15 @@ aie.device(xcvc1902) { func.func private @func(%A: memref<256xi32>, %B: memref<256xi32>) -> () attributes {link_with = "kernel.o"} %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write func.call @func(%buf13_0, %buf13_1) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } diff --git a/test/unit_tests/chess_compiler_tests/03_cascade_core_functions/aie.mlir b/test/unit_tests/chess_compiler_tests/03_cascade_core_functions/aie.mlir index f233a4df727..02eb7b6c138 100644 --- a/test/unit_tests/chess_compiler_tests/03_cascade_core_functions/aie.mlir +++ b/test/unit_tests/chess_compiler_tests/03_cascade_core_functions/aie.mlir @@ -31,9 +31,11 @@ aie.device(xcvc1902) { func.func private @do_mac(%A: memref<256xi32>) -> () attributes {link_with = "kernel.o"} %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) func.call @do_mul(%buf13_0) : (memref<256xi32>) -> () - aie.use_lock(%lock13_3, "Release", 0) // release for write + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul1) // release for write aie.end } @@ -41,9 +43,11 @@ aie.device(xcvc1902) { // %val1 = arith.constant 7 : i32 // %idx1 = arith.constant 0 : index // memref.store %val1, %buf14_0[%idx1] : memref<256xi32> - aie.use_lock(%lock23_7, "Acquire", 0) // acquire for write + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock23_7, "Acquire", %c0_ul2) // acquire for write func.call @do_mac(%buf23_0) : (memref<256xi32>) -> () - aie.use_lock(%lock23_7, "Release", 1) // release for read + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock23_7, "Release", %c1_ul3) // release for read aie.end } diff --git a/test/unit_tests/chess_compiler_tests/04_shared_memory/aie.mlir b/test/unit_tests/chess_compiler_tests/04_shared_memory/aie.mlir index 980a99c9d70..caa2741b130 100644 --- a/test/unit_tests/chess_compiler_tests/04_shared_memory/aie.mlir +++ b/test/unit_tests/chess_compiler_tests/04_shared_memory/aie.mlir @@ -29,8 +29,10 @@ aie.device(xcvc1902) { %lock14_7 = aie.lock(%tile14, 7) { sym_name = "output_lock" } // output buffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -39,14 +41,18 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } %core14 = aie.core(%tile14) { - aie.use_lock(%lock13_5, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock14_7, "Acquire", 0) // acquire for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Acquire", %c1_ul4) // acquire for read(e.g. input ping) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock14_7, "Acquire", %c0_ul5) // acquire for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf13_1[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -55,8 +61,10 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf14_0[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, "Release", 0) // release for write - aie.use_lock(%lock14_7, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock14_7, "Release", %c1_ul7) // release for read aie.end } diff --git a/test/unit_tests/chess_compiler_tests/04_shared_memory/aie_row.mlir b/test/unit_tests/chess_compiler_tests/04_shared_memory/aie_row.mlir index 9a21cd7bbf0..5cf29527f3e 100644 --- a/test/unit_tests/chess_compiler_tests/04_shared_memory/aie_row.mlir +++ b/test/unit_tests/chess_compiler_tests/04_shared_memory/aie_row.mlir @@ -31,8 +31,10 @@ aie.device(xcvc1902) { %lock33_7 = aie.lock(%tile33, 7) { sym_name = "output_lock" } // output buffer lock %core13 = aie.core(%tile23) { - aie.use_lock(%lock23_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock23_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock23_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock23_5, "Acquire", %c0_ul1) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -41,15 +43,19 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock23_3, "Release", 0) // release for write - aie.use_lock(%lock23_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock23_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock23_5, "Release", %c1_ul3) // release for read aie.end } %core33 = aie.core(%tile33) { - aie.use_lock(%lock23_5, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock33_7, "Acquire", 0) // acquire for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock23_5, "Acquire", %c1_ul4) // acquire for read(e.g. input ping) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock33_7, "Acquire", %c0_ul5) // acquire for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_1[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -58,8 +64,10 @@ aie.device(xcvc1902) { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf33_0[%idx2] : memref<256xi32> - aie.use_lock(%lock23_5, "Release", 0) // release for write - aie.use_lock(%lock33_7, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock23_5, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock33_7, "Release", %c1_ul7) // release for read aie.end } diff --git a/test/unit_tests/chess_compiler_tests/04_shim_dma_kernel/aie.mlir b/test/unit_tests/chess_compiler_tests/04_shim_dma_kernel/aie.mlir index 39d30cdf898..ab8d8dc47d6 100644 --- a/test/unit_tests/chess_compiler_tests/04_shim_dma_kernel/aie.mlir +++ b/test/unit_tests/chess_compiler_tests/04_shim_dma_kernel/aie.mlir @@ -41,24 +41,32 @@ aie.device(xcvc1902) { ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul0) aie.dma_bd(%buf_a_ping : memref<256xi32>, 0, 256) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_pong, "Acquire", 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c0_ul2) aie.dma_bd(%buf_a_pong : memref<256xi32>, 0, 256) - aie.use_lock(%lock_a_pong, "Release", 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Release", %c1_ul3) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_ping, "Acquire", 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c1_ul4) aie.dma_bd(%buf_b_ping : memref<256xi32>, 0, 256) - aie.use_lock(%lock_b_ping, "Release", 0) + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Release", %c0_ul5) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_pong, "Acquire", 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c1_ul6) aie.dma_bd(%buf_b_pong : memref<256xi32>, 0, 256) - aie.use_lock(%lock_b_pong, "Release", 0) + %c0_ul7 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Release", %c0_ul7) aie.next_bd ^bd2 ^end: aie.end @@ -80,14 +88,18 @@ aie.device(xcvc1902) { ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul8) aie.dma_bd(%buffer_in : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul9 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul9) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2, Acquire, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock2, Acquire, %c1_ul10) aie.dma_bd(%buffer_out : memref<512 x i32>, 0, 512) - aie.use_lock(%lock2, Release, 0) + %c0_ul11 = arith.constant 0 : i32 + aie.use_lock(%lock2, Release, %c0_ul11) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests/05_shim_dma_core_function/aie.mlir b/test/unit_tests/chess_compiler_tests/05_shim_dma_core_function/aie.mlir index 6bde470832d..059111118af 100644 --- a/test/unit_tests/chess_compiler_tests/05_shim_dma_core_function/aie.mlir +++ b/test/unit_tests/chess_compiler_tests/05_shim_dma_core_function/aie.mlir @@ -43,17 +43,25 @@ aie.device(xcvc1902) { scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_ping, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_ping, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c1_ul0) // acquire for read + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c0_ul1) // acquire for write func.call @func(%buf_a_ping, %buf_b_ping) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock_a_ping, "Release", 0) // release for write - aie.use_lock(%lock_b_ping, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Release", %c1_ul3) // release for read - aie.use_lock(%lock_a_pong, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_pong, "Acquire", 0) // acquire for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c1_ul4) // acquire for read + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c0_ul5) // acquire for write func.call @func(%buf_a_pong, %buf_b_pong) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock_a_pong, "Release", 0) // release for write - aie.use_lock(%lock_b_pong, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Release", %c1_ul7) // release for read } @@ -66,24 +74,32 @@ aie.device(xcvc1902) { ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul8) aie.dma_bd(%buf_a_ping : memref<256xi32>, 0, 256) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_pong, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c0_ul10) aie.dma_bd(%buf_a_pong : memref<256xi32>, 0, 256) - aie.use_lock(%lock_a_pong, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Release", %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_ping, "Acquire", 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c1_ul12) aie.dma_bd(%buf_b_ping : memref<256xi32>, 0, 256) - aie.use_lock(%lock_b_ping, "Release", 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Release", %c0_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_pong, "Acquire", 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c1_ul14) aie.dma_bd(%buf_b_pong : memref<256xi32>, 0, 256) - aie.use_lock(%lock_b_pong, "Release", 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Release", %c0_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -105,14 +121,18 @@ aie.device(xcvc1902) { ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul16) aie.dma_bd(%buffer_in : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2, Acquire, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2, Acquire, %c1_ul18) aie.dma_bd(%buffer_out : memref<512 x i32>, 0, 512) - aie.use_lock(%lock2, Release, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock2, Release, %c0_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests/07_shim_dma_core_function_with_loop/aie.mlir b/test/unit_tests/chess_compiler_tests/07_shim_dma_core_function_with_loop/aie.mlir index c9307b47330..90b6e89dccb 100644 --- a/test/unit_tests/chess_compiler_tests/07_shim_dma_core_function_with_loop/aie.mlir +++ b/test/unit_tests/chess_compiler_tests/07_shim_dma_core_function_with_loop/aie.mlir @@ -52,17 +52,25 @@ aie.device(xcvc1902) { %c64 = arith.constant 64 : index scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_ping, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_ping, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c1_ul0) // acquire for read + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c0_ul1) // acquire for write func.call @func(%buf_a_ping, %buf_b_ping,%buffer_size) : (memref<64xi32>, memref<64xi32>,i32) -> () - aie.use_lock(%lock_a_ping, "Release", 0) // release for write - aie.use_lock(%lock_b_ping, "Release", 1) // release for read - - aie.use_lock(%lock_a_pong, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_pong, "Acquire", 0) // acquire for write + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Release", %c1_ul3) // release for read + + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c1_ul4) // acquire for read + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c0_ul5) // acquire for write func.call @func(%buf_a_pong, %buf_b_pong,%buffer_size) : (memref<64xi32>, memref<64xi32>,i32) -> () - aie.use_lock(%lock_a_pong, "Release", 0) // release for write - aie.use_lock(%lock_b_pong, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Release", %c1_ul7) // release for read } aie.end @@ -74,24 +82,32 @@ aie.device(xcvc1902) { ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul8) aie.dma_bd(%buf_a_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_pong, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c0_ul10) aie.dma_bd(%buf_a_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_pong, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Release", %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_ping, "Acquire", 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c1_ul12) aie.dma_bd(%buf_b_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_ping, "Release", 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Release", %c0_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_pong, "Acquire", 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c1_ul14) aie.dma_bd(%buf_b_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_pong, "Release", 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Release", %c0_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -113,14 +129,18 @@ aie.device(xcvc1902) { ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul16) aie.dma_bd(%buffer_in : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2, Acquire, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2, Acquire, %c1_ul18) aie.dma_bd(%buffer_out : memref<512 x i32>, 0, 512) - aie.use_lock(%lock2, Release, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock2, Release, %c0_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests/08_tile_locks/aie.mlir b/test/unit_tests/chess_compiler_tests/08_tile_locks/aie.mlir index cf9d4f8806e..e3ddcddd3e5 100644 --- a/test/unit_tests/chess_compiler_tests/08_tile_locks/aie.mlir +++ b/test/unit_tests/chess_compiler_tests/08_tile_locks/aie.mlir @@ -40,24 +40,32 @@ aie.device(xcvc1902) { ^dma1: %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_e, Acquire, 0) + %c0_ul0 = arith.constant 0 : i32 + aie.use_lock(%lock_e, Acquire, %c0_ul0) aie.dma_bd(%buf_l : memref<256xi32>, 0, 2) - aie.use_lock(%lock_e, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_e, Release, %c1_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_l, Acquire, 0) + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_l, Acquire, %c0_ul2) aie.dma_bd(%buf_l : memref<256xi32>, 4, 2) - aie.use_lock(%lock_l, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_l, Release, %c1_ul3) aie.next_bd ^end ^bd2: - aie.use_lock(%lock_n, Acquire, 0) + %c0_ul4 = arith.constant 0 : i32 + aie.use_lock(%lock_n, Acquire, %c0_ul4) aie.dma_bd(%buf_l : memref<256xi32>, 8, 2) - aie.use_lock(%lock_n, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_n, Release, %c1_ul5) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_s, Acquire, 0) + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock_s, Acquire, %c0_ul6) aie.dma_bd(%buf_l : memref<256xi32>, 12, 2) - aie.use_lock(%lock_s, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_s, Release, %c1_ul7) aie.next_bd ^end ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests_aie2/01_precompiled_core_function/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/01_precompiled_core_function/aie.mlir index 5764001ad22..d8f091dd30b 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/01_precompiled_core_function/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/01_precompiled_core_function/aie.mlir @@ -28,11 +28,15 @@ module @test_chesss_01_precompiled_core_function { func.func private @func(%A: memref<256xi32>, %B: memref<256xi32>) -> () attributes {link_with = "kernel.o"} %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, "Acquire", 1) // acquire for read(e.g. input ping) - aie.use_lock(%lock13_5, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, "Acquire", %c1_ul0) // acquire for read(e.g. input ping) + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock13_5, "Acquire", %c0_ul1) // acquire for write func.call @func(%buf13_0, %buf13_1) : (memref<256xi32>, memref<256xi32>) -> () - aie.use_lock(%lock13_3, "Release", 0) // release for write - aie.use_lock(%lock13_5, "Release", 1) // release for read + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock13_3, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, "Release", %c1_ul3) // release for read aie.end } } diff --git a/test/unit_tests/chess_compiler_tests_aie2/03_cascade_core_functions/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/03_cascade_core_functions/aie.mlir index 8c5ff785666..aa2c97118b7 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/03_cascade_core_functions/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/03_cascade_core_functions/aie.mlir @@ -30,7 +30,8 @@ module { func.func private @do_mac(%A: memref<256xi32>) -> () attributes {link_with = "kernel.o"} %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, AcquireGreaterEqual, 1) // acquire for read(e.g. input ping) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, AcquireGreaterEqual, %c1_ul0) // acquire for read(e.g. input ping) func.call @do_mul(%buf13_0) : (memref<256xi32>) -> () aie.end } @@ -40,7 +41,8 @@ module { // %idx1 = arith.constant 0 : index // memref.store %val1, %buf14_0[%idx1] : memref<256xi32> func.call @do_mac(%buf23_0) : (memref<256xi32>) -> () - aie.use_lock(%lock23_7, Release, 1) // release for read + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock23_7, Release, %c1_ul1) // release for read aie.end } } diff --git a/test/unit_tests/chess_compiler_tests_aie2/03_simple/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/03_simple/aie.mlir index 8034026bbf3..7e7f97a731b 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/03_simple/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/03_simple/aie.mlir @@ -27,7 +27,8 @@ module @test04_shared_memory { %lock13_5 = aie.lock(%tile13, 5) { sym_name = "output_lock" } // output buffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_3, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, AcquireGreaterEqual, %c1_ul0) %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -36,7 +37,8 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, Release, %c1_ul1) aie.end } } diff --git a/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie.mlir index 302ea4bab18..e11e0a3ff2b 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie.mlir @@ -35,8 +35,10 @@ module @test04_shared_memory { %lock14_8 = aie.lock(%tile14, 8) { sym_name = "output_read_lock" } // output buffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_4, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock13_5, AcquireGreaterEqual, 1) // acquire input for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_4, AcquireGreaterEqual, %c1_ul0) // acquire input for read(e.g. input ping) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, AcquireGreaterEqual, %c1_ul1) // acquire input for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -45,14 +47,18 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, Release, 1) // release input for write - aie.use_lock(%lock13_6, Release, 1) // release output for read + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, Release, %c1_ul2) // release input for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, Release, %c1_ul3) // release output for read aie.end } %core14 = aie.core(%tile14) { - aie.use_lock(%lock13_6, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock14_7, AcquireGreaterEqual, 1) // acquire output for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, AcquireGreaterEqual, %c1_ul4) // acquire input for read(e.g. input ping) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock14_7, AcquireGreaterEqual, %c1_ul5) // acquire output for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf13_1[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -61,8 +67,10 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf14_0[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, Release, 1) // release input for write - aie.use_lock(%lock14_8, Release, 1) // release output for read + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, Release, %c1_ul6) // release input for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock14_8, Release, %c1_ul7) // release output for read aie.end } } diff --git a/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie_row.mlir b/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie_row.mlir index a44d8da394a..cec1753e204 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie_row.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/04_shared_memory/aie_row.mlir @@ -35,8 +35,10 @@ module @test04_shared_memory { %lock23_8 = aie.lock(%tile23, 8) { sym_name = "output_read_lock" } // output buffer lock %core13 = aie.core(%tile13) { - aie.use_lock(%lock13_4, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock13_5, AcquireGreaterEqual, 1) // acquire input for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock13_4, AcquireGreaterEqual, %c1_ul0) // acquire input for read(e.g. input ping) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, AcquireGreaterEqual, %c1_ul1) // acquire input for write %idx1 = arith.constant 3 : index %val1 = memref.load %buf13_0[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -45,14 +47,18 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf13_1[%idx2] : memref<256xi32> - aie.use_lock(%lock13_3, Release, 1) // release input for write - aie.use_lock(%lock13_6, Release, 1) // release output for read + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock13_3, Release, %c1_ul2) // release input for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, Release, %c1_ul3) // release output for read aie.end } %core23 = aie.core(%tile23) { - aie.use_lock(%lock13_6, AcquireGreaterEqual, 1) // acquire input for read(e.g. input ping) - aie.use_lock(%lock23_7, AcquireGreaterEqual, 1) // acquire output for write + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock13_6, AcquireGreaterEqual, %c1_ul4) // acquire input for read(e.g. input ping) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock23_7, AcquireGreaterEqual, %c1_ul5) // acquire output for write %idx1 = arith.constant 5 : index %val1 = memref.load %buf13_1[%idx1] : memref<256xi32> %2 = arith.addi %val1, %val1 : i32 @@ -61,8 +67,10 @@ module @test04_shared_memory { %5 = arith.addi %4, %val1 : i32 %idx2 = arith.constant 5 : index memref.store %5, %buf23_0[%idx2] : memref<256xi32> - aie.use_lock(%lock13_5, Release, 1) // release input for write - aie.use_lock(%lock23_8, Release, 1) // release output for read + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock13_5, Release, %c1_ul6) // release input for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock23_8, Release, %c1_ul7) // release output for read aie.end } } diff --git a/test/unit_tests/chess_compiler_tests_aie2/04_shim_dma_kernel/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/04_shim_dma_kernel/aie.mlir index 436d95e6197..bde977aff9b 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/04_shim_dma_kernel/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/04_shim_dma_kernel/aie.mlir @@ -43,24 +43,32 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_a_ping : memref<16xi32>, 0, 16) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf_a_pong : memref<16xi32>, 0, 16) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul3) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_read, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf_b_ping : memref<16xi32>, 0, 16) - aie.use_lock(%lock_b_write, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, Release, %c1_ul5) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_read, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf_b_pong : memref<16xi32>, 0, 16) - aie.use_lock(%lock_b_write, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, Release, %c1_ul7) aie.next_bd ^bd2 ^end: aie.end @@ -84,14 +92,18 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1_read, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock1_read, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buffer_in : memref<32 x i32>, 0, 32) - aie.use_lock(%lock1_write, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock1_write, Release, %c1_ul9) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2_write, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock2_write, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%buffer_out : memref<32 x i32>, 0, 32) - aie.use_lock(%lock2_read, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock2_read, Release, %c1_ul11) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests_aie2/05_shim_dma_core_function/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/05_shim_dma_core_function/aie.mlir index 10f77bbb57f..8a3e06c552c 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/05_shim_dma_core_function/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/05_shim_dma_core_function/aie.mlir @@ -44,17 +44,25 @@ module @test_chess_05_shim_dma_core_function { %step = arith.constant 1 : index scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_read, AcquireGreaterEqual, 1) // acquire for read - aie.use_lock(%lock_b_write, AcquireGreaterEqual, 1) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, AcquireGreaterEqual, %c1_ul0) // acquire for read + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, AcquireGreaterEqual, %c1_ul1) // acquire for write func.call @func(%buf_a_ping, %buf_b_ping) : (memref<16xi32>, memref<16xi32>) -> () - aie.use_lock(%lock_a_write, Release, 1) // release for write - aie.use_lock(%lock_b_read, Release, 1) // release for read - - aie.use_lock(%lock_a_read, AcquireGreaterEqual, 1) // acquire for read - aie.use_lock(%lock_b_write, AcquireGreaterEqual, 1) // acquire for write + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, Release, %c1_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, Release, %c1_ul3) // release for read + + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, AcquireGreaterEqual, %c1_ul4) // acquire for read + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, AcquireGreaterEqual, %c1_ul5) // acquire for write func.call @func(%buf_a_pong, %buf_b_pong) : (memref<16xi32>, memref<16xi32>) -> () - aie.use_lock(%lock_a_write, Release, 1) // release for write - aie.use_lock(%lock_b_read, Release, 1) // release for read + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, Release, %c1_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, Release, %c1_ul7) // release for read } aie.end @@ -66,24 +74,32 @@ module @test_chess_05_shim_dma_core_function { ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buf_a_ping : memref<16xi32>, 0, 16) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_write, AcquireGreaterEqual, 1) + %c1_ul10 = arith.constant 1 : i32 + aie.use_lock(%lock_a_write, AcquireGreaterEqual, %c1_ul10) aie.dma_bd(%buf_a_pong : memref<16xi32>, 0, 16) - aie.use_lock(%lock_a_read, Release, 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_read, Release, %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_read, AcquireGreaterEqual, 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, AcquireGreaterEqual, %c1_ul12) aie.dma_bd(%buf_b_ping : memref<16xi32>, 0, 16) - aie.use_lock(%lock_b_write, Release, 1) + %c1_ul13 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, Release, %c1_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_read, AcquireGreaterEqual, 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_read, AcquireGreaterEqual, %c1_ul14) aie.dma_bd(%buf_b_pong : memref<16xi32>, 0, 16) - aie.use_lock(%lock_b_write, Release, 1) + %c1_ul15 = arith.constant 1 : i32 + aie.use_lock(%lock_b_write, Release, %c1_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -107,14 +123,18 @@ module @test_chess_05_shim_dma_core_function { ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1_read, AcquireGreaterEqual, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1_read, AcquireGreaterEqual, %c1_ul16) aie.dma_bd(%buffer_in : memref<32 x i32>, 0, 32) - aie.use_lock(%lock1_write, Release, 1) + %c1_ul17 = arith.constant 1 : i32 + aie.use_lock(%lock1_write, Release, %c1_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2_write, AcquireGreaterEqual, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2_write, AcquireGreaterEqual, %c1_ul18) aie.dma_bd(%buffer_out : memref<32 x i32>, 0, 32) - aie.use_lock(%lock2_read, Release, 1) + %c1_ul19 = arith.constant 1 : i32 + aie.use_lock(%lock2_read, Release, %c1_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests_aie2/07_shim_dma_core_function_with_loop/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/07_shim_dma_core_function_with_loop/aie.mlir index df0a6655493..4a98c0abb13 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/07_shim_dma_core_function_with_loop/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/07_shim_dma_core_function_with_loop/aie.mlir @@ -48,17 +48,25 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ %c64 = arith.constant 64 : index scf.for %iv = %lb to %ub step %step { - aie.use_lock(%lock_a_ping, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_ping, "Acquire", 0) // acquire for write + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c1_ul0) // acquire for read + %c0_ul1 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c0_ul1) // acquire for write func.call @func(%buf_a_ping, %buf_b_ping,%buffer_size) : (memref<64xi32>, memref<64xi32>,i32) -> () - aie.use_lock(%lock_a_ping, "Release", 0) // release for write - aie.use_lock(%lock_b_ping, "Release", 1) // release for read - - aie.use_lock(%lock_a_pong, "Acquire", 1) // acquire for read - aie.use_lock(%lock_b_pong, "Acquire", 0) // acquire for write + %c0_ul2 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Release", %c0_ul2) // release for write + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Release", %c1_ul3) // release for read + + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c1_ul4) // acquire for read + %c0_ul5 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c0_ul5) // acquire for write func.call @func(%buf_a_pong, %buf_b_pong,%buffer_size) : (memref<64xi32>, memref<64xi32>,i32) -> () - aie.use_lock(%lock_a_pong, "Release", 0) // release for write - aie.use_lock(%lock_b_pong, "Release", 1) // release for read + %c0_ul6 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Release", %c0_ul6) // release for write + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Release", %c1_ul7) // release for read } aie.end @@ -70,24 +78,32 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ ^dma0: %dstDma = aie.dma_start("MM2S", 1, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_a_ping, "Acquire", 0) + %c0_ul8 = arith.constant 0 : i32 + aie.use_lock(%lock_a_ping, "Acquire", %c0_ul8) aie.dma_bd(%buf_a_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_ping, "Release", 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_a_ping, "Release", %c1_ul9) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_a_pong, "Acquire", 0) + %c0_ul10 = arith.constant 0 : i32 + aie.use_lock(%lock_a_pong, "Acquire", %c0_ul10) aie.dma_bd(%buf_a_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_a_pong, "Release", 1) + %c1_ul11 = arith.constant 1 : i32 + aie.use_lock(%lock_a_pong, "Release", %c1_ul11) aie.next_bd ^bd0 ^bd2: - aie.use_lock(%lock_b_ping, "Acquire", 1) + %c1_ul12 = arith.constant 1 : i32 + aie.use_lock(%lock_b_ping, "Acquire", %c1_ul12) aie.dma_bd(%buf_b_ping : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_ping, "Release", 0) + %c0_ul13 = arith.constant 0 : i32 + aie.use_lock(%lock_b_ping, "Release", %c0_ul13) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_b_pong, "Acquire", 1) + %c1_ul14 = arith.constant 1 : i32 + aie.use_lock(%lock_b_pong, "Acquire", %c1_ul14) aie.dma_bd(%buf_b_pong : memref<64xi32>, 0, 64) - aie.use_lock(%lock_b_pong, "Release", 0) + %c0_ul15 = arith.constant 0 : i32 + aie.use_lock(%lock_b_pong, "Release", %c0_ul15) aie.next_bd ^bd2 ^end: aie.end @@ -117,14 +133,18 @@ module @test_chess_04_deprecated_shim_dma_precompiled_kernel{ ^dma: aie.dma_start(S2MM, 0, ^bd1, ^end) ^bd0: - aie.use_lock(%lock1, Acquire, 1) + %c1_ul16 = arith.constant 1 : i32 + aie.use_lock(%lock1, Acquire, %c1_ul16) aie.dma_bd(%buffer_in : memref<512 x i32>, 0, 512) - aie.use_lock(%lock1, Release, 0) + %c0_ul17 = arith.constant 0 : i32 + aie.use_lock(%lock1, Release, %c0_ul17) aie.next_bd ^bd0 ^bd1: - aie.use_lock(%lock2, Acquire, 1) + %c1_ul18 = arith.constant 1 : i32 + aie.use_lock(%lock2, Acquire, %c1_ul18) aie.dma_bd(%buffer_out : memref<512 x i32>, 0, 512) - aie.use_lock(%lock2, Release, 0) + %c0_ul19 = arith.constant 0 : i32 + aie.use_lock(%lock2, Release, %c0_ul19) aie.next_bd ^bd1 ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests_aie2/08_tile_locks/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/08_tile_locks/aie.mlir index d24371baea8..9dc721fe554 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/08_tile_locks/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/08_tile_locks/aie.mlir @@ -37,24 +37,32 @@ module @test_chess_08_tile_locks { ^dma1: %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_l : memref<256xi32>, 0, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul1) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf_l : memref<256xi32>, 4, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul3) aie.next_bd ^end ^bd2: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf_l : memref<256xi32>, 8, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul5) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf_l : memref<256xi32>, 12, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul7) aie.next_bd ^end ^end: aie.end diff --git a/test/unit_tests/chess_compiler_tests_aie2/09_memtile_locks/aie.mlir b/test/unit_tests/chess_compiler_tests_aie2/09_memtile_locks/aie.mlir index 36e8623d3d5..8ed56caca04 100644 --- a/test/unit_tests/chess_compiler_tests_aie2/09_memtile_locks/aie.mlir +++ b/test/unit_tests/chess_compiler_tests_aie2/09_memtile_locks/aie.mlir @@ -34,9 +34,11 @@ module @test_chess_08_tile_locks { aie.memtile_dma(%t81) { %srcDma = aie.dma_start("MM2S", 0, ^bd0, ^end) ^bd0: - aie.use_lock(%lock_d2, AcquireGreaterEqual, 1) + %c1_ul0 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, AcquireGreaterEqual, %c1_ul0) aie.dma_bd(%buf_e : memref<256xi32>, 0, 2) - aie.use_lock(%lock_s2, Release, 1) + %c1_ul1 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, Release, %c1_ul1) aie.next_bd ^end ^end: aie.end @@ -47,24 +49,32 @@ module @test_chess_08_tile_locks { ^dma1: %dstDma = aie.dma_start("S2MM", 0, ^bd2, ^end) ^bd0: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul2 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul2) aie.dma_bd(%buf_w : memref<256xi32>, 0, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul3 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul3) aie.next_bd ^bd1 ^bd1: - aie.use_lock(%lock_s1, AcquireGreaterEqual, 1) + %c1_ul4 = arith.constant 1 : i32 + aie.use_lock(%lock_s1, AcquireGreaterEqual, %c1_ul4) aie.dma_bd(%buf_w : memref<256xi32>, 4, 2) - aie.use_lock(%lock_d1, Release, 1) + %c1_ul5 = arith.constant 1 : i32 + aie.use_lock(%lock_d1, Release, %c1_ul5) aie.next_bd ^end ^bd2: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul6 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul6) aie.dma_bd(%buf_e : memref<256xi32>, 8, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul7 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul7) aie.next_bd ^bd3 ^bd3: - aie.use_lock(%lock_s2, AcquireGreaterEqual, 1) + %c1_ul8 = arith.constant 1 : i32 + aie.use_lock(%lock_s2, AcquireGreaterEqual, %c1_ul8) aie.dma_bd(%buf_e : memref<256xi32>, 12, 2) - aie.use_lock(%lock_d2, Release, 1) + %c1_ul9 = arith.constant 1 : i32 + aie.use_lock(%lock_d2, Release, %c1_ul9) aie.next_bd ^end ^end: aie.end From 853cd95c4dd779bc93d8a62ff5bdd56311c759af Mon Sep 17 00:00:00 2001 From: andrej Date: Fri, 10 Jul 2026 15:31:29 -0600 Subject: [PATCH 3/9] fix conv1x1 stack overflow and conv3x3 buffer overrun --- programming_examples/ml/bottleneck/bottleneck.py | 7 ++++--- programming_examples/ml/resnet/layers_conv2_x/resnet.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/programming_examples/ml/bottleneck/bottleneck.py b/programming_examples/ml/bottleneck/bottleneck.py index e26fdce0235..acbf04e8674 100644 --- a/programming_examples/ml/bottleneck/bottleneck.py +++ b/programming_examples/ml/bottleneck/bottleneck.py @@ -130,6 +130,7 @@ def conv1x1_fn(of_wts, of_act_in, of_act_out, conv1x1): Worker( conv1x1_fn, fn_args=[wts_buf_00.cons(), of_act_l3l2.cons(), of_act_2_3_5.prod(), conv1], + stack_size=0x1000, ) ) @@ -147,7 +148,7 @@ def conv3x3_fn(of_wts, of_act_in, of_act_out, conv3x3, channel_offset): elem_out, tensor_w, l2_in_c, - l2_out_c, + l2_out_c // 2, 3, 3, 0, @@ -168,7 +169,7 @@ def conv3x3_fn(of_wts, of_act_in, of_act_out, conv3x3, channel_offset): elem_out, tensor_w, l2_in_c, - l2_out_c, + l2_out_c // 2, 3, 3, 1, @@ -189,7 +190,7 @@ def conv3x3_fn(of_wts, of_act_in, of_act_out, conv3x3, channel_offset): elem_out, tensor_w, l2_in_c, - l2_out_c, + l2_out_c // 2, 3, 3, 2, diff --git a/programming_examples/ml/resnet/layers_conv2_x/resnet.py b/programming_examples/ml/resnet/layers_conv2_x/resnet.py index e2271c51d56..655f81edf24 100644 --- a/programming_examples/ml/resnet/layers_conv2_x/resnet.py +++ b/programming_examples/ml/resnet/layers_conv2_x/resnet.py @@ -397,6 +397,7 @@ def conv1_skip_fn( i, ], tile=cores[i][0], + stack_size=0x1000, ) ) workers.append( From f811ad74a3081383b7ebb7f2f25ae9d3260cc9c7 Mon Sep 17 00:00:00 2001 From: andrej Date: Fri, 10 Jul 2026 15:44:43 -0600 Subject: [PATCH 4/9] address comments --- include/aie/Dialect/AIE/IR/AIEOps.td | 2 +- lib/Dialect/AIE/IR/AIEDialect.cpp | 83 +++------------------------- 2 files changed, 8 insertions(+), 77 deletions(-) diff --git a/include/aie/Dialect/AIE/IR/AIEOps.td b/include/aie/Dialect/AIE/IR/AIEOps.td index a6db0e8f29a..bdcf3d9b01f 100644 --- a/include/aie/Dialect/AIE/IR/AIEOps.td +++ b/include/aie/Dialect/AIE/IR/AIEOps.td @@ -1394,7 +1394,7 @@ def AIE_UseLockOp: AIE_Op<"use_lock", []> { ); let assemblyFormat = [{ - `(` $lock `,` custom($action, $value, $blocking) `)` attr-dict + `(` $lock `,` $action `,` $value (`,` $blocking^)? `)` attr-dict }]; let hasVerifier = 1; diff --git a/lib/Dialect/AIE/IR/AIEDialect.cpp b/lib/Dialect/AIE/IR/AIEDialect.cpp index 69212c20f9f..eadd9f24723 100644 --- a/lib/Dialect/AIE/IR/AIEDialect.cpp +++ b/lib/Dialect/AIE/IR/AIEDialect.cpp @@ -75,13 +75,9 @@ struct AIEDialectFoldInterface : DialectFoldInterface { // them with a core's identical constants, which would leave the core // referencing a device-level value that is erased when the core is // outlined. - // - aie.mem/aie.memtile_dma/aie.shim_dma bodies carry constant lock values - // (aie.use_lock operands). If these hoisted to the device, CSE would - // merge them with the identical constant kept local to a core, and since - // the device-level constant dominates the core, the core's use would be - // rewritten to reference it -- reintroducing the cross-region reference - // that breaks core outlining. Keeping them local avoids the dominating - // device-level duplicate entirely. + // - Make sure SSA values for aie.use_lock operands in + // aie.mem/aie.memtile_dma/aie.shim_dma bodies do not get + // hoisted. return isa( region->getParentOp()); } @@ -2689,10 +2685,8 @@ LogicalResult LockOp::verify() { return success(); } -// Centralized lookup for the compile-time constant lock value: returns the -// integer if `op`'s value operand is defined by an arith.constant, otherwise -// std::nullopt. This is the single place that knows how a static lock value is -// recovered from the SSA operand. +// Look up for compile-time constant lock values, if any. +// Returns std::nullopt if lock value does not reference an `arith.constant`. static std::optional getConstantLockValue(UseLockOp op) { if (auto constant = op.getValue().getDefiningOp()) if (auto intAttr = llvm::dyn_cast(constant.getValue())) @@ -2763,8 +2757,8 @@ LogicalResult UseLockOp::verify() { return (*this)->emitOpError( "AcquireGreaterEqual is not supported in AIE1."); - // Locks used inside a DMA/BD block are configured via MMIO and therefore - // require a compile-time constant value (an arith.constant operand). + // Locks used inside a DMA/BD block are configured via static register writes + // and therefore require a compile-time constant value. if (HasSomeParent::verifyTrait(*this) .succeeded() && !getConstantLockValue(*this)) @@ -2857,69 +2851,6 @@ static void printTraceRegValue(OpAsmPrinter &printer, Operation *op, } // Helper to parse a LockBlocking enum keyword. -static ParseResult parseLockBlockingKeyword(OpAsmParser &parser, - xilinx::AIE::LockBlockingAttr &blocking) { - StringRef keyword; - if (parser.parseKeyword(&keyword)) - return failure(); - auto symbol = xilinx::AIE::symbolizeLockBlocking(keyword); - if (!symbol) - return parser.emitError(parser.getCurrentLocation()) - << "invalid lock blocking value: " << keyword; - blocking = - xilinx::AIE::LockBlockingAttr::get(parser.getContext(), *symbol); - return success(); -} - -// Custom parser for the value slot of aie.use_lock. The lock value is a -// required `i32` SSA operand, optionally followed by a `blocking` keyword. The -// action keyword is parsed here as well so that the printed form has no stray -// space before the comma. -static ParseResult -parseUseLockValue(OpAsmParser &parser, xilinx::AIE::LockActionAttr &action, - OpAsmParser::UnresolvedOperand &value, - xilinx::AIE::LockBlockingAttr &blocking) { - // The action is accepted either as a bare keyword (`Acquire`) or, for - // backward compatibility with older textual IR, as a quoted string - // (`"Acquire"`). - StringRef actionKeyword; - std::string actionString; - if (succeeded(parser.parseOptionalKeyword(&actionKeyword))) { - // Parsed a bare keyword. - } else if (succeeded(parser.parseOptionalString(&actionString))) { - actionKeyword = actionString; - } else { - return parser.emitError(parser.getCurrentLocation()) - << "expected lock action keyword"; - } - auto actionSymbol = xilinx::AIE::symbolizeLockAction(actionKeyword); - if (!actionSymbol) - return parser.emitError(parser.getCurrentLocation()) - << "invalid lock action: " << actionKeyword; - action = xilinx::AIE::LockActionAttr::get(parser.getContext(), *actionSymbol); - - // The lock value SSA operand. - if (parser.parseComma() || parser.parseOperand(value)) - return failure(); - - // Optionally parse a trailing blocking keyword. - if (!parser.parseOptionalComma()) - return parseLockBlockingKeyword(parser, blocking); - return success(); -} - -// Custom printer for the value slot of aie.use_lock. -static void printUseLockValue(OpAsmPrinter &printer, Operation *op, - xilinx::AIE::LockActionAttr action, Value value, - xilinx::AIE::LockBlockingAttr blocking) { - printer << xilinx::AIE::stringifyLockAction(action.getValue()); - printer << ", "; - printer.printOperand(value); - if (blocking) - printer << ", " - << xilinx::AIE::stringifyLockBlocking(blocking.getValue()); -} - #define GET_OP_CLASSES #include "aie/Dialect/AIE/IR/AIEOps.cpp.inc" From 1f71463413a994cb226bf7951497830428aaa2f4 Mon Sep 17 00:00:00 2001 From: andrej Date: Fri, 10 Jul 2026 16:06:29 -0600 Subject: [PATCH 5/9] format --- .../AIEObjectFifoStatefulTransform.cpp | 34 +++++++++---------- python/dialects/aie.py | 5 ++- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp index 83b7a4dbebe..5edff091d3e 100644 --- a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp +++ b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp @@ -2367,10 +2367,9 @@ struct AIEObjectFifoStatefulTransformPass // accounting that cannot see through runtime-dependent control flow. // Runtime lock counts require semaphore locks (AIE2+); on architectures // with binary locks (AIE1) the dynamic lowering keeps static lock counts. - bool isDynamicCore = - dynamicLoweringTiles.count(coreOp.getTileOp()) > 0 && - device.getTargetModel().hasProperty( - AIETargetModel::UsesSemaphoreLocks); + bool isDynamicCore = dynamicLoweringTiles.count(coreOp.getTileOp()) > 0 && + device.getTargetModel().hasProperty( + AIETargetModel::UsesSemaphoreLocks); BufferOp heldBuffer; DenseMap, Value> heldSlotIndex; if (isDynamicCore) { @@ -2403,11 +2402,11 @@ struct AIEObjectFifoStatefulTransformPass /*initial_value*/ nullptr, /*mem_bank*/ nullptr, /*aligned*/ nullptr); builder.setInsertionPointToStart(&(coreOp.getBody().front())); - Value zero = arith::ConstantOp::create( - builder, coreOp.getLoc(), builder.getI32IntegerAttr(0)); + Value zero = arith::ConstantOp::create(builder, coreOp.getLoc(), + builder.getI32IntegerAttr(0)); for (int slot = 0; slot < (int)slotOrder.size(); ++slot) { - Value idx = arith::ConstantOp::create( - builder, coreOp.getLoc(), builder.getIndexAttr(slot)); + Value idx = arith::ConstantOp::create(builder, coreOp.getLoc(), + builder.getIndexAttr(slot)); heldSlotIndex[slotOrder[slot]] = idx; memref::StoreOp::create(builder, coreOp.getLoc(), zero, heldBuffer, ValueRange(ArrayRef({idx}))); @@ -2457,9 +2456,9 @@ struct AIEObjectFifoStatefulTransformPass // number of released elements. if (isDynamicCore && heldBuffer) { Value idx = heldSlotIndex[{op, portNum}]; - Value held = memref::LoadOp::create(builder, releaseOp.getLoc(), - heldBuffer, - ValueRange(ArrayRef({idx}))); + Value held = + memref::LoadOp::create(builder, releaseOp.getLoc(), heldBuffer, + ValueRange(ArrayRef({idx}))); Value m = arith::ConstantOp::create( builder, releaseOp.getLoc(), builder.getI32IntegerAttr(numLocks)); Value newHeld = @@ -2530,21 +2529,20 @@ struct AIEObjectFifoStatefulTransformPass int acqNum = acquireOp.acqNumber(); int repeat = op.getRepeatCount().value_or(1); Value idx = heldSlotIndex[{op, portNum}]; - Value held = memref::LoadOp::create(builder, acquireOp.getLoc(), - heldBuffer, - ValueRange(ArrayRef({idx}))); + Value held = + memref::LoadOp::create(builder, acquireOp.getLoc(), heldBuffer, + ValueRange(ArrayRef({idx}))); Value nVal = arith::ConstantOp::create( builder, acquireOp.getLoc(), builder.getI32IntegerAttr(acqNum)); - Value zero = arith::ConstantOp::create( - builder, acquireOp.getLoc(), builder.getI32IntegerAttr(0)); + Value zero = arith::ConstantOp::create(builder, acquireOp.getLoc(), + builder.getI32IntegerAttr(0)); Value rawDelta = arith::SubIOp::create(builder, acquireOp.getLoc(), nVal, held); Value delta = arith::MaxSIOp::create(builder, acquireOp.getLoc(), rawDelta, zero); if (repeat > 1) { Value repeatVal = arith::ConstantOp::create( - builder, acquireOp.getLoc(), - builder.getI32IntegerAttr(repeat)); + builder, acquireOp.getLoc(), builder.getI32IntegerAttr(repeat)); delta = arith::MulIOp::create(builder, acquireOp.getLoc(), delta, repeatVal); } diff --git a/python/dialects/aie.py b/python/dialects/aie.py index fdef79b6205..37ca55fc490 100644 --- a/python/dialects/aie.py +++ b/python/dialects/aie.py @@ -86,7 +86,9 @@ from ._aie_ops_gen import use_lock as _use_lock -def use_lock(lock, action, value=None, *, blocking=None, acq_en=None, loc=None, ip=None): +def use_lock( + lock, action, value=None, *, blocking=None, acq_en=None, loc=None, ip=None +): if value is None: value = 1 if isinstance(value, int): @@ -95,6 +97,7 @@ def use_lock(lock, action, value=None, *, blocking=None, acq_en=None, loc=None, lock, action, value, blocking=blocking, acq_en=acq_en, loc=loc, ip=ip ) + # Included in aie instead of aiex to avoid circular imports, as buffer uses this from ._aiex_ops_gen import NpuWriteRTPOp From 675d1c14bcdf943ced94829e133d93fde2313b78 Mon Sep 17 00:00:00 2001 From: andrej Date: Fri, 10 Jul 2026 17:07:21 -0600 Subject: [PATCH 6/9] clarity --- .../AIEObjectFifoStatefulTransform.cpp | 158 +++++++++--------- 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp index 5edff091d3e..7ac7dfda5d8 100644 --- a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp +++ b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp @@ -2519,11 +2519,15 @@ struct AIEObjectFifoStatefulTransformPass if (state.objFifoLinks.find(*linkOp) != state.objFifoLinks.end()) target = state.objFifoLinks[*linkOp]; + // The subview buffer references built at the end of this handler map + // each acquired access index to a physical buffer. For dynamic tiles + // they are only consumed for size-1 fifos: buffer addressing for + // size > 1 fifos is handled separately by the runtime index_switch in + // dynamicGlobalObjectFifos, which already replaced those accesses. + std::vector acquiredIndices; + // For dynamic tiles, compute the number of locks to acquire at runtime - // as max(0, acqNumber - held), using the runtime "held" counter. Buffer - // addressing for size > 1 fifos is handled separately (via runtime - // index_switch in dynamicGlobalObjectFifos); the subview references - // built below are only used for size-1 fifos. + // as max(0, acqNumber - held), using the runtime "held" counter. if (isDynamicCore && heldBuffer) { builder.setInsertionPointAfter(acquireOp); int acqNum = acquireOp.acqNumber(); @@ -2553,99 +2557,97 @@ struct AIEObjectFifoStatefulTransformPass memref::StoreOp::create(builder, acquireOp.getLoc(), newHeld, heldBuffer, ValueRange(ArrayRef({idx}))); - // Build the subview buffer references (used by the subview.access - // replacement below for size-1 fifos). - std::vector subviewRefs; - subviewRefs.reserve(acqNum); + // Round-robin buffer index per acquired element (see note above). for (int i = 0; i < acqNum; i++) { - subviewRefs.push_back(&state.buffersPerFifo[target][start]); + acquiredIndices.push_back(start); start = (start + 1) % op.size(); } - subviews[acquireOp] = subviewRefs; acqPerFifo[{op, portNum}] = start; - return WalkResult::advance(); - } + } else { - // check how many elements have been released in between this AcquireOp - // and the previous one - // !!! operations may not be in the same block !!! - int numRel = 0; - for (std::vector::iterator relOp = - releaseOps[{op, portNum}].begin(); - relOp != releaseOps[{op, portNum}].end();) { - bool erased = false; - Operation *acqBlockDefOp = acquireOp.getOperation(); - do { - Operation *relBlockDefOp = (*relOp).getOperation(); + // check how many elements have been released in between this + // AcquireOp and the previous one + // !!! operations may not be in the same block !!! + int numRel = 0; + for (std::vector::iterator relOp = + releaseOps[{op, portNum}].begin(); + relOp != releaseOps[{op, portNum}].end();) { + bool erased = false; + Operation *acqBlockDefOp = acquireOp.getOperation(); do { - if (acqBlockDefOp->getBlock() == relBlockDefOp->getBlock()) { - if (relBlockDefOp->isBeforeInBlock(acqBlockDefOp)) { - numRel += (*relOp).relNumber(); - relOp = releaseOps[{op, portNum}].erase(relOp); - // to ensure that we do not account - // the ReleaseOps again later, - // after the subview is created - erased = true; + Operation *relBlockDefOp = (*relOp).getOperation(); + do { + if (acqBlockDefOp->getBlock() == relBlockDefOp->getBlock()) { + if (relBlockDefOp->isBeforeInBlock(acqBlockDefOp)) { + numRel += (*relOp).relNumber(); + relOp = releaseOps[{op, portNum}].erase(relOp); + // to ensure that we do not account + // the ReleaseOps again later, + // after the subview is created + erased = true; + } } - } - } while ((relBlockDefOp = relBlockDefOp->getParentOp()) && - !isa(relBlockDefOp) && !erased); - } while ((acqBlockDefOp = acqBlockDefOp->getParentOp()) && - !isa(acqBlockDefOp) && !erased); - if (!erased) - ++relOp; - } + } while ((relBlockDefOp = relBlockDefOp->getParentOp()) && + !isa(relBlockDefOp) && !erased); + } while ((acqBlockDefOp = acqBlockDefOp->getParentOp()) && + !isa(acqBlockDefOp) && !erased); + if (!erased) + ++relOp; + } - // track indices of elements to acquire - std::vector acquiredIndices; - if (!acquiresPerFifo[{op, portNum}].empty()) { - // take into account what has already been acquired by previous - // AcquireOp in program order - acquiredIndices = acquiresPerFifo[{op, portNum}]; - // take into account what has been released in-between - if (static_cast(numRel) > acquiredIndices.size()) { - acquireOp->emitOpError("cannot release more elements than are " - "already acquired"); - return WalkResult::interrupt(); + // track indices of elements to acquire + if (!acquiresPerFifo[{op, portNum}].empty()) { + // take into account what has already been acquired by previous + // AcquireOp in program order + acquiredIndices = acquiresPerFifo[{op, portNum}]; + // take into account what has been released in-between + if (static_cast(numRel) > acquiredIndices.size()) { + acquireOp->emitOpError("cannot release more elements than are " + "already acquired"); + return WalkResult::interrupt(); + } + for (int i = 0; i < numRel; i++) + acquiredIndices.erase(acquiredIndices.begin()); } - for (int i = 0; i < numRel; i++) - acquiredIndices.erase(acquiredIndices.begin()); - } - // acquire locks - int numLocks = acquireOp.acqNumber(); - int alreadyAcq = acquiredIndices.size(); - int numCreate; - if (numLocks > alreadyAcq) - numCreate = numLocks - alreadyAcq; - else - numCreate = 0; + // acquire locks + int numLocks = acquireOp.acqNumber(); + int alreadyAcq = acquiredIndices.size(); + int numCreate; + if (numLocks > alreadyAcq) + numCreate = numLocks - alreadyAcq; + else + numCreate = 0; - // account for repetition - if (op.getRepeatCount().has_value()) - numCreate *= op.getRepeatCount().value(); + // account for repetition + if (op.getRepeatCount().has_value()) + numCreate *= op.getRepeatCount().value(); - auto dev = op->getParentOfType(); - if (auto &targetArch = dev.getTargetModel(); - targetArch.getTargetArch() == AIEArch::AIE1) - createUseLocks(builder, op, port, acqPerFifo, numCreate, - LockAction::Acquire, state); - else - createUseLocks(builder, op, port, acqPerFifo, numCreate, - LockAction::AcquireGreaterEqual, state); + auto dev = op->getParentOfType(); + if (auto &targetArch = dev.getTargetModel(); + targetArch.getTargetArch() == AIEArch::AIE1) + createUseLocks(builder, op, port, acqPerFifo, numCreate, + LockAction::Acquire, state); + else + createUseLocks(builder, op, port, acqPerFifo, numCreate, + LockAction::AcquireGreaterEqual, state); - // create subview: buffers that were already acquired + new acquires - for (int i = 0; i < numCreate; i++) { - acquiredIndices.push_back(start); - start = (start + 1) % op.size(); + // create subview: buffers that were already acquired + new acquires + for (int i = 0; i < numCreate; i++) { + acquiredIndices.push_back(start); + start = (start + 1) % op.size(); + } + acquiresPerFifo[{op, portNum}] = acquiredIndices; } + + // Build the subview buffer references shared by both paths (see note + // above). For size > 1 dynamic fifos these are dead because the + // accesses were already rewired by dynamicGlobalObjectFifos. std::vector subviewRefs; subviewRefs.reserve(acquiredIndices.size()); for (auto index : acquiredIndices) subviewRefs.push_back(&state.buffersPerFifo[target][index]); - subviews[acquireOp] = subviewRefs; - acquiresPerFifo[{op, portNum}] = acquiredIndices; return WalkResult::advance(); }); From 993750724b11c715f9810e46995595ee6b61993a Mon Sep 17 00:00:00 2001 From: andrej Date: Fri, 10 Jul 2026 18:25:38 -0600 Subject: [PATCH 7/9] AIE: promote dynamic objectFifo held counters to SSA via mem2reg Emit the per-(fifo,port) runtime held-element counters as single-element memref.alloca (tagged aie.held_counter) so acquire/release bookkeeping is plain load/store, then run mem2reg in-pass to promote them to SSA values. Hard-error if any counter survives promotion. Regenerate the dynamic objectFifo lock CHECK lines accordingly. --- .../AIEObjectFifoStatefulTransform.cpp | 125 ++++--- .../dynamic_lowering/core_flag_test.mlir | 221 ++++++------ .../depth_one_objectfifo_test.mlir | 70 ++-- .../different_depth_objectfifos_test.mlir | 333 ++++++++---------- .../dynamic_lowering/pass_flag_test.mlir | 304 ++++++++-------- .../same_depth_objectfifos_test.mlir | 323 ++++++++--------- .../dynamic_runtime_lock_basic.mlir | 116 +++--- .../dynamic_runtime_lock_conditional.mlir | 127 ++++--- .../dynamic_runtime_lock_multiple_fifos.mlir | 253 +++++++------ .../dynamic_runtime_lock_nested_loops.mlir | 246 ++++++------- .../dynamic_runtime_lock_producer.mlir | 64 ++-- .../dynamic_runtime_lock_scf_while.mlir | 149 ++++---- 12 files changed, 1097 insertions(+), 1234 deletions(-) diff --git a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp index 7ac7dfda5d8..a4fc46f1c77 100644 --- a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp +++ b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp @@ -17,8 +17,10 @@ #include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/IR/Attributes.h" +#include "mlir/IR/Dominance.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" +#include "mlir/Transforms/Mem2Reg.h" #include "mlir/IR/Operation.h" #include "mlir/Interfaces/DataLayoutInterfaces.h" @@ -2339,6 +2341,9 @@ struct AIEObjectFifoStatefulTransformPass //===------------------------------------------------------------------===// // Replace ops //===------------------------------------------------------------------===// + // Runtime held-counter allocas collected across all cores. They are + // promoted to SSA values by mem2reg once all rewriting is complete. + SmallVector heldCounterAllocas; for (auto coreOp : device.getOps()) { DenseMap> subviews; // maps each "subview" to its buffer references (subviews @@ -2370,48 +2375,35 @@ struct AIEObjectFifoStatefulTransformPass bool isDynamicCore = dynamicLoweringTiles.count(coreOp.getTileOp()) > 0 && device.getTargetModel().hasProperty( AIETargetModel::UsesSemaphoreLocks); - BufferOp heldBuffer; - DenseMap, Value> heldSlotIndex; + // One runtime "held" counter per (fifo, port), emitted as a + // single-element memref.alloca so the acquire/release bookkeeping is + // just plain load/store. These are promoted to SSA values by mem2reg at + // the end of the pass. + DenseMap, memref::AllocaOp> heldAlloca; if (isDynamicCore) { - DenseMap, int> heldSlot; - // Ordered list of (fifo, port) keys indexed by their slot number, so - // that the counter buffer is initialized deterministically (a plain - // DenseMap iteration order is not stable). - SmallVector> slotOrder; - auto assignSlot = [&](ObjectFifoCreateOp fifo, ObjectFifoPort p) { + auto ensureSlot = [&](ObjectFifoCreateOp fifo, ObjectFifoPort p) { int pn = p == ObjectFifoPort::Produce ? 0 : 1; - if (!heldSlot.count({fifo, pn})) { - heldSlot[{fifo, pn}] = slotOrder.size(); - slotOrder.push_back({fifo, pn}); - } + if (heldAlloca.count({fifo, pn})) + return; + OpBuilder::InsertionGuard g(builder); + builder.setInsertionPointToStart(&(coreOp.getBody().front())); + auto counterTy = MemRefType::get({}, builder.getI32Type()); + auto counter = + memref::AllocaOp::create(builder, coreOp.getLoc(), counterTy); + counter->setAttr("aie.held_counter", builder.getUnitAttr()); + Value zero = arith::ConstantOp::create(builder, coreOp.getLoc(), + builder.getI32IntegerAttr(0)); + memref::StoreOp::create(builder, coreOp.getLoc(), zero, counter, + ValueRange{}); + heldAlloca[{fifo, pn}] = counter; + heldCounterAllocas.push_back(counter); }; coreOp.walk([&](ObjectFifoAcquireOp a) { - assignSlot(a.getObjectFifo(), a.getPort()); + ensureSlot(a.getObjectFifo(), a.getPort()); }); coreOp.walk([&](ObjectFifoReleaseOp r) { - assignSlot(r.getObjectFifo(), r.getPort()); + ensureSlot(r.getObjectFifo(), r.getPort()); }); - if (!slotOrder.empty()) { - builder.setInsertionPoint(coreOp); - auto heldTy = - MemRefType::get(SmallVector{(int64_t)slotOrder.size()}, - builder.getI32Type()); - heldBuffer = BufferOp::create( - builder, coreOp.getLoc(), heldTy, coreOp.getTile(), - /*sym_name*/ nullptr, /*address*/ nullptr, - /*initial_value*/ nullptr, /*mem_bank*/ nullptr, - /*aligned*/ nullptr); - builder.setInsertionPointToStart(&(coreOp.getBody().front())); - Value zero = arith::ConstantOp::create(builder, coreOp.getLoc(), - builder.getI32IntegerAttr(0)); - for (int slot = 0; slot < (int)slotOrder.size(); ++slot) { - Value idx = arith::ConstantOp::create(builder, coreOp.getLoc(), - builder.getIndexAttr(slot)); - heldSlotIndex[slotOrder[slot]] = idx; - memref::StoreOp::create(builder, coreOp.getLoc(), zero, heldBuffer, - ValueRange(ArrayRef({idx}))); - } - } } //===----------------------------------------------------------------===// @@ -2454,17 +2446,17 @@ struct AIEObjectFifoStatefulTransformPass // For dynamic tiles, decrement the runtime "held" counter by the // number of released elements. - if (isDynamicCore && heldBuffer) { - Value idx = heldSlotIndex[{op, portNum}]; - Value held = - memref::LoadOp::create(builder, releaseOp.getLoc(), heldBuffer, - ValueRange(ArrayRef({idx}))); + if (memref::AllocaOp counter = isDynamicCore + ? heldAlloca.lookup({op, portNum}) + : memref::AllocaOp()) { + Value held = memref::LoadOp::create(builder, releaseOp.getLoc(), + counter, ValueRange{}); Value m = arith::ConstantOp::create( builder, releaseOp.getLoc(), builder.getI32IntegerAttr(numLocks)); Value newHeld = arith::SubIOp::create(builder, releaseOp.getLoc(), held, m); - memref::StoreOp::create(builder, releaseOp.getLoc(), newHeld, - heldBuffer, ValueRange(ArrayRef({idx}))); + memref::StoreOp::create(builder, releaseOp.getLoc(), newHeld, counter, + ValueRange{}); } // register release op @@ -2528,14 +2520,15 @@ struct AIEObjectFifoStatefulTransformPass // For dynamic tiles, compute the number of locks to acquire at runtime // as max(0, acqNumber - held), using the runtime "held" counter. - if (isDynamicCore && heldBuffer) { + memref::AllocaOp counter = isDynamicCore + ? heldAlloca.lookup({op, portNum}) + : memref::AllocaOp(); + if (counter) { builder.setInsertionPointAfter(acquireOp); int acqNum = acquireOp.acqNumber(); int repeat = op.getRepeatCount().value_or(1); - Value idx = heldSlotIndex[{op, portNum}]; - Value held = - memref::LoadOp::create(builder, acquireOp.getLoc(), heldBuffer, - ValueRange(ArrayRef({idx}))); + Value held = memref::LoadOp::create(builder, acquireOp.getLoc(), + counter, ValueRange{}); Value nVal = arith::ConstantOp::create( builder, acquireOp.getLoc(), builder.getI32IntegerAttr(acqNum)); Value zero = arith::ConstantOp::create(builder, acquireOp.getLoc(), @@ -2554,8 +2547,8 @@ struct AIEObjectFifoStatefulTransformPass LockAction::AcquireGreaterEqual, state); Value newHeld = arith::AddIOp::create(builder, acquireOp.getLoc(), held, delta); - memref::StoreOp::create(builder, acquireOp.getLoc(), newHeld, - heldBuffer, ValueRange(ArrayRef({idx}))); + memref::StoreOp::create(builder, acquireOp.getLoc(), newHeld, counter, + ValueRange{}); // Round-robin buffer index per acquired element (see note above). for (int i = 0; i < acqNum; i++) { @@ -2729,6 +2722,40 @@ struct AIEObjectFifoStatefulTransformPass for (auto *op : opsToErase) { op->erase(); } + + //===------------------------------------------------------------------===// + // Promote runtime held-counter allocas to SSA values (mem2reg). + //===------------------------------------------------------------------===// + // The held counters were emitted as single-element memref.alloca so the + // acquire/release bookkeeping could be written as plain load/store. Run + // mem2reg here as an in-pass step so it always executes, then require that + // every counter was fully promoted: a surviving alloca would mean opaque + // memory traffic left in the core, which we treat as a hard error. + if (!heldCounterAllocas.empty()) { + SmallVector allocators; + allocators.reserve(heldCounterAllocas.size()); + for (memref::AllocaOp counter : heldCounterAllocas) + allocators.push_back( + cast(counter.getOperation())); + OpBuilder promoteBuilder(device); + DominanceInfo dominance; + const DataLayout dataLayout = DataLayout::closest(device.getOperation()); + (void)tryToPromoteMemorySlots(allocators, promoteBuilder, dataLayout, + dominance); + + bool residualCounter = false; + device.walk([&](memref::AllocaOp counter) { + if (counter->hasAttr("aie.held_counter")) { + counter.emitOpError( + "dynamic objectFifo held counter could not be promoted to an SSA " + "value by mem2reg; runtime lock bookkeeping would remain in " + "memory"); + residualCounter = true; + } + }); + if (residualCounter) + return signalPassFailure(); + } } }; diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir index 531ce1afae2..c1265690161 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/core_flag_test.mlir @@ -7,8 +7,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu1_1col) { +// CHECK-LABEL: aie.device(npu1_1col) { // CHECK: func.func @passthrough_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>) { // CHECK: return // CHECK: } @@ -44,33 +43,27 @@ // CHECK: aie.flow(%[[VAL_2]], DMA : 1, %[[VAL_4]], DMA : 0) // CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_2]], DMA : 1) // CHECK: %[[VAL_29:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> -// CHECK: %[[VAL_30:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> -// CHECK: %[[VAL_31:.*]] = aie.core(%[[VAL_3]]) { +// CHECK: %[[VAL_30:.*]] = aie.core(%[[VAL_3]]) { +// CHECK: %[[VAL_31:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_32:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_33:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> -// CHECK: %[[VAL_34:.*]] = arith.constant 1 : index -// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_35:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_36:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_33:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_34:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_35:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_33]], %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_36:.*]] = arith.constant 1 : index // CHECK: %[[VAL_37:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> -// CHECK: %[[VAL_38:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_39:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_40:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_41:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_42:.*]] = arith.constant 10 : index -// CHECK: scf.for %[[VAL_43:.*]] = %[[VAL_40]] to %[[VAL_42]] step %[[VAL_41]] { -// CHECK: %[[VAL_44:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: memref.store %[[VAL_33]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_39:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_40:.*]] = arith.constant 10 : index +// CHECK: %[[VAL_41:.*]]:2 = scf.for %[[VAL_42:.*]] = %[[VAL_38]] to %[[VAL_40]] step %[[VAL_39]] iter_args(%[[VAL_43:.*]] = %[[VAL_32]], %[[VAL_44:.*]] = %[[VAL_31]]) -> (i32, i32) { // CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 // CHECK: %[[VAL_46:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_45]], %[[VAL_44]] : i32 +// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_45]], %[[VAL_43]] : i32 // CHECK: %[[VAL_48:.*]] = arith.maxsi %[[VAL_47]], %[[VAL_46]] : i32 // CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_48]]) -// CHECK: %[[VAL_49:.*]] = arith.addi %[[VAL_44]], %[[VAL_48]] : i32 -// CHECK: memref.store %[[VAL_49]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> -// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_49:.*]] = arith.addi %[[VAL_43]], %[[VAL_48]] : i32 +// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> // CHECK: %[[VAL_51:.*]] = arith.index_cast %[[VAL_50]] : i32 to index // CHECK: %[[VAL_52:.*]] = scf.index_switch %[[VAL_51]] -> memref<10xi32> // CHECK: case 0 { @@ -82,17 +75,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_19]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_55:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_56:.*]] = arith.subi %[[VAL_54]], %[[VAL_53]] : i32 -// CHECK: %[[VAL_57:.*]] = arith.maxsi %[[VAL_56]], %[[VAL_55]] : i32 -// CHECK: aie.use_lock(%[[VAL_26]], AcquireGreaterEqual, %[[VAL_57]]) -// CHECK: %[[VAL_58:.*]] = arith.addi %[[VAL_53]], %[[VAL_57]] : i32 -// CHECK: memref.store %[[VAL_58]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_59:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_60:.*]] = arith.index_cast %[[VAL_59]] : i32 to index -// CHECK: %[[VAL_61:.*]] = scf.index_switch %[[VAL_60]] -> memref<10xi32> +// CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_54:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_55:.*]] = arith.subi %[[VAL_53]], %[[VAL_44]] : i32 +// CHECK: %[[VAL_56:.*]] = arith.maxsi %[[VAL_55]], %[[VAL_54]] : i32 +// CHECK: aie.use_lock(%[[VAL_26]], AcquireGreaterEqual, %[[VAL_56]]) +// CHECK: %[[VAL_57:.*]] = arith.addi %[[VAL_44]], %[[VAL_56]] : i32 +// CHECK: %[[VAL_58:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_59:.*]] = arith.index_cast %[[VAL_58]] : i32 to index +// CHECK: %[[VAL_60:.*]] = scf.index_switch %[[VAL_59]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_23]] : memref<10xi32> // CHECK: } @@ -102,139 +93,135 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_23]] : memref<10xi32> // CHECK: } -// CHECK: func.call @passthrough_10_i32(%[[VAL_61]], %[[VAL_52]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: func.call @passthrough_10_i32(%[[VAL_60]], %[[VAL_52]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], Release, %[[VAL_61]]) // CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_25]], Release, %[[VAL_62]]) -// CHECK: %[[VAL_63:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_64:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_65:.*]] = arith.subi %[[VAL_63]], %[[VAL_64]] : i32 -// CHECK: memref.store %[[VAL_65]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_66:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_67:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_68:.*]] = arith.addi %[[VAL_66]], %[[VAL_67]] : i32 -// CHECK: %[[VAL_69:.*]] = arith.cmpi sge, %[[VAL_68]], %[[VAL_39]] : i32 -// CHECK: %[[VAL_70:.*]] = arith.subi %[[VAL_68]], %[[VAL_39]] : i32 -// CHECK: %[[VAL_71:.*]] = arith.select %[[VAL_69]], %[[VAL_70]], %[[VAL_68]] : i32 -// CHECK: memref.store %[[VAL_71]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_72:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_22]], Release, %[[VAL_72]]) -// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_63:.*]] = arith.subi %[[VAL_57]], %[[VAL_62]] : i32 +// CHECK: %[[VAL_64:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_65:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_66:.*]] = arith.addi %[[VAL_64]], %[[VAL_65]] : i32 +// CHECK: %[[VAL_67:.*]] = arith.cmpi sge, %[[VAL_66]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_68:.*]] = arith.subi %[[VAL_66]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_69:.*]] = arith.select %[[VAL_67]], %[[VAL_68]], %[[VAL_66]] : i32 +// CHECK: memref.store %[[VAL_69]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_70:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %[[VAL_70]]) +// CHECK: %[[VAL_71:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_72:.*]] = arith.subi %[[VAL_49]], %[[VAL_71]] : i32 +// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> // CHECK: %[[VAL_74:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_75:.*]] = arith.subi %[[VAL_73]], %[[VAL_74]] : i32 -// CHECK: memref.store %[[VAL_75]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> -// CHECK: %[[VAL_76:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> -// CHECK: %[[VAL_77:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_78:.*]] = arith.addi %[[VAL_76]], %[[VAL_77]] : i32 -// CHECK: %[[VAL_79:.*]] = arith.cmpi sge, %[[VAL_78]], %[[VAL_37]] : i32 -// CHECK: %[[VAL_80:.*]] = arith.subi %[[VAL_78]], %[[VAL_37]] : i32 -// CHECK: %[[VAL_81:.*]] = arith.select %[[VAL_79]], %[[VAL_80]], %[[VAL_78]] : i32 -// CHECK: memref.store %[[VAL_81]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_75:.*]] = arith.addi %[[VAL_73]], %[[VAL_74]] : i32 +// CHECK: %[[VAL_76:.*]] = arith.cmpi sge, %[[VAL_75]], %[[VAL_35]] : i32 +// CHECK: %[[VAL_77:.*]] = arith.subi %[[VAL_75]], %[[VAL_35]] : i32 +// CHECK: %[[VAL_78:.*]] = arith.select %[[VAL_76]], %[[VAL_77]], %[[VAL_75]] : i32 +// CHECK: memref.store %[[VAL_78]], %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_72]], %[[VAL_63]] : i32, i32 // CHECK: } // CHECK: aie.end // CHECK: } {dynamic_objfifo_lowering = true} -// CHECK: %[[VAL_82:.*]] = aie.core(%[[VAL_4]]) { -// CHECK: %[[VAL_83:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_84:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_85:.*]] = arith.constant 10 : index -// CHECK: %[[VAL_86:.*]] = arith.constant 2 : index -// CHECK: scf.for %[[VAL_87:.*]] = %[[VAL_83]] to %[[VAL_85]] step %[[VAL_86]] { +// CHECK: %[[VAL_79:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_80:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_81:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_82:.*]] = arith.constant 10 : index +// CHECK: %[[VAL_83:.*]] = arith.constant 2 : index +// CHECK: scf.for %[[VAL_84:.*]] = %[[VAL_80]] to %[[VAL_82]] step %[[VAL_83]] { +// CHECK: %[[VAL_85:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_85]]) +// CHECK: %[[VAL_86:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_86]]) +// CHECK: func.call @passthrough_10_i32(%[[VAL_11]], %[[VAL_7]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_87:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_87]]) // CHECK: %[[VAL_88:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_88]]) +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_88]]) // CHECK: %[[VAL_89:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_89]]) -// CHECK: func.call @passthrough_10_i32(%[[VAL_11]], %[[VAL_7]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_89]]) // CHECK: %[[VAL_90:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_90]]) +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_90]]) +// CHECK: func.call @passthrough_10_i32(%[[VAL_12]], %[[VAL_8]]) : (memref<10xi32>, memref<10xi32>) -> () // CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_91]]) +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_91]]) // CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_92]]) -// CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_93]]) -// CHECK: func.call @passthrough_10_i32(%[[VAL_12]], %[[VAL_8]]) : (memref<10xi32>, memref<10xi32>) -> () -// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_94]]) -// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_95]]) +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_92]]) // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_2]], MM2S, 0) -// CHECK: %[[VAL_96:.*]] = aie.mem(%[[VAL_3]]) { -// CHECK: %[[VAL_97:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: %[[VAL_93:.*]] = aie.mem(%[[VAL_3]]) { +// CHECK: %[[VAL_94:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_98]]) +// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_95]]) // CHECK: aie.dma_bd(%[[VAL_23]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_99:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_99]]) +// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_96]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_100]]) +// CHECK: %[[VAL_97:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_97]]) // CHECK: aie.dma_bd(%[[VAL_24]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_101]]) +// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_98]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: -// CHECK: %[[VAL_102:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: %[[VAL_99:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_103]]) +// CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_100]]) // CHECK: aie.dma_bd(%[[VAL_19]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_104:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_104]]) +// CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_101]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: %[[VAL_105:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_105]]) +// CHECK: %[[VAL_102:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_102]]) // CHECK: aie.dma_bd(%[[VAL_20]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_106:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_106]]) +// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_103]]) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_2]], S2MM, 0) // CHECK: aie.shim_dma_allocation @input_fifo2_shim_alloc(%[[VAL_2]], MM2S, 1) -// CHECK: %[[VAL_107:.*]] = aie.mem(%[[VAL_4]]) { -// CHECK: %[[VAL_108:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: %[[VAL_104:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_105:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_109]]) +// CHECK: %[[VAL_106:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_106]]) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_110:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_110]]) +// CHECK: %[[VAL_107:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_107]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_111]]) +// CHECK: %[[VAL_108:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_108]]) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_112:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_112]]) +// CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_109]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: -// CHECK: %[[VAL_113:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: %[[VAL_110:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: %[[VAL_114:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_114]]) +// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_111]]) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_115]]) +// CHECK: %[[VAL_112:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_112]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: %[[VAL_116:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_116]]) +// CHECK: %[[VAL_113:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_113]]) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_117]]) +// CHECK: %[[VAL_114:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_114]]) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @output_fifo2_shim_alloc(%[[VAL_2]], S2MM, 1) // CHECK: } -// CHECK: } module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir index 53048df3a94..f7f8a0b9969 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/depth_one_objectfifo_test.mlir @@ -7,8 +7,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=false" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu1_1col) { +// CHECK-LABEL: aie.device(npu1_1col) { // CHECK: func.func @passthrough_10_i32(%[[VAL_0:.*]]: memref<10xi32>) { // CHECK: return // CHECK: } @@ -22,59 +21,52 @@ // CHECK: %[[VAL_8:.*]] = aie.lock(%[[VAL_1]], 1) {init = 0 : i32, sym_name = "input_fifo_cons_lock_0"} // CHECK: aie.flow(%[[VAL_1]], DMA : 0, %[[VAL_2]], DMA : 0) // CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_2]]) : memref<1xi32> -// CHECK: %[[VAL_10:.*]] = aie.buffer(%[[VAL_2]]) : memref<1xi32> -// CHECK: %[[VAL_11:.*]] = aie.core(%[[VAL_2]]) { +// CHECK: %[[VAL_10:.*]] = aie.core(%[[VAL_2]]) { +// CHECK: %[[VAL_11:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_12:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_13:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_12]], %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> -// CHECK: %[[VAL_14:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_14:.*]] = arith.constant 1 : i32 +// CHECK: memref.store %[[VAL_12]], %[[VAL_9]]{{\[}}%[[VAL_13]]] : memref<1xi32> // CHECK: %[[VAL_15:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_16:.*]] = arith.constant 1 : i32 -// CHECK: memref.store %[[VAL_14]], %[[VAL_9]]{{\[}}%[[VAL_15]]] : memref<1xi32> -// CHECK: %[[VAL_17:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_18:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_19:.*]] = arith.constant 10 : index -// CHECK: scf.for %[[VAL_20:.*]] = %[[VAL_17]] to %[[VAL_19]] step %[[VAL_18]] { -// CHECK: %[[VAL_21:.*]] = memref.load %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> -// CHECK: %[[VAL_22:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_23:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_24:.*]] = arith.subi %[[VAL_22]], %[[VAL_21]] : i32 -// CHECK: %[[VAL_25:.*]] = arith.maxsi %[[VAL_24]], %[[VAL_23]] : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_25]]) -// CHECK: %[[VAL_26:.*]] = arith.addi %[[VAL_21]], %[[VAL_25]] : i32 -// CHECK: memref.store %[[VAL_26]], %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: %[[VAL_16:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_17:.*]] = arith.constant 10 : index +// CHECK: %[[VAL_18:.*]] = scf.for %[[VAL_19:.*]] = %[[VAL_15]] to %[[VAL_17]] step %[[VAL_16]] iter_args(%[[VAL_20:.*]] = %[[VAL_11]]) -> (i32) { +// CHECK: %[[VAL_21:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_23:.*]] = arith.subi %[[VAL_21]], %[[VAL_20]] : i32 +// CHECK: %[[VAL_24:.*]] = arith.maxsi %[[VAL_23]], %[[VAL_22]] : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_24]]) +// CHECK: %[[VAL_25:.*]] = arith.addi %[[VAL_20]], %[[VAL_24]] : i32 // CHECK: func.call @passthrough_10_i32(%[[VAL_4]]) : (memref<10xi32>) -> () +// CHECK: %[[VAL_26:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_26]]) // CHECK: %[[VAL_27:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_27]]) -// CHECK: %[[VAL_28:.*]] = memref.load %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> -// CHECK: %[[VAL_29:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_30:.*]] = arith.subi %[[VAL_28]], %[[VAL_29]] : i32 -// CHECK: memref.store %[[VAL_30]], %[[VAL_10]]{{\[}}%[[VAL_13]]] : memref<1xi32> -// CHECK: %[[VAL_31:.*]] = memref.load %[[VAL_9]]{{\[}}%[[VAL_15]]] : memref<1xi32> -// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_33:.*]] = arith.addi %[[VAL_31]], %[[VAL_32]] : i32 -// CHECK: %[[VAL_34:.*]] = arith.cmpi sge, %[[VAL_33]], %[[VAL_16]] : i32 -// CHECK: %[[VAL_35:.*]] = arith.subi %[[VAL_33]], %[[VAL_16]] : i32 -// CHECK: %[[VAL_36:.*]] = arith.select %[[VAL_34]], %[[VAL_35]], %[[VAL_33]] : i32 -// CHECK: memref.store %[[VAL_36]], %[[VAL_9]]{{\[}}%[[VAL_15]]] : memref<1xi32> +// CHECK: %[[VAL_28:.*]] = arith.subi %[[VAL_25]], %[[VAL_27]] : i32 +// CHECK: %[[VAL_29:.*]] = memref.load %[[VAL_9]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: %[[VAL_30:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_31:.*]] = arith.addi %[[VAL_29]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_32:.*]] = arith.cmpi sge, %[[VAL_31]], %[[VAL_14]] : i32 +// CHECK: %[[VAL_33:.*]] = arith.subi %[[VAL_31]], %[[VAL_14]] : i32 +// CHECK: %[[VAL_34:.*]] = arith.select %[[VAL_32]], %[[VAL_33]], %[[VAL_31]] : i32 +// CHECK: memref.store %[[VAL_34]], %[[VAL_9]]{{\[}}%[[VAL_13]]] : memref<1xi32> +// CHECK: scf.yield %[[VAL_28]] : i32 // CHECK: } // CHECK: aie.end // CHECK: } {dynamic_objfifo_lowering = true} // CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_1]], MM2S, 0) -// CHECK: %[[VAL_37:.*]] = aie.mem(%[[VAL_2]]) { -// CHECK: %[[VAL_38:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) +// CHECK: %[[VAL_35:.*]] = aie.mem(%[[VAL_2]]) { +// CHECK: %[[VAL_36:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb2) // CHECK: ^bb1: -// CHECK: %[[VAL_39:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_39]]) +// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_37]]) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_40:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_40]]) +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_38]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb2: // CHECK: aie.end // CHECK: } // CHECK: } -// CHECK: } module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir index 58c220f6950..a31ac91804f 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/different_depth_objectfifos_test.mlir @@ -7,8 +7,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform=dynamic-objFifos %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu1_1col) { +// CHECK-LABEL: aie.device(npu1_1col) { // CHECK: func.func @add_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>, %[[VAL_2:.*]]: memref<10xi32>) { // CHECK: return // CHECK: } @@ -30,34 +29,28 @@ // CHECK: aie.flow(%[[VAL_3]], DMA : 0, %[[VAL_4]], DMA : 0) // CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_3]], DMA : 0) // CHECK: %[[VAL_18:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> -// CHECK: %[[VAL_19:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> -// CHECK: %[[VAL_20:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_19:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_20:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_21:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_22:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_21]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_23:.*]] = arith.constant 1 : index -// CHECK: memref.store %[[VAL_21]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_24:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_25:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_26:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_24]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: %[[VAL_27:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_28:.*]] = arith.constant 3 : i32 -// CHECK: memref.store %[[VAL_24]], %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_29:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_30:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_31:.*]] = arith.constant 9 : index -// CHECK: %[[VAL_32:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_33:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_34:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_35:.*]] = arith.subi %[[VAL_33]], %[[VAL_32]] : i32 -// CHECK: %[[VAL_36:.*]] = arith.maxsi %[[VAL_35]], %[[VAL_34]] : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_36]]) -// CHECK: %[[VAL_37:.*]] = arith.addi %[[VAL_32]], %[[VAL_36]] : i32 -// CHECK: memref.store %[[VAL_37]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_38:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: %[[VAL_39:.*]] = arith.index_cast %[[VAL_38]] : i32 to index -// CHECK: %[[VAL_40:.*]] = scf.index_switch %[[VAL_39]] -> memref<10xi32> +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_23:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_24:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_22]], %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_25:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_26:.*]] = arith.constant 3 : i32 +// CHECK: memref.store %[[VAL_22]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_27:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_28:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_29:.*]] = arith.constant 9 : index +// CHECK: %[[VAL_30:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_31:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_32:.*]] = arith.subi %[[VAL_30]], %[[VAL_21]] : i32 +// CHECK: %[[VAL_33:.*]] = arith.maxsi %[[VAL_32]], %[[VAL_31]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_33]]) +// CHECK: %[[VAL_34:.*]] = arith.addi %[[VAL_21]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_35:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_36:.*]] = arith.index_cast %[[VAL_35]] : i32 to index +// CHECK: %[[VAL_37:.*]] = scf.index_switch %[[VAL_36]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } @@ -67,17 +60,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_41:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_42:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_43:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_44:.*]] = arith.subi %[[VAL_42]], %[[VAL_41]] : i32 -// CHECK: %[[VAL_45:.*]] = arith.maxsi %[[VAL_44]], %[[VAL_43]] : i32 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_45]]) -// CHECK: %[[VAL_46:.*]] = arith.addi %[[VAL_41]], %[[VAL_45]] : i32 -// CHECK: memref.store %[[VAL_46]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_47:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_48:.*]] = arith.index_cast %[[VAL_47]] : i32 to index -// CHECK: %[[VAL_49:.*]] = scf.index_switch %[[VAL_48]] -> memref<10xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_39:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_40:.*]] = arith.subi %[[VAL_38]], %[[VAL_20]] : i32 +// CHECK: %[[VAL_41:.*]] = arith.maxsi %[[VAL_40]], %[[VAL_39]] : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_41]]) +// CHECK: %[[VAL_42:.*]] = arith.addi %[[VAL_20]], %[[VAL_41]] : i32 +// CHECK: %[[VAL_43:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_44:.*]] = arith.index_cast %[[VAL_43]] : i32 to index +// CHECK: %[[VAL_45:.*]] = scf.index_switch %[[VAL_44]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } @@ -90,32 +81,28 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } -// CHECK: func.call @add_10_i32(%[[VAL_49]], %[[VAL_49]], %[[VAL_40]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: func.call @add_10_i32(%[[VAL_45]], %[[VAL_45]], %[[VAL_37]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_46:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_46]]) +// CHECK: %[[VAL_47:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_48:.*]] = arith.subi %[[VAL_34]], %[[VAL_47]] : i32 +// CHECK: %[[VAL_49:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> // CHECK: %[[VAL_50:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_50]]) -// CHECK: %[[VAL_51:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_53:.*]] = arith.subi %[[VAL_51]], %[[VAL_52]] : i32 -// CHECK: memref.store %[[VAL_53]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_54:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_56:.*]] = arith.addi %[[VAL_54]], %[[VAL_55]] : i32 -// CHECK: %[[VAL_57:.*]] = arith.cmpi sge, %[[VAL_56]], %[[VAL_26]] : i32 -// CHECK: %[[VAL_58:.*]] = arith.subi %[[VAL_56]], %[[VAL_26]] : i32 -// CHECK: %[[VAL_59:.*]] = arith.select %[[VAL_57]], %[[VAL_58]], %[[VAL_56]] : i32 -// CHECK: memref.store %[[VAL_59]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: scf.for %[[VAL_60:.*]] = %[[VAL_29]] to %[[VAL_31]] step %[[VAL_30]] { -// CHECK: %[[VAL_61:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_63:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_64:.*]] = arith.subi %[[VAL_62]], %[[VAL_61]] : i32 -// CHECK: %[[VAL_65:.*]] = arith.maxsi %[[VAL_64]], %[[VAL_63]] : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_65]]) -// CHECK: %[[VAL_66:.*]] = arith.addi %[[VAL_61]], %[[VAL_65]] : i32 -// CHECK: memref.store %[[VAL_66]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_67:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: %[[VAL_68:.*]] = arith.index_cast %[[VAL_67]] : i32 to index -// CHECK: %[[VAL_69:.*]] = scf.index_switch %[[VAL_68]] -> memref<10xi32> +// CHECK: %[[VAL_51:.*]] = arith.addi %[[VAL_49]], %[[VAL_50]] : i32 +// CHECK: %[[VAL_52:.*]] = arith.cmpi sge, %[[VAL_51]], %[[VAL_24]] : i32 +// CHECK: %[[VAL_53:.*]] = arith.subi %[[VAL_51]], %[[VAL_24]] : i32 +// CHECK: %[[VAL_54:.*]] = arith.select %[[VAL_52]], %[[VAL_53]], %[[VAL_51]] : i32 +// CHECK: memref.store %[[VAL_54]], %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_55:.*]]:2 = scf.for %[[VAL_56:.*]] = %[[VAL_27]] to %[[VAL_29]] step %[[VAL_28]] iter_args(%[[VAL_57:.*]] = %[[VAL_48]], %[[VAL_58:.*]] = %[[VAL_42]]) -> (i32, i32) { +// CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_60:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_61:.*]] = arith.subi %[[VAL_59]], %[[VAL_57]] : i32 +// CHECK: %[[VAL_62:.*]] = arith.maxsi %[[VAL_61]], %[[VAL_60]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_62]]) +// CHECK: %[[VAL_63:.*]] = arith.addi %[[VAL_57]], %[[VAL_62]] : i32 +// CHECK: %[[VAL_64:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_65:.*]] = arith.index_cast %[[VAL_64]] : i32 to index +// CHECK: %[[VAL_66:.*]] = scf.index_switch %[[VAL_65]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } @@ -125,17 +112,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_70:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_71:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_72:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_73:.*]] = arith.subi %[[VAL_71]], %[[VAL_70]] : i32 -// CHECK: %[[VAL_74:.*]] = arith.maxsi %[[VAL_73]], %[[VAL_72]] : i32 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_74]]) -// CHECK: %[[VAL_75:.*]] = arith.addi %[[VAL_70]], %[[VAL_74]] : i32 -// CHECK: memref.store %[[VAL_75]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_76:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_77:.*]] = arith.index_cast %[[VAL_76]] : i32 to index -// CHECK: %[[VAL_78:.*]] = scf.index_switch %[[VAL_77]] -> memref<10xi32> +// CHECK: %[[VAL_67:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_68:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_69:.*]] = arith.subi %[[VAL_67]], %[[VAL_58]] : i32 +// CHECK: %[[VAL_70:.*]] = arith.maxsi %[[VAL_69]], %[[VAL_68]] : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_70]]) +// CHECK: %[[VAL_71:.*]] = arith.addi %[[VAL_58]], %[[VAL_70]] : i32 +// CHECK: %[[VAL_72:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_73:.*]] = arith.index_cast %[[VAL_72]] : i32 to index +// CHECK: %[[VAL_74:.*]] = scf.index_switch %[[VAL_73]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } @@ -148,9 +133,9 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_79:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_80:.*]] = arith.index_cast %[[VAL_79]] : i32 to index -// CHECK: %[[VAL_81:.*]] = scf.index_switch %[[VAL_80]] -> memref<10xi32> +// CHECK: %[[VAL_75:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_76:.*]] = arith.index_cast %[[VAL_75]] : i32 to index +// CHECK: %[[VAL_77:.*]] = scf.index_switch %[[VAL_76]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } @@ -163,45 +148,40 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } -// CHECK: func.call @add_10_i32(%[[VAL_78]], %[[VAL_81]], %[[VAL_69]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: func.call @add_10_i32(%[[VAL_74]], %[[VAL_77]], %[[VAL_66]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_78:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_78]]) +// CHECK: %[[VAL_79:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_80:.*]] = arith.subi %[[VAL_71]], %[[VAL_79]] : i32 +// CHECK: %[[VAL_81:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> // CHECK: %[[VAL_82:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_82]]) -// CHECK: %[[VAL_83:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_84:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_85:.*]] = arith.subi %[[VAL_83]], %[[VAL_84]] : i32 -// CHECK: memref.store %[[VAL_85]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_86:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_83:.*]] = arith.addi %[[VAL_81]], %[[VAL_82]] : i32 +// CHECK: %[[VAL_84:.*]] = arith.cmpi sge, %[[VAL_83]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_85:.*]] = arith.subi %[[VAL_83]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_86:.*]] = arith.select %[[VAL_84]], %[[VAL_85]], %[[VAL_83]] : i32 +// CHECK: memref.store %[[VAL_86]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> // CHECK: %[[VAL_87:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_88:.*]] = arith.addi %[[VAL_86]], %[[VAL_87]] : i32 -// CHECK: %[[VAL_89:.*]] = arith.cmpi sge, %[[VAL_88]], %[[VAL_28]] : i32 -// CHECK: %[[VAL_90:.*]] = arith.subi %[[VAL_88]], %[[VAL_28]] : i32 -// CHECK: %[[VAL_91:.*]] = arith.select %[[VAL_89]], %[[VAL_90]], %[[VAL_88]] : i32 -// CHECK: memref.store %[[VAL_91]], %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_92]]) -// CHECK: %[[VAL_93:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_95:.*]] = arith.subi %[[VAL_93]], %[[VAL_94]] : i32 -// CHECK: memref.store %[[VAL_95]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_96:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: %[[VAL_97:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_98:.*]] = arith.addi %[[VAL_96]], %[[VAL_97]] : i32 -// CHECK: %[[VAL_99:.*]] = arith.cmpi sge, %[[VAL_98]], %[[VAL_26]] : i32 -// CHECK: %[[VAL_100:.*]] = arith.subi %[[VAL_98]], %[[VAL_26]] : i32 -// CHECK: %[[VAL_101:.*]] = arith.select %[[VAL_99]], %[[VAL_100]], %[[VAL_98]] : i32 -// CHECK: memref.store %[[VAL_101]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_87]]) +// CHECK: %[[VAL_88:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_89:.*]] = arith.subi %[[VAL_63]], %[[VAL_88]] : i32 +// CHECK: %[[VAL_90:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_92:.*]] = arith.addi %[[VAL_90]], %[[VAL_91]] : i32 +// CHECK: %[[VAL_93:.*]] = arith.cmpi sge, %[[VAL_92]], %[[VAL_24]] : i32 +// CHECK: %[[VAL_94:.*]] = arith.subi %[[VAL_92]], %[[VAL_24]] : i32 +// CHECK: %[[VAL_95:.*]] = arith.select %[[VAL_93]], %[[VAL_94]], %[[VAL_92]] : i32 +// CHECK: memref.store %[[VAL_95]], %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_89]], %[[VAL_80]] : i32, i32 // CHECK: } -// CHECK: %[[VAL_102:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_104:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_105:.*]] = arith.subi %[[VAL_103]], %[[VAL_102]] : i32 -// CHECK: %[[VAL_106:.*]] = arith.maxsi %[[VAL_105]], %[[VAL_104]] : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_106]]) -// CHECK: %[[VAL_107:.*]] = arith.addi %[[VAL_102]], %[[VAL_106]] : i32 -// CHECK: memref.store %[[VAL_107]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_108:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: %[[VAL_109:.*]] = arith.index_cast %[[VAL_108]] : i32 to index -// CHECK: %[[VAL_110:.*]] = scf.index_switch %[[VAL_109]] -> memref<10xi32> +// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_97:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_98:.*]] = arith.subi %[[VAL_96]], %[[VAL_99:.*]]#0 : i32 +// CHECK: %[[VAL_100:.*]] = arith.maxsi %[[VAL_98]], %[[VAL_97]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_100]]) +// CHECK: %[[VAL_101:.*]] = arith.addi %[[VAL_99]]#0, %[[VAL_100]] : i32 +// CHECK: %[[VAL_102:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_103:.*]] = arith.index_cast %[[VAL_102]] : i32 to index +// CHECK: %[[VAL_104:.*]] = scf.index_switch %[[VAL_103]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } @@ -211,17 +191,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_111:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_112:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_113:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_114:.*]] = arith.subi %[[VAL_112]], %[[VAL_111]] : i32 -// CHECK: %[[VAL_115:.*]] = arith.maxsi %[[VAL_114]], %[[VAL_113]] : i32 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_115]]) -// CHECK: %[[VAL_116:.*]] = arith.addi %[[VAL_111]], %[[VAL_115]] : i32 -// CHECK: memref.store %[[VAL_116]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_117:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_118:.*]] = arith.index_cast %[[VAL_117]] : i32 to index -// CHECK: %[[VAL_119:.*]] = scf.index_switch %[[VAL_118]] -> memref<10xi32> +// CHECK: %[[VAL_105:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_106:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_107:.*]] = arith.subi %[[VAL_105]], %[[VAL_99]]#1 : i32 +// CHECK: %[[VAL_108:.*]] = arith.maxsi %[[VAL_107]], %[[VAL_106]] : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_108]]) +// CHECK: %[[VAL_109:.*]] = arith.addi %[[VAL_99]]#1, %[[VAL_108]] : i32 +// CHECK: %[[VAL_110:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_111:.*]] = arith.index_cast %[[VAL_110]] : i32 to index +// CHECK: %[[VAL_112:.*]] = scf.index_switch %[[VAL_111]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } @@ -234,9 +212,9 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_120:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_121:.*]] = arith.index_cast %[[VAL_120]] : i32 to index -// CHECK: %[[VAL_122:.*]] = scf.index_switch %[[VAL_121]] -> memref<10xi32> +// CHECK: %[[VAL_113:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_114:.*]] = arith.index_cast %[[VAL_113]] : i32 to index +// CHECK: %[[VAL_115:.*]] = scf.index_switch %[[VAL_114]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } @@ -249,81 +227,76 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } -// CHECK: func.call @add_10_i32(%[[VAL_119]], %[[VAL_122]], %[[VAL_110]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: %[[VAL_123:.*]] = arith.constant 2 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_123]]) -// CHECK: %[[VAL_124:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_125:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_126:.*]] = arith.subi %[[VAL_124]], %[[VAL_125]] : i32 -// CHECK: memref.store %[[VAL_126]], %[[VAL_19]]{{\[}}%[[VAL_23]]] : memref<2xi32> -// CHECK: %[[VAL_127:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_128:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_129:.*]] = arith.addi %[[VAL_127]], %[[VAL_128]] : i32 -// CHECK: %[[VAL_130:.*]] = arith.cmpi sge, %[[VAL_129]], %[[VAL_28]] : i32 -// CHECK: %[[VAL_131:.*]] = arith.subi %[[VAL_129]], %[[VAL_28]] : i32 -// CHECK: %[[VAL_132:.*]] = arith.select %[[VAL_130]], %[[VAL_131]], %[[VAL_129]] : i32 -// CHECK: memref.store %[[VAL_132]], %[[VAL_18]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_133:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_133]]) -// CHECK: %[[VAL_134:.*]] = memref.load %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_135:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_136:.*]] = arith.subi %[[VAL_134]], %[[VAL_135]] : i32 -// CHECK: memref.store %[[VAL_136]], %[[VAL_19]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_137:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> -// CHECK: %[[VAL_138:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_139:.*]] = arith.addi %[[VAL_137]], %[[VAL_138]] : i32 -// CHECK: %[[VAL_140:.*]] = arith.cmpi sge, %[[VAL_139]], %[[VAL_26]] : i32 -// CHECK: %[[VAL_141:.*]] = arith.subi %[[VAL_139]], %[[VAL_26]] : i32 -// CHECK: %[[VAL_142:.*]] = arith.select %[[VAL_140]], %[[VAL_141]], %[[VAL_139]] : i32 -// CHECK: memref.store %[[VAL_142]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: func.call @add_10_i32(%[[VAL_112]], %[[VAL_115]], %[[VAL_104]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_116:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_116]]) +// CHECK: %[[VAL_117:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_118:.*]] = arith.subi %[[VAL_109]], %[[VAL_117]] : i32 +// CHECK: %[[VAL_119:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_120:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_121:.*]] = arith.addi %[[VAL_119]], %[[VAL_120]] : i32 +// CHECK: %[[VAL_122:.*]] = arith.cmpi sge, %[[VAL_121]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_123:.*]] = arith.subi %[[VAL_121]], %[[VAL_26]] : i32 +// CHECK: %[[VAL_124:.*]] = arith.select %[[VAL_122]], %[[VAL_123]], %[[VAL_121]] : i32 +// CHECK: memref.store %[[VAL_124]], %[[VAL_18]]{{\[}}%[[VAL_25]]] : memref<2xi32> +// CHECK: %[[VAL_125:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_125]]) +// CHECK: %[[VAL_126:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_127:.*]] = arith.subi %[[VAL_101]], %[[VAL_126]] : i32 +// CHECK: %[[VAL_128:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> +// CHECK: %[[VAL_129:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_130:.*]] = arith.addi %[[VAL_128]], %[[VAL_129]] : i32 +// CHECK: %[[VAL_131:.*]] = arith.cmpi sge, %[[VAL_130]], %[[VAL_24]] : i32 +// CHECK: %[[VAL_132:.*]] = arith.subi %[[VAL_130]], %[[VAL_24]] : i32 +// CHECK: %[[VAL_133:.*]] = arith.select %[[VAL_131]], %[[VAL_132]], %[[VAL_130]] : i32 +// CHECK: memref.store %[[VAL_133]], %[[VAL_18]]{{\[}}%[[VAL_23]]] : memref<2xi32> // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_3]], MM2S, 0) -// CHECK: %[[VAL_143:.*]] = aie.mem(%[[VAL_4]]) { -// CHECK: %[[VAL_144:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) +// CHECK: %[[VAL_134:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_135:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: -// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_145]]) +// CHECK: %[[VAL_136:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_136]]) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_146:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_146]]) +// CHECK: %[[VAL_137:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_137]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_147:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_147]]) +// CHECK: %[[VAL_138:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_138]]) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_148:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_148]]) +// CHECK: %[[VAL_139:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_139]]) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: -// CHECK: %[[VAL_149:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_149]]) +// CHECK: %[[VAL_140:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_140]]) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_150:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_150]]) +// CHECK: %[[VAL_141:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_141]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: -// CHECK: %[[VAL_151:.*]] = aie.dma_start(MM2S, 0, ^bb5, ^bb7) +// CHECK: %[[VAL_142:.*]] = aie.dma_start(MM2S, 0, ^bb5, ^bb7) // CHECK: ^bb5: -// CHECK: %[[VAL_152:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_152]]) +// CHECK: %[[VAL_143:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_143]]) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_153:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_153]]) +// CHECK: %[[VAL_144:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_144]]) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: -// CHECK: %[[VAL_154:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_154]]) +// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_145]]) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_155:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_155]]) +// CHECK: %[[VAL_146:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_146]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb7: // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_3]], S2MM, 0) // CHECK: } -// CHECK: } module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir index be37de92d3e..3dc64ef3268 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/pass_flag_test.mlir @@ -7,8 +7,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform=dynamic-objFifos %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu1_1col) { +// CHECK-LABEL: aie.device(npu1_1col) { // CHECK: func.func @passthrough_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>) { // CHECK: return // CHECK: } @@ -44,33 +43,27 @@ // CHECK: aie.flow(%[[VAL_2]], DMA : 1, %[[VAL_4]], DMA : 0) // CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_2]], DMA : 1) // CHECK: %[[VAL_29:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> -// CHECK: %[[VAL_30:.*]] = aie.buffer(%[[VAL_3]]) : memref<2xi32> -// CHECK: %[[VAL_31:.*]] = aie.core(%[[VAL_3]]) { +// CHECK: %[[VAL_30:.*]] = aie.core(%[[VAL_3]]) { +// CHECK: %[[VAL_31:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_32:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_33:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> -// CHECK: %[[VAL_34:.*]] = arith.constant 1 : index -// CHECK: memref.store %[[VAL_32]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_35:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_36:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_33:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_34:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_35:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_33]], %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: %[[VAL_36:.*]] = arith.constant 1 : index // CHECK: %[[VAL_37:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> -// CHECK: %[[VAL_38:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_39:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_35]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_40:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_41:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_42:.*]] = arith.constant 10 : index -// CHECK: scf.for %[[VAL_43:.*]] = %[[VAL_40]] to %[[VAL_42]] step %[[VAL_41]] { -// CHECK: %[[VAL_44:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: memref.store %[[VAL_33]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_39:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_40:.*]] = arith.constant 10 : index +// CHECK: %[[VAL_41:.*]]:2 = scf.for %[[VAL_42:.*]] = %[[VAL_38]] to %[[VAL_40]] step %[[VAL_39]] iter_args(%[[VAL_43:.*]] = %[[VAL_32]], %[[VAL_44:.*]] = %[[VAL_31]]) -> (i32, i32) { // CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 // CHECK: %[[VAL_46:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_45]], %[[VAL_44]] : i32 +// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_45]], %[[VAL_43]] : i32 // CHECK: %[[VAL_48:.*]] = arith.maxsi %[[VAL_47]], %[[VAL_46]] : i32 // CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_48]]) -// CHECK: %[[VAL_49:.*]] = arith.addi %[[VAL_44]], %[[VAL_48]] : i32 -// CHECK: memref.store %[[VAL_49]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> -// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_49:.*]] = arith.addi %[[VAL_43]], %[[VAL_48]] : i32 +// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> // CHECK: %[[VAL_51:.*]] = arith.index_cast %[[VAL_50]] : i32 to index // CHECK: %[[VAL_52:.*]] = scf.index_switch %[[VAL_51]] -> memref<10xi32> // CHECK: case 0 { @@ -82,17 +75,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_19]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_55:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_56:.*]] = arith.subi %[[VAL_54]], %[[VAL_53]] : i32 -// CHECK: %[[VAL_57:.*]] = arith.maxsi %[[VAL_56]], %[[VAL_55]] : i32 -// CHECK: aie.use_lock(%[[VAL_26]], AcquireGreaterEqual, %[[VAL_57]]) -// CHECK: %[[VAL_58:.*]] = arith.addi %[[VAL_53]], %[[VAL_57]] : i32 -// CHECK: memref.store %[[VAL_58]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_59:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_60:.*]] = arith.index_cast %[[VAL_59]] : i32 to index -// CHECK: %[[VAL_61:.*]] = scf.index_switch %[[VAL_60]] -> memref<10xi32> +// CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_54:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_55:.*]] = arith.subi %[[VAL_53]], %[[VAL_44]] : i32 +// CHECK: %[[VAL_56:.*]] = arith.maxsi %[[VAL_55]], %[[VAL_54]] : i32 +// CHECK: aie.use_lock(%[[VAL_26]], AcquireGreaterEqual, %[[VAL_56]]) +// CHECK: %[[VAL_57:.*]] = arith.addi %[[VAL_44]], %[[VAL_56]] : i32 +// CHECK: %[[VAL_58:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_59:.*]] = arith.index_cast %[[VAL_58]] : i32 to index +// CHECK: %[[VAL_60:.*]] = scf.index_switch %[[VAL_59]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_23]] : memref<10xi32> // CHECK: } @@ -102,66 +93,57 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_23]] : memref<10xi32> // CHECK: } -// CHECK: func.call @passthrough_10_i32(%[[VAL_61]], %[[VAL_52]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: func.call @passthrough_10_i32(%[[VAL_60]], %[[VAL_52]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], Release, %[[VAL_61]]) // CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_25]], Release, %[[VAL_62]]) -// CHECK: %[[VAL_63:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_64:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_65:.*]] = arith.subi %[[VAL_63]], %[[VAL_64]] : i32 -// CHECK: memref.store %[[VAL_65]], %[[VAL_30]]{{\[}}%[[VAL_34]]] : memref<2xi32> -// CHECK: %[[VAL_66:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_67:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_68:.*]] = arith.addi %[[VAL_66]], %[[VAL_67]] : i32 -// CHECK: %[[VAL_69:.*]] = arith.cmpi sge, %[[VAL_68]], %[[VAL_39]] : i32 -// CHECK: %[[VAL_70:.*]] = arith.subi %[[VAL_68]], %[[VAL_39]] : i32 -// CHECK: %[[VAL_71:.*]] = arith.select %[[VAL_69]], %[[VAL_70]], %[[VAL_68]] : i32 -// CHECK: memref.store %[[VAL_71]], %[[VAL_29]]{{\[}}%[[VAL_38]]] : memref<2xi32> -// CHECK: %[[VAL_72:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_22]], Release, %[[VAL_72]]) -// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> +// CHECK: %[[VAL_63:.*]] = arith.subi %[[VAL_57]], %[[VAL_62]] : i32 +// CHECK: %[[VAL_64:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_65:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_66:.*]] = arith.addi %[[VAL_64]], %[[VAL_65]] : i32 +// CHECK: %[[VAL_67:.*]] = arith.cmpi sge, %[[VAL_66]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_68:.*]] = arith.subi %[[VAL_66]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_69:.*]] = arith.select %[[VAL_67]], %[[VAL_68]], %[[VAL_66]] : i32 +// CHECK: memref.store %[[VAL_69]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_70:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], Release, %[[VAL_70]]) +// CHECK: %[[VAL_71:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_72:.*]] = arith.subi %[[VAL_49]], %[[VAL_71]] : i32 +// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> // CHECK: %[[VAL_74:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_75:.*]] = arith.subi %[[VAL_73]], %[[VAL_74]] : i32 -// CHECK: memref.store %[[VAL_75]], %[[VAL_30]]{{\[}}%[[VAL_33]]] : memref<2xi32> -// CHECK: %[[VAL_76:.*]] = memref.load %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> -// CHECK: %[[VAL_77:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_78:.*]] = arith.addi %[[VAL_76]], %[[VAL_77]] : i32 -// CHECK: %[[VAL_79:.*]] = arith.cmpi sge, %[[VAL_78]], %[[VAL_37]] : i32 -// CHECK: %[[VAL_80:.*]] = arith.subi %[[VAL_78]], %[[VAL_37]] : i32 -// CHECK: %[[VAL_81:.*]] = arith.select %[[VAL_79]], %[[VAL_80]], %[[VAL_78]] : i32 -// CHECK: memref.store %[[VAL_81]], %[[VAL_29]]{{\[}}%[[VAL_36]]] : memref<2xi32> +// CHECK: %[[VAL_75:.*]] = arith.addi %[[VAL_73]], %[[VAL_74]] : i32 +// CHECK: %[[VAL_76:.*]] = arith.cmpi sge, %[[VAL_75]], %[[VAL_35]] : i32 +// CHECK: %[[VAL_77:.*]] = arith.subi %[[VAL_75]], %[[VAL_35]] : i32 +// CHECK: %[[VAL_78:.*]] = arith.select %[[VAL_76]], %[[VAL_77]], %[[VAL_75]] : i32 +// CHECK: memref.store %[[VAL_78]], %[[VAL_29]]{{\[}}%[[VAL_34]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_72]], %[[VAL_63]] : i32, i32 // CHECK: } // CHECK: aie.end // CHECK: } {dynamic_objfifo_lowering = false} -// CHECK: %[[VAL_82:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> -// CHECK: %[[VAL_83:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> -// CHECK: %[[VAL_84:.*]] = aie.core(%[[VAL_4]]) { -// CHECK: %[[VAL_85:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_86:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_85]], %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> -// CHECK: %[[VAL_87:.*]] = arith.constant 1 : index -// CHECK: memref.store %[[VAL_85]], %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> -// CHECK: %[[VAL_88:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_89:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_90:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_88]], %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> -// CHECK: %[[VAL_91:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_92:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_88]], %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> -// CHECK: %[[VAL_93:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_94:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_95:.*]] = arith.constant 10 : index -// CHECK: scf.for %[[VAL_96:.*]] = %[[VAL_93]] to %[[VAL_95]] step %[[VAL_94]] { -// CHECK: %[[VAL_97:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> -// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_99:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_100:.*]] = arith.subi %[[VAL_98]], %[[VAL_97]] : i32 -// CHECK: %[[VAL_101:.*]] = arith.maxsi %[[VAL_100]], %[[VAL_99]] : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_101]]) -// CHECK: %[[VAL_102:.*]] = arith.addi %[[VAL_97]], %[[VAL_101]] : i32 -// CHECK: memref.store %[[VAL_102]], %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> -// CHECK: %[[VAL_103:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> -// CHECK: %[[VAL_104:.*]] = arith.index_cast %[[VAL_103]] : i32 to index -// CHECK: %[[VAL_105:.*]] = scf.index_switch %[[VAL_104]] -> memref<10xi32> +// CHECK: %[[VAL_79:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> +// CHECK: %[[VAL_80:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_81:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_82:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_83:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_84:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_85:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_83]], %[[VAL_79]]{{\[}}%[[VAL_84]]] : memref<2xi32> +// CHECK: %[[VAL_86:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_87:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_83]], %[[VAL_79]]{{\[}}%[[VAL_86]]] : memref<2xi32> +// CHECK: %[[VAL_88:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_89:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_90:.*]] = arith.constant 10 : index +// CHECK: %[[VAL_91:.*]]:2 = scf.for %[[VAL_92:.*]] = %[[VAL_88]] to %[[VAL_90]] step %[[VAL_89]] iter_args(%[[VAL_93:.*]] = %[[VAL_82]], %[[VAL_94:.*]] = %[[VAL_81]]) -> (i32, i32) { +// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_96:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_97:.*]] = arith.subi %[[VAL_95]], %[[VAL_93]] : i32 +// CHECK: %[[VAL_98:.*]] = arith.maxsi %[[VAL_97]], %[[VAL_96]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_98]]) +// CHECK: %[[VAL_99:.*]] = arith.addi %[[VAL_93]], %[[VAL_98]] : i32 +// CHECK: %[[VAL_100:.*]] = memref.load %[[VAL_79]]{{\[}}%[[VAL_84]]] : memref<2xi32> +// CHECK: %[[VAL_101:.*]] = arith.index_cast %[[VAL_100]] : i32 to index +// CHECK: %[[VAL_102:.*]] = scf.index_switch %[[VAL_101]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } @@ -171,17 +153,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_106:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> -// CHECK: %[[VAL_107:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_108:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_109:.*]] = arith.subi %[[VAL_107]], %[[VAL_106]] : i32 -// CHECK: %[[VAL_110:.*]] = arith.maxsi %[[VAL_109]], %[[VAL_108]] : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_110]]) -// CHECK: %[[VAL_111:.*]] = arith.addi %[[VAL_106]], %[[VAL_110]] : i32 -// CHECK: memref.store %[[VAL_111]], %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> -// CHECK: %[[VAL_112:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> -// CHECK: %[[VAL_113:.*]] = arith.index_cast %[[VAL_112]] : i32 to index -// CHECK: %[[VAL_114:.*]] = scf.index_switch %[[VAL_113]] -> memref<10xi32> +// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_104:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_105:.*]] = arith.subi %[[VAL_103]], %[[VAL_94]] : i32 +// CHECK: %[[VAL_106:.*]] = arith.maxsi %[[VAL_105]], %[[VAL_104]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_106]]) +// CHECK: %[[VAL_107:.*]] = arith.addi %[[VAL_94]], %[[VAL_106]] : i32 +// CHECK: %[[VAL_108:.*]] = memref.load %[[VAL_79]]{{\[}}%[[VAL_86]]] : memref<2xi32> +// CHECK: %[[VAL_109:.*]] = arith.index_cast %[[VAL_108]] : i32 to index +// CHECK: %[[VAL_110:.*]] = scf.index_switch %[[VAL_109]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } @@ -191,112 +171,108 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } -// CHECK: func.call @passthrough_10_i32(%[[VAL_114]], %[[VAL_105]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: func.call @passthrough_10_i32(%[[VAL_110]], %[[VAL_102]]) : (memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_111]]) +// CHECK: %[[VAL_112:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_113:.*]] = arith.subi %[[VAL_107]], %[[VAL_112]] : i32 +// CHECK: %[[VAL_114:.*]] = memref.load %[[VAL_79]]{{\[}}%[[VAL_86]]] : memref<2xi32> // CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_115]]) -// CHECK: %[[VAL_116:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> -// CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_118:.*]] = arith.subi %[[VAL_116]], %[[VAL_117]] : i32 -// CHECK: memref.store %[[VAL_118]], %[[VAL_83]]{{\[}}%[[VAL_87]]] : memref<2xi32> -// CHECK: %[[VAL_119:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> +// CHECK: %[[VAL_116:.*]] = arith.addi %[[VAL_114]], %[[VAL_115]] : i32 +// CHECK: %[[VAL_117:.*]] = arith.cmpi sge, %[[VAL_116]], %[[VAL_87]] : i32 +// CHECK: %[[VAL_118:.*]] = arith.subi %[[VAL_116]], %[[VAL_87]] : i32 +// CHECK: %[[VAL_119:.*]] = arith.select %[[VAL_117]], %[[VAL_118]], %[[VAL_116]] : i32 +// CHECK: memref.store %[[VAL_119]], %[[VAL_79]]{{\[}}%[[VAL_86]]] : memref<2xi32> // CHECK: %[[VAL_120:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_121:.*]] = arith.addi %[[VAL_119]], %[[VAL_120]] : i32 -// CHECK: %[[VAL_122:.*]] = arith.cmpi sge, %[[VAL_121]], %[[VAL_92]] : i32 -// CHECK: %[[VAL_123:.*]] = arith.subi %[[VAL_121]], %[[VAL_92]] : i32 -// CHECK: %[[VAL_124:.*]] = arith.select %[[VAL_122]], %[[VAL_123]], %[[VAL_121]] : i32 -// CHECK: memref.store %[[VAL_124]], %[[VAL_82]]{{\[}}%[[VAL_91]]] : memref<2xi32> -// CHECK: %[[VAL_125:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_125]]) -// CHECK: %[[VAL_126:.*]] = memref.load %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> -// CHECK: %[[VAL_127:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_128:.*]] = arith.subi %[[VAL_126]], %[[VAL_127]] : i32 -// CHECK: memref.store %[[VAL_128]], %[[VAL_83]]{{\[}}%[[VAL_86]]] : memref<2xi32> -// CHECK: %[[VAL_129:.*]] = memref.load %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> -// CHECK: %[[VAL_130:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_131:.*]] = arith.addi %[[VAL_129]], %[[VAL_130]] : i32 -// CHECK: %[[VAL_132:.*]] = arith.cmpi sge, %[[VAL_131]], %[[VAL_90]] : i32 -// CHECK: %[[VAL_133:.*]] = arith.subi %[[VAL_131]], %[[VAL_90]] : i32 -// CHECK: %[[VAL_134:.*]] = arith.select %[[VAL_132]], %[[VAL_133]], %[[VAL_131]] : i32 -// CHECK: memref.store %[[VAL_134]], %[[VAL_82]]{{\[}}%[[VAL_89]]] : memref<2xi32> +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_120]]) +// CHECK: %[[VAL_121:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_122:.*]] = arith.subi %[[VAL_99]], %[[VAL_121]] : i32 +// CHECK: %[[VAL_123:.*]] = memref.load %[[VAL_79]]{{\[}}%[[VAL_84]]] : memref<2xi32> +// CHECK: %[[VAL_124:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_125:.*]] = arith.addi %[[VAL_123]], %[[VAL_124]] : i32 +// CHECK: %[[VAL_126:.*]] = arith.cmpi sge, %[[VAL_125]], %[[VAL_85]] : i32 +// CHECK: %[[VAL_127:.*]] = arith.subi %[[VAL_125]], %[[VAL_85]] : i32 +// CHECK: %[[VAL_128:.*]] = arith.select %[[VAL_126]], %[[VAL_127]], %[[VAL_125]] : i32 +// CHECK: memref.store %[[VAL_128]], %[[VAL_79]]{{\[}}%[[VAL_84]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_122]], %[[VAL_113]] : i32, i32 // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_2]], MM2S, 0) -// CHECK: %[[VAL_135:.*]] = aie.mem(%[[VAL_3]]) { -// CHECK: %[[VAL_136:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: %[[VAL_129:.*]] = aie.mem(%[[VAL_3]]) { +// CHECK: %[[VAL_130:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: %[[VAL_137:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_137]]) +// CHECK: %[[VAL_131:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_131]]) // CHECK: aie.dma_bd(%[[VAL_23]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_138:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_138]]) +// CHECK: %[[VAL_132:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_132]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_139:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_139]]) +// CHECK: %[[VAL_133:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_25]], AcquireGreaterEqual, %[[VAL_133]]) // CHECK: aie.dma_bd(%[[VAL_24]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_140:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_140]]) +// CHECK: %[[VAL_134:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_26]], Release, %[[VAL_134]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: -// CHECK: %[[VAL_141:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: %[[VAL_135:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: %[[VAL_142:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_142]]) +// CHECK: %[[VAL_136:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_136]]) // CHECK: aie.dma_bd(%[[VAL_19]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_143:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_143]]) +// CHECK: %[[VAL_137:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_137]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: %[[VAL_144:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_144]]) +// CHECK: %[[VAL_138:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_138]]) // CHECK: aie.dma_bd(%[[VAL_20]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_145]]) +// CHECK: %[[VAL_139:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_139]]) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_2]], S2MM, 0) // CHECK: aie.shim_dma_allocation @input_fifo2_shim_alloc(%[[VAL_2]], MM2S, 1) -// CHECK: %[[VAL_146:.*]] = aie.mem(%[[VAL_4]]) { -// CHECK: %[[VAL_147:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: %[[VAL_140:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_141:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: %[[VAL_148:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_148]]) +// CHECK: %[[VAL_142:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_142]]) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_149:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_149]]) +// CHECK: %[[VAL_143:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_143]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_150:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_150]]) +// CHECK: %[[VAL_144:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_144]]) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_151:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_151]]) +// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_145]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: -// CHECK: %[[VAL_152:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: %[[VAL_146:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: %[[VAL_153:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_153]]) +// CHECK: %[[VAL_147:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_147]]) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_154:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_154]]) +// CHECK: %[[VAL_148:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_148]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: %[[VAL_155:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_155]]) +// CHECK: %[[VAL_149:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_149]]) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_156:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_156]]) +// CHECK: %[[VAL_150:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_150]]) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @output_fifo2_shim_alloc(%[[VAL_2]], S2MM, 1) // CHECK: } -// CHECK: } module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir b/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir index 927ca6b88a9..19b2eb16473 100644 --- a/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir +++ b/test/objectFifo-stateful-transform/dynamic_lowering/same_depth_objectfifos_test.mlir @@ -7,8 +7,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform=dynamic-objFifos %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu1_1col) { +// CHECK-LABEL: aie.device(npu1_1col) { // CHECK: func.func @add_10_i32(%[[VAL_0:.*]]: memref<10xi32>, %[[VAL_1:.*]]: memref<10xi32>, %[[VAL_2:.*]]: memref<10xi32>) { // CHECK: return // CHECK: } @@ -29,34 +28,28 @@ // CHECK: aie.flow(%[[VAL_3]], DMA : 0, %[[VAL_4]], DMA : 0) // CHECK: aie.flow(%[[VAL_4]], DMA : 0, %[[VAL_3]], DMA : 0) // CHECK: %[[VAL_17:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> -// CHECK: %[[VAL_18:.*]] = aie.buffer(%[[VAL_4]]) : memref<2xi32> -// CHECK: %[[VAL_19:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_18:.*]] = aie.core(%[[VAL_4]]) { +// CHECK: %[[VAL_19:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_20:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_21:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_20]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_22:.*]] = arith.constant 1 : index -// CHECK: memref.store %[[VAL_20]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_23:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_24:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_21:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_22:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_23:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_21]], %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_24:.*]] = arith.constant 1 : index // CHECK: %[[VAL_25:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_23]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: %[[VAL_26:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_27:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_23]], %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_28:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_29:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_30:.*]] = arith.constant 9 : index -// CHECK: %[[VAL_31:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_33:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_34:.*]] = arith.subi %[[VAL_32]], %[[VAL_31]] : i32 -// CHECK: %[[VAL_35:.*]] = arith.maxsi %[[VAL_34]], %[[VAL_33]] : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_35]]) -// CHECK: %[[VAL_36:.*]] = arith.addi %[[VAL_31]], %[[VAL_35]] : i32 -// CHECK: memref.store %[[VAL_36]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: %[[VAL_38:.*]] = arith.index_cast %[[VAL_37]] : i32 to index -// CHECK: %[[VAL_39:.*]] = scf.index_switch %[[VAL_38]] -> memref<10xi32> +// CHECK: memref.store %[[VAL_21]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_26:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_27:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_28:.*]] = arith.constant 9 : index +// CHECK: %[[VAL_29:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_30:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_31:.*]] = arith.subi %[[VAL_29]], %[[VAL_20]] : i32 +// CHECK: %[[VAL_32:.*]] = arith.maxsi %[[VAL_31]], %[[VAL_30]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_32]]) +// CHECK: %[[VAL_33:.*]] = arith.addi %[[VAL_20]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_34:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_35:.*]] = arith.index_cast %[[VAL_34]] : i32 to index +// CHECK: %[[VAL_36:.*]] = scf.index_switch %[[VAL_35]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } @@ -66,17 +59,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_40:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_41:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_42:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_43:.*]] = arith.subi %[[VAL_41]], %[[VAL_40]] : i32 -// CHECK: %[[VAL_44:.*]] = arith.maxsi %[[VAL_43]], %[[VAL_42]] : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_44]]) -// CHECK: %[[VAL_45:.*]] = arith.addi %[[VAL_40]], %[[VAL_44]] : i32 -// CHECK: memref.store %[[VAL_45]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_46:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_47:.*]] = arith.index_cast %[[VAL_46]] : i32 to index -// CHECK: %[[VAL_48:.*]] = scf.index_switch %[[VAL_47]] -> memref<10xi32> +// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_38:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_39:.*]] = arith.subi %[[VAL_37]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_40:.*]] = arith.maxsi %[[VAL_39]], %[[VAL_38]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_40]]) +// CHECK: %[[VAL_41:.*]] = arith.addi %[[VAL_19]], %[[VAL_40]] : i32 +// CHECK: %[[VAL_42:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_43:.*]] = arith.index_cast %[[VAL_42]] : i32 to index +// CHECK: %[[VAL_44:.*]] = scf.index_switch %[[VAL_43]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } @@ -86,32 +77,28 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } -// CHECK: func.call @add_10_i32(%[[VAL_48]], %[[VAL_48]], %[[VAL_39]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: func.call @add_10_i32(%[[VAL_44]], %[[VAL_44]], %[[VAL_36]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_45]]) +// CHECK: %[[VAL_46:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_33]], %[[VAL_46]] : i32 +// CHECK: %[[VAL_48:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> // CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_49]]) -// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_52:.*]] = arith.subi %[[VAL_50]], %[[VAL_51]] : i32 -// CHECK: memref.store %[[VAL_52]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_55:.*]] = arith.addi %[[VAL_53]], %[[VAL_54]] : i32 -// CHECK: %[[VAL_56:.*]] = arith.cmpi sge, %[[VAL_55]], %[[VAL_25]] : i32 -// CHECK: %[[VAL_57:.*]] = arith.subi %[[VAL_55]], %[[VAL_25]] : i32 -// CHECK: %[[VAL_58:.*]] = arith.select %[[VAL_56]], %[[VAL_57]], %[[VAL_55]] : i32 -// CHECK: memref.store %[[VAL_58]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: scf.for %[[VAL_59:.*]] = %[[VAL_28]] to %[[VAL_30]] step %[[VAL_29]] { -// CHECK: %[[VAL_60:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_62:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_63:.*]] = arith.subi %[[VAL_61]], %[[VAL_60]] : i32 -// CHECK: %[[VAL_64:.*]] = arith.maxsi %[[VAL_63]], %[[VAL_62]] : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_64]]) -// CHECK: %[[VAL_65:.*]] = arith.addi %[[VAL_60]], %[[VAL_64]] : i32 -// CHECK: memref.store %[[VAL_65]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_66:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: %[[VAL_67:.*]] = arith.index_cast %[[VAL_66]] : i32 to index -// CHECK: %[[VAL_68:.*]] = scf.index_switch %[[VAL_67]] -> memref<10xi32> +// CHECK: %[[VAL_50:.*]] = arith.addi %[[VAL_48]], %[[VAL_49]] : i32 +// CHECK: %[[VAL_51:.*]] = arith.cmpi sge, %[[VAL_50]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_52:.*]] = arith.subi %[[VAL_50]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_53:.*]] = arith.select %[[VAL_51]], %[[VAL_52]], %[[VAL_50]] : i32 +// CHECK: memref.store %[[VAL_53]], %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_54:.*]]:2 = scf.for %[[VAL_55:.*]] = %[[VAL_26]] to %[[VAL_28]] step %[[VAL_27]] iter_args(%[[VAL_56:.*]] = %[[VAL_47]], %[[VAL_57:.*]] = %[[VAL_41]]) -> (i32, i32) { +// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_59:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_60:.*]] = arith.subi %[[VAL_58]], %[[VAL_56]] : i32 +// CHECK: %[[VAL_61:.*]] = arith.maxsi %[[VAL_60]], %[[VAL_59]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_61]]) +// CHECK: %[[VAL_62:.*]] = arith.addi %[[VAL_56]], %[[VAL_61]] : i32 +// CHECK: %[[VAL_63:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_64:.*]] = arith.index_cast %[[VAL_63]] : i32 to index +// CHECK: %[[VAL_65:.*]] = scf.index_switch %[[VAL_64]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } @@ -121,17 +108,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_69:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_70:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_71:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_72:.*]] = arith.subi %[[VAL_70]], %[[VAL_69]] : i32 -// CHECK: %[[VAL_73:.*]] = arith.maxsi %[[VAL_72]], %[[VAL_71]] : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_73]]) -// CHECK: %[[VAL_74:.*]] = arith.addi %[[VAL_69]], %[[VAL_73]] : i32 -// CHECK: memref.store %[[VAL_74]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_75:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_76:.*]] = arith.index_cast %[[VAL_75]] : i32 to index -// CHECK: %[[VAL_77:.*]] = scf.index_switch %[[VAL_76]] -> memref<10xi32> +// CHECK: %[[VAL_66:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_67:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_68:.*]] = arith.subi %[[VAL_66]], %[[VAL_57]] : i32 +// CHECK: %[[VAL_69:.*]] = arith.maxsi %[[VAL_68]], %[[VAL_67]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_69]]) +// CHECK: %[[VAL_70:.*]] = arith.addi %[[VAL_57]], %[[VAL_69]] : i32 +// CHECK: %[[VAL_71:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_72:.*]] = arith.index_cast %[[VAL_71]] : i32 to index +// CHECK: %[[VAL_73:.*]] = scf.index_switch %[[VAL_72]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } @@ -141,9 +126,9 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_78:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_79:.*]] = arith.index_cast %[[VAL_78]] : i32 to index -// CHECK: %[[VAL_80:.*]] = scf.index_switch %[[VAL_79]] -> memref<10xi32> +// CHECK: %[[VAL_74:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_75:.*]] = arith.index_cast %[[VAL_74]] : i32 to index +// CHECK: %[[VAL_76:.*]] = scf.index_switch %[[VAL_75]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } @@ -153,45 +138,40 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } -// CHECK: func.call @add_10_i32(%[[VAL_77]], %[[VAL_80]], %[[VAL_68]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: func.call @add_10_i32(%[[VAL_73]], %[[VAL_76]], %[[VAL_65]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_77:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_77]]) +// CHECK: %[[VAL_78:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_79:.*]] = arith.subi %[[VAL_70]], %[[VAL_78]] : i32 +// CHECK: %[[VAL_80:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> // CHECK: %[[VAL_81:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_81]]) -// CHECK: %[[VAL_82:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_83:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_84:.*]] = arith.subi %[[VAL_82]], %[[VAL_83]] : i32 -// CHECK: memref.store %[[VAL_84]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_85:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_82:.*]] = arith.addi %[[VAL_80]], %[[VAL_81]] : i32 +// CHECK: %[[VAL_83:.*]] = arith.cmpi sge, %[[VAL_82]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_84:.*]] = arith.subi %[[VAL_82]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_85:.*]] = arith.select %[[VAL_83]], %[[VAL_84]], %[[VAL_82]] : i32 +// CHECK: memref.store %[[VAL_85]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> // CHECK: %[[VAL_86:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_87:.*]] = arith.addi %[[VAL_85]], %[[VAL_86]] : i32 -// CHECK: %[[VAL_88:.*]] = arith.cmpi sge, %[[VAL_87]], %[[VAL_27]] : i32 -// CHECK: %[[VAL_89:.*]] = arith.subi %[[VAL_87]], %[[VAL_27]] : i32 -// CHECK: %[[VAL_90:.*]] = arith.select %[[VAL_88]], %[[VAL_89]], %[[VAL_87]] : i32 -// CHECK: memref.store %[[VAL_90]], %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_91]]) -// CHECK: %[[VAL_92:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_94:.*]] = arith.subi %[[VAL_92]], %[[VAL_93]] : i32 -// CHECK: memref.store %[[VAL_94]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_95:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_97:.*]] = arith.addi %[[VAL_95]], %[[VAL_96]] : i32 -// CHECK: %[[VAL_98:.*]] = arith.cmpi sge, %[[VAL_97]], %[[VAL_25]] : i32 -// CHECK: %[[VAL_99:.*]] = arith.subi %[[VAL_97]], %[[VAL_25]] : i32 -// CHECK: %[[VAL_100:.*]] = arith.select %[[VAL_98]], %[[VAL_99]], %[[VAL_97]] : i32 -// CHECK: memref.store %[[VAL_100]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_86]]) +// CHECK: %[[VAL_87:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_88:.*]] = arith.subi %[[VAL_62]], %[[VAL_87]] : i32 +// CHECK: %[[VAL_89:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_90:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_91:.*]] = arith.addi %[[VAL_89]], %[[VAL_90]] : i32 +// CHECK: %[[VAL_92:.*]] = arith.cmpi sge, %[[VAL_91]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_93:.*]] = arith.subi %[[VAL_91]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_94:.*]] = arith.select %[[VAL_92]], %[[VAL_93]], %[[VAL_91]] : i32 +// CHECK: memref.store %[[VAL_94]], %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_88]], %[[VAL_79]] : i32, i32 // CHECK: } -// CHECK: %[[VAL_101:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_102:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_103:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_104:.*]] = arith.subi %[[VAL_102]], %[[VAL_101]] : i32 -// CHECK: %[[VAL_105:.*]] = arith.maxsi %[[VAL_104]], %[[VAL_103]] : i32 -// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_105]]) -// CHECK: %[[VAL_106:.*]] = arith.addi %[[VAL_101]], %[[VAL_105]] : i32 -// CHECK: memref.store %[[VAL_106]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_107:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: %[[VAL_108:.*]] = arith.index_cast %[[VAL_107]] : i32 to index -// CHECK: %[[VAL_109:.*]] = scf.index_switch %[[VAL_108]] -> memref<10xi32> +// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_96:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_97:.*]] = arith.subi %[[VAL_95]], %[[VAL_98:.*]]#0 : i32 +// CHECK: %[[VAL_99:.*]] = arith.maxsi %[[VAL_97]], %[[VAL_96]] : i32 +// CHECK: aie.use_lock(%[[VAL_9]], AcquireGreaterEqual, %[[VAL_99]]) +// CHECK: %[[VAL_100:.*]] = arith.addi %[[VAL_98]]#0, %[[VAL_99]] : i32 +// CHECK: %[[VAL_101:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_102:.*]] = arith.index_cast %[[VAL_101]] : i32 to index +// CHECK: %[[VAL_103:.*]] = scf.index_switch %[[VAL_102]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } @@ -201,17 +181,15 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_7]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_110:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_111:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_112:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_113:.*]] = arith.subi %[[VAL_111]], %[[VAL_110]] : i32 -// CHECK: %[[VAL_114:.*]] = arith.maxsi %[[VAL_113]], %[[VAL_112]] : i32 -// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_114]]) -// CHECK: %[[VAL_115:.*]] = arith.addi %[[VAL_110]], %[[VAL_114]] : i32 -// CHECK: memref.store %[[VAL_115]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_116:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_117:.*]] = arith.index_cast %[[VAL_116]] : i32 to index -// CHECK: %[[VAL_118:.*]] = scf.index_switch %[[VAL_117]] -> memref<10xi32> +// CHECK: %[[VAL_104:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_105:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_106:.*]] = arith.subi %[[VAL_104]], %[[VAL_98]]#1 : i32 +// CHECK: %[[VAL_107:.*]] = arith.maxsi %[[VAL_106]], %[[VAL_105]] : i32 +// CHECK: aie.use_lock(%[[VAL_14]], AcquireGreaterEqual, %[[VAL_107]]) +// CHECK: %[[VAL_108:.*]] = arith.addi %[[VAL_98]]#1, %[[VAL_107]] : i32 +// CHECK: %[[VAL_109:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_110:.*]] = arith.index_cast %[[VAL_109]] : i32 to index +// CHECK: %[[VAL_111:.*]] = scf.index_switch %[[VAL_110]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } @@ -221,9 +199,9 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_11]] : memref<10xi32> // CHECK: } -// CHECK: %[[VAL_119:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_120:.*]] = arith.index_cast %[[VAL_119]] : i32 to index -// CHECK: %[[VAL_121:.*]] = scf.index_switch %[[VAL_120]] -> memref<10xi32> +// CHECK: %[[VAL_112:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_113:.*]] = arith.index_cast %[[VAL_112]] : i32 to index +// CHECK: %[[VAL_114:.*]] = scf.index_switch %[[VAL_113]] -> memref<10xi32> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } @@ -233,74 +211,69 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_12]] : memref<10xi32> // CHECK: } -// CHECK: func.call @add_10_i32(%[[VAL_118]], %[[VAL_121]], %[[VAL_109]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () -// CHECK: %[[VAL_122:.*]] = arith.constant 2 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_122]]) -// CHECK: %[[VAL_123:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_124:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_125:.*]] = arith.subi %[[VAL_123]], %[[VAL_124]] : i32 -// CHECK: memref.store %[[VAL_125]], %[[VAL_18]]{{\[}}%[[VAL_22]]] : memref<2xi32> -// CHECK: %[[VAL_126:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_127:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_128:.*]] = arith.addi %[[VAL_126]], %[[VAL_127]] : i32 -// CHECK: %[[VAL_129:.*]] = arith.cmpi sge, %[[VAL_128]], %[[VAL_27]] : i32 -// CHECK: %[[VAL_130:.*]] = arith.subi %[[VAL_128]], %[[VAL_27]] : i32 -// CHECK: %[[VAL_131:.*]] = arith.select %[[VAL_129]], %[[VAL_130]], %[[VAL_128]] : i32 -// CHECK: memref.store %[[VAL_131]], %[[VAL_17]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_132:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_132]]) -// CHECK: %[[VAL_133:.*]] = memref.load %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_134:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_135:.*]] = arith.subi %[[VAL_133]], %[[VAL_134]] : i32 -// CHECK: memref.store %[[VAL_135]], %[[VAL_18]]{{\[}}%[[VAL_21]]] : memref<2xi32> -// CHECK: %[[VAL_136:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> -// CHECK: %[[VAL_137:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_138:.*]] = arith.addi %[[VAL_136]], %[[VAL_137]] : i32 -// CHECK: %[[VAL_139:.*]] = arith.cmpi sge, %[[VAL_138]], %[[VAL_25]] : i32 -// CHECK: %[[VAL_140:.*]] = arith.subi %[[VAL_138]], %[[VAL_25]] : i32 -// CHECK: %[[VAL_141:.*]] = arith.select %[[VAL_139]], %[[VAL_140]], %[[VAL_138]] : i32 -// CHECK: memref.store %[[VAL_141]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: func.call @add_10_i32(%[[VAL_111]], %[[VAL_114]], %[[VAL_103]]) : (memref<10xi32>, memref<10xi32>, memref<10xi32>) -> () +// CHECK: %[[VAL_115:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], Release, %[[VAL_115]]) +// CHECK: %[[VAL_116:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_117:.*]] = arith.subi %[[VAL_108]], %[[VAL_116]] : i32 +// CHECK: %[[VAL_118:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_119:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_120:.*]] = arith.addi %[[VAL_118]], %[[VAL_119]] : i32 +// CHECK: %[[VAL_121:.*]] = arith.cmpi sge, %[[VAL_120]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_122:.*]] = arith.subi %[[VAL_120]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_123:.*]] = arith.select %[[VAL_121]], %[[VAL_122]], %[[VAL_120]] : i32 +// CHECK: memref.store %[[VAL_123]], %[[VAL_17]]{{\[}}%[[VAL_24]]] : memref<2xi32> +// CHECK: %[[VAL_124:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_124]]) +// CHECK: %[[VAL_125:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_126:.*]] = arith.subi %[[VAL_100]], %[[VAL_125]] : i32 +// CHECK: %[[VAL_127:.*]] = memref.load %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> +// CHECK: %[[VAL_128:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_129:.*]] = arith.addi %[[VAL_127]], %[[VAL_128]] : i32 +// CHECK: %[[VAL_130:.*]] = arith.cmpi sge, %[[VAL_129]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_131:.*]] = arith.subi %[[VAL_129]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_132:.*]] = arith.select %[[VAL_130]], %[[VAL_131]], %[[VAL_129]] : i32 +// CHECK: memref.store %[[VAL_132]], %[[VAL_17]]{{\[}}%[[VAL_22]]] : memref<2xi32> // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @input_fifo_shim_alloc(%[[VAL_3]], MM2S, 0) -// CHECK: %[[VAL_142:.*]] = aie.mem(%[[VAL_4]]) { -// CHECK: %[[VAL_143:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: %[[VAL_133:.*]] = aie.mem(%[[VAL_4]]) { +// CHECK: %[[VAL_134:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: %[[VAL_144:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_144]]) +// CHECK: %[[VAL_135:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_135]]) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_145:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_145]]) +// CHECK: %[[VAL_136:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_136]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_146:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_146]]) +// CHECK: %[[VAL_137:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_13]], AcquireGreaterEqual, %[[VAL_137]]) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_147:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_147]]) +// CHECK: %[[VAL_138:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_14]], Release, %[[VAL_138]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: -// CHECK: %[[VAL_148:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) +// CHECK: %[[VAL_139:.*]] = aie.dma_start(MM2S, 0, ^bb4, ^bb6) // CHECK: ^bb4: -// CHECK: %[[VAL_149:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_149]]) +// CHECK: %[[VAL_140:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_140]]) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_150:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_150]]) +// CHECK: %[[VAL_141:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_141]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb5: -// CHECK: %[[VAL_151:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_151]]) +// CHECK: %[[VAL_142:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_142]]) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<10xi32>, 0, 10) -// CHECK: %[[VAL_152:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_152]]) +// CHECK: %[[VAL_143:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_143]]) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb6: // CHECK: aie.end // CHECK: } // CHECK: aie.shim_dma_allocation @output_fifo_shim_alloc(%[[VAL_3]], S2MM, 0) // CHECK: } -// CHECK: } module { aie.device(npu1_1col) { diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir index 94595249885..1df3cc07e7a 100644 --- a/test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_basic.mlir @@ -13,8 +13,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu2) { +// CHECK-LABEL: aie.device(npu2) { // CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) // CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) // CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_0"} : memref<8xi8> @@ -29,30 +28,25 @@ // CHECK: %[[VAL_11:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} // CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) // CHECK: %[[VAL_12:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> -// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> -// CHECK: %[[VAL_14:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_13:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_14:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_15:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_16:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_15]], %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> -// CHECK: %[[VAL_17:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_17:.*]] = arith.constant 2 : i32 +// CHECK: memref.store %[[VAL_15]], %[[VAL_12]]{{\[}}%[[VAL_16]]] : memref<1xi32> // CHECK: %[[VAL_18:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_19:.*]] = arith.constant 2 : i32 -// CHECK: memref.store %[[VAL_17]], %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_20:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_21:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_22:.*]] = arith.constant 14 : index -// CHECK: scf.for %[[VAL_23:.*]] = %[[VAL_20]] to %[[VAL_22]] step %[[VAL_21]] { -// CHECK: %[[VAL_24:.*]] = memref.load %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> -// CHECK: %[[VAL_25:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_26:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_27:.*]] = arith.subi %[[VAL_25]], %[[VAL_24]] : i32 -// CHECK: %[[VAL_28:.*]] = arith.maxsi %[[VAL_27]], %[[VAL_26]] : i32 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_28]]) -// CHECK: %[[VAL_29:.*]] = arith.addi %[[VAL_24]], %[[VAL_28]] : i32 -// CHECK: memref.store %[[VAL_29]], %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> -// CHECK: %[[VAL_30:.*]] = memref.load %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_31:.*]] = arith.index_cast %[[VAL_30]] : i32 to index -// CHECK: %[[VAL_32:.*]] = scf.index_switch %[[VAL_31]] -> memref<8xi8> +// CHECK: %[[VAL_19:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_20:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_21:.*]] = scf.for %[[VAL_22:.*]] = %[[VAL_18]] to %[[VAL_20]] step %[[VAL_19]] iter_args(%[[VAL_23:.*]] = %[[VAL_14]]) -> (i32) { +// CHECK: %[[VAL_24:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_25:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_26:.*]] = arith.subi %[[VAL_24]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_27:.*]] = arith.maxsi %[[VAL_26]], %[[VAL_25]] : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_27]]) +// CHECK: %[[VAL_28:.*]] = arith.addi %[[VAL_23]], %[[VAL_27]] : i32 +// CHECK: %[[VAL_29:.*]] = memref.load %[[VAL_12]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: %[[VAL_30:.*]] = arith.index_cast %[[VAL_29]] : i32 to index +// CHECK: %[[VAL_31:.*]] = scf.index_switch %[[VAL_30]] -> memref<8xi8> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_2]] : memref<8xi8> // CHECK: } @@ -62,76 +56,74 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_2]] : memref<8xi8> // CHECK: } +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], Release, %[[VAL_32]]) // CHECK: %[[VAL_33:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_4]], Release, %[[VAL_33]]) -// CHECK: %[[VAL_34:.*]] = memref.load %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> -// CHECK: %[[VAL_35:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_36:.*]] = arith.subi %[[VAL_34]], %[[VAL_35]] : i32 -// CHECK: memref.store %[[VAL_36]], %[[VAL_13]]{{\[}}%[[VAL_16]]] : memref<1xi32> -// CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_38:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_39:.*]] = arith.addi %[[VAL_37]], %[[VAL_38]] : i32 -// CHECK: %[[VAL_40:.*]] = arith.cmpi sge, %[[VAL_39]], %[[VAL_19]] : i32 -// CHECK: %[[VAL_41:.*]] = arith.subi %[[VAL_39]], %[[VAL_19]] : i32 -// CHECK: %[[VAL_42:.*]] = arith.select %[[VAL_40]], %[[VAL_41]], %[[VAL_39]] : i32 -// CHECK: memref.store %[[VAL_42]], %[[VAL_12]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_34:.*]] = arith.subi %[[VAL_28]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_35:.*]] = memref.load %[[VAL_12]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: %[[VAL_36:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_37:.*]] = arith.addi %[[VAL_35]], %[[VAL_36]] : i32 +// CHECK: %[[VAL_38:.*]] = arith.cmpi sge, %[[VAL_37]], %[[VAL_17]] : i32 +// CHECK: %[[VAL_39:.*]] = arith.subi %[[VAL_37]], %[[VAL_17]] : i32 +// CHECK: %[[VAL_40:.*]] = arith.select %[[VAL_38]], %[[VAL_39]], %[[VAL_37]] : i32 +// CHECK: memref.store %[[VAL_40]], %[[VAL_12]]{{\[}}%[[VAL_16]]] : memref<1xi32> +// CHECK: scf.yield %[[VAL_34]] : i32 // CHECK: } // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_43:.*]] = aie.memtile_dma(%[[VAL_0]]) { -// CHECK: %[[VAL_44:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb5) +// CHECK: %[[VAL_41:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_42:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb5) // CHECK: ^bb1: +// CHECK: %[[VAL_43:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_43]]) +// CHECK: aie.dma_bd(%[[VAL_6]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_44:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_44]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_45]]) -// CHECK: aie.dma_bd(%[[VAL_6]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_7]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_46:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_46]]) -// CHECK: aie.next_bd ^bb2 -// CHECK: ^bb2: +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: // CHECK: %[[VAL_47:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_47]]) -// CHECK: aie.dma_bd(%[[VAL_7]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_48:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_48]]) -// CHECK: aie.next_bd ^bb3 -// CHECK: ^bb3: +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: // CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_49]]) -// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_50:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_50]]) -// CHECK: aie.next_bd ^bb4 -// CHECK: ^bb4: -// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_11]], AcquireGreaterEqual, %[[VAL_51]]) -// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], Release, %[[VAL_52]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_53:.*]] = aie.mem(%[[VAL_1]]) { -// CHECK: %[[VAL_54:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) +// CHECK: %[[VAL_51:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_52:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb3) // CHECK: ^bb1: -// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %[[VAL_55]]) +// CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %[[VAL_53]]) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_56]]) +// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_54]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_57:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %[[VAL_57]]) +// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, %[[VAL_55]]) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_58]]) +// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_56]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb3: // CHECK: aie.end // CHECK: } // CHECK: } -// CHECK: } module { aie.device(npu2) { diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir index 1d72765ec4a..7c9e1c98a7d 100644 --- a/test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_conditional.mlir @@ -14,8 +14,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu2) { +// CHECK-LABEL: aie.device(npu2) { // CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) // CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) // CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_0"} : memref<8xi8> @@ -31,107 +30,103 @@ // CHECK: %[[VAL_12:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} // CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) // CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> -// CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> -// CHECK: %[[VAL_15:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_14:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_15:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_16:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_17:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_16]], %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> -// CHECK: %[[VAL_18:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_18:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_16]], %[[VAL_13]]{{\[}}%[[VAL_17]]] : memref<1xi32> // CHECK: %[[VAL_19:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_20:.*]] = arith.constant 4 : i32 -// CHECK: memref.store %[[VAL_18]], %[[VAL_13]]{{\[}}%[[VAL_19]]] : memref<1xi32> -// CHECK: %[[VAL_21:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_22:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_23:.*]] = arith.constant 14 : index -// CHECK: %[[VAL_24:.*]] = arith.constant true -// CHECK: scf.for %[[VAL_25:.*]] = %[[VAL_21]] to %[[VAL_23]] step %[[VAL_22]] { -// CHECK: %[[VAL_26:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> -// CHECK: %[[VAL_27:.*]] = arith.constant 3 : i32 -// CHECK: %[[VAL_28:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_29:.*]] = arith.subi %[[VAL_27]], %[[VAL_26]] : i32 -// CHECK: %[[VAL_30:.*]] = arith.maxsi %[[VAL_29]], %[[VAL_28]] : i32 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_30]]) -// CHECK: %[[VAL_31:.*]] = arith.addi %[[VAL_26]], %[[VAL_30]] : i32 -// CHECK: memref.store %[[VAL_31]], %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> -// CHECK: scf.if %[[VAL_24]] { +// CHECK: %[[VAL_20:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_21:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_22:.*]] = arith.constant true +// CHECK: %[[VAL_23:.*]] = scf.for %[[VAL_24:.*]] = %[[VAL_19]] to %[[VAL_21]] step %[[VAL_20]] iter_args(%[[VAL_25:.*]] = %[[VAL_15]]) -> (i32) { +// CHECK: %[[VAL_26:.*]] = arith.constant 3 : i32 +// CHECK: %[[VAL_27:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_28:.*]] = arith.subi %[[VAL_26]], %[[VAL_25]] : i32 +// CHECK: %[[VAL_29:.*]] = arith.maxsi %[[VAL_28]], %[[VAL_27]] : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_29]]) +// CHECK: %[[VAL_30:.*]] = arith.addi %[[VAL_25]], %[[VAL_29]] : i32 +// CHECK: %[[VAL_31:.*]] = scf.if %[[VAL_22]] -> (i32) { // CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_32]]) -// CHECK: %[[VAL_33:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> -// CHECK: %[[VAL_34:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_35:.*]] = arith.subi %[[VAL_33]], %[[VAL_34]] : i32 -// CHECK: memref.store %[[VAL_35]], %[[VAL_14]]{{\[}}%[[VAL_17]]] : memref<1xi32> -// CHECK: %[[VAL_36:.*]] = memref.load %[[VAL_13]]{{\[}}%[[VAL_19]]] : memref<1xi32> -// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_38:.*]] = arith.addi %[[VAL_36]], %[[VAL_37]] : i32 -// CHECK: %[[VAL_39:.*]] = arith.cmpi sge, %[[VAL_38]], %[[VAL_20]] : i32 -// CHECK: %[[VAL_40:.*]] = arith.subi %[[VAL_38]], %[[VAL_20]] : i32 -// CHECK: %[[VAL_41:.*]] = arith.select %[[VAL_39]], %[[VAL_40]], %[[VAL_38]] : i32 -// CHECK: memref.store %[[VAL_41]], %[[VAL_13]]{{\[}}%[[VAL_19]]] : memref<1xi32> +// CHECK: %[[VAL_33:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_34:.*]] = arith.subi %[[VAL_30]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_35:.*]] = memref.load %[[VAL_13]]{{\[}}%[[VAL_17]]] : memref<1xi32> +// CHECK: %[[VAL_36:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_37:.*]] = arith.addi %[[VAL_35]], %[[VAL_36]] : i32 +// CHECK: %[[VAL_38:.*]] = arith.cmpi sge, %[[VAL_37]], %[[VAL_18]] : i32 +// CHECK: %[[VAL_39:.*]] = arith.subi %[[VAL_37]], %[[VAL_18]] : i32 +// CHECK: %[[VAL_40:.*]] = arith.select %[[VAL_38]], %[[VAL_39]], %[[VAL_37]] : i32 +// CHECK: memref.store %[[VAL_40]], %[[VAL_13]]{{\[}}%[[VAL_17]]] : memref<1xi32> +// CHECK: scf.yield %[[VAL_34]] : i32 +// CHECK: } else { +// CHECK: scf.yield %[[VAL_30]] : i32 // CHECK: } +// CHECK: scf.yield %[[VAL_31]] : i32 // CHECK: } // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_42:.*]] = aie.memtile_dma(%[[VAL_0]]) { -// CHECK: %[[VAL_43:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: %[[VAL_41:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_42:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) // CHECK: ^bb1: -// CHECK: %[[VAL_44:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_44]]) +// CHECK: %[[VAL_43:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_43]]) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_45]]) +// CHECK: %[[VAL_44:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_44]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_46:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_46]]) +// CHECK: %[[VAL_45:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_45]]) // CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_47:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_47]]) +// CHECK: %[[VAL_46:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_46]]) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: -// CHECK: %[[VAL_48:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_48]]) +// CHECK: %[[VAL_47:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_47]]) // CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_49]]) +// CHECK: %[[VAL_48:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_48]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_50:.*]] = aie.mem(%[[VAL_1]]) { -// CHECK: %[[VAL_51:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) +// CHECK: %[[VAL_49:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_50:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: -// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_52]]) +// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_51]]) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_53]]) +// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_52]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_54]]) +// CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_53]]) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_55]]) +// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_54]]) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: -// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_56]]) +// CHECK: %[[VAL_55:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_55]]) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_57:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_57]]) +// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_56]]) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: -// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_58]]) +// CHECK: %[[VAL_57:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_57]]) // CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_59]]) +// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_58]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // CHECK: aie.end // CHECK: } // CHECK: } -// CHECK: } module { aie.device(npu2) { diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir index 92d49e5c723..7f8b0b9adfa 100644 --- a/test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_multiple_fifos.mlir @@ -12,8 +12,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu2) { +// CHECK-LABEL: aie.device(npu2) { // CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) // CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) // CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifoY_cons_buff_0"} : memref<8xi8> @@ -39,195 +38,179 @@ // CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) // CHECK: aie.flow(%[[VAL_0]], DMA : 1, %[[VAL_1]], DMA : 1) // CHECK: %[[VAL_22:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> -// CHECK: %[[VAL_23:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> -// CHECK: %[[VAL_24:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_23:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_24:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_25:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_26:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_25]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_27:.*]] = arith.constant 1 : index -// CHECK: memref.store %[[VAL_25]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_28:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_29:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_30:.*]] = arith.constant 4 : i32 -// CHECK: memref.store %[[VAL_28]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> -// CHECK: %[[VAL_31:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_32:.*]] = arith.constant 3 : i32 -// CHECK: memref.store %[[VAL_28]], %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> -// CHECK: %[[VAL_33:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_34:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_35:.*]] = arith.constant 14 : index -// CHECK: scf.for %[[VAL_36:.*]] = %[[VAL_33]] to %[[VAL_35]] step %[[VAL_34]] { -// CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_26:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_27:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_28:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_26]], %[[VAL_22]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_29:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_30:.*]] = arith.constant 3 : i32 +// CHECK: memref.store %[[VAL_26]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: %[[VAL_31:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_33:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_34:.*]]:2 = scf.for %[[VAL_35:.*]] = %[[VAL_31]] to %[[VAL_33]] step %[[VAL_32]] iter_args(%[[VAL_36:.*]] = %[[VAL_25]], %[[VAL_37:.*]] = %[[VAL_24]]) -> (i32, i32) { // CHECK: %[[VAL_38:.*]] = arith.constant 3 : i32 // CHECK: %[[VAL_39:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_40:.*]] = arith.subi %[[VAL_38]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_40:.*]] = arith.subi %[[VAL_38]], %[[VAL_36]] : i32 // CHECK: %[[VAL_41:.*]] = arith.maxsi %[[VAL_40]], %[[VAL_39]] : i32 // CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_41]]) -// CHECK: %[[VAL_42:.*]] = arith.addi %[[VAL_37]], %[[VAL_41]] : i32 -// CHECK: memref.store %[[VAL_42]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_43:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_44:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_45:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_46:.*]] = arith.subi %[[VAL_44]], %[[VAL_43]] : i32 -// CHECK: %[[VAL_47:.*]] = arith.maxsi %[[VAL_46]], %[[VAL_45]] : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_47]]) -// CHECK: %[[VAL_48:.*]] = arith.addi %[[VAL_43]], %[[VAL_47]] : i32 -// CHECK: memref.store %[[VAL_48]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_42:.*]] = arith.addi %[[VAL_36]], %[[VAL_41]] : i32 +// CHECK: %[[VAL_43:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_44:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_45:.*]] = arith.subi %[[VAL_43]], %[[VAL_37]] : i32 +// CHECK: %[[VAL_46:.*]] = arith.maxsi %[[VAL_45]], %[[VAL_44]] : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_46]]) +// CHECK: %[[VAL_47:.*]] = arith.addi %[[VAL_37]], %[[VAL_46]] : i32 +// CHECK: %[[VAL_48:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_48]]) // CHECK: %[[VAL_49:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_49]]) -// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_52:.*]] = arith.subi %[[VAL_50]], %[[VAL_51]] : i32 -// CHECK: memref.store %[[VAL_52]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_53:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> -// CHECK: %[[VAL_54:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_55:.*]] = arith.addi %[[VAL_53]], %[[VAL_54]] : i32 -// CHECK: %[[VAL_56:.*]] = arith.cmpi sge, %[[VAL_55]], %[[VAL_30]] : i32 -// CHECK: %[[VAL_57:.*]] = arith.subi %[[VAL_55]], %[[VAL_30]] : i32 -// CHECK: %[[VAL_58:.*]] = arith.select %[[VAL_56]], %[[VAL_57]], %[[VAL_55]] : i32 -// CHECK: memref.store %[[VAL_58]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> -// CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_59]]) -// CHECK: %[[VAL_60:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_50:.*]] = arith.subi %[[VAL_42]], %[[VAL_49]] : i32 +// CHECK: %[[VAL_51:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_53:.*]] = arith.addi %[[VAL_51]], %[[VAL_52]] : i32 +// CHECK: %[[VAL_54:.*]] = arith.cmpi sge, %[[VAL_53]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_55:.*]] = arith.subi %[[VAL_53]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_56:.*]] = arith.select %[[VAL_54]], %[[VAL_55]], %[[VAL_53]] : i32 +// CHECK: memref.store %[[VAL_56]], %[[VAL_22]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_57:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_57]]) +// CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_59:.*]] = arith.subi %[[VAL_47]], %[[VAL_58]] : i32 +// CHECK: %[[VAL_60:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> // CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_62:.*]] = arith.subi %[[VAL_60]], %[[VAL_61]] : i32 -// CHECK: memref.store %[[VAL_62]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_63:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> -// CHECK: %[[VAL_64:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_65:.*]] = arith.addi %[[VAL_63]], %[[VAL_64]] : i32 -// CHECK: %[[VAL_66:.*]] = arith.cmpi sge, %[[VAL_65]], %[[VAL_32]] : i32 -// CHECK: %[[VAL_67:.*]] = arith.subi %[[VAL_65]], %[[VAL_32]] : i32 -// CHECK: %[[VAL_68:.*]] = arith.select %[[VAL_66]], %[[VAL_67]], %[[VAL_65]] : i32 -// CHECK: memref.store %[[VAL_68]], %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> +// CHECK: %[[VAL_62:.*]] = arith.addi %[[VAL_60]], %[[VAL_61]] : i32 +// CHECK: %[[VAL_63:.*]] = arith.cmpi sge, %[[VAL_62]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_64:.*]] = arith.subi %[[VAL_62]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_65:.*]] = arith.select %[[VAL_63]], %[[VAL_64]], %[[VAL_62]] : i32 +// CHECK: memref.store %[[VAL_65]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_50]], %[[VAL_59]] : i32, i32 // CHECK: } -// CHECK: %[[VAL_69:.*]] = arith.constant 2 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_69]]) -// CHECK: %[[VAL_70:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> +// CHECK: %[[VAL_66:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], Release, %[[VAL_66]]) +// CHECK: %[[VAL_67:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_68:.*]] = arith.subi %[[VAL_69:.*]]#0, %[[VAL_67]] : i32 +// CHECK: %[[VAL_70:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_27]]] : memref<2xi32> // CHECK: %[[VAL_71:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_72:.*]] = arith.subi %[[VAL_70]], %[[VAL_71]] : i32 -// CHECK: memref.store %[[VAL_72]], %[[VAL_23]]{{\[}}%[[VAL_26]]] : memref<2xi32> -// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> -// CHECK: %[[VAL_74:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_75:.*]] = arith.addi %[[VAL_73]], %[[VAL_74]] : i32 -// CHECK: %[[VAL_76:.*]] = arith.cmpi sge, %[[VAL_75]], %[[VAL_30]] : i32 -// CHECK: %[[VAL_77:.*]] = arith.subi %[[VAL_75]], %[[VAL_30]] : i32 -// CHECK: %[[VAL_78:.*]] = arith.select %[[VAL_76]], %[[VAL_77]], %[[VAL_75]] : i32 -// CHECK: memref.store %[[VAL_78]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> -// CHECK: %[[VAL_79:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_79]]) -// CHECK: %[[VAL_80:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_81:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_82:.*]] = arith.subi %[[VAL_80]], %[[VAL_81]] : i32 -// CHECK: memref.store %[[VAL_82]], %[[VAL_23]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_83:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> -// CHECK: %[[VAL_84:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_85:.*]] = arith.addi %[[VAL_83]], %[[VAL_84]] : i32 -// CHECK: %[[VAL_86:.*]] = arith.cmpi sge, %[[VAL_85]], %[[VAL_32]] : i32 -// CHECK: %[[VAL_87:.*]] = arith.subi %[[VAL_85]], %[[VAL_32]] : i32 -// CHECK: %[[VAL_88:.*]] = arith.select %[[VAL_86]], %[[VAL_87]], %[[VAL_85]] : i32 -// CHECK: memref.store %[[VAL_88]], %[[VAL_22]]{{\[}}%[[VAL_31]]] : memref<2xi32> +// CHECK: %[[VAL_72:.*]] = arith.addi %[[VAL_70]], %[[VAL_71]] : i32 +// CHECK: %[[VAL_73:.*]] = arith.cmpi sge, %[[VAL_72]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_74:.*]] = arith.subi %[[VAL_72]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_75:.*]] = arith.select %[[VAL_73]], %[[VAL_74]], %[[VAL_72]] : i32 +// CHECK: memref.store %[[VAL_75]], %[[VAL_22]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_76:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], Release, %[[VAL_76]]) +// CHECK: %[[VAL_77:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_78:.*]] = arith.subi %[[VAL_69]]#1, %[[VAL_77]] : i32 +// CHECK: %[[VAL_79:.*]] = memref.load %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> +// CHECK: %[[VAL_80:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_81:.*]] = arith.addi %[[VAL_79]], %[[VAL_80]] : i32 +// CHECK: %[[VAL_82:.*]] = arith.cmpi sge, %[[VAL_81]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_83:.*]] = arith.subi %[[VAL_81]], %[[VAL_30]] : i32 +// CHECK: %[[VAL_84:.*]] = arith.select %[[VAL_82]], %[[VAL_83]], %[[VAL_81]] : i32 +// CHECK: memref.store %[[VAL_84]], %[[VAL_22]]{{\[}}%[[VAL_29]]] : memref<2xi32> // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_89:.*]] = aie.memtile_dma(%[[VAL_0]]) { -// CHECK: %[[VAL_90:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: %[[VAL_85:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_86:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) // CHECK: ^bb1: -// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_91]]) +// CHECK: %[[VAL_87:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_87]]) // CHECK: aie.dma_bd(%[[VAL_17]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_92]]) +// CHECK: %[[VAL_88:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_88]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_93]]) +// CHECK: %[[VAL_89:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_89]]) // CHECK: aie.dma_bd(%[[VAL_18]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_94]]) +// CHECK: %[[VAL_90:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_90]]) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: -// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_95]]) +// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], AcquireGreaterEqual, %[[VAL_91]]) // CHECK: aie.dma_bd(%[[VAL_19]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_96]]) +// CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_20]], Release, %[[VAL_92]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: -// CHECK: %[[VAL_97:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb7) +// CHECK: %[[VAL_93:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb7) // CHECK: ^bb5: -// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_98]]) +// CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_94]]) // CHECK: aie.dma_bd(%[[VAL_7]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_99:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_99]]) +// CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_95]]) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb6: -// CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_100]]) +// CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_10]], AcquireGreaterEqual, %[[VAL_96]]) // CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_101]]) +// CHECK: %[[VAL_97:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_9]], Release, %[[VAL_97]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb7: // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_102:.*]] = aie.mem(%[[VAL_1]]) { -// CHECK: %[[VAL_103:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) +// CHECK: %[[VAL_98:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_99:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: -// CHECK: %[[VAL_104:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_104]]) +// CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_100]]) // CHECK: aie.dma_bd(%[[VAL_11]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_105:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_105]]) +// CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_101]]) // CHECK: aie.next_bd ^bb2 // CHECK: ^bb2: -// CHECK: %[[VAL_106:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_106]]) +// CHECK: %[[VAL_102:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_102]]) // CHECK: aie.dma_bd(%[[VAL_12]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_107:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_107]]) +// CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_103]]) // CHECK: aie.next_bd ^bb3 // CHECK: ^bb3: -// CHECK: %[[VAL_108:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_108]]) +// CHECK: %[[VAL_104:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_104]]) // CHECK: aie.dma_bd(%[[VAL_13]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_109]]) +// CHECK: %[[VAL_105:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_105]]) // CHECK: aie.next_bd ^bb4 // CHECK: ^bb4: -// CHECK: %[[VAL_110:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_110]]) +// CHECK: %[[VAL_106:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_15]], AcquireGreaterEqual, %[[VAL_106]]) // CHECK: aie.dma_bd(%[[VAL_14]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_111]]) +// CHECK: %[[VAL_107:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_107]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: -// CHECK: %[[VAL_112:.*]] = aie.dma_start(S2MM, 1, ^bb6, ^bb9) +// CHECK: %[[VAL_108:.*]] = aie.dma_start(S2MM, 1, ^bb6, ^bb9) // CHECK: ^bb6: -// CHECK: %[[VAL_113:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_113]]) +// CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_109]]) // CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_114:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_114]]) +// CHECK: %[[VAL_110:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_110]]) // CHECK: aie.next_bd ^bb7 // CHECK: ^bb7: -// CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_115]]) +// CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_111]]) // CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_116:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_116]]) +// CHECK: %[[VAL_112:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_112]]) // CHECK: aie.next_bd ^bb8 // CHECK: ^bb8: -// CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_117]]) +// CHECK: %[[VAL_113:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, %[[VAL_113]]) // CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_118:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_118]]) +// CHECK: %[[VAL_114:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_114]]) // CHECK: aie.next_bd ^bb6 // CHECK: ^bb9: // CHECK: aie.end // CHECK: } // CHECK: } -// CHECK: } module { aie.device(npu2) { diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir index d580f8fa460..bb4ca0326f3 100644 --- a/test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_nested_loops.mlir @@ -12,8 +12,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu2) { +// CHECK-LABEL: aie.device(npu2) { // CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) // CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) // CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "inOF_X_cons_buff_0"} : memref<8xi8> @@ -40,204 +39,189 @@ // CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) // CHECK: aie.flow(%[[VAL_0]], DMA : 1, %[[VAL_1]], DMA : 1) // CHECK: %[[VAL_23:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> -// CHECK: %[[VAL_24:.*]] = aie.buffer(%[[VAL_1]]) : memref<2xi32> -// CHECK: %[[VAL_25:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_24:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_25:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_26:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_27:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_26]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_28:.*]] = arith.constant 1 : index -// CHECK: memref.store %[[VAL_26]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> -// CHECK: %[[VAL_29:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_30:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_31:.*]] = arith.constant 3 : i32 -// CHECK: memref.store %[[VAL_29]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> -// CHECK: %[[VAL_32:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_33:.*]] = arith.constant 4 : i32 -// CHECK: memref.store %[[VAL_29]], %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> -// CHECK: %[[VAL_34:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_35:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_36:.*]] = arith.constant 14 : index -// CHECK: scf.for %[[VAL_37:.*]] = %[[VAL_34]] to %[[VAL_36]] step %[[VAL_35]] { -// CHECK: %[[VAL_38:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> +// CHECK: %[[VAL_27:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_28:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_29:.*]] = arith.constant 3 : i32 +// CHECK: memref.store %[[VAL_27]], %[[VAL_23]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_30:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_31:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_27]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_32:.*]] = arith.constant 0 : index +// CHECK: %[[VAL_33:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_34:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_35:.*]]:2 = scf.for %[[VAL_36:.*]] = %[[VAL_32]] to %[[VAL_34]] step %[[VAL_33]] iter_args(%[[VAL_37:.*]] = %[[VAL_26]], %[[VAL_38:.*]] = %[[VAL_25]]) -> (i32, i32) { // CHECK: %[[VAL_39:.*]] = arith.constant 2 : i32 // CHECK: %[[VAL_40:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_41:.*]] = arith.subi %[[VAL_39]], %[[VAL_38]] : i32 +// CHECK: %[[VAL_41:.*]] = arith.subi %[[VAL_39]], %[[VAL_37]] : i32 // CHECK: %[[VAL_42:.*]] = arith.maxsi %[[VAL_41]], %[[VAL_40]] : i32 // CHECK: aie.use_lock(%[[VAL_17]], AcquireGreaterEqual, %[[VAL_42]]) -// CHECK: %[[VAL_43:.*]] = arith.addi %[[VAL_38]], %[[VAL_42]] : i32 -// CHECK: memref.store %[[VAL_43]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: scf.for %[[VAL_44:.*]] = %[[VAL_34]] to %[[VAL_36]] step %[[VAL_35]] { -// CHECK: %[[VAL_45:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> -// CHECK: %[[VAL_46:.*]] = arith.constant 3 : i32 -// CHECK: %[[VAL_47:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_48:.*]] = arith.subi %[[VAL_46]], %[[VAL_45]] : i32 -// CHECK: %[[VAL_49:.*]] = arith.maxsi %[[VAL_48]], %[[VAL_47]] : i32 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_49]]) -// CHECK: %[[VAL_50:.*]] = arith.addi %[[VAL_45]], %[[VAL_49]] : i32 -// CHECK: memref.store %[[VAL_50]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> -// CHECK: %[[VAL_51:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_51]]) -// CHECK: %[[VAL_52:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_43:.*]] = arith.addi %[[VAL_37]], %[[VAL_42]] : i32 +// CHECK: %[[VAL_44:.*]] = scf.for %[[VAL_45:.*]] = %[[VAL_32]] to %[[VAL_34]] step %[[VAL_33]] iter_args(%[[VAL_46:.*]] = %[[VAL_38]]) -> (i32) { +// CHECK: %[[VAL_47:.*]] = arith.constant 3 : i32 +// CHECK: %[[VAL_48:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_49:.*]] = arith.subi %[[VAL_47]], %[[VAL_46]] : i32 +// CHECK: %[[VAL_50:.*]] = arith.maxsi %[[VAL_49]], %[[VAL_48]] : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_50]]) +// CHECK: %[[VAL_51:.*]] = arith.addi %[[VAL_46]], %[[VAL_50]] : i32 +// CHECK: %[[VAL_52:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_52]]) // CHECK: %[[VAL_53:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_54:.*]] = arith.subi %[[VAL_52]], %[[VAL_53]] : i32 -// CHECK: memref.store %[[VAL_54]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> -// CHECK: %[[VAL_55:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: %[[VAL_54:.*]] = arith.subi %[[VAL_51]], %[[VAL_53]] : i32 +// CHECK: %[[VAL_55:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> // CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 // CHECK: %[[VAL_57:.*]] = arith.addi %[[VAL_55]], %[[VAL_56]] : i32 -// CHECK: %[[VAL_58:.*]] = arith.cmpi sge, %[[VAL_57]], %[[VAL_33]] : i32 -// CHECK: %[[VAL_59:.*]] = arith.subi %[[VAL_57]], %[[VAL_33]] : i32 +// CHECK: %[[VAL_58:.*]] = arith.cmpi sge, %[[VAL_57]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_59:.*]] = arith.subi %[[VAL_57]], %[[VAL_31]] : i32 // CHECK: %[[VAL_60:.*]] = arith.select %[[VAL_58]], %[[VAL_59]], %[[VAL_57]] : i32 -// CHECK: memref.store %[[VAL_60]], %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: memref.store %[[VAL_60]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_54]] : i32 // CHECK: } // CHECK: %[[VAL_61:.*]] = arith.constant 2 : i32 // CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_61]]) -// CHECK: %[[VAL_62:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> -// CHECK: %[[VAL_63:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_64:.*]] = arith.subi %[[VAL_62]], %[[VAL_63]] : i32 -// CHECK: memref.store %[[VAL_64]], %[[VAL_24]]{{\[}}%[[VAL_28]]] : memref<2xi32> -// CHECK: %[[VAL_65:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> -// CHECK: %[[VAL_66:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_67:.*]] = arith.addi %[[VAL_65]], %[[VAL_66]] : i32 -// CHECK: %[[VAL_68:.*]] = arith.cmpi sge, %[[VAL_67]], %[[VAL_33]] : i32 -// CHECK: %[[VAL_69:.*]] = arith.subi %[[VAL_67]], %[[VAL_33]] : i32 -// CHECK: %[[VAL_70:.*]] = arith.select %[[VAL_68]], %[[VAL_69]], %[[VAL_67]] : i32 -// CHECK: memref.store %[[VAL_70]], %[[VAL_23]]{{\[}}%[[VAL_32]]] : memref<2xi32> +// CHECK: %[[VAL_62:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_63:.*]] = arith.subi %[[VAL_44]], %[[VAL_62]] : i32 +// CHECK: %[[VAL_64:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_65:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_66:.*]] = arith.addi %[[VAL_64]], %[[VAL_65]] : i32 +// CHECK: %[[VAL_67:.*]] = arith.cmpi sge, %[[VAL_66]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_68:.*]] = arith.subi %[[VAL_66]], %[[VAL_31]] : i32 +// CHECK: %[[VAL_69:.*]] = arith.select %[[VAL_67]], %[[VAL_68]], %[[VAL_66]] : i32 +// CHECK: memref.store %[[VAL_69]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_70:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_70]]) // CHECK: %[[VAL_71:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_71]]) -// CHECK: %[[VAL_72:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_73:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_74:.*]] = arith.subi %[[VAL_72]], %[[VAL_73]] : i32 -// CHECK: memref.store %[[VAL_74]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_75:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> -// CHECK: %[[VAL_76:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_77:.*]] = arith.addi %[[VAL_75]], %[[VAL_76]] : i32 -// CHECK: %[[VAL_78:.*]] = arith.cmpi sge, %[[VAL_77]], %[[VAL_31]] : i32 -// CHECK: %[[VAL_79:.*]] = arith.subi %[[VAL_77]], %[[VAL_31]] : i32 -// CHECK: %[[VAL_80:.*]] = arith.select %[[VAL_78]], %[[VAL_79]], %[[VAL_77]] : i32 -// CHECK: memref.store %[[VAL_80]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_72:.*]] = arith.subi %[[VAL_43]], %[[VAL_71]] : i32 +// CHECK: %[[VAL_73:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_74:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_75:.*]] = arith.addi %[[VAL_73]], %[[VAL_74]] : i32 +// CHECK: %[[VAL_76:.*]] = arith.cmpi sge, %[[VAL_75]], %[[VAL_29]] : i32 +// CHECK: %[[VAL_77:.*]] = arith.subi %[[VAL_75]], %[[VAL_29]] : i32 +// CHECK: %[[VAL_78:.*]] = arith.select %[[VAL_76]], %[[VAL_77]], %[[VAL_75]] : i32 +// CHECK: memref.store %[[VAL_78]], %[[VAL_23]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: scf.yield %[[VAL_72]], %[[VAL_63]] : i32, i32 // CHECK: } -// CHECK: %[[VAL_81:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_81]]) -// CHECK: %[[VAL_82:.*]] = memref.load %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_83:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_84:.*]] = arith.subi %[[VAL_82]], %[[VAL_83]] : i32 -// CHECK: memref.store %[[VAL_84]], %[[VAL_24]]{{\[}}%[[VAL_27]]] : memref<2xi32> -// CHECK: %[[VAL_85:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> -// CHECK: %[[VAL_86:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_87:.*]] = arith.addi %[[VAL_85]], %[[VAL_86]] : i32 -// CHECK: %[[VAL_88:.*]] = arith.cmpi sge, %[[VAL_87]], %[[VAL_31]] : i32 -// CHECK: %[[VAL_89:.*]] = arith.subi %[[VAL_87]], %[[VAL_31]] : i32 -// CHECK: %[[VAL_90:.*]] = arith.select %[[VAL_88]], %[[VAL_89]], %[[VAL_87]] : i32 -// CHECK: memref.store %[[VAL_90]], %[[VAL_23]]{{\[}}%[[VAL_30]]] : memref<2xi32> +// CHECK: %[[VAL_79:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], Release, %[[VAL_79]]) +// CHECK: %[[VAL_80:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_81:.*]] = arith.subi %[[VAL_82:.*]]#0, %[[VAL_80]] : i32 +// CHECK: %[[VAL_83:.*]] = memref.load %[[VAL_23]]{{\[}}%[[VAL_28]]] : memref<2xi32> +// CHECK: %[[VAL_84:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_85:.*]] = arith.addi %[[VAL_83]], %[[VAL_84]] : i32 +// CHECK: %[[VAL_86:.*]] = arith.cmpi sge, %[[VAL_85]], %[[VAL_29]] : i32 +// CHECK: %[[VAL_87:.*]] = arith.subi %[[VAL_85]], %[[VAL_29]] : i32 +// CHECK: %[[VAL_88:.*]] = arith.select %[[VAL_86]], %[[VAL_87]], %[[VAL_85]] : i32 +// CHECK: memref.store %[[VAL_88]], %[[VAL_23]]{{\[}}%[[VAL_28]]] : memref<2xi32> // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_91:.*]] = aie.memtile_dma(%[[VAL_0]]) { -// CHECK: %[[VAL_92:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: %[[VAL_89:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_90:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) // CHECK: ^bb1: +// CHECK: %[[VAL_91:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_91]]) +// CHECK: aie.dma_bd(%[[VAL_18]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_92:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_92]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: %[[VAL_93:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_93]]) -// CHECK: aie.dma_bd(%[[VAL_18]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_19]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_94:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_94]]) -// CHECK: aie.next_bd ^bb2 -// CHECK: ^bb2: +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: // CHECK: %[[VAL_95:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_95]]) -// CHECK: aie.dma_bd(%[[VAL_19]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_20]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_96:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_96]]) -// CHECK: aie.next_bd ^bb3 -// CHECK: ^bb3: -// CHECK: %[[VAL_97:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_22]], AcquireGreaterEqual, %[[VAL_97]]) -// CHECK: aie.dma_bd(%[[VAL_20]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_21]], Release, %[[VAL_98]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: -// CHECK: %[[VAL_99:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb8) +// CHECK: %[[VAL_97:.*]] = aie.dma_start(MM2S, 1, ^bb5, ^bb8) // CHECK: ^bb5: +// CHECK: %[[VAL_98:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_98]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_99:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_99]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb6: // CHECK: %[[VAL_100:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_100]]) -// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_101:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_101]]) -// CHECK: aie.next_bd ^bb6 -// CHECK: ^bb6: +// CHECK: aie.next_bd ^bb7 +// CHECK: ^bb7: // CHECK: %[[VAL_102:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_102]]) -// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_103:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_103]]) -// CHECK: aie.next_bd ^bb7 -// CHECK: ^bb7: -// CHECK: %[[VAL_104:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_104]]) -// CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_105:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_105]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb8: // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_106:.*]] = aie.mem(%[[VAL_1]]) { -// CHECK: %[[VAL_107:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) +// CHECK: %[[VAL_104:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_105:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb4) // CHECK: ^bb1: +// CHECK: %[[VAL_106:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_106]]) +// CHECK: aie.dma_bd(%[[VAL_13]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_107:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_17]], Release, %[[VAL_107]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: %[[VAL_108:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_108]]) -// CHECK: aie.dma_bd(%[[VAL_13]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_14]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_109:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_17]], Release, %[[VAL_109]]) -// CHECK: aie.next_bd ^bb2 -// CHECK: ^bb2: +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: // CHECK: %[[VAL_110:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_110]]) -// CHECK: aie.dma_bd(%[[VAL_14]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_15]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_111:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_17]], Release, %[[VAL_111]]) -// CHECK: aie.next_bd ^bb3 -// CHECK: ^bb3: -// CHECK: %[[VAL_112:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_16]], AcquireGreaterEqual, %[[VAL_112]]) -// CHECK: aie.dma_bd(%[[VAL_15]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_113:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_17]], Release, %[[VAL_113]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: -// CHECK: %[[VAL_114:.*]] = aie.dma_start(S2MM, 1, ^bb5, ^bb9) +// CHECK: %[[VAL_112:.*]] = aie.dma_start(S2MM, 1, ^bb5, ^bb9) // CHECK: ^bb5: +// CHECK: %[[VAL_113:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_113]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_114:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_114]]) +// CHECK: aie.next_bd ^bb6 +// CHECK: ^bb6: // CHECK: %[[VAL_115:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_115]]) -// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_116:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_116]]) -// CHECK: aie.next_bd ^bb6 -// CHECK: ^bb6: +// CHECK: aie.next_bd ^bb7 +// CHECK: ^bb7: // CHECK: %[[VAL_117:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_117]]) -// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_118:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_118]]) -// CHECK: aie.next_bd ^bb7 -// CHECK: ^bb7: +// CHECK: aie.next_bd ^bb8 +// CHECK: ^bb8: // CHECK: %[[VAL_119:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_119]]) -// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_120:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_120]]) -// CHECK: aie.next_bd ^bb8 -// CHECK: ^bb8: -// CHECK: %[[VAL_121:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_121]]) -// CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_122:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_122]]) // CHECK: aie.next_bd ^bb5 // CHECK: ^bb9: // CHECK: aie.end // CHECK: } // CHECK: } -// CHECK: } module { aie.device(npu2) { diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir index fe4cd015129..86df7152cf6 100644 --- a/test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_producer.mlir @@ -12,8 +12,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu2) { +// CHECK-LABEL: aie.device(npu2) { // CHECK: %[[VAL_0:.*]] = aie.tile(0, 2) // CHECK: %[[VAL_1:.*]] = aie.tile(0, 3) // CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = "fifo_buff_0"} : memref<8xi8> @@ -23,30 +22,25 @@ // CHECK: %[[VAL_6:.*]] = aie.lock(%[[VAL_0]], 0) {init = 4 : i32, sym_name = "fifo_prod_lock_0"} // CHECK: %[[VAL_7:.*]] = aie.lock(%[[VAL_0]], 1) {init = 0 : i32, sym_name = "fifo_cons_lock_0"} // CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) : memref<1xi32> -// CHECK: %[[VAL_9:.*]] = aie.buffer(%[[VAL_0]]) : memref<1xi32> -// CHECK: %[[VAL_10:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_9:.*]] = aie.core(%[[VAL_0]]) { +// CHECK: %[[VAL_10:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_11:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_12:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_11]], %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> -// CHECK: %[[VAL_13:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_13:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_11]], %[[VAL_8]]{{\[}}%[[VAL_12]]] : memref<1xi32> // CHECK: %[[VAL_14:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_15:.*]] = arith.constant 4 : i32 -// CHECK: memref.store %[[VAL_13]], %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> -// CHECK: %[[VAL_16:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_17:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_18:.*]] = arith.constant 14 : index -// CHECK: scf.for %[[VAL_19:.*]] = %[[VAL_16]] to %[[VAL_18]] step %[[VAL_17]] { -// CHECK: %[[VAL_20:.*]] = memref.load %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> -// CHECK: %[[VAL_21:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_22:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_23:.*]] = arith.subi %[[VAL_21]], %[[VAL_20]] : i32 -// CHECK: %[[VAL_24:.*]] = arith.maxsi %[[VAL_23]], %[[VAL_22]] : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_24]]) -// CHECK: %[[VAL_25:.*]] = arith.addi %[[VAL_20]], %[[VAL_24]] : i32 -// CHECK: memref.store %[[VAL_25]], %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> -// CHECK: %[[VAL_26:.*]] = memref.load %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> -// CHECK: %[[VAL_27:.*]] = arith.index_cast %[[VAL_26]] : i32 to index -// CHECK: %[[VAL_28:.*]] = scf.index_switch %[[VAL_27]] -> memref<8xi8> +// CHECK: %[[VAL_15:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_16:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_17:.*]] = scf.for %[[VAL_18:.*]] = %[[VAL_14]] to %[[VAL_16]] step %[[VAL_15]] iter_args(%[[VAL_19:.*]] = %[[VAL_10]]) -> (i32) { +// CHECK: %[[VAL_20:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_21:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_22:.*]] = arith.subi %[[VAL_20]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_23:.*]] = arith.maxsi %[[VAL_22]], %[[VAL_21]] : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_23]]) +// CHECK: %[[VAL_24:.*]] = arith.addi %[[VAL_19]], %[[VAL_23]] : i32 +// CHECK: %[[VAL_25:.*]] = memref.load %[[VAL_8]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: %[[VAL_26:.*]] = arith.index_cast %[[VAL_25]] : i32 to index +// CHECK: %[[VAL_27:.*]] = scf.index_switch %[[VAL_26]] -> memref<8xi8> // CHECK: case 0 { // CHECK: scf.yield %[[VAL_2]] : memref<8xi8> // CHECK: } @@ -62,24 +56,22 @@ // CHECK: default { // CHECK: scf.yield %[[VAL_2]] : memref<8xi8> // CHECK: } +// CHECK: %[[VAL_28:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_28]]) // CHECK: %[[VAL_29:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_29]]) -// CHECK: %[[VAL_30:.*]] = memref.load %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> -// CHECK: %[[VAL_31:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_32:.*]] = arith.subi %[[VAL_30]], %[[VAL_31]] : i32 -// CHECK: memref.store %[[VAL_32]], %[[VAL_9]]{{\[}}%[[VAL_12]]] : memref<1xi32> -// CHECK: %[[VAL_33:.*]] = memref.load %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> -// CHECK: %[[VAL_34:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_35:.*]] = arith.addi %[[VAL_33]], %[[VAL_34]] : i32 -// CHECK: %[[VAL_36:.*]] = arith.cmpi sge, %[[VAL_35]], %[[VAL_15]] : i32 -// CHECK: %[[VAL_37:.*]] = arith.subi %[[VAL_35]], %[[VAL_15]] : i32 -// CHECK: %[[VAL_38:.*]] = arith.select %[[VAL_36]], %[[VAL_37]], %[[VAL_35]] : i32 -// CHECK: memref.store %[[VAL_38]], %[[VAL_8]]{{\[}}%[[VAL_14]]] : memref<1xi32> +// CHECK: %[[VAL_30:.*]] = arith.subi %[[VAL_24]], %[[VAL_29]] : i32 +// CHECK: %[[VAL_31:.*]] = memref.load %[[VAL_8]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: %[[VAL_32:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_33:.*]] = arith.addi %[[VAL_31]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_34:.*]] = arith.cmpi sge, %[[VAL_33]], %[[VAL_13]] : i32 +// CHECK: %[[VAL_35:.*]] = arith.subi %[[VAL_33]], %[[VAL_13]] : i32 +// CHECK: %[[VAL_36:.*]] = arith.select %[[VAL_34]], %[[VAL_35]], %[[VAL_33]] : i32 +// CHECK: memref.store %[[VAL_36]], %[[VAL_8]]{{\[}}%[[VAL_12]]] : memref<1xi32> +// CHECK: scf.yield %[[VAL_30]] : i32 // CHECK: } // CHECK: aie.end // CHECK: } // CHECK: } -// CHECK: } module { aie.device(npu2) { diff --git a/test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir b/test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir index 14d109043e6..53c00f865d2 100644 --- a/test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir +++ b/test/objectFifo-stateful-transform/dynamic_runtime_lock_scf_while.mlir @@ -12,8 +12,7 @@ // RUN: aie-opt --aie-objectFifo-stateful-transform="dynamic-objFifos=true" %s | FileCheck %s -// CHECK-LABEL: module { -// CHECK: aie.device(npu2) { +// CHECK-LABEL: aie.device(npu2) { // CHECK: %[[VAL_0:.*]] = aie.tile(0, 1) // CHECK: %[[VAL_1:.*]] = aie.tile(0, 2) // CHECK: %[[VAL_2:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "fifo_cons_buff_0"} : memref<8xi8> @@ -30,124 +29,114 @@ // CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = "buf"} : memref<1xindex> // CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0) // CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> -// CHECK: %[[VAL_15:.*]] = aie.buffer(%[[VAL_1]]) : memref<1xi32> -// CHECK: %[[VAL_16:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_15:.*]] = aie.core(%[[VAL_1]]) { +// CHECK: %[[VAL_16:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_17:.*]] = arith.constant 0 : i32 // CHECK: %[[VAL_18:.*]] = arith.constant 0 : index -// CHECK: memref.store %[[VAL_17]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_19:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_19:.*]] = arith.constant 4 : i32 +// CHECK: memref.store %[[VAL_17]], %[[VAL_14]]{{\[}}%[[VAL_18]]] : memref<1xi32> // CHECK: %[[VAL_20:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_21:.*]] = arith.constant 4 : i32 -// CHECK: memref.store %[[VAL_19]], %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> -// CHECK: %[[VAL_22:.*]] = arith.constant 0 : index -// CHECK: %[[VAL_23:.*]] = arith.constant 1 : index -// CHECK: %[[VAL_24:.*]] = arith.constant 14 : index -// CHECK: %[[VAL_25:.*]] = scf.while (%[[VAL_26:.*]] = %[[VAL_22]]) : (index) -> index { -// CHECK: %[[VAL_27:.*]] = arith.cmpi slt, %[[VAL_26]], %[[VAL_24]] : index -// CHECK: scf.condition(%[[VAL_27]]) %[[VAL_26]] : index +// CHECK: %[[VAL_21:.*]] = arith.constant 1 : index +// CHECK: %[[VAL_22:.*]] = arith.constant 14 : index +// CHECK: %[[VAL_23:.*]]:2 = scf.while (%[[VAL_24:.*]] = %[[VAL_20]], %[[VAL_25:.*]] = %[[VAL_16]]) : (index, i32) -> (index, i32) { +// CHECK: %[[VAL_26:.*]] = arith.cmpi slt, %[[VAL_24]], %[[VAL_22]] : index +// CHECK: scf.condition(%[[VAL_26]]) %[[VAL_24]], %[[VAL_25]] : index, i32 // CHECK: } do { -// CHECK: ^bb0(%[[VAL_28:.*]]: index): -// CHECK: %[[VAL_29:.*]] = memref.load %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_30:.*]] = arith.constant 3 : i32 -// CHECK: %[[VAL_31:.*]] = arith.constant 0 : i32 -// CHECK: %[[VAL_32:.*]] = arith.subi %[[VAL_30]], %[[VAL_29]] : i32 -// CHECK: %[[VAL_33:.*]] = arith.maxsi %[[VAL_32]], %[[VAL_31]] : i32 -// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_33]]) -// CHECK: %[[VAL_34:.*]] = arith.addi %[[VAL_29]], %[[VAL_33]] : i32 -// CHECK: memref.store %[[VAL_34]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: ^bb0(%[[VAL_27:.*]]: index, %[[VAL_28:.*]]: i32): +// CHECK: %[[VAL_29:.*]] = arith.constant 3 : i32 +// CHECK: %[[VAL_30:.*]] = arith.constant 0 : i32 +// CHECK: %[[VAL_31:.*]] = arith.subi %[[VAL_29]], %[[VAL_28]] : i32 +// CHECK: %[[VAL_32:.*]] = arith.maxsi %[[VAL_31]], %[[VAL_30]] : i32 +// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, %[[VAL_32]]) +// CHECK: %[[VAL_33:.*]] = arith.addi %[[VAL_28]], %[[VAL_32]] : i32 +// CHECK: %[[VAL_34:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_34]]) // CHECK: %[[VAL_35:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_35]]) -// CHECK: %[[VAL_36:.*]] = memref.load %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_37:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_38:.*]] = arith.subi %[[VAL_36]], %[[VAL_37]] : i32 -// CHECK: memref.store %[[VAL_38]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_39:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> -// CHECK: %[[VAL_40:.*]] = arith.constant 1 : i32 -// CHECK: %[[VAL_41:.*]] = arith.addi %[[VAL_39]], %[[VAL_40]] : i32 -// CHECK: %[[VAL_42:.*]] = arith.cmpi sge, %[[VAL_41]], %[[VAL_21]] : i32 -// CHECK: %[[VAL_43:.*]] = arith.subi %[[VAL_41]], %[[VAL_21]] : i32 -// CHECK: %[[VAL_44:.*]] = arith.select %[[VAL_42]], %[[VAL_43]], %[[VAL_41]] : i32 -// CHECK: memref.store %[[VAL_44]], %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> -// CHECK: %[[VAL_45:.*]] = arith.addi %[[VAL_28]], %[[VAL_23]] : index -// CHECK: scf.yield %[[VAL_45]] : index +// CHECK: %[[VAL_36:.*]] = arith.subi %[[VAL_33]], %[[VAL_35]] : i32 +// CHECK: %[[VAL_37:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_38:.*]] = arith.constant 1 : i32 +// CHECK: %[[VAL_39:.*]] = arith.addi %[[VAL_37]], %[[VAL_38]] : i32 +// CHECK: %[[VAL_40:.*]] = arith.cmpi sge, %[[VAL_39]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_41:.*]] = arith.subi %[[VAL_39]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_42:.*]] = arith.select %[[VAL_40]], %[[VAL_41]], %[[VAL_39]] : i32 +// CHECK: memref.store %[[VAL_42]], %[[VAL_14]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_43:.*]] = arith.addi %[[VAL_27]], %[[VAL_21]] : index +// CHECK: scf.yield %[[VAL_43]], %[[VAL_36]] : index, i32 // CHECK: } -// CHECK: memref.store %[[VAL_25]], %[[VAL_13]]{{\[}}%[[VAL_22]]] : memref<1xindex> +// CHECK: memref.store %[[VAL_44:.*]]#0, %[[VAL_13]]{{\[}}%[[VAL_20]]] : memref<1xindex> +// CHECK: %[[VAL_45:.*]] = arith.constant 2 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_45]]) // CHECK: %[[VAL_46:.*]] = arith.constant 2 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], Release, %[[VAL_46]]) -// CHECK: %[[VAL_47:.*]] = memref.load %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_48:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_49:.*]] = arith.subi %[[VAL_47]], %[[VAL_48]] : i32 -// CHECK: memref.store %[[VAL_49]], %[[VAL_15]]{{\[}}%[[VAL_18]]] : memref<1xi32> -// CHECK: %[[VAL_50:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> -// CHECK: %[[VAL_51:.*]] = arith.constant 2 : i32 -// CHECK: %[[VAL_52:.*]] = arith.addi %[[VAL_50]], %[[VAL_51]] : i32 -// CHECK: %[[VAL_53:.*]] = arith.cmpi sge, %[[VAL_52]], %[[VAL_21]] : i32 -// CHECK: %[[VAL_54:.*]] = arith.subi %[[VAL_52]], %[[VAL_21]] : i32 -// CHECK: %[[VAL_55:.*]] = arith.select %[[VAL_53]], %[[VAL_54]], %[[VAL_52]] : i32 -// CHECK: memref.store %[[VAL_55]], %[[VAL_14]]{{\[}}%[[VAL_20]]] : memref<1xi32> +// CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_44]]#1, %[[VAL_46]] : i32 +// CHECK: %[[VAL_48:.*]] = memref.load %[[VAL_14]]{{\[}}%[[VAL_18]]] : memref<1xi32> +// CHECK: %[[VAL_49:.*]] = arith.constant 2 : i32 +// CHECK: %[[VAL_50:.*]] = arith.addi %[[VAL_48]], %[[VAL_49]] : i32 +// CHECK: %[[VAL_51:.*]] = arith.cmpi sge, %[[VAL_50]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_52:.*]] = arith.subi %[[VAL_50]], %[[VAL_19]] : i32 +// CHECK: %[[VAL_53:.*]] = arith.select %[[VAL_51]], %[[VAL_52]], %[[VAL_50]] : i32 +// CHECK: memref.store %[[VAL_53]], %[[VAL_14]]{{\[}}%[[VAL_18]]] : memref<1xi32> // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_56:.*]] = aie.memtile_dma(%[[VAL_0]]) { -// CHECK: %[[VAL_57:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) +// CHECK: %[[VAL_54:.*]] = aie.memtile_dma(%[[VAL_0]]) { +// CHECK: %[[VAL_55:.*]] = aie.dma_start(MM2S, 0, ^bb1, ^bb4) // CHECK: ^bb1: +// CHECK: %[[VAL_56:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_56]]) +// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_57:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_57]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: %[[VAL_58:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_58]]) -// CHECK: aie.dma_bd(%[[VAL_8]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_59:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_59]]) -// CHECK: aie.next_bd ^bb2 -// CHECK: ^bb2: +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: // CHECK: %[[VAL_60:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_60]]) -// CHECK: aie.dma_bd(%[[VAL_9]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_61:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_61]]) -// CHECK: aie.next_bd ^bb3 -// CHECK: ^bb3: -// CHECK: %[[VAL_62:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_12]], AcquireGreaterEqual, %[[VAL_62]]) -// CHECK: aie.dma_bd(%[[VAL_10]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_63:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_11]], Release, %[[VAL_63]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb4: // CHECK: aie.end // CHECK: } -// CHECK: %[[VAL_64:.*]] = aie.mem(%[[VAL_1]]) { -// CHECK: %[[VAL_65:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) +// CHECK: %[[VAL_62:.*]] = aie.mem(%[[VAL_1]]) { +// CHECK: %[[VAL_63:.*]] = aie.dma_start(S2MM, 0, ^bb1, ^bb5) // CHECK: ^bb1: +// CHECK: %[[VAL_64:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_64]]) +// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: %[[VAL_65:.*]] = arith.constant 1 : i32 +// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_65]]) +// CHECK: aie.next_bd ^bb2 +// CHECK: ^bb2: // CHECK: %[[VAL_66:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_66]]) -// CHECK: aie.dma_bd(%[[VAL_2]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_67:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_67]]) -// CHECK: aie.next_bd ^bb2 -// CHECK: ^bb2: +// CHECK: aie.next_bd ^bb3 +// CHECK: ^bb3: // CHECK: %[[VAL_68:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_68]]) -// CHECK: aie.dma_bd(%[[VAL_3]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_69:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_69]]) -// CHECK: aie.next_bd ^bb3 -// CHECK: ^bb3: +// CHECK: aie.next_bd ^bb4 +// CHECK: ^bb4: // CHECK: %[[VAL_70:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_70]]) -// CHECK: aie.dma_bd(%[[VAL_4]] : memref<8xi8>, 0, 8) +// CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) // CHECK: %[[VAL_71:.*]] = arith.constant 1 : i32 // CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_71]]) -// CHECK: aie.next_bd ^bb4 -// CHECK: ^bb4: -// CHECK: %[[VAL_72:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_6]], AcquireGreaterEqual, %[[VAL_72]]) -// CHECK: aie.dma_bd(%[[VAL_5]] : memref<8xi8>, 0, 8) -// CHECK: %[[VAL_73:.*]] = arith.constant 1 : i32 -// CHECK: aie.use_lock(%[[VAL_7]], Release, %[[VAL_73]]) // CHECK: aie.next_bd ^bb1 // CHECK: ^bb5: // CHECK: aie.end // CHECK: } // CHECK: } -// CHECK: } module { aie.device(npu2) { From b7d5259d2e0412682e1dc03cdda264b632d3f17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R=C3=B6sti?= Date: Fri, 10 Jul 2026 19:20:55 -0600 Subject: [PATCH 8/9] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André Rösti --- .../AIE/Transforms/AIEObjectFifoStatefulTransform.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp index a4fc46f1c77..7bc546f6d3a 100644 --- a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp +++ b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp @@ -1674,10 +1674,7 @@ struct AIEObjectFifoStatefulTransformPass } } - /// Emit a UseLockOp whose lock value is a runtime-computed SSA i32. Used by - /// the dynamic objectFifo lowering, where the number of locks to - /// acquire/release is not known at compile time. Only valid for AIE2 - /// semaphore locks (the dynamic lowering targets AIE2/AIE2p). + /// Emit a UseLockOp whose lock value is a runtime-computed SSA i32. void createUseLocksRuntime(OpBuilder &builder, ObjectFifoCreateOp op, ObjectFifoPort port, Value count, LockAction lockAction, ObjectFifoState &state) { @@ -2368,8 +2365,7 @@ struct AIEObjectFifoStatefulTransformPass //===----------------------------------------------------------------===// // For tiles using the dynamic objectFifo lowering, the number of locks // to acquire is computed at runtime from a per-(fifo,port) "held" counter - // stored in a local buffer. This replaces the static (cyclostatic) - // accounting that cannot see through runtime-dependent control flow. + // stored in a local buffer. // Runtime lock counts require semaphore locks (AIE2+); on architectures // with binary locks (AIE1) the dynamic lowering keeps static lock counts. bool isDynamicCore = dynamicLoweringTiles.count(coreOp.getTileOp()) > 0 && From 25ca535067ff062cc5d3ad0f38ee77f5c54fa964 Mon Sep 17 00:00:00 2001 From: andrej Date: Fri, 10 Jul 2026 20:27:39 -0600 Subject: [PATCH 9/9] clang-format --- lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp index 7bc546f6d3a..6b2e308def7 100644 --- a/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp +++ b/lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp @@ -2365,7 +2365,7 @@ struct AIEObjectFifoStatefulTransformPass //===----------------------------------------------------------------===// // For tiles using the dynamic objectFifo lowering, the number of locks // to acquire is computed at runtime from a per-(fifo,port) "held" counter - // stored in a local buffer. + // stored in a local buffer. // Runtime lock counts require semaphore locks (AIE2+); on architectures // with binary locks (AIE1) the dynamic lowering keeps static lock counts. bool isDynamicCore = dynamicLoweringTiles.count(coreOp.getTileOp()) > 0 &&