[LLVMdev] Separate loop condition and loop body
Trevor Harmon
trevor.w.harmon at nasa.gov
Mon May 10 13:44:53 PDT 2010
On May 10, 2010, at 11:05 AM, Trevor Harmon wrote:
>>> To me it looks like any basic block from the loop body with a
>>> successor not in the loop body is a BB "building the condition" (an
>>> "exit" block).
>>
>> I assume you mean "any basic block from the loop header".
>
> No really, loop body.
In that case, what does it mean for a block to be "from" the loop body?
Perhaps you meant "of" or "in" the loop body, but then I'm still
confused. Consider break statements (CFG attached):
while (j < 10 && j > 5 && j % 2 == 0) {
j++;
if (j == 9)
break;
}
In this example, block bb is in the loop body, has a successor not in
the loop body, but is not building the condition. This appears to be a
violation of your rule.
Trevor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cfg._Z6simplei.dot
Type: application/octet-stream
Size: 2180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100510/6b17f2c6/attachment.obj>
-------------- next part --------------
More information about the llvm-dev
mailing list