aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2021-06-10 13:36:14 -0700
committerPhilip Reames <listmail@philipreames.com>2021-06-10 13:37:32 -0700
commit7629b2a09c169bfd7f7295deb3678f3fa7755eee (patch)
treed54de67671d53c0d022e2635d5142365a3c4bd21 /llvm/lib/Transforms/Utils/LoopUtils.cpp
parent859c924c5fd58865e824b02c8bea40e7cb55456e (diff)
downloadllvm-7629b2a09c169bfd7f7295deb3678f3fa7755eee.zip
llvm-7629b2a09c169bfd7f7295deb3678f3fa7755eee.tar.gz
llvm-7629b2a09c169bfd7f7295deb3678f3fa7755eee.tar.bz2
[LI] Add a cover function for checking if a loop is mustprogress [nfc]
Essentially, the cover function simply combines the loop level check and the function level scope into one call. This simplifies several callers and is (subjectively) less error prone.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 761960f..95ae7db 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -1781,8 +1781,7 @@ Optional<IVConditionInfo> llvm::hasPartialIVCondition(Loop &L,
// We could also allow loops with known trip counts without mustprogress,
// but ScalarEvolution may not be available.
- Info.PathIsNoop &=
- L.getHeader()->getParent()->mustProgress() || hasMustProgress(&L);
+ Info.PathIsNoop &= isMustProgress(&L);
// If the path is considered a no-op so far, check if it reaches a
// single exit block without any phis. This ensures no values from the