[LoopDeletion] Simplify. NFC
authorFangrui Song <i@maskray.me>
Tue, 14 Feb 2023 06:49:09 +0000 (22:49 -0800)
committerFangrui Song <i@maskray.me>
Tue, 14 Feb 2023 06:49:09 +0000 (22:49 -0800)
llvm/lib/Transforms/Scalar/LoopDeletion.cpp

index 7e4dbac..42fc69a 100644 (file)
@@ -73,7 +73,7 @@ static bool isLoopDead(Loop *L, ScalarEvolution &SE,
   // of the loop.
   bool AllEntriesInvariant = true;
   bool AllOutgoingValuesSame = true;
-  if (!L->hasNoExitBlocks()) {
+  if (ExitBlock) {
     for (PHINode &P : ExitBlock->phis()) {
       Value *incoming = P.getIncomingValueForBlock(ExitingBlocks[0]);