[llvm] r322685 - AMDGPU: Error in SIAnnotateControlFlow instead of assert

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 08:30:01 PST 2018


Author: arsenm
Date: Wed Jan 17 08:30:01 2018
New Revision: 322685

URL: http://llvm.org/viewvc/llvm-project?rev=322685&view=rev
Log:
AMDGPU: Error in SIAnnotateControlFlow instead of assert

This assert typically happens if an unstructured CFG is passed
to the pass. This can happen if the pass is run independently
without the structurizer.

Modified:
    llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp?rev=322685&r1=322684&r2=322685&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp Wed Jan 17 08:30:01 2018
@@ -422,7 +422,11 @@ bool SIAnnotateControlFlow::runOnFunctio
     openIf(Term);
   }
 
-  assert(Stack.empty());
+  if (!Stack.empty()) {
+    // CFG was probably not structured.
+    report_fatal_error("failed to annotate CFG");
+  }
+
   return true;
 }
 




More information about the llvm-commits mailing list