This is an archive of the discontinued LLVM Phabricator instance.

[mlir][AsmPrinter] Change value numbering for local scope to be the next isolated operation.
ClosedPublic

Authored by rriddle on Apr 5 2020, 11:40 PM.

Details

Summary

This revision updates the value numbering when printing to number from the next parent operation that is isolated from above. This is the highest level to number from that still ensures thread-safety. This revision also changes the behavior of Operator::operator<< to use local scope to avoid thread races when numbering operations.

Diff Detail

Event Timeline

rriddle created this revision.Apr 5 2020, 11:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2020, 11:40 PM
mehdi_amini accepted this revision.Apr 6 2020, 12:38 AM
This revision is now accepted and ready to land.Apr 6 2020, 12:38 AM
bondhugula accepted this revision.Apr 6 2020, 3:57 AM
bondhugula added inline comments.
mlir/include/mlir/IR/Operation.h
608

Did this race condition exist all along (since pass threading) or was it introduced lately? It looks like when pass threading is on, the printing has to always be "isolated from above" op local?

mlir/lib/IR/AsmPrinter.cpp
2347

Nit: The flags.shouldUseLocalScope() check can be hoisted out.

rriddle updated this revision to Diff 255404.Apr 6 2020, 10:44 AM
rriddle marked 3 inline comments as done.

Resolve comments

rriddle added inline comments.Apr 6 2020, 10:49 AM
mlir/include/mlir/IR/Operation.h
608

This has always existed, it is only recently that something used it in the common code path.

This revision was automatically updated to reflect the committed changes.