mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILOptimizer: Fix speculative devirtualizer with dynamic Self
The testcase exercises this when run with check-swift-optimized.
This commit is contained in:
@@ -95,6 +95,9 @@ static FullApplySite speculateMonomorphicTarget(FullApplySite AI,
|
||||
if (!canDevirtualizeClassMethod(AI, SubType))
|
||||
return FullApplySite();
|
||||
|
||||
if (SubType.getSwiftRValueType()->hasDynamicSelfType())
|
||||
return FullApplySite();
|
||||
|
||||
// Create a diamond shaped control flow and a checked_cast_branch
|
||||
// instruction that checks the exact type of the object.
|
||||
// This cast selects between two paths: one that calls the slow dynamic
|
||||
|
||||
Reference in New Issue
Block a user