This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fix ssa values naming bug
ClosedPublic

Authored by ezhulenev on May 12 2021, 2:07 PM.

Details

Summary

Address comments in https://reviews.llvm.org/D102226 to fix the bug + style violations

Diff Detail

Event Timeline

ezhulenev created this revision.May 12 2021, 2:07 PM
ezhulenev requested review of this revision.May 12 2021, 2:07 PM
ezhulenev edited the summary of this revision. (Show Details)May 12 2021, 2:08 PM
rriddle accepted this revision.May 12 2021, 2:13 PM

Thanks for the fix!

mlir/lib/IR/AsmPrinter.cpp
865

You'll need to destroy this object at the end of the constructor, otherwise you'll leak memory. Can you directly push it into nameContext? You can then use that for the parent scope in the above loop (i.e. the nullptr).

This revision is now accepted and ready to land.May 12 2021, 2:13 PM
rriddle added inline comments.May 12 2021, 2:15 PM
mlir/lib/IR/AsmPrinter.cpp
865

Actually strike that, technically the scope doesn't have anything interesting inside of it. We also don't need to use the allocator, we could just use a simple variable for the top-level scope.

ezhulenev updated this revision to Diff 344958.May 12 2021, 2:17 PM
ezhulenev marked an inline comment as done.

Add top level names scope to named context

This revision was landed with ongoing or failed builds.May 12 2021, 2:38 PM
Closed by commit rGfb3a00c327df: [mlir] Fix ssa values naming bug (authored by ezhulenev, committed by rriddle). · Explain Why
This revision was automatically updated to reflect the committed changes.