[llvm] r211103 - Fixed jump threading going to infinite loop.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jun 18 05:14:42 PDT 2014


On 18 June 2014 02:23, Dinesh Dwivedi <dinesh.d at samsung.com> wrote:
> Sorry, committed this patch too soon. How about changing comment as follows.

No, that is fine. In llvm the code review process does continue after commit.

>   // Remove unreachable blocks from function as they may result in infinite loop
>   // We do threading if we found something profitable. But there may be two or
>   // more conflicting cases where both are profitable and one results in undoing
>   // other. This issue will not come for reachable blocks as we don't jump
>   // thread back edges. Unreachable blocks having cycle with no back edge may
>   // result in infinite loop.
>   removeUnreachableBlocks(F);

Close. I wouldn't call the optimizations conflicting since they don't
exist at the same time. It is just that jump threading a branch can
create another opportunity. If the blocks for a cycle, we would loop
forever, except that we avoid that by looking at back edges. The
problem with unreachable code is that there will be a loop, but not
back edge.

Cheers,
Rafael



More information about the llvm-commits mailing list