[go: nahoru, domu]

Skip to content

Commit

Permalink
Use the generic IR in the debug MLIR dump
Browse files Browse the repository at this point in the history
We want to guarantee that the IR is "complete" and for debugging the best way to ensure
this is to use the generic IR.

PiperOrigin-RevId: 306898069
Change-Id: Iaf22bd5564fea8942a7d58d23db93ac9d2bab439
  • Loading branch information
joker-eph authored and tensorflower-gardener committed Apr 16, 2020
1 parent 27a7c0b commit 6294828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ std::string DumpMlirOpToFile(llvm::StringRef name, mlir::Operation* op,
Status result = CreateFileForDumping(name, &os, &filepath, dirname);
if (!result.ok()) return result.error_message();

op->print(*os, mlir::OpPrintingFlags().useLocalScope());
op->print(*os, mlir::OpPrintingFlags().useLocalScope().printGenericOpForm());
LOG(INFO) << "Dumped MLIR operation '" << op->getName().getStringRef().str()
<< "' to '" << filepath << "'";
return filepath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ TEST(DumpMlirModuleTest, Valid) {
std::string expected_txt_module;
{
llvm::raw_string_ostream os(expected_txt_module);
module_ref->getOperation()->print(os);
module_ref->getOperation()->print(
os, mlir::OpPrintingFlags().printGenericOpForm());
os.flush();
}

Expand Down

0 comments on commit 6294828

Please sign in to comment.