[llvm-dev] [RFC] New pass: LoopExitValues

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Fri Sep 11 10:06:53 PDT 2015


Hi Steve,

I believe that others have been looking recently at a very similar set of problems. For example, Wei Mi posted this patch:

  http://reviews.llvm.org/D12090

and I wonder if this would also address your use cases. If not, I think we'd like to understand why. Also, if these redundant expressions involve induction variables, then that's something that the IndVarSimplify is already supposed to do, and if it is missing cases, then we should improve that pass (and, thus, folding what you've done into IndVarSimplify might be the right way to go).

 -Hal

----- Original Message -----
> From: "Gerolf Hoflehner via llvm-dev" <llvm-dev at lists.llvm.org>
> To: "Steve King" <steve at metrokings.com>
> Cc: "llvm-dev" <llvm-dev at lists.llvm.org>
> Sent: Thursday, September 10, 2015 9:51:21 PM
> Subject: Re: [llvm-dev] [RFC] New pass: LoopExitValues
> 
> Hi Steve
> 
> it seems the general consensus is that the patch feels like a
> work-around for a problem with LSR (and possibly other loop
> transformations) that introduces redundant instructions. It is
> probably best to file a bug and a few of your test cases.
> 
> Thanks
> Gerolf
> > On Sep 10, 2015, at 4:37 PM, Steve King via llvm-dev
> > <llvm-dev at lists.llvm.org> wrote:
> > 
> > On Thu, Sep 10, 2015 at 3:43 PM, Jake VanAdrighem
> > <jvanadrighem at gmail.com> wrote:
> >> Which cases does this pass handle which aren't otherwise optimized
> >> out by
> >> passes like GlobalValueNumbering or DeadCodeElimination?
> >> 
> > 
> > The case uniquely handled here is one in which a computation after
> > a
> > loop so happens to be redundant with a value left over from loop
> > execution.  At each nesting level of N nested loops, the pass
> > compares
> > computable SCEVs looking for matches.  This sounds specialized to
> > me,
> > but I'm not knowledgeable enough in LLVM's many passes to know
> > which
> > one comes closest to this sort of optimization.  My colleague that
> > originally wrote the pass noted that redundancies found by this
> > pass
> > pop up after loop transforms like LSR.
> > 
> > Previously, I showed examples of the type of optimization performed
> > by
> > this pass -- they're bulky so I won't cut and paste here.  In
> > particular, check out the before-and-after IR example James asked
> > for.
> > 
> > Regards,
> > -steve
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-dev mailing list