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.
This commit is contained in:
Andrew Trick
2021-02-23 16:14:07 -08:00
parent ca0d189348
commit b908b9fe04

View File

@@ -888,7 +888,11 @@ void EagerSpecializerTransform::run() {
// removed.
for (auto *SA : attrsToRemove)
F.removeSpecializeAttr(SA);
F.verify();
// If any specializations were created, reverify the original body now that it
// has checks.
if (!newFunctions.empty())
F.verify();
for (SILFunction *newF : newFunctions) {
addFunctionToPassManagerWorklist(newF, nullptr);