[llvm] r372723 - [ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 03:58:42 PDT 2019


Author: rksimon
Date: Tue Sep 24 03:58:42 2019
New Revision: 372723

URL: http://llvm.org/viewvc/llvm-project?rev=372723&view=rev
Log:
[ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Assert that we've found the start of the MI schedule list.

Modified:
    llvm/trunk/lib/CodeGen/ModuloSchedule.cpp

Modified: llvm/trunk/lib/CodeGen/ModuloSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ModuloSchedule.cpp?rev=372723&r1=372722&r2=372723&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ModuloSchedule.cpp (original)
+++ llvm/trunk/lib/CodeGen/ModuloSchedule.cpp Tue Sep 24 03:58:42 2019
@@ -1301,6 +1301,7 @@ void KernelRewriter::rewrite() {
     if (!FirstMI)
       FirstMI = MI;
   }
+  assert(FirstMI && "Failed to find first MI in schedule");
 
   // At this point all of the scheduled instructions are between FirstMI
   // and the end of the block. Kill from the first non-phi to FirstMI.




More information about the llvm-commits mailing list