Re: [PATCH 00/22] add support for Clang LTO

2020-07-14 Thread Nick Desaulniers
On Tue, Jul 14, 2020 at 2:44 AM Sedat Dilek wrote: > > On Sun, Jul 12, 2020 at 8:40 PM Nathan Chancellor > wrote: > > > > Lastly, for the future, I would recommend grabbing b4 to easily apply > > patches (specifically full series) from lore.kernel.org. > > > > https://git.kernel.org/pub/scm/utils

Re: [PATCH 00/22] add support for Clang LTO

2020-07-14 Thread Sedat Dilek
On Tue, Jul 14, 2020 at 2:16 PM Paul Menzel wrote: > > Dear Sami, > > > Am 13.07.20 um 01:34 schrieb Sami Tolvanen: > > On Sat, Jul 11, 2020 at 9:32 AM Paul Menzel wrote: > >> Thank you very much for sending these changes. > >> > >> Do you have a branch, where your current work can be pulled from

Re: [PATCH 00/22] add support for Clang LTO

2020-07-14 Thread Paul Menzel
Dear Sami, Am 13.07.20 um 01:34 schrieb Sami Tolvanen: On Sat, Jul 11, 2020 at 9:32 AM Paul Menzel wrote: Thank you very much for sending these changes. Do you have a branch, where your current work can be pulled from? Your branch on GitHub [1] seems 15 months old. The clang-lto branch is

Re: [PATCH 00/22] add support for Clang LTO

2020-07-14 Thread Sedat Dilek
On Sun, Jul 12, 2020 at 8:40 PM Nathan Chancellor wrote: > > On Sun, Jul 12, 2020 at 10:59:17AM +0200, Sedat Dilek wrote: > > On Sat, Jul 11, 2020 at 6:32 PM Paul Menzel wrote: > > > > > > Dear Sami, > > > > > > > > > Am 24.06.20 um 22:31 schrieb Sami Tolvanen: > > > > This patch series adds supp

Re: [PATCH 00/22] add support for Clang LTO

2020-07-12 Thread Sami Tolvanen
On Sat, Jul 11, 2020 at 9:32 AM Paul Menzel wrote: > Thank you very much for sending these changes. > > Do you have a branch, where your current work can be pulled from? Your > branch on GitHub [1] seems 15 months old. The clang-lto branch is rebased regularly on top of Linus' tree. GitHub just l

Re: [PATCH 00/22] add support for Clang LTO

2020-07-12 Thread Nathan Chancellor
On Sun, Jul 12, 2020 at 10:59:17AM +0200, Sedat Dilek wrote: > On Sat, Jul 11, 2020 at 6:32 PM Paul Menzel wrote: > > > > Dear Sami, > > > > > > Am 24.06.20 um 22:31 schrieb Sami Tolvanen: > > > This patch series adds support for building x86_64 and arm64 kernels > > > with Clang's Link Time Optim

Re: [PATCH 00/22] add support for Clang LTO

2020-07-12 Thread Sedat Dilek
On Sat, Jul 11, 2020 at 6:32 PM Paul Menzel wrote: > > Dear Sami, > > > Am 24.06.20 um 22:31 schrieb Sami Tolvanen: > > This patch series adds support for building x86_64 and arm64 kernels > > with Clang's Link Time Optimization (LTO). > > > > In addition to performance, the primary motivation for

Re: [PATCH 00/22] add support for Clang LTO

2020-07-11 Thread Paul Menzel
Dear Sami, Am 24.06.20 um 22:31 schrieb Sami Tolvanen: This patch series adds support for building x86_64 and arm64 kernels with Clang's Link Time Optimization (LTO). In addition to performance, the primary motivation for LTO is to allow Clang's Control-Flow Integrity (CFI) to be used in the k

Re: [PATCH 00/22] add support for Clang LTO

2020-07-07 Thread Jakub Kicinski
On Tue, 7 Jul 2020 10:17:25 -0700 Nick Desaulniers wrote: > On Tue, Jul 7, 2020 at 9:56 AM Jakub Kicinski wrote: > > > > > On Tue, Jul 07, 2020 at 08:51:07AM -0700, Sami Tolvanen wrote: > > > > After spending some time debugging this with Nick, it looks like the > > > > error is caused by a re

Re: [PATCH 00/22] add support for Clang LTO

2020-07-07 Thread Nick Desaulniers
On Tue, Jul 7, 2020 at 9:56 AM Jakub Kicinski wrote: > > > On Tue, Jul 07, 2020 at 08:51:07AM -0700, Sami Tolvanen wrote: > > > After spending some time debugging this with Nick, it looks like the > > > error is caused by a recent optimization change in LLVM, which together > > > with the inlining

Re: [PATCH 00/22] add support for Clang LTO

2020-07-07 Thread Jakub Kicinski
On Tue, 7 Jul 2020 09:05:28 -0700 Sami Tolvanen wrote: > On Tue, Jul 07, 2020 at 08:51:07AM -0700, Sami Tolvanen wrote: > > After spending some time debugging this with Nick, it looks like the > > error is caused by a recent optimization change in LLVM, which together > > with the inlining of ur_lo

Re: [PATCH 00/22] add support for Clang LTO

2020-07-07 Thread Sami Tolvanen
On Tue, Jul 07, 2020 at 08:51:07AM -0700, Sami Tolvanen wrote: > After spending some time debugging this with Nick, it looks like the > error is caused by a recent optimization change in LLVM, which together > with the inlining of ur_load_imm_any into jeq_imm, changes a runtime > check in FIELD_FIT

Re: [PATCH 00/22] add support for Clang LTO

2020-07-07 Thread Sami Tolvanen
On Mon, Jun 29, 2020 at 04:20:59PM -0700, Sami Tolvanen wrote: > Hi Masahiro, > > On Mon, Jun 29, 2020 at 01:56:19AM +0900, Masahiro Yamada wrote: > > I also got an error for > > ARCH=arm64 allyesconfig + CONFIG_LTO_CLANG=y > > > > > > > > $ make ARCH=arm64 LLVM=1 LLVM_IAS=1 > > CROSS_COMPILE=~

Re: [PATCH 00/22] add support for Clang LTO

2020-07-06 Thread Paul E. McKenney
On Mon, Jul 06, 2020 at 09:40:12PM +0200, Peter Zijlstra wrote: > On Mon, Jul 06, 2020 at 11:39:33AM -0700, Paul E. McKenney wrote: > > On Mon, Jul 06, 2020 at 08:29:26PM +0200, Peter Zijlstra wrote: > > > On Mon, Jul 06, 2020 at 09:26:33AM -0700, Paul E. McKenney wrote: > > > > If they do not con

Re: [PATCH 00/22] add support for Clang LTO

2020-07-06 Thread Peter Zijlstra
On Mon, Jul 06, 2020 at 11:39:33AM -0700, Paul E. McKenney wrote: > On Mon, Jul 06, 2020 at 08:29:26PM +0200, Peter Zijlstra wrote: > > On Mon, Jul 06, 2020 at 09:26:33AM -0700, Paul E. McKenney wrote: > > If they do not consider their Linux OS running correctly :-) > > Many of them really do not

Re: [PATCH 00/22] add support for Clang LTO

2020-07-06 Thread Paul E. McKenney
On Mon, Jul 06, 2020 at 08:29:26PM +0200, Peter Zijlstra wrote: > On Mon, Jul 06, 2020 at 09:26:33AM -0700, Paul E. McKenney wrote: > > > And perhaps more constructively, we do need to prioritize address and data > > dependencies over control dependencies. For one thing, there are a lot > > more

Re: [PATCH 00/22] add support for Clang LTO

2020-07-06 Thread Peter Zijlstra
On Mon, Jul 06, 2020 at 09:26:33AM -0700, Paul E. McKenney wrote: > And perhaps more constructively, we do need to prioritize address and data > dependencies over control dependencies. For one thing, there are a lot > more address/data dependencies in existing code than there are control > depend

Re: [PATCH 00/22] add support for Clang LTO

2020-07-06 Thread Paul E. McKenney
On Fri, Jul 03, 2020 at 07:42:28AM -0700, Paul E. McKenney wrote: > On Fri, Jul 03, 2020 at 03:13:30PM +0200, Peter Zijlstra wrote: > > On Thu, Jul 02, 2020 at 10:59:48AM -0700, Paul E. McKenney wrote: > > > On Thu, Jul 02, 2020 at 10:20:40AM +0200, Peter Zijlstra wrote: > > > > On Wed, Jul 01, 202

Re: [PATCH 00/22] add support for Clang LTO

2020-07-03 Thread Paul E. McKenney
On Fri, Jul 03, 2020 at 03:25:23PM +0200, Peter Zijlstra wrote: > On Fri, Jul 03, 2020 at 03:13:30PM +0200, Peter Zijlstra wrote: > > > The prototype for GCC is here: https://github.com/AKG001/gcc/ > > > > Thanks! Those test cases are somewhat over qualified though: > > > >static volatile

Re: [PATCH 00/22] add support for Clang LTO

2020-07-03 Thread Paul E. McKenney
On Fri, Jul 03, 2020 at 03:13:30PM +0200, Peter Zijlstra wrote: > On Thu, Jul 02, 2020 at 10:59:48AM -0700, Paul E. McKenney wrote: > > On Thu, Jul 02, 2020 at 10:20:40AM +0200, Peter Zijlstra wrote: > > > On Wed, Jul 01, 2020 at 09:03:38AM -0700, Paul E. McKenney wrote: > > > > > > > But it looks

Re: [PATCH 00/22] add support for Clang LTO

2020-07-03 Thread Peter Zijlstra
On Fri, Jul 03, 2020 at 03:13:30PM +0200, Peter Zijlstra wrote: > > The prototype for GCC is here: https://github.com/AKG001/gcc/ > > Thanks! Those test cases are somewhat over qualified though: > >static volatile _Atomic (TYPE) * _Dependent_ptr a; > \ One question t

Re: [PATCH 00/22] add support for Clang LTO

2020-07-03 Thread Peter Zijlstra
On Thu, Jul 02, 2020 at 10:59:48AM -0700, Paul E. McKenney wrote: > On Thu, Jul 02, 2020 at 10:20:40AM +0200, Peter Zijlstra wrote: > > On Wed, Jul 01, 2020 at 09:03:38AM -0700, Paul E. McKenney wrote: > > > > > But it looks like we are going to have to tell the compiler. > > > > What does the cu

Re: [PATCH 00/22] add support for Clang LTO

2020-07-02 Thread Paul E. McKenney
On Thu, Jul 02, 2020 at 09:37:26AM +, David Laight wrote: > From: Paul E. McKenney > > Sent: 01 July 2020 17:06 > ... > > > Would an asm statement that uses the same 'register' for input and > > > output but doesn't actually do anything help? > > > It won't generate any code, but the compiler o

Re: [PATCH 00/22] add support for Clang LTO

2020-07-02 Thread Paul E. McKenney
On Thu, Jul 02, 2020 at 10:20:40AM +0200, Peter Zijlstra wrote: > On Wed, Jul 01, 2020 at 09:03:38AM -0700, Paul E. McKenney wrote: > > > But it looks like we are going to have to tell the compiler. > > What does the current proposal look like? I can certainly annotate the > seqcount latch users,

RE: [PATCH 00/22] add support for Clang LTO

2020-07-02 Thread David Laight
From: Paul E. McKenney > Sent: 01 July 2020 17:06 ... > > Would an asm statement that uses the same 'register' for input and > > output but doesn't actually do anything help? > > It won't generate any code, but the compiler ought to assume that > > it might change the value - so can't do optimisati

Re: [PATCH 00/22] add support for Clang LTO

2020-07-02 Thread Peter Zijlstra
On Wed, Jul 01, 2020 at 09:03:38AM -0700, Paul E. McKenney wrote: > But it looks like we are going to have to tell the compiler. What does the current proposal look like? I can certainly annotate the seqcount latch users, but who knows what other code is out there

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Paul E. McKenney
On Wed, Jul 01, 2020 at 02:20:13PM +, David Laight wrote: > From: Peter Zijlstra > > Sent: 01 July 2020 10:11 > > On Tue, Jun 30, 2020 at 01:30:16PM -0700, Paul E. McKenney wrote: > > > On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > > > > > > I'm not convinced C11 memory_ord

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Paul E. McKenney
On Wed, Jul 01, 2020 at 05:05:12PM +0200, Peter Zijlstra wrote: > On Wed, Jul 01, 2020 at 07:06:54AM -0700, Paul E. McKenney wrote: > > > The current state in the C++ committee is that marking variables > > carrying dependencies is the way forward. This is of course not what > > the Linux kernel

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Peter Zijlstra
On Wed, Jul 01, 2020 at 07:06:54AM -0700, Paul E. McKenney wrote: > The current state in the C++ committee is that marking variables > carrying dependencies is the way forward. This is of course not what > the Linux kernel community does, but it should not be hard to have a > -fall-variables-depe

RE: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread David Laight
From: Peter Zijlstra > Sent: 01 July 2020 10:11 > On Tue, Jun 30, 2020 at 01:30:16PM -0700, Paul E. McKenney wrote: > > On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > > > > I'm not convinced C11 memory_order_consume would actually work for us, > > > even if it would work. That i

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Paul E. McKenney
On Wed, Jul 01, 2020 at 01:40:27PM +0200, Peter Zijlstra wrote: > On Wed, Jul 01, 2020 at 11:41:17AM +0200, Marco Elver wrote: > > On Tue, 30 Jun 2020 at 22:30, Paul E. McKenney wrote: > > > On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > > > > On Tue, Jun 30, 2020 at 09:19:31PM

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Peter Zijlstra
On Wed, Jul 01, 2020 at 11:41:17AM +0200, Marco Elver wrote: > On Tue, 30 Jun 2020 at 22:30, Paul E. McKenney wrote: > > On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > > > On Tue, Jun 30, 2020 at 09:19:31PM +0200, Marco Elver wrote: > > > > Thoughts? > > > > > > How hard would

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Will Deacon
On Wed, Jul 01, 2020 at 11:41:17AM +0200, Marco Elver wrote: > On Tue, 30 Jun 2020 at 22:30, Paul E. McKenney wrote: > > On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > > > On Tue, Jun 30, 2020 at 09:19:31PM +0200, Marco Elver wrote: > > > > So, we are probably better off untangl

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Marco Elver
On Tue, 30 Jun 2020 at 22:30, Paul E. McKenney wrote: > On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > > On Tue, Jun 30, 2020 at 09:19:31PM +0200, Marco Elver wrote: > > > First of all, I agree with the concerns, but not because of LTO. > > > > > > To set the stage better, and

Re: [PATCH 00/22] add support for Clang LTO

2020-07-01 Thread Peter Zijlstra
On Tue, Jun 30, 2020 at 01:30:16PM -0700, Paul E. McKenney wrote: > On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > > I'm not convinced C11 memory_order_consume would actually work for us, > > even if it would work. That is, given: > > > > https://lore.kernel.org/lkml/20150520

Re: [PATCH 00/22] add support for Clang LTO

2020-06-30 Thread Paul E. McKenney
On Tue, Jun 30, 2020 at 10:12:43PM +0200, Peter Zijlstra wrote: > On Tue, Jun 30, 2020 at 09:19:31PM +0200, Marco Elver wrote: > > I was asked for input on this, and after a few days digging through some > > history, thought I'd comment. Hope you don't mind. > > Not at all, being the one that aske

Re: [PATCH 00/22] add support for Clang LTO

2020-06-30 Thread Peter Zijlstra
On Tue, Jun 30, 2020 at 09:19:31PM +0200, Marco Elver wrote: > I was asked for input on this, and after a few days digging through some > history, thought I'd comment. Hope you don't mind. Not at all, being the one that asked :-) > First of all, I agree with the concerns, but not because of LTO.

Re: [PATCH 00/22] add support for Clang LTO

2020-06-30 Thread Marco Elver
I was asked for input on this, and after a few days digging through some history, thought I'd comment. Hope you don't mind. On Thu, Jun 25, 2020 at 10:57AM +0200, Peter Zijlstra wrote: > On Thu, Jun 25, 2020 at 10:24:33AM +0200, Peter Zijlstra wrote: > > On Thu, Jun 25, 2020 at 10:03:13AM +0200, P

Re: [PATCH 00/22] add support for Clang LTO

2020-06-29 Thread Sami Tolvanen
Hi Masahiro, On Mon, Jun 29, 2020 at 01:56:19AM +0900, Masahiro Yamada wrote: > On Thu, Jun 25, 2020 at 5:32 AM 'Sami Tolvanen' via Clang Built Linux > wrote: > > > > This patch series adds support for building x86_64 and arm64 kernels > > with Clang's Link Time Optimization (LTO). > > > > In add

Re: [PATCH 00/22] add support for Clang LTO

2020-06-28 Thread Masahiro Yamada
On Thu, Jun 25, 2020 at 5:32 AM 'Sami Tolvanen' via Clang Built Linux wrote: > > This patch series adds support for building x86_64 and arm64 kernels > with Clang's Link Time Optimization (LTO). > > In addition to performance, the primary motivation for LTO is to allow > Clang's Control-Flow Integ

Re: [PATCH 00/22] add support for Clang LTO

2020-06-25 Thread Peter Zijlstra
On Thu, Jun 25, 2020 at 10:24:33AM +0200, Peter Zijlstra wrote: > On Thu, Jun 25, 2020 at 10:03:13AM +0200, Peter Zijlstra wrote: > > I'm sure Will will respond, but the basic issue is the trainwreck C11 > > made of dependent loads. > > > > Anyway, here's a link to the last time this came up: > >

Re: [PATCH 00/22] add support for Clang LTO

2020-06-25 Thread Will Deacon
On Wed, Jun 24, 2020 at 02:30:14PM -0700, Sami Tolvanen wrote: > On Wed, Jun 24, 2020 at 11:15:40PM +0200, Peter Zijlstra wrote: > > On Wed, Jun 24, 2020 at 01:31:38PM -0700, Sami Tolvanen wrote: > > > This patch series adds support for building x86_64 and arm64 kernels > > > with Clang's Link Time

Re: [PATCH 00/22] add support for Clang LTO

2020-06-25 Thread Peter Zijlstra
On Thu, Jun 25, 2020 at 10:03:13AM +0200, Peter Zijlstra wrote: > On Wed, Jun 24, 2020 at 02:31:36PM -0700, Nick Desaulniers wrote: > > On Wed, Jun 24, 2020 at 2:15 PM Peter Zijlstra wrote: > > > > > > On Wed, Jun 24, 2020 at 01:31:38PM -0700, Sami Tolvanen wrote: > > > > This patch series adds su

Re: [PATCH 00/22] add support for Clang LTO

2020-06-25 Thread Peter Zijlstra
On Wed, Jun 24, 2020 at 02:31:36PM -0700, Nick Desaulniers wrote: > On Wed, Jun 24, 2020 at 2:15 PM Peter Zijlstra wrote: > > > > On Wed, Jun 24, 2020 at 01:31:38PM -0700, Sami Tolvanen wrote: > > > This patch series adds support for building x86_64 and arm64 kernels > > > with Clang's Link Time O

Re: [PATCH 00/22] add support for Clang LTO

2020-06-24 Thread Nick Desaulniers
On Wed, Jun 24, 2020 at 2:15 PM Peter Zijlstra wrote: > > On Wed, Jun 24, 2020 at 01:31:38PM -0700, Sami Tolvanen wrote: > > This patch series adds support for building x86_64 and arm64 kernels > > with Clang's Link Time Optimization (LTO). > > > > In addition to performance, the primary motivatio

Re: [PATCH 00/22] add support for Clang LTO

2020-06-24 Thread Sami Tolvanen
On Wed, Jun 24, 2020 at 11:15:40PM +0200, Peter Zijlstra wrote: > On Wed, Jun 24, 2020 at 01:31:38PM -0700, Sami Tolvanen wrote: > > This patch series adds support for building x86_64 and arm64 kernels > > with Clang's Link Time Optimization (LTO). > > > > In addition to performance, the primary m

Re: [PATCH 00/22] add support for Clang LTO

2020-06-24 Thread Peter Zijlstra
On Wed, Jun 24, 2020 at 01:31:38PM -0700, Sami Tolvanen wrote: > This patch series adds support for building x86_64 and arm64 kernels > with Clang's Link Time Optimization (LTO). > > In addition to performance, the primary motivation for LTO is to allow > Clang's Control-Flow Integrity (CFI) to be