OSDN Git Service

[RuntimeUnrolling] Add logic for loops with multiple exit blocks
authorAnna Thomas <anna@azul.com>
Fri, 30 Jun 2017 17:57:07 +0000 (17:57 +0000)
committerAnna Thomas <anna@azul.com>
Fri, 30 Jun 2017 17:57:07 +0000 (17:57 +0000)
commitf6b4a0347c0d944c03d42c835693e5f1f369426f
treebb776be5538b62d10974a8322bec1af3a10a7251
parentdc482f3f63c835384e8c2a9ed9af95310b74747e
[RuntimeUnrolling] Add logic for loops with multiple exit blocks

Summary:
Runtime unrolling is done for loops with a single exit block and a
single exiting block (and this exiting block should be the latch block).
This patch adds logic to support unrolling in the presence of multiple exit
blocks (which also means multiple exiting blocks).
Currently this is under an off-by-default option and is supported when
epilog code is generated. Support in presence of prolog code will be in
a future patch (we just need to add more tests, and update comments).

This patch is essentially an implementation patch. I have not added any
heuristic (in terms of branches added or code size) to decide when
this should be enabled.

Reviewers: mkuper, sanjoy, reames, evstupac

Reviewed by: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306846 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LoopUnrollRuntime.cpp
test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll [new file with mode: 0644]