Skip to content

Commit b908b9f

Browse files
committed
EagerSpecializer: only run SIL verification when needed
This was running the SIL verifier in the asserts build unconditionally on every function even if this pass did nothing.
1 parent ca0d189 commit b908b9f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/SILOptimizer/Transforms/EagerSpecializer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,11 @@ void EagerSpecializerTransform::run() {
888888
// removed.
889889
for (auto *SA : attrsToRemove)
890890
F.removeSpecializeAttr(SA);
891-
F.verify();
891+
892+
// If any specializations were created, reverify the original body now that it
893+
// has checks.
894+
if (!newFunctions.empty())
895+
F.verify();
892896

893897
for (SILFunction *newF : newFunctions) {
894898
addFunctionToPassManagerWorklist(newF, nullptr);

0 commit comments

Comments
 (0)