public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ajit Kumar Agarwal <ajit.kumar.agarwal@xilinx.com>
To: Jeff Law <law@redhat.com>, Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Vinod Kathail <vinodk@xilinx.com>,
	Shail Aditya Gupta <shailadi@xilinx.com>,
	Vidhumouli Hunsigida	<vidhum@xilinx.com>,
	Nagaraju Mekala <nmekala@xilinx.com>
Subject: RE: [Patch,tree-optimization]: Add new path Splitting pass on tree ssa representation
Date: Mon, 18 Jan 2016 18:27:00 -0000	[thread overview]
Message-ID: <37378DC5BCD0EE48BA4B082E0B55DFAA429E61F0@XAP-PVEXMBX02.xlnx.xilinx.com> (raw)
In-Reply-To: <56997A86.7070201@redhat.com>



-----Original Message-----
From: Jeff Law [mailto:law@redhat.com] 
Sent: Saturday, January 16, 2016 4:33 AM
To: Ajit Kumar Agarwal; Richard Biener
Cc: GCC Patches; Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch,tree-optimization]: Add new path Splitting pass on tree ssa representation

On 01/14/2016 01:55 AM, Jeff Law wrote:
[ Replying to myself again, mostly to make sure we've got these thoughts in the archives. ]
>
> Anyway, going back to adpcm_decode, we do end up splitting this path:
>
>   # vpdiff_12 = PHI <vpdiff_11(12), vpdiff_50(13)>
>    if (sign_41 != 0)
>      goto <bb 15>;
>    else
>      goto <bb 16>;
> ;;    succ:       15
> ;;                16
>
> ;;   basic block 15, loop depth 1
> ;;    pred:       14
>    valpred_51 = valpred_76 - vpdiff_12;
>    goto <bb 17>;
> ;;    succ:       17
>
> ;;   basic block 16, loop depth 1
> ;;    pred:       14
>    valpred_52 = vpdiff_12 + valpred_76;
> ;;    succ:       17
>
> ;;   basic block 17, loop depth 1
> ;;    pred:       15
> ;;                16
>    # valpred_7 = PHI <valpred_51(15), valpred_52(16)>
>    _85 = MAX_EXPR <valpred_7, -32768>;
>    valpred_13 = MIN_EXPR <_85, 32767>;
>    step_53 = stepsizeTable[index_62];
>    outp_54 = outp_69 + 2;
>    _55 = (short int) valpred_13;
>    MEM[base: outp_54, offset: -2B] = _55;
>    if (outp_54 != _74)
>      goto <bb 20>;
>    else
>      goto <bb 18>;
>
> This doesn't result in anything particularly interesting/good AFAICT. 
> We propagate valpred_51/52 into the use in the MAX_EXPR in the 
> duplicate paths, but that doesn't allow any further simplification.
>>So with the heuristic I'm poking at, this gets rejected.  Essentially it doesn't think it's likely to expose CSE/DCE opportunities (and it's correct).  The number of statements in predecessor >>blocks that feed operands in the to-be-copied-block is too small relative to the size of the to-be-copied-block.


>
> Ajit, can you confirm which of adpcm_code or adpcm_decode where path 
> splitting is showing a gain?  I suspect it's the former but would like 
> to make sure so that I can adjust the heuristics properly.
>>I'd still like to have this answered when you can Ajit, just to be 100%
 >> that it's the path splitting in adpcm_code that's responsible for the improvements you're seeing in adpcm.

The adpcm_coder get optimized with path splitting whereas the adpcm_decoder is not optimized further with path splitting. In adpcm_decoder
the join node is duplicated into its predecessors and with the duplication of join node the code is not optimized further.

In adpcm_coder with path splitting the following optimization is triggered with path splitting.

1. /* Output last step, if needed */
    if ( !bufferstep )
      *outp++ = outputbuffer;

     IF-THEN inside the loop will be triggered with bufferstep is 1.  Then the flip happens and bufferstep is 0. For the exit branch if the bufferstep
Is 1 the flip convert it to 0  and above IF-THEN generate store to assign outputbuffer to outp.

The above sequence is optimized with path splitting, if the bufferstep is 1 then exit branch of the loop branches to the above store. This does not require the flip of
bufferstep using xor with immediate 1. With this optimization there is one level of exit branch for the bufferstep 1 path. This lead to scheduling the
exit branch to the store with a meaningful instruction instead of xor with immediate 1.

Without Path Splitting if the bufferstep is 1  the exit branch of the loop branches to piece of branch flipping it to zero and the above IF-THEN outside the
loop does the store to assign outputbuffer to outp. Thus without path splitting there is two level of branch in the case of exit branch in the path where 
bufferstep is 1 inside the loop generating non optimized. Also without path splitting the two level of exit branch of the loop is scheduled with xor immediate with 1.

 Thanks & Regards
Ajit

jeff

  reply	other threads:[~2016-01-18 18:27 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  8:34 Ajit Kumar Agarwal
2015-06-30 10:38 ` Bernhard Reutner-Fischer
2015-06-30 10:43   ` Ajit Kumar Agarwal
2015-06-30 10:51     ` Bernhard Reutner-Fischer
2015-06-30 11:39 ` Richard Biener
2015-06-30 12:07   ` Ajit Kumar Agarwal
2015-07-04 12:40   ` Ajit Kumar Agarwal
2015-07-07  8:50     ` Richard Biener
2015-07-07 13:22       ` Ajit Kumar Agarwal
2015-07-16 11:20         ` Richard Biener
2015-07-29  7:44           ` Ajit Kumar Agarwal
2015-08-15 23:13             ` Ajit Kumar Agarwal
2015-08-19 19:47               ` Jeff Law
2015-08-20 15:40                 ` Ajit Kumar Agarwal
2015-08-20 15:49                   ` Jeff Law
2015-08-27  6:00                     ` Ajit Kumar Agarwal
2015-09-09 21:45                       ` Jeff Law
2015-09-12 12:05                         ` Ajit Kumar Agarwal
2015-10-20 16:05                           ` Ajit Kumar Agarwal
2015-11-11  7:01                           ` Jeff Law
2015-08-19 21:53               ` Jeff Law
2015-08-20 15:41                 ` Ajit Kumar Agarwal
2015-09-04 18:07                 ` Ajit Kumar Agarwal
2015-11-11 20:38                   ` Jeff Law
2015-11-12 10:58                     ` Richard Biener
2015-11-12 17:05                       ` Jeff Law
2015-11-12 18:33                         ` Jeff Law
2015-11-12 19:40                           ` Richard Biener
2015-11-12 19:52                             ` Jeff Law
2015-11-12 21:58                           ` Jeff Law
2015-11-13 10:13                             ` Richard Biener
2015-11-13 16:26                               ` Jeff Law
2015-11-13 18:09                                 ` Richard Biener
2015-11-13 20:23                                   ` Jeff Law
2015-11-13 23:36                                     ` Jeff Law
2015-11-18  7:44                                       ` Tom de Vries
2015-11-18 14:24                                         ` Ajit Kumar Agarwal
2015-12-03 14:38                                       ` Richard Biener
2015-12-03 14:45                                         ` Richard Biener
2015-12-10 20:12                                           ` Jeff Law
2015-12-03 15:46                                         ` Jeff Law
2015-12-10 20:08                                         ` Jeff Law
2015-12-11  9:11                                           ` Ajit Kumar Agarwal
2015-12-23  6:36                                             ` Jeff Law
2015-12-25  8:40                                               ` Ajit Kumar Agarwal
2016-01-02  7:32                                                 ` Jeff Law
2016-01-04 14:32                                               ` Ajit Kumar Agarwal
2016-01-13  8:10                                                 ` Jeff Law
     [not found]                                                   ` <56976289.3080203@redhat.com! >
2016-01-14  8:55                                                   ` Jeff Law
2016-01-15 23:02                                                     ` Jeff Law
2016-01-18 18:27                                                       ` Ajit Kumar Agarwal [this message]
2016-01-27  7:17                                                         ` Jeff Law
2016-01-27 17:21                                                           ` Ajit Kumar Agarwal
2016-01-15 22:38                                                   ` Jeff Law
2016-01-16  6:32                                                 ` Jeff Law
2016-01-18  9:13                                                   ` Ajit Kumar Agarwal
2016-01-27  7:13                                                     ` Jeff Law
2016-01-27  9:35                                                       ` Ajit Kumar Agarwal
2016-02-04  8:57                                                 ` Jeff Law
2015-12-11 10:06                                           ` Richard Biener
2015-12-15 23:50                                             ` Jeff Law
2015-12-16  7:44                                               ` Ajit Kumar Agarwal
2015-12-16  9:57                                                 ` Richard Biener
2015-12-16 10:13                                                   ` Ajit Kumar Agarwal
2015-12-17 10:38                                                     ` Ajit Kumar Agarwal
2015-12-17 23:41                                             ` Jeff Law
2015-12-18 15:43                                               ` Zamyatin, Igor
2015-11-13 13:19                             ` Ajit Kumar Agarwal
2015-06-30 12:39 ` Ajit Kumar Agarwal
2015-06-30 22:18 ` Joseph Myers
2015-07-02  3:52   ` Ajit Kumar Agarwal
2015-07-06 20:08     ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37378DC5BCD0EE48BA4B082E0B55DFAA429E61F0@XAP-PVEXMBX02.xlnx.xilinx.com \
    --to=ajit.kumar.agarwal@xilinx.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=nmekala@xilinx.com \
    --cc=richard.guenther@gmail.com \
    --cc=shailadi@xilinx.com \
    --cc=vidhum@xilinx.com \
    --cc=vinodk@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).