Yes, the caller needs to check the function returns a non-NULL value. The meaning of 'Get_nesting_if" is: Get the closest nesting if of "this", if it is non-NULL, also gets whether "this" node is located in a else-path or a then-path. If the returned value is NULL, then "this" node doesn't have a nesting if. So whatever the value of '*is_else" is, it doesn't make difference.
-Mei -----Original Message----- From: Sun Chan [mailto:sun.c...@gmail.com] Sent: Wednesday, April 27, 2011 5:41 PM To: Ye, Mei Cc: Min Zhao; open64-devel@lists.sourceforge.net Subject: Re: [Open64-devel] code review - more proactive loop fusions you are right about the "this" For Get_nesting_if, so you have to check against that in the caller, right? The interface is just awkward. At the minimum, I would assert in the break. My rule of thumb is, anytime one has an unnatural interface, trouble will follow. For example, return NULL means what? If SC_NODE * is Null and *is_else is true, what does that mean?... Sun On Thu, Apr 28, 2011 at 8:22 AM, Ye, Mei <mei...@amd.com> wrote: > Hi Sun, > > Both 'Get_nesting_if' and 'Get_outermost_nesting_if' are desired to return > two values. > If the function returns a non-NULL value, then '*is_else' and '*level' are > not garbages. > If the function returns a NULL value, then '*is_else' and '*level' are > garbages. > Both '*is_else' and '*level' are meaningless unless the function returns a > non-NULL value. > > For "SC_NODE::Last()": I will initialize 'sc_last' to NULL. How can 'this' > be NULL when this member function is called? > > -Mei > > > -----Original Message----- > From: Sun Chan [mailto:sun.c...@gmail.com] > Sent: Wednesday, April 27, 2011 5:08 PM > To: Ye, Mei > Cc: Min Zhao; open64-devel@lists.sourceforge.net > Subject: Re: [Open64-devel] code review - more proactive loop fusions > > function Get_nesting_if, the *is_else could be returning garbage, > similarly for Get_outermost_nesting_if, *level could be returning > garbage. > WOPT convention do not allow "int" types > SC_NODE::Last(), if this is null, sc_last is garbage > I rest my case > Sun > > > On Thu, Apr 28, 2011 at 7:22 AM, Ye, Mei <mei...@amd.com> wrote: >> Hi, >> >> This series of transformations are CFG pre-transformations to enable LNO. >> The name we use is probably a bit misleading. >> >> I added about 30 FmtAsserts for this patch. >> The code is thoroughly tested though all AMD testing suites. >> >> >> -Mei >> >> >> -----Original Message----- >> From: Sun Chan [mailto:sun.c...@gmail.com] >> Sent: Wednesday, April 27, 2011 4:03 PM >> To: Min Zhao >> Cc: Ye, Mei; open64-devel@lists.sourceforge.net >> Subject: Re: [Open64-devel] code review - more proactive loop fusions >> >> Min, >> Don't mean to do this after you have done your part. I have a couple >> of comments. >> Since the transformation is done in WHIRL, why is the code in WOPT? >> Which phase of wopt? >> Also, I hardly see any assertion added? Is the code so thoroughly >> tested that there will never be any unforeseen circumstances? >> I had assumed, wrongly, that loop fusions are done in LNO by >> architectural design. Why is it in wopt now? What is the architectural >> reasoning behind this? >> >> Sun >> >> On Thu, Apr 28, 2011 at 3:02 AM, Min Zhao <mzhao...@gmail.com> wrote: >>> >>> Hi, >>> >>> Your change look OK to me. Since it is a relative big functionality, would >>> you please update at: >>> http://wiki.open64.net/index.php/ActiveDevelopment. It would be good if you >>> have some motivating examples and design doc. >>> >>> Thanks, >>> >>> Min >>> >>> >>> On Mon, Apr 25, 2011 at 5:04 PM, Ye, Mei <mei...@amd.com> wrote: >>>> >>>> Add extended proactive loop optimizations: Hash nested if-compare >>>> expressions to identify loop fusion candidates; Apply if-condition >>>> distribution, if-condition tree height reduction and reversed loop >>>> unswitching to expose if-merging opportunities; Apply if-merging, proactive >>>> loop fusion and loop fusion; Add head/tail duplication of if-regions; Add >>>> bit-expression simplification and dead code removal; Add more utilities >>>> and >>>> debugging flags. >>>> >>>> >>>> >>>> Testing: All AMD test suites. >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> WhatsUp Gold - Download Free Network Management Software >>>> The most intuitive, comprehensive, and cost-effective network >>>> management toolset available today. Delivers lowest initial >>>> acquisition cost and overall TCO of any competing solution. >>>> http://p.sf.net/sfu/whatsupgold-sd >>>> _______________________________________________ >>>> Open64-devel mailing list >>>> Open64-devel@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/open64-devel >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> WhatsUp Gold - Download Free Network Management Software >>> The most intuitive, comprehensive, and cost-effective network >>> management toolset available today. Delivers lowest initial >>> acquisition cost and overall TCO of any competing solution. >>> http://p.sf.net/sfu/whatsupgold-sd >>> _______________________________________________ >>> Open64-devel mailing list >>> Open64-devel@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/open64-devel >>> >>> >> >> >> > > > ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel