Skip to content

Commit 2a19561

Browse files
bors[bot]vext01
andauthored
33: In debug builds, verify the IR after the control point pass. r=ltratt a=vext01 Co-authored-by: Edd Barrett <[email protected]>
2 parents 043c401 + 1b29b69 commit 2a19561

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/lib/Transforms/Yk/ControlPoint.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,14 @@ class YkControlPoint : public ModulePass {
376376
Builder.SetInsertPoint(BB);
377377
Builder.CreateCondBr(NewCtrlPointCallInst, ExitBB, ContBB);
378378

379-
// Generate new control point logic.
379+
#ifndef NDEBUG
380+
// Our pass runs after LLVM normally does its verify pass. In debug builds
381+
// we run it again to check that our pass is generating valid IR.
382+
if (verifyModule(M, &errs())) {
383+
Context.emitError("Control point pass generated invalid IR!");
384+
return false;
385+
}
386+
#endif
380387
return true;
381388
}
382389
};

0 commit comments

Comments
 (0)