Fix for PR10293

Benjamin Kramer benny.kra at gmail.com
Sun May 5 03:06:25 PDT 2013


On 04.05.2013, at 14:00, Michele Scandale <michele.scandale at gmail.com> wrote:

> Hi everybody,
> 
> here I propose a patch for PR 10293, related to loop rotate and missing hoisting of loop invariant code.
> 
> http://llvm.org/bugs/show_bug.cgi?id=10293
> 
> For the case listed in the bug report the proposed solution solve the problem because the loop rotation is performed instead of latch simplification, making the block that contains the instruction the new loop header. This condition allows to hoist the 'load' instruction because now it dominates all the exit blocks so is guaranteed to be executed.
> 
> The patch postpones the call to 'simplifyLoopLatch' after the effective loop-rotation to handle those cases where the rotation may fail.

I believe that this was intentionally chose because simplifyLoopLatch can improve the analyzability of a loop without introducing the duplication regular loop rotation does. Maybe Andy has an opinion here.

This also needs a test case.

- Ben



More information about the llvm-commits mailing list