[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-17 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth added a comment. Small forward fix for the documentation in D155490 . If something else crops up I can revert both and reland. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.l

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-17 Thread Paul Kirth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG610fc5cbcc8b: [clang] Preliminary fat-lto-object support (authored by paulkirth). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-15 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. Thank you for the update. I think this Clang patch is good enough to land even if the lld part is still in review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.l

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-14 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 540559. paulkirth marked an inline comment as done. paulkirth edited the summary of this revision. paulkirth added a comment. Revise tests + update summary - Add driver tests for -S - Add codegen tests for -S - Test Unified LTO codegen - Use -fdriver-only t

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-14 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/test/CodeGen/embed-fat-lto-objects.c:3 +// RUN: %clang -cc1 -triple x86_64-unknown-linux-gnu -flto=full -ffat-lto-objects -emit-llvm < %s | FileCheck %s --check-prefixes=FULL,SPLIT + +// RUN: %clang -cc1 -triple x86_64-unknown-li

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-14 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth added inline comments. Comment at: clang/lib/Driver/Driver.cpp:4733 + types::ID Output; + if (Args.hasArg(options::OPT_S)) +Output = types::TY_LTO_IR; MaskRay wrote: > This part is not tested. oh, feel free to disregard my Q about `-S

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-14 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth added a comment. In D146777#4499608 , @MaskRay wrote: > Thanks for the update. Can you add a comment for the `-funified-lto` > combination? It's unclear what it does... ugh, I had put comments above each compiler invocation, but forgot that

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-13 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Thanks for the update. Can you add a comment for the `-funified-lto` combination? It's unclear what it does... `clang -flto=thin -ffat-lto-objects -funified-lto -fuse-ld=lld foo.c` I've left some comments about missing test coverage. Comment at: clan

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-13 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 540192. paulkirth marked an inline comment as done. paulkirth edited the summary of this revision. paulkirth added a comment. Update summary w/ instructions for using `-ffat-lto-objects` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/docs/ReleaseNotes.rst:268 +- ``-ffat-lto-objects`` can now be used to emit object files with both object + code and LLVM bitcode. Previously this flag was ignored for GCC compatibility. + You can insert the https

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D146777#4491842 , @paulkirth wrote: > Rebase and try to accomodate Unified LTO changes. > > Based on the Unified LTO patches, I think this is the correct handling for > FatLTO, but I'd like to get a second opinion before landin

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-12 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 539584. paulkirth added a comment. Use `--` for LLD options Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/cla

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:623 +if (Args.hasArg(options::OPT_ffat_lto_objects)) + CmdArgs.push_back("-fat-lto-objects"); } New lld long options only allow `--` form. So use two dashes. Repos

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-07-11 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 539346. paulkirth added a comment. Rebase and try to accomodate Unified LTO changes. Based on the Unified LTO patches, I think this is the correct handling for FatLTO, but I'd like to get a second opinion before landing this. CC: @ormris Repository: rG

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-28 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D146777#4457839 , @paulkirth wrote: > In D146777#4457209 , @MaskRay wrote: > >> As mentioned, you may consider landing llvm patch then wait a bit so that >> (a) people can experiment w

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-28 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth added a comment. In D146777#4457209 , @MaskRay wrote: > As mentioned, you may consider landing llvm patch then wait a bit so that (a) > people can experiment with the clang patch better (b) prevent the llvm/clang > patches to be both reverted,

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-28 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. As mentioned, you may consider landing llvm patch then wait a bit so that (a) people can experiment with the clang patch better (b) prevent the llvm/clang patches to be both reverted, if some issue has been identified with the llvm patch. (Don't worry that a feature doe

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-28 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 535472. paulkirth added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/CodeGenOp

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-21 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth added inline comments. Comment at: clang/include/clang/Driver/Options.td:2311 MarshallingInfoString>; +defm fat_lto_objects : BoolFOption<"fat-lto-objects", + CodeGenOpts<"FatLTO">, DefaultFalse, MaskRay wrote: > We just need the pos flag for CC1Opt

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-21 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 533433. paulkirth marked 12 inline comments as done. paulkirth added a comment. Rebase and address comments - Update & rename tests - Fix typos - Handle options Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:7298 + if (IsUsingLTO && Args.getLastArg(options::OPT_ffat_lto_objects)) { +assert(LTOMode == LTOK_Full || LTOMode == LTOK_Thin); +CmdArgs.push_back(Args.MakeArgString( We a

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/docs/ReleaseNotes.rst:250 +- `-ffat-lto-objects` can now be used to emit object files with both object + code and bitcode. Previously this flag was ignored for GCC compatibility. MaskRay wrote: > `bitcode` => `

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. There is a `-fno-fat-lto-objects` issue, but otherwise looks good after some nits are addressed. Thanks! Comment at: clang/docs/ReleaseNotes.rst:250 +- `-ffat-lto-objects` can now be used to emit object files with both

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-16 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth marked an inline comment as done. paulkirth added inline comments. Comment at: clang/test/Driver/fatlto.c:1 + tejohnson wrote: > Is this empty file meant to contain something? No, this was just a mistake in my commit. I had the linker checks in another

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-16 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 532272. paulkirth added a comment. Rebase and fix run line in test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/incl

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-16 Thread Teresa Johnson via Phabricator via cfe-commits
tejohnson accepted this revision. tejohnson added a comment. This revision is now accepted and ready to land. lgtm Comment at: clang/test/Driver/fatlto.c:1 + Is this empty file meant to contain something? Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-16 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 532212. paulkirth marked an inline comment as done. paulkirth added a comment. Rebase, address comments, and add missing test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.l

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-15 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth added inline comments. Comment at: clang/lib/CodeGen/BackendUtil.cpp:1065 + if (CodeGenOpts.FatLTO) { +// Set EnableSplitLTOUnit, since the config above won't +if (!TheModule->getModuleFlag("EnableSplitLTOUnit")) tejohnson wrote: > Can you expa

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-15 Thread Teresa Johnson via Phabricator via cfe-commits
tejohnson added inline comments. Comment at: clang/lib/CodeGen/BackendUtil.cpp:1065 + if (CodeGenOpts.FatLTO) { +// Set EnableSplitLTOUnit, since the config above won't +if (!TheModule->getModuleFlag("EnableSplitLTOUnit")) Can you expand the comment a bi

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-06-14 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 531534. paulkirth added a comment. Rebase and pass fat-lto-objects to LLD from clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNot

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-05-31 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 527075. paulkirth added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/CodeGenO

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-05-25 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 525902. paulkirth added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/CodeGenOp

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-27 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 517706. paulkirth added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/CodeGenOp

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-26 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 517416. paulkirth added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/CodeGenO

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-21 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 515910. paulkirth added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/CodeGenOp

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-21 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 515880. paulkirth added a comment. Add relese note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-17 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 514432. paulkirth added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/include/clang/Basic/CodeGenOptions.def clang/include/cla

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-17 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 514430. paulkirth added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/include/clang/Basic/CodeGenOptions.def clang/include/cla

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-17 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 514331. paulkirth added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/include/clang/Basic/CodeGenOptions.def clang/include/cla

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-04-14 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 513766. paulkirth added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146777/new/ https://reviews.llvm.org/D146777 Files: clang/include/clang/Basic/CodeGenOptions.def clang/include/cla

[PATCH] D146777: [clang] Preliminary fat-lto-object support

2023-03-27 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth updated this revision to Diff 508773. paulkirth retitled this revision from "[clang] Preliminary fat-lot-object support" to "[clang] Preliminary fat-lto-object support". paulkirth added a comment. Herald added a subscriber: inglorion. Fix typo in title Repository: rG LLVM Github Mon