[llvm-branch-commits] [llvm-branch] r341048 - Merging r340900:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 30 02:34:31 PDT 2018


Author: hans
Date: Thu Aug 30 02:34:31 2018
New Revision: 341048

URL: http://llvm.org/viewvc/llvm-project?rev=341048&view=rev
Log:
Merging r340900:
------------------------------------------------------------------------
r340900 | hans | 2018-08-29 08:55:27 +0200 (Wed, 29 Aug 2018) | 6 lines

LoopSink: Don't sink into blocks without an insertion point (PR38462)

In the PR, LoopSink was trying to sink into a catchswitch block, which
doesn't have a valid insertion point.

Differential Revision: https://reviews.llvm.org/D51307
------------------------------------------------------------------------

Added:
    llvm/branches/release_70/test/Transforms/LICM/loopsink-pr38462.ll
      - copied unchanged from r340900, llvm/trunk/test/Transforms/LICM/loopsink-pr38462.ll
Modified:
    llvm/branches/release_70/   (props changed)
    llvm/branches/release_70/lib/Transforms/Scalar/LoopSink.cpp

Propchange: llvm/branches/release_70/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 30 02:34:31 2018
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,338552,338554,338569,338599,338610,338658,338665,338682,338703,338709,338716,338751,338762,338817,338841,338902,338915,338968,339073,339091,339166,339179,339184,339190,339225,339316,339319,339411,339492,339515,339533,339535-339536,339600,339636,339674,339769,339822,339883,339895-339896,339945,340158,340303,340416-340417,340455,340641,340691,340751,340820,340839
+/llvm/trunk:155241,338552,338554,338569,338599,338610,338658,338665,338682,338703,338709,338716,338751,338762,338817,338841,338902,338915,338968,339073,339091,339166,339179,339184,339190,339225,339316,339319,339411,339492,339515,339533,339535-339536,339600,339636,339674,339769,339822,339883,339895-339896,339945,340158,340303,340416-340417,340455,340641,340691,340751,340820,340839,340900

Modified: llvm/branches/release_70/lib/Transforms/Scalar/LoopSink.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_70/lib/Transforms/Scalar/LoopSink.cpp?rev=341048&r1=341047&r2=341048&view=diff
==============================================================================
--- llvm/branches/release_70/lib/Transforms/Scalar/LoopSink.cpp (original)
+++ llvm/branches/release_70/lib/Transforms/Scalar/LoopSink.cpp Thu Aug 30 02:34:31 2018
@@ -152,6 +152,14 @@ findBBsToSinkInto(const Loop &L, const S
     }
   }
 
+  // Can't sink into blocks that have no valid insertion point.
+  for (BasicBlock *BB : BBsToSinkInto) {
+    if (BB->getFirstInsertionPt() == BB->end()) {
+      BBsToSinkInto.clear();
+      break;
+    }
+  }
+
   // If the total frequency of BBsToSinkInto is larger than preheader frequency,
   // do not sink.
   if (adjustedSumFreq(BBsToSinkInto, BFI) >




More information about the llvm-branch-commits mailing list