I cc'ed gcc-patches by mistake. This is a patch still in progress. Please ignore.
-Sri. On Thu, Dec 15, 2011 at 1:58 PM, <tmsri...@google.com> wrote: > Reviewers: davidxl, > > Message: > I have uploaded a new patch. I did not split the patch into two because > I felt the ifunc dispatch patch does nothing as a standalone. The > framework now will do aggressive cloning and it will mark the clones > specialized for core2 with "-mtune=core2". I have already submitted > another patch that will optimize vectorization for core2. > > I also tested Teresa's RAT stalls avoidance in my MV framework and it > works great. I removed that from the current patch as I thought that > should go in as a separate patch. > > Pending: Test case. > > > On 2011/12/09 07:49:57, davidxl wrote: >> >> It might be better to split this into two patches: > > >> 1) ifunc dispatch patch >> 2) auto cloning patch > > >> The auto cloning framework is good in general, the main problem > > potential >> >> disconnection of early cloning decisions and later transformations. > > >> the logic of deciding if loops are vectorizable is not the same as > > that used in >> >> the actual vectorization pass which can lead to either false positives >> (unnecessary clones) and false negatives (missing clones of > > vectorizable loops). >> >> The false negatives are entirely possible because later > > transformations such as >> >> if-cvt can expose more opportunities. To alleviate the problem, it > > would be >> >> more powerful if the framework allows more aggressive (speculative) > > cloning, and >> >> undo some of the cloning later when they turn out to be not needed. > > This is >> >> possible with some book keeping. > > >> David > > >> http://codereview.appspot.com/5477048/diff/1/config/i386/i386.c >> File config/i386/i386.c (right): > > > > http://codereview.appspot.com/5477048/diff/1/config/i386/i386.c#newcode26331 >> >> config/i386/i386.c:26331: + >> THe --> The. > > > > http://codereview.appspot.com/5477048/diff/1/config/i386/i386.c#newcode26365 >> >> config/i386/i386.c:26365: + tree-vect-stmts.cc. The loop is not > > vectorizable >> >> even if a single stmt is not >> even if? > > > > http://codereview.appspot.com/5477048/diff/1/config/i386/i386.c#newcode26367 >> >> config/i386/i386.c:26367: + >> You need a good explanation here why a common utility function can not > > be used, >> >> but 'duplicate' the check here. > > > > http://codereview.appspot.com/5477048/diff/1/config/i386/i386.c#newcode26524 >> >> config/i386/i386.c:26524: + if (ix86_mv_arch_string >> Using hardcoded target name here is not ideal -- better encode this > > attribute in >> >> the target/processor model array. For now better add a comment here. > > > > http://codereview.appspot.com/5477048/diff/1/config/i386/i386.c#newcode26544 >> >> config/i386/i386.c:26544: + if (*cond_func_decl == NULL) >> Add a small example in the comment here. Also better use a helper > > function. > >> http://codereview.appspot.com/5477048/diff/1/mversn-dispatch.c >> File mversn-dispatch.c (right): > > > > http://codereview.appspot.com/5477048/diff/1/mversn-dispatch.c#newcode2330 >> >> mversn-dispatch.c:2330: static unsigned int do_auto_clone (void) >> Start a new line > > > > http://codereview.appspot.com/5477048/diff/1/mversn-dispatch.c#newcode2371 >> >> mversn-dispatch.c:2371: return 0; >> Fix indentation > > > > http://codereview.appspot.com/5477048/diff/1/mversn-dispatch.c#newcode2404 >> >> mversn-dispatch.c:2404: NULL, fn_ver_addr_chain); >> indentation > > > > http://codereview.appspot.com/5477048/diff/1/mversn-dispatch.c#newcode2412 >> >> mversn-dispatch.c:2412: /* The current function is replaced by a ifunc > > call to >> >> the right version. >> s/a/an/ > > > > http://codereview.appspot.com/5477048/diff/1/mversn-dispatch.c#newcode2424 >> >> mversn-dispatch.c:2424: cond_func_addr, fn_ver_addr_chain, >> Indentation > > > > http://codereview.appspot.com/5477048/diff/1/mversn-dispatch.c#newcode2431 >> >> mversn-dispatch.c:2431: gimple_set_bb (gsi_stmt (gsi), empty_bb); >> Fix indentation. > > > > > > > Please review this at http://codereview.appspot.com/5477048/ > > Affected files: > M config/i386/i386.c > M config/i386/i386.opt > M doc/tm.texi > M doc/tm.texi.in > M mversn-dispatch.c > M params.def > M passes.c > M target.def > M tree-pass.h > >