Skip to content

Commit 038dc3b

Browse files
committed
metatype_inst with a concrete, non-generic type can be considered a constant for the purposes of the pure invocations checks
1 parent 9522372 commit 038dc3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SILOptimizer/Utils/PerformanceInlinerUtils.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ static bool isConstantValue(SILValue V) {
756756
}
757757
return true;
758758
}
759+
if (auto *MT = dyn_cast<MetatypeInst>(V)) {
760+
if (!MT->getType().hasArchetype())
761+
return true;
762+
}
759763
return false;
760764
}
761765

0 commit comments

Comments
 (0)