Index: lib/Target/AMDGPU/SIAnnotateControlFlow.cpp =================================================================== --- lib/Target/AMDGPU/SIAnnotateControlFlow.cpp +++ lib/Target/AMDGPU/SIAnnotateControlFlow.cpp @@ -422,7 +422,11 @@ openIf(Term); } - assert(Stack.empty()); + if (!Stack.empty()) { + // CFG was probably not structured. + report_fatal_error("failed to annotate CFG"); + } + return true; }