[Mlir-commits] [mlir] [mlir] Add option to add comdat to all linkonce functions (PR #65270)

David Truby llvmlistbot at llvm.org
Mon Sep 4 13:34:43 PDT 2023


DavidTruby wrote:

The exact use case in flang is that we just want every function that has linkonce or linkonce_odr linkage to have the Any comdat on any target that supports comdats (well, particularly on Windows where linking won't work at all without them, but behaviour is also slightly better on ELF-based platforms with comdats than without them). 

We particularly see this when converting using the MathToFuncs dialects where ipowi operations are converted using a function defined by the conversion with linkonce linkage, and so these fail to link on Windows with the default linker because it bails on the duplicate definitions with no comdats. If comdats could be added to FuncOps at any point, MathToFuncs could just add the comdat when compiling for a target that supports comdats.

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


More information about the Mlir-commits mailing list