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

Gerolf Hoflehner via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 10 19:51:21 PDT 2015


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



More information about the llvm-dev mailing list