[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-08 Thread Jacob Lambert via cfe-commits
lamb-j wrote: https://github.com/llvm/llvm-project/pull/91495 Follow up PR to fix warning with now-unused private variable in BackendConsumer class (FileMgr) https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits mailing list cfe-commits@lis

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-08 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j closed https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Hopefully in the future we can handle this in the linker better. https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-07 Thread via cfe-commits
b-sumner wrote: Looks good to me. https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-03 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/85672 >From aff1a762a73ce30cde38a6fcbbed8a3e4f0b5366 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 18 Mar 2024 10:19:38 -0700 Subject: [PATCH 1/7] [clang][CodeGen] Omit pre-opt link when post-opt link request

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-02 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j edited https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-02 Thread Jacob Lambert via cfe-commits
lamb-j wrote: Switched the option from a cl::opt to a Clang/CodeGen option. Also added a LIT test which tests both -mlink-builtin-bitcode-postopt and -mno-link-builtin-bitcode-postopt https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits ma

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-02 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/85672 >From aff1a762a73ce30cde38a6fcbbed8a3e4f0b5366 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 18 Mar 2024 10:19:38 -0700 Subject: [PATCH 1/6] [clang][CodeGen] Omit pre-opt link when post-opt link request

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-02 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/85672 >From aff1a762a73ce30cde38a6fcbbed8a3e4f0b5366 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 18 Mar 2024 10:19:38 -0700 Subject: [PATCH 1/5] [clang][CodeGen] Omit pre-opt link when post-opt link request

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-01 Thread via cfe-commits
b-sumner wrote: > > I'm thinking of an option that developers can use. If > > -link-builtin-bitcodes-postopt, becomes the default, how can developers > > disable it? > > Presumably you'd add `--no-link-builtin-bitcodes-postopt` and then use > `Args.hasFlag(PosFlag, NegFlag, Default)`. I assu

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-01 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > Currently if a user doesn't supply the new "-link-builtin-bitcodes-postopt" > > option, linking builtin bitcodes happens first, then the optimization > > pipeline follows. Does that cover the case you're talking about? > > I'm thinking of an option that developers can use. I

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-01 Thread via cfe-commits
b-sumner wrote: > Currently if a user doesn't supply the new "-link-builtin-bitcodes-postopt" > option, linking builtin bitcodes happens first, then the optimization > pipeline follows. Does that cover the case you're talking about? I'm thinking of an option that developers can use. If -link

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-01 Thread Jacob Lambert via cfe-commits
lamb-j wrote: > @lamb-j I appreciate your carrying out these performance tests! > > Would you be open to providing an option to enable post-link optimization > that could be off by default for now? Currently if a user doesn't supply the new "-link-builtin-bitcodes-postopt" option, linking bui

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-01 Thread via cfe-commits
b-sumner wrote: @lamb-j I appreciate your carrying out these performance tests! Would you be open to providing an option to enable post-link optimization that could be off by default for now? https://github.com/llvm/llvm-project/pull/85672 ___ cfe-co

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-05-01 Thread Jacob Lambert via cfe-commits
lamb-j wrote: I've been working on testing this patch with an array of OpenCL benchmarks over the past month. We did some high-level regression testing with the following benchmarks: BlackMagic Linpack_Dgemm babelstream-Double babelstream-Float chimex clfft clmem clpeak-Double-precision comput

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-04-30 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/85672 >From aff1a762a73ce30cde38a6fcbbed8a3e4f0b5366 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 18 Mar 2024 10:19:38 -0700 Subject: [PATCH 1/5] [clang][CodeGen] Omit pre-opt link when post-opt link request

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-04-29 Thread Jacob Lambert via cfe-commits
@@ -28,12 +28,8 @@ PreservedAnalyses LinkInModulesPass::run(Module &M, ModuleAnalysisManager &AM) { if (!BC) return PreservedAnalyses::all(); - // Re-load bitcode modules from files - if (BC->ReloadModules(&M)) -report_fatal_error("Bitcode module re-loading failed

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-03-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: This means that there won't be any optimizations on these definitions, correct? Likely not ideal to have no inlining even if it saves compilation time. This "post-op" linking is only required because we emit calls to functions that don't exist in the module. The way we solved t

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-03-18 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/85672 >From aff1a762a73ce30cde38a6fcbbed8a3e4f0b5366 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 18 Mar 2024 10:19:38 -0700 Subject: [PATCH 1/4] [clang][CodeGen] Omit pre-opt link when post-opt link request

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-03-18 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/85672 >From aff1a762a73ce30cde38a6fcbbed8a3e4f0b5366 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 18 Mar 2024 10:19:38 -0700 Subject: [PATCH 1/3] [clang][CodeGen] Omit pre-opt link when post-opt link request

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-03-18 Thread via cfe-commits
b-sumner wrote: This seems like it could have a significant hit on performance. Have the runtime performance effects been measured? https://github.com/llvm/llvm-project/pull/85672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-03-18 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/85672 >From aff1a762a73ce30cde38a6fcbbed8a3e4f0b5366 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 18 Mar 2024 10:19:38 -0700 Subject: [PATCH 1/2] [clang][CodeGen] Omit pre-opt link when post-opt link request

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-03-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Jacob Lambert (lamb-j) Changes Currently, when the -relink-builtin-bitcodes-postop option is used we link builtin bitcodes twice: once before optimization, and again after optimization. With this change, we omit the pre-opt linkin

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

2024-03-18 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j created https://github.com/llvm/llvm-project/pull/85672 Currently, when the -relink-builtin-bitcodes-postop option is used we link builtin bitcodes twice: once before optimization, and again after optimization. With this change, we omit the pre-opt linking when the op