#include "mlir/Analysis/Liveness.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/Pass/Pass.h"
using namespace mlir;
namespace {
struct TestLivenessPass
: public PassWrapper<TestLivenessPass, InterfacePass<SymbolOpInterface>> {
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestLivenessPass)
StringRef getArgument() const final { return "test-print-liveness"; }
StringRef getDescription() const final {
return "Print the contents of a constructed liveness information.";
}
void runOnOperation() override {
llvm::errs() << "Testing : " << getOperation().getName() << "\n";
getAnalysis<Liveness>().print(llvm::errs());
}
};
}
namespace mlir {
namespace test {
void registerTestLivenessPass() { PassRegistration<TestLivenessPass>(); }
}
}