[llvm] r321805 - Add assertion on DT availability during LI update in UpdateAnalysisInformation

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 09:21:16 PST 2018


Author: annat
Date: Thu Jan  4 09:21:15 2018
New Revision: 321805

URL: http://llvm.org/viewvc/llvm-project?rev=321805&view=rev
Log:
Add assertion on DT availability during LI update in UpdateAnalysisInformation

This came up during discussions in llvm-commits for
rL321653: Check for unreachable preds before updating LI in
UpdateAnalysisInformation

The assert provides hints to passes to require both DT and LI if we plan on
updating LI through this function.

Tests run: make check

Modified:
    llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp

Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=321805&r1=321804&r2=321805&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Thu Jan  4 09:21:15 2018
@@ -316,6 +316,7 @@ static void UpdateAnalysisInformation(Ba
   if (!LI)
     return;
 
+  assert(DT && "DT should be available to update LoopInfo!");
   Loop *L = LI->getLoopFor(OldBB);
 
   // If we need to preserve loop analyses, collect some information about how




More information about the llvm-commits mailing list