[PATCH] D67385: Pass -mcmodel to LTO plugin

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 07:55:30 PDT 2019


tejohnson added a comment.

In D67385#1679127 <https://reviews.llvm.org/D67385#1679127>, @khchen wrote:

> @tejohnson when I run the `clang -flto -Wl,-plugin-opt=-help` command, it shows the
>
>   --code-model=<value>                               - Choose code model
>      =tiny                                            -   Tiny code model
>      =small                                           -   Small code model
>      =kernel                                          -   Kernel code model
>      =medium                                          -   Medium code model
>      =large                                           -   Large code model
>
>   so I think the clang driver need to pass this info to LTO codegen, does it make sense?


This is an internal LLVM option, that can be used to override the mcmodel set in the Module IR when the code was compiled into Bitcode. I don't think it makes sense to have the clang driver automatically set this internal option for the plugin, overridding what was set when the code was compiled, it can be set manually via a -plugin-opt if one needs to override for debugging etc. Why isn't the code model module flag in the Bitcode sufficient for your LTO case?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67385/new/

https://reviews.llvm.org/D67385





More information about the cfe-commits mailing list