Skip to content

Commit f354726

Browse files
author
Joe Shajrawi
committed
[SILOptimizer] Do not devirtualize instructions when dynamic dispatch is required
1 parent dad0526 commit f354726

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/SILOptimizer/Utils/Devirtualize.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ bool swift::canDevirtualizeClassMethod(FullApplySite AI,
561561
return false;
562562
}
563563

564+
if (MI->isVolatile()) {
565+
// dynamic dispatch is semantically required, can't devirtualize
566+
return false;
567+
}
568+
564569
// Type of the actual function to be called.
565570
CanSILFunctionType GenCalleeType = F->getLoweredFunctionType();
566571

0 commit comments

Comments
 (0)