Make opcodes configure depend on bfd configure

2021-11-12 Thread Alan Modra via Gcc-patches
The idea is for opcodes to be able to see whether bfd is compiled for 64-bit. A lot of --enable-targets=all libopcodes is wasted space if bfd can't load 64-bit target object files. * Makefile.def (configure-opcodes): Depend on configure-bfd. * Makefile.in: Regenerate. Applied to

[PATCH] tree-optimization/103204 - fix missed valueization in VN

2021-11-12 Thread Richard Biener via Gcc-patches
The following fixes a missed valueization when simplifying a MEM[&...] combination during valueization. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-11-12 Richard Biener PR tree-optimization/103204 * tree-ssa-sccvn.c (valueize_refs_1): Re-valueize the

Introduce finalize method to modref_summary

2021-11-12 Thread Jan Hubicka via Gcc-patches
Hi, this patch adds finalize method that is called once summary is computed before it is used by optimizers. It adds convenient place to compute various flags as one for DSE Richard asked for. Bootstrapped/regtested x86_64-linux, will commit it shortly. gcc/ChangeLog: * ipa-modref.c (mo

Re: [PATCH] vect: Add bias parameter for partial vectorization

2021-11-12 Thread Robin Dapp via Gcc-patches
Hi Kewen and Richard, the attached v3 addresses the comments to v2, among others: - Rename to load_store where appropriate. - Save the adjusted length as a separate control that is used instead of loop_len with a bias != 0 and added to the loop header. - Update the costs to reflect a bias. Bo

[PATCH] gcc: vxworks: fix providing stdint.h header

2021-11-12 Thread Rasmus Villemoes
Commit bbbc05957e (Arrange to preinclude yvals.h ahead of stdint on VxWorks 7) breaks the build of libstdc++ for our VxWorks 5 platform. In file included from .../gcc-build/powerpc-wrs-vxworks/libstdc++-v3/include/memory:72, from .../gcc-src/libstdc++-v3/include/precompiled/stdc+

Re: Basic kill analysis for modref

2021-11-12 Thread Richard Biener via Gcc-patches
On Thu, 11 Nov 2021, Jan Hubicka wrote: > Hi, > This patch enables optimization of stores that are killed by calls. > Modref summary is extended by array containing list of access ranges, relative > to function parameters, that are known to be killed by the function. > This array is collected duri

Re: Basic kill analysis for modref

2021-11-12 Thread Jan Hubicka via Gcc-patches
> > I wonder why we bother producing summaries for things that do not > bind locally? The summary->kills.length () has an upper bound? Because of local aliases. The size of the array is capped by param_max_modref_accesses which is 16. > > > + && summary->kills.length ()) > > + { > > +

Re: [vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2021-11-12 Thread Richard Biener via Gcc-patches
On Thu, 11 Nov 2021, Joel Hutton wrote: > Hi all, > > This refactor allows widening vect patterns (such as widen_plus/widen_minus) > to be represented as > either internal_fns or tree_codes and replaces the current > widen_plus/widen_minus with internal_fn versions. This refactor is split into

Re: [AArch64] Enable generation of FRINTNZ instructions

2021-11-12 Thread Richard Biener via Gcc-patches
On Thu, 11 Nov 2021, Andre Vieira (lists) wrote: > Hi, > > This patch introduces two IFN's FTRUNC32 and FTRUNC64, the corresponding > optabs and mappings. It also creates a backend pattern to implement them for > aarch64 and a match.pd pattern to idiom recognize these. > These IFN's (and optabs)

Re: Basic kill analysis for modref

2021-11-12 Thread Richard Biener via Gcc-patches
On Fri, 12 Nov 2021, Jan Hubicka wrote: > > > > I wonder why we bother producing summaries for things that do not > > bind locally? The summary->kills.length () has an upper bound? > > Because of local aliases. > The size of the array is capped by param_max_modref_accesses which is > 16. > > >

Re: [Patch] Fortran/openmp: Fix '!$omp end'

2021-11-12 Thread Tobias Burnus
On 11.11.21 19:01, Jakub Jelinek wrote: On Thu, Nov 11, 2021 at 06:11:23PM +0100, Tobias Burnus wrote: --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c ... + matchs ("end distribute parallel do simd", gfc_match_omp_end_nowait, ... + matcho ("end distribute parallel do", gfc_match_om

[Patch 9/9, GCC, Arm] Implement arm Function target attribute 'branch-protection'.

2021-11-12 Thread Tejas Belagod via Gcc-patches
Hi, This patch is part of the series of PACBTI-M patches posted earlier https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582773.html This change adds the target function attribute 'branch-protection'. The options that it can take are the same the command-line option 'mbranch-protection'.

[PATCH][PUSHED] Remove unused function.

2021-11-12 Thread Martin Liška
This one is last unused function we have, I'm going to push this as obvious. Martin, feel free to restore the function once it's used. Thanks, Martin PR tree-optimization/102497 gcc/ChangeLog: * gimple-predicate-analysis.cc (add_pred): Remove unused function: --- gcc/g

Re: Use modref summary to DSE calls to non-pure functions

2021-11-12 Thread Jan Hubicka via Gcc-patches
Hi, this is updated patch. It moves the summary walk checking if we can possibly suceed on dse to summary->finalize member function so it is done once per summary and refactors dse_optimize_call to be called from dse_optimize_stmt after early checks. I did not try to handle the special case of pa

RE: [vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2021-11-12 Thread Joel Hutton via Gcc-patches
> please use #define INCLUDE_MAP before the system.h include instead. > Is it really necessary to build a new std::map for each optab lookup?! > That looks quite ugly and inefficient. We'd usually - if necessary at all - > build > a auto_vec > and .sort () and .bsearch () it. Ok, I'll rework this

[committed] openmp, v2: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 11, 2021 at 08:03:13PM +0100, Jakub Jelinek via Gcc-patches wrote: > The following patch implements what I've been talking about earlier, > honor that for explicit num_teams clause we create at least the > lower-bound (if not specified, upper-bound) teams in the league. > For host fallb

Re: [AArch64] Enable generation of FRINTNZ instructions

2021-11-12 Thread Andre Simoes Dias Vieira via Gcc-patches
On 12/11/2021 10:56, Richard Biener wrote: On Thu, 11 Nov 2021, Andre Vieira (lists) wrote: Hi, This patch introduces two IFN's FTRUNC32 and FTRUNC64, the corresponding optabs and mappings. It also creates a backend pattern to implement them for aarch64 and a match.pd pattern to idiom recogn

[wwwdocs] Document libstdc++ changes in gcc-12

2021-11-12 Thread Jonathan Wakely via Gcc-patches
Pushed to wwwdocs. --- htdocs/gcc-12/changes.html | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index 19947f90..5f12fb42 100644 --- a/htdocs/gcc-12/changes.html +++ b/htdocs/gcc-12/changes.html @@

Re: [Patch] Fortran/openmp: Fix '!$omp end'

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 12:01:27PM +0100, Tobias Burnus wrote: > With the attached patch, the following combined/composite > directives accept 'nowait' at 'end': I've filed https://github.com/OpenMP/spec/issues/3184 because I think OpenMP 5.2 got it wrong (and 5.1 got it wrong for the end directiv

[PATCH]AArch64 Optimize right shift rounding narrowing

2021-11-12 Thread Tamar Christina via Gcc-patches
Hi All, This optimizes right shift rounding narrow instructions to rounding add narrow high where one vector is 0 when the shift amount is half that of the original input type. i.e. uint32x4_t foo (uint64x2_t a, uint64x2_t b) { return vrshrn_high_n_u64 (vrshrn_n_u64 (a, 32), b, 32); } now gen

[committed] fortran: Ignore unused arguments for scalarisation [PR97896]

2021-11-12 Thread Mikael Morin
Committed as r12-5192. The KIND argument of the INDEX intrinsic is a compile time constant that is used at compile time only to resolve to a kind-specific library function. That argument is otherwise completely ignored at runtime, and there is no code generated for it as the library procedure ha

[committed] libstdc++: Print assertion messages to stderr [PR59675]

2021-11-12 Thread Jonathan Wakely via Gcc-patches
This replaces the printf used by failed debug assertions with fprintf, so we can write to stderr. To avoid including the assert function is moved into the library. To avoid programs using a vague linkage definition of the old inline function, the function is renamed. Code compiled with old versio

Re: Use modref summary to DSE calls to non-pure functions

2021-11-12 Thread Richard Biener via Gcc-patches
On Fri, Nov 12, 2021 at 12:39 PM Jan Hubicka wrote: > > Hi, > this is updated patch. It moves the summary walk checking if we can > possibly suceed on dse to summary->finalize member function so it is done > once per summary and refactors dse_optimize_call to be called from > dse_optimize_stmt af

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-11-12 Thread Robin Dapp via Gcc-patches
Hi Richard, > It's hard to judge this in isolation because it's not clear when > and how the new arguments are going to be used, but it seems OK > in principle. Do you still want: > > /* If earliest == jump, try to build the cmove insn directly. > This is helpful when combine has created

Fix ipa-modref pure/const discovery

2021-11-12 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes bug I introduced while breaking up the bigger change. We currently can not use pure/const to discover looping pures&const since lack of global memory writes/stores does not imply we can CSE on the function. THis is witnessed by testsuite doing volatile asm or also can happen i

Re: [PATCH 1v2/3][vect] Add main vectorized loop unrolling

2021-11-12 Thread Richard Biener via Gcc-patches
On Thu, 11 Nov 2021, Andre Vieira (lists) wrote: > Hi, > > This is the rebased and reworked version of the unroll patch.  I wasn't > entirely sure whether I should compare the costs of the unrolled loop_vinfo > with the original loop_vinfo it was unrolled of. I did now, but I wasn't too > sure wh

[PATCH] libgomp, nvptx: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
Hi! Here is an completely untested attempt at implementing what I was talking about, that for num_teams_upper 0 or whenever num_teams_lower <= num_blocks, the current implementation is fine but if the user explicitly asks for more teams than we can provide in hardware, we need to stop assuming tha

[PATCH] libgomp, nvptx, v2: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 02:20:23PM +0100, Jakub Jelinek via Gcc-patches wrote: > This patch assumes that .shared variables are initialized to 0, > https://docs.nvidia.com/cuda/parallel-thread-execution/index.html lists > in Table 7. .shared as non-initializable. If that isn't the case, > we need t

[committed] jit: fix -Werror=format-overflow= in testsuite [PR103199]

2021-11-12 Thread David Malcolm via Gcc-patches
Successfully regression-tested on x86_64-pc-linux-gnu, improves jit.sum: FAIL: 2->0 (-2) PASS: 12043->12073 (+30) Pushed to trunk as r12-5196-gaa1fd30df56d752e3d5a81af409875a1f1e3e327. gcc/jit/ChangeLog: PR jit/103199 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile

[PATCH] tree-optimization/102880 - improve CD-DCE

2021-11-12 Thread Richard Biener via Gcc-patches
The PR shows a missed control-dependent DCE caused by CFG cleanup merging a forwarder resulting in a partially degenerate PHI node. With control-dependent DCE we need to mark control dependences of incoming edges into PHIs as necessary but that is unnecessarily conservative for the case when two ed

Re: [PATCH] libbacktrace: fix UBSAN issues

2021-11-12 Thread Martin Liška
On 11/11/21 20:21, Ian Lance Taylor wrote: On Thu, Nov 11, 2021 at 7:39 AM Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin Fix issues mentioned in the PR. PR libbacktrace/103167 libbacktrace/ChangeLog

[PATCH][pushed] testsuite: Filter out TSVC test on Power [PR103051]

2021-11-12 Thread Martin Liška
Pushed to master. Martin PR testsuite/103051 gcc/testsuite/ChangeLog: * gcc.dg/vect/tsvc/vect-tsvc-s112.c: Skip test for old Power CPUs. --- gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s112.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuit

Re: [PATCH] Remove dead code.

2021-11-12 Thread Martin Liška
On 11/8/21 15:19, Jeff Law wrote: On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote: This fixes issue reported in the PR. Ready to be installed? I'm not sure.  liboffloadmic is copied from upstream, so the right thing if

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liška
On 11/11/21 18:52, Segher Boessenkool wrote: Hi! On Thu, Nov 04, 2021 at 01:36:06PM +0100, Martin Liška wrote: Sending the patch in a separate thread. Hello. You forgot to send the commit message though? No, the patch is simple so I didn't write any message (except commit title).

[PATCH][V3] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liska
gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_override_options_after_change): Do not set flag_rename_registers, it's already enabled with EnabledBy(funroll-loops). Use EnabledBy for unroll_only_small_loops. * config/rs6000/rs6000.opt: Use EnabledBy for unroll_onl

[PATCH] Fortran: Use build_debug_expr_decl to create DEBUG_DECL_EXPRs

2021-11-12 Thread Martin Jambor
Hi, This patch converts one more open coded construction of a DEBUG_EXPR_DECL to a call of build_debug_expr_decl that I missed in my previous patch because it happens to be in the Fortran front-end. Bootstrapped and tested on x86_64-linux. Since this should have been done by an earlier approved

Re: [PATCH] Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.

2021-11-12 Thread Martin Liška
@Alexandre: PING On 10/18/21 12:05, Richard Biener wrote: On Mon, Oct 18, 2021 at 10:54 AM Martin Liška wrote: The macros correspond 1:1 to an option flags and make it harder to find all usages of the flags. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be

[PATCH] Replace more DEBUG_EXPR_DECL creations with build_debug_expr_decl

2021-11-12 Thread Martin Jambor
Hi, On Tue, Nov 09 2021, Richard Biener wrote: > On Mon, 8 Nov 2021, Martin Jambor wrote: >> this patch introduces a helper function build_debug_expr_decl to build >> DEBUG_EXPR_DECL tree nodes in the most common way and replaces with a >> call of this function all code pieces which build such a D

Re: [PATCH] Remove dead code.

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: > > On 11/8/21 15:19, Jeff Law wrote: > > > > > > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: > >> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote: > >>> This fixes issue reported in the PR. > >>> > >>> Ready to be ins

Re: [PATCH] Remove dead code.

2021-11-12 Thread Martin Liška
On 11/12/21 15:41, H.J. Lu wrote: On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: On 11/8/21 15:19, Jeff Law wrote: On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote: This fixes issue reported in the PR. Ready to b

Re: [PATCH] Remove dead code.

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 6:44 AM Martin Liška wrote: > > On 11/12/21 15:41, H.J. Lu wrote: > > On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: > >> > >> On 11/8/21 15:19, Jeff Law wrote: > >>> > >>> > >>> On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: > On Mon, Nov 08, 2021 at

[PATCH][GCC] arm: Add support for dwarf debug directives and pseudo hard-register for PAC feature.

2021-11-12 Thread Srinath Parvathaneni via Gcc-patches
Hello, This patch teaches the DWARF support in gcc about RA_AUTH_CODE pseudo hard-register and also .save {ra_auth_code} and .cfi_offset ra_auth_code dwarf directives for the PAC feature in Armv8.1-M architecture. RA_AUTH_CODE register number is 107 and it's dwarf register number is 143. Whe

[committed] libgomp: Unbreak gcn offload build

2021-11-12 Thread Jakub Jelinek via Gcc-patches
Hi! My recent libgomp change apparently broke libgomp build for gcn offloading. The problem is that gcn, unlike nvptx, doesn't override teams.c source file and the patch I've committed assumed all the non-LIBGOMP_USE_PTHREADS targets do not use it. My understanding is that gcn included omp_get_nu

[PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread H.J. Lu via Gcc-patches
Check optab before transforming equivalent, but slighly different cases to their canonical forms in optimize_atomic_bit_test_and and require TARGET_HIMODE_MATH in HImode atomic bit expanders. gcc/ PR target/103205 * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Check optab

Re: [PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 07:29:03AM -0800, H.J. Lu wrote: > Check optab before transforming equivalent, but slighly different cases > to their canonical forms in optimize_atomic_bit_test_and and require > TARGET_HIMODE_MATH in HImode atomic bit expanders. > > gcc/ > > PR target/103205 >

Fix ICE in tree-ssa-structalias

2021-11-12 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes ICE in sanity check of EAF flags determined: we can not escape/clobber/return param indirectly w/o reading it. I moved check earlier and fixed the wrong updates. Boottrapped/regtested x86_64-linux, comitted. Honza PR tree-optimization/103175 * ipa-modref.c (m

[PATCH] options: Make -Ofast switch off -fsemantic-interposition

2021-11-12 Thread Martin Jambor
Hi, using -fno-semantic-interposition has been reported by various people to bring about considerable speed up at the cost of strict compliance to the ELF symbol interposition rules See for example https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup As such I believe it s

Re: [PATCH] options: Make -Ofast switch off -fsemantic-interposition

2021-11-12 Thread Jan Hubicka via Gcc-patches
> Hi, > > using -fno-semantic-interposition has been reported by various people > to bring about considerable speed up at the cost of strict compliance > to the ELF symbol interposition rules See for example > https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup > > As suc

Re: [PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 7:34 AM Jakub Jelinek wrote: > > On Fri, Nov 12, 2021 at 07:29:03AM -0800, H.J. Lu wrote: > > Check optab before transforming equivalent, but slighly different cases > > to their canonical forms in optimize_atomic_bit_test_and and require > > TARGET_HIMODE_MATH in HImode at

Re: [Patch] Fortran/openmp: Fix '!$omp end'

2021-11-12 Thread Tobias Burnus
On 12.11.21 13:02, Jakub Jelinek wrote: 3) anything combined with target allows it ... and puts it on 'target' as it shouldn't be on 'for' or 'do' in 'target ... parallel do/for ...', I'd guess. Updated patch attach. Tobias - Siemens Electronic Design Automation GmbH; Anschrif

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Segher Boessenkool
On Fri, Nov 12, 2021 at 03:34:17PM +0100, Martin Liška wrote: > On 11/11/21 18:52, Segher Boessenkool wrote: > >You forgot to send the commit message though? > > No, the patch is simple so I didn't write any message (except commit title). How is a maintainer supposed to know what the patch is abo

Re: [Patch] Fortran/openmp: Fix '!$omp end'

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 04:56:37PM +0100, Tobias Burnus wrote: > Fortran/openmp: Fix '!$omp end' > > gcc/fortran/ChangeLog: > > * parse.c (decode_omp_directive): Fix permitting 'nowait' for some > combined directives, add missing 'omp end ... loop'. > (gfc_ascii_statement): Fix

[PATCH][V4] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liska
Do not set flag_rename_registers, it's already enabled with EnabledBy(funroll-loops) in the common.opt file. Use EnabledBy for unroll_only_small_loops which is a canonical approach how can be make option dependencies. gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_override_options_after

Re: [PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 07:55:26AM -0800, H.J. Lu wrote: > > I have following patch queued for testing for this... > > > > 2021-11-12 Jakub Jelinek > > > > PR target/103205 > > * config/i386/sync.md (atomic_bit_test_and_set, > > atomic_bit_test_and_complement, > >

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liška
On 11/12/21 16:58, Segher Boessenkool wrote: On Fri, Nov 12, 2021 at 03:34:17PM +0100, Martin Liška wrote: On 11/11/21 18:52, Segher Boessenkool wrote: You forgot to send the commit message though? No, the patch is simple so I didn't write any message (except commit title). How is a maintai

Re: [PATCH] gcc: vxworks: fix providing stdint.h header

2021-11-12 Thread Olivier Hainque via Gcc-patches
Hi Rasmus, We have had to use for stdbool a similar trick as we had for stdint (need to preinclude yyvals.h), which we will need to propagate somehow. I'm not yet sure how to reconcile that with your observations. Olivier > On 12 Nov 2021, at 11:15, Rasmus Villemoes wrote: > > Commit bbbc05957

Re: [PATCH 1/3] gimple-fold: Transform stp*cpy_chk to str*cpy directly

2021-11-12 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 12 Nov 2021 at 01:12, Siddhesh Poyarekar wrote: > > Avoid going through another folding cycle and use the ignore flag to > directly transform BUILT_IN_STPCPY_CHK to BUILT_IN_STRCPY when set, > likewise for BUILT_IN_STPNCPY_CHK to BUILT_IN_STPNCPY. > > Dump the transformation in dump_file s

[committed] aarch64: Detect more consecutive MEMs

2021-11-12 Thread Richard Sandiford via Gcc-patches
For tests like: int res[2]; void f1 (int x, int y) { res[0] = res[1] = x + y; } we generated: add w0, w0, w1 adrpx1, .LANCHOR0 add x2, x1, :lo12:.LANCHOR0 str w0, [x1, #:lo12:.LANCHOR0] str w0, [x2, 4]

[committed] aarch64: Fold aarch64_sve_op_count into aarch64_vec_op_count

2021-11-12 Thread Richard Sandiford via Gcc-patches
Later patches make aarch64 use the new vector hooks. We then only need to track one set of ops for each aarch64_vector_costs structure. This in turn means that it's more convenient to merge aarch64_sve_op_count and aarch64_vec_op_count. The patch also adds issue info and vec flags to aarch64_vec

[committed] aarch64: Remove vectype from latency tests

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch gets the scalar mode of a reduction operation from the gimple stmt rather than the vectype. This makes it more suitable for use in scalar costs. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_sve_in_loop_reduction_latency): Re

[committed] aarch64: Get floatness from stmt_info

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch gets the floatness of a memory access from the data reference rather than the vectype. This makes it more suitable for use in scalar costing code. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_dr_type): New function. (aarch64

[committed] aarch64: Use real scalar op counts

2021-11-12 Thread Richard Sandiford via Gcc-patches
Now that vector finish_costs is passed the associated scalar costs, we can record the scalar issue information while computing the scalar costs, rather than trying to estimate it while computing the vector costs. This simplifies things a little, but the main motivation is to improve accuracy. Tes

[committed] aarch64: Use an array of aarch64_vec_op_counts

2021-11-12 Thread Richard Sandiford via Gcc-patches
-mtune=neoverse-512tvb uses two issue rates, one for Neoverse V1 and one with more generic parameters. We use both rates when making a choice between scalar, Advanced SIMD and SVE code. Previously we calculated the Neoverse V1 issue rates from the more generic issue rates, but by removing m_scala

[committed] aarch64: Move cycle estimation into aarch64_vec_op_count

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch just moves the main cycle estimation routines into aarch64_vec_op_count. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_vec_op_count::rename_cycles_per_iter): New function. (aarch64_vec_op_count::min_nonpred_cycles_per_

[PATCH] PR fortran/102368 - Failure to compile program using the C_SIZEOF function in ISO_C_BINDING

2021-11-12 Thread Harald Anlauf via Gcc-patches
Dear Fortranners, F2008:15.3.5 relaxed the condition on interoperable character variables and now allows values different from one. Similar text in F2018:18.3.4. This required an adjustment in the interoperability check. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From 1

[committed] aarch64: Add vf_factor to aarch64_vec_op_count

2021-11-12 Thread Richard Sandiford via Gcc-patches
-mtune=neoverse-512tvb sets the likely SVE vector length to 128 bits, but it also takes into account Neoverse V1, which is a 256-bit target. This patch adds this VF (VL) factor to aarch64_vec_op_count. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch

[committed] aarch64: Use new hooks for vector comparisons

2021-11-12 Thread Richard Sandiford via Gcc-patches
Previously we tried to account for the different issue rates of the various vector modes by guessing what the Advanced SIMD version of an SVE loop would look like and what its issue rate was likely to be. We'd then increase the cost of the SVE loop if the Advanced SIMD loop might issue more quickly

[committed] aarch64: Remove redundant costing code

2021-11-12 Thread Richard Sandiford via Gcc-patches
Previous patches made some of the complex parts of the issue rate code redundant. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_vector_op::n_advsimd_ops): Delete. (aarch64_vector_op::m_seen_loads): Likewise. (aarch64_vector_costs

[PATCH] vect: Pass mode to gather/scatter tests

2021-11-12 Thread Richard Sandiford via Gcc-patches
vect_check_gather_scatter had a binary “does this target support internal gather/scatter functions” test. This dates from the time when we only handled gathers and scatters via direct target support, with x86_64 using built-in functions and aarch64 using IFNs. But now that we can emulate gathers,

[PATCH] vect: Fix vect_is_reduction

2021-11-12 Thread Richard Sandiford via Gcc-patches
The current definition of vect_is_reduction (provided for target costing) misses some pattern statements. Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard gcc/ * tree-vectorizer.h (vect_is_reduction): Use STMT_VINFO_REDUC_IDX. gcc/testsuite/ * gcc.

[PATCH] vect: Fix SVE mask_gather_load/store_store tests

2021-11-12 Thread Richard Sandiford via Gcc-patches
If-conversion now applies rewrite_to_defined_overflow to the address calculation in an IFN_MASK_LOAD. This means that we end up with: cast_base = (uintptr_t) base; uncast_sum = cast_base + offset; sum = (orig_type *) uncast_sum; If the target supports IFN_MASK_GATHER_LOAD with pointe

[PATCH 1/5] vect: Use code_helper when building SLP nodes

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch uses code_helper to represent the common (and alternative) operations when building an SLP node. It's not much of a saving on its own, but it helps with later patches. Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard gcc/ * tree-vect-slp.c (vect

[PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 02:27:16PM +0100, Jakub Jelinek via Gcc-patches wrote: > On Fri, Nov 12, 2021 at 02:20:23PM +0100, Jakub Jelinek via Gcc-patches wrote: > > This patch assumes that .shared variables are initialized to 0, > > https://docs.nvidia.com/cuda/parallel-thread-execution/index.html l

[PATCH 2/5] vect: Use generalised accessors to build SLP nodes

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch adds: - gimple_num_args - gimple_arg - gimple_arg_ptr for accessing rhs operands of an assignment, call or PHI. This is similar to the existing gimple_get_lhs. I guess there's a danger that these routines could be overused, such as in cases where gimple_assign_rhs1 etc. would be more

[PATCH 3/5] vect: Support gather loads with SLP

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch adds SLP support for IFN_GATHER_LOAD. Like the SLP support for IFN_MASK_LOAD, it works by treating only some of the arguments as child nodes. Unlike IFN_MASK_LOAD, it requires the other arguments (base, scale, and extension type) to be the same for all calls in the group. It does not

[PATCH v2][GCC] arm: Add support for dwarf debug directives and pseudo hard-register for PAC feature.

2021-11-12 Thread Srinath Parvathaneni via Gcc-patches
Hello, This patch teaches the DWARF support in gcc about RA_AUTH_CODE pseudo hard-register and also .save {ra_auth_code} and .cfi_offset ra_auth_code dwarf directives for the PAC feature in Armv8.1-M architecture. RA_AUTH_CODE register number is 107 and it's dwarf register number is 143. Whe

[PATCH 4/5] if-conv: Apply VN to hoisted conversions

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch is a prerequisite for a later one. At the moment, if-conversion converts predicated POINTER_PLUS_EXPRs into non-wrapping forms, which for: … = base + offset becomes: tmp = (unsigned long) base … = tmp + offset It then hoists these conversions out of the loop where possib

[PATCH 5/5] vect: Support masked gather loads with SLP

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch extends the previous SLP gather load support so that it can handle masked loads too. Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard gcc/ * tree-vect-slp.c (arg1_arg4_map): New variable. (vect_get_operand_map): Handle IFN_MASK_GATHER_LOA

[PATCH v2] Check optab before transforming atomic bit test and operations

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 8:13 AM Jakub Jelinek wrote: > > On Fri, Nov 12, 2021 at 07:55:26AM -0800, H.J. Lu wrote: > > > I have following patch queued for testing for this... > > > > > > 2021-11-12 Jakub Jelinek > > > > > > PR target/103205 > > > * config/i386/sync.md (atomic_bit

[r12-5194 Regression] FAIL: c-c++-common/goacc/firstprivate-mappings-1.c scan-tree-dump omplower "(?n)#pragma omp target oacc_parallel firstprivate\\(array_li.[0-9]+\\) map\\(from:array_so \\[len: 4\\

2021-11-12 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, b7e20480630e3eeb9eed8b3941da3b3f0c22c969 is the first bad commit commit b7e20480630e3eeb9eed8b3941da3b3f0c22c969 Author: Chung-Lin Tang Date: Fri Nov 12 20:29:00 2021 +0800 openmp: Relax handling of implicit map vs. existing device mappings caused FAIL: c-c++-common/goac

Re: [PATCH] vect: Pass mode to gather/scatter tests

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:53:04 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >vect_check_gather_scatter had a binary “does this target support >internal gather/scatter functions” test. This dates from the time when >we only handled gathers and scatters via direct target support, with >x86

[committed] analyzer: "__analyzer_dump_state" has no side-effects

2021-11-12 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as 72f1c1c452198ba1df6f70959180b201cedc506e. gcc/analyzer/ChangeLog: * engine.cc (exploded_node::on_stmt_pre): Return when handling "__analyzer_dump_state". Signed-off-by: David Malcolm --- gcc/analyz

Re: [PATCH] vect: Fix vect_is_reduction

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:54:29 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >The current definition of vect_is_reduction (provided for target >costing) misses some pattern statements. > >Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? This now will return true for

Re: [PATCH] vect: Fix SVE mask_gather_load/store_store tests

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:55:47 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >If-conversion now applies rewrite_to_defined_overflow to the >address calculation in an IFN_MASK_LOAD. This means that we >end up with: > >cast_base = (uintptr_t) base; >uncast_sum = cast_base + offset;

Re: [PATCH 1/5] vect: Use code_helper when building SLP nodes

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:57:29 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >This patch uses code_helper to represent the common (and >alternative) operations when building an SLP node. It's not >much of a saving on its own, but it helps with later patches. > >Regstrapped on aarch64-linu

Re: [PATCH 2/5] vect: Use generalised accessors to build SLP nodes

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:59:22 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >This patch adds: > >- gimple_num_args >- gimple_arg >- gimple_arg_ptr > >for accessing rhs operands of an assignment, call or PHI. This is >similar to the existing gimple_get_lhs. > >I guess there's a danger tha

Re: [PATCH] Remove dead code.

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" wrote: >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: >> >> On 11/8/21 15:19, Jeff Law wrote: >> > >> > >> > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: >> >> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Marti

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Alexander Monakov via Gcc-patches
Hello Jakub, On Fri, 12 Nov 2021, Jakub Jelinek via Gcc-patches wrote: > On Fri, Nov 12, 2021 at 02:27:16PM +0100, Jakub Jelinek via Gcc-patches wrote: > > On Fri, Nov 12, 2021 at 02:20:23PM +0100, Jakub Jelinek via Gcc-patches > > wrote: > > > This patch assumes that .shared variables are initi

Re: [PATCH] Replace more DEBUG_EXPR_DECL creations with build_debug_expr_decl

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 3:39:56 PM GMT+01:00, Martin Jambor wrote: >Hi, > >On Tue, Nov 09 2021, Richard Biener wrote: >> On Mon, 8 Nov 2021, Martin Jambor wrote: >>> this patch introduces a helper function build_debug_expr_decl to build >>> DEBUG_EXPR_DECL tree nodes in the most common way and repla

Re: Enable pure/const discovery in modref

2021-11-12 Thread Jan Hubicka via Gcc-patches
> Hi Honza, > > On Thu, 11 Nov 2021 17:39:18 +0100 > Jan Hubicka via Gcc-patches wrote: > > > diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c > > index 422b52fba4b..550bdeded16 100644 > > --- a/gcc/ipa-pure-const.c > > +++ b/gcc/ipa-pure-const.c > > @@ -1513,6 +1611,9 @@ propagate_pure_

Re: [PATCH] Remove dead code.

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 11:15 AM Richard Biener wrote: > > On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" > wrote: > >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: > >> > >> On 11/8/21 15:19, Jeff Law wrote: > >> > > >> > > >> > On 11/8/2021 2:59 AM, Jakub Jelinek vi

[wwwdocs][PATCH] Document deprecation of OpenMP MIC offloading in GCC 12

2021-11-12 Thread H.J. Lu via Gcc-patches
--- htdocs/gcc-12/changes.html | 4 1 file changed, 4 insertions(+) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index 5f12fb42..c133786d 100644 --- a/htdocs/gcc-12/changes.html +++ b/htdocs/gcc-12/changes.html @@ -49,6 +49,10 @@ a work-in-progress. which still s

[COMMITTED] path solver: Solve PHI imports first for ranges.

2021-11-12 Thread Aldy Hernandez via Gcc-patches
PHIs must be resolved first while solving ranges in a block, regardless of where they appear in the import bitmap. We went through a similar exercise for the relational code, but missed these. Tested on x86-64 & ppc64le Linux. gcc/ChangeLog: PR tree-optimization/103202 * gimple-

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 10:16:11PM +0300, Alexander Monakov wrote: > I suspect there may be a misunderstanding here, or maybe your explanation is > incomplete. I don't think the intention of the standard was to force such > complexity. You can launch as many blocks on the GPU as you like, limited o

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 08:47:09PM +0100, Jakub Jelinek wrote: > The problem is that the argument of the num_teams clause isn't always known > before target is launched. There was a design mistake that the clause has been put on teams rather than on target (well, for host teams we need it on teams

PING: [PATCH] rs6000: MMA test case emits wrong code when building a vector pair

2021-11-12 Thread Peter Bergner via Gcc-patches
I'd like to ping the following patch. Peter On 10/27/21 8:37 PM, Peter Bergner via Gcc-patches wrote: > PR102976 shows a test case where we generate wrong code when building > a vector pair from 2 vector registers. The bug here is that with unlucky > register assignments, we can clobber one of

Re: [COMMITTED] path solver: Solve PHI imports first for ranges.

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 8:46:25 PM GMT+01:00, Aldy Hernandez via Gcc-patches wrote: >PHIs must be resolved first while solving ranges in a block, >regardless of where they appear in the import bitmap. We went through >a similar exercise for the relational code, but missed these. Must not all stmts

Re: [PATCH] Remove dead code.

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 8:18:59 PM GMT+01:00, "H.J. Lu" wrote: >On Fri, Nov 12, 2021 at 11:15 AM Richard Biener > wrote: >> >> On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" >> wrote: >> >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: >> >> >> >> On 11/8/21 15:19, Jeff

Re: [wwwdocs][PATCH] Document deprecation of OpenMP MIC offloading in GCC 12

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 8:26:40 PM GMT+01:00, "H.J. Lu via Gcc-patches" wrote: >--- > htdocs/gcc-12/changes.html | 4 > 1 file changed, 4 insertions(+) Ok. Thanks, Richard. >diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html >index 5f12fb42..c133786d 100644 >--- a/htdocs/

Re: [COMMITTED] path solver: Solve PHI imports first for ranges.

2021-11-12 Thread Aldy Hernandez via Gcc-patches
On Fri, Nov 12, 2021, 20:50 Richard Biener wrote: > On November 12, 2021 8:46:25 PM GMT+01:00, Aldy Hernandez via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > >PHIs must be resolved first while solving ranges in a block, > >regardless of where they appear in the import bitmap. We went throu

  1   2   >