MLIR 23.0.0git
AMDGPUDialect.cpp
Go to the documentation of this file.
1//===- AMDGPUDialect.cpp - MLIR AMDGPU dialect implementation --------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the AMDGPU dialect and its operations.
10//
11//===----------------------------------------------------------------------===//
12
14
22
23using namespace mlir;
24using namespace mlir::amdgpu;
25
26#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.cpp.inc"
27
28namespace {
29struct AMDGPUInlinerInterface final : DialectInlinerInterface {
30 using DialectInlinerInterface::DialectInlinerInterface;
31 bool isLegalToInline(Operation *, Region *, bool, IRMapping &) const final {
32 return true;
33 }
34};
35} // namespace
36
37void AMDGPUDialect::initialize() {
38 addOperations<
39#define GET_OP_LIST
40#include "mlir/Dialect/AMDGPU/IR/AMDGPU.cpp.inc"
41 >();
42 registerTypes();
43 registerAttributes();
44 addInterfaces<AMDGPUInlinerInterface>();
45 declarePromisedInterfaces<
46 memref::IndexedAccessOpInterface, TransposeLoadOp, GlobalTransposeLoadOp,
47 MakeDmaDescriptorOp, MakeGatherDmaDescriptorOp, DsBarrierInitOp,
48 DsBarrierPollStateOp, DsAsyncBarrierArriveOp, DsBarrierArriveOp>();
49 declarePromisedInterfaces<memref::IndexedMemCopyOpInterface, GatherToLDSOp,
50 GlobalLoadAsyncToLDSOp, MakeDmaBaseOp,
51 MakeGatherDmaBaseOp>();
52}
static bool isLegalToInline(InlinerInterface &interface, Region *src, Region *insertRegion, bool shouldCloneInlinedRegion, IRMapping &valueMapping)
Utility to check that all of the operations within 'src' can be inlined.
Include the generated interface declarations.