mirror-llvm-project/mlir/tools
Natanael Cintean e432cb1296
[mlir]Add resultSegmentSizes/operandSegmentSizes to prop-dict. (#211222)
`setPropertiesFromParsedAttr` (generated by `OpFormatGen.cpp` for ops
using a custom `assemblyFormat`) rejects the trait-injected
`operandSegmentSizes` /. `resultSegmentSizes` properties when they
appear in a `prop-dict`, even though the printer emits them there for ops
whose format uses a bulk operand/result type directive
(`type(operands)`, `type(results)`, `functional-type(operands, results)`).

This breaks round-tripping: any op combining `AttrSizedOperandSegments`
/ `AttrSizedResultSegments` with such a bulk directive fails to re-parse
its own printed output, because printer-side elision of these keys
(introduced in #115930) is intentionally skipped in that case — the
sizes can't be reconstructed from individually-typed operand/result 
groups, so they must survive in the text, but the custom parser was never
taught to read them back.

`setPropertiesFromAttr` (used by the generic-form parser, bytecode, and
C++ construction) already special-cases these two keys, so this change
makes `setPropertiesFromParsedAttr` mirror that behavior: keys are
accepted from the dictionary attr when the corresponding trait is present,
and required exactly when the format can't reconstruct the sizes itself
(i.e. when `fmt.allOperands` / `fmt.allResultTypes` is true). Otherwise the
key remains optional, since `genParserVariadicSegmentResolution`
overwrites it with the sizes inferred from the parsed operand/result
groups.

The contents of the PR as well as description has been made using
github-copilot. However I've reviewed the contents and tested locally
the change.

Fixes #211220
2026-07-28 13:11:34 +00:00
..
mlir-irdl-to-cpp [MLIR] Install missing standalone helper tools (#205066) 2026-07-13 09:33:38 +01:00
mlir-linalg-ods-gen [NFC] Exactly one kind typo fixes, change defintions to definitions. (#174333) 2026-01-14 08:12:26 +00:00
mlir-lsp-server [LLVM][MLIR] Move LSP server support library from MLIR into LLVM (#157885) 2025-09-11 17:17:52 +00:00
mlir-opt Reland "[MLIR] Add IntegerDivisibilityAnalysis and InferIntDivisibilityOpInterface" (#198110) 2026-05-18 16:01:06 -04:00
mlir-parser-fuzzer
mlir-pdll [support] Use VFS in SourceMgr for loading includes (#162903) 2025-10-15 09:24:36 -07:00
mlir-pdll-lsp-server
mlir-query
mlir-reduce
mlir-rewrite [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in mlir-rewrite.cpp (NFC) 2025-10-03 03:16:39 -07:00
mlir-runner
mlir-shlib
mlir-src-sharder [MLIR] Install missing standalone helper tools (#205066) 2026-07-13 09:33:38 +01:00
mlir-tblgen [mlir]Add resultSegmentSizes/operandSegmentSizes to prop-dict. (#211222) 2026-07-28 13:11:34 +00:00
mlir-translate
tblgen-lsp-server
tblgen-to-irdl [mlir] fix the Disambiguate NoneType in OpDefinitionsGen (#172923) 2025-12-22 11:36:40 +01:00
CMakeLists.txt