Re: SSA_NAME_DEF_STMT or print_gimple_stmt for MEM_REF seems mal-functional

2020-06-16 Thread Richard Biener via Gcc
On Tue, Jun 16, 2020 at 5:00 AM Shuai Wang wrote: > > Yes, TREE_CODE (op1) != SSA_NAME shows that op1 is by no means SSA names > (although I don't know why). But how can I backwardly identify its > initialization statement _17 = (signed char *) _16? Thanks! You want to walk over SSA operands o

Re: SSA_NAME_DEF_STMT or print_gimple_stmt for MEM_REF seems mal-functional

2020-06-15 Thread Shuai Wang via Gcc
Yes, TREE_CODE (op1) != SSA_NAME shows that op1 is by no means SSA names (although I don't know why). But how can I backwardly identify its initialization statement _17 = (signed char *) _16? Thanks! Shuai On Tue, Jun 16, 2020 at 10:32 AM Shuai Wang wrote: > Got it. But in that sense, given a

Re: SSA_NAME_DEF_STMT or print_gimple_stmt for MEM_REF seems mal-functional

2020-06-15 Thread Shuai Wang via Gcc
Got it. But in that sense, given a `op1` satisfies the "is_gimple_addressable" predicate (e.g., the _17 in my sample code), how can I find its def statement? Thank you very much. Shuai On Tue, Jun 16, 2020 at 3:19 AM Richard Biener wrote: > On June 15, 2020 6:58:27 PM GMT+02:00, Shuai Wang > w

Re: SSA_NAME_DEF_STMT or print_gimple_stmt for MEM_REF seems mal-functional

2020-06-15 Thread Richard Biener via Gcc
On June 15, 2020 6:58:27 PM GMT+02:00, Shuai Wang wrote: >Thank you very much for your prompt response, Rchard. Sorry I was kinda >"learning by doing". I am familiar with LLVM stuff but newbie to GCC >specifications. > >Just want to make sure I got it right; _17 and _16 in the IR code are >SSA >v

Re: SSA_NAME_DEF_STMT or print_gimple_stmt for MEM_REF seems mal-functional

2020-06-15 Thread Shuai Wang via Gcc
Thank you very much for your prompt response, Rchard. Sorry I was kinda "learning by doing". I am familiar with LLVM stuff but newbie to GCC specifications. Just want to make sure I got it right; _17 and _16 in the IR code are SSA variables. They are initialized for once and used once. Could you p

Re: SSA_NAME_DEF_STMT or print_gimple_stmt for MEM_REF seems mal-functional

2020-06-15 Thread Richard Biener via Gcc
On June 15, 2020 6:31:38 PM GMT+02:00, Shuai Wang via Gcc wrote: >Hello, > >Suppose given the following SSA statement generated by the `sanopt` >pass: > > _17 = (signed char *) _16; > _18 = *_17; > >I am using the following code to identify that _17 depends on _16: > >// def_stmt refers to _1

SSA_NAME_DEF_STMT or print_gimple_stmt for MEM_REF seems mal-functional

2020-06-15 Thread Shuai Wang via Gcc
Hello, Suppose given the following SSA statement generated by the `sanopt` pass: _17 = (signed char *) _16; _18 = *_17; I am using the following code to identify that _17 depends on _16: // def_stmt refers to _18 = &_17; for (unsigned i = 1; i < gimple_num_ops(def_stmt); i++) { o