[Mlir-commits] [mlir] [MLIR][LLVMIR] Add support for intrinsics with metadata arguments (PR #200308)
Andy Kaylor
llvmlistbot at llvm.org
Tue Jun 2 17:58:01 PDT 2026
================
@@ -1980,10 +2016,29 @@ LogicalResult ModuleImport::convertIntrinsicArguments(
value = nullptr;
}
+ // Convert a single intrinsic operand into an MLIR value.
+ // `llvm::MetadataAsValue` operands (e.g. the rounding-mode / FP-exception
+ // MDString arguments used by the constrained floating-point intrinsics, or
+ // the named-register MDNode used by `llvm.read_register`) are lifted into a
+ // `llvm.mlir.metadata_as_value` SSA op carrying the corresponding metadata
+ // attribute. All other operands go through the standard `convertValue` path,
+ // which rejects metadata values.
+ auto convertOperand = [&](llvm::Value *value) -> FailureOr<Value> {
+ if (auto *mdAsVal = dyn_cast<llvm::MetadataAsValue>(value)) {
----------------
andykaylor wrote:
Sure. That works.
https://github.com/llvm/llvm-project/pull/200308
More information about the Mlir-commits
mailing list