Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polygeist Ops Inlining and printing debug info #423

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/polygeist/Dialect.cpp
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
#include "polygeist/Dialect.h"
#include "mlir/IR/DialectImplementation.h"
#include "polygeist/Ops.h"
#include "mlir/Transforms/InliningUtils.h"

using namespace mlir;
using namespace mlir::polygeist;
@@ -17,11 +18,25 @@ using namespace mlir::polygeist;
// Polygeist dialect.
//===----------------------------------------------------------------------===//

namespace {
/// This class defines the interface for handling inlining for Polygeist
/// dialect operations.
struct PolygeistInlinerInterface : public DialectInlinerInterface {
using DialectInlinerInterface::DialectInlinerInterface;

/// All Polygeist dialect ops can be inlined.
bool isLegalToInline(Operation *, Region *, bool, IRMapping &) const final {
return true;
}
};
} // namespace

void PolygeistDialect::initialize() {
addOperations<
#define GET_OP_LIST
#include "polygeist/PolygeistOps.cpp.inc"
>();
addInterfaces<PolygeistInlinerInterface>();
}

#include "polygeist/PolygeistOpsDialect.cpp.inc"
2 changes: 1 addition & 1 deletion tools/cgeist/driver.cc
Original file line number Diff line number Diff line change
@@ -612,7 +612,7 @@ int main(int argc, char **argv) {

OpPrintingFlags flags;
if (PrintDebugInfo)
flags.enableDebugInfo(/*pretty*/ false);
flags.enableDebugInfo(/*enable*/ true, /*pretty*/ false);

if (ImmediateMLIR) {
module->print(llvm::outs(), flags);