Re: Re: [PATCH v2 1/1] [RISC-V] Add support for _Bfloat16

2024-05-04 Thread Xiao Zeng
2024-05-04 23:23  Jeff Law wrote: >   > > >On 4/2/24 3:22 AM, Xiao Zeng wrote: >> 1 At point , >>    BF16 has already been completed "post public review". >> >> 2 LLVM has also added support for RISCV BF16 in >> and >>

[RFA][RISC-V] Use "uw" forms for constant synthesis

2024-05-04 Thread Jeff Law
So another constant synthesis improvement. In this patch we're looking at cases where we'd like to be able to use lui+slli, but can't because of the sign extending nature of lui on TARGET_64BIT. For example: 0x800110020UL. The trunk currently generates 4 instructions for that constant,

[PATCH v3] DCE __cxa_atexit calls where the function is pure/const [PR19661]

2024-05-04 Thread Andrew Pinski
In C++ sometimes you have a deconstructor function which is "empty", like for an example with unions or with arrays. The front-end might not know it is empty either so this should be done on during optimization.o To implement it I added it to DCE where we mark if a statement is necessary or

[PATCH v2] DCE __cxa_atexit calls where the function is pure/const [PR19661]

2024-05-04 Thread Andrew Pinski
In C++ sometimes you have a deconstructor function which is "empty", like for an example with unions or with arrays. The front-end might not know it is empty either so this should be done on during optimization.o To implement it I added it to DCE where we mark if a statement is necessary or

[PATCH 09/12] OpenMP: Extend dynamic selector support to declare variant

2024-05-04 Thread Sandra Loosemore
This patch extends the mechanisms previously added to support dynamic selectors in metavariant constructs to also apply to "declare variant". The front-end mechanisms used to handle "declare variant" via attributes attached to the function decls remain the same, but the gimplifier now uses the

[PATCH 07/12] OpenMP: Fortran front-end support for metadirectives.

2024-05-04 Thread Sandra Loosemore
This patch adds support for metadirectives to the Fortran front end. gcc/fortran/ChangeLog * decl.cc (gfc_match_end): Handle metadirectives. * dump-parse-tree.cc (show_omp_node): Likewise. (show_code_node): Likewise. * gfortran.h (enum gfc_statement): Add

[PATCH 11/12] OpenMP: Update "declare target"/OpenMP context interaction

2024-05-04 Thread Sandra Loosemore
The code and test case previously implemented the OpenMP 5.0 spec, which said in section 2.3.1: "For functions within a declare target block, the target trait is added to the beginning of the set..." In OpenMP 5.1, this was changed to "For device routines, the target trait is added to the

[PATCH 10/12] OpenMP: Remove dead code from declare variant reimplementation

2024-05-04 Thread Sandra Loosemore
After reimplementing late resolution of "declare variant" to use the same mechanisms as metadirective, the declare_variant_alt and calls_declare_variant_alt flags on struct cgraph_node are no longer used by anything. For the purposes of marking functions that need late resolution, the

[PATCH 05/12] OpenMP: C++ front-end support for metadirectives

2024-05-04 Thread Sandra Loosemore
This patch adds C++ support for metadirectives. It uses the c-family support committed with the corresponding C front end patch to do early parse-time metadirective resolution when possible. Additional C/C++ common testcases are provided in a subsequent patch in the series. gcc/cp/ChangeLog

[PATCH 06/12] OpenMP: common c/c++ testcases for metadirectives

2024-05-04 Thread Sandra Loosemore
gcc/testsuite/ChangeLog * c-c++-common/gomp/metadirective-1.c: New. * c-c++-common/gomp/metadirective-2.c: New. * c-c++-common/gomp/metadirective-3.c: New. * c-c++-common/gomp/metadirective-4.c: New. * c-c++-common/gomp/metadirective-5.c: New. *

[PATCH 08/12] OpenMP: Reject other properties with kind(any)

2024-05-04 Thread Sandra Loosemore
The OpenMP spec says: "If trait-property any is specified in the kind trait-selector of the device selector set or the target_device selector sets, no other trait-property may be specified in the same selector set." GCC was not previously enforcing this restriction and several testcases included

[PATCH 04/12] OpenMP: C front end support for metadirectives

2024-05-04 Thread Sandra Loosemore
This patch adds support to the C front end to parse OpenMP metadirective constructs. It includes support for early parse-time resolution of metadirectives (when possible) that will also be used by the C++ front end. Additional common C/C++ testcases are in a later patch in the series.

[PATCH 12/12] OpenMP: Update documentation of metadirective implementation status.

2024-05-04 Thread Sandra Loosemore
libgomp/ChangeLog * libgomp.texi (OpenMP 5.0): Mark metadirective and declare variant as implemented. (OpenMP 5.1): Mark target_device as supported. Add changed interaction between declare target and OpenMP context and dynamic selector support.

[PATCH 03/12] libgomp: runtime support for target_device selector

2024-05-04 Thread Sandra Loosemore
This patch implements the libgomp runtime support for the dynamic target_device selector via the GOMP_evaluate_target_device function. include/ChangeLog * cuda/cuda.h (CUdevice_attribute): Add definitions for CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR and

[PATCH 02/12] OpenMP: middle-end support for metadirectives

2024-05-04 Thread Sandra Loosemore
This patch adds middle-end support for OpenMP metadirectives. Some context selectors can be resolved during gimplification, but others need to be deferred until the omp_device_lower pass, which requires that cgraph, LTO streaming, inlining, etc all know about this construct as well.

[PATCH 01/12] OpenMP: metadirective tree data structures and front-end interfaces

2024-05-04 Thread Sandra Loosemore
This patch adds the OMP_METADIRECTIVE tree node and shared tree-level support for manipulating metadirectives. It defines/exposes interfaces that will be used in subsequent patches that add front-end and middle-end support, but nothing generates these nodes yet. This patch also adds compile-time

[PATCH 00/12] OpenMP: Metadirective support + "declare variant" improvements

2024-05-04 Thread Sandra Loosemore
This series of patches is a revised and extended version of the metadirective patches I previously posted in January: https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642005.html Those in turn were based on work by Kwok originally implemented on the devel/omp/gcc-11 branch in 2021 and

Fix gnu versioned namespace mode 02/03

2024-05-04 Thread François Dumont
    libstdc++: [_GLIBCXX_INLINE_VERSION] Use cxx11 abi [PR83077]     Use cxx11 abi when activating versioned namespace mode. To do so support a new     configuration mode where !_GLIBCXX_USE_DUAL_ABI and _GLIBCXX_USE_CXX11_ABI.     The main change is that std::__cow_string is now defined

Fix gnu versioned namespace mode 03/03

2024-05-04 Thread François Dumont
    libstdc++: Review configuration options to control abi     --disable-libstdcxx-dual-abi default to 'new' abi mode.     --with-default-libstdcxx-abi consider the requested abi mode regardless     of --disable-libstdcxx-dual-abi usage.     libstdc++-v3/ChangeLog     * acinclude.m4

Fix gnu versioned namespace mode 01/03

2024-05-04 Thread François Dumont
libstdc++: Bump gnu versioned namespace to __9 libstdc++-v3/ChangeLog:     * acinclude.m4 (libtool_VERSION): Bump to 9:0:0.     * config/abi/pre/gnu-versioned-namespace.ver (GLIBCXX_8.0): Replace by GLIBCXX_9.0.     Adapt all references to __8 namespace.     *

Fix gnu versioned namespace mode 00/03

2024-05-04 Thread François Dumont
Here is the list of patches to restore gnu versioned namespace mode. 1/3: Bump gnu version namespace This is important to be done first so that once build of gnu versioned namespace is fixed there is no chance to have another build of '__8' version with a different abi than last successful

[PATCH v2] Driver: Reject output filenames with source file suffixes [PR80182]

2024-05-04 Thread Peter Damianov
Currently, commands like: gcc -o file.c -lm will delete the user's code. This patch checks the suffix of the output, and errors if the output ends in any of the suffixes listed in default_compilers. Unfortunately, I couldn't come up with a better heuristic to diagnose this case more

[PATCH] Driver: Reject output filenames with the same suffixes as source files [PR80182]

2024-05-04 Thread Peter Damianov
Currently, commands like: gcc -o file.c -lm will delete the user's code. This patch checks the suffix of the output, and errors if the output ends in any of the suffixes listed in default_compilers. Unfortunately, I couldn't come up with a better heuristic to diagnose this case more

Ping: [PATCH 0/3] Recover in-tree libiconv build support

2024-05-04 Thread Arsen Arsenović
Hi! Given that trunk is now GCC 15, it might be good to land this patch early. I will re-test it just in case after a rebase but, otherwise, OK for trunk? TIA, have a lovely day. -- Arsen Arsenović signature.asc Description: PGP signature

Re: [PATCH v2 1/1] [RISC-V] Add support for _Bfloat16

2024-05-04 Thread Jeff Law
On 4/2/24 3:22 AM, Xiao Zeng wrote: 1 At point , BF16 has already been completed "post public review". 2 LLVM has also added support for RISCV BF16 in and . 3 According to

[PATCH v2] Fix auto deduction for template specialization scopes [PR114915]

2024-05-04 Thread Seyed Sajad Kahani
The limitations of the initial patch (checking specializiation template usage), have been discussed. > I realized that for the case where we have a member function template > of a class template, and a specialization of the enclosing class only > (like below), > > template <> > template > void

[PATCH 2/4] libcpp/init: remove unnecessary `struct` keyword

2024-05-04 Thread Ben Boeckel
The initial P1689 patches were written in 2019 and ended up having code move around over time ended up introducing a `struct` keyword to the implementation of `cpp_finish`. Remove it to match the rest of the file and its declaration in the header. Fixes: 024f135a1e9 (p1689r5: initial support,

[PATCH 3/4] gcc/c-family/c-opts: fix quoting for `-fdeps-format=` error message

2024-05-04 Thread Ben Boeckel
Fixes: 024f135a1e9 (p1689r5: initial support, 2023-09-01) Reported-by: Roland Illig gcc/c-family/ * c-opts.cc (c_common_handle_option): Fix quoting in `-fdeps-format=` unrecognized parameter error message. Signed-off-by: Ben Boeckel --- gcc/c-family/c-opts.cc | 2 +- 1 file

[PATCH 4/4] gcc/c-family/c.opt: clarify `-fdeps-*` flag documentation

2024-05-04 Thread Ben Boeckel
Move the only supported value (as of today) to the flag name itself. Also reword to clarify that the `-fdeps-file=` file will be written to. Fixes: 024f135a1e9 (p1689r5: initial support, 2023-09-01) Reported-by: Roland Illig gcc/c-family/ * c.opt: Clarify `-fdeps-*` documentation.

[PATCH 1/4] libcpp/mkdeps: fix indentation

2024-05-04 Thread Ben Boeckel
Fixes: 024f135a1e9 (p1689r5: initial support, 2023-09-01) Reported-by: Roland Illig libcpp/ * mkdeps.cc (fdeps_add_target): Fix indentation. Signed-off-by: Ben Boeckel --- libcpp/mkdeps.cc | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git

[PATCH 0/4] P1689 followup fixes

2024-05-04 Thread Ben Boeckel
Hi, Here are some minor fixes to documentation, formatting, and styling to the P1689R5 support through the `-fdeps-*` flags. Thanks, --Ben Ben Boeckel (4): libcpp/mkdeps: fix indentation libcpp/init: remove unnecessary `struct` keyword gcc/c-family/c-opts: fix quoting for

[RFA][RISC-V] [PATCH v2] Enable inlining str* by default

2024-05-04 Thread Jeff Law
The CI system caught a latent bug in the inline string comparison code that shows up with rv32+zbb. It was hardcoding 64 when AFAICT it should have been using BITS_PER_WORD. So v2 with that fixed. -- So with Chrstoph's patches from late 2022 we've had the ability to inline strlen, and

Re: [PATCH] Fix auto deduction for template specialization scopes [114915].

2024-05-04 Thread Seyed Sajad Kahani
Thanks for your helpful feedback. It has totally shaped my understanding. While I was trying to develop other tests, as you suggested: > It would be good to also test an explicit variable tmpl spec and > an explicit spec of a member template of a class template. I realized that for the case

Re: [V2][PATCH] gcc-14/changes.html: Deprecate a GCC C extension on flexible array members.

2024-05-04 Thread Sebastian Huber
On 07.08.23 16:22, Qing Zhao via Gcc-patches wrote: Hi, This is the 2nd version of the patch. Comparing to the 1st version, the only change is to address Richard's comment on refering a warning option for diagnosing deprecated behavior. Okay for committing? thanks. Qing ==

[PATCH] aarch64: Support multiple variants including up to 3

2024-05-04 Thread Andrew Pinski
On some of the Qualcomm's SoC that includes oryon-1 core, the variant will be different on the cores due to big.little config. Though the difference between big and little is not significant enough to have seperate cost/scheduling models for them and the feature set is the same across all

[COMMITTED 21/23] Implement operator_gt for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_gt::fold_range): New. (operator_gt::op1_range): New. (operator_gt::op2_range): New. (operator_gt::op1_op2_relation): New.

[COMMITTED 18/23] Implement operator_equal for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_equal::fold_range): New. (operator_equal::op1_range): New. (operator_equal::op2_range): New. (operator_equal::op1_op2_relation): New.

[COMMITTED 22/23] Implement operator_ge for prange....

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_ge::fold_range): New. (operator_ge::op1_range): New. (operator_ge::op2_range): New. (operator_ge::op1_op2_relation): New.

[COMMITTED 08/23] Implement operator_identity for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for fold_range, op1_range, lhs_op1_relation, pointers_handled_p. * range-op-ptr.cc (operator_identity::fold_range): New. (operator_identity::lhs_op1_relation): New.

[COMMITTED 14/23] Implement operator_pointer_diff for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-ptr.cc (operator_pointer_diff::op1_op2_relation_effect): New. (operator_pointer_diff::pointers_handled_p): New. --- gcc/range-op-ptr.cc | 32 1 file changed, 32 insertions(+) diff --git a/gcc/range-op-ptr.cc

[COMMITTED 23/23] Add prange entries in gimple-range-op.cc.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * gimple-range-op.cc (class cfn_pass_through_arg1): Add overloads for prange operations. (cfn_strlen): Same. --- gcc/gimple-range-op.cc | 36 1 file changed, 36 insertions(+) diff --git a/gcc/gimple-range-op.cc

[COMMITTED 20/23] Implement operator_le for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_le::fold_range): New. (operator_le::op1_range): New. (operator_le::op2_range): New. (operator_le::op1_op2_relation): New.

[COMMITTED 11/23] Implement operator_min and operator_max for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_min::fold_range): New. (operator_min::pointers_handled_p): New. (operator_max::fold_range): New. (operator_max::pointers_handled_p): New. ---

[COMMITTED 09/23] Implement operator_cst for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_cst::fold_range): New. (operator_cst::pointers_handled_p): New. --- gcc/range-op-mixed.h | 4 gcc/range-op-ptr.cc | 23 +++ 2 files

[COMMITTED 17/23] Implement operator_not_equal for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_not_equal::fold_range): New. (operator_not_equal::op1_range): New. (operator_not_equal::op2_range): New. (operator_not_equal::op1_op2_relation):

[COMMITTED 06/23] Add prange implementation for get_legacy_range.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * value-range.cc (get_legacy_range): New version for prange. --- gcc/value-range.cc | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 62170a438bf..3e1ecf69517 100644 ---

[COMMITTED 19/23] Implement operator_lt for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (max_limit): New. (min_limit): New. (build_lt): New. (build_le): New. (build_gt): New. (build_ge): New. (operator_lt::fold_range):

[COMMITTED 12/23] Implement operator_addr_expr for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_addr_expr::op1_range): New. (operator_addr_expr::pointers_handled_p): New. --- gcc/range-op-mixed.h | 4 gcc/range-op-ptr.cc | 38

[COMMITTED 10/23] Implement operator_cast for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_cast::fold_range): New. (operator_cast::op1_range): New. (operator_cast::lhs_op1_relation): New. (operator_cast::pointers_handled_p): New. ---

[COMMITTED 13/23] Implement pointer_plus_operator for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-ptr.cc (class pointer_plus_operator): Add overloaded declarations for pointer variants. (pointer_plus_operator::fold_range): New. (pointer_plus_operator::op2_range): New. (pointer_plus_operator::pointers_handled_p): New. ---

[COMMITTED 15/23] Implement operator_bitwise_and for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_bitwise_and::fold_range): New. (operator_bitwise_and::pointers_handled_p): New. --- gcc/range-op-mixed.h | 6 ++ gcc/range-op-ptr.cc | 30

[COMMITTED 16/23] Implement operator_bitwise_or for prange.

2024-05-04 Thread Aldy Hernandez
We seem to have a range-op entry for pointer bitwise OR that we've inherited from the original VRP implementation, but it never gets used. If this is not valid gimple, we can safely remove this entry. gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants.

[COMMITTED 05/23] Add hashing support for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * value-range.cc (add_vrange): Add prange support. --- gcc/value-range.cc | 16 1 file changed, 16 insertions(+) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 84113ccfbd0..62170a438bf 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc

[COMMITTED 01/23] Minimal prange class showing inlining degradation to VRP.

2024-05-04 Thread Aldy Hernandez
There is a 2% slowdown to VRP unrelated to the work at hand. This patch is a skeleton implementation of prange that exhibits this degradation. It is meant as a place in the commit history we can return to in order to revisit the issue. The relevant discussion is here:

[COMMITTED 07/23] Implement range-op dispatch for prange.

2024-05-04 Thread Aldy Hernandez
This patch adds the range-op dispatch code for prange, and adds some temporary sanity checks (for flag_checking only) to make sure we handle all the pointer/integer variants. In order to make sure I got all the combinations right, I started with a clean slate, trapping on all pointer operands.

[COMMITTED 02/23] Implement basic prange class.

2024-05-04 Thread Aldy Hernandez
This provides a bare prange class with bounds and bitmasks. It will be a drop-in replacement for pointer ranges, so we can pull their support from irange. The range-op code will be contributed as a follow-up. The code is disabled by default, as irange::supports_p still accepts pointers: inline

[COMMITTED 04/23] Add storage support for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * value-range-storage.cc (vrange_allocator::clone_varying): Add prange support. (vrange_allocator::clone_undefined): Same. (vrange_storage::alloc): Same. (vrange_storage::set_vrange): Same. (vrange_storage::get_vrange): Same.

[PATCH 00/23] prange: pointer ranges

2024-05-04 Thread Aldy Hernandez
This patchset implements prange, a range class for pointers. This is meant to be a drop-in replacement for pointer ranges, so we can pull them out of irange, simplifying both irange and prange in the process. Initially we have two integer endpoints and the usual value/mask bitmasks as this is

[COMMITTED 03/23] Add streaming support for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * data-streamer-in.cc (streamer_read_value_range): Add prange support. * data-streamer-out.cc (streamer_write_vrange): Same. --- gcc/data-streamer-in.cc | 12 gcc/data-streamer-out.cc | 10 ++ 2 files changed, 22 insertions(+) diff --git

Re: [PATCH] middle-end/114931 - type_hash_canon and structual equality types

2024-05-04 Thread Martin Uecker
Am Freitag, dem 03.05.2024 um 21:16 +0200 schrieb Jakub Jelinek: > > On Fri, May 03, 2024 at 09:11:20PM +0200, Martin Uecker wrote: > > > > > > TYPE_CANONICAL as used by the middle-end cannot express this but > > > > > > > > Hm. so how does it work now for arrays? > > > > Do you have a testcase