[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-24 Thread Kuan Hsu Chen via Phabricator via cfe-commits
khchen added a comment. In D67385#1680959 , @tejohnson wrote: > In D67385#1680942 , @khchen wrote: > > > @tejohnson for example: > > > > $ clang -flto a.c -c -o a.o > > $ llvm-ar q a.a a.o // archive li

[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-24 Thread Teresa Johnson via Phabricator via cfe-commits
tejohnson added a comment. In D67385#1680942 , @khchen wrote: > @tejohnson for example: > > $ clang -flto a.c -c -o a.o > $ llvm-ar q a.a a.o // archive libraries > $ clang -flto a.a b.c -O2 -o main -mcmodel=small > > > In above case

[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-24 Thread Kuan Hsu Chen via Phabricator via cfe-commits
khchen added a comment. @tejohnson for example: $ clang -flto a.c -c -o a.o $ llvm-ar q a.a a.o // archive libraries $ clang -flto a.a b.c -O2 -o main -mcmodel=small In above case user need to aware that passing `-Wl,-plugin-opt=-code-model=small` to plugin is necessary. I

[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-23 Thread Teresa Johnson via Phabricator via cfe-commits
tejohnson added a comment. In D67385#1679127 , @khchen wrote: > @tejohnson when I run the `clang -flto -Wl,-plugin-opt=-help` command, it > shows the > > --code-model= - Choose code model > =tiny

[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-23 Thread Kuan Hsu Chen via Phabricator via cfe-commits
khchen added a comment. @tejohnson when I run the `clang -flto -Wl,-plugin-opt=-help` command, it shows the --code-model= - Choose code model =tiny- Tiny code model =small

[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-23 Thread Teresa Johnson via Phabricator via cfe-commits
tejohnson added a comment. Typically -mcmodel is passed to the clang compile invocation which sets a module flag in the IR, which is then used by LTO (see calls to Module::setCodeModel() and Module::getCodeModel()). Why is it necessary to pass through the mcmodel passed to the link invocation?

[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-22 Thread Kuan Hsu Chen via Phabricator via cfe-commits
khchen added a comment. ping Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67385/new/ https://reviews.llvm.org/D67385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[PATCH] D67385: Pass -mcmodel to LTO plugin

2019-09-14 Thread Kuan Hsu Chen via Phabricator via cfe-commits
khchen updated this revision to Diff 220218. khchen retitled this revision from "Pass -mcmodel to gold-pulgin" to "Pass -mcmodel to LTO plugin". khchen edited the summary of this revision. khchen added a comment. Herald added subscribers: steven_wu, inglorion. added a test CHANGES SINCE LAST AC