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

Steve King via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 27 13:49:34 PDT 2015


On Sat, Sep 26, 2015 at 4:38 PM, Sanjoy Das
<sanjoy at playingwithpointers.com> wrote:
>> Do you primarily find this to help for nested loops? If so, that
>> could be because LSR explicitly bails out of processing them:
>>

Hi Sanjoy,
I think the original author of the pass still watches llvm-dev and I'm
hoping he'll comment, but yes, the only cases I've personally
investigated happened to be nested loops.

>> I don't know how much time you're willing to commit to this, but
>> perhaps a more principled fix is to change LSR to actually work with
>> nested loops?

Time commitment aside, it would be interesting to try.  As I
understand it, LSR uses a ranking system to find the optimal set of
induction variables.  To extend this for nested loops, the next outer
loop analysis could start with the set of zero-cost exit values from
the inner loop.  Or other ideas?  This probably creates the same
live-range worry as the current LEV proposal.

Two questions please:
1) Does the LLVM community still have an expert on the current LSR
implementation?  I do not see questions about LSR getting
authoritative, or sometimes any, responses.  For example, the recent
"Problem with LSR" thread.
2) Do you agree LSR has problems to fix before attempting to extend to
nested loops?  The cost analysis algorithm produces incorrect results
(and fatter code) for even simple loops.  IIRC, you've pointed out LSR
problems yourself.

If there is energy out there to improve LSR at its roots, I'd like to chip in.

Regards,
-steve


More information about the llvm-dev mailing list