Re: Question about builtin_free doesn't read memory

2021-11-28 Thread Bin.Cheng via Gcc
On Sun, Nov 28, 2021 at 4:11 PM Jan Hubicka wrote: > > > Hi, > > In function ref_maybe_used_by_call_p_1, there is below code snippet > > /* The following builtins do not read from memory. */ > > case BUILT_IN_FREE: > > ... > >return false; > > > > I am confu

Question about builtin_free doesn't read memory

2021-11-27 Thread Bin.Cheng via Gcc
Hi, In function ref_maybe_used_by_call_p_1, there is below code snippet /* The following builtins do not read from memory. */ case BUILT_IN_FREE: ... return false; I am confused because free function does read from (and even write to) memory pointed to by pas

Re: State of AutoFDO in GCC

2021-04-22 Thread Bin.Cheng via Gcc
On Fri, Apr 23, 2021 at 4:16 AM Martin Liška wrote: > > On 4/22/21 9:58 PM, Eugene Rozenfeld via Gcc wrote: > > GCC documentation for AutoFDO points to create_gcov tool that converts > > perf.data file into gcov format that can be consumed by gcc with > > -fauto-profile (https://gcc.gnu.org/onli

Re: cache optimization through samping hardware event

2020-11-18 Thread Bin.Cheng via Gcc
On Tue, Nov 10, 2020 at 3:04 PM 172060045 <172060...@hdu.edu.cn> wrote: > > Hi, > > Recently, I was interested in GCC AutoFDO optimization, which works by > sampling specific PMU event on production machines and using those profiles > to guide optimization. In this way, information such as cache

Question about -moutline-atomic under -mcmodel-large

2020-09-17 Thread Bin.Cheng via Gcc
Hi, Compiling below program: #define STREAM_ARRAY_SIZE (1107296256) double a[STREAM_ARRAY_SIZE], b[STREAM_ARRAY_SIZE], c[STREAM_ARRAY_SIZE]; typedef struct { volatile int locked; } spinlock_t; volatile int cnt32=0; volatile long cnt64=0; void atom(){ __atomic_fetch_add(&cnt32,

How should I check if a type can be contextually converted to another one in c++FE

2020-02-09 Thread Bin.Cheng
Hi, As subject, how should I check if a type can be contextually converted to bool, in c++FE? Thanks, bin

Confused about code/comment in tree.c:build2

2020-01-30 Thread Bin.Cheng
Hi, In tree.c:build2 there is following code/comment: if ((code == MINUS_EXPR || code == PLUS_EXPR || code == MULT_EXPR) && arg0 && arg1 && tt && POINTER_TYPE_P (tt) /* When sizetype precision doesn't match that of pointers we need to be able to build explicit extensions or

Re: Do we need to do a loop invariant motion after loop interchange ?

2019-11-25 Thread Bin.Cheng
On Mon, Nov 25, 2019 at 5:29 PM Li Jia He wrote: > > > > On 2019/11/24 2:26 PM, Bin.Cheng wrote: > > On Fri, Nov 22, 2019 at 3:23 PM Bin.Cheng wrote: > >> > >> On Fri, Nov 22, 2019 at 3:19 PM Richard Biener > >> wrote: > >>> &

Re: Do we need to do a loop invariant motion after loop interchange ?

2019-11-23 Thread Bin.Cheng
On Fri, Nov 22, 2019 at 3:23 PM Bin.Cheng wrote: > > On Fri, Nov 22, 2019 at 3:19 PM Richard Biener > wrote: > > > > On November 22, 2019 6:51:38 AM GMT+01:00, Li Jia He > > wrote: > > > > > > > > >On 2019/11/21 8:10 PM, Richard Biener wr

Re: Do we need to do a loop invariant motion after loop interchange ?

2019-11-21 Thread Bin.Cheng
On Fri, Nov 22, 2019 at 3:19 PM Richard Biener wrote: > > On November 22, 2019 6:51:38 AM GMT+01:00, Li Jia He > wrote: > > > > > >On 2019/11/21 8:10 PM, Richard Biener wrote: > >> On Thu, Nov 21, 2019 at 10:22 AM Li Jia He > >wrote: > >>> > >>> Hi, > >>> > >>> I found for the follow code: > >>

Re: Any future plan supporting livepatching in kernel for AArch64?

2019-09-18 Thread Bin.Cheng
On Thu, Sep 19, 2019 at 1:02 PM Andrew Pinski wrote: > > On Wed, Sep 18, 2019 at 9:56 PM Andrew Pinski wrote: > > > > On Wed, Sep 18, 2019 at 9:24 PM Bin.Cheng wrote: > > > > > > Hi, > > > I read through previous messages which tried to sup

Any future plan supporting livepatching in kernel for AArch64?

2019-09-18 Thread Bin.Cheng
Hi, I read through previous messages which tried to support livepatching in kernel for AArch64. Following is the patch supporting mfentry: https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00756.html And this is the last message about above thread: https://gcc.gnu.org/ml/gcc-patches/2016-04/msg01093.ht

Re: Rust front-end

2019-08-27 Thread Bin.Cheng
On Fri, Aug 23, 2019 at 10:11 PM Mateus Carmo Martins de Freitas Barbosa wrote: > > I'm interested in working on the Rust front-end for GCC. > > So far I've cloned the repository > and tried to compile it as described in >

Re: GCC missing -flto optimizations? SPEC lbm benchmark

2019-02-15 Thread Bin.Cheng
On Fri, Feb 15, 2019 at 3:30 AM Steve Ellcey wrote: > > I have a question about SPEC CPU 2017 and what GCC can and cannot do > with -flto. As part of some SPEC analysis I am doing I found that with > -Ofast, ICC and GCC were not that far apart (especially spec int rate, > spec fp rate was a sligh

Re: question about inlining long call sequence

2019-02-13 Thread Bin.Cheng
On Tue, Feb 12, 2019 at 6:16 PM Martin Jambor wrote: > > On Tue, Feb 12 2019, Bin.Cheng wrote: > > Hi, > > When reading inlining code in GCC, I wonder if we have size heuristics > > to limit inlining long call sequence? For example, for call sequence > > A ->

question about inlining long call sequence

2019-02-12 Thread Bin.Cheng
Hi, When reading inlining code in GCC, I wonder if we have size heuristics to limit inlining long call sequence? For example, for call sequence A -> B -> C -> D -> ... -> X -> Y -> Z if each function call grows size by a very small amount, inlining Z all the way up to the outermost function could

Re: Is it a bug allowing to copy GIMPLE_ASM with labels?

2018-12-28 Thread Bin.Cheng
On Sat, Dec 29, 2018 at 3:42 PM Alexander Monakov wrote: > > On Sat, 29 Dec 2018, Bin.Cheng wrote: > > tracer-1.c: Assembler messages: > > tracer-1.c:16: Error: symbol `foo_label' is already defined > > > > Root cause is in tracer.c which duplicates basi

Is it a bug allowing to copy GIMPLE_ASM with labels?

2018-12-28 Thread Bin.Cheng
Hi, Give below test: volatile int a, b, c; __attribute__((noinline)) int foo () { int i; for (i = 0; i < 1000; i++) { if (i % 17) a++; else b++; asm volatile( "foo_label:\n" "pushq %%rbx\n" "popq %%rbx\n" :"=m"(c) :"r"(i)

Re: Parallelize the compilation using Threads

2018-12-13 Thread Bin.Cheng
On Wed, Dec 12, 2018 at 11:46 PM Giuliano Augusto Faulin Belinassi wrote: > > Hi, I have some news. :-) > > I replicated the Martin Liška experiment [1] on a 64-cores machine for > gcc [2] and Linux kernel [3] (Linux kernel was fully parallelized), > and I am excited to dive into this problem. As

A GCC bug related to inline?

2018-11-10 Thread Bin.Cheng
Hi, Given below simple code: inline int foo (int a) { return a + 1; } int g = 5; int main(void) { return foo(g); } When compiled with -O0, GCC generates below assembly: .file "test.c" .text .globl g .data .align 4 .type g, @object .size g, 4 g: .long 5 .text .globl main .type main, @function

progress on PR85804?

2018-10-14 Thread Bin.Cheng
Hi, Is there any progress on PR85804? There were some discussion about the old path at below address, but looks like no further attentions. https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01026.html Thanks, bin

Re: How to get GCC on par with ICC?

2018-06-06 Thread Bin.Cheng
On Wed, Jun 6, 2018 at 3:51 PM, Paul Menzel wrote: > Dear GCC folks, > > > Some scientists in our organization still want to use the Intel compiler, as > they say, it produces faster code, which is then executed on clusters. Some > resources on the Web [1][2] confirm this. (I am aware, that it’s h

Re: PR80155: Code hoisting and register pressure

2018-05-26 Thread Bin.Cheng
On Fri, May 25, 2018 at 5:54 PM, Richard Biener wrote: > On May 25, 2018 6:57:13 PM GMT+02:00, Jeff Law wrote: >>On 05/25/2018 03:49 AM, Bin.Cheng wrote: >>> On Fri, May 25, 2018 at 10:23 AM, Prathamesh Kulkarni >>> wrote: >>>> On 23 May 2018 at 18:37, Jef

Re: PR80155: Code hoisting and register pressure

2018-05-25 Thread Bin.Cheng
On Fri, May 25, 2018 at 10:23 AM, Prathamesh Kulkarni wrote: > On 23 May 2018 at 18:37, Jeff Law wrote: >> On 05/23/2018 03:20 AM, Prathamesh Kulkarni wrote: >>> On 23 May 2018 at 13:58, Richard Biener wrote: On Wed, 23 May 2018, Prathamesh Kulkarni wrote: > Hi, > I am trying t

Re: PR80155: Code hoisting and register pressure

2018-05-23 Thread Bin.Cheng
On Wed, May 23, 2018 at 9:28 AM, Richard Biener wrote: > On Wed, 23 May 2018, Prathamesh Kulkarni wrote: > >> Hi, >> I am trying to work on PR80155, which exposes a problem with code >> hoisting and register pressure on a leading embedded benchmark for ARM >> cortex-m7, where code-hoisting causes

Re: Bin Cheng appointed Loop Optimizer co-maintainer

2018-05-22 Thread Bin.Cheng
On Mon, May 21, 2018 at 6:20 PM, David Edelsohn wrote: > I am pleased to announce that the GCC Steering Committee has > appointed Bin Cheng as Loop Optimizer co-maintainer. > > Please join me in congratulating Bin on his new role. > Bin, please update your listing in the MAINTAINER

Re: Loop fusion.

2018-04-23 Thread Bin.Cheng
On Sun, Apr 22, 2018 at 3:27 PM, Toon Moene wrote: > A few days ago there was a rant on the Fortran Standardization Committee's > e-mail list about Fortran's "whole array arithmetic" being unoptimizable. > > An example picked at random from our weather forecasting code: > > ZQICE(1:NPROMA,1:NF

Re: Fortran array slices and -frepack-arrays

2018-04-13 Thread Bin.Cheng
On Fri, Apr 13, 2018 at 3:32 PM, Wilco Dijkstra wrote: > Hi, > > I looked at a few performance anomalies between gfortran and Flang - it > appears array slices > are treated differently. Using -frepack-arrays fixed a performance issue in > gfortran and didn't > cause any regressions. Making inpu

Re: How big (and fast) is going to be GCC 8? [part 2]

2018-03-06 Thread Bin.Cheng
On Tue, Mar 6, 2018 at 5:50 PM, Martin Liška wrote: > Hi. > > This is speed comparison of GCC 8 builds compared to my system GCC 7.3.0 > which is built with PGO bootstrap. > > I run empty C and C++ source file, tramp3d and the rest are some big beasts > from GCC source file. Feel free to suggest a

Re: eliminate dead stores across functions

2018-03-06 Thread Bin.Cheng
On Tue, Mar 6, 2018 at 4:50 PM, Bin.Cheng wrote: > On Tue, Mar 6, 2018 at 4:44 PM, Martin Jambor wrote: >> Hi Bin, >> >> On Tue, Mar 06 2018, Bin Cheng wrote: >>> On Tue, Mar 6, 2018 at 2:28 PM, Richard Biener >>>> >>>> Do you think the

Re: eliminate dead stores across functions

2018-03-06 Thread Bin.Cheng
On Tue, Mar 6, 2018 at 4:44 PM, Martin Jambor wrote: > Hi Bin, > > On Tue, Mar 06 2018, Bin Cheng wrote: >> On Tue, Mar 6, 2018 at 2:28 PM, Richard Biener >>> >>> Do you think the situation happens often enough to make this worthwhile? >> There is one probably more useful case. Program may use gl

Re: eliminate dead stores across functions

2018-03-06 Thread Bin.Cheng
On Tue, Mar 6, 2018 at 2:28 PM, Richard Biener wrote: > On Tue, Mar 6, 2018 at 1:00 PM, Prathamesh Kulkarni > wrote: >> Hi, >> For the following test-case, >> >> int a; >> >> __attribute__((noinline)) >> static void foo() >> { >> a = 3; >> } >> >> int main() >> { >> a = 4; >> foo (); >> r

Re: Question about generated type for common block in fortran

2017-11-09 Thread Bin.Cheng
On Wed, Nov 8, 2017 at 3:22 PM, Richard Biener wrote: > On Wed, Nov 8, 2017 at 3:45 PM, Michael Matz wrote: >> Hi, >> >> On Wed, 8 Nov 2017, Richard Biener wrote: >> >>> Not sure how - the issue is the FIELD_DECLs overlap which rules out a >>> RECORD_TYPE and leaves us with a UNION_TYPE. >> >> No

Question about generated type for common block in fortran

2017-10-26 Thread Bin.Cheng
Hi, I am looking into DSE transformation of some fortran codes. Given below fortran declarations: real*8 a(len) , b(len) , c(len) , d(len) common /area/ a, b, c, d real*8 src1(len), temp1(len), temp2(len), src2(len) equivalence(src1, a), (src2, b), (temp

Re: Handling prefetcher tag collisions while allocating registers

2017-10-24 Thread Bin.Cheng
On Tue, Oct 24, 2017 at 12:44 AM, Kugan Vivekanandarajah wrote: > Hi All, > > I am wondering if there is anyway we can prefer certain registers in > register allocations. That is, I want to have some way of recording > register allocation decisions (for loads in loop that are accessed in > steps)

Re: RFC: Improving GCC8 default option settings

2017-09-14 Thread Bin.Cheng
On Thu, Sep 14, 2017 at 11:24 AM, Richard Biener wrote: > On Thu, Sep 14, 2017 at 12:18 PM, Martin Liška wrote: >> On 09/14/2017 12:07 PM, Markus Trippelsdorf wrote: >>> On 2017.09.14 at 11:57 +0200, Richard Biener wrote: On Wed, Sep 13, 2017 at 6:11 PM, Nikos Chantziaras wrote: >

Re: Overwhelmed by GCC frustration

2017-08-17 Thread Bin.Cheng
On Thu, Aug 17, 2017 at 6:22 PM, wrote: > >> On Aug 17, 2017, at 11:22 AM, Oleg Endo wrote: >> >> On Wed, 2017-08-16 at 19:04 -0500, Segher Boessenkool wrote: >>> >>> LRA is easier to work with than old reload, and that makes it better >>> maintainable. >>> >>> Making LRA handle everything reloa

Re: How to migrate POINTER_TYPE_OVERFLOW_UNDEFINED for GCC v8.x?

2017-08-04 Thread Bin.Cheng
On Fri, Aug 4, 2017 at 8:00 AM, Leslie Zhai wrote: > Hi GCC developers, > > As ChangeLog mentioned: > > 2017-08-01 Bin Cheng > > * tree.h (POINTER_TYPE_OVERFLOW_UNDEFINED): Delete. > > > Then how to migrate it for GCC v8.x? for example: > > Constant *Result = POINTER_TYPE_OVERFLOW_UNDEFINED

Re: Optimization for static local variables

2017-06-14 Thread Bin.Cheng
On Wed, Jun 14, 2017 at 12:14 PM, Prachi Godbole wrote: > I'm developing a solution to optimize away intermediate stores (loads) for > static local variables which are assigned to before referenced on every path > through a function. > > Currently GCC eliminates all loads/stores in a straight li

Re: Lack of capability to represent arbitrary alias dependent information

2017-06-12 Thread Bin.Cheng
On Mon, Jun 12, 2017 at 11:46 AM, Bin.Cheng wrote: > On Mon, Jun 12, 2017 at 10:15 AM, Richard Biener > wrote: >> On Mon, Jun 12, 2017 at 11:02 AM, Bin.Cheng wrote: >>> HI, >>> GCC adds runtime alias checks for data references in passes like >>> vectorizer

Re: Lack of capability to represent arbitrary alias dependent information

2017-06-12 Thread Bin.Cheng
On Mon, Jun 12, 2017 at 10:15 AM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 11:02 AM, Bin.Cheng wrote: >> HI, >> GCC adds runtime alias checks for data references in passes like >> vectorizer, it would be very useful to pass along the runtime alias >> dependent

Lack of capability to represent arbitrary alias dependent information

2017-06-12 Thread Bin.Cheng
HI, GCC adds runtime alias checks for data references in passes like vectorizer, it would be very useful to pass along the runtime alias dependent information to later passes. Given below expample: int foo (int *a, int *b, int *c, int *d, int *e, int len, int v) { int k, x; for (k = 0; k < le

Re: Duplicating loops and virtual phis

2017-05-22 Thread Bin.Cheng
On Mon, May 22, 2017 at 1:42 AM, Kugan Vivekanandarajah wrote: > Hi Bin and Steve, > > On 17 May 2017 at 19:41, Bin.Cheng wrote: >> On Mon, May 15, 2017 at 7:32 PM, Richard Biener >> wrote: >>> On May 15, 2017 6:56:53 PM GMT+02:00, Steve Ellcey >>> wrote

Question about comment in vect_prune_runtime_alias_test_list

2017-05-18 Thread Bin.Cheng
Hi, In that function, we have below comments: /* Basically, for each pair of dependent data refs store_ptr_0 and load_ptr_0, we create an expression: ((store_ptr_0 + store_segment_length_0) <= load_ptr_0) || (load_ptr_0 + load_segment_length_0) <= store_ptr_0)) for aliasing

Re: Duplicating loops and virtual phis

2017-05-17 Thread Bin.Cheng
On Mon, May 15, 2017 at 7:32 PM, Richard Biener wrote: > On May 15, 2017 6:56:53 PM GMT+02:00, Steve Ellcey wrote: >>On Sat, 2017-05-13 at 08:18 +0200, Richard Biener wrote: >>> On May 12, 2017 10:42:34 PM GMT+02:00, Steve Ellcey >> om> wrote: >>> > >>> > (Short version of this email, is there a

Re: Vectorization regression on s390x GCC6 vs GCC5

2017-01-26 Thread Bin.Cheng
On Thu, Jan 26, 2017 at 10:18 AM, Robin Dapp wrote: > Hi, > > while analyzing a test case with a lot of nested loops (>7) and double > floating point operations I noticed a performance regression of GCC 6/7 > vs GCC 5 on s390x. It seems due to GCC 6 vectorizing something GCC 5 > couldn't. > Basic

Questions about pedantic_non_lvalue_loc and related code

2016-10-28 Thread Bin.Cheng
Hi, I am trying to move simplifications in fold_cond_expr_with_comparison to match.pd and had below questions about pedantic_non_lvalue_loc. Last change for the function is: commit 565353e8cf24046c034ecaf04dcb69ea8319a57c Author: rguenth Date: Tue Nov 11 15:21:12 2014 + 2014-11-11 Ri

Re: Question about fold C_MAYBE_CONST_EXPR expressions

2016-07-25 Thread Bin.Cheng
On Sun, Jul 24, 2016 at 11:04 PM, Prathamesh Kulkarni wrote: > On 24 July 2016 at 21:26, Bin.Cheng wrote: >> Hi, >> I ran into a problem that C frontend (in function >> build_conditional_expr) creates expression like (C_MAYBE_CONST_EXPR >> (NULL, x + const)). Th

Question about fold C_MAYBE_CONST_EXPR expressions

2016-07-24 Thread Bin.Cheng
Hi, I ran into a problem that C frontend (in function build_conditional_expr) creates expression like (C_MAYBE_CONST_EXPR (NULL, x + const)). The inner expression (and its operands) have unsigned int type. After that, the expression needs to be casted to result type which is unsigned short. In t

Re: Unnecessary check on phi node in tree if-conversion?

2016-04-08 Thread Bin.Cheng
On Thu, Apr 7, 2016 at 10:30 AM, Richard Biener wrote: > On April 6, 2016 8:21:35 PM GMT+02:00, "Bin.Cheng" > wrote: >>On Wed, Apr 6, 2016 at 5:07 PM, Bin.Cheng >>wrote: >>> Hi, >>> Function if_convertible_phi_p has below check on virtual PH

Re: Unnecessary check on phi node in tree if-conversion?

2016-04-06 Thread Bin.Cheng
On Wed, Apr 6, 2016 at 5:07 PM, Bin.Cheng wrote: > Hi, > Function if_convertible_phi_p has below check on virtual PHI nodes: > > > if (any_mask_load_store) > return true; > > /* When there were no if-convertible stores, check > that there are no memory wr

Unnecessary check on phi node in tree if-conversion?

2016-04-06 Thread Bin.Cheng
Hi, Function if_convertible_phi_p has below check on virtual PHI nodes: if (any_mask_load_store) return true; /* When there were no if-convertible stores, check that there are no memory writes in the branches of the loop to be if-converted. */ if (virtual_operand_p (gimple_p

Re: Help about how to bootstrap gcc with local version glibc other than system one

2016-02-22 Thread Bin.Cheng
On Mon, Feb 1, 2016 at 7:45 PM, Jeff Law wrote: > On 02/01/2016 12:07 PM, Bin.Cheng wrote: >> >> On Mon, Feb 1, 2016 at 6:08 PM, Andreas Schwab >> wrote: >>> >>> "Bin.Cheng" writes: >>> >>>> Seems to me Andrew was right

Re: ipa vrp implementation in gcc

2016-02-10 Thread Bin.Cheng
On Mon, Jan 18, 2016 at 5:10 PM, Jan Hubicka wrote: >> On Mon, Jan 18, 2016 at 12:00 AM, Kugan >> wrote: >> > Hi, >> > >> >> Another potential use of value ranges is the profile estimation. >> >> http://www.lighterra.com/papers/valuerangeprop/Patterson1995-ValueRangeProp.pdf >> >> It seems to me

Re: Inconsistent initialization for pic_offset_table_rtx?

2016-02-09 Thread Bin.Cheng
On Tue, Feb 9, 2016 at 3:53 PM, Ilya Enkovich wrote: > 2016-02-09 18:45 GMT+03:00 Richard Earnshaw (lists) > : >> On 09/02/16 14:56, Ilya Enkovich wrote: >>> >>> I agree it looks inconsistent. But I don't think PIC_OFFSET_TABLE_REGNUM is >>> supposed to return pseudo regno. Using EBX_REG value

Re: Inconsistent initialization for pic_offset_table_rtx?

2016-02-09 Thread Bin.Cheng
On Tue, Feb 9, 2016 at 2:56 PM, Ilya Enkovich wrote: > 2016-02-09 17:27 GMT+03:00 Bin.Cheng : >> On Fri, Feb 5, 2016 at 10:32 AM, Ilya Enkovich >> wrote: >>> 2016-02-04 19:16 GMT+03:00 Bin.Cheng : >>>> On Thu, Feb 4, 2016 at 3:18 PM, Ilya Enkovich >>

Re: Inconsistent initialization for pic_offset_table_rtx?

2016-02-09 Thread Bin.Cheng
On Fri, Feb 5, 2016 at 10:32 AM, Ilya Enkovich wrote: > 2016-02-04 19:16 GMT+03:00 Bin.Cheng : >> On Thu, Feb 4, 2016 at 3:18 PM, Ilya Enkovich wrote: >>> 2016-02-04 17:12 GMT+03:00 Bin.Cheng : >>>> Hi, >>>> I noticed that pic_offset_table_rtx is initial

Re: Inconsistent initialization for pic_offset_table_rtx?

2016-02-04 Thread Bin.Cheng
On Thu, Feb 4, 2016 at 3:18 PM, Ilya Enkovich wrote: > 2016-02-04 17:12 GMT+03:00 Bin.Cheng : >> Hi, >> I noticed that pic_offset_table_rtx is initialized twice in GCC. Take >> x86_32 as an example. >> The first initialization is done in emit

Inconsistent initialization for pic_offset_table_rtx?

2016-02-04 Thread Bin.Cheng
Hi, I noticed that pic_offset_table_rtx is initialized twice in GCC. Take x86_32 as an example. The first initialization is done in emit_init_regs, with below code: pic_offset_table_rtx = NULL_RTX; if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) pic_offset_table_rtx = gen_raw_RE

Re: Help about how to bootstrap gcc with local version glibc other than system one

2016-02-02 Thread Bin.Cheng
On Mon, Feb 1, 2016 at 7:45 PM, Jeff Law wrote: > On 02/01/2016 12:07 PM, Bin.Cheng wrote: >> >> On Mon, Feb 1, 2016 at 6:08 PM, Andreas Schwab >> wrote: >>> >>> "Bin.Cheng" writes: >>> >>>> Seems to me Andrew was right

Re: Help about how to bootstrap gcc with local version glibc other than system one

2016-02-01 Thread Bin.Cheng
On Mon, Feb 1, 2016 at 6:08 PM, Andreas Schwab wrote: > "Bin.Cheng" writes: > >> Seems to me Andrew was right in comment of PR69559, that we simply >> couldn't bootstrap GCC with sysroot. > > The main use of sysroot is to build a cross compiler, which

Help about how to bootstrap gcc with local version glibc other than system one

2016-02-01 Thread Bin.Cheng
Hi, Recently I tried to bootstrap gcc against new glibc but failed. What I want to do is just bootstrap gcc against local version glibc other than system one, because I can't update glibc in that system. I tried this by configuring GCC using "--with-build-sysroot" or "--with-sysroot" or both, but

libstdc++ and c library compatible issue when bootstrap GCC

2016-01-28 Thread Bin.Cheng
Hi, I ran into below error message at stage2 of bootstrap GCC: /work/obj/gcc-bootstrap/./prev-gcc/xg++ -B/work/obj/gcc-bootstrap/./prev-gcc/ -B//aarch64-none-linux-gnu/bin/ -nostdinc++ -B/work/obj/gcc-bootstrap/prev-aarch64-none-linux-gnu/libstdc++-v3/src/.libs -B/work/obj/gcc-bootstrap/prev-aarc

Re: Question about how to fix PR69052

2016-01-26 Thread Bin.Cheng
On Tue, Jan 26, 2016 at 4:26 PM, Jeff Law wrote: > On 01/26/2016 02:28 AM, Bin.Cheng wrote: >> >> Yes, loop invariant now increased invariant cost if the invariant >> can't be propagated into address expression. Problem is we check >> propagation by simply

Re: Question about how to fix PR69052

2016-01-26 Thread Bin.Cheng
On Tue, Jan 26, 2016 at 1:51 PM, Bin.Cheng wrote: > On Tue, Jan 26, 2016 at 12:56 PM, Bernd Schmidt > wrote: >> On 01/26/2016 10:48 AM, Bin.Cheng wrote: >>> >>> Yes, I moved whole loop pass (also the pass_web) after combine and it >>> worked. A combine

Re: Question about how to fix PR69052

2016-01-26 Thread Bin.Cheng
On Tue, Jan 26, 2016 at 12:56 PM, Bernd Schmidt wrote: > On 01/26/2016 10:48 AM, Bin.Cheng wrote: >> >> Yes, I moved whole loop pass (also the pass_web) after combine and it >> worked. A combine pass before loop-invariant can fix this problem. >> Below passes are curre

Re: Question about how to fix PR69052

2016-01-26 Thread Bin.Cheng
On Mon, Jan 25, 2016 at 8:05 PM, Bernd Schmidt wrote: > On 01/25/2016 08:51 PM, Jeff Law wrote: >> >> No, the combiner works within a basic block only. There was a group, I >> believe in Moscow, that worked on a cross-block combiner. It was >> discussed at the Cauldron in California a few years

Re: Question about how to fix PR69052

2016-01-26 Thread Bin.Cheng
On Mon, Jan 25, 2016 at 7:51 PM, Jeff Law wrote: > On 01/25/2016 11:42 AM, Bin.Cheng wrote: >> >> >> Yuri Rumyantsev suggested we may add a hook to handle GOT related >> instruction propagation specially so it won't be hoisted out. Is a >> hook at this s

Question about how to fix PR69052

2016-01-25 Thread Bin.Cheng
Hi, In revision 229402, I added logic in loop-invariant.c to check if a look invariant can be forward propagated to memory references in the same loop; and increase loop invariant cost if the answer is no. I think this is a reasonable change. Some targets like AArch64 can benefit from it because

Re: Test case mis-categorized as UNSUPPORTED?

2016-01-07 Thread Bin.Cheng
On Thu, Jan 7, 2016 at 2:21 PM, Kyrill Tkachov wrote: > Hi Bin, > > > On 07/01/16 14:15, Bin.Cheng wrote: >> >> Hi, >> Below test is supposed to be compiled and run, but we failed to link >> the binary with tiny memory model. >> >> spawn >

Re: Question about PR 48814 and ivopts and post-increment

2015-12-04 Thread Bin.Cheng
On Fri, Dec 4, 2015 at 11:00 AM, Bin.Cheng wrote: > On Fri, Dec 4, 2015 at 10:48 AM, Bin.Cheng wrote: >> On Wed, Dec 2, 2015 at 5:11 AM, Steve Ellcey wrote: >>> >>> I have a question involving ivopts and PR 48814, which was a fix for >>> the post increment

Re: Question about PR 48814 and ivopts and post-increment

2015-12-03 Thread Bin.Cheng
On Fri, Dec 4, 2015 at 10:48 AM, Bin.Cheng wrote: > On Wed, Dec 2, 2015 at 5:11 AM, Steve Ellcey wrote: >> >> I have a question involving ivopts and PR 48814, which was a fix for >> the post increment operation. Prior to the fix for PR 48814, MIPS >> would generate t

Re: Question about PR 48814 and ivopts and post-increment

2015-12-03 Thread Bin.Cheng
On Wed, Dec 2, 2015 at 5:11 AM, Steve Ellcey wrote: > > I have a question involving ivopts and PR 48814, which was a fix for > the post increment operation. Prior to the fix for PR 48814, MIPS > would generate this loop for strcmp (C code from glibc): > > $L4: > lbu $3,0($4) >

Re: How to generate jump_table_data in rtl optimizers

2015-11-08 Thread Bin.Cheng
On Mon, Nov 9, 2015 at 2:20 PM, Bin.Cheng wrote: > Hi, > I used below code snippet to generate jump_table_data: > > //setup label refs > start_sequence (); > emit_jump_table_data(gen_rtx_ > ADDR_DIFF_VEC (CASE_VECTOR_MODE, > > base_label_ref, > >

How to generate jump_table_data in rtl optimizers

2015-11-08 Thread Bin.Cheng
Hi, I used below code snippet to generate jump_table_data: //setup label refs start_sequence (); emit_jump_table_data(gen_rtx_ ADDR_DIFF_VEC (CASE_VECTOR_MODE, base_label_ref, label_refs...)) insns = get_insns (); end_sequence (); split_edge_and_insert (edge, insns); But

Re: Awareness of register pressure on strength reduction of induction variables.

2015-09-05 Thread Bin.Cheng
On Wed, Sep 2, 2015 at 8:52 PM, Richard Biener wrote: > On Tue, Sep 1, 2015 at 7:57 PM, Ajit Kumar Agarwal > wrote: >> All; >> >> The Global code motion are the important optimization that have an impact on >> register spills and Fetch. Thus >> The Global code motion takes into account the incre

Re: Bin Cheng as Loop Induction Variable Optimizations maintainer

2015-08-02 Thread Bin.Cheng
On Sat, Aug 1, 2015 at 5:03 AM, Jeff Law wrote: > I am pleased to announce that the GCC Steering Committee has appointed Bin > Cheng as the IVopts maintainer. > > Please join me in congratulating Bin on his new role. > > Bin, please update your entry in the MAINTAINERS file. I also believe you Do

Re: %fs and %gs segments on x86/x86-64

2015-07-13 Thread Bin.Cheng
On Thu, Jul 9, 2015 at 8:02 PM, Armin Rigo wrote: > Hi all, > > Here is an updated patch (attached) for __seg_fs and __seg_gs: > > * added a target hook "default_pointer_address_modes" to avoid > disabling a few gcc optimizations which, according to my reading of > the documentation, should contin

Re: Question about always executed info computed in tree-ssa-loop-im.c

2015-07-08 Thread Bin.Cheng
On Wed, Jul 8, 2015 at 5:58 PM, Bin.Cheng wrote: > On Wed, Jul 8, 2015 at 5:51 PM, Richard Biener > wrote: >> On Wed, Jul 8, 2015 at 8:52 AM, Bin.Cheng wrote: >>> Hi, >>> Function fill_always_executed_in_1 computes basic blocks' always >>> executed in

Re: Question about always executed info computed in tree-ssa-loop-im.c

2015-07-08 Thread Bin.Cheng
On Wed, Jul 8, 2015 at 5:51 PM, Richard Biener wrote: > On Wed, Jul 8, 2015 at 8:52 AM, Bin.Cheng wrote: >> Hi, >> Function fill_always_executed_in_1 computes basic blocks' always >> executed information, and it has below code and comment: >> >>

Question about always executed info computed in tree-ssa-loop-im.c

2015-07-07 Thread Bin.Cheng
Hi, Function fill_always_executed_in_1 computes basic blocks' always executed information, and it has below code and comment: /* In a loop that is always entered we may proceed anyway. But record that we entered it and stop once we leave it. */ inn_loop = bb->loop_fat

Re: Does GCC generate LDRD/STRD (Register) forms?

2015-07-06 Thread Bin.Cheng
On Tue, Jul 7, 2015 at 10:05 AM, Anmol Paralkar (anmparal) wrote: > Hello, > > Does GCC generate LDRD/STRD (Register) forms [A8.8.74/A8.8.211 per ARMv7-A > & ARMv7-R ARM]? > > Based on various attempts to write code to get GCC to generate a sample > form, and subsequently inspecting the code I see

Re: Live on Exit renaming.

2015-07-05 Thread Bin.Cheng
On Mon, Jul 6, 2015 at 1:16 PM, Ajit Kumar Agarwal wrote: > > > -Original Message- > From: Bin.Cheng [mailto:amker.ch...@gmail.com] > Sent: Monday, July 06, 2015 10:26 AM > To: Ajit Kumar Agarwal > Cc: Steven Bosscher; l...@redhat.com; Richard Biener; gcc@gcc.gnu.

Re: Live on Exit renaming.

2015-07-05 Thread Bin.Cheng
On Mon, Jul 6, 2015 at 12:02 PM, Ajit Kumar Agarwal wrote: > > > -Original Message- > From: Bin.Cheng [mailto:amker.ch...@gmail.com] > Sent: Monday, July 06, 2015 7:04 AM > To: Steven Bosscher > Cc: Ajit Kumar Agarwal; l...@redhat.com; Richard Biener; gcc@gcc.gnu.

Re: Live on Exit renaming.

2015-07-05 Thread Bin.Cheng
On Mon, Jul 6, 2015 at 6:02 AM, Steven Bosscher wrote: > On Sat, Jul 4, 2015 at 3:45 PM, Ajit Kumar Agarwal wrote: >> I am not sure why the above optimization is not implemented in GCC. > > -fsplit-ivs-in-unroller And thing might have changed. Given the condition GCC does IVO on gimple, unrollin

Re: Identifying Chain of Recurrence

2015-05-29 Thread Bin.Cheng
_info() non-static and recompiling the source > code? > > Thanks, > Pritam Gharat > > On Fri, May 29, 2015 at 10:34 AM, Bin.Cheng wrote: >> On Fri, May 29, 2015 at 12:41 PM, Pritam Gharat >> wrote: >>> GCC builds a chain of recurrence to capture a pat

Re: Identifying Chain of Recurrence

2015-05-28 Thread Bin.Cheng
On Fri, May 29, 2015 at 12:41 PM, Pritam Gharat wrote: > GCC builds a chain of recurrence to capture a pattern in which an > array is accessed in a loop. Is there any function which identifies > that gcc has built a chain of recurrence? Is this information > associated to the gimple assignment whi

Re: Question about macro _GLIBCXX_RES_LIMITS in libstdc++ testsuite

2015-05-17 Thread Bin.Cheng
On Mon, May 18, 2015 at 9:40 AM, Jim Wilson wrote: > On 05/17/2015 01:16 AM, Bin.Cheng wrote: >> On Sat, May 16, 2015 at 5:35 PM, Hans-Peter Nilsson >> wrote: >>> On Thu, 23 Apr 2015, Bin.Cheng wrote: >>>> Hi, >>>> In libstdc++ testsuite, I notice

Re: Question about macro _GLIBCXX_RES_LIMITS in libstdc++ testsuite

2015-05-17 Thread Bin.Cheng
On Sat, May 16, 2015 at 5:35 PM, Hans-Peter Nilsson wrote: > On Thu, 23 Apr 2015, Bin.Cheng wrote: >> Hi, >> In libstdc++ testsuite, I noticed that macro _GLIBCXX_RES_LIMITS is >> checked/set by GLIBCXX_CHECK_SETRLIMIT, which is further guarded by >> GLIBCXX_IS_NATI

Question about macro _GLIBCXX_RES_LIMITS in libstdc++ testsuite

2015-04-22 Thread Bin.Cheng
Hi, In libstdc++ testsuite, I noticed that macro _GLIBCXX_RES_LIMITS is checked/set by GLIBCXX_CHECK_SETRLIMIT, which is further guarded by GLIBCXX_IS_NATIVE as below: AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], [ if $GLIBCXX_IS_NATIVE ; then # Do checks for resource limit functions. GLIBCXX

Re: Combine changes ASHIFT into mult for non-MEM rtx

2015-04-02 Thread Bin.Cheng
On Thu, Apr 2, 2015 at 8:32 PM, Jeff Law wrote: > On 04/02/2015 03:39 AM, Bin.Cheng wrote: >> >> Hi, >> In function make_compound_operation, the code/comment says: >> >> case ASHIFT: >>/* Convert shifts by constants into multiplications if insid

Re: Combine changes ASHIFT into mult for non-MEM rtx

2015-04-02 Thread Bin.Cheng
On Thu, Apr 2, 2015 at 5:49 PM, Kugan wrote: > On 02/04/15 20:39, Bin.Cheng wrote: >> Hi, >> In function make_compound_operation, the code/comment says: >> >> case ASHIFT: >> /* Convert shifts by constants into multiplications if inside >>

Combine changes ASHIFT into mult for non-MEM rtx

2015-04-02 Thread Bin.Cheng
Hi, In function make_compound_operation, the code/comment says: case ASHIFT: /* Convert shifts by constants into multiplications if inside an address. */ if (in_code == MEM && CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT && INTVAL (XE

Re: Fixing inconsistent uses of address costs

2015-03-30 Thread Bin.Cheng
On Sat, Mar 28, 2015 at 1:31 AM, Sandra Loosemore wrote: > On 03/27/2015 03:43 AM, Kyrill Tkachov wrote: >> >> >> On 27/03/15 03:29, Bin.Cheng wrote: >>> >>> [much snippage] >>> >>> >>> As for tree ivopts, address cost is used

Re: Fixing inconsistent uses of address costs

2015-03-30 Thread Bin.Cheng
On Fri, Mar 27, 2015 at 5:43 PM, Kyrill Tkachov wrote: > > On 27/03/15 03:29, Bin.Cheng wrote: >> >> On Thu, Mar 26, 2015 at 11:40 PM, Kyrill Tkachov >> wrote: >>> >>> Hi all, >>> >>> I'd like to attempt to make GCC's usage o

Re: Fixing inconsistent uses of address costs

2015-03-26 Thread Bin.Cheng
On Thu, Mar 26, 2015 at 11:40 PM, Kyrill Tkachov wrote: > Hi all, > > I'd like to attempt to make GCC's usage of costs in the backends consistent. > We have a lot of different types: rtx costs, address costs, regmove costs, > vector costs etc. Some of them are use in different units, compared agai

Do we create new insn in combine? Or can we rely on INSN_LUID checking the order of instuctions?

2014-12-10 Thread Bin.Cheng
Hi, I am looking into distribute_notes, one reason why it's complicated is the live range of register noted by REG_DEAD could be both shrunk or extended. When live range shrinks, we need to search backwards to find previous reference and mark it as REG_DEAD (or delete the definition if there is no

Re: Question on param MAX_PENDING_LIST_LENGTH in sched-deps

2014-11-06 Thread Bin.Cheng
On Fri, Nov 7, 2014 at 7:10 AM, Jeff Law wrote: > On 11/04/14 20:29, Bin.Cheng wrote: >> >> Hi, >> The parameter MAX_PENDING_LIST_LENGTH is set to 32 by default. It >> seems to me the length of pending list can't be larger than 32. But >&g

Question on param MAX_PENDING_LIST_LENGTH in sched-deps

2014-11-04 Thread Bin.Cheng
Hi, The parameter MAX_PENDING_LIST_LENGTH is set to 32 by default. It seems to me the length of pending list can't be larger than 32. But in sched-deps.c, below code is used: /* Pending lists can't get larger with a readonly context. */ if (!deps->readonly && ((deps->pendin

Re: GCC ARM: aligned access

2014-09-03 Thread Bin.Cheng
On Mon, Sep 1, 2014 at 9:14 AM, Peng Fan wrote: > > > On 09/01/2014 08:09 AM, Matt Thomas wrote: >> >> On Aug 31, 2014, at 11:32 AM, Joel Sherrill >> wrote: >> Hi, I am writing some code and found that system crashed. I found it was unaligned access which causes `data abort`

  1   2   >