diff options
| author | Philip Reames <listmail@philipreames.com> | 2018-03-29 20:32:15 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2018-03-29 20:32:15 +0000 |
| commit | 5c14ed89f606155089150783fc5e6ddce36c836b (patch) | |
| tree | eab0a629e7ec228f081bcf907fbac38bc8a1e439 /llvm/lib/Transforms | |
| parent | ffb132e74b26213ed3df4378c0de3128d9060aad (diff) | |
| download | bcm5719-llvm-5c14ed89f606155089150783fc5e6ddce36c836b.tar.gz bcm5719-llvm-5c14ed89f606155089150783fc5e6ddce36c836b.zip | |
[NFC][LICM] Rearrange checks to have the cheap bail out first
llvm-svn: 328822
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index ec1f4a7599c..91a30088fa0 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -635,6 +635,12 @@ bool LoopUnswitch::processCurrentLoop() { return true; } + // Do not do non-trivial unswitch while optimizing for size. + // FIXME: Use Function::optForSize(). + if (OptimizeForSize || + loopHeader->getParent()->hasFnAttribute(Attribute::OptimizeForSize)) + return false; + // Run through the instructions in the loop, keeping track of three things: // // - That we do not unswitch loops containing convergent operations, as we @@ -666,12 +672,6 @@ bool LoopUnswitch::processCurrentLoop() { } } - // Do not do non-trivial unswitch while optimizing for size. - // FIXME: Use Function::optForSize(). - if (OptimizeForSize || - loopHeader->getParent()->hasFnAttribute(Attribute::OptimizeForSize)) - return false; - for (IntrinsicInst *Guard : Guards) { Value *LoopCond = FindLIVLoopCondition(Guard->getOperand(0), currentLoop, Changed).first; |

