Skip to content

Commit ad7fed0

Browse files
committed
Eager specilization shouldn't optimize functions with ownership (yet)
1 parent f0eb312 commit ad7fed0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/SILOptimizer/IPO/EagerSpecializer.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,12 @@ void EagerSpecializerTransform::run() {
736736

737737
// Process functions in any order.
738738
for (auto &F : *getModule()) {
739-
if (!F.shouldOptimize()) {
739+
// TODO: we should support ownership here but first we'll have to support
740+
// ownership in GenericFuncSpecializer.
741+
if (!F.shouldOptimize() || F.hasOwnership()) {
740742
LLVM_DEBUG(dbgs() << " Cannot specialize function " << F.getName()
741-
<< " marked to be excluded from optimizations.\n");
743+
<< " because it has ownership or is marked to be "
744+
"excluded from optimizations.\n");
742745
continue;
743746
}
744747
// Only specialize functions in their home module.

0 commit comments

Comments
 (0)