Skip to content

Commit 3df2643

Browse files
author
Joe Shajrawi
authored
Merge pull request #6799 from shajrawi/devirtualize_volatile_fix
[SILOptimizer] Do not devirtualize instructions when dynamic dispatch is required
2 parents a716d40 + f354726 commit 3df2643

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
@@ -565,6 +565,11 @@ bool swift::canDevirtualizeClassMethod(FullApplySite AI,
565565
return false;
566566
}
567567

568+
if (MI->isVolatile()) {
569+
// dynamic dispatch is semantically required, can't devirtualize
570+
return false;
571+
}
572+
568573
// Type of the actual function to be called.
569574
CanSILFunctionType GenCalleeType = F->getLoweredFunctionType();
570575

0 commit comments

Comments
 (0)