Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-12-13 Thread Richard Biener
On Thu, Dec 8, 2016 at 1:51 PM, Martin Liška wrote: > On 12/02/2016 01:29 PM, Richard Biener wrote: >> On Thu, Dec 1, 2016 at 5:30 PM, Martin Liška wrote: >>> On 11/23/2016 03:13 PM, Jakub Jelinek wrote: On Wed, Nov 23, 2016 at 02:57:07PM +0100, Martin Liška wrote: > I started review pro

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-12-08 Thread Martin Liška
On 12/02/2016 01:29 PM, Richard Biener wrote: > On Thu, Dec 1, 2016 at 5:30 PM, Martin Liška wrote: >> On 11/23/2016 03:13 PM, Jakub Jelinek wrote: >>> On Wed, Nov 23, 2016 at 02:57:07PM +0100, Martin Liška wrote: I started review process in libsanitizer: https://reviews.llvm.org/D26965

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-12-02 Thread Richard Biener
On Thu, Dec 1, 2016 at 5:30 PM, Martin Liška wrote: > On 11/23/2016 03:13 PM, Jakub Jelinek wrote: >> On Wed, Nov 23, 2016 at 02:57:07PM +0100, Martin Liška wrote: >>> I started review process in libsanitizer: https://reviews.llvm.org/D26965 >>> And I have a question that was asked in the review:

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-12-01 Thread Martin Liška
On 11/23/2016 03:13 PM, Jakub Jelinek wrote: > On Wed, Nov 23, 2016 at 02:57:07PM +0100, Martin Liška wrote: >> I started review process in libsanitizer: https://reviews.llvm.org/D26965 >> And I have a question that was asked in the review: can we distinguish >> between load and store >> in case o

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 02:57:07PM +0100, Martin Liška wrote: > I started review process in libsanitizer: https://reviews.llvm.org/D26965 > And I have a question that was asked in the review: can we distinguish > between load and store > in case of having usage of ASAN_POISON? I think with ASAN_P

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-23 Thread Martin Liška
I started review process in libsanitizer: https://reviews.llvm.org/D26965 And I have a question that was asked in the review: can we distinguish between load and store in case of having usage of ASAN_POISON? Load looks as follows: int main (int argc, char **argv) { char *ptr; if (argc != 12

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-22 Thread Martin Liška
On 11/16/2016 05:28 PM, Jakub Jelinek wrote: > On Wed, Nov 16, 2016 at 05:01:31PM +0100, Martin Liška wrote: >> + use_operand_p use_p; >> + imm_use_iterator imm_iter; >> + FOR_EACH_IMM_USE_FAST (use_p, imm_iter, poisoned_var) >> +{ >> + gimple *use = USE_STMT (use_p); >> + if (is_g

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-16 Thread Jakub Jelinek
On Wed, Nov 16, 2016 at 05:01:31PM +0100, Martin Liška wrote: > + use_operand_p use_p; > + imm_use_iterator imm_iter; > + FOR_EACH_IMM_USE_FAST (use_p, imm_iter, poisoned_var) > +{ > + gimple *use = USE_STMT (use_p); > + if (is_gimple_debug (use)) > + continue; > + > + bui

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-16 Thread Martin Liška
As the patch quite significantly slowed down tramp3d, there's analysis of # of variables which are poisoned by the sanitizer: == normal variables == 24 B: 348x (5.80%) 16 B: 273x (4.55%) 8 B: 237x (3.95%) 1 B: 177x (2.95%) 4 B: 119x (1.98%) 40 B: 89x (1.48%) 144 B:

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-16 Thread Martin Liška
On 11/16/2016 02:07 PM, Jakub Jelinek wrote: > On Wed, Nov 16, 2016 at 01:25:04PM +0100, Martin Liška wrote: >> >> + >> +/* Expand the ASAN_{LOAD,STORE} builtins. */ > > Stale comment. Fixed. > >> + >> +bool >> +asan_expand_poison_ifn (gimple_stmt_iterator *iter, >> +bool

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-16 Thread Jakub Jelinek
On Wed, Nov 16, 2016 at 01:25:04PM +0100, Martin Liška wrote: > > + > +/* Expand the ASAN_{LOAD,STORE} builtins. */ Stale comment. > + > +bool > +asan_expand_poison_ifn (gimple_stmt_iterator *iter, > + bool *need_commit_edge_insert) > +{ ... > + use_operand_p use_p; > + i

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-16 Thread Martin Liška
On 11/16/2016 01:25 PM, Martin Liška wrote: > Hello > > Following patch is a candidate that re-writes VAR_DECLs that are > is_gimple_reg_type with: > my_char_25 = ASAN_POISON (); > > that is eventually transformed to: > __builtin___asan_report_use_after_scope_noabort ("my_char", 1); > > at place

[RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-16 Thread Martin Liška
Hello Following patch is a candidate that re-writes VAR_DECLs that are is_gimple_reg_type with: my_char_25 = ASAN_POISON (); that is eventually transformed to: __builtin___asan_report_use_after_scope_noabort ("my_char", 1); at places where my_char_25 is used. That introduces a new entry point to