if cand/cior is not lowered, sure PRE will be able to do the CSE. What you are seeing is that someone changed the lowering hence eliminated the CSE opportunity, just like your current lowering method Sun
On Wed, Jul 13, 2011 at 12:36 PM, David Coakley <dcoak...@gmail.com> wrote: > I don't think this patch will affect CSE. > > With the patch: > > if (a && b) > > is changed to: > > if (a) > if (b) > > Without the patch: > if (a && b) > > is changed to a bunch of FALSEBR/TRUEBR's. > > The latter case is not handled by the code that does if-conversion later on. > > On Tue, Jul 12, 2011 at 5:44 AM, Sun Chan <sun.c...@gmail.com> wrote: >> I am ok with the changes, except you have not address my original >> question, cand/cior is originally designed to allow CSE of such >> expressions, with your new changes, you gain some, but loose some >> also. How do you allow better heuristics to do one or the other >> Sun >> >> On Tue, Jul 12, 2011 at 8:38 AM, David Coakley <dcoak...@gmail.com> wrote: >>> I don't see a problem with that. I also put the related function >>> wn_is_assign_return in wn.cxx. >>> >>> A revised patch is attached. >>> >>> On Mon, Jul 11, 2011 at 3:11 PM, Ye, Mei <mei...@amd.com> wrote: >>>> Can "wn_is_assign" placed in common/com/wn.cxx? >>>> >>>> -Mei >>>> >>>> -----Original Message----- >>>> From: David Coakley [mailto:dcoak...@gmail.com] >>>> Sent: Monday, July 11, 2011 11:43 AM >>>> To: open64-devel; Sun Chan >>>> Subject: Re: [Open64-devel] revised patch to enable more if-conversion >>>> >>>> I did not receive any feedback on this patch. Did anyone get a chance to >>>> review it? >>>> >>>> On Tue, Jun 21, 2011 at 2:25 PM, David Coakley <dcoak...@gmail.com> wrote: >>>>> The attached patch is a minor revision to a patch that I posted a few >>>>> weeks ago. The code in lower_if() was modified to make it more clear >>>>> when the transformation is applied: >>>>> >>>>> if (Action(LOWER_SHORTCIRCUIT) && >>>>> OPT_Lower_Splitsinglecand && WOPT_Enable_Simple_If_Conv >= 1) >>>>> { >>>>> lower_split_single_cand(tree, actions); >>>>> } >>>>> >>>>> I have added more detail to the description in an attempt to address >>>>> some questions raised by the earlier patch: >>>>> >>>>> Convert: >>>>> if (a && b) >>>>> x = ... >>>>> To: >>>>> if (a) >>>>> if (b) >>>>> x = ... >>>>> To enable more if-conversion. >>>>> >>>>> Without this transformation, WHIRL-lowering creates control flow that >>>>> WOPT-if-conversion can't handle. With this transformation, this now >>>>> looks like any other if-conversion opportunity to WOPT. >>>>> So this transformation enables more if-conversion (i.e. replace branch >>>>> with conditional move). >>>>> >>>>> The transformation is enabled when the internal flag >>>>> OPT_Lower_Splitsinglecand is on (the default) and when if-conversion >>>>> is enabled in WOPT. It is applied when the action flag >>>>> LOWER_SHORTCIRCUIT is set (mainopt phase). >>>>> >>>>> As part of the transformation, all profile info is updated to be >>>>> consistent: in-edge weights equal out-edge weights, all new edges have >>>>> weights, overall incoming/outgoing frequency to the original node does >>>>> not change, and the frequency of "if a && b" >>>>> is true is equal to the frequency of "if a/if b" is true. >>>>> >>>>> >>>>> Sun and others, please let me know if it looks ok. >>>>> >>>>> -David Coakley / AMD Open Source Compiler Engineering >>>>> >>>> >>>> >>> >> > ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel