-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ObjectFifo] Add a pass to combine logical objFifos for connection reuse
-- This commit adds a new pass `--iree-amdaie-logical-objectfifos-for-connection-reuse`. -- Essentially follows the narrative after splitting of logical objectFifos and is aimed to address point 4 of #644. Signed-off-by: Abhishek Varma <[email protected]>
- Loading branch information
1 parent
80b81a1
commit 9b288f9
Showing
9 changed files
with
670 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...target/AMD-AIE/iree-amd-aie/Transforms/AMDAIECombineLogicalObjFifosForConnectionReuse.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2024 The IREE Authors | ||
// | ||
// Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
#include "iree-amd-aie/IR/AMDAIEOps.h" | ||
#include "iree-amd-aie/Transforms/AMDAIELogicalObjFifoSplittingUtils.h" | ||
#include "iree-amd-aie/Transforms/Passes.h" | ||
#include "mlir/IR/Iterators.h" | ||
#include "mlir/Pass/Pass.h" | ||
|
||
#define DEBUG_TYPE \ | ||
"iree-amdaie-combine-logical-objectfifos-for-connection-reuse" | ||
|
||
namespace mlir::iree_compiler::AMDAIE { | ||
|
||
namespace { | ||
|
||
class AMDAIECombineLogicalObjFifosForConnectionReusePass | ||
: public impl::AMDAIECombineLogicalObjFifosForConnectionReuseBase< | ||
AMDAIECombineLogicalObjFifosForConnectionReusePass> { | ||
public: | ||
using AMDAIECombineLogicalObjFifosForConnectionReuseBase:: | ||
AMDAIECombineLogicalObjFifosForConnectionReuseBase; | ||
|
||
void getDependentDialects(DialectRegistry ®istry) const override { | ||
registry.insert<AMDAIEDialect>(); | ||
} | ||
void runOnOperation() override; | ||
}; | ||
|
||
void AMDAIECombineLogicalObjFifosForConnectionReusePass::runOnOperation() { | ||
ModuleOp moduleOp = getOperation(); | ||
MLIRContext *context = &getContext(); | ||
IRRewriter rewriter(context); | ||
|
||
SmallVector<AMDAIE::DmaCpyNdOp> l2ToL1DmaOps = | ||
fetchDmaCpyNdOpsToSplitOrCombine(moduleOp); | ||
|
||
if (failed(combineLogicalObjectFifos(rewriter, l2ToL1DmaOps, context))) { | ||
return signalPassFailure(); | ||
} | ||
} | ||
|
||
} // namespace | ||
|
||
std::unique_ptr<Pass> | ||
createAMDAIECombineLogicalObjFifosForConnectionReusePass() { | ||
return std::make_unique<AMDAIECombineLogicalObjFifosForConnectionReusePass>(); | ||
} | ||
|
||
} // namespace mlir::iree_compiler::AMDAIE |
Oops, something went wrong.