[Mlir-commits] [mlir] [mlir] Add llvm.linker.options operation to the LLVM IR Dialect (PR #71720)

David Truby llvmlistbot at llvm.org
Thu Nov 9 05:24:21 PST 2023


================
@@ -2337,3 +2337,9 @@ llvm.func @zeroinit_complex_local_aggregate() {
 
   llvm.return
 }
+
+//CHECK: !llvm.linker.options = !{![[MD0:[0-9]+]], ![[MD1:[0-9]+]]}
+//CHECK: ![[MD0]] = !{!"/DEFAULTLIB:", !"libcmt"}
+llvm.linker.options ["/DEFAULTLIB:", "libcmt"]
+//CHECK: ![[MD1]] = !{!"/DEFAULTLIB:", !"libcmtd"}
+llvm.linker.options ["/DEFAULTLIB:", "libcmtd"]
----------------
DavidTruby wrote:

It should only be possible to write it at module scope, I’ll add a verifier to check this.

We can have multiple per module, right now I’m just generating a single LLVM metadata operation with all the mlir linker options on the one operation because I think that’s better supported. It’s not clear in the langref on the LLVM side if multiple are allowed and it seems to work on windows but not Linux from my testing. I don’t think it matters that much though as we can still generate a single LLVM metadata from multiple operations on the MLIR side, which is what I have done in this patch.

https://github.com/llvm/llvm-project/pull/71720


More information about the Mlir-commits mailing list