[all-commits] [llvm/llvm-project] da092e: Fix bytecode roundtrip of unregistered ops (#82932)
Matteo Franciolini via All-commits
all-commits at lists.llvm.org
Sun Feb 25 16:18:53 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: da092e8808319b572fa9fea7eb74e55e7434a8b2
https://github.com/llvm/llvm-project/commit/da092e8808319b572fa9fea7eb74e55e7434a8b2
Author: Matteo Franciolini <mfranciolini at tesla.com>
Date: 2024-02-25 (Sun, 25 Feb 2024)
Changed paths:
M mlir/lib/Bytecode/Reader/BytecodeReader.cpp
Log Message:
-----------
Fix bytecode roundtrip of unregistered ops (#82932)
When roundtripping to bytecode an unregistered operation name that does
not contain any '.' separator, the bytecode writer will emit an op
encoding without a proper opName. In this case, the string just becomes
a possibly unknown dialect name. At parsing, this dialect name is
used as a proper operation name.
However, when the unregistered operation name coincidentally matches
that of a dialect, the parser would fail. That means we can't roundtrip
an unregistered op with a name that matches one of the registered
dialect names. For example,
```
"index"() : () -> ()
```
can be emitted but cannot be parsed, because its name is coincidentally
the same as that of the Index dialect. The patch removes such
inconsistency.
This patch specifically fixes the bytecode roundtrip of
`mlir/test/IR/parser.mlir`.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list