This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Catch the case using ir print without disabling multithread
ClosedPublic

Authored by Lewuathe on Mar 23 2023, 11:47 PM.

Details

Summary

-mlir-print-ir-module-scope option cannot be used without disabling multithread for pass manager. For the usability, we can throw a validation error in mlir-opt instead of assertion failure.

Issue: https://github.com/llvm/llvm-project/issues/61578

Diff Detail

Event Timeline

Lewuathe created this revision.Mar 23 2023, 11:47 PM
Lewuathe requested review of this revision.Mar 23 2023, 11:47 PM
Lewuathe updated this revision to Diff 507970.Mar 23 2023, 11:48 PM

Add new line.

Lewuathe edited the summary of this revision. (Show Details)Mar 23 2023, 11:48 PM
rriddle added inline comments.Mar 27 2023, 9:54 AM
mlir/lib/Pass/PassManagerOptions.cpp
147–148

The error message doesn't really match the check, "IR printing" is much more general than just module scope.

Lewuathe updated this revision to Diff 508870.Mar 27 2023, 7:20 PM

Refine error message

Lewuathe updated this revision to Diff 509902.Mar 30 2023, 10:23 PM

Fix test failure.

LGTM modulo one comment

mlir/lib/Pass/PassManagerOptions.cpp
147–148

I suspect we should print the error through the context so it is emitted as diagnostic instead of using directly llvm::errs().

This revision is now accepted and ready to land.Apr 1 2023, 5:28 AM