You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (LB <= UB) {
long i = LB;
do {
S(i);
i++;
} while (LB <= UB);
}
or as
long i = LB;
do {
S(i);
i++;
} while (LB <= UB);
in case we can statically proof that LB <= UB. Polly can do this only for integer constants, but isl can likely proof this information a lot more often. It would be great if isl can provide this information, such that we can avoid code size increase due to the unnecessary condition. The condition likely also hinders loop invariant code motion.
Background: Polly (and LLVM in general) does this rewriting to move branches after the loop body, such that the content of the loop body can be hoisted out of the loop without any control flow branches blocking this hoisting.
The text was updated successfully, but these errors were encountered:
Extended Description
Polly generates in lib/CodeGen/LoopGenerators.cpp:createLoop one of the two loop forms:
// BeforeBB BeforeBB
// | |
// v v
// GuardBB PreHeaderBB
// / | | _____
// __ PreHeaderBB | v / |
// / \ / | HeaderBB latch
// latch HeaderBB | |\ |
// \ / \ / | ------/
// < \ / |
// \ / v
// ExitBB ExitBB
In C, this means a loop:
for (i = LB; i <= UB; i++)
S(i);
is generated either as:
if (LB <= UB) {
long i = LB;
do {
S(i);
i++;
} while (LB <= UB);
}
or as
long i = LB;
do {
S(i);
i++;
} while (LB <= UB);
in case we can statically proof that LB <= UB. Polly can do this only for integer constants, but isl can likely proof this information a lot more often. It would be great if isl can provide this information, such that we can avoid code size increase due to the unnecessary condition. The condition likely also hinders loop invariant code motion.
Background: Polly (and LLVM in general) does this rewriting to move branches after the loop body, such that the content of the loop body can be hoisted out of the loop without any control flow branches blocking this hoisting.
The text was updated successfully, but these errors were encountered: