This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Emit debug message if inlining fails
ClosedPublic

Authored by jurahul on Jun 5 2020, 4:46 PM.

Details

Summary

Emit a debug message if inlining fails.

Diff Detail

Event Timeline

jurahul created this revision.Jun 5 2020, 4:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2020, 4:47 PM
jurahul updated this revision to Diff 268965.Jun 5 2020, 4:49 PM

Fix space

jpienaar added inline comments.Jun 5 2020, 4:56 PM
mlir/lib/Transforms/Inliner.cpp
438

Did you mean to have the dump inside the LLVM_DEBUG section too?

jurahul updated this revision to Diff 268966.Jun 5 2020, 5:11 PM
jurahul marked an inline comment as done.

Move call.dump() inside LLVM_DEBUG

mlir/lib/Transforms/Inliner.cpp
438

Yes, I did.

mehdi_amini added inline comments.Jun 5 2020, 8:00 PM
mlir/lib/Transforms/Inliner.cpp
438

Why the **?

Also you can avoid the dump and just write it like this I think: LLVM_DEBUG(llvm::dbgs() << "Failed to inline: " << call << "\n");

jurahul marked an inline comment as done.Jun 8 2020, 8:34 AM
jurahul added inline comments.
mlir/lib/Transforms/Inliner.cpp
438

The "**" is there to indicate that the message is in the scope of the earlier message, so it will appear as:

* Inlining call: ...
** Failed to inline: ...

I am ok if we want just a single '*'. Also llvm::dbgs() << call does not work, I guess the insertion operator << has not been overloaded for CallOpInterface (or its parent). I will check what would be needed to get that working.

jurahul marked an inline comment as not done.Jun 8 2020, 10:00 AM
jpienaar added inline comments.Jun 8 2020, 12:24 PM
mlir/lib/Transforms/Inliner.cpp
438

You should be able to do LLVM_DEBUG(call.print(llvm::dbgs() << " ..."); llvm::dbgs() << '\n');

jurahul updated this revision to Diff 269317.Jun 8 2020, 12:37 PM
  • Allow MLIR op's to be printed using <<
rriddle added inline comments.Jun 8 2020, 12:39 PM
mlir/include/mlir/IR/OpDefinition.h
263

nit: Please use complete sentences in comments.

jurahul updated this revision to Diff 269329.Jun 8 2020, 12:57 PM

Address River's comment

jurahul marked 3 inline comments as done.Jun 8 2020, 12:58 PM
jurahul added inline comments.
mlir/lib/Transforms/Inliner.cpp
438

I have overloaded the << operator now, so its much cleaner.

rriddle accepted this revision.Jun 8 2020, 1:00 PM
rriddle added inline comments.
mlir/lib/Transforms/Inliner.cpp
437

Why stream in the call here? It is already being streamed in above, this just duplicates it.

This revision is now accepted and ready to land.Jun 8 2020, 1:00 PM
jurahul updated this revision to Diff 269341.Jun 8 2020, 1:32 PM

Don't stream call

jurahul marked an inline comment as done.Jun 8 2020, 1:32 PM
mehdi_amini added inline comments.Jun 8 2020, 8:07 PM
mlir/lib/Transforms/Inliner.cpp
438

Thanks, LG.

This revision was automatically updated to reflect the committed changes.