#include "mlir/Dialect/SPIRV/Transforms/Passes.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/Utils/LayoutUtils.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/Support/FormatVariadic.h"
usingnamespacemlir;
namespace mlir {
namespace spirv {
#define GEN_PASS_DEF_SPIRVCOMPOSITETYPELAYOUTPASS
#include "mlir/Dialect/SPIRV/Transforms/Passes.h.inc"
}
}
namespace {
class SPIRVGlobalVariableOpLayoutInfoDecoration
: public OpRewritePattern<spirv::GlobalVariableOp> { … };
class SPIRVAddressOfOpLayoutInfoDecoration
: public OpRewritePattern<spirv::AddressOfOp> { … };
template <typename OpT>
class SPIRVPassThroughConversion : public OpConversionPattern<OpT> { … };
}
static void populateSPIRVLayoutInfoPatterns(RewritePatternSet &patterns) { … }
namespace {
class DecorateSPIRVCompositeTypeLayoutPass
: public spirv::impl::SPIRVCompositeTypeLayoutPassBase<
DecorateSPIRVCompositeTypeLayoutPass> { … };
}
void DecorateSPIRVCompositeTypeLayoutPass::runOnOperation() { … }