-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathNoBufferizeFlagTreePass.cpp
More file actions
64 lines (55 loc) · 2.06 KB
/
Copy pathNoBufferizeFlagTreePass.cpp
File metadata and controls
64 lines (55 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton-shared/Conversion/NoBufferize_FlagTree/NoBufferizeFlagTree.h"
#include "triton-shared/Dialect/TritonStructured/IR/TritonStructuredDialect.h"
#include "triton-shared/Dialect/TritonTilingExt/IR/TritonTilingExtDialect.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/SCF/Transforms/Patterns.h"
#include "mlir/Pass/PassManager.h"
#include "triton/Dialect/Triton/IR/Types.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Casting.h"
#include <iostream>
#include <optional>
#define DEBUG_TYPE "no-bufferize-flagtree"
using namespace mlir;
using namespace triton;
namespace mlir {
namespace triton {
#define GEN_PASS_DEF_NOBUFFERIZEFLAGTREE
#include "triton-shared/Conversion/NoBufferize_FlagTree/Passes.h.inc"
} // namespace triton
} // namespace mlir
namespace {
class NoBufferizeFlagTreePass
: public triton::impl::NoBufferizeFlagTreeBase<NoBufferizeFlagTreePass> {
using NoBufferizeFlagTreeBase<
NoBufferizeFlagTreePass>::NoBufferizeFlagTreeBase;
public:
void runOnOperation() override {
ModuleOp module = getOperation();
RewritePatternSet localPatterns(&getContext());
{
TypeConverter typeConverter;
triton::populateNoBufferizeFlagTreeConversionPatterns(localPatterns,
typeConverter);
}
(void)applyPatternsGreedily(module, std::move(localPatterns));
}
};
} // namespace
std::unique_ptr<OperationPass<ModuleOp>>
triton::createNoBufferizeFlagTreePass() {
return std::make_unique<NoBufferizeFlagTreePass>();
}