Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-07 Thread Segher Boessenkool
On Tue, Feb 04, 2020 at 12:06:54PM +, Richard Sandiford wrote: > > Also, you don't need to emit "#" in output template. This is just for > > extra safety, we can live without. Please see e.g. "*tzcnt_1". > > IMO it's better to keep it here, where we're relying on the split > happening for corr

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-05 Thread Jakub Jelinek
On Wed, Feb 05, 2020 at 12:11:15PM +0100, Uros Bizjak wrote: > > I think the primary question is, do we for -O0 need to enable split2 (as in, > > will anything in pro_and_epilogue or jump2 passes benefit from the > > splitting and worth running two -O0 post-RA split passes), then we could go > > wi

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-05 Thread Uros Bizjak
On Wed, Feb 5, 2020 at 12:03 PM Jakub Jelinek wrote: > > On Wed, Feb 05, 2020 at 11:46:51AM +0100, Uros Bizjak wrote: > > I think we should just enable split4 also for -O0. This would also > > allow us to remove the "optimize > 0" check above and allow us to > > generate a bit more optimal code ev

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-05 Thread Jakub Jelinek
On Wed, Feb 05, 2020 at 11:46:51AM +0100, Uros Bizjak wrote: > I think we should just enable split4 also for -O0. This would also > allow us to remove the "optimize > 0" check above and allow us to > generate a bit more optimal code even with -O0 for > TARGET_SSE_PARTIAL_REG_DEPENDENCY and TARGET_A

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-05 Thread Uros Bizjak
On Wed, Feb 5, 2020 at 11:05 AM Jakub Jelinek wrote: > > On Tue, Feb 04, 2020 at 02:15:04PM +0100, Uros Bizjak wrote: > > On Tue, Feb 4, 2020 at 2:13 PM Jakub Jelinek wrote: > > > > > > On Tue, Feb 04, 2020 at 01:38:51PM +0100, Uros Bizjak wrote: > > > > As Richard advised, let's put this safety

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-05 Thread Jakub Jelinek
On Wed, Feb 05, 2020 at 10:58:04AM +0100, Jakub Jelinek wrote: > Attached are 3 possible incremental patches for recog.c, all of them fix > all the above regressions, but haven't fully bootstrapped/regtested any of > them yet. My preference would be the last one, which for -O0 and x86 > disables s

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-05 Thread Jakub Jelinek
On Tue, Feb 04, 2020 at 02:15:04PM +0100, Uros Bizjak wrote: > On Tue, Feb 4, 2020 at 2:13 PM Jakub Jelinek wrote: > > > > On Tue, Feb 04, 2020 at 01:38:51PM +0100, Uros Bizjak wrote: > > > As Richard advised, let's put this safety stuff back. Usually, in > > > i386.md, these kind of splitters are

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Uros Bizjak
On Tue, Feb 4, 2020 at 2:13 PM Jakub Jelinek wrote: > > On Tue, Feb 04, 2020 at 01:38:51PM +0100, Uros Bizjak wrote: > > As Richard advised, let's put this safety stuff back. Usually, in > > i386.md, these kind of splitters are implemented as two patterns, one > > (define_insn_and_split) having "#

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Jakub Jelinek
On Tue, Feb 04, 2020 at 01:38:51PM +0100, Uros Bizjak wrote: > As Richard advised, let's put this safety stuff back. Usually, in > i386.md, these kind of splitters are implemented as two patterns, one > (define_insn_and_split) having "#", and the other (define_insn) with a > real insn. My opinion i

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Uros Bizjak
On Tue, Feb 4, 2020 at 1:30 PM Jakub Jelinek wrote: > > On Tue, Feb 04, 2020 at 12:24:10PM +0100, Uros Bizjak wrote: > > > A && is missing in the split condition to inherit TARGET_AVX. > > > > Also, you don't need to emit "#" in output template. This is just for > > extra safety, we can live witho

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Jakub Jelinek
On Tue, Feb 04, 2020 at 12:24:10PM +0100, Uros Bizjak wrote: > > A && is missing in the split condition to inherit TARGET_AVX. > > Also, you don't need to emit "#" in output template. This is just for > extra safety, we can live without. Please see e.g. "*tzcnt_1". I was worried that -fipa-ra the

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Uros Bizjak
On Tue, Feb 4, 2020 at 1:06 PM Richard Sandiford wrote: > > Uros Bizjak writes: > > On Tue, Feb 4, 2020 at 12:13 PM Uros Bizjak wrote: > >> > >> On Tue, Feb 4, 2020 at 12:05 PM Jakub Jelinek wrote: > >> > > >> > On Tue, Feb 04, 2020 at 11:16:06AM +0100, Uros Bizjak wrote: > >> > > If it works O

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Richard Sandiford
Uros Bizjak writes: > On Tue, Feb 4, 2020 at 12:13 PM Uros Bizjak wrote: >> >> On Tue, Feb 4, 2020 at 12:05 PM Jakub Jelinek wrote: >> > >> > On Tue, Feb 04, 2020 at 11:16:06AM +0100, Uros Bizjak wrote: >> > > If it works OK, I'd rather see this functionality implemented as an >> > > epilogue_co

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Uros Bizjak
On Tue, Feb 4, 2020 at 12:13 PM Uros Bizjak wrote: > > On Tue, Feb 4, 2020 at 12:05 PM Jakub Jelinek wrote: > > > > On Tue, Feb 04, 2020 at 11:16:06AM +0100, Uros Bizjak wrote: > > > If it works OK, I'd rather see this functionality implemented as an > > > epilogue_completed guarded splitter. In

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Uros Bizjak
On Tue, Feb 4, 2020 at 12:05 PM Jakub Jelinek wrote: > > On Tue, Feb 04, 2020 at 11:16:06AM +0100, Uros Bizjak wrote: > > If it works OK, I'd rather see this functionality implemented as an > > epilogue_completed guarded splitter. In the .md files, there are > > already cases where we split at thi

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Jakub Jelinek
On Tue, Feb 04, 2020 at 11:16:06AM +0100, Uros Bizjak wrote: > If it works OK, I'd rather see this functionality implemented as an > epilogue_completed guarded splitter. In the .md files, there are > already cases where we split at this point, and where it is assumed > that allocated registers won'

Re: [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Uros Bizjak
On Tue, Feb 4, 2020 at 10:39 AM Jakub Jelinek wrote: > > Hi! > > As mentioned in the PR, the CLOBBERs in vzeroupper are added there even for > registers that aren't ever live in the function before and break the > prologue/epilogue expansion with ms ABI (normal ABIs are fine, as they > consider al

[PATCH] i386: Omit clobbers from vzeroupper until final [PR92190]

2020-02-04 Thread Jakub Jelinek
Hi! As mentioned in the PR, the CLOBBERs in vzeroupper are added there even for registers that aren't ever live in the function before and break the prologue/epilogue expansion with ms ABI (normal ABIs are fine, as they consider all [xyz]mm registers call clobbered, but the ms ABI considers xmm0-1