]> granicus.if.org Git - llvm/commit
[LoopUnroll] Don't try to unroll non canonical loops.
authorDavide Italiano <davide@freebsd.org>
Mon, 24 Apr 2017 20:14:11 +0000 (20:14 +0000)
committerDavide Italiano <davide@freebsd.org>
Mon, 24 Apr 2017 20:14:11 +0000 (20:14 +0000)
commiteb3134a13b6bc83745c9da378ac5bbdbdf4f6ddb
tree9a40332924aed62731aefa20fd57c4bd504e2910
parentcf003d753fe4788e13fd70e98b40c48300669f3f
[LoopUnroll] Don't try to unroll non canonical loops.

The current Loop Unroll implementation works with loops having a
single latch that contains a conditional branch to a block outside
the loop (the other successor is, by defition of latch, the header).
If this precondition doesn't hold, avoid unrolling the loop as
the code is not ready to handle such circumstances.

Differential Revision:  https://reviews.llvm.org/D32261

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301239 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LoopUnroll.cpp
test/Transforms/LoopUnroll/not-rotated.ll [new file with mode: 0644]