[K/Wasm] Optimize range checks
This commit is contained in:
@@ -115,6 +115,12 @@ private val lateinitUsageLoweringPhase = makeWasmModulePhase(
|
||||
description = "Insert checks for lateinit field references"
|
||||
)
|
||||
|
||||
private val rangeContainsLoweringPhase = makeWasmModulePhase(
|
||||
::RangeContainsLowering,
|
||||
name = "RangeContainsLowering",
|
||||
description = "[Optimization] Optimizes calls to contains() for ClosedRanges"
|
||||
)
|
||||
|
||||
private val arrayConstructorReferencePhase = makeWasmModulePhase(
|
||||
::WasmArrayConstructorReferenceLowering,
|
||||
name = "ArrayConstructorReference",
|
||||
@@ -637,6 +643,7 @@ val wasmPhases = SameTypeNamedCompilerPhase(
|
||||
lateinitNullableFieldsPhase then
|
||||
lateinitDeclarationLoweringPhase then
|
||||
lateinitUsageLoweringPhase then
|
||||
rangeContainsLoweringPhase then
|
||||
arrayConstructorReferencePhase then
|
||||
arrayConstructorPhase then
|
||||
sharedVariablesLoweringPhase then
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// TARGET_BACKEND: WASM
|
||||
|
||||
// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 48_430
|
||||
// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 40_730
|
||||
// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 4_552
|
||||
|
||||
fun box(): String {
|
||||
|
||||
Reference in New Issue
Block a user