Looks good, though there will probably be more works to extend it to triple and 
beyond nested cases.

-----Original Message-----
From: Mathew, Pallavi 
Sent: Wednesday, June 15, 2011 4:22 PM
To: Ye, Mei; Sun Chan
Cc: open64-devel@lists.sourceforge.net
Subject: RE: [Open64-devel] Code review request for vectorizer patch [LNO] [CG]

Hi Mei,

Please see the updated patch.
For comment 1: Added comments at line 13-14 and 52-53 suggesting changes that 
will be needed to extend to triple-nested cases.
For comment 2: Yes, the example will be vectorized.
For comment 3: Done at lines 293-300.
For comment 4: Done by introducing macro BINARY_OP.

-Pallavi

-----Original Message-----
From: Ye, Mei
Sent: Wednesday, June 15, 2011 1:09 PM
To: Mathew, Pallavi; Sun Chan
Cc: open64-devel@lists.sourceforge.net
Subject: RE: [Open64-devel] Code review request for vectorizer patch [LNO] [CG]

For the LNO part:

- The code appears hard-wired to handle single-nested and double-nested
  cases and not flexible enough to extend it for triple-nested cases.
  (I do not require a change for this patch, a fix in the future will be good).

- Does the code take care of the following case where the comparison is a
  "OPR_NE" with a zero, but the if-condition expression is not a single load?

  if ((x & mask1) != 0) {
    if (y & mask2) != 0) {

    }
  }

- L287: "LWN_Get_Parent(WN_do_body(loop))" can be CSEed.

- L286 and L420: identifying 2-operand operators can be CSEed.

-Mei


-----Original Message-----
From: Mathew, Pallavi [mailto:pallavi.mat...@amd.com]
Sent: Tuesday, June 14, 2011 3:47 PM
To: Sun Chan
Cc: open64-devel@lists.sourceforge.net
Subject: Re: [Open64-devel] Code review request for vectorizer patch [LNO] [CG]

The original patch has been split into the two attached patches.
whirl.p: proposed WHIRL changes to add OPR_BLEND.
vectorizer.p: vectorization of if-statements that uses OPR_BLEND.

-Pallavi  

-----Original Message-----
From: Sun Chan [mailto:sun.c...@gmail.com]
Sent: Tuesday, June 14, 2011 2:51 PM
To: Mathew, Pallavi
Cc: open64-devel@lists.sourceforge.net
Subject: Re: [Open64-devel] Code review request for vectorizer patch [LNO] [CG]

This is a WHIRL change, Fred, can you look at the change (at least the new 
OPR_BLEND) to see if that is ok?
Sun

On Tue, Jun 14, 2011 at 1:39 PM, Mathew, Pallavi <pallavi.mat...@amd.com> wrote:
> Hi,
>
> Can a gatekeeper please review the attached patch which introduces a 
> framework for vectorization of IF-statements of the form:
>
>   - if (x != 0) { single_istore_statement } else {empty_body}
>
>   - if (x != 0) { if (y !=0) {single_istore_statement} else 
> {empty_body}} else {empty_body}
>
>
>
> Sample program:
>
> long array[2000000];
>
> void sample() {
>
>   long i;
>
>   for(i = 0; i < 2000000; i++) {
>
>     if (array[i])
>
>                 array[i] ^= i;
>
>   }
>
>   return;
>
> }
>
>
>
> Vectorization of such if-statement is done by first vectorizing its 
> subexpressions.
>
> The result of the vectorized if-condition is computed by 'pcmpeqq' 
> (V16I8EQ) and
>
> is used to select between the result of executing the statement in the 
> if-body or
>
> leaving the array element unchanged. This selection is performed by 
> the
>
> 'pblendvb' (V16I1V16I1BLEND) operation. Both of these are SSE4.1 
> instructions.
>
> We introduce a new whirl operation OPR_BLEND which eventually gets 
> translated to 'pblendvb'.
>
> This optimization is turned on by default and can be controlled by 
> -LNO:simd_vect_if={on/off}.
>
> This patch also recognizes and handles vectorization of invariants 
> rooted at OPR_ADD, OPR_SUB and OPR_MPY.
>
>
>
> Files updated by this patch:
>
> osprey/be/lno/simd.cxx
>
>  - vectorization of if-statements.
>
>  - vectorization of invariants rooted at OPR_ADD, OPR_SUB and OPR_MPY.
>
> osprey/common/com/config_lno.h
>
> osprey/common/com/config_lno.cxx
>
>  - add flag to control vectorization of if-statements
>
> osprey/common/com/opcode_gen_core.h
>
>  - add the OPR_BLEND operation and its opcode.
>
>  - add opcode for vectorized version of OPR_EQ.
>
> osprey/common/com/opcode_gen_core.cxx
>
>  - specify number of kids, desc, rtype, property(expression), etc. for 
> OPR_BLEND.
>
> osprey/common/com/wn.cxx
>
>  - enable WN_has_side_effects for opr_blend
>
> osprey/be/opt/opt_bdce.cxx
>
>  - propagate live bits down the expression tree.
>
> osprey/be/cg/whirl2ops.cxx
>
>  - expand expression containing OPR_BLEND
>
>  - add handler for blend.
>
> osprey/be/cg/cgexp_internals.h
>
>  - add declaration of Expand_Blend
>
> osprey/be/cg/x8664/expand.cxx
>
>  - expand OPC_BLEND to expression containing TNs
>
> osprey/be/com/x8664/betarget.cxx
>
>  - convert opcode to TOP... (return top_blend...)
>
> osprey/common/com/wn_util.h
>
> osprey/common/com/wn_util.cxx
>
>  - add utility routine.
>
>
>
> Thanks.
>
> Pallavi
>
> ----------------------------------------------------------------------
> -------- EditLive Enterprise is the world's most technically advanced 
> content authoring tool. Experience the power of Track Changes, Inline 
> Image Editing and ensure content is compliant with Accessibility 
> Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>



------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to