[all-commits] [llvm/llvm-project] 1c1d0c: [MLIR][LLVMIR] Handle MDTuple-of-MDStrings module ...
Mehdi Amini via All-commits
all-commits at lists.llvm.org
Mon Apr 13 04:37:27 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1c1d0cd30edf8134585ab914efdb7bf2f781958c
https://github.com/llvm/llvm-project/commit/1c1d0cd30edf8134585ab914efdb7bf2f781958c
Author: Mehdi Amini <joker.eph at gmail.com>
Date: 2026-04-13 (Mon, 13 Apr 2026)
Changed paths:
M mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
M mlir/lib/Target/LLVMIR/ModuleImport.cpp
M mlir/test/Dialect/LLVMIR/invalid.mlir
M mlir/test/Target/LLVMIR/Import/module-flags.ll
M mlir/test/Target/LLVMIR/llvmir.mlir
Log Message:
-----------
[MLIR][LLVMIR] Handle MDTuple-of-MDStrings module flags (e.g. riscv-isa) (#188741)
The "riscv-isa" LLVM module flag stores its value as an MDTuple
containing MDStrings (e.g. `\!{\!"rv64i2p1", \!"m2p0"}`). Previously,
this fell through the unrecognized-key path in
`convertModuleFlagValueFromMDTuple`, which emitted a warning and dropped
the flag during import.
This patch adds generic handling for MDTuples whose operands are all
MDStrings:
- Import: convert to `ArrayAttr<StringAttr>` in
`convertModuleFlagValueFromMDTuple`
- Export: convert `ArrayAttr<StringAttr>` back to an MDTuple of
MDStrings in `convertModuleFlagValue`, enabling a lossless round-trip
- Verifier: allow `ArrayAttr<StringAttr>` as a valid `ModuleFlagAttr`
value for keys not otherwise handled by specific verifier branches
Fixes #188122
Assisted-by: Claude Code
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