[LoopUnswitch] Check OptimizeForSize before traversing over all basic blocks in curre...
authorChen Li <meloli87@gmail.com>
Thu, 13 Aug 2015 05:24:29 +0000 (05:24 +0000)
committerChen Li <meloli87@gmail.com>
Thu, 13 Aug 2015 05:24:29 +0000 (05:24 +0000)
commit785c5129429c87278237cc4958e2010a574913b8
tree7c831fd9c11b1fd8506dad6ef123efbd0b5b55ce
parent5689f67ef75ea0b927e0bb3c3cda9078e9bf100f
[LoopUnswitch] Check OptimizeForSize before traversing over all basic blocks in current loop

Summary: This patch moves the check of OptimizeForSize before traversing over all basic blocks in current loop. If OptimizeForSize is set to true, no non-trivial unswitch is ever allowed. Therefore, the early exit will help reduce compilation time. This patch should be NFC.

Reviewers: reames, weimingz, broune

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11997

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244868 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopUnswitch.cpp