This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Implements IR versioning capability (WIP)
AbandonedPublic

Authored by mehdi_amini on Mar 5 2023, 12:20 PM.

Details

Diff Detail

Event Timeline

mehdi_amini created this revision.Mar 5 2023, 12:20 PM
Herald added a project: Restricted Project. · View Herald Transcript
mehdi_amini requested review of this revision.Mar 5 2023, 12:20 PM
jpienaar added inline comments.
mlir/docs/BytecodeFormat.md
411

So the number of instances here is not required as below one require a version for every dialect? (even if there is 1 dialect without a version, it is cheaper to have a varint for number of versioned dialects here up to 511 dialects in file it would seem)

mlir/include/mlir/IR/OpImplementation.h
472

Why should this be in OpImplementation.h instead of localized to Bytecode? (it seems like nothing actually queries it outside there)

mlir/lib/Bytecode/Reader/BytecodeReader.cpp
437

Handle feels misleading, this is raw data from which version will be extracted.

1388

Should this be checked in the verify required sections function? Also, why is it required? E.g., what if I just want to use within same rev build?

mlir/test/Bytecode/versioning/versioned_op.mlir
1

Outdated.

41

Could you also add example of what .mlir input with version looks like?

mehdi_amini abandoned this revision.Mar 6 2023, 1:30 AM
mehdi_amini added a subscriber: mfrancio.

Marked as abandoned, @mfrancio will merge this all into https://reviews.llvm.org/D143647

mlir/docs/BytecodeFormat.md
411

I haven't updated the doc from the revision I took as a basis, please ignore this file :)

mlir/include/mlir/IR/OpImplementation.h
472

Absolutely!

mlir/lib/Bytecode/Reader/BytecodeReader.cpp
1388

This is a nested section, we can't verify early I think.

It is not as much "required" as we don't expect any other section here, and I'm not sure how to express an optional section? (so we'll always write an empty one)

mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
373

Code above is pure code motion because of DialectWriter used in BytecodeWriter::writeDialectSection() below.

mlir/test/Bytecode/versioning/versioned_op.mlir
41

We won't support any version in .mlir file right now (tests are outdated)