From bd19dd39c70184adcb922ba3a18de505ce104b21 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 7 Mar 2024 12:08:46 -0500 Subject: [PATCH 1/9] Optimize `[for n in start..finish -> n]`, etc. --- src/Compiler/CodeGen/IlxGen.fs | 3 +- .../Optimize/LowerComputedCollections.fs | 94 +- .../Optimize/LowerComputedCollections.fsi | 8 +- .../ComputedCollections.fs | 10 + .../ComputedCollections/ForNInRangeArrays.fs | 27 + .../ForNInRangeArrays.fs.il.bsl | 2024 +++++++++++++++++ .../ComputedCollections/ForNInRangeLists.fs | 27 + .../ForNInRangeLists.fs.il.bsl | 1751 ++++++++++++++ .../GeneratedIterators/GenIter01.fs.il.bsl | 91 +- .../GeneratedIterators/GenIter03.fs.il.bsl | 91 +- ...nIter04_RealInternalSignatureOff.fs.il.bsl | 94 +- ...enIter04_RealInternalSignatureOn.fs.il.bsl | 90 +- .../GeneratedIterators/GeneratedIterators.fs | 1 + 13 files changed, 4063 insertions(+), 248 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 976bba1c82f..5c174ecf9de 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -2920,7 +2920,8 @@ and GenExprPreSteps (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr sequel = let lowering = if compileSequenceExpressions then - LowerComputedCollectionExpressions.LowerComputedListOrArrayExpr cenv.tcVal g cenv.amap expr + let ilTyForTy ty = GenType cenv expr.Range eenv.tyenv ty + LowerComputedCollectionExpressions.LowerComputedListOrArrayExpr cenv.tcVal g cenv.amap ilTyForTy expr else None diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 7ceff0a676c..d048157d96a 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -258,7 +258,7 @@ let (|SeqToArray|_|) g expr = module List = /// Makes an expression that will build a list from an integral range. - let mkFromIntegralRange tcVal (g: TcGlobals) amap m overallElemTy overallSeqExpr start step finish = + let mkFromIntegralRange tcVal (g: TcGlobals) amap m rangeTy overallElemTy rangeExpr start step finish body = let collectorTy = g.mk_ListCollector_ty overallElemTy /// let collector = ListCollector () in @@ -267,7 +267,16 @@ module List = let mkListInit mkLoop = mkCompGenLetMutableIn m "collector" collectorTy (mkDefault (m, collectorTy)) (fun (_, collector) -> let reader = InfoReader (g, amap) - let loop = mkLoop (fun _idxVar loopVar -> mkCallCollectorAdd tcVal g reader m collector loopVar) + + let loop = + mkLoop (fun _idxVar loopVar -> + let body = + body + |> Option.map (fun (loopVal, body) -> mkInvisibleLet m loopVal loopVar body) + |> Option.defaultValue loopVar + + mkCallCollectorAdd tcVal g reader m collector body) + let close = mkCallCollectorClose tcVal g reader m collector mkSequential m loop close ) @@ -275,7 +284,7 @@ module List = mkOptimizedRangeLoop g (m, m, m, DebugPointAtWhile.No) - (overallElemTy, overallSeqExpr) + (rangeTy, rangeExpr) (start, step, finish) (fun count mkLoop -> match count with @@ -301,7 +310,7 @@ module Array = | NoCheckOvf /// Makes an expression that will build an array from an integral range. - let mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish = + let mkFromIntegralRange g m rangeTy ilTy overallElemTy rangeExpr start step finish body = let arrayTy = mkArrayType g overallElemTy let convToNativeInt ovf expr = @@ -324,21 +333,21 @@ module Array = else expr - let ilTy, ilBasicTy = - let ty = stripMeasuresFromTy g overallElemTy - - if typeEquiv g ty g.int32_ty then g.ilg.typ_Int32, DT_I4 - elif typeEquiv g ty g.int64_ty then g.ilg.typ_Int64, DT_I8 - elif typeEquiv g ty g.uint64_ty then g.ilg.typ_UInt64, DT_U8 - elif typeEquiv g ty g.uint32_ty then g.ilg.typ_UInt32, DT_U4 - elif typeEquiv g ty g.nativeint_ty then g.ilg.typ_IntPtr, DT_I - elif typeEquiv g ty g.unativeint_ty then g.ilg.typ_UIntPtr, DT_U - elif typeEquiv g ty g.int16_ty then g.ilg.typ_Int16, DT_I2 - elif typeEquiv g ty g.uint16_ty then g.ilg.typ_UInt16, DT_U2 - elif typeEquiv g ty g.sbyte_ty then g.ilg.typ_SByte, DT_I1 - elif typeEquiv g ty g.byte_ty then g.ilg.typ_Byte, DT_U1 - elif typeEquiv g ty g.char_ty then g.ilg.typ_Char, DT_U2 - else error (InternalError ($"Unable to find IL type for integral type '{overallElemTy}'.", m)) + let stelem = + if ilTy = g.ilg.typ_Int32 then I_stelem DT_I4 + elif ilTy = g.ilg.typ_Int64 then I_stelem DT_I8 + elif ilTy = g.ilg.typ_UInt64 then I_stelem DT_U8 + elif ilTy = g.ilg.typ_UInt32 then I_stelem DT_U4 + elif ilTy = g.ilg.typ_IntPtr then I_stelem DT_I + elif ilTy = g.ilg.typ_UIntPtr then I_stelem DT_U + elif ilTy = g.ilg.typ_Int16 then I_stelem DT_I2 + elif ilTy = g.ilg.typ_UInt16 then I_stelem DT_U2 + elif ilTy = g.ilg.typ_SByte then I_stelem DT_I1 + elif ilTy = g.ilg.typ_Byte then I_stelem DT_U1 + elif ilTy = g.ilg.typ_Char then I_stelem DT_U2 + elif ilTy = g.ilg.typ_Double then I_stelem DT_R8 + elif ilTy = g.ilg.typ_Single then I_stelem DT_R4 + else I_stelem_any (ILArrayShape.SingleDimensional, ilTy) /// (# "newarr !0" type ('T) count : 'T array #) let mkNewArray count = @@ -356,13 +365,20 @@ module Array = /// array let mkArrayInit count mkLoop = mkCompGenLetIn m "array" arrayTy (mkNewArray count) (fun (_, array) -> - let loop = mkLoop (fun idxVar loopVar -> mkAsmExpr ([I_stelem ilBasicTy], [], [array; convToNativeInt NoCheckOvf idxVar; loopVar], [], m)) + let loop = mkLoop (fun idxVar loopVar -> + let body = + body + |> Option.map (fun (loopVal, body) -> mkInvisibleLet m loopVal loopVar body) + |> Option.defaultValue loopVar + + mkAsmExpr ([stelem], [], [array; convToNativeInt NoCheckOvf idxVar; body], [], m)) + mkSequential m loop array) mkOptimizedRangeLoop g (m, m, m, DebugPointAtWhile.No) - (overallElemTy, overallSeqExpr) + (rangeTy, rangeExpr) (start, step, finish) (fun count mkLoop -> match count with @@ -399,7 +415,15 @@ module Array = ) ) -let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = +/// for … in … -> … +[] +let (|SimpleMapping|_|) g expr = + match expr with + | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_map_vref (([ty1; ty2] | [ty1; _; ty2]), [Expr.Lambda (valParams = [loopVal]; bodyExpr = body) as mapping; input], _))], _) -> + ValueSome (ty1, ty2, input, mapping, loopVal, body) + | _ -> ValueNone + +let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap ilTyForTy overallExpr = // If ListCollector is in FSharp.Core then this optimization kicks in if g.ListCollector_tcr.CanDeref then match overallExpr with @@ -408,8 +432,17 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = match overallSeqExpr with // [start..finish] // [start..step..finish] - | IntegralRange g (_, (start, step, finish)) when g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops -> - Some (List.mkFromIntegralRange tcVal g amap m overallElemTy overallSeqExpr start step finish) + | IntegralRange g (rangeTy, (start, step, finish)) when + g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops + -> + Some (List.mkFromIntegralRange tcVal g amap m rangeTy overallElemTy overallSeqExpr start step finish None) + + // [for … in start..finish -> …] + // [for … in start..step..finish -> …] + | SimpleMapping g (_, _, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), _, loopVal, body) when + g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops + -> + Some (List.mkFromIntegralRange tcVal g amap m rangeTy overallElemTy rangeExpr start step finish (Some (loopVal, body))) // [(* Anything more complex. *)] | _ -> @@ -421,8 +454,17 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = match overallSeqExpr with // [|start..finish|] // [|start..step..finish|] - | IntegralRange g (_, (start, step, finish)) when g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops -> - Some (Array.mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish) + | IntegralRange g (rangeTy, (start, step, finish)) when + g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops + -> + Some (Array.mkFromIntegralRange g m rangeTy (ilTyForTy overallElemTy) overallElemTy overallSeqExpr start step finish None) + + // [|for … in start..finish -> …|] + // [|for … in start..step..finish -> …|] + | SimpleMapping g (_, _, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), _, loopVal, body) when + g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops + -> + Some (Array.mkFromIntegralRange g m rangeTy (ilTyForTy overallElemTy) overallElemTy rangeExpr start step finish (Some (loopVal, body))) // [|(* Anything more complex. *)|] | _ -> diff --git a/src/Compiler/Optimize/LowerComputedCollections.fsi b/src/Compiler/Optimize/LowerComputedCollections.fsi index a1656361776..e504af7e3ec 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fsi +++ b/src/Compiler/Optimize/LowerComputedCollections.fsi @@ -2,9 +2,15 @@ module internal FSharp.Compiler.LowerComputedCollectionExpressions +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.Import open FSharp.Compiler.TcGlobals open FSharp.Compiler.TypedTree val LowerComputedListOrArrayExpr: - tcVal: ConstraintSolver.TcValF -> g: TcGlobals -> amap: ImportMap -> Expr -> Expr option + tcVal: ConstraintSolver.TcValF -> + g: TcGlobals -> + amap: ImportMap -> + ilTyForTy: (TType -> ILType) -> + overallExpr: Expr -> + Expr option diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs index b97d6e164fb..f8fbb00a4e2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs @@ -34,3 +34,13 @@ module ComputedCollections = let ``UInt64RangeLists_fs`` compilation = compilation |> verifyCompilation + + [] + let ``ForNInRangeArrays_fs`` compilation = + compilation + |> verifyCompilation + + [] + let ``ForNInRangeLists_fs`` compilation = + compilation + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs new file mode 100644 index 00000000000..05f54cee6f3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs @@ -0,0 +1,27 @@ +let f0 () = [|for n in 1..10 do System.Console.WriteLine ""; yield n|] +let f00 () = [|for n in 1..10 do System.Console.WriteLine ""; yield n; yield n + 1|] +let f1 () = [|for n in 1..10 -> n|] +let f2 () = [|for n in 10..1 -> n|] +let f3 () = [|for n in 1..1..10 -> n|] +let f4 () = [|for n in 1..2..10 -> n|] +let f5 () = [|for n in 10..1..1 -> n|] +let f6 () = [|for n in 1..-1..10 -> n|] +let f7 () = [|for n in 10..-1..1 -> n|] +let f8 () = [|for n in 10..-2..1 -> n|] +let f9 start = [|for n in start..10 -> n|] +let f10 finish = [|for n in 1..finish -> n|] +let f11 start finish = [|for n in start..finish -> n|] +let f12 start = [|for n in start..1..10 -> n|] +let f13 step = [|for n in 1..step..10 -> n|] +let f14 finish = [|for n in 1..1..finish -> n|] +let f15 start step = [|for n in start..step..10 -> n|] +let f16 start finish = [|for n in start..1..finish -> n|] +let f17 step finish = [|for n in 1..step..finish -> n|] +let f18 start step finish = [|for n in start..step..finish -> n|] +let f19 f = [|for n in f ()..10 -> n|] +let f20 f = [|for n in 1..f () -> n|] +let f21 f g = [|for n in f ()..g() -> n|] +let f22 f = [|for n in f ()..1..10 -> n|] +let f23 f = [|for n in 1..f ()..10 -> n|] +let f24 f = [|for n in 1..1..f () -> n|] +let f25 f g h = [|for n in f ()..g ()..h () -> n|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl new file mode 100644 index 00000000000..373ea3e86c2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl @@ -0,0 +1,2024 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static int32[] f0() cil managed + { + + .maxstack 5 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1 V_0, + class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + class [runtime]System.Collections.Generic.IEnumerable`1 V_2, + int32 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.s 10 + IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_000f: stloc.1 + .try + { + IL_0010: br.s IL_002c + + IL_0012: ldloc.1 + IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0018: stloc.3 + IL_0019: ldstr "" + IL_001e: call void [runtime]System.Console::WriteLine(string) + IL_0023: ldloca.s V_0 + IL_0025: ldloc.3 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloc.1 + IL_002d: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0032: brtrue.s IL_0012 + + IL_0034: ldnull + IL_0035: stloc.2 + IL_0036: leave.s IL_004d + + } + finally + { + IL_0038: ldloc.1 + IL_0039: isinst [runtime]System.IDisposable + IL_003e: stloc.s V_4 + IL_0040: ldloc.s V_4 + IL_0042: brfalse.s IL_004c + + IL_0044: ldloc.s V_4 + IL_0046: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_004b: endfinally + IL_004c: endfinally + } + IL_004d: ldloc.2 + IL_004e: pop + IL_004f: ldloca.s V_0 + IL_0051: call instance !0[] valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Close() + IL_0056: ret + } + + .method public static int32[] f00() cil managed + { + + .maxstack 5 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1 V_0, + class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + class [runtime]System.Collections.Generic.IEnumerable`1 V_2, + int32 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.s 10 + IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_000f: stloc.1 + .try + { + IL_0010: br.s IL_0037 + + IL_0012: ldloc.1 + IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0018: stloc.3 + IL_0019: ldstr "" + IL_001e: call void [runtime]System.Console::WriteLine(string) + IL_0023: ldloca.s V_0 + IL_0025: ldloc.3 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloca.s V_0 + IL_002e: ldloc.3 + IL_002f: ldc.i4.1 + IL_0030: add + IL_0031: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) + IL_0036: nop + IL_0037: ldloc.1 + IL_0038: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_003d: brtrue.s IL_0012 + + IL_003f: ldnull + IL_0040: stloc.2 + IL_0041: leave.s IL_0058 + + } + finally + { + IL_0043: ldloc.1 + IL_0044: isinst [runtime]System.IDisposable + IL_0049: stloc.s V_4 + IL_004b: ldloc.s V_4 + IL_004d: brfalse.s IL_0057 + + IL_004f: ldloc.s V_4 + IL_0051: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0056: endfinally + IL_0057: endfinally + } + IL_0058: ldloc.2 + IL_0059: pop + IL_005a: ldloca.s V_0 + IL_005c: call instance !0[] valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Close() + IL_0061: ret + } + + .method public static int32[] f1() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_0021 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stloc.3 + IL_0016: ldloc.3 + IL_0017: stelem.i4 + IL_0018: ldloc.2 + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: ldc.i4.s 10 + IL_0024: conv.i8 + IL_0025: blt.un.s IL_0011 + + IL_0027: ldloc.0 + IL_0028: ret + } + + .method public static int32[] f2() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static int32[] f3() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_0021 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stloc.3 + IL_0016: ldloc.3 + IL_0017: stelem.i4 + IL_0018: ldloc.2 + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: ldc.i4.s 10 + IL_0024: conv.i8 + IL_0025: blt.un.s IL_0011 + + IL_0027: ldloc.0 + IL_0028: ret + } + + .method public static int32[] f4() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.5 + IL_0001: conv.i8 + IL_0002: conv.ovf.i.un + IL_0003: newarr [runtime]System.Int32 + IL_0008: stloc.0 + IL_0009: ldc.i4.0 + IL_000a: conv.i8 + IL_000b: stloc.1 + IL_000c: ldc.i4.1 + IL_000d: stloc.2 + IL_000e: br.s IL_0020 + + IL_0010: ldloc.0 + IL_0011: ldloc.1 + IL_0012: conv.i + IL_0013: ldloc.2 + IL_0014: stloc.3 + IL_0015: ldloc.3 + IL_0016: stelem.i4 + IL_0017: ldloc.2 + IL_0018: ldc.i4.2 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldc.i4.5 + IL_0022: conv.i8 + IL_0023: blt.un.s IL_0010 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static int32[] f5() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static int32[] f6() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static int32[] f7() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.s 10 + IL_000f: stloc.2 + IL_0010: br.s IL_0022 + + IL_0012: ldloc.0 + IL_0013: ldloc.1 + IL_0014: conv.i + IL_0015: ldloc.2 + IL_0016: stloc.3 + IL_0017: ldloc.3 + IL_0018: stelem.i4 + IL_0019: ldloc.2 + IL_001a: ldc.i4.m1 + IL_001b: add + IL_001c: stloc.2 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: add + IL_0021: stloc.1 + IL_0022: ldloc.1 + IL_0023: ldc.i4.s 10 + IL_0025: conv.i8 + IL_0026: blt.un.s IL_0012 + + IL_0028: ldloc.0 + IL_0029: ret + } + + .method public static int32[] f8() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.5 + IL_0001: conv.i8 + IL_0002: conv.ovf.i.un + IL_0003: newarr [runtime]System.Int32 + IL_0008: stloc.0 + IL_0009: ldc.i4.0 + IL_000a: conv.i8 + IL_000b: stloc.1 + IL_000c: ldc.i4.s 10 + IL_000e: stloc.2 + IL_000f: br.s IL_0022 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stloc.3 + IL_0016: ldloc.3 + IL_0017: stelem.i4 + IL_0018: ldloc.2 + IL_0019: ldc.i4.s -2 + IL_001b: add + IL_001c: stloc.2 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: add + IL_0021: stloc.1 + IL_0022: ldloc.1 + IL_0023: ldc.i4.5 + IL_0024: conv.i8 + IL_0025: blt.un.s IL_0011 + + IL_0027: ldloc.0 + IL_0028: ret + } + + .method public static int32[] f9(int32 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: ldarg.0 + IL_0004: bge.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0014 + + IL_000b: ldc.i4.s 10 + IL_000d: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: stloc.1 + IL_0017: ldloc.1 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: bge.un.s IL_0022 + + IL_001c: call !!0[] [runtime]System.Array::Empty() + IL_0021: ret + + IL_0022: ldloc.1 + IL_0023: conv.ovf.i.un + IL_0024: newarr [runtime]System.Int32 + IL_0029: stloc.2 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: ldarg.0 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0047 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stloc.s V_5 + IL_0039: ldloc.s V_5 + IL_003b: stelem.i4 + IL_003c: ldloc.s V_4 + IL_003e: ldc.i4.1 + IL_003f: add + IL_0040: stloc.s V_4 + IL_0042: ldloc.3 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldloc.0 + IL_0049: blt.un.s IL_0032 + + IL_004b: ldloc.2 + IL_004c: ret + } + + .method public static int32[] f10(int32 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldc.i4.1 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0045 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stloc.s V_5 + IL_0037: ldloc.s V_5 + IL_0039: stelem.i4 + IL_003a: ldloc.s V_4 + IL_003c: ldc.i4.1 + IL_003d: add + IL_003e: stloc.s V_4 + IL_0040: ldloc.3 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.3 + IL_0045: ldloc.3 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_0030 + + IL_0049: ldloc.2 + IL_004a: ret + } + + .method public static int32[] f11(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldarg.0 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0045 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stloc.s V_5 + IL_0037: ldloc.s V_5 + IL_0039: stelem.i4 + IL_003a: ldloc.s V_4 + IL_003c: ldc.i4.1 + IL_003d: add + IL_003e: stloc.s V_4 + IL_0040: ldloc.3 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.3 + IL_0045: ldloc.3 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_0030 + + IL_0049: ldloc.2 + IL_004a: ret + } + + .method public static int32[] f12(int32 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: ldarg.0 + IL_0004: bge.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0014 + + IL_000b: ldc.i4.s 10 + IL_000d: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: stloc.1 + IL_0017: ldloc.1 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: bge.un.s IL_0022 + + IL_001c: call !!0[] [runtime]System.Array::Empty() + IL_0021: ret + + IL_0022: ldloc.1 + IL_0023: conv.ovf.i.un + IL_0024: newarr [runtime]System.Int32 + IL_0029: stloc.2 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: ldarg.0 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0047 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stloc.s V_5 + IL_0039: ldloc.s V_5 + IL_003b: stelem.i4 + IL_003c: ldloc.s V_4 + IL_003e: ldc.i4.1 + IL_003f: add + IL_0040: stloc.s V_4 + IL_0042: ldloc.3 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldloc.0 + IL_0049: blt.un.s IL_0032 + + IL_004b: ldloc.2 + IL_004c: ret + } + + .method public static int32[] f13(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.0 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldc.i4.1 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldc.i4.1 + IL_0023: sub + IL_0024: ldarg.0 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldc.i4.1 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldc.i4.1 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.0 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldloc.0 + IL_0047: stloc.1 + IL_0048: ldloc.1 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: bge.un.s IL_0053 + + IL_004d: call !!0[] [runtime]System.Array::Empty() + IL_0052: ret + + IL_0053: ldloc.1 + IL_0054: conv.ovf.i.un + IL_0055: newarr [runtime]System.Int32 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: conv.i8 + IL_005d: stloc.3 + IL_005e: ldc.i4.1 + IL_005f: stloc.s V_4 + IL_0061: br.s IL_0078 + + IL_0063: ldloc.2 + IL_0064: ldloc.3 + IL_0065: conv.i + IL_0066: ldloc.s V_4 + IL_0068: stloc.s V_5 + IL_006a: ldloc.s V_5 + IL_006c: stelem.i4 + IL_006d: ldloc.s V_4 + IL_006f: ldarg.0 + IL_0070: add + IL_0071: stloc.s V_4 + IL_0073: ldloc.3 + IL_0074: ldc.i4.1 + IL_0075: conv.i8 + IL_0076: add + IL_0077: stloc.3 + IL_0078: ldloc.3 + IL_0079: ldloc.0 + IL_007a: blt.un.s IL_0063 + + IL_007c: ldloc.2 + IL_007d: ret + } + + .method public static int32[] f14(int32 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldc.i4.1 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0045 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stloc.s V_5 + IL_0037: ldloc.s V_5 + IL_0039: stelem.i4 + IL_003a: ldloc.s V_4 + IL_003c: ldc.i4.1 + IL_003d: add + IL_003e: stloc.s V_4 + IL_0040: ldloc.3 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.3 + IL_0045: ldloc.3 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_0030 + + IL_0049: ldloc.2 + IL_004a: ret + } + + .method public static int32[] f15(int32 start, + int32 step) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.1 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldarg.0 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldarg.0 + IL_0023: sub + IL_0024: ldarg.1 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldarg.0 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldarg.0 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.1 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldloc.0 + IL_0047: stloc.1 + IL_0048: ldloc.1 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: bge.un.s IL_0053 + + IL_004d: call !!0[] [runtime]System.Array::Empty() + IL_0052: ret + + IL_0053: ldloc.1 + IL_0054: conv.ovf.i.un + IL_0055: newarr [runtime]System.Int32 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: conv.i8 + IL_005d: stloc.3 + IL_005e: ldarg.0 + IL_005f: stloc.s V_4 + IL_0061: br.s IL_0078 + + IL_0063: ldloc.2 + IL_0064: ldloc.3 + IL_0065: conv.i + IL_0066: ldloc.s V_4 + IL_0068: stloc.s V_5 + IL_006a: ldloc.s V_5 + IL_006c: stelem.i4 + IL_006d: ldloc.s V_4 + IL_006f: ldarg.1 + IL_0070: add + IL_0071: stloc.s V_4 + IL_0073: ldloc.3 + IL_0074: ldc.i4.1 + IL_0075: conv.i8 + IL_0076: add + IL_0077: stloc.3 + IL_0078: ldloc.3 + IL_0079: ldloc.0 + IL_007a: blt.un.s IL_0063 + + IL_007c: ldloc.2 + IL_007d: ret + } + + .method public static int32[] f16(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldarg.0 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0045 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stloc.s V_5 + IL_0037: ldloc.s V_5 + IL_0039: stelem.i4 + IL_003a: ldloc.s V_4 + IL_003c: ldc.i4.1 + IL_003d: add + IL_003e: stloc.s V_4 + IL_0040: ldloc.3 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.3 + IL_0045: ldloc.3 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_0030 + + IL_0049: ldloc.2 + IL_004a: ret + } + + .method public static int32[] f17(int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldarg.1 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.1 + IL_0016: ldc.i4.1 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.1 + IL_001f: ldc.i4.1 + IL_0020: sub + IL_0021: ldarg.0 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldc.i4.1 + IL_002b: ldarg.1 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldc.i4.1 + IL_0034: ldarg.1 + IL_0035: sub + IL_0036: ldarg.0 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: bge.un.s IL_004e + + IL_0048: call !!0[] [runtime]System.Array::Empty() + IL_004d: ret + + IL_004e: ldloc.1 + IL_004f: conv.ovf.i.un + IL_0050: newarr [runtime]System.Int32 + IL_0055: stloc.2 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.3 + IL_0059: ldc.i4.1 + IL_005a: stloc.s V_4 + IL_005c: br.s IL_0073 + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stloc.s V_5 + IL_0065: ldloc.s V_5 + IL_0067: stelem.i4 + IL_0068: ldloc.s V_4 + IL_006a: ldarg.0 + IL_006b: add + IL_006c: stloc.s V_4 + IL_006e: ldloc.3 + IL_006f: ldc.i4.1 + IL_0070: conv.i8 + IL_0071: add + IL_0072: stloc.3 + IL_0073: ldloc.3 + IL_0074: ldloc.0 + IL_0075: blt.un.s IL_005e + + IL_0077: ldloc.2 + IL_0078: ret + } + + .method public static int32[] f18(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: bge.un.s IL_004e + + IL_0048: call !!0[] [runtime]System.Array::Empty() + IL_004d: ret + + IL_004e: ldloc.1 + IL_004f: conv.ovf.i.un + IL_0050: newarr [runtime]System.Int32 + IL_0055: stloc.2 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.3 + IL_0059: ldarg.0 + IL_005a: stloc.s V_4 + IL_005c: br.s IL_0073 + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stloc.s V_5 + IL_0065: ldloc.s V_5 + IL_0067: stelem.i4 + IL_0068: ldloc.s V_4 + IL_006a: ldarg.1 + IL_006b: add + IL_006c: stloc.s V_4 + IL_006e: ldloc.3 + IL_006f: ldc.i4.1 + IL_0070: conv.i8 + IL_0071: add + IL_0072: stloc.3 + IL_0073: ldloc.3 + IL_0074: ldloc.0 + IL_0075: blt.un.s IL_005e + + IL_0077: ldloc.2 + IL_0078: ret + } + + .method public static int32[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldloc.1 + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: bge.un.s IL_0029 + + IL_0023: call !!0[] [runtime]System.Array::Empty() + IL_0028: ret + + IL_0029: ldloc.2 + IL_002a: conv.ovf.i.un + IL_002b: newarr [runtime]System.Int32 + IL_0030: stloc.3 + IL_0031: ldc.i4.0 + IL_0032: conv.i8 + IL_0033: stloc.s V_4 + IL_0035: ldloc.0 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_0052 + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stloc.s V_6 + IL_0042: ldloc.s V_6 + IL_0044: stelem.i4 + IL_0045: ldloc.s V_5 + IL_0047: ldc.i4.1 + IL_0048: add + IL_0049: stloc.s V_5 + IL_004b: ldloc.s V_4 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: add + IL_0050: stloc.s V_4 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.1 + IL_0055: blt.un.s IL_003a + + IL_0057: ldloc.3 + IL_0058: ret + } + + .method public static int32[] f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: stloc.2 + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: bge.un.s IL_0027 + + IL_0021: call !!0[] [runtime]System.Array::Empty() + IL_0026: ret + + IL_0027: ldloc.2 + IL_0028: conv.ovf.i.un + IL_0029: newarr [runtime]System.Int32 + IL_002e: stloc.3 + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: stloc.s V_4 + IL_0033: ldc.i4.1 + IL_0034: stloc.s V_5 + IL_0036: br.s IL_0050 + + IL_0038: ldloc.3 + IL_0039: ldloc.s V_4 + IL_003b: conv.i + IL_003c: ldloc.s V_5 + IL_003e: stloc.s V_6 + IL_0040: ldloc.s V_6 + IL_0042: stelem.i4 + IL_0043: ldloc.s V_5 + IL_0045: ldc.i4.1 + IL_0046: add + IL_0047: stloc.s V_5 + IL_0049: ldloc.s V_4 + IL_004b: ldc.i4.1 + IL_004c: conv.i8 + IL_004d: add + IL_004e: stloc.s V_4 + IL_0050: ldloc.s V_4 + IL_0052: ldloc.1 + IL_0053: blt.un.s IL_0038 + + IL_0055: ldloc.3 + IL_0056: ret + } + + .method public static int32[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + uint64 V_2, + uint64 V_3, + int32[] V_4, + uint64 V_5, + int32 V_6, + int32 V_7) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldloc.1 + IL_0011: ldloc.0 + IL_0012: bge.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0021 + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: conv.i8 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: nop + IL_0021: stloc.2 + IL_0022: ldloc.2 + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: bge.un.s IL_002f + + IL_0029: call !!0[] [runtime]System.Array::Empty() + IL_002e: ret + + IL_002f: ldloc.3 + IL_0030: conv.ovf.i.un + IL_0031: newarr [runtime]System.Int32 + IL_0036: stloc.s V_4 + IL_0038: ldc.i4.0 + IL_0039: conv.i8 + IL_003a: stloc.s V_5 + IL_003c: ldloc.0 + IL_003d: stloc.s V_6 + IL_003f: br.s IL_005a + + IL_0041: ldloc.s V_4 + IL_0043: ldloc.s V_5 + IL_0045: conv.i + IL_0046: ldloc.s V_6 + IL_0048: stloc.s V_7 + IL_004a: ldloc.s V_7 + IL_004c: stelem.i4 + IL_004d: ldloc.s V_6 + IL_004f: ldc.i4.1 + IL_0050: add + IL_0051: stloc.s V_6 + IL_0053: ldloc.s V_5 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add + IL_0058: stloc.s V_5 + IL_005a: ldloc.s V_5 + IL_005c: ldloc.2 + IL_005d: blt.un.s IL_0041 + + IL_005f: ldloc.s V_4 + IL_0061: ret + } + + .method public static int32[] f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldloc.1 + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: bge.un.s IL_0029 + + IL_0023: call !!0[] [runtime]System.Array::Empty() + IL_0028: ret + + IL_0029: ldloc.2 + IL_002a: conv.ovf.i.un + IL_002b: newarr [runtime]System.Int32 + IL_0030: stloc.3 + IL_0031: ldc.i4.0 + IL_0032: conv.i8 + IL_0033: stloc.s V_4 + IL_0035: ldloc.0 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_0052 + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stloc.s V_6 + IL_0042: ldloc.s V_6 + IL_0044: stelem.i4 + IL_0045: ldloc.s V_5 + IL_0047: ldc.i4.1 + IL_0048: add + IL_0049: stloc.s V_5 + IL_004b: ldloc.s V_4 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: add + IL_0050: stloc.s V_4 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.1 + IL_0055: blt.un.s IL_003a + + IL_0057: ldloc.3 + IL_0058: ret + } + + .method public static int32[] f23(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_0018 + + IL_000b: ldc.i4.1 + IL_000c: ldloc.0 + IL_000d: ldc.i4.s 10 + IL_000f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0014: pop + IL_0015: nop + IL_0016: br.s IL_0019 + + IL_0018: nop + IL_0019: ldc.i4.0 + IL_001a: ldloc.0 + IL_001b: bge.s IL_0034 + + IL_001d: ldc.i4.s 10 + IL_001f: ldc.i4.1 + IL_0020: bge.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_004c + + IL_0027: ldc.i4.s 10 + IL_0029: ldc.i4.1 + IL_002a: sub + IL_002b: ldloc.0 + IL_002c: div.un + IL_002d: conv.i8 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: add + IL_0031: nop + IL_0032: br.s IL_004c + + IL_0034: ldc.i4.1 + IL_0035: ldc.i4.s 10 + IL_0037: bge.s IL_003e + + IL_0039: ldc.i4.0 + IL_003a: conv.i8 + IL_003b: nop + IL_003c: br.s IL_004c + + IL_003e: ldc.i4.1 + IL_003f: ldc.i4.s 10 + IL_0041: sub + IL_0042: ldloc.0 + IL_0043: not + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: div.un + IL_0047: conv.i8 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: nop + IL_004c: stloc.1 + IL_004d: ldloc.1 + IL_004e: stloc.2 + IL_004f: ldloc.2 + IL_0050: ldc.i4.1 + IL_0051: conv.i8 + IL_0052: bge.un.s IL_005a + + IL_0054: call !!0[] [runtime]System.Array::Empty() + IL_0059: ret + + IL_005a: ldloc.2 + IL_005b: conv.ovf.i.un + IL_005c: newarr [runtime]System.Int32 + IL_0061: stloc.3 + IL_0062: ldc.i4.0 + IL_0063: conv.i8 + IL_0064: stloc.s V_4 + IL_0066: ldc.i4.1 + IL_0067: stloc.s V_5 + IL_0069: br.s IL_0083 + + IL_006b: ldloc.3 + IL_006c: ldloc.s V_4 + IL_006e: conv.i + IL_006f: ldloc.s V_5 + IL_0071: stloc.s V_6 + IL_0073: ldloc.s V_6 + IL_0075: stelem.i4 + IL_0076: ldloc.s V_5 + IL_0078: ldloc.0 + IL_0079: add + IL_007a: stloc.s V_5 + IL_007c: ldloc.s V_4 + IL_007e: ldc.i4.1 + IL_007f: conv.i8 + IL_0080: add + IL_0081: stloc.s V_4 + IL_0083: ldloc.s V_4 + IL_0085: ldloc.1 + IL_0086: blt.un.s IL_006b + + IL_0088: ldloc.3 + IL_0089: ret + } + + .method public static int32[] f24(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: stloc.2 + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: bge.un.s IL_0027 + + IL_0021: call !!0[] [runtime]System.Array::Empty() + IL_0026: ret + + IL_0027: ldloc.2 + IL_0028: conv.ovf.i.un + IL_0029: newarr [runtime]System.Int32 + IL_002e: stloc.3 + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: stloc.s V_4 + IL_0033: ldc.i4.1 + IL_0034: stloc.s V_5 + IL_0036: br.s IL_0050 + + IL_0038: ldloc.3 + IL_0039: ldloc.s V_4 + IL_003b: conv.i + IL_003c: ldloc.s V_5 + IL_003e: stloc.s V_6 + IL_0040: ldloc.s V_6 + IL_0042: stelem.i4 + IL_0043: ldloc.s V_5 + IL_0045: ldc.i4.1 + IL_0046: add + IL_0047: stloc.s V_5 + IL_0049: ldloc.s V_4 + IL_004b: ldc.i4.1 + IL_004c: conv.i8 + IL_004d: add + IL_004e: stloc.s V_4 + IL_0050: ldloc.s V_4 + IL_0052: ldloc.1 + IL_0053: blt.un.s IL_0038 + + IL_0055: ldloc.3 + IL_0056: ret + } + + .method public static int32[] f25(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 h) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + uint64 V_3, + uint64 V_4, + int32[] V_5, + uint64 V_6, + int32 V_7, + int32 V_8) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldarg.2 + IL_0011: ldnull + IL_0012: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: brtrue.s IL_0027 + + IL_001b: ldloc.0 + IL_001c: ldloc.1 + IL_001d: ldloc.2 + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldc.i4.0 + IL_0029: ldloc.1 + IL_002a: bge.s IL_0041 + + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0057 + + IL_0035: ldloc.2 + IL_0036: ldloc.0 + IL_0037: sub + IL_0038: ldloc.1 + IL_0039: div.un + IL_003a: conv.i8 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: nop + IL_003f: br.s IL_0057 + + IL_0041: ldloc.0 + IL_0042: ldloc.2 + IL_0043: bge.s IL_004a + + IL_0045: ldc.i4.0 + IL_0046: conv.i8 + IL_0047: nop + IL_0048: br.s IL_0057 + + IL_004a: ldloc.0 + IL_004b: ldloc.2 + IL_004c: sub + IL_004d: ldloc.1 + IL_004e: not + IL_004f: ldc.i4.1 + IL_0050: add + IL_0051: div.un + IL_0052: conv.i8 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: nop + IL_0057: stloc.3 + IL_0058: ldloc.3 + IL_0059: stloc.s V_4 + IL_005b: ldloc.s V_4 + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: bge.un.s IL_0067 + + IL_0061: call !!0[] [runtime]System.Array::Empty() + IL_0066: ret + + IL_0067: ldloc.s V_4 + IL_0069: conv.ovf.i.un + IL_006a: newarr [runtime]System.Int32 + IL_006f: stloc.s V_5 + IL_0071: ldc.i4.0 + IL_0072: conv.i8 + IL_0073: stloc.s V_6 + IL_0075: ldloc.0 + IL_0076: stloc.s V_7 + IL_0078: br.s IL_0093 + + IL_007a: ldloc.s V_5 + IL_007c: ldloc.s V_6 + IL_007e: conv.i + IL_007f: ldloc.s V_7 + IL_0081: stloc.s V_8 + IL_0083: ldloc.s V_8 + IL_0085: stelem.i4 + IL_0086: ldloc.s V_7 + IL_0088: ldloc.1 + IL_0089: add + IL_008a: stloc.s V_7 + IL_008c: ldloc.s V_6 + IL_008e: ldc.i4.1 + IL_008f: conv.i8 + IL_0090: add + IL_0091: stloc.s V_6 + IL_0093: ldloc.s V_6 + IL_0095: ldloc.3 + IL_0096: blt.un.s IL_007a + + IL_0098: ldloc.s V_5 + IL_009a: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs new file mode 100644 index 00000000000..ffa779c295d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs @@ -0,0 +1,27 @@ +let f0 () = [for n in 1..10 do System.Console.WriteLine ""; yield n] +let f00 () = [for n in 1..10 do System.Console.WriteLine ""; yield n; yield n + 1] +let f1 () = [for n in 1..10 -> n] +let f2 () = [for n in 10..1 -> n] +let f3 () = [for n in 1..1..10 -> n] +let f4 () = [for n in 1..2..10 -> n] +let f5 () = [for n in 10..1..1 -> n] +let f6 () = [for n in 1..-1..10 -> n] +let f7 () = [for n in 10..-1..1 -> n] +let f8 () = [for n in 10..-2..1 -> n] +let f9 start = [for n in start..10 -> n] +let f10 finish = [for n in 1..finish -> n] +let f11 start finish = [for n in start..finish -> n] +let f12 start = [for n in start..1..10 -> n] +let f13 step = [for n in 1..step..10 -> n] +let f14 finish = [for n in 1..1..finish -> n] +let f15 start step = [for n in start..step..10 -> n] +let f16 start finish = [for n in start..1..finish -> n] +let f17 step finish = [for n in 1..step..finish -> n] +let f18 start step finish = [for n in start..step..finish -> n] +let f19 f = [for n in f ()..10 -> n] +let f20 f = [for n in 1..f () -> n] +let f21 f g = [for n in f ()..g() -> n] +let f22 f = [for n in f ()..1..10 -> n] +let f23 f = [for n in 1..f ()..10 -> n] +let f24 f = [for n in 1..1..f () -> n] +let f25 f g h = [for n in f ()..g ()..h () -> n] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl new file mode 100644 index 00000000000..da57a1ce043 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl @@ -0,0 +1,1751 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f0() cil managed + { + + .maxstack 5 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + class [runtime]System.Collections.Generic.IEnumerable`1 V_2, + int32 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.s 10 + IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_000f: stloc.1 + .try + { + IL_0010: br.s IL_002c + + IL_0012: ldloc.1 + IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0018: stloc.3 + IL_0019: ldstr "" + IL_001e: call void [runtime]System.Console::WriteLine(string) + IL_0023: ldloca.s V_0 + IL_0025: ldloc.3 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloc.1 + IL_002d: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0032: brtrue.s IL_0012 + + IL_0034: ldnull + IL_0035: stloc.2 + IL_0036: leave.s IL_004d + + } + finally + { + IL_0038: ldloc.1 + IL_0039: isinst [runtime]System.IDisposable + IL_003e: stloc.s V_4 + IL_0040: ldloc.s V_4 + IL_0042: brfalse.s IL_004c + + IL_0044: ldloc.s V_4 + IL_0046: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_004b: endfinally + IL_004c: endfinally + } + IL_004d: ldloc.2 + IL_004e: pop + IL_004f: ldloca.s V_0 + IL_0051: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0056: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f00() cil managed + { + + .maxstack 5 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + class [runtime]System.Collections.Generic.IEnumerable`1 V_2, + int32 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.s 10 + IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_000f: stloc.1 + .try + { + IL_0010: br.s IL_0037 + + IL_0012: ldloc.1 + IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0018: stloc.3 + IL_0019: ldstr "" + IL_001e: call void [runtime]System.Console::WriteLine(string) + IL_0023: ldloca.s V_0 + IL_0025: ldloc.3 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloca.s V_0 + IL_002e: ldloc.3 + IL_002f: ldc.i4.1 + IL_0030: add + IL_0031: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0036: nop + IL_0037: ldloc.1 + IL_0038: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_003d: brtrue.s IL_0012 + + IL_003f: ldnull + IL_0040: stloc.2 + IL_0041: leave.s IL_0058 + + } + finally + { + IL_0043: ldloc.1 + IL_0044: isinst [runtime]System.IDisposable + IL_0049: stloc.s V_4 + IL_004b: ldloc.s V_4 + IL_004d: brfalse.s IL_0057 + + IL_004f: ldloc.s V_4 + IL_0051: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0056: endfinally + IL_0057: endfinally + } + IL_0058: ldloc.2 + IL_0059: pop + IL_005a: ldloca.s V_0 + IL_005c: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0061: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f1() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_001b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldloc.3 + IL_000c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0011: nop + IL_0012: ldloc.2 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.s 10 + IL_001e: conv.i8 + IL_001f: blt.un.s IL_0007 + + IL_0021: ldloca.s V_0 + IL_0023: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0028: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f2() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f3() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_001b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldloc.3 + IL_000c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0011: nop + IL_0012: ldloc.2 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.s 10 + IL_001e: conv.i8 + IL_001f: blt.un.s IL_0007 + + IL_0021: ldloca.s V_0 + IL_0023: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0028: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f4() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_001b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldloc.3 + IL_000c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0011: nop + IL_0012: ldloc.2 + IL_0013: ldc.i4.2 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.5 + IL_001d: conv.i8 + IL_001e: blt.un.s IL_0007 + + IL_0020: ldloca.s V_0 + IL_0022: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0027: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f5() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f6() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f7() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.2 + IL_0006: br.s IL_001c + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: stloc.3 + IL_000c: ldloc.3 + IL_000d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0012: nop + IL_0013: ldloc.2 + IL_0014: ldc.i4.m1 + IL_0015: add + IL_0016: stloc.2 + IL_0017: ldloc.1 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add + IL_001b: stloc.1 + IL_001c: ldloc.1 + IL_001d: ldc.i4.s 10 + IL_001f: conv.i8 + IL_0020: blt.un.s IL_0008 + + IL_0022: ldloca.s V_0 + IL_0024: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0029: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f8() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.2 + IL_0006: br.s IL_001d + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: stloc.3 + IL_000c: ldloc.3 + IL_000d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0012: nop + IL_0013: ldloc.2 + IL_0014: ldc.i4.s -2 + IL_0016: add + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: add + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.5 + IL_001f: conv.i8 + IL_0020: blt.un.s IL_0008 + + IL_0022: ldloca.s V_0 + IL_0024: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0029: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f9(int32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: ldarg.0 + IL_0004: bge.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0014 + + IL_000b: ldc.i4.s 10 + IL_000d: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: stloc.s V_4 + IL_0021: ldloc.s V_4 + IL_0023: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0028: nop + IL_0029: ldloc.3 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.3 + IL_002d: ldloc.2 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: ldloc.0 + IL_0034: blt.un.s IL_001c + + IL_0036: ldloca.s V_1 + IL_0038: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f10(int32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldc.i4.1 + IL_0017: stloc.3 + IL_0018: br.s IL_0030 + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: stloc.s V_4 + IL_001f: ldloc.s V_4 + IL_0021: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0026: nop + IL_0027: ldloc.3 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.3 + IL_002b: ldloc.2 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_001a + + IL_0034: ldloca.s V_1 + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f11(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldarg.0 + IL_0017: stloc.3 + IL_0018: br.s IL_0030 + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: stloc.s V_4 + IL_001f: ldloc.s V_4 + IL_0021: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0026: nop + IL_0027: ldloc.3 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.3 + IL_002b: ldloc.2 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_001a + + IL_0034: ldloca.s V_1 + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f12(int32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: ldarg.0 + IL_0004: bge.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0014 + + IL_000b: ldc.i4.s 10 + IL_000d: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: stloc.s V_4 + IL_0021: ldloc.s V_4 + IL_0023: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0028: nop + IL_0029: ldloc.3 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.3 + IL_002d: ldloc.2 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: ldloc.0 + IL_0034: blt.un.s IL_001c + + IL_0036: ldloca.s V_1 + IL_0038: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f13(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.0 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldc.i4.1 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldc.i4.1 + IL_0023: sub + IL_0024: ldarg.0 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldc.i4.1 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldc.i4.1 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.0 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: stloc.2 + IL_0049: ldc.i4.1 + IL_004a: stloc.3 + IL_004b: br.s IL_0063 + + IL_004d: ldloca.s V_1 + IL_004f: ldloc.3 + IL_0050: stloc.s V_4 + IL_0052: ldloc.s V_4 + IL_0054: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0059: nop + IL_005a: ldloc.3 + IL_005b: ldarg.0 + IL_005c: add + IL_005d: stloc.3 + IL_005e: ldloc.2 + IL_005f: ldc.i4.1 + IL_0060: conv.i8 + IL_0061: add + IL_0062: stloc.2 + IL_0063: ldloc.2 + IL_0064: ldloc.0 + IL_0065: blt.un.s IL_004d + + IL_0067: ldloca.s V_1 + IL_0069: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006e: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f14(int32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldc.i4.1 + IL_0017: stloc.3 + IL_0018: br.s IL_0030 + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: stloc.s V_4 + IL_001f: ldloc.s V_4 + IL_0021: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0026: nop + IL_0027: ldloc.3 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.3 + IL_002b: ldloc.2 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_001a + + IL_0034: ldloca.s V_1 + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f15(int32 start, + int32 step) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.1 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldarg.0 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldarg.0 + IL_0023: sub + IL_0024: ldarg.1 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldarg.0 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldarg.0 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.1 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: stloc.2 + IL_0049: ldarg.0 + IL_004a: stloc.3 + IL_004b: br.s IL_0063 + + IL_004d: ldloca.s V_1 + IL_004f: ldloc.3 + IL_0050: stloc.s V_4 + IL_0052: ldloc.s V_4 + IL_0054: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0059: nop + IL_005a: ldloc.3 + IL_005b: ldarg.1 + IL_005c: add + IL_005d: stloc.3 + IL_005e: ldloc.2 + IL_005f: ldc.i4.1 + IL_0060: conv.i8 + IL_0061: add + IL_0062: stloc.2 + IL_0063: ldloc.2 + IL_0064: ldloc.0 + IL_0065: blt.un.s IL_004d + + IL_0067: ldloca.s V_1 + IL_0069: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006e: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f16(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldarg.0 + IL_0017: stloc.3 + IL_0018: br.s IL_0030 + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: stloc.s V_4 + IL_001f: ldloc.s V_4 + IL_0021: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0026: nop + IL_0027: ldloc.3 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.3 + IL_002b: ldloc.2 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_001a + + IL_0034: ldloca.s V_1 + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f17(int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldarg.1 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.1 + IL_0016: ldc.i4.1 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.1 + IL_001f: ldc.i4.1 + IL_0020: sub + IL_0021: ldarg.0 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldc.i4.1 + IL_002b: ldarg.1 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldc.i4.1 + IL_0034: ldarg.1 + IL_0035: sub + IL_0036: ldarg.0 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldc.i4.1 + IL_0045: stloc.3 + IL_0046: br.s IL_005e + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: stloc.s V_4 + IL_004d: ldloc.s V_4 + IL_004f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0054: nop + IL_0055: ldloc.3 + IL_0056: ldarg.0 + IL_0057: add + IL_0058: stloc.3 + IL_0059: ldloc.2 + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: stloc.2 + IL_005e: ldloc.2 + IL_005f: ldloc.0 + IL_0060: blt.un.s IL_0048 + + IL_0062: ldloca.s V_1 + IL_0064: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0069: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f18(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldarg.0 + IL_0045: stloc.3 + IL_0046: br.s IL_005e + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: stloc.s V_4 + IL_004d: ldloc.s V_4 + IL_004f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0054: nop + IL_0055: ldloc.3 + IL_0056: ldarg.1 + IL_0057: add + IL_0058: stloc.3 + IL_0059: ldloc.2 + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: stloc.2 + IL_005e: ldloc.2 + IL_005f: ldloc.0 + IL_0060: blt.un.s IL_0048 + + IL_0062: ldloca.s V_1 + IL_0064: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0069: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldc.i4.0 + IL_001d: conv.i8 + IL_001e: stloc.3 + IL_001f: ldloc.0 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_003d + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: stloc.s V_5 + IL_002a: ldloc.s V_5 + IL_002c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0031: nop + IL_0032: ldloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.s V_4 + IL_0038: ldloc.3 + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: add + IL_003c: stloc.3 + IL_003d: ldloc.3 + IL_003e: ldloc.1 + IL_003f: blt.un.s IL_0024 + + IL_0041: ldloca.s V_2 + IL_0043: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0048: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.3 + IL_001d: ldc.i4.1 + IL_001e: stloc.s V_4 + IL_0020: br.s IL_003b + + IL_0022: ldloca.s V_2 + IL_0024: ldloc.s V_4 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_5 + IL_002a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002f: nop + IL_0030: ldloc.s V_4 + IL_0032: ldc.i4.1 + IL_0033: add + IL_0034: stloc.s V_4 + IL_0036: ldloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: add + IL_003a: stloc.3 + IL_003b: ldloc.3 + IL_003c: ldloc.1 + IL_003d: blt.un.s IL_0022 + + IL_003f: ldloca.s V_2 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0046: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1, + uint64 V_2, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, + uint64 V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldloc.1 + IL_0011: ldloc.0 + IL_0012: bge.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0021 + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: conv.i8 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: nop + IL_0021: stloc.2 + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: stloc.s V_4 + IL_0026: ldloc.0 + IL_0027: stloc.s V_5 + IL_0029: br.s IL_0046 + + IL_002b: ldloca.s V_3 + IL_002d: ldloc.s V_5 + IL_002f: stloc.s V_6 + IL_0031: ldloc.s V_6 + IL_0033: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0038: nop + IL_0039: ldloc.s V_5 + IL_003b: ldc.i4.1 + IL_003c: add + IL_003d: stloc.s V_5 + IL_003f: ldloc.s V_4 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.s V_4 + IL_0046: ldloc.s V_4 + IL_0048: ldloc.2 + IL_0049: blt.un.s IL_002b + + IL_004b: ldloca.s V_3 + IL_004d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0052: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldc.i4.0 + IL_001d: conv.i8 + IL_001e: stloc.3 + IL_001f: ldloc.0 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_003d + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: stloc.s V_5 + IL_002a: ldloc.s V_5 + IL_002c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0031: nop + IL_0032: ldloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.s V_4 + IL_0038: ldloc.3 + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: add + IL_003c: stloc.3 + IL_003d: ldloc.3 + IL_003e: ldloc.1 + IL_003f: blt.un.s IL_0024 + + IL_0041: ldloca.s V_2 + IL_0043: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0048: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f23(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_0018 + + IL_000b: ldc.i4.1 + IL_000c: ldloc.0 + IL_000d: ldc.i4.s 10 + IL_000f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0014: pop + IL_0015: nop + IL_0016: br.s IL_0019 + + IL_0018: nop + IL_0019: ldc.i4.0 + IL_001a: ldloc.0 + IL_001b: bge.s IL_0034 + + IL_001d: ldc.i4.s 10 + IL_001f: ldc.i4.1 + IL_0020: bge.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_004c + + IL_0027: ldc.i4.s 10 + IL_0029: ldc.i4.1 + IL_002a: sub + IL_002b: ldloc.0 + IL_002c: div.un + IL_002d: conv.i8 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: add + IL_0031: nop + IL_0032: br.s IL_004c + + IL_0034: ldc.i4.1 + IL_0035: ldc.i4.s 10 + IL_0037: bge.s IL_003e + + IL_0039: ldc.i4.0 + IL_003a: conv.i8 + IL_003b: nop + IL_003c: br.s IL_004c + + IL_003e: ldc.i4.1 + IL_003f: ldc.i4.s 10 + IL_0041: sub + IL_0042: ldloc.0 + IL_0043: not + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: div.un + IL_0047: conv.i8 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: nop + IL_004c: stloc.1 + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: stloc.3 + IL_0050: ldc.i4.1 + IL_0051: stloc.s V_4 + IL_0053: br.s IL_006e + + IL_0055: ldloca.s V_2 + IL_0057: ldloc.s V_4 + IL_0059: stloc.s V_5 + IL_005b: ldloc.s V_5 + IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0062: nop + IL_0063: ldloc.s V_4 + IL_0065: ldloc.0 + IL_0066: add + IL_0067: stloc.s V_4 + IL_0069: ldloc.3 + IL_006a: ldc.i4.1 + IL_006b: conv.i8 + IL_006c: add + IL_006d: stloc.3 + IL_006e: ldloc.3 + IL_006f: ldloc.1 + IL_0070: blt.un.s IL_0055 + + IL_0072: ldloca.s V_2 + IL_0074: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0079: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f24(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.3 + IL_001d: ldc.i4.1 + IL_001e: stloc.s V_4 + IL_0020: br.s IL_003b + + IL_0022: ldloca.s V_2 + IL_0024: ldloc.s V_4 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_5 + IL_002a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002f: nop + IL_0030: ldloc.s V_4 + IL_0032: ldc.i4.1 + IL_0033: add + IL_0034: stloc.s V_4 + IL_0036: ldloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: add + IL_003a: stloc.3 + IL_003b: ldloc.3 + IL_003c: ldloc.1 + IL_003d: blt.un.s IL_0022 + + IL_003f: ldloca.s V_2 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0046: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f25(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 h) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + uint64 V_3, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, + uint64 V_5, + int32 V_6, + int32 V_7) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldarg.2 + IL_0011: ldnull + IL_0012: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: brtrue.s IL_0027 + + IL_001b: ldloc.0 + IL_001c: ldloc.1 + IL_001d: ldloc.2 + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldc.i4.0 + IL_0029: ldloc.1 + IL_002a: bge.s IL_0041 + + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0057 + + IL_0035: ldloc.2 + IL_0036: ldloc.0 + IL_0037: sub + IL_0038: ldloc.1 + IL_0039: div.un + IL_003a: conv.i8 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: nop + IL_003f: br.s IL_0057 + + IL_0041: ldloc.0 + IL_0042: ldloc.2 + IL_0043: bge.s IL_004a + + IL_0045: ldc.i4.0 + IL_0046: conv.i8 + IL_0047: nop + IL_0048: br.s IL_0057 + + IL_004a: ldloc.0 + IL_004b: ldloc.2 + IL_004c: sub + IL_004d: ldloc.1 + IL_004e: not + IL_004f: ldc.i4.1 + IL_0050: add + IL_0051: div.un + IL_0052: conv.i8 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: nop + IL_0057: stloc.3 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: stloc.s V_5 + IL_005c: ldloc.0 + IL_005d: stloc.s V_6 + IL_005f: br.s IL_007c + + IL_0061: ldloca.s V_4 + IL_0063: ldloc.s V_6 + IL_0065: stloc.s V_7 + IL_0067: ldloc.s V_7 + IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006e: nop + IL_006f: ldloc.s V_6 + IL_0071: ldloc.1 + IL_0072: add + IL_0073: stloc.s V_6 + IL_0075: ldloc.s V_5 + IL_0077: ldc.i4.1 + IL_0078: conv.i8 + IL_0079: add + IL_007a: stloc.s V_5 + IL_007c: ldloc.s V_5 + IL_007e: ldloc.3 + IL_007f: blt.un.s IL_0061 + + IL_0081: ldloca.s V_4 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter01.fs.il.bsl index d2116eb9df4..9cf19fe503d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter01.fs.il.bsl @@ -43,65 +43,46 @@ extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - squaresOfOneToTen() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 squaresOfOneToTen() cil managed { .maxstack 5 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.2 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000e: stloc.1 - .try - { - IL_000f: br.s IL_0023 - - IL_0011: ldloc.1 - IL_0012: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0017: stloc.3 - IL_0018: ldloca.s V_0 - IL_001a: ldloc.3 - IL_001b: ldloc.3 - IL_001c: mul - IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0022: nop - IL_0023: ldloc.1 - IL_0024: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0029: brtrue.s IL_0011 - - IL_002b: ldnull - IL_002c: stloc.2 - IL_002d: leave.s IL_0044 - - } - finally - { - IL_002f: ldloc.1 - IL_0030: isinst [runtime]System.IDisposable - IL_0035: stloc.s V_4 - IL_0037: ldloc.s V_4 - IL_0039: brfalse.s IL_0043 - - IL_003b: ldloc.s V_4 - IL_003d: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0042: endfinally - IL_0043: endfinally - } - IL_0044: ldloc.2 - IL_0045: pop - IL_0046: ldloca.s V_0 - IL_0048: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004d: ret + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.0 + IL_0004: stloc.2 + IL_0005: br.s IL_001d + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldloc.3 + IL_000c: ldloc.3 + IL_000d: mul + IL_000e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0013: nop + IL_0014: ldloc.2 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: add + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.3 + IL_001f: conv.i8 + IL_0020: blt.un.s IL_0007 + + IL_0022: ldloca.s V_0 + IL_0024: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0029: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter03.fs.il.bsl index 7a3d0ce3812..2f8d1ce09f2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter03.fs.il.bsl @@ -43,65 +43,46 @@ extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - squaresOfOneToTenC() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 squaresOfOneToTenC() cil managed { .maxstack 5 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 10 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0024 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.3 - IL_0019: ldloca.s V_0 - IL_001b: ldloc.3 - IL_001c: ldloc.3 - IL_001d: mul - IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.1 - IL_0025: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002a: brtrue.s IL_0012 - - IL_002c: ldnull - IL_002d: stloc.2 - IL_002e: leave.s IL_0045 - - } - finally - { - IL_0030: ldloc.1 - IL_0031: isinst [runtime]System.IDisposable - IL_0036: stloc.s V_4 - IL_0038: ldloc.s V_4 - IL_003a: brfalse.s IL_0044 - - IL_003c: ldloc.s V_4 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ldloc.2 - IL_0046: pop - IL_0047: ldloca.s V_0 - IL_0049: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004e: ret + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.0 + IL_0004: stloc.2 + IL_0005: br.s IL_001d + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldloc.3 + IL_000c: ldloc.3 + IL_000d: mul + IL_000e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0013: nop + IL_0014: ldloc.2 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: add + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.s 11 + IL_0020: conv.i8 + IL_0021: blt.un.s IL_0007 + + IL_0023: ldloca.s V_0 + IL_0025: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_002a: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOff.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOff.fs.il.bsl index 8ff1796aaff..2d319d672ea 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOff.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOff.fs.il.bsl @@ -75,62 +75,44 @@ .maxstack 5 .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - class [runtime]System.Collections.Generic.IEnumerator`1 V_2, - class [runtime]System.Collections.Generic.IEnumerable`1 V_3, - int32 V_4, - class [runtime]System.IDisposable V_5) - IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 10 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.2 - .try - { - IL_0010: br.s IL_0027 - - IL_0012: ldloc.2 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.s V_4 - IL_001a: ldloca.s V_1 - IL_001c: ldloc.s V_4 - IL_001e: ldloc.s V_4 - IL_0020: mul - IL_0021: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0026: nop - IL_0027: ldloc.2 - IL_0028: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002d: brtrue.s IL_0012 - - IL_002f: ldnull - IL_0030: stloc.3 - IL_0031: leave.s IL_0048 - - } - finally - { - IL_0033: ldloc.2 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.s V_5 - IL_003b: ldloc.s V_5 - IL_003d: brfalse.s IL_0047 - - IL_003f: ldloc.s V_5 - IL_0041: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0046: endfinally - IL_0047: endfinally - } - IL_0048: ldloc.3 - IL_0049: pop - IL_004a: ldloca.s V_1 - IL_004c: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0051: dup - IL_0052: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::squaresOfOneToTenD@4 - IL_0057: stloc.0 - IL_0058: ret + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.2 + IL_0003: ldc.i4.0 + IL_0004: stloc.3 + IL_0005: br.s IL_0020 + + IL_0007: ldloca.s V_1 + IL_0009: ldloc.3 + IL_000a: stloc.s V_4 + IL_000c: ldloc.s V_4 + IL_000e: ldloc.s V_4 + IL_0010: mul + IL_0011: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0016: nop + IL_0017: ldloc.3 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.3 + IL_001b: ldloc.2 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.2 + IL_0021: ldc.i4.s 11 + IL_0023: conv.i8 + IL_0024: blt.un.s IL_0007 + + IL_0026: ldloca.s V_1 + IL_0028: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_002d: dup + IL_002e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::squaresOfOneToTenD@4 + IL_0033: stloc.0 + IL_0034: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOn.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOn.fs.il.bsl index 84e9c999f30..e5b5501f20d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOn.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter04_RealInternalSignatureOn.fs.il.bsl @@ -69,60 +69,42 @@ .maxstack 5 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 10 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0024 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.3 - IL_0019: ldloca.s V_0 - IL_001b: ldloc.3 - IL_001c: ldloc.3 - IL_001d: mul - IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.1 - IL_0025: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002a: brtrue.s IL_0012 - - IL_002c: ldnull - IL_002d: stloc.2 - IL_002e: leave.s IL_0045 - - } - finally - { - IL_0030: ldloc.1 - IL_0031: isinst [runtime]System.IDisposable - IL_0036: stloc.s V_4 - IL_0038: ldloc.s V_4 - IL_003a: brfalse.s IL_0044 - - IL_003c: ldloc.s V_4 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ldloc.2 - IL_0046: pop - IL_0047: ldloca.s V_0 - IL_0049: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::squaresOfOneToTenD@4 - IL_0053: ret + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.0 + IL_0004: stloc.2 + IL_0005: br.s IL_001d + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldloc.3 + IL_000c: ldloc.3 + IL_000d: mul + IL_000e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0013: nop + IL_0014: ldloc.2 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: add + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.s 11 + IL_0020: conv.i8 + IL_0021: blt.un.s IL_0007 + + IL_0023: ldloca.s V_0 + IL_0025: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_002a: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::squaresOfOneToTenD@4 + IL_002f: ret } .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs index 68899c67afe..4d19bbec2f6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs @@ -10,6 +10,7 @@ module GeneratedIterators = compilation |> withOptions [ "--test:EmitFeeFeeAs100001" ] |> asExe + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> withNoOptimize |> withEmbeddedPdb |> withEmbedAllSource From 93d7855c030cc617551456706eee748ca1f318ce Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 7 Mar 2024 12:35:24 -0500 Subject: [PATCH 2/9] Only two --- src/Compiler/Optimize/LowerComputedCollections.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index d048157d96a..25e810fb294 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -419,7 +419,7 @@ module Array = [] let (|SimpleMapping|_|) g expr = match expr with - | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_map_vref (([ty1; ty2] | [ty1; _; ty2]), [Expr.Lambda (valParams = [loopVal]; bodyExpr = body) as mapping; input], _))], _) -> + | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_map_vref ([ty1; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = body) as mapping; input], _))], _) -> ValueSome (ty1, ty2, input, mapping, loopVal, body) | _ -> ValueNone From abc714c880dfbb4cf8f9cecbcf39cb718eb6b382 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 7 Mar 2024 12:38:48 -0500 Subject: [PATCH 3/9] Update release notes --- docs/release-notes/.Language/preview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index eb7ddd08e54..c8fbe9c0381 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -1,6 +1,6 @@ ### Added -* Lower integral ranges to fast loops in more cases and optimize list and array construction from ranges. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650)) +* Lower integral ranges to fast loops in more cases and optimize list and array construction from ranges. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650), [PR #16832](https://github.com/dotnet/fsharp/pull/16832)) * Better generic unmanaged structs handling. ([Language suggestion #692](https://github.com/fsharp/fslang-suggestions/issues/692), [PR #12154](https://github.com/dotnet/fsharp/pull/12154)) * Bidirectional F#/C# interop for 'unmanaged' constraint. ([PR #12154](https://github.com/dotnet/fsharp/pull/12154)) * Make `.Is*` discriminated union properties visible. ([Language suggestion #222](https://github.com/fsharp/fslang-suggestions/issues/222), [PR #16341](https://github.com/dotnet/fsharp/pull/16341)) From 77069f713362ecf345beb07ddbb146b815613207 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 7 Mar 2024 12:41:08 -0500 Subject: [PATCH 4/9] Update release notes --- docs/release-notes/.FSharp.Compiler.Service/8.0.300.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 148f3734185..6549a81d4cd 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -36,4 +36,4 @@ * Reverted [#16348](https://github.com/dotnet/fsharp/pull/16348) `ThreadStatic` `CancellationToken` changes to improve test stability and prevent potential unwanted cancellations. ([PR #16536](https://github.com/dotnet/fsharp/pull/16536)) * Refactored parenthesization API. ([PR #16461])(https://github.com/dotnet/fsharp/pull/16461)) * Optimize some interpolated strings by lowering to string concatenation. ([PR #16556](https://github.com/dotnet/fsharp/pull/16556)) -* Integral range optimizations. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650)) +* Integral range optimizations. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650), [PR #16832](https://github.com/dotnet/fsharp/pull/16832)) From 6cfb44c9b9242c25696ed00d404002c6d163c6ee Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 7 Mar 2024 14:17:35 -0500 Subject: [PATCH 5/9] Add tests for a few more cases --- .../ComputedCollections/ForNInRangeArrays.fs | 8 +- .../ForNInRangeArrays.fs.il.bsl | 561 +++++++++++++++--- .../ComputedCollections/ForNInRangeLists.fs | 8 +- .../ForNInRangeLists.fs.il.bsl | 512 +++++++++++++--- 4 files changed, 951 insertions(+), 138 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs index 05f54cee6f3..eafda4c03ab 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs @@ -1,5 +1,6 @@ -let f0 () = [|for n in 1..10 do System.Console.WriteLine ""; yield n|] -let f00 () = [|for n in 1..10 do System.Console.WriteLine ""; yield n; yield n + 1|] +let f0 f = [|for n in 1..10 do f (); yield n|] +let f00 f = [|for n in 1..10 do f (); yield n; yield n + 1|] +let f000 () = [|for n in 1..10 do yield n|] let f1 () = [|for n in 1..10 -> n|] let f2 () = [|for n in 10..1 -> n|] let f3 () = [|for n in 1..1..10 -> n|] @@ -25,3 +26,6 @@ let f22 f = [|for n in f ()..1..10 -> n|] let f23 f = [|for n in 1..f ()..10 -> n|] let f24 f = [|for n in 1..1..f () -> n|] let f25 f g h = [|for n in f ()..g ()..h () -> n|] +let f26 start step finish = [|for n in start..step..finish -> n, float n|] +let f27 start step finish = [|for n in start..step..finish -> struct (n, float n)|] +let f28 start step finish = [|for n in start..step..finish -> let x = n + 1 in n * n|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl index 373ea3e86c2..b1e49e9103e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl @@ -5,7 +5,6 @@ .assembly extern runtime { } .assembly extern FSharp.Core { } -.assembly extern runtime { } .assembly assembly { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, @@ -44,7 +43,7 @@ extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static int32[] f0() cil managed + .method public static int32[] f0(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { .maxstack 5 @@ -64,47 +63,49 @@ IL_000f: stloc.1 .try { - IL_0010: br.s IL_002c + IL_0010: br.s IL_002a IL_0012: ldloc.1 IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() IL_0018: stloc.3 - IL_0019: ldstr "" - IL_001e: call void [runtime]System.Console::WriteLine(string) - IL_0023: ldloca.s V_0 - IL_0025: ldloc.3 - IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) - IL_002b: nop - IL_002c: ldloc.1 - IL_002d: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0032: brtrue.s IL_0012 - - IL_0034: ldnull - IL_0035: stloc.2 - IL_0036: leave.s IL_004d + IL_0019: ldarg.0 + IL_001a: ldnull + IL_001b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0020: pop + IL_0021: ldloca.s V_0 + IL_0023: ldloc.3 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloc.1 + IL_002b: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0030: brtrue.s IL_0012 + + IL_0032: ldnull + IL_0033: stloc.2 + IL_0034: leave.s IL_004b } finally { - IL_0038: ldloc.1 - IL_0039: isinst [runtime]System.IDisposable - IL_003e: stloc.s V_4 - IL_0040: ldloc.s V_4 - IL_0042: brfalse.s IL_004c - - IL_0044: ldloc.s V_4 - IL_0046: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_004b: endfinally - IL_004c: endfinally + IL_0036: ldloc.1 + IL_0037: isinst [runtime]System.IDisposable + IL_003c: stloc.s V_4 + IL_003e: ldloc.s V_4 + IL_0040: brfalse.s IL_004a + + IL_0042: ldloc.s V_4 + IL_0044: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0049: endfinally + IL_004a: endfinally } - IL_004d: ldloc.2 - IL_004e: pop - IL_004f: ldloca.s V_0 - IL_0051: call instance !0[] valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Close() - IL_0056: ret + IL_004b: ldloc.2 + IL_004c: pop + IL_004d: ldloca.s V_0 + IL_004f: call instance !0[] valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Close() + IL_0054: ret } - .method public static int32[] f00() cil managed + .method public static int32[] f00(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { .maxstack 5 @@ -124,50 +125,97 @@ IL_000f: stloc.1 .try { - IL_0010: br.s IL_0037 + IL_0010: br.s IL_0035 IL_0012: ldloc.1 IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() IL_0018: stloc.3 - IL_0019: ldstr "" - IL_001e: call void [runtime]System.Console::WriteLine(string) - IL_0023: ldloca.s V_0 - IL_0025: ldloc.3 - IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) - IL_002b: nop - IL_002c: ldloca.s V_0 - IL_002e: ldloc.3 - IL_002f: ldc.i4.1 - IL_0030: add - IL_0031: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) - IL_0036: nop - IL_0037: ldloc.1 - IL_0038: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003d: brtrue.s IL_0012 - - IL_003f: ldnull - IL_0040: stloc.2 - IL_0041: leave.s IL_0058 + IL_0019: ldarg.0 + IL_001a: ldnull + IL_001b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0020: pop + IL_0021: ldloca.s V_0 + IL_0023: ldloc.3 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloca.s V_0 + IL_002c: ldloc.3 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) + IL_0034: nop + IL_0035: ldloc.1 + IL_0036: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_003b: brtrue.s IL_0012 + + IL_003d: ldnull + IL_003e: stloc.2 + IL_003f: leave.s IL_0056 } finally { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.s V_4 - IL_004b: ldloc.s V_4 - IL_004d: brfalse.s IL_0057 - - IL_004f: ldloc.s V_4 - IL_0051: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0056: endfinally - IL_0057: endfinally + IL_0041: ldloc.1 + IL_0042: isinst [runtime]System.IDisposable + IL_0047: stloc.s V_4 + IL_0049: ldloc.s V_4 + IL_004b: brfalse.s IL_0055 + + IL_004d: ldloc.s V_4 + IL_004f: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0054: endfinally + IL_0055: endfinally } - IL_0058: ldloc.2 - IL_0059: pop - IL_005a: ldloca.s V_0 - IL_005c: call instance !0[] valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Close() - IL_0061: ret + IL_0056: ldloc.2 + IL_0057: pop + IL_0058: ldloca.s V_0 + IL_005a: call instance !0[] valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Close() + IL_005f: ret + } + + .method public static int32[] f000() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_0021 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stloc.3 + IL_0016: ldloc.3 + IL_0017: stelem.i4 + IL_0018: ldloc.2 + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: ldc.i4.s 10 + IL_0024: conv.i8 + IL_0025: blt.un.s IL_0011 + + IL_0027: ldloc.0 + IL_0028: ret } .method public static int32[] f1() cil managed @@ -2002,6 +2050,385 @@ IL_009a: ret } + .method public static class [runtime]System.Tuple`2[] + f26(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 6 + .locals init (uint64 V_0, + uint64 V_1, + class [runtime]System.Tuple`2[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: bge.un.s IL_004e + + IL_0048: call !!0[] [runtime]System.Array::Empty>() + IL_004d: ret + + IL_004e: ldloc.1 + IL_004f: conv.ovf.i.un + IL_0050: newarr class [runtime]System.Tuple`2 + IL_0055: stloc.2 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.3 + IL_0059: ldarg.0 + IL_005a: stloc.s V_4 + IL_005c: br.s IL_007f + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stloc.s V_5 + IL_0065: ldloc.s V_5 + IL_0067: ldloc.s V_5 + IL_0069: conv.r8 + IL_006a: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_006f: stelem class [runtime]System.Tuple`2 + IL_0074: ldloc.s V_4 + IL_0076: ldarg.1 + IL_0077: add + IL_0078: stloc.s V_4 + IL_007a: ldloc.3 + IL_007b: ldc.i4.1 + IL_007c: conv.i8 + IL_007d: add + IL_007e: stloc.3 + IL_007f: ldloc.3 + IL_0080: ldloc.0 + IL_0081: blt.un.s IL_005e + + IL_0083: ldloc.2 + IL_0084: ret + } + + .method public static valuetype [runtime]System.ValueTuple`2[] + f27(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 6 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [runtime]System.ValueTuple`2[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: bge.un.s IL_004e + + IL_0048: call !!0[] [runtime]System.Array::Empty>() + IL_004d: ret + + IL_004e: ldloc.1 + IL_004f: conv.ovf.i.un + IL_0050: newarr valuetype [runtime]System.ValueTuple`2 + IL_0055: stloc.2 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.3 + IL_0059: ldarg.0 + IL_005a: stloc.s V_4 + IL_005c: br.s IL_007f + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stloc.s V_5 + IL_0065: ldloc.s V_5 + IL_0067: ldloc.s V_5 + IL_0069: conv.r8 + IL_006a: newobj instance void valuetype [runtime]System.ValueTuple`2::.ctor(!0, + !1) + IL_006f: stelem valuetype [runtime]System.ValueTuple`2 + IL_0074: ldloc.s V_4 + IL_0076: ldarg.1 + IL_0077: add + IL_0078: stloc.s V_4 + IL_007a: ldloc.3 + IL_007b: ldc.i4.1 + IL_007c: conv.i8 + IL_007d: add + IL_007e: stloc.3 + IL_007f: ldloc.3 + IL_0080: ldloc.0 + IL_0081: blt.un.s IL_005e + + IL_0083: ldloc.2 + IL_0084: ret + } + + .method public static int32[] f28(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 6 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4, + int32 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: bge.un.s IL_004e + + IL_0048: call !!0[] [runtime]System.Array::Empty() + IL_004d: ret + + IL_004e: ldloc.1 + IL_004f: conv.ovf.i.un + IL_0050: newarr [runtime]System.Int32 + IL_0055: stloc.2 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.3 + IL_0059: ldarg.0 + IL_005a: stloc.s V_4 + IL_005c: br.s IL_0077 + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stloc.s V_5 + IL_0065: nop + IL_0066: ldloc.s V_5 + IL_0068: ldloc.s V_5 + IL_006a: mul + IL_006b: stelem.i4 + IL_006c: ldloc.s V_4 + IL_006e: ldarg.1 + IL_006f: add + IL_0070: stloc.s V_4 + IL_0072: ldloc.3 + IL_0073: ldc.i4.1 + IL_0074: conv.i8 + IL_0075: add + IL_0076: stloc.3 + IL_0077: ldloc.3 + IL_0078: ldloc.0 + IL_0079: blt.un.s IL_005e + + IL_007b: ldloc.2 + IL_007c: ret + } + } .class private abstract auto ansi sealed ''.$assembly diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs index ffa779c295d..456707fba28 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs @@ -1,5 +1,6 @@ -let f0 () = [for n in 1..10 do System.Console.WriteLine ""; yield n] -let f00 () = [for n in 1..10 do System.Console.WriteLine ""; yield n; yield n + 1] +let f0 f = [for n in 1..10 do f (); yield n] +let f00 f = [for n in 1..10 do f (); yield n; yield n + 1] +let f000 () = [for n in 1..10 do yield n] let f1 () = [for n in 1..10 -> n] let f2 () = [for n in 10..1 -> n] let f3 () = [for n in 1..1..10 -> n] @@ -25,3 +26,6 @@ let f22 f = [for n in f ()..1..10 -> n] let f23 f = [for n in 1..f ()..10 -> n] let f24 f = [for n in 1..1..f () -> n] let f25 f g h = [for n in f ()..g ()..h () -> n] +let f26 start step finish = [for n in start..step..finish -> n, float n] +let f27 start step finish = [for n in start..step..finish -> struct (n, float n)] +let f28 start step finish = [for n in start..step..finish -> let x = n + 1 in n * n] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl index da57a1ce043..100cc84ebd9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl @@ -5,7 +5,6 @@ .assembly extern runtime { } .assembly extern FSharp.Core { } -.assembly extern runtime { } .assembly assembly { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, @@ -44,7 +43,7 @@ extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f0() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f0(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { .maxstack 5 @@ -64,47 +63,49 @@ IL_000f: stloc.1 .try { - IL_0010: br.s IL_002c + IL_0010: br.s IL_002a IL_0012: ldloc.1 IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() IL_0018: stloc.3 - IL_0019: ldstr "" - IL_001e: call void [runtime]System.Console::WriteLine(string) - IL_0023: ldloca.s V_0 - IL_0025: ldloc.3 - IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002b: nop - IL_002c: ldloc.1 - IL_002d: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0032: brtrue.s IL_0012 - - IL_0034: ldnull - IL_0035: stloc.2 - IL_0036: leave.s IL_004d + IL_0019: ldarg.0 + IL_001a: ldnull + IL_001b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0020: pop + IL_0021: ldloca.s V_0 + IL_0023: ldloc.3 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloc.1 + IL_002b: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0030: brtrue.s IL_0012 + + IL_0032: ldnull + IL_0033: stloc.2 + IL_0034: leave.s IL_004b } finally { - IL_0038: ldloc.1 - IL_0039: isinst [runtime]System.IDisposable - IL_003e: stloc.s V_4 - IL_0040: ldloc.s V_4 - IL_0042: brfalse.s IL_004c - - IL_0044: ldloc.s V_4 - IL_0046: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_004b: endfinally - IL_004c: endfinally + IL_0036: ldloc.1 + IL_0037: isinst [runtime]System.IDisposable + IL_003c: stloc.s V_4 + IL_003e: ldloc.s V_4 + IL_0040: brfalse.s IL_004a + + IL_0042: ldloc.s V_4 + IL_0044: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0049: endfinally + IL_004a: endfinally } - IL_004d: ldloc.2 - IL_004e: pop - IL_004f: ldloca.s V_0 - IL_0051: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0056: ret + IL_004b: ldloc.2 + IL_004c: pop + IL_004d: ldloca.s V_0 + IL_004f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0054: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f00() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f00(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { .maxstack 5 @@ -124,50 +125,92 @@ IL_000f: stloc.1 .try { - IL_0010: br.s IL_0037 + IL_0010: br.s IL_0035 IL_0012: ldloc.1 IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() IL_0018: stloc.3 - IL_0019: ldstr "" - IL_001e: call void [runtime]System.Console::WriteLine(string) - IL_0023: ldloca.s V_0 - IL_0025: ldloc.3 - IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002b: nop - IL_002c: ldloca.s V_0 - IL_002e: ldloc.3 - IL_002f: ldc.i4.1 - IL_0030: add - IL_0031: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0036: nop - IL_0037: ldloc.1 - IL_0038: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003d: brtrue.s IL_0012 - - IL_003f: ldnull - IL_0040: stloc.2 - IL_0041: leave.s IL_0058 + IL_0019: ldarg.0 + IL_001a: ldnull + IL_001b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0020: pop + IL_0021: ldloca.s V_0 + IL_0023: ldloc.3 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloca.s V_0 + IL_002c: ldloc.3 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0034: nop + IL_0035: ldloc.1 + IL_0036: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_003b: brtrue.s IL_0012 + + IL_003d: ldnull + IL_003e: stloc.2 + IL_003f: leave.s IL_0056 } finally { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.s V_4 - IL_004b: ldloc.s V_4 - IL_004d: brfalse.s IL_0057 - - IL_004f: ldloc.s V_4 - IL_0051: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0056: endfinally - IL_0057: endfinally + IL_0041: ldloc.1 + IL_0042: isinst [runtime]System.IDisposable + IL_0047: stloc.s V_4 + IL_0049: ldloc.s V_4 + IL_004b: brfalse.s IL_0055 + + IL_004d: ldloc.s V_4 + IL_004f: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0054: endfinally + IL_0055: endfinally } - IL_0058: ldloc.2 - IL_0059: pop - IL_005a: ldloca.s V_0 - IL_005c: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0061: ret + IL_0056: ldloc.2 + IL_0057: pop + IL_0058: ldloca.s V_0 + IL_005a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_005f: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f000() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_001b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldloc.3 + IL_000c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0011: nop + IL_0012: ldloc.2 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.s 10 + IL_001e: conv.i8 + IL_001f: blt.un.s IL_0007 + + IL_0021: ldloca.s V_0 + IL_0023: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0028: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f1() cil managed @@ -1729,6 +1772,341 @@ IL_0088: ret } + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> + f26(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1> V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldarg.0 + IL_0045: stloc.3 + IL_0046: br.s IL_0066 + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: stloc.s V_4 + IL_004d: ldloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: conv.r8 + IL_0052: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0057: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1>::Add(!0) + IL_005c: nop + IL_005d: ldloc.3 + IL_005e: ldarg.1 + IL_005f: add + IL_0060: stloc.3 + IL_0061: ldloc.2 + IL_0062: ldc.i4.1 + IL_0063: conv.i8 + IL_0064: add + IL_0065: stloc.2 + IL_0066: ldloc.2 + IL_0067: ldloc.0 + IL_0068: blt.un.s IL_0048 + + IL_006a: ldloca.s V_1 + IL_006c: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1>::Close() + IL_0071: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> + f27(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1> V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldarg.0 + IL_0045: stloc.3 + IL_0046: br.s IL_0066 + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: stloc.s V_4 + IL_004d: ldloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: conv.r8 + IL_0052: newobj instance void valuetype [runtime]System.ValueTuple`2::.ctor(!0, + !1) + IL_0057: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1>::Add(!0) + IL_005c: nop + IL_005d: ldloc.3 + IL_005e: ldarg.1 + IL_005f: add + IL_0060: stloc.3 + IL_0061: ldloc.2 + IL_0062: ldc.i4.1 + IL_0063: conv.i8 + IL_0064: add + IL_0065: stloc.2 + IL_0066: ldloc.2 + IL_0067: ldloc.0 + IL_0068: blt.un.s IL_0048 + + IL_006a: ldloca.s V_1 + IL_006c: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1>::Close() + IL_0071: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f28(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldarg.0 + IL_0045: stloc.3 + IL_0046: br.s IL_0062 + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: stloc.s V_4 + IL_004d: nop + IL_004e: ldloc.s V_4 + IL_0050: ldloc.s V_4 + IL_0052: mul + IL_0053: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0058: nop + IL_0059: ldloc.3 + IL_005a: ldarg.1 + IL_005b: add + IL_005c: stloc.3 + IL_005d: ldloc.2 + IL_005e: ldc.i4.1 + IL_005f: conv.i8 + IL_0060: add + IL_0061: stloc.2 + IL_0062: ldloc.2 + IL_0063: ldloc.0 + IL_0064: blt.un.s IL_0048 + + IL_0066: ldloca.s V_1 + IL_0068: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006d: ret + } + } .class private abstract auto ansi sealed ''.$assembly From 5d52462433811f61acc58aa7111475aa7e5f610a Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 8 Mar 2024 11:16:02 -0500 Subject: [PATCH 6/9] Handle simple sequential mappings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Optimize simple mappings containing sequential expressions: ```fsharp [for n in start..finish do f (); …; yield n] ``` --- .../Optimize/LowerComputedCollections.fs | 20 ++- .../ComputedCollections/ForNInRangeArrays.fs | 5 +- .../ForNInRangeArrays.fs.il.bsl | 154 +++++++++++------- .../ComputedCollections/ForNInRangeLists.fs | 5 +- .../ForNInRangeLists.fs.il.bsl | 145 +++++++++++------ .../GeneratedIterators/GenIter02.fs.il.bsl | 99 +++++------ 6 files changed, 254 insertions(+), 174 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 25e810fb294..b479922cdcb 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -415,11 +415,29 @@ module Array = ) ) +/// f (); …; Seq.singleton x +/// +/// E.g., in [for x in … do f (); …; yield x] +[] +let (|SimpleSequential|_|) g expr = + let rec loop expr cont = + match expr with + | Expr.Sequential (expr1, DebugPoints (ValApp g g.seq_singleton_vref (_, [body], _), debug), kind, m) -> + ValueSome (cont (expr1, debug body, kind, m)) + + | Expr.Sequential (expr1, body, kind, m) -> + loop body (cont >> fun body -> Expr.Sequential (expr1, body, kind, m)) + + | _ -> ValueNone + + loop expr Expr.Sequential + /// for … in … -> … [] let (|SimpleMapping|_|) g expr = match expr with - | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_map_vref ([ty1; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = body) as mapping; input], _))], _) -> + | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_map_vref ([ty1; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = body) as mapping; input], _))], _) + | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_collect_vref ([ty1; _; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = SimpleSequential g body) as mapping; input], _))], _) -> ValueSome (ty1, ty2, input, mapping, loopVal, body) | _ -> ValueNone diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs index eafda4c03ab..5e2867fae3a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs @@ -1,6 +1,7 @@ let f0 f = [|for n in 1..10 do f (); yield n|] -let f00 f = [|for n in 1..10 do f (); yield n; yield n + 1|] -let f000 () = [|for n in 1..10 do yield n|] +let f00 f g = [|for n in 1..10 do f (); g (); yield n|] +let f000 f = [|for n in 1..10 do f (); yield n; yield n + 1|] +let f0000 () = [|for n in 1..10 do yield n|] let f1 () = [|for n in 1..10 -> n|] let f2 () = [|for n in 10..1 -> n|] let f3 () = [|for n in 1..1..10 -> n|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl index b1e49e9103e..fe63ecb7138 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs.il.bsl @@ -46,66 +46,108 @@ .method public static int32[] f0(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { - .maxstack 5 - .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 10 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_002a + .maxstack 6 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_0029 - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.3 - IL_0019: ldarg.0 - IL_001a: ldnull - IL_001b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0020: pop - IL_0021: ldloca.s V_0 - IL_0023: ldloc.3 - IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Add(!0) - IL_0029: nop - IL_002a: ldloc.1 - IL_002b: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0030: brtrue.s IL_0012 + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldnull + IL_0018: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001d: pop + IL_001e: ldloc.3 + IL_001f: stelem.i4 + IL_0020: ldloc.2 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldc.i4.s 10 + IL_002c: conv.i8 + IL_002d: blt.un.s IL_0011 - IL_0032: ldnull - IL_0033: stloc.2 - IL_0034: leave.s IL_004b + IL_002f: ldloc.0 + IL_0030: ret + } - } - finally - { - IL_0036: ldloc.1 - IL_0037: isinst [runtime]System.IDisposable - IL_003c: stloc.s V_4 - IL_003e: ldloc.s V_4 - IL_0040: brfalse.s IL_004a - - IL_0042: ldloc.s V_4 - IL_0044: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0049: endfinally - IL_004a: endfinally - } - IL_004b: ldloc.2 - IL_004c: pop - IL_004d: ldloca.s V_0 - IL_004f: call instance !0[] valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ArrayCollector`1::Close() - IL_0054: ret + .method public static int32[] f00(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 6 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_0031 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldnull + IL_0018: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001d: pop + IL_001e: ldarg.1 + IL_001f: ldnull + IL_0020: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0025: pop + IL_0026: ldloc.3 + IL_0027: stelem.i4 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.1 + IL_002d: ldc.i4.1 + IL_002e: conv.i8 + IL_002f: add + IL_0030: stloc.1 + IL_0031: ldloc.1 + IL_0032: ldc.i4.s 10 + IL_0034: conv.i8 + IL_0035: blt.un.s IL_0011 + + IL_0037: ldloc.0 + IL_0038: ret } - .method public static int32[] f00(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + .method public static int32[] f000(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { .maxstack 5 @@ -173,7 +215,7 @@ IL_005f: ret } - .method public static int32[] f000() cil managed + .method public static int32[] f0000() cil managed { .maxstack 5 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs index 456707fba28..3562a5bfa71 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs @@ -1,6 +1,7 @@ let f0 f = [for n in 1..10 do f (); yield n] -let f00 f = [for n in 1..10 do f (); yield n; yield n + 1] -let f000 () = [for n in 1..10 do yield n] +let f00 f g = [|for n in 1..10 do f (); g (); yield n|] +let f000 f = [for n in 1..10 do f (); yield n; yield n + 1] +let f0000 () = [for n in 1..10 do yield n] let f1 () = [for n in 1..10 -> n] let f2 () = [for n in 10..1 -> n] let f3 () = [for n in 1..1..10 -> n] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl index 100cc84ebd9..e5a3adcb69c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeLists.fs.il.bsl @@ -48,64 +48,101 @@ .maxstack 5 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 10 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_002a + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_0023 - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.3 - IL_0019: ldarg.0 - IL_001a: ldnull - IL_001b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0020: pop - IL_0021: ldloca.s V_0 - IL_0023: ldloc.3 - IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0029: nop - IL_002a: ldloc.1 - IL_002b: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0030: brtrue.s IL_0012 + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldarg.0 + IL_000c: ldnull + IL_000d: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0012: pop + IL_0013: ldloc.3 + IL_0014: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0019: nop + IL_001a: ldloc.2 + IL_001b: ldc.i4.1 + IL_001c: add + IL_001d: stloc.2 + IL_001e: ldloc.1 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: add + IL_0022: stloc.1 + IL_0023: ldloc.1 + IL_0024: ldc.i4.s 10 + IL_0026: conv.i8 + IL_0027: blt.un.s IL_0007 - IL_0032: ldnull - IL_0033: stloc.2 - IL_0034: leave.s IL_004b + IL_0029: ldloca.s V_0 + IL_002b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0030: ret + } - } - finally - { - IL_0036: ldloc.1 - IL_0037: isinst [runtime]System.IDisposable - IL_003c: stloc.s V_4 - IL_003e: ldloc.s V_4 - IL_0040: brfalse.s IL_004a - - IL_0042: ldloc.s V_4 - IL_0044: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0049: endfinally - IL_004a: endfinally - } - IL_004b: ldloc.2 - IL_004c: pop - IL_004d: ldloca.s V_0 - IL_004f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0054: ret + .method public static int32[] f00(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 6 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_0031 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldnull + IL_0018: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001d: pop + IL_001e: ldarg.1 + IL_001f: ldnull + IL_0020: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0025: pop + IL_0026: ldloc.3 + IL_0027: stelem.i4 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.1 + IL_002d: ldc.i4.1 + IL_002e: conv.i8 + IL_002f: add + IL_0030: stloc.1 + IL_0031: ldloc.1 + IL_0032: ldc.i4.s 10 + IL_0034: conv.i8 + IL_0035: blt.un.s IL_0011 + + IL_0037: ldloc.0 + IL_0038: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f00(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f000(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { .maxstack 5 @@ -173,7 +210,7 @@ IL_005f: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f000() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f0000() cil managed { .maxstack 4 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter02.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter02.fs.il.bsl index abae1939447..a29c41f8c95 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter02.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GenIter02.fs.il.bsl @@ -43,69 +43,50 @@ extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - squaresOfOneToTenB() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 squaresOfOneToTenB() cil managed { .maxstack 5 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.2 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000e: stloc.1 - .try - { - IL_000f: br.s IL_0033 - - IL_0011: ldloc.1 - IL_0012: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0017: stloc.3 - IL_0018: ldstr "hello" - IL_001d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_0022: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0027: pop - IL_0028: ldloca.s V_0 - IL_002a: ldloc.3 - IL_002b: ldloc.3 - IL_002c: mul - IL_002d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0032: nop - IL_0033: ldloc.1 - IL_0034: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0039: brtrue.s IL_0011 - - IL_003b: ldnull - IL_003c: stloc.2 - IL_003d: leave.s IL_0054 - - } - finally - { - IL_003f: ldloc.1 - IL_0040: isinst [runtime]System.IDisposable - IL_0045: stloc.s V_4 - IL_0047: ldloc.s V_4 - IL_0049: brfalse.s IL_0053 - - IL_004b: ldloc.s V_4 - IL_004d: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0052: endfinally - IL_0053: endfinally - } - IL_0054: ldloc.2 - IL_0055: pop - IL_0056: ldloca.s V_0 - IL_0058: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_005d: ret + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.0 + IL_0004: stloc.2 + IL_0005: br.s IL_002d + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldstr "hello" + IL_0010: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0015: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001a: pop + IL_001b: ldloc.3 + IL_001c: ldloc.3 + IL_001d: mul + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.2 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.2 + IL_0028: ldloc.1 + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldc.i4.3 + IL_002f: conv.i8 + IL_0030: blt.un.s IL_0007 + + IL_0032: ldloca.s V_0 + IL_0034: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0039: ret } } From 88988ec21e46779568454d023e7d5a785ddb767c Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 8 Mar 2024 11:28:31 -0500 Subject: [PATCH 7/9] Consistent indent --- src/Compiler/Optimize/LowerComputedCollections.fs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index b479922cdcb..aa30c022794 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -365,13 +365,14 @@ module Array = /// array let mkArrayInit count mkLoop = mkCompGenLetIn m "array" arrayTy (mkNewArray count) (fun (_, array) -> - let loop = mkLoop (fun idxVar loopVar -> - let body = - body - |> Option.map (fun (loopVal, body) -> mkInvisibleLet m loopVal loopVar body) - |> Option.defaultValue loopVar + let loop = + mkLoop (fun idxVar loopVar -> + let body = + body + |> Option.map (fun (loopVal, body) -> mkInvisibleLet m loopVal loopVar body) + |> Option.defaultValue loopVar - mkAsmExpr ([stelem], [], [array; convToNativeInt NoCheckOvf idxVar; body], [], m)) + mkAsmExpr ([stelem], [], [array; convToNativeInt NoCheckOvf idxVar; body], [], m)) mkSequential m loop array) From 8b590a431f60547a25cb7a96569d279fdce65b70 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 8 Mar 2024 12:03:53 -0500 Subject: [PATCH 8/9] Update baselines --- ...InternalSignatureOff.il.net472.release.bsl | 92 ++++++++----------- ...nternalSignatureOff.il.netcore.release.bsl | 92 ++++++++----------- ...lInternalSignatureOn.il.net472.release.bsl | 92 ++++++++----------- ...InternalSignatureOn.il.netcore.release.bsl | 92 ++++++++----------- 4 files changed, 148 insertions(+), 220 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl index 155ad0265cc..0b0542bcd06 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl @@ -679,63 +679,45 @@ .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ListExpressionSteppingTest7() cil managed { - .maxstack 5 + .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.4 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000e: stloc.1 - .try - { - IL_000f: br.s IL_0031 - - IL_0011: ldloc.1 - IL_0012: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0017: stloc.3 - IL_0018: ldstr "hello" - IL_001d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_0022: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0027: pop - IL_0028: ldloca.s V_0 - IL_002a: ldloc.3 - IL_002b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0030: nop - IL_0031: ldloc.1 - IL_0032: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0037: brtrue.s IL_0011 - - IL_0039: ldnull - IL_003a: stloc.2 - IL_003b: leave.s IL_0052 + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_002b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldstr "hello" + IL_0010: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0015: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001a: pop + IL_001b: ldloc.3 + IL_001c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0021: nop + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldc.i4.4 + IL_002d: conv.i8 + IL_002e: blt.un.s IL_0007 - } - finally - { - IL_003d: ldloc.1 - IL_003e: isinst [runtime]System.IDisposable - IL_0043: stloc.s V_4 - IL_0045: ldloc.s V_4 - IL_0047: brfalse.s IL_0051 - - IL_0049: ldloc.s V_4 - IL_004b: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0050: endfinally - IL_0051: endfinally - } - IL_0052: ldloc.2 - IL_0053: pop - IL_0054: ldloca.s V_0 - IL_0056: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_005b: ret + IL_0030: ldloca.s V_0 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret } .property int32 r() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl index 3d78a971d68..885135c69e6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl @@ -680,63 +680,45 @@ .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ListExpressionSteppingTest7() cil managed { - .maxstack 5 + .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.4 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000e: stloc.1 - .try - { - IL_000f: br.s IL_0031 - - IL_0011: ldloc.1 - IL_0012: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0017: stloc.3 - IL_0018: ldstr "hello" - IL_001d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_0022: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0027: pop - IL_0028: ldloca.s V_0 - IL_002a: ldloc.3 - IL_002b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0030: nop - IL_0031: ldloc.1 - IL_0032: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0037: brtrue.s IL_0011 - - IL_0039: ldnull - IL_003a: stloc.2 - IL_003b: leave.s IL_0052 + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_002b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldstr "hello" + IL_0010: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0015: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001a: pop + IL_001b: ldloc.3 + IL_001c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0021: nop + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldc.i4.4 + IL_002d: conv.i8 + IL_002e: blt.un.s IL_0007 - } - finally - { - IL_003d: ldloc.1 - IL_003e: isinst [runtime]System.IDisposable - IL_0043: stloc.s V_4 - IL_0045: ldloc.s V_4 - IL_0047: brfalse.s IL_0051 - - IL_0049: ldloc.s V_4 - IL_004b: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0050: endfinally - IL_0051: endfinally - } - IL_0052: ldloc.2 - IL_0053: pop - IL_0054: ldloca.s V_0 - IL_0056: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_005b: ret + IL_0030: ldloca.s V_0 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret } .property int32 r() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl index 66a9fd3e0d5..0022e910a22 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl @@ -681,63 +681,45 @@ .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ListExpressionSteppingTest7() cil managed { - .maxstack 5 + .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.4 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000e: stloc.1 - .try - { - IL_000f: br.s IL_0031 - - IL_0011: ldloc.1 - IL_0012: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0017: stloc.3 - IL_0018: ldstr "hello" - IL_001d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_0022: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0027: pop - IL_0028: ldloca.s V_0 - IL_002a: ldloc.3 - IL_002b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0030: nop - IL_0031: ldloc.1 - IL_0032: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0037: brtrue.s IL_0011 - - IL_0039: ldnull - IL_003a: stloc.2 - IL_003b: leave.s IL_0052 + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_002b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldstr "hello" + IL_0010: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0015: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001a: pop + IL_001b: ldloc.3 + IL_001c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0021: nop + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldc.i4.4 + IL_002d: conv.i8 + IL_002e: blt.un.s IL_0007 - } - finally - { - IL_003d: ldloc.1 - IL_003e: isinst [runtime]System.IDisposable - IL_0043: stloc.s V_4 - IL_0045: ldloc.s V_4 - IL_0047: brfalse.s IL_0051 - - IL_0049: ldloc.s V_4 - IL_004b: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0050: endfinally - IL_0051: endfinally - } - IL_0052: ldloc.2 - IL_0053: pop - IL_0054: ldloca.s V_0 - IL_0056: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_005b: ret + IL_0030: ldloca.s V_0 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret } .method private specialname rtspecialname static void .cctor() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl index 9be862b2fd6..64016951d4d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl @@ -682,63 +682,45 @@ .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ListExpressionSteppingTest7() cil managed { - .maxstack 5 + .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, - class [runtime]System.Collections.Generic.IEnumerable`1 V_2, - int32 V_3, - class [runtime]System.IDisposable V_4) - IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.4 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000e: stloc.1 - .try - { - IL_000f: br.s IL_0031 - - IL_0011: ldloc.1 - IL_0012: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0017: stloc.3 - IL_0018: ldstr "hello" - IL_001d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_0022: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0027: pop - IL_0028: ldloca.s V_0 - IL_002a: ldloc.3 - IL_002b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0030: nop - IL_0031: ldloc.1 - IL_0032: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_0037: brtrue.s IL_0011 - - IL_0039: ldnull - IL_003a: stloc.2 - IL_003b: leave.s IL_0052 + uint64 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_002b + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: stloc.3 + IL_000b: ldstr "hello" + IL_0010: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0015: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001a: pop + IL_001b: ldloc.3 + IL_001c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0021: nop + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldc.i4.4 + IL_002d: conv.i8 + IL_002e: blt.un.s IL_0007 - } - finally - { - IL_003d: ldloc.1 - IL_003e: isinst [runtime]System.IDisposable - IL_0043: stloc.s V_4 - IL_0045: ldloc.s V_4 - IL_0047: brfalse.s IL_0051 - - IL_0049: ldloc.s V_4 - IL_004b: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0050: endfinally - IL_0051: endfinally - } - IL_0052: ldloc.2 - IL_0053: pop - IL_0054: ldloca.s V_0 - IL_0056: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_005b: ret + IL_0030: ldloca.s V_0 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret } .method private specialname rtspecialname static void .cctor() cil managed From 5da1a7c18820ecf3502d4741ec226aca0ab5857a Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 8 Mar 2024 17:23:12 -0500 Subject: [PATCH 9/9] Shorter lines, more comments --- .../Optimize/LowerComputedCollections.fs | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index aa30c022794..18eafb2c6de 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -433,13 +433,44 @@ let (|SimpleSequential|_|) g expr = loop expr Expr.Sequential +/// The representation used for +/// /// for … in … -> … +/// +/// and +/// +/// for … in … do yield … +[] +let (|SeqMap|_|) g expr = + match expr with + | ValApp g g.seq_map_vref ([ty1; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = body) as mapping; input], _) -> + ValueSome (ty1, ty2, input, mapping, loopVal, body) + | _ -> ValueNone + +/// The representation used for +/// +/// for … in … do f (); …; yield … +[] +let (|SeqCollectSingle|_|) g expr = + match expr with + | ValApp g g.seq_collect_vref ([ty1; _; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = SimpleSequential g body) as mapping; input], _) -> + ValueSome (ty1, ty2, input, mapping, loopVal, body) + | _ -> ValueNone + +/// for … in … -> … +/// for … in … do yield … +/// for … in … do f (); …; yield … [] let (|SimpleMapping|_|) g expr = match expr with - | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_map_vref ([ty1; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = body) as mapping; input], _))], _) - | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = ValApp g g.seq_collect_vref ([ty1; _; ty2], [Expr.Lambda (valParams = [loopVal]; bodyExpr = SimpleSequential g body) as mapping; input], _))], _) -> + // for … in … -> … + // for … in … do yield … + | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = SeqMap g (ty1, ty2, input, mapping, loopVal, body))], _) + + // for … in … do f (); …; yield … + | ValApp g g.seq_delay_vref (_, [Expr.Lambda (bodyExpr = SeqCollectSingle g (ty1, ty2, input, mapping, loopVal, body))], _) -> ValueSome (ty1, ty2, input, mapping, loopVal, body) + | _ -> ValueNone let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap ilTyForTy overallExpr =