[PATCH, S/390] Improved support for the Linux kernel Ftrace

2018-07-16 Thread Ilya Leoshkevich
This is the counterpart of the i386 feature introduced by 39a5a6a4: Add direct support for Linux kernel __fentry__ patching.

[PATCH 2/3] S/390: Implement -mrecord-mcount

2018-07-16 Thread Ilya Leoshkevich
This is the counterpart of the i386 feature introduced by 39a5a6a4: Add direct support for Linux kernel __fentry__ patching. * gcc/config/s390/s390.c (s390_function_profiler): Generate __mcount_loc section. * gcc/config/s390/s390.opt: Add the new option. * gcc/tests

[PATCH 3/3] S/390: Implement -mnop-mcount

2018-07-16 Thread Ilya Leoshkevich
This is the counterpart of the i386 feature introduced by 39a5a6a4: Add direct support for Linux kernel __fentry__ patching. On i386 the profiler call sequence always consists of 1 call instruction, so -mnop-mcount generates a single nop with the same length as a call. For S/390 longer sequences m

[PATCH 1/3] S/390: Implement -mfentry

2018-07-16 Thread Ilya Leoshkevich
This is the counterpart of the i386 feature introduced by 39a5a6a4: Add direct support for Linux kernel __fentry__ patching. On i386, the difference between mcount and fentry is that fentry comes before the prolog. On s390 mcount already comes before the prolog, but takes 4 instructions. This patc

[PATCH] S/390: Add CFI for mcount call sequences

2018-07-17 Thread Ilya Leoshkevich
Fixes unwind for mcount. 2018-07-17 Ilya Leoshkevich * config/s390/s390.c (s390_function_profiler): Generate CFI. --- gcc/config/s390/s390.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c

[PATCH] Fix hard regno checks

2018-07-23 Thread Ilya Leoshkevich
FIRST_PSEUDO_REGISTER is not a hard regno, so comparisons should use "<" instead of "<=", and ">=" instread of ">". 2018-07-19 Ilya Leoshkevich * config/nds32/nds32.c (nds32_hard_regno_mode_ok): Replace > wi

[PATCH] S/390: Use UNSPEC_GET_TP for thread pointer loads

2019-10-23 Thread Ilya Leoshkevich
Boostrapped and regtested on s390x-redhat-linux. gcc/ChangeLog: 2019-10-21 Ilya Leoshkevich * config/s390/s390.c (s390_get_thread_pointer): Use gen_get_thread_pointer. (s390_expand_split_stack_prologue): Likewise. * config/s390/s390.md (UNSPEC_GET_TP): New

[PATCH v2] Move jump threading before reload

2019-10-24 Thread Ilya Leoshkevich
bine, 3918 edges are threaded. This means this change will not introduce performance regressions. gcc/ChangeLog: 2019-10-17 Ilya Leoshkevich PR rtl-optimization/92007 * cfgcleanup.c (thread_jump): Add an assertion that we don't call it after reload if hot/cold

[PATCH] Free dominance info at the beginning of pass_jump_after_combine

2019-11-12 Thread Ilya Leoshkevich
the dominator tree, which in turn makes delete_basic_block loop forever. Fix by freeing dominance info at the beginning of cleanup_cfg. gcc/ChangeLog: 2019-11-12 Ilya Leoshkevich PR rtl-optimization/92430 * cfgcleanup.c (pass_jump_after_combine::execute): Free dominance

Re: [PATCH] Free dominance info at the beginning of pass_jump_after_combine

2019-11-12 Thread Ilya Leoshkevich
> Am 12.11.2019 um 15:32 schrieb Segher Boessenkool > : > > Hi! > > On Tue, Nov 12, 2019 at 03:11:05PM +0100, Ilya Leoshkevich wrote: >> try_forward_edges does not update dominance info, and merge_blocks >> relies on it being up-to-date. In PR92430 stale domina

Re: [PATCH] Free dominance info at the beginning of pass_jump_after_combine

2019-11-13 Thread Ilya Leoshkevich
> On Tue, Nov 12, 2019 at 04:32:36PM +0100, Ilya Leoshkevich wrote: >>> Am 12.11.2019 um 15:32 schrieb Segher Boessenkool >>> : >>> On Tue, Nov 12, 2019 at 03:11:05PM +0100, Ilya Leoshkevich wrote: >>>> unsigned int >>>> pass_jump_afte

[PATCH] libsanitizer: Do not mention MSan and DFSan in an error message

2024-04-04 Thread Ilya Leoshkevich
Bootstrapped and regtested on s390x-redhat-linux. Ok for master? libsanitizer/ChangeLog: * sanitizer_common/sanitizer_linux_s390.cpp (AvoidCVE_2016_2143): Do not mention MSan and DFSan, which are not supported by GCC. --- libsanitizer/sanitizer_common/sanitizer_linux_s390.cpp |

Re: [PATCH] s390: Fix s390_const_int_pool_entry_p and movdi peephole2 [PR114605]

2024-04-08 Thread Ilya Leoshkevich
On Sat, 2024-04-06 at 18:58 +0200, Jakub Jelinek wrote: > Hi! > > The following testcase is miscompiled, because we have initially > a movti which loads the 0x3f803f80ULL TImode constant > from constant pool.  Later on we split it into a pair of DImode > loads.  Now, for the first load (wh

[PATCH] IBM Z: Preserve exceptions in autovec-*-signaling-eq.c tests

2024-02-19 Thread Ilya Leoshkevich
DSE, DCE, and other passes are removing redundant signaling comparisons from these tests, but the whole point is to check that GCC knows how to emit them. Use -fno-delete-dead-exceptions to prevent that. gcc/testsuite/ChangeLog: * gcc.target/s390/zvector/autovec-double-signaling-eq.c:

[PATCH v2] rs6000: Fix ASAN linker errors for Power ELF V1 ABI [PR113284]

2024-01-09 Thread Ilya Leoshkevich
ME using ASM_OUTPUT_FUNCTION_LABEL") Suggested-by: Jakub Jelinek Signed-off-by: Ilya Leoshkevich gcc/ChangeLog: PR sanitizer/113284 * config/rs6000/rs6000.cc (rs6000_elf_declare_function_name): Use assemble_function_label_final () for Power ELF V1 ABI.

[PATCH] Mark ASM_OUTPUT_FUNCTION_LABEL ()'s DECL argument as used

2024-01-15 Thread Ilya Leoshkevich
edict Glaw Suggested-by: Jan-Benedict Glaw Fixes: c659dd8bfb55 ("Implement ASM_DECLARE_FUNCTION_NAME using ASM_OUTPUT_FUNCTION_LABEL") Signed-off-by: Ilya Leoshkevich gcc/ChangeLog: * defaults.h (ASM_OUTPUT_FUNCTION_LABEL): Mark DECL as used. --- gcc/defaults.h | 7 +-

[PATCH v2 0/2] asan: Align .LASANPC on function boundary

2024-01-02 Thread Ilya Leoshkevich
338.html [4] https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549252.html [5] https://patchwork.ozlabs.org/project/gcc/list/?series=320223 [6] https://patchwork.ozlabs.org/project/gcc/list/?series=297132 [7] http://toolchain.lug-owl.de/laminar/jobs Ilya Leoshkevich (2): Implement ASM_DECLARE_F

[PATCH v2 1/2] Implement ASM_DECLARE_FUNCTION_NAME using ASM_OUTPUT_FUNCTION_LABEL

2024-01-02 Thread Ilya Leoshkevich
gccint recommends using ASM_OUTPUT_FUNCTION_LABEL in ASM_DECLARE_FUNCTION_NAME, but many implementations use ASM_OUTPUT_LABEL instead. It's inconsistent and prevents changes to ASM_OUTPUT_FUNCTION_LABEL from affecting the respective targets. --- gcc/config/aarch64/aarch64.cc | 2 +- gcc/co

[PATCH v2 2/2] asan: Align .LASANPC on function boundary

2024-01-02 Thread Ilya Leoshkevich
GCC can emit code between the function label and the .LASANPC label, making the latter unaligned. Some architectures cannot load unaligned labels directly and require literal pool entries, which is inefficient. Move the invocation of asan_function_start to ASM_OUTPUT_FUNCTION_LABEL, which guarant

[PATCH] asan: Do not call asan_function_start () without the current function [PR113251]

2024-01-08 Thread Ilya Leoshkevich
SANPC on function boundary") Suggested-by: Jakub Jelinek Signed-off-by: Ilya Leoshkevich gcc/ChangeLog: PR sanitizer/113251 * varasm.cc (assemble_function_label_raw): Do not call asan_function_start () without the current function. --- gcc/varasm.cc | 4 +++- 1 file

[PATCH] rs6000: Fix ASAN linker errors for Power ELF V1 ABI [PR113284]

2024-01-09 Thread Ilya Leoshkevich
other branches already use the correct macro. Fixes: c659dd8bfb55 ("Implement ASM_DECLARE_FUNCTION_NAME using ASM_OUTPUT_FUNCTION_LABEL") Signed-off-by: Ilya Leoshkevich gcc/ChangeLog: PR sanitizer/113284 * config/rs6000/rs6000.cc (rs6000_elf_declare_function_name):

Re: [PATCH v2 2/2] asan: Align .LASANPC on function boundary

2024-01-09 Thread Ilya Leoshkevich
On Tue, 2024-01-09 at 11:55 -0700, Jeff Law wrote: > > > On 1/2/24 12:41, Ilya Leoshkevich wrote: > > GCC can emit code between the function label and the .LASANPC > > label, > > making the latter unaligned.  Some architectures cannot load > > unaligned > &

[PATCH 0/2] asan: Align .LASANPC on function boundary

2023-12-07 Thread Ilya Leoshkevich
[3] https://gcc.gnu.org/pipermail/gcc-patches/2020-June/548338.html [4] https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549252.html [5] https://patchwork.ozlabs.org/project/gcc/list/?series=320223 [6] https://patchwork.ozlabs.org/project/gcc/list/?series=297132 [7] http://toolchain.lug-owl.de/laminar/

[PATCH 1/2] Implement ASM_DECLARE_FUNCTION_NAME using ASM_OUTPUT_FUNCTION_LABEL

2023-12-07 Thread Ilya Leoshkevich
gccint recommends using ASM_OUTPUT_FUNCTION_LABEL in ASM_DECLARE_FUNCTION_NAME, but many implementations use ASM_OUTPUT_LABEL instead. It's inconsistent and prevents changes to ASM_OUTPUT_FUNCTION_LABEL from affecting the respective targets. --- gcc/config/aarch64/aarch64.cc | 2 +- gcc/co

[PATCH 2/2] asan: Align .LASANPC on function boundary

2023-12-07 Thread Ilya Leoshkevich
GCC can emit code between the function label and the .LASANPC label, making the latter unaligned. Some architectures cannot load unaligned labels directly and require literal pool entries, which is inefficient. Move the invocation of asan_function_start to ASM_OUTPUT_FUNCTION_LABEL, which guarant

Re: [PATCH] s390: Fix TF to FPRX2 conversion [PR115860]

2024-09-11 Thread Ilya Leoshkevich
On Fri, 2024-08-16 at 09:41 +0200, Stefan Schulze Frielinghaus wrote: > Currently subregs originating from *tf_to_fprx2_0 and *tf_to_fprx2_1 > survive register allocation.  This in turn leads to wrong register > renaming.  Keeping the current approach would mean we need two insns > for > *tf_to_fpr

Re: [PATCH] s390: Fix TF to FPRX2 conversion [PR115860]

2024-09-11 Thread Ilya Leoshkevich
On Wed, 2024-09-11 at 12:35 +0200, Stefan Schulze Frielinghaus wrote: > On Wed, Sep 11, 2024 at 11:47:54AM +0200, Ilya Leoshkevich wrote: > > On Fri, 2024-08-16 at 09:41 +0200, Stefan Schulze Frielinghaus > > wrote: > > > Currently subregs originating from *tf_to_fprx2_0

Re: [PATCH] s390: Fix TF to FPRX2 conversion [PR115860]

2024-09-11 Thread Ilya Leoshkevich
On Wed, 2024-09-11 at 13:34 +0200, Stefan Schulze Frielinghaus wrote: > On Wed, Sep 11, 2024 at 01:22:30PM +0200, Ilya Leoshkevich wrote: > > On Wed, 2024-09-11 at 12:35 +0200, Stefan Schulze Frielinghaus > > wrote: > > > On Wed, Sep 11, 2024 at 11:47:54AM +0200, Ilya Leosh

Re: [PATCH] s390: Fix TF to FPRX2 conversion [PR115860]

2024-09-11 Thread Ilya Leoshkevich
On Wed, 2024-09-11 at 16:44 +0200, Stefan Schulze Frielinghaus wrote: > On Wed, Sep 11, 2024 at 01:59:48PM +0200, Ilya Leoshkevich wrote: > > On Wed, 2024-09-11 at 13:34 +0200, Stefan Schulze Frielinghaus > > wrote: > > > On Wed, Sep 11, 2024 at 01:22:30PM +0200, Ilya Leosh

Re: [PATCH v3 4/9] S/390: Do not use signaling vector comparisons on z13

2019-09-30 Thread Ilya Leoshkevich
> Am 06.09.2019 um 12:34 schrieb Segher Boessenkool > : > > Hi Ilya, > > On Thu, Sep 05, 2019 at 01:10:14PM +0200, Ilya Leoshkevich wrote: >> z13 supports only non-signaling vector comparisons. This means we >> cannot vectorize LT, LE, GT, GE and LTGT when compil

Re: [PATCH v3 2/9] Introduce rtx_alloca, alloca_raw_REG and alloca_rtx_fmt_*

2019-09-30 Thread Ilya Leoshkevich
> Am 06.09.2019 um 14:40 schrieb Richard Sandiford : > > Ilya Leoshkevich writes: >> One of the next patches in series needs to frequently pass short-lived >> fake rtxes to the back-end in order to test its capabilities. In order >> to reduce the load on GC, it is b

[PATCH v4 0/7] S/390: Use signaling FP comparison instructions

2019-10-01 Thread Ilya Leoshkevich
preparation cleanups. Patch 6 is an actual implementation. Path 7 contains new tests, that make sure autovectorized comparisons use proper instructions. Ilya Leoshkevich (7): Allow COND_EXPR and VEC_COND_EXPR condtions to trap Introduce can_vcond_compare_p function S/390: Do not use

[PATCH v4 3/7] S/390: Do not use signaling vector comparisons on z13

2019-10-01 Thread Ilya Leoshkevich
z13 supports only non-signaling vector comparisons. This means we cannot vectorize LT, LE, GT, GE and LTGT when compiling for z13. Notify middle-end about this by using more restrictive operator predicate in vcond. gcc/ChangeLog: 2019-08-21 Ilya Leoshkevich PR target/77918

[PATCH v4 1/7] Allow COND_EXPR and VEC_COND_EXPR condtions to trap

2019-10-01 Thread Ilya Leoshkevich
h takes special care to avoid introducing trapping comparisons in GIMPLE_COND. They are not allowed, because they would require 3 outgoing edges (then, else and EH), which is awkward to say the least. Therefore, computations of such conditions should live in their own basic blocks. gcc/Chang

[PATCH v4 5/7] S/390: Remove code duplication in vec_* comparison expanders

2019-10-01 Thread Ilya Leoshkevich
s390.md uses a lot of near-identical expanders that perform dispatching to other expanders based on operand types. Since the following patch would require even more of these, avoid copy-pasting the code by generating these expanders using an iterator. gcc/ChangeLog: 2019-08-09 Ilya Leoshkevich

[PATCH v4 2/7] Introduce can_vcond_compare_p function

2019-10-01 Thread Ilya Leoshkevich
. Introduce a function that checks whether back-end supports vector comparisons with individual rtx codes by matching vcond expander's third argument with a fake comparison with the corresponding rtx code. gcc/ChangeLog: 2019-08-27 Ilya Leoshkevich PR target/77918 * optabs-t

[PATCH v4 6/7] S/390: Use signaling FP comparison instructions

2019-10-01 Thread Ilya Leoshkevich
in this and similar cases. gcc/ChangeLog: 2019-08-09 Ilya Leoshkevich PR target/77918 * config/s390/2827.md: Add new opcodes. * config/s390/2964.md: Likewise. * config/s390/3906.md: Likewise. * config/s390/8561.md: Likewise. * config/s390/s

[PATCH v4 4/7] S/390: Implement vcond expander for V1TI,V1TF

2019-10-01 Thread Ilya Leoshkevich
Ilya Leoshkevich PR target/77918 * config/s390/vector.md (V_HW): Add V1TI in order to make vcond$a$b generate vcondv1tiv1tf. --- gcc/config/s390/vector.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/s390/vector.md b/gcc/config/s390

[PATCH v4 7/7] S/390: Test signaling FP comparison instructions

2019-10-01 Thread Ilya Leoshkevich
gcc/testsuite/ChangeLog: 2019-08-09 Ilya Leoshkevich PR target/77918 * gcc.target/s390/s390.exp: Enable Fortran tests. * gcc.target/s390/zvector/autovec-double-quiet-eq.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-ge.c: New test

PING^3 [PATCH v2] S/390: Improve storing asan frame_pc

2019-10-01 Thread Ilya Leoshkevich
> Am 02.07.2019 um 17:34 schrieb Ilya Leoshkevich : > > Bootstrap and regtest running on x86_64-redhat-linux, s390x-redhat-linux > and ppc64le-redhat-linux. > > Currently s390 emits the following sequence to store a frame_pc: > > a: > .LASANPC0: > &

Re: [PATCH v4 2/7] Introduce can_vcond_compare_p function

2019-10-07 Thread Ilya Leoshkevich
> Am 03.10.2019 um 14:42 schrieb Richard Sandiford : > > Ilya Leoshkevich writes: >> z13 supports only non-signaling vector comparisons. This means we >> cannot vectorize LT, LE, GT, GE and LTGT when compiling for z13. >> However, we cannot express this restriction

Re: [PATCH v4 7/7] S/390: Test signaling FP comparison instructions

2019-10-11 Thread Ilya Leoshkevich
> Am 07.10.2019 um 18:27 schrieb Andreas Krebbel : > > On 01.10.19 15:27, wrote: >> gcc/testsuite/ChangeLog: >> >> 2019-08-09 Ilya Leoshkevich >> >> PR target/77918 >> * gcc.target/s390/s390.exp: Enable Fortran tests. >>

Re: [PATCH v4 6/7] S/390: Use signaling FP comparison instructions

2019-10-11 Thread Ilya Leoshkevich
> Am 07.10.2019 um 18:19 schrieb Andreas Krebbel : > > On 01.10.19 15:27, Ilya Leoshkevich wrote: >> dg-torture.exp=inf-compare-1.c is failing, because (qNaN > +Inf) >> comparison is compiled to CDB instruction, which does not signal an >> invalid operation except

[PATCH] S/390: Run %a0:DI splitters only after reload

2019-10-11 Thread Ilya Leoshkevich
Bootstrapped and regtested on s390x-redhat-linux. gcc/ChangeLog: 2019-10-10 Ilya Leoshkevich * config/s390/s390.md: Run %a0:DI splitters only after reload. gcc/testsuite/ChangeLog: 2019-10-10 Ilya Leoshkevich * gcc.target/s390/load-thread-pointer-once.c: New test

[PATCH] find_partition_fixes: remove unused bbs_in_cold_partition variable

2019-10-16 Thread Ilya Leoshkevich
Bootstrapped and regtested on x86_64-redhat-linux. I noticed this while looking into PR92007. gcc/ChangeLog: 2019-10-16 Ilya Leoshkevich * cfgrtl.c (find_partition_fixes): Remove bbs_in_cold_partition. --- gcc/cfgrtl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc

[PATCH] Move jump threading before reload

2019-10-18 Thread Ilya Leoshkevich
ter reload, 3889 edges are threaded. * When doing jump threading right after combine, 3918 edges are threaded. This means this change will not introduce performance regressions. gcc/ChangeLog: 2019-10-17 Ilya Leoshkevich PR rtl-optimization/92007 * cfgcleanup.c (thread_ju

[PATCH] Make flag_thread_jumps a gate of pass_jump_after_combine

2019-11-14 Thread Ilya Leoshkevich
2019-11-13 Ilya Leoshkevich PR rtl-optimization/92430 * cfgcleanup.c (pass_jump_after_combine::gate): New function. (pass_jump_after_combine::execute): Perform jump threading unconditionally. --- gcc/cfgcleanup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletio

[PATCH 0/2] S/390: Remove deprecated machines

2018-08-07 Thread Ilya Leoshkevich
Remove g5 and g6 machines as well as the corresponding lower-level features.

[PATCH 1/2] S/390: Remove support for g5 and g6 machines

2018-08-07 Thread Ilya Leoshkevich
g5 and g6 were deprecated since gcc 6.1.0 (commit 3bd8520f). gcc/ChangeLog: 2018-08-02 Ilya Leoshkevich * common/config/s390/s390-common.c (processor_flags_table): Remove flags. * config.gcc: Remove with_arch/with_tune support. * config/s390/2064.md: Remove

[PATCH 2/2] S/390: Remove TARGET_CPU_ZARCH

2018-08-07 Thread Ilya Leoshkevich
e: we need to support it because floating point and vector instructions still cannot use relative addressing. gcc/ChangeLog: 2018-08-07 Ilya Leoshkevich * config/s390/s390.c (s390_loadrelative_operand_p): Remove TARGET_CPU_ZARCH usages. (s390_rtx_costs): Lik

[PATCH] S/390: Factor out constant pool ref decomposition

2018-08-13 Thread Ilya Leoshkevich
gcc/ChangeLog: 2018-07-27 Ilya Leoshkevich * config/s390/s390.c (s390_decompose_constant_pool_ref): New function. (s390_decompose_address): Factor out constant pool ref decomposition. --- gcc/config/s390/s390.c | 155

[PATCH] S/390: Remove literal pool chunkification loop

2018-08-14 Thread Ilya Leoshkevich
Since there is no branch splitting anymore, the loop is no longer necessary: pool chunkification can be done in one step. gcc/ChangeLog: 2018-08-13 Ilya Leoshkevich * config/s390/s390.c (s390_reorg): remove loop --- gcc/config/s390/s390.c | 69

[PATCH] lra: fix FPE when dumping

2018-08-14 Thread Ilya Leoshkevich
ot;, "r5", "r6", "r7", "r8", "r9", "r10", "r12", "r14"); } results in internal compiler error: Floating point exception when building with -fira-verbose=9 -fdump-rtl-all gcc/ChangeLog: 2018-0

[PATCH] S/390: Remove UNSPEC_LTREL_BASE

2018-08-14 Thread Ilya Leoshkevich
It was needed only for g5/g6 machines, which are now gone. gcc/ChangeLog: 2018-08-14 Ilya Leoshkevich * config/s390/s390.c (s390_decompose_constant_pool_ref): Remove UNSPEC_LTREL_BASE check. (annotate_constant_pool_refs): Likewise. (find_constant_pool_ref

[PATCH v2] S/390: Remove literal pool chunkification loop

2018-08-15 Thread Ilya Leoshkevich
Since there is no branch splitting anymore, the loop is no longer necessary: pool chunkification can be done in one step. gcc/ChangeLog: 2018-08-13 Ilya Leoshkevich * config/s390/s390.c (s390_reorg): remove loop --- gcc/config/s390/s390.c | 68

[PATCH] S/390: Fix conditional returns

2018-09-05 Thread Ilya Leoshkevich
S/390 epilogue ends with (parallel [(return) (use %r14)]) instead of the more usual (return) or (simple_return). This sequence is not recognized by the conditional return logic in try_optimize_cfg (). gcc/ChangeLog: 2018-08-28 Ilya Leoshkevich PR target/80080 * cfgcleanup.c

[PATCH 1/2] S/390: Register pass_s390_early_mach statically

2018-09-05 Thread Ilya Leoshkevich
: 2018-08-27 Ilya Leoshkevich PR target/80080 * config/s390/s390-passes.def: New file. * config/s390/s390-protos.h (class rtl_opt_pass): Add forward declaration. (make_pass_s390_early_mach): Add declaration. * config/s390/s390.c

[PATCH 2/2] S/390: Repeat jump threading after combine

2018-09-05 Thread Ilya Leoshkevich
Combine can change basic blocks in a way that they end up containing a single jump_insn. This creates an opportunity to improve code with jump threading. gcc/ChangeLog: 2018-08-28 Ilya Leoshkevich PR target/80080 * cfgcleanup.c: Make jump pass clonable. * config/s390

[PATCH v2] combine: perform jump threading at the end

2018-09-05 Thread Ilya Leoshkevich
gcc/ChangeLog: 2018-09-05 Ilya Leoshkevich PR target/80080 * combine.c (rest_of_handle_combine): Perform jump threading. gcc/testsuite/ChangeLog: 2018-09-05 Ilya Leoshkevich PR target/80080 * gcc.target/s390/pr80080-4.c: New test. --- gcc/combine.c

[PATCH] S/390: Prohibit SYMBOL_REF in UNSPECV_CAS

2018-09-05 Thread Ilya Leoshkevich
Inhibit constant propagation inlining SYMBOL_REF loads into UNSPECV_CAS. Even though reload can later undo it, the resulting code will be less efficient. gcc/ChangeLog: 2018-09-05 Ilya Leoshkevich PR target/80080 * config/s390/predicates.md: Add nonsym_memory_operand

Re: [PATCH v2] combine: perform jump threading at the end

2018-09-10 Thread Ilya Leoshkevich
> Am 06.09.2018 um 20:11 schrieb Jeff Law : > > On 09/05/2018 06:11 AM, Richard Biener wrote: >> On Wed, Sep 5, 2018 at 2:01 PM Ilya Leoshkevich wrote: >>> >>> gcc/ChangeLog: >>> >>> 2018-09-05 Ilya Leoshkevich >

[PATCH v3] combine: perform jump threading at the end

2018-09-10 Thread Ilya Leoshkevich
able. Remove redundant usage of TV_JUMP. gcc/testsuite/ChangeLog: 2018-09-05 Ilya Leoshkevich PR target/80080 * gcc.target/s390/pr80080-4.c: New test. --- gcc/combine.c | 89 +++ gcc/testsuite/gcc.target/s390/pr80080-4.c |

Re: [PATCH v2] combine: perform jump threading at the end

2018-09-10 Thread Ilya Leoshkevich
> Am 07.09.2018 um 00:39 schrieb Segher Boessenkool > : > > On Thu, Sep 06, 2018 at 12:11:09PM -0600, Jeff Law wrote: >> On 09/05/2018 06:11 AM, Richard Biener wrote: >>> On Wed, Sep 5, 2018 at 2:01 PM Ilya Leoshkevich wrote: >>>> + /* Combining insn

[PATCH] Add myself to MAINTAINERS

2018-09-13 Thread Ilya Leoshkevich
2018-09-13 Ilya Leoshkevich * MAINTAINERS: (write after approval): Add myself. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8c90437180d..f8838fa8e8c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -462,6 +462,7 @@ Georg-Johann Lay

[PATCH] S/390: Improve s390-passes.def formatting

2018-09-14 Thread Ilya Leoshkevich
The result looks nicer in the generated pass-instances.def. gcc/ChangeLog: 2018-09-13 Ilya Leoshkevich * config/s390/s390-passes.def (INSERT_PASS_BEFORE): Improve formatting. Obvious fix, committed as r264306. --- gcc/config/s390/s390-passes.def | 2 +- 1 file changed, 1

Re: [PATCH v3] combine: perform jump threading at the end

2018-09-17 Thread Ilya Leoshkevich
> Am 14.09.2018 um 23:35 schrieb Segher Boessenkool > : > > Hi! > > On Mon, Sep 10, 2018 at 12:59:19PM +0200, Ilya Leoshkevich wrote: >> Consider the following RTL: >> >> (code_label 11 10 26 4 2 (nil) [1 uses]) >> (note 26 11 12 4 [bb 4] NOTE_INSN_BAS

[PATCH] Middle-end changes for fixing S/390 conditional returns

2018-09-17 Thread Ilya Leoshkevich
Hi all, Could anyone please take a look at https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00237.html ? Best regards, Ilya

Re: [PATCH v3] combine: perform jump threading at the end

2018-09-18 Thread Ilya Leoshkevich
> Am 17.09.2018 um 19:11 schrieb Segher Boessenkool > : > > On Mon, Sep 17, 2018 at 10:50:58AM +0200, Ilya Leoshkevich wrote: >>> Am 14.09.2018 um 23:35 schrieb Segher Boessenkool >>> : >>> Could you please show generated code before and after this pat

Re: [PATCH v3] combine: perform jump threading at the end

2018-09-18 Thread Ilya Leoshkevich
> Am 17.09.2018 um 19:11 schrieb Segher Boessenkool > : > > On Mon, Sep 17, 2018 at 10:50:58AM +0200, Ilya Leoshkevich wrote: >>> Am 14.09.2018 um 23:35 schrieb Segher Boessenkool >>> : > >>> Why does the existing jump threading not work for you; shoul

Re: [PATCH] S/390: Fix conditional returns

2018-09-18 Thread Ilya Leoshkevich
> Am 18.09.2018 um 02:57 schrieb Jeff Law : > > On 9/5/18 2:34 AM, Ilya Leoshkevich wrote: >> --- a/gcc/cfgcleanup.c >> +++ b/gcc/cfgcleanup.c >> @@ -2624,7 +2624,7 @@ bb_is_just_return (basic_block bb, rtx_insn **ret, >> rtx_insn **use) >>

Re: [PATCH] S/390: Fix conditional returns

2018-09-19 Thread Ilya Leoshkevich
> Am 19.09.2018 um 06:15 schrieb Jeff Law : > > On 9/18/18 8:04 AM, Segher Boessenkool wrote: >> On Wed, Sep 05, 2018 at 10:34:48AM +0200, Ilya Leoshkevich wrote: >>> S/390 epilogue ends with (parallel [(return) (use %r14)]) instead of >>> the more usual (

[PATCH] Change EQ_ATTR_ALT to support up to 64 alternatives

2018-09-19 Thread Ilya Leoshkevich
t called for "type" attribute for some reason? This patch widens EQ_ATTR_ALT bitmap to 64 bits, making it possible to gracefully handle up to 64 alternatives. It eliminates the problem with the 33rd alternative on S/390. gcc/ChangeLog: 2018-09-18 Ilya Leoshkevich * gen

[PATCH v2] S/390: Fix conditional returns on z196+

2018-09-19 Thread Ilya Leoshkevich
%r14. The resulting sequences are recognized by the conditional return logic in try_optimize_cfg (). gcc/ChangeLog: 2018-09-19 Ilya Leoshkevich PR target/80080 * config/s390/s390.md: Do not use PARALLEL RETURN+USE when returning via %r14. gcc/testsuite/ChangeLog: 2018-

[PATCH v2] Change EQ_ATTR_ALT to support up to 64 alternatives

2018-09-20 Thread Ilya Leoshkevich
o 64 bits, making it possible to gracefully handle up to 64 alternatives. It eliminates the problem with the 33rd alternative on S/390. gcc/ChangeLog: 2018-09-18 Ilya Leoshkevich * genattrtab.c (mk_attr_alt): Use alternative_mask. (attr_rtx_1): Adjust cachi

Re: [PATCH v2] S/390: Fix conditional returns on z196+

2018-09-21 Thread Ilya Leoshkevich
> Am 21.09.2018 um 12:50 schrieb Ulrich Weigand : > > Ilya Leoshkevich wrote: > >> 2018-09-19 Ilya Leoshkevich >> >> PR target/80080 >> * config/s390/s390.md: Do not use PARALLEL RETURN+USE when >> returning via %r14. > > T

[PATCH v3] S/390: Fix conditional returns on z196+

2018-09-24 Thread Ilya Leoshkevich
%r14. The resulting sequences are recognized by the conditional return logic in try_optimize_cfg (). gcc/ChangeLog: 2018-09-19 Ilya Leoshkevich PR target/80080 * config/s390/s390.c (s390_emit_epilogue): Do not use PARALLEL RETURN+USE when returning via %r14. gcc/test

Re: [PATCH] Change EQ_ATTR_ALT to support up to 64 alternatives

2018-09-24 Thread Ilya Leoshkevich
> Am 24.09.2018 um 13:29 schrieb Richard Sandiford : > > Ilya Leoshkevich writes: >> On S/390 there is a need to support more than 32 instruction >> alternatives per define_insn. Currently this is not explicitly >> prohibited or unsupported: MAX_RECOG_AL

[PATCH] Fix EQ_ATTR_ALT size calculation (PR bootstrap/87417)

2018-09-24 Thread Ilya Leoshkevich
es contain HOST_WIDE_INTs. This did not surface on 64-bit systems, because rtunion is 8 bytes anyway, but on 32-bit systems it's only 4 bytes. This resulted in out-of-bounds writes and memory corruptions in genattrtab. gcc/ChangeLog: 2018-09-24 Ilya Leoshkevich PR bootstrap/87417

[PATCH 0/8] Use signaling FP comparison instructions

2019-08-20 Thread Ilya Leoshkevich
comparisons use proper instructions. Ilya Leoshkevich (8): Document signaling for min, max and ltgt operations Introduce vcond_supported_p hook S/390: Implement vcond_supported_p hook S/390: Implement vcond expander for V1TI,V1TF S/390: Remove code duplication in vec_unordered S/390: Remove

[PATCH 2/8] Introduce vcond_supported_p hook

2019-08-20 Thread Ilya Leoshkevich
hook that tells whether target supports certain vector comparison operations with certain modes. gcc/ChangeLog: 2019-08-09 Ilya Leoshkevich * doc/tm.texi (TARGET_VCOND_SUPPORTED_P): Document. * doc/tm.texi.in (TARGET_VCOND_SUPPORTED_P): Document. * optabs-tree.c

[PATCH 1/8] Document signaling for min, max and ltgt operations

2019-08-20 Thread Ilya Leoshkevich
s (intentionally?) left unspecified, according to commit 64dd117734d0 ("Unconditionally use MAX_EXPR/MIN_EXPR for MAX/MIN intrinsics"). So document the status quo. gcc/ChangeLog: 2019-08-09 Ilya Leoshkevich PR target/91323 * doc/generic.texi (LTGT_EXPR): Re

[PATCH 3/8] S/390: Implement vcond_supported_p hook

2019-08-20 Thread Ilya Leoshkevich
z13 supports only non-signaling vector comparisons. This means we cannot vectorize LT, LE, GT, GE and LTGT when compiling for z13. Notify middle-end about this using vcond_supported_p hook. gcc/ChangeLog: 2019-08-09 Ilya Leoshkevich * config/s390/s390.c (s390_vcond_supported_p

[PATCH 4/8] S/390: Implement vcond expander for V1TI,V1TF

2019-08-20 Thread Ilya Leoshkevich
Ilya Leoshkevich * config/s390/vector.md (vcondv1tiv1tf): New variant of vcond$a$b expander. --- gcc/config/s390/vector.md | 15 +++ 1 file changed, 15 insertions(+) diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md index 0702e1de835..7d90d97b006 100644

[PATCH 6/8] S/390: Remove code duplication in vec_* comparison expanders

2019-08-20 Thread Ilya Leoshkevich
s390.md uses a lot of near-identical expanders that perform dispatching to other expanders based on operand types. Since the following patch would require even more of these, avoid copy-pasting the code by generating these expanders using an iterator. gcc/ChangeLog: 2019-08-09 Ilya Leoshkevich

[PATCH 5/8] S/390: Remove code duplication in vec_unordered

2019-08-20 Thread Ilya Leoshkevich
vec_unordered is vec_ordered plus a negation at the end. Reuse vec_unordered logic. gcc/ChangeLog: 2019-08-13 Ilya Leoshkevich * config/s390/vector.md (vec_unordered): Call gen_vec_ordered. --- gcc/config/s390/vector.md | 14 +++--- 1 file changed, 7 insertions(+), 7

[PATCH 8/8] S/390: Test signaling FP comparison instructions

2019-08-20 Thread Ilya Leoshkevich
gcc/testsuite/ChangeLog: 2019-08-09 Ilya Leoshkevich * gcc.target/s390/s390.exp: Enable Fortran tests. * gcc.target/s390/zvector/autovec-double-quiet-eq.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-ge.c: New test. * gcc.target/s390/zvector

[PATCH 7/8] S/390: Use signaling FP comparison instructions

2019-08-20 Thread Ilya Leoshkevich
in this and similar cases. gcc/ChangeLog: 2019-08-09 Ilya Leoshkevich * config/s390/2827.md: Add new opcodes. * config/s390/2964.md: Likewise. * config/s390/3906.md: Likewise. * config/s390/8561.md: Likewise. * config/s390/s390-builtins.def (s390_vfch

Re: [PATCH 2/8] Introduce vcond_supported_p hook

2019-08-20 Thread Ilya Leoshkevich
> Am 20.08.2019 um 12:13 schrieb Richard Sandiford : > > Ilya Leoshkevich writes: >> z13 supports only non-signaling vector comparisons. This means we >> cannot vectorize LT, LE, GT, GE and LTGT when compiling for z13. >> However, we cannot express this restriction

Re: [PATCH 1/8] Document signaling for min, max and ltgt operations

2019-08-20 Thread Ilya Leoshkevich
> Am 20.08.2019 um 17:04 schrieb Segher Boessenkool > : > > On Tue, Aug 20, 2019 at 11:18:38AM +0200, Ilya Leoshkevich wrote: >> Currently it's not clear whether or not min, max and ltgt should raise >> floating point exceptions when dealing with qNaNs. >>

Re: [PATCH 1/8] Document signaling for min, max and ltgt operations

2019-08-20 Thread Ilya Leoshkevich
> Am 20.08.2019 um 17:32 schrieb Segher Boessenkool > : > > On Tue, Aug 20, 2019 at 05:19:46PM +0200, Ilya Leoshkevich wrote: >>> Am 20.08.2019 um 17:04 schrieb Segher Boessenkool >>> : >>> The < and > operators separately already can cause exceptio

Re: [PATCH 1/8] Document signaling for min, max and ltgt operations

2019-08-20 Thread Ilya Leoshkevich
> Am 20.08.2019 um 17:50 schrieb Segher Boessenkool > : > > On Tue, Aug 20, 2019 at 11:18:38AM +0200, Ilya Leoshkevich wrote: >> Currently it's not clear whether or not min, max and ltgt should raise >> floating point exceptions when dealing with qNaNs. >>

Re: [PATCH 2/8] Introduce vcond_supported_p hook

2019-08-21 Thread Ilya Leoshkevich
> Am 20.08.2019 um 13:54 schrieb Richard Sandiford : > > Ilya Leoshkevich writes: >>> Am 20.08.2019 um 12:13 schrieb Richard Sandiford >>> : >>> >>> Ilya Leoshkevich writes: >>>> z13 supports only non-signaling vector comparisons. Th

Re: [PATCH 1/8] Document signaling for min, max and ltgt operations

2019-08-21 Thread Ilya Leoshkevich
> Am 20.08.2019 um 19:13 schrieb Segher Boessenkool > : > > On Tue, Aug 20, 2019 at 06:13:00PM +0200, Ilya Leoshkevich wrote: >>> Am 20.08.2019 um 17:50 schrieb Segher Boessenkool >>> : >>> There is currently no way to say (in trees or gimple or rtl

[PATCH v2 2/9] hash_traits: split pointer_hash_mark from pointer_hash

2019-08-22 Thread Ilya Leoshkevich
, is_deleted and is_empty manually. Split pointer_hash_mark out of pointer_hash in order to support such use cases. Also make use of it in the existing code where possible. gcc/ChangeLog: 2019-08-22 Ilya Leoshkevich * hash-traits.h (struct pointer_hash_mark): New trait. (Pointer

[PATCH v2 0/9] S/390: Use signaling FP comparison instructions

2019-08-22 Thread Ilya Leoshkevich
possible to query supported vcond rtxes and make use of that for z13. Patches 5-7 are preparation cleanups. Patch 8 is an actual implementation. Path 9 contains new tests, that make sure autovectorized comparisons use proper instructions. Ilya Leoshkevich (9): Document signaling for min, max and

[PATCH v2 1/9] Document signaling for min, max and ltgt operations

2019-08-22 Thread Ilya Leoshkevich
x > y)). The behavior of MIN/MAX is (intentionally?) left unspecified, according to https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=263751 ("Unconditionally use MAX_EXPR/MIN_EXPR for MAX/MIN intrinsics"). So document the status quo. gcc/ChangeLog: 2019-08-09 Ilya Leoshkev

[PATCH v2 3/9] Introduce can_vector_compare_p function

2019-08-22 Thread Ilya Leoshkevich
. Introduce a function that checks whether back-end supports vector comparisons with individual rtx codes by matching vcond expander's third argument with a fake comparison with the corresponding rtx code. gcc/ChangeLog: 2019-08-21 Ilya Leoshkevich * Makefile.in (GTFILES): Add opt

[PATCH v2 5/9] S/390: Implement vcond expander for V1TI,V1TF

2019-08-22 Thread Ilya Leoshkevich
Ilya Leoshkevich * config/s390/vector.md (vcondv1tiv1tf): New variant of vcond$a$b expander. --- gcc/config/s390/vector.md | 15 +++ 1 file changed, 15 insertions(+) diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md index d7a266c5605..ca5ec0dd3b0 100644

[PATCH v2 4/9] S/390: Do not use signaling vector comparisons on z13

2019-08-22 Thread Ilya Leoshkevich
z13 supports only non-signaling vector comparisons. This means we cannot vectorize LT, LE, GT, GE and LTGT when compiling for z13. Notify middle-end about this using more restrictive operator predicate in vcond. gcc/ChangeLog: 2019-08-21 Ilya Leoshkevich * config/s390/vector.md

[PATCH v2 6/9] S/390: Remove code duplication in vec_unordered

2019-08-22 Thread Ilya Leoshkevich
vec_unordered is vec_ordered plus a negation at the end. Reuse vec_unordered logic. gcc/ChangeLog: 2019-08-13 Ilya Leoshkevich * config/s390/vector.md (vec_unordered): Call gen_vec_ordered. --- gcc/config/s390/vector.md | 14 +++--- 1 file changed, 7 insertions(+), 7

  1   2   3   >