Small cleanup of MachineLICM.cpp
authorDaniel Jasper <djasper@google.com>
Thu, 5 Feb 2015 22:39:46 +0000 (22:39 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 5 Feb 2015 22:39:46 +0000 (22:39 +0000)
commitc7c2518a65a907fafe0197aad1b5b3e4962729cd
tree1411ea51d832d7b965e611dc9ed2d39cbbd1f6a7
parentff7b5e9dda22a9b17562fb8582b08df9714addcb
Small cleanup of MachineLICM.cpp

Specifically:
- Calculate the loop pre-header once at the stat of HoistOutOfLoop, so:
  - We don't-DFS walk the MachineDomTree if we aren't going to do anything
  - Don't call getCurPreheader for each Scope
- Don't needlessly use a do-while loop
- Use early exit for Scopes.size() == 0

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228350 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineLICM.cpp