llvm/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp

//===- TestAvailability.cpp - Pass to test SPIR-V op availability ---------===//
//
// Part of the LLVM Project, 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 "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVAttributes.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
#include "mlir/Pass/Pass.h"

usingnamespacemlir;

//===----------------------------------------------------------------------===//
// Printing op availability pass
//===----------------------------------------------------------------------===//

namespace {
/// A pass for testing SPIR-V op availability.
struct PrintOpAvailability
    : public PassWrapper<PrintOpAvailability, OperationPass<func::FuncOp>> {};
} // namespace

void PrintOpAvailability::runOnOperation() {}

namespace mlir {
void registerPrintSpirvAvailabilityPass() {}
} // namespace mlir

//===----------------------------------------------------------------------===//
// Converting target environment pass
//===----------------------------------------------------------------------===//

namespace {
/// A pass for testing SPIR-V op availability.
struct ConvertToTargetEnv
    : public PassWrapper<ConvertToTargetEnv, OperationPass<func::FuncOp>> {};

struct ConvertToAtomCmpExchangeWeak : RewritePattern {};

struct ConvertToBitReverse : RewritePattern {};

struct ConvertToGroupNonUniformBallot : RewritePattern {};

struct ConvertToModule : RewritePattern {};

struct ConvertToSubgroupBallot : RewritePattern {};

template <const char *TestOpName, typename SPIRVOp>
struct ConvertToIntegerDotProd : RewritePattern {};
} // namespace

void ConvertToTargetEnv::runOnOperation() {}

namespace mlir {
void registerConvertToTargetEnvPass() {}
} // namespace mlir