Skip to content

Commit 87b9e63

Browse files
authored
Merge pull request #36276 from meg-gupta/disableverify
Verify critical edges only when -sil-verify-all is enabled
2 parents 58a8b75 + 1f89d9f commit 87b9e63

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

lib/SILOptimizer/LoopTransforms/ArrayPropertyOpt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ class SwiftArrayPropertyOptPass : public SILFunctionTransform {
797797
ArrayPropertiesSpecializer(DT, LA, HoistableLoopNest).run();
798798

799799
// Verify that no illegal critical edges were created.
800-
getFunction()->verifyCriticalEdges();
800+
if (getFunction()->getModule().getOptions().VerifyAll)
801+
getFunction()->verifyCriticalEdges();
801802

802803
// We preserve the dominator tree. Let's invalidate everything
803804
// else.

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,8 @@ bool MemoryToRegisters::promoteSingleAllocation(AllocStackInst *alloc,
10321032
bool MemoryToRegisters::run() {
10331033
bool Changed = false;
10341034

1035-
F.verifyCriticalEdges();
1035+
if (F.getModule().getOptions().VerifyAll)
1036+
F.verifyCriticalEdges();
10361037

10371038
// Compute dominator tree node levels for the function.
10381039
DomTreeLevelMap DomTreeLevels;

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3372,7 +3372,9 @@ bool SimplifyCFG::run() {
33723372
if (simplifyBlocks())
33733373
removeUnreachableBlocks(Fn);
33743374
}
3375-
Fn.verifyCriticalEdges();
3375+
3376+
if (Fn.getModule().getOptions().VerifyAll)
3377+
Fn.verifyCriticalEdges();
33763378

33773379
// Canonicalize switch_enum instructions.
33783380
Changed |= canonicalizeSwitchEnums();
@@ -4139,7 +4141,7 @@ class SplitCriticalEdges : public SILFunctionTransform {
41394141
void run() override {
41404142
auto &Fn = *getFunction();
41414143

4142-
if (OnlyNonCondBrEdges)
4144+
if (OnlyNonCondBrEdges && Fn.getModule().getOptions().VerifyAll)
41434145
Fn.verifyCriticalEdges();
41444146

41454147
// Split all critical edges from all or non only cond_br terminators.

lib/SILOptimizer/Utils/CheckedCastBrJumpThreading.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ void CheckedCastBrJumpThreading::optimizeFunction() {
657657
return;
658658

659659
// Second phase: transformation.
660-
Fn->verifyCriticalEdges();
660+
if (Fn->getModule().getOptions().VerifyAll)
661+
Fn->verifyCriticalEdges();
661662

662663
for (Edit *edit : Edits) {
663664
BasicBlockCloner Cloner(edit->CCBBlock);

0 commit comments

Comments
 (0)