[mlir] Add pass to add comdat to all linkonce functions (#65270)
authorDavid Truby <david@truby.dev>
Wed, 13 Sep 2023 12:05:05 +0000 (13:05 +0100)
committerTobias Hieta <tobias@hieta.se>
Tue, 31 Oct 2023 07:58:56 +0000 (08:58 +0100)
commitbdb1553c7639baaf17f462bb743beac1fdd360d9
treedb71b37b8262ed791834cdb5e39f375e4e0bc902
parent3347c844158831872bf017842f1b85993e4c82f6
[mlir] Add pass to add comdat to all linkonce functions (#65270)

This adds a new pass to add an Any comdat to each linkonce
and linkonce_odr function in the LLVM dialect. These comdats are
necessary on Windows
to allow the default system linker to link binaries containing these
functions.

(cherry picked from commit a6857156df9a73720fbd9633067d1a61c32dd74e)
mlir/include/mlir/Dialect/LLVMIR/Transforms/AddComdats.h [new file with mode: 0644]
mlir/include/mlir/Dialect/LLVMIR/Transforms/Passes.h
mlir/include/mlir/Dialect/LLVMIR/Transforms/Passes.td
mlir/lib/Dialect/LLVMIR/Transforms/AddComdats.cpp [new file with mode: 0644]
mlir/lib/Dialect/LLVMIR/Transforms/CMakeLists.txt
mlir/test/Dialect/LLVMIR/add-linkonce-comdat.mlir [new file with mode: 0644]