[K/N] Fix inlining of property setters by replacing ReturnsInsertion lowering

This commit is contained in:
Elena Lepilkina
2021-05-26 16:34:42 +03:00
committed by Space
parent 3387615d4a
commit b6f35ac44d
3 changed files with 9 additions and 8 deletions
@@ -376,13 +376,6 @@ internal val autoboxPhase = makeKonanFileLoweringPhase(
prerequisite = setOf(bridgesPhase, coroutinesPhase)
)
internal val returnsInsertionPhase = makeKonanFileLoweringPhase(
::ReturnsInsertionLowering,
name = "ReturnsInsertion",
description = "Returns insertion for Unit functions",
prerequisite = setOf(autoboxPhase, coroutinesPhase, enumClassPhase)
)
internal val ifNullExpressionsFusionPhase = makeKonanFileLoweringPhase(
::IfNullExpressionsFusionLowering,
name = "IfNullExpressionsFusionLowering",
@@ -231,7 +231,6 @@ internal val allLoweringsPhase = NamedCompilerPhase(
typeOperatorPhase,
bridgesPhase,
autoboxPhase,
returnsInsertionPhase,
)
),
actions = setOf(defaultDumper, ::moduleValidationCallback)
@@ -379,6 +378,7 @@ internal val bitcodePhase = NamedCompilerPhase(
generateDebugInfoHeaderPhase then
propertyAccessorInlinePhase then // Have to run after link dependencies phase, because fields
// from dependencies can be changed during lowerings.
returnsInsertionPhase then
escapeAnalysisPhase then
localEscapeAnalysisPhase then
codegenPhase then
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.backend.common.phaser.namedUnitPhase
import org.jetbrains.kotlin.backend.konan.*
import org.jetbrains.kotlin.backend.konan.descriptors.GlobalHierarchyAnalysis
import org.jetbrains.kotlin.backend.konan.lower.RedundantCoercionsCleaner
import org.jetbrains.kotlin.backend.konan.lower.ReturnsInsertionLowering
import org.jetbrains.kotlin.backend.konan.optimizations.*
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
@@ -108,6 +109,13 @@ internal val buildDFGPhase = makeKonanModuleOpPhase(
}
)
internal val returnsInsertionPhase = makeKonanModuleOpPhase(
name = "ReturnsInsertion",
description = "Returns insertion for Unit functions",
prerequisite = setOf(autoboxPhase, coroutinesPhase, enumClassPhase),
op = { context, irModule -> irModule.files.forEach { ReturnsInsertionLowering(context).lower(it) } }
)
internal val devirtualizationPhase = makeKonanModuleOpPhase(
name = "Devirtualization",
description = "Devirtualization",