From 105cc21e67be93b19fac47633fbaae7d120656ce Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Sun, 4 Feb 2024 20:16:52 -0500 Subject: [PATCH 01/66] Lower integral ranges to fast while-loops * Lower for-loops over integral ranges to fast while-loops for all built-in integral types. * Lower `[start..finish]`, `[start..step..finish]`, `[|start..finish|]`, `[|start..step..finish|]` to fast integral while-loop initializers. --- .../Optimize/LowerComputedCollections.fs | 405 +++++++++++++++++- src/Compiler/TypedTree/TcGlobals.fs | 20 + src/Compiler/TypedTree/TypedTreeOps.fs | 393 ++++++++++++++++- src/Compiler/TypedTree/TypedTreeOps.fsi | 30 ++ 4 files changed, 836 insertions(+), 12 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 2de57119ff3..4a7d98580b6 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -2,7 +2,7 @@ module internal FSharp.Compiler.LowerComputedCollectionExpressions -open Internal.Utilities.Library +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.InfoReader @@ -12,6 +12,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.TypeRelations open FSharp.Compiler.TypedTree +open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TypeHierarchy @@ -255,18 +256,410 @@ let (|SeqToArray|_|) g expr = | ValApp g g.seq_to_array_vref (_, [seqExpr], m) -> ValueSome (seqExpr, m) | _ -> ValueNone +[] +module IntegralConst = + /// Constant 0. + [] + let (|Zero|_|) expr = + match expr with + | Const.Zero + | Const.Int32 0 + | Const.Int64 0L + | Const.UInt64 0UL + | Const.UInt32 0u + | Const.IntPtr 0L + | Const.UIntPtr 0UL + | Const.Int16 0s + | Const.UInt16 0us + | Const.SByte 0y + | Const.Byte 0uy + | Const.Char '\000' -> ValueSome Zero + | _ -> ValueNone + + /// Constant 1. + [] + let (|One|_|) expr = + match expr with + | Const.Int32 1 + | Const.Int64 1L + | Const.UInt64 1UL + | Const.UInt32 1u + | Const.IntPtr 1L + | Const.UIntPtr 1UL + | Const.Int16 1s + | Const.UInt16 1us + | Const.SByte 1y + | Const.Byte 1uy + | Const.Char '\001' -> ValueSome One + | _ -> ValueNone + + /// Constant -1. + [] + let (|MinusOne|_|) expr = + match expr with + | Const.Int32 -1 + | Const.Int64 -1L + | Const.IntPtr -1L + | Const.Int16 -1s + | Const.SByte -1y -> ValueSome MinusOne + | _ -> ValueNone + +/// Note: this assumes that an empty range has already been checked for +/// (otherwise the conversion operations here might overflow). +[] +let (|ConstCount|_|) (start, step, finish) = + match start, step, finish with + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (Const.Int32 ((finish - start) / step + 1)) + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.Int64 ((finish - start) / step + 1L)) + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (Const.UInt64 ((finish - start) / step + 1UL)) + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (Const.UInt32 ((finish - start) / step + 1u)) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.IntPtr ((finish - start) / step + 1L)) + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) -> ValueSome (Const.UIntPtr ((finish - start) / step + 1UL)) + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (Const.Int16 ((finish - start) / step + 1s)) + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (Const.UInt16 ((finish - start) / step + 1us)) + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (Const.SByte ((finish - start) / step + 1y)) + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (Const.Byte ((finish - start) / step + 1uy)) + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (Const.Char (char (uint16 (finish - start) / uint16 step) + '\001')) + | _ -> ValueNone + let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = // If ListCollector is in FSharp.Core then this optimization kicks in if g.ListCollector_tcr.CanDeref then + /// Make an expression holding the count + /// to initialize the collection with. + let mkCount m rangeExpr ty start step finish = + match step with + // step = 1: + // finish - start + 1 + | Expr.Const (value = IntegralConst.One) -> + let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) + mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) + + // step = -1: + // -(finish - start) + 1 + | Expr.Const (value = IntegralConst.MinusOne) -> + let diff = mkAsmExpr ([AI_neg], [], [mkAsmExpr ([AI_sub], [], [finish; start], [ty], m)], [ty], m) + mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) + + // step = : + // (finish - start) / step + 1 + | Expr.Const (value = _notOneOrMinusOne) -> + let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) + + let quotient = + if isSignedIntegerTy g ty then + mkAsmExpr ([AI_div], [], [diff; step], [ty], m) + else + mkAsmExpr ([AI_div_un], [], [diff; step], [ty], m) + + mkAsmExpr ([AI_add], [], [quotient; mkOne g m], [ty], m) + + // Arbitrary step: + // (finish - start) / step + 1 + | _notConst -> + // Use the potentially-evaluated-and-bound start, step, and finish. + let rangeExpr = + match rangeExpr with + | Expr.App (funcExpr, formalType, tyargs, _, m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) + | _ -> rangeExpr + + /// This will raise an exception at runtime if step is zero. + let callAndIgnoreRangeExpr = + mkSequential + m + rangeExpr + (mkUnit g m) + + // Let the range call throw the appropriate localized + // exception at runtime if step is zero: + // if step = 0 then (.. ..) start step finish + let throwIfStepIsZero = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + g.unit_ty + (mkILAsmCeq g m step (mkZero g m)) + callAndIgnoreRangeExpr + (mkUnit g m) + + let count = + let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) + + let quotient = + if isSignedIntegerTy g ty then + mkAsmExpr ([AI_div], [], [diff; step], [ty], m) + else + mkAsmExpr ([AI_div_un], [], [diff; step], [ty], m) + + mkAsmExpr ([AI_add], [], [quotient; mkOne g m], [ty], m) + + mkSequential m throwIfStepIsZero count + + /// Triggers an overflow exception at runtime if count doesn't fit in a native int. + let convToNativeIntWithOverflow m overallElemTy count = + if typeEquiv g overallElemTy g.int64_ty then mkAsmExpr ([AI_conv_ovf DT_I], [], [count], [g.nativeint_ty], m) + elif typeEquiv g overallElemTy g.uint64_ty then mkAsmExpr ([AI_conv_ovf_un DT_I], [], [count], [g.nativeint_ty], m) + else count + + let mkSignednessAppropriateClt g m ty e1 e2 = + if isSignedIntegerTy g ty then + mkILAsmClt g m e1 e2 + else + mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) + + /// Bind start, step, and finish exprs to local variables if needed, e.g., + /// + /// [start..finishExpr] → let finish = finishExpr in … + /// + /// [startExpr..finish] → let start = startExpr in … + /// + /// [startExpr..finishExpr] → let start = startExpr in let finish = finishExpr in … + let mkLetBindingsIfNeeded m ty start step finish mkInitExpr = + match start, step, finish with + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + mkInitExpr start step finish + + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish) + + | _, (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkInitExpr start step finish) + + | (Expr.Const _ | Expr.Val _), _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkInitExpr start step finish) + + | _, (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish)) + + | (Expr.Const _ | Expr.Val _), _, _ -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish)) + + | _, _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkInitExpr start step finish)) + + | _, _, _ -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish))) + + let mkIlTy m ty = + let ty = stripMeasuresFromTy g ty + if typeEquiv g ty g.int32_ty then g.ilg.typ_Int32 + elif typeEquiv g ty g.int64_ty then g.ilg.typ_Int64 + elif typeEquiv g ty g.uint64_ty then g.ilg.typ_UInt64 + elif typeEquiv g ty g.uint32_ty then g.ilg.typ_UInt32 + elif typeEquiv g ty g.nativeint_ty then g.ilg.typ_IntPtr + elif typeEquiv g ty g.unativeint_ty then g.ilg.typ_UIntPtr + elif typeEquiv g ty g.int16_ty then g.ilg.typ_Int16 + elif typeEquiv g ty g.uint16_ty then g.ilg.typ_UInt16 + elif typeEquiv g ty g.sbyte_ty then g.ilg.typ_SByte + elif typeEquiv g ty g.byte_ty then g.ilg.typ_Byte + elif typeEquiv g ty g.char_ty then g.ilg.typ_Char + else error(InternalError($"Unrecognized integral type '{ty}'.", m)) match overallExpr with + // […] | SeqToList g (OptionalCoerce (OptionalSeq g amap (overallSeqExpr, overallElemTy)), m) -> - let collectorTy = g.mk_ListCollector_ty overallElemTy - LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr - + match overallSeqExpr with + // [start..0..finish] → let the default implementation raise an exception. + | IntegralRange g (_, (_, Expr.Const (value = IntegralConst.Zero), _)) -> + let collectorTy = g.mk_ListCollector_ty overallElemTy + LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr + + // [5..1] → [] + // [1..-1..5] → [] + | IntegralRange g (_, EmptyRange) -> + Some (mkNil g m overallElemTy) + + // [start..finish] + // [start..step..finish] + | IntegralRange g (_, (start, step, finish)) -> + let collectorTy = g.mk_ListCollector_ty overallElemTy + + let expr = + mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> + mkCompGenLetMutableIn m "collector" collectorTy (mkDefault (m, collectorTy)) (fun (_, collector) -> + mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> + let reader = InfoReader (g, amap) + + let body = mkCallCollectorAdd tcVal g reader m collector loopVar + + let loop = + mkOptimizedRangeLoop + g + (m, m, m, DebugPointAtWhile.No) + (overallElemTy, overallSeqExpr) + (start, step, finish) + (loopVarVal, loopVar) + body + + let close = mkCallCollectorClose tcVal g reader m collector + + mkSequential m loop close + ) + ) + ) + + Some expr + + // [(* Anything more complex. *)] + | _ -> + let collectorTy = g.mk_ListCollector_ty overallElemTy + LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr + + // [|…|] | SeqToArray g (OptionalCoerce (OptionalSeq g amap (overallSeqExpr, overallElemTy)), m) -> - let collectorTy = g.mk_ArrayCollector_ty overallElemTy - LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr + match overallSeqExpr with + // [|start..0..finish|] → let the default implementation raise an exception. + | IntegralRange g (_, (_, Expr.Const (value = IntegralConst.Zero), _)) -> + let collectorTy = g.mk_ArrayCollector_ty overallElemTy + LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr + + // [|5..1|] → [||] + // [|1..-1..5|] → [||] + | IntegralRange g (_, EmptyRange) -> + Some (mkArray (overallElemTy, [], m)) + + // [|1..5|] + // [|1..2..5|] + | IntegralRange g (_, (start, step, _) & ConstCount count) -> + let arrayTy = mkArrayType g overallElemTy + + // (# "newarr !0" type ('T) count : 'T array #) + let array = + mkAsmExpr + ( + [I_newarr (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], + [], + [convToNativeIntWithOverflow m overallElemTy (Expr.Const (count, m, overallElemTy))], + [arrayTy], + m + ) + + let expr = + mkCompGenLetIn m (nameof array) arrayTy array (fun (_, array) -> + mkCompGenLetMutableIn m "i" g.int32_ty (mkZero g m) (fun (iVal, i) -> + mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> + // array[i] <- loopVar + let setArrSubI = mkAsmExpr ([I_stelem_any (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], [], [array; i; loopVar], [], m) + + // loopVar <- loopVar + step + let incrV = mkValSet m (mkLocalValRef loopVarVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [overallElemTy], m)) + + // i <- i + 1 + let incrI = mkValSet m (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkOne g m], [g.int32_ty], m)) + + let body = mkSequentials g m [setArrSubI; incrV; incrI] + + let guard = mkILAsmClt g m i (mkLdlen g m array) + + let loop = + mkWhile + g + ( + DebugPointAtWhile.No, + NoSpecialWhileLoopMarker, + guard, + body, + m + ) + + // while i < array.Length do done + // array + mkSequential m loop array + ) + ) + ) + + Some expr + + // [|start..finish|] + // [|start..step..finish|] + | IntegralRange g (_, (start, step, finish)) -> + let expr = + mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> + mkCompGenLetIn m "count" overallElemTy (mkCount m overallSeqExpr overallElemTy start step finish) (fun (_, count) -> + let arrayTy = mkArrayType g overallElemTy + + // count < 1 + let countLtOne = mkSignednessAppropriateClt g m overallElemTy count (mkOne g m) + + // [||] + let empty = mkArray (overallElemTy, [], m) + + // (# "newarr !0" type ('T) count : 'T array #) + let array = + mkAsmExpr + ( + [I_newarr (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], + [], + [convToNativeIntWithOverflow m overallElemTy count], + [arrayTy], + m + ) + + let initialize = + mkCompGenLetIn m (nameof array) arrayTy array (fun (_, array) -> + mkCompGenLetMutableIn m "i" g.int32_ty (mkZero g m) (fun (iVal, i) -> + mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> + // array[i] <- loopVar + let setArrSubI = mkAsmExpr ([I_stelem_any (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], [], [array; i; loopVar], [], m) + + // loopVar <- loopVar + step + let incrV = mkValSet m (mkLocalValRef loopVarVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [overallElemTy], m)) + + // i <- i + 1 + let incrI = mkValSet m (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkOne g m], [g.int32_ty], m)) + + let body = mkSequentials g m [setArrSubI; incrV; incrI] + + let guard = mkILAsmClt g m i (mkLdlen g m array) + + let loop = + mkWhile + g + ( + DebugPointAtWhile.No, + NoSpecialWhileLoopMarker, + guard, + body, + m + ) + + // while i < array.Length do done + // array + mkSequential m loop array + ) + ) + ) + + // if count < 1 then [||] else + mkCond + DebugPointAtBinding.NoneAtInvisible + m + arrayTy + countLtOne + empty + initialize + ) + ) + + Some expr + + // [|(* Anything more complex. *)|] + | _ -> + let collectorTy = g.mk_ArrayCollector_ty overallElemTy + LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr | _ -> None else diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 3830dd008e5..78584629a25 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -809,6 +809,16 @@ type TcGlobals( let v_range_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Range" , None , None , [vara], ([[varaTy];[varaTy]], mkSeqTy varaTy)) let v_range_step_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_RangeStep" , None , None , [vara;varb], ([[varaTy];[varbTy];[varaTy]], mkSeqTy varaTy)) let v_range_int32_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeInt32" , None , None , [], ([[v_int_ty];[v_int_ty];[v_int_ty]], mkSeqTy v_int_ty)) + let v_range_int64_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeInt64" , None , None , [], ([[v_int64_ty];[v_int64_ty];[v_int64_ty]], mkSeqTy v_int64_ty)) + let v_range_uint64_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUInt64" , None , None , [], ([[v_uint64_ty];[v_uint64_ty];[v_uint64_ty]], mkSeqTy v_uint64_ty)) + let v_range_uint32_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUInt32" , None , None , [], ([[v_uint32_ty];[v_uint32_ty];[v_uint32_ty]], mkSeqTy v_uint32_ty)) + let v_range_nativeint_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeIntPtr" , None , None , [], ([[v_nativeint_ty];[v_nativeint_ty];[v_nativeint_ty]], mkSeqTy v_nativeint_ty)) + let v_range_unativeint_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUIntPtr" , None , None , [], ([[v_unativeint_ty];[v_unativeint_ty];[v_unativeint_ty]], mkSeqTy v_unativeint_ty)) + let v_range_int16_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeInt16" , None , None , [], ([[v_int16_ty];[v_int16_ty];[v_int16_ty]], mkSeqTy v_int16_ty)) + let v_range_uint16_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUInt16" , None , None , [], ([[v_uint16_ty];[v_uint16_ty];[v_uint16_ty]], mkSeqTy v_uint16_ty)) + let v_range_sbyte_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeSByte" , None , None , [], ([[v_sbyte_ty];[v_sbyte_ty];[v_sbyte_ty]], mkSeqTy v_sbyte_ty)) + let v_range_byte_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeByte" , None , None , [], ([[v_byte_ty];[v_byte_ty];[v_byte_ty]], mkSeqTy v_byte_ty)) + let v_range_char_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeChar" , None , None , [], ([[v_char_ty];[v_char_ty];[v_char_ty]], mkSeqTy v_char_ty)) let v_array_length_info = makeIntrinsicValRef(fslib_MFArrayModule_nleref, "length" , None , Some "Length" , [vara], ([[mkArrayType 1 varaTy]], v_int_ty)) let v_array_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray" , None , None , [vara], ([[mkArrayType 1 varaTy]; [v_int_ty]], varaTy)) @@ -1687,6 +1697,16 @@ type TcGlobals( member val range_op_vref = ValRefForIntrinsic v_range_op_info member val range_step_op_vref = ValRefForIntrinsic v_range_step_op_info member val range_int32_op_vref = ValRefForIntrinsic v_range_int32_op_info + member val range_int64_op_vref = ValRefForIntrinsic v_range_int64_op_info + member val range_uint64_op_vref = ValRefForIntrinsic v_range_uint64_op_info + member val range_uint32_op_vref = ValRefForIntrinsic v_range_uint32_op_info + member val range_nativeint_op_vref = ValRefForIntrinsic v_range_nativeint_op_info + member val range_unativeint_op_vref = ValRefForIntrinsic v_range_unativeint_op_info + member val range_int16_op_vref = ValRefForIntrinsic v_range_int16_op_info + member val range_uint16_op_vref = ValRefForIntrinsic v_range_uint16_op_info + member val range_sbyte_op_vref = ValRefForIntrinsic v_range_sbyte_op_info + member val range_byte_op_vref = ValRefForIntrinsic v_range_byte_op_info + member val range_char_op_vref = ValRefForIntrinsic v_range_char_op_info member val array_get_vref = ValRefForIntrinsic v_array_get_info member val array2D_get_vref = ValRefForIntrinsic v_array2D_get_info member val array3D_get_vref = ValRefForIntrinsic v_array3D_get_info diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 8ef6ce62182..bea18489dc3 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -8326,6 +8326,10 @@ let mkCompGenLetIn m nm ty e f = let v, ve = mkCompGenLocal m nm ty mkCompGenLet m v e (f (v, ve)) +let mkCompGenLetMutableIn m nm ty e f = + let v, ve = mkMutableCompGenLocal m nm ty + mkCompGenLet m v e (f (v, ve)) + /// Take a node representing a coercion from one function type to another, e.g. /// A -> A * A -> int /// to @@ -10103,6 +10107,376 @@ let (|CompiledInt32RangeForEachExpr|_|) g expr = Some (startExpr, step, finishExpr, elemVar, bodyExpr, ranges) | _ -> None +let (|ValApp|_|) g vref expr = + match expr with + | Expr.App (Expr.Val (vref2, _, _), _f0ty, tyargs, args, m) when valRefEq g vref vref2 -> Some (tyargs, args, m) + | _ -> None + +[] +module IntegralConst = + /// Constant 0. + [] + let (|Zero|_|) expr = + match expr with + | Const.Zero + | Const.Int32 0 + | Const.Int64 0L + | Const.UInt64 0UL + | Const.UInt32 0u + | Const.IntPtr 0L + | Const.UIntPtr 0UL + | Const.Int16 0s + | Const.UInt16 0us + | Const.SByte 0y + | Const.Byte 0uy + | Const.Char '\000' -> ValueSome Zero + | _ -> ValueNone + + /// Positive constant. + [] + let (|Positive|_|) expr = + match expr with + | Const.Int32 v when v > 0 -> ValueSome Positive + | Const.Int64 v when v > 0L -> ValueSome Positive + | Const.IntPtr v when v > 0L -> ValueSome Positive + | Const.Int16 v when v > 0s -> ValueSome Positive + | Const.SByte v when v > 0y -> ValueSome Positive + | Const.UInt64 v when v > 0UL -> ValueSome Positive + | Const.UInt32 v when v > 0u -> ValueSome Positive + | Const.UIntPtr v when v > 0UL -> ValueSome Positive + | Const.UInt16 v when v > 0us -> ValueSome Positive + | Const.Byte v when v > 0uy -> ValueSome Positive + | Const.Char v when v > '\000' -> ValueSome Positive + | _ -> ValueNone + +/// start..finish +/// start..step..finish +[] +let (|IntegralRange|_|) g expr = + match expr with + | ValApp g g.range_int32_op_vref ([], [start; step; finish], _) -> ValueSome (g.int32_ty, (start, step, finish)) + | ValApp g g.range_int64_op_vref ([], [start; step; finish], _) -> ValueSome (g.int64_ty, (start, step, finish)) + | ValApp g g.range_uint64_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint64_ty, (start, step, finish)) + | ValApp g g.range_uint32_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint32_ty, (start, step, finish)) + | ValApp g g.range_nativeint_op_vref ([], [start; step; finish], _) -> ValueSome (g.nativeint_ty, (start, step, finish)) + | ValApp g g.range_unativeint_op_vref ([], [start; step; finish], _) -> ValueSome (g.unativeint_ty, (start, step, finish)) + | ValApp g g.range_int16_op_vref ([], [start; step; finish], _) -> ValueSome (g.int16_ty, (start, step, finish)) + | ValApp g g.range_uint16_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint16_ty, (start, step, finish)) + | ValApp g g.range_sbyte_op_vref ([], [start; step; finish], _) -> ValueSome (g.sbyte_ty, (start, step, finish)) + | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) + | ValApp g g.range_char_op_vref ([], [start; step; finish], _) -> ValueSome (g.char_ty, (start, step, finish)) + | _ -> ValueNone + +/// 5..1 +/// 1..-5 +/// 1..-1..5 +/// -5..-1..-1 +/// 5..2..1 +[] +let (|EmptyRange|_|) (start, step, finish) = + match start, step, finish with + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) when finish < start && step > 0 || finish > start && step < 0 -> ValueSome EmptyRange + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when finish < start && step > 0L || finish > start && step < 0L -> ValueSome EmptyRange + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 _), Expr.Const (value = Const.UInt64 finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 _), Expr.Const (value = Const.UInt32 finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when finish < start && step > 0L || finish > start && step < 0L -> ValueSome EmptyRange + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr _), Expr.Const (value = Const.UIntPtr finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) when finish < start && step > 0s || finish > start && step < 0s -> ValueSome EmptyRange + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 _), Expr.Const (value = Const.UInt16 finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when finish < start && step > 0y || finish > start && step < 0y -> ValueSome EmptyRange + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte _), Expr.Const (value = Const.Byte finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char _), Expr.Const (value = Const.Char finish) when finish < start -> ValueSome EmptyRange + | _ -> ValueNone + +/// 1..5 → start <= finish && step > 0 → FSharpForLoopUp +/// 1..2..5 → start <= finish && step > 0 → FSharpForLoopUp +/// 1..-2..-5 → finish < start && step < 0 → FSharpForLoopDown +[] +let (|ConstRange|_|) (start, step, finish) = + let inline upOrDown start step finish = + assert (step <> LanguagePrimitives.GenericZero) + assert (start <= finish && step > LanguagePrimitives.GenericZero || finish < start && step < LanguagePrimitives.GenericZero) + + if start <= finish && step > LanguagePrimitives.GenericZero then + FSharpForLoopUp + else + FSharpForLoopDown + + match start, step, finish with + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (upOrDown start step finish) + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (upOrDown start step finish) + | _ -> ValueNone + +/// If the start and finish are constant, +/// we can generate a simpler runtime check to determine +/// whether the range is empty. +/// +/// 1..step..5 +[] +let (|ConstStartAndFinish|_|) (start, _step, finish) = + match start, finish with + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown + | _ -> ValueNone + +let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (loopVarVal: Val, loopVar) body = + let mkNecessaryLetBindingsFor f = + let setLoopVarAndBindRest start = + mkSequential mFor (mkValSet loopVarVal.Range (mkLocalValRef loopVarVal) start) ( + match step, finish with + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + f (loopVarVal, loopVar) start step finish + + | (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + f (loopVarVal, loopVar) start step finish) + + | _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + f (loopVarVal, loopVar) start step finish) + + | _, _ -> + mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + f (loopVarVal, loopVar) start step finish)) + ) + + match start with + | Expr.Const _ | Expr.Val _ -> setLoopVarAndBindRest start + | _ -> mkCompGenLetIn mFor "originalStart" rangeTy start (fun (_, start) -> setLoopVarAndBindRest start) + + let mkSignednessAppropriateClt g m e1 e2 = + if isSignedIntegerTy g rangeTy then + mkILAsmClt g m e1 e2 + else + mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) + + /// while start <= finish do … + let mkUp (startVal, start) originalStart step finish = + let origStartLtEqStart = + mkCond + DebugPointAtBinding.NoneAtInvisible + mFor + g.bool_ty + (mkSignednessAppropriateClt g mFor originalStart start) + (mkTrue g mFor) + (mkILAsmCeq g mFor originalStart start) + + // if start < finish then originalStart <= start else start = finish + let guard = + mkCond + DebugPointAtBinding.NoneAtInvisible + mFor + g.bool_ty + (mkSignednessAppropriateClt g mFor start finish) + origStartLtEqStart + (mkILAsmCeq g mFor start finish) + + let incr = mkValSet mIn (mkLocalValRef startVal) (mkAsmExpr ([AI_add], [], [start; step], [rangeTy], mIn)) + + mkWhile + g + ( + spInWhile, + WhileLoopForCompiledForEachExprMarker, + guard, + mkCompGenSequential mIn body incr, + mBody + ) + + /// while finish <= start do … + let mkDown (startVal, start) originalStart step finish = + let startLtEqOrigStart = + mkCond + DebugPointAtBinding.NoneAtInvisible + mFor + g.bool_ty + (mkSignednessAppropriateClt g mFor start originalStart) + (mkTrue g mFor) + (mkILAsmCeq g mFor start originalStart) + + // if finish < start then start <= originalStart else finish = start + let guard = + mkCond + DebugPointAtBinding.NoneAtInvisible + mFor + g.bool_ty + (mkSignednessAppropriateClt g mFor finish start) + startLtEqOrigStart + (mkILAsmCeq g mFor finish start) + + let incr = mkValSet mIn (mkLocalValRef startVal) (mkAsmExpr ([AI_add], [], [start; step], [rangeTy], mIn)) + + mkWhile + g + ( + spInWhile, + WhileLoopForCompiledForEachExprMarker, + guard, + mkCompGenSequential mIn body incr, + mBody + ) + + /// This will raise an exception at runtime if step is zero. + let callAndIgnoreRangeExpr start step finish = + // Use the potentially-evaluated-and-bound start, step, and finish. + let rangeExpr = + match rangeExpr with + | Expr.App (funcExpr, formalType, tyargs, _, m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) + | _ -> rangeExpr + + mkSequential + mBody + rangeExpr + (mkUnit g mIn) + + /// Emits logic to handle arbitrary start, step, and finish values at runtime. + let mkIntegralWhileLoop (startVal, start) originalStart step finish = + match originalStart, step, finish with + // Dynamic start and/or finish, but positive constant step. + // + // step > 0: + // if finish < start then () + // else + | _, Expr.Const (value = IntegralConst.Positive), _ -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkSignednessAppropriateClt g mIn finish start) + (mkUnit g mIn) + (mkUp (startVal, start) originalStart step finish) + + // Dynamic start and/or finish, but negative constant step. + // + // step < 0: + // if start < finish then () + // else + | _, Expr.Const (value = _negative), _ -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkSignednessAppropriateClt g mIn start finish) + (mkUnit g mIn) + (mkDown (startVal, start) originalStart step finish) + + // Dynamic step, but constant start and finish. + // + // start <= finish: + // if step = 0 then + // elif step < 0 then () + // else + | ConstStartAndFinish FSharpForLoopUp -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkILAsmCeq g mIn step (mkZero g mIn)) + (callAndIgnoreRangeExpr start step finish) + ( + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkSignednessAppropriateClt g mIn step (mkZero g mIn)) + (mkUnit g mIn) + (mkUp (startVal, start) originalStart step finish) + ) + + // Dynamic step, but constant start and finish. + // + // finish < start: + // if step = 0 then + // elif 0 < step then () + // else + | ConstStartAndFinish FSharpForLoopDown -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkILAsmCeq g mIn step (mkZero g mIn)) + (callAndIgnoreRangeExpr start step finish) + ( + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkSignednessAppropriateClt g mIn (mkZero g mIn) step) + (mkUnit g mIn) + (mkDown (startVal, start) originalStart step finish) + ) + + // Unsigned ranges can only ever go up. + // + // if step = 0 then + // else (* 0 < step *) + | _ when isUnsignedIntegerTy g rangeTy -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkILAsmCeq g mIn step (mkZero g mIn)) + (callAndIgnoreRangeExpr start step finish) + (mkUp (startVal, start) originalStart step finish) + + // Any other combination of dynamic exprs. + // + // if step = 0 then + // elif 0 < step then + // else (* step < 0 *) + | _ -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkILAsmCeq g mIn step (mkZero g mIn)) + (callAndIgnoreRangeExpr start step finish) + ( + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + (mkSignednessAppropriateClt g mIn (mkZero g mIn) step) + (mkUp (startVal, start) originalStart step finish) + (mkDown (startVal, start) originalStart step finish) + ) + + match start, step, finish with + // for … in start..0..finish do … + | _, Expr.Const (value = IntegralConst.Zero), _ -> callAndIgnoreRangeExpr start step finish + + // for … in 5..1 do … + // for … in 1..-1..2 do … + | EmptyRange -> mkUnit g mBody + + // for … in 1..5 do … + // for … in 1..2..5 do … + | ConstRange FSharpForLoopUp -> mkNecessaryLetBindingsFor mkUp + + // for … in 5..-1..1 do … + | ConstRange FSharpForLoopDown -> mkNecessaryLetBindingsFor mkDown + + // for … in start..step..finish do … + | _, _, _ -> mkNecessaryLetBindingsFor mkIntegralWhileLoop let mkDebugPoint m expr = Expr.DebugPoint(DebugPointAtLeafExpr.Yes m, expr) @@ -10119,6 +10493,19 @@ let DetectAndOptimizeForEachExpression g option expr = let spFor = match spFor with DebugPointAtBinding.Yes mFor -> DebugPointAtFor.Yes mFor | _ -> DebugPointAtFor.No mkFastForLoop g (spFor, spIn, mWholeExpr, elemVar, startExpr, (step = 1), finishExpr, bodyExpr) + | _, CompiledForEachExpr g (_enumTy, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), elemVar, bodyExpr, ranges) -> + let mBody, _spFor, _spIn, mFor, mIn, spInWhile, _mWhole = ranges + + mkCompGenLetMutableIn elemVar.Range "loopVar" rangeTy start (fun (loopVarVal, loopVar) -> + mkOptimizedRangeLoop + g + (mBody, mFor, mIn, spInWhile) + (rangeTy, rangeExpr) + (start, step, finish) + (loopVarVal, loopVar) + (mkInvisibleLet elemVar.Range elemVar loopVar bodyExpr) + ) + | OptimizeAllForExpressions, CompiledForEachExpr g (enumerableTy, enumerableExpr, elemVar, bodyExpr, ranges) -> let mBody, spFor, spIn, mFor, mIn, spInWhile, mWholeExpr = ranges @@ -10212,12 +10599,6 @@ let mkUnitDelayLambda (g: TcGlobals) m e = let uv, _ = mkCompGenLocal m "unitVar" g.unit_ty mkLambda m uv (e, tyOfExpr g e) - -let (|ValApp|_|) g vref expr = - match expr with - | Expr.App (Expr.Val (vref2, _, _), _f0ty, tyargs, args, m) when valRefEq g vref vref2 -> Some (tyargs, args, m) - | _ -> None - let (|UseResumableStateMachinesExpr|_|) g expr = match expr with | ValApp g g.cgh__useResumableCode_vref (_, _, _m) -> Some () diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index bec1e031185..a79f3d2b939 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -218,6 +218,10 @@ val mkCompGenLet: range -> Val -> Expr -> Expr -> Expr /// is returned by the given continuation. Compiler-generated bindings do not give rise to a sequence point in debugging. val mkCompGenLetIn: range -> string -> TType -> Expr -> (Val * Expr -> Expr) -> Expr +/// Make a mutable let-expression that locally binds a compiler-generated value to an expression, where the expression +/// is returned by the given continuation. Compiler-generated bindings do not give rise to a sequence point in debugging. +val mkCompGenLetMutableIn: range -> string -> TType -> Expr -> (Val * Expr -> Expr) -> Expr + /// Make a let-expression that locally binds a value to an expression in an "invisible" way. /// Invisible bindings are not given a sequence point and should not have side effects. val mkInvisibleLet: range -> Val -> Expr -> Expr -> Expr @@ -2540,6 +2544,32 @@ val (|SpecialEquatableHeadType|_|): TcGlobals -> TType -> TType list option val (|SpecialNotEquatableHeadType|_|): TcGlobals -> TType -> unit option +/// Matches if the given expression is an application +/// of an integral range operator and returns the +/// type, start, step, and finish if so. +/// +/// start..finish +/// +/// start..step..finish +[] +val (|IntegralRange|_|): g:TcGlobals -> expr: Expr -> (TType * (Expr * Expr * Expr)) voption + +/// Matches if the given start, step, and finish represent +/// a range that is known to be empty at compile-time. +[] +val (|EmptyRange|_|): start:Expr * step: Expr * finish: Expr -> unit voption + +/// Makes an optimized while-loop for the given +/// integral start, stop, and finish. +val mkOptimizedRangeLoop: + g: TcGlobals -> + mBody: range * mFor: range * mIn: range * spInWhile: DebugPointAtWhile -> + rangeTy: TType * rangeExpr: Expr -> + start: Expr * step: Expr * finish: Expr -> + loopVarVal: Val * loopVar: Expr -> + body: Expr -> + Expr + type OptimizeForExpressionOptions = | OptimizeIntRangesOnly | OptimizeAllForExpressions From 7ead59f01c99969ea038fc2fc2e59ba09cdfc4b0 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Sun, 4 Feb 2024 20:20:20 -0500 Subject: [PATCH 02/66] Add int32 tests --- ...putedCollectionRangeLoweringTests.Int32.fs | 1826 +++++++++++++++++ tests/fsharp/FSharpSuite.Tests.fsproj | 3 +- 2 files changed, 1828 insertions(+), 1 deletion(-) create mode 100644 tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs new file mode 100644 index 00000000000..ac29ca97c08 --- /dev/null +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -0,0 +1,1826 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests.ComputedCollectionRangeLoweringTests + +open NUnit.Framework +open FSharp.Test + +[] +module Int32 = + /// [|…|] + module Array = + /// [|start..finish|] + module Range = + [] + let ``Lone RangeInt32 with const args when start > finish lowers to empty array`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test () = [|10..1|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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[] test() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with const args lowers to init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test () = [|1..257|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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[] test() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + int32 V_1, + int32 V_2) + IL_0000: ldc.i4 0x101 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + 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: ldloc.2 + IL_0014: stelem [runtime]System.Int32 + IL_0019: ldloc.2 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: stloc.2 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: ldloc.0 + IL_0023: ldlen + IL_0024: conv.i4 + IL_0025: blt.s IL_0011 + + IL_0027: ldloc.0 + IL_0028: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test start finish = [|start..finish|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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[] test(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 (int32 V_0, + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: sub + IL_0003: ldc.i4.1 + IL_0004: add + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.1 + IL_0008: bge.s IL_0010 + + IL_000a: call !!0[] [runtime]System.Array::Empty() + IL_000f: ret + + IL_0010: ldloc.0 + IL_0011: newarr [runtime]System.Int32 + IL_0016: stloc.1 + IL_0017: ldc.i4.0 + IL_0018: stloc.2 + IL_0019: ldarg.0 + IL_001a: stloc.3 + IL_001b: br.s IL_002d + + IL_001d: ldloc.1 + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: stelem [runtime]System.Int32 + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.3 + IL_0029: ldloc.2 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: ldloc.1 + IL_002f: ldlen + IL_0030: conv.i4 + IL_0031: blt.s IL_001d + + IL_0033: ldloc.1 + IL_0034: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let a () = (Array.zeroCreate 10).Length + let b () = (Array.zeroCreate 20).Length + + let test () = [|a ()..b ()|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 a() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static int32 b() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 20 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static int32[] test() cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + int32[] V_3, + int32 V_4, + int32 V_5) + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: stloc.0 + IL_000a: ldc.i4.s 20 + IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: stloc.1 + IL_0014: ldloc.1 + IL_0015: ldloc.0 + IL_0016: sub + IL_0017: ldc.i4.1 + IL_0018: add + IL_0019: stloc.2 + IL_001a: ldloc.2 + IL_001b: ldc.i4.1 + IL_001c: bge.s IL_0024 + + IL_001e: call !!0[] [runtime]System.Array::Empty() + IL_0023: ret + + IL_0024: ldloc.2 + IL_0025: newarr [runtime]System.Int32 + IL_002a: stloc.3 + IL_002b: ldc.i4.0 + IL_002c: stloc.s V_4 + IL_002e: ldloc.0 + IL_002f: stloc.s V_5 + IL_0031: br.s IL_0049 + + IL_0033: ldloc.3 + IL_0034: ldloc.s V_4 + IL_0036: ldloc.s V_5 + IL_0038: stelem [runtime]System.Int32 + IL_003d: ldloc.s V_5 + IL_003f: ldc.i4.1 + IL_0040: add + IL_0041: stloc.s V_5 + IL_0043: ldloc.s V_4 + IL_0045: ldc.i4.1 + IL_0046: add + IL_0047: stloc.s V_4 + IL_0049: ldloc.s V_4 + IL_004b: ldloc.3 + IL_004c: ldlen + IL_004d: conv.i4 + IL_004e: blt.s IL_0033 + + IL_0050: ldloc.3 + IL_0051: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + /// [|start..step..finish|] + module RangeStep = + [] + let ``Lone RangeInt32 with const args when (finish - start) / step + 1 ≤ 0 lowers to empty array`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test () = [|1..-1..5|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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[] test() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with const args lowers to init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test () = [|1..2..257|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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[] test() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + int32 V_1, + int32 V_2) + IL_0000: ldc.i4 0x81 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + 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: ldloc.2 + IL_0014: stelem [runtime]System.Int32 + IL_0019: ldloc.2 + IL_001a: ldc.i4.2 + IL_001b: add + IL_001c: stloc.2 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: ldloc.0 + IL_0023: ldlen + IL_0024: conv.i4 + IL_0025: blt.s IL_0011 + + IL_0027: ldloc.0 + IL_0028: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test start step finish = [|start..step..finish|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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[] test(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 (int32 V_0, + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000e + + IL_0003: ldarg.0 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000b: pop + IL_000c: br.s IL_000e + + IL_000e: ldarg.2 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldarg.1 + IL_0012: div + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.1 + IL_0018: bge.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.0 + IL_0021: newarr [runtime]System.Int32 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: stloc.2 + IL_0029: ldarg.0 + IL_002a: stloc.3 + IL_002b: br.s IL_003d + + IL_002d: ldloc.1 + IL_002e: ldloc.2 + IL_002f: ldloc.3 + IL_0030: stelem [runtime]System.Int32 + IL_0035: ldloc.3 + IL_0036: ldarg.1 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.2 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.2 + IL_003d: ldloc.2 + IL_003e: ldloc.1 + IL_003f: ldlen + IL_0040: conv.i4 + IL_0041: blt.s IL_002d + + IL_0043: ldloc.1 + IL_0044: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let a () = (Array.zeroCreate 10).Length + let b () = (Array.zeroCreate 20).Length + let c () = (Array.zeroCreate 300).Length + + let test () = [|a () .. b () .. c ()|] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 a() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static int32 b() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 20 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static int32 c() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4 0x12c + IL_0005: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_000a: ldlen + IL_000b: conv.i4 + IL_000c: ret + } + + .method public static int32[] test() cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + int32 V_3, + int32[] V_4, + int32 V_5, + int32 V_6) + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: stloc.0 + IL_000a: ldc.i4.s 20 + IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: stloc.1 + IL_0014: ldc.i4 0x12c + IL_0019: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_001e: ldlen + IL_001f: conv.i4 + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: brtrue.s IL_002f + + IL_0024: ldloc.0 + IL_0025: ldloc.1 + IL_0026: ldloc.2 + IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_002c: pop + IL_002d: br.s IL_002f + + IL_002f: ldloc.2 + IL_0030: ldloc.0 + IL_0031: sub + IL_0032: ldloc.1 + IL_0033: div + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.3 + IL_0038: ldc.i4.1 + IL_0039: bge.s IL_0041 + + IL_003b: call !!0[] [runtime]System.Array::Empty() + IL_0040: ret + + IL_0041: ldloc.3 + IL_0042: newarr [runtime]System.Int32 + IL_0047: stloc.s V_4 + IL_0049: ldc.i4.0 + IL_004a: stloc.s V_5 + IL_004c: ldloc.0 + IL_004d: stloc.s V_6 + IL_004f: br.s IL_0068 + + IL_0051: ldloc.s V_4 + IL_0053: ldloc.s V_5 + IL_0055: ldloc.s V_6 + IL_0057: stelem [runtime]System.Int32 + IL_005c: ldloc.s V_6 + IL_005e: ldloc.1 + IL_005f: add + IL_0060: stloc.s V_6 + IL_0062: ldloc.s V_5 + IL_0064: ldc.i4.1 + IL_0065: add + IL_0066: stloc.s V_5 + IL_0068: ldloc.s V_5 + IL_006a: ldloc.s V_4 + IL_006c: ldlen + IL_006d: conv.i4 + IL_006e: blt.s IL_0051 + + IL_0070: ldloc.s V_4 + IL_0072: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + /// […] + module List = + /// [start..finish] + module Range = + [] + let ``Lone RangeInt32 with const args when start > finish lowers to empty list`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test () = [10..1] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 + test() 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 + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with const args lowers to init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test () = [1..101] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 + test() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + int32 V_1) + IL_0000: ldc.i4.1 + IL_0001: stloc.1 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0012 + + IL_0006: ldloca.s V_0 + IL_0008: ldloc.1 + IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldc.i4.s 101 + IL_0015: bge.s IL_0024 + + IL_0017: ldc.i4.1 + IL_0018: ldloc.1 + IL_0019: bge.s IL_001e + + IL_001b: ldc.i4.1 + IL_001c: br.s IL_0029 + + IL_001e: ldc.i4.1 + IL_001f: ldloc.1 + IL_0020: ceq + IL_0022: br.s IL_0029 + + IL_0024: ldloc.1 + IL_0025: ldc.i4.s 101 + IL_0027: ceq + IL_0029: brtrue.s IL_0006 + + IL_002b: ldloca.s V_0 + IL_002d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0032: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args lowers to init loop``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let test start finish = [start..finish] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 + test(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 (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: ldarg.1 + IL_0005: ldloc.1 + IL_0006: bge.s IL_000a + + IL_0008: br.s IL_002f + + IL_000a: br.s IL_0018 + + IL_000c: ldloca.s V_0 + IL_000e: ldloc.1 + IL_000f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldarg.1 + IL_001a: bge.s IL_0029 + + IL_001c: ldarg.0 + IL_001d: ldloc.1 + IL_001e: bge.s IL_0023 + + IL_0020: ldc.i4.1 + IL_0021: br.s IL_002d + + IL_0023: ldarg.0 + IL_0024: ldloc.1 + IL_0025: ceq + IL_0027: br.s IL_002d + + IL_0029: ldloc.1 + IL_002a: ldarg.1 + IL_002b: ceq + IL_002d: brtrue.s IL_000c + + IL_002f: ldloca.s V_0 + IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0036: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + """ + module Test + + let a () = (Array.zeroCreate 10).Length + let b () = (Array.zeroCreate 20).Length + + let test () = [a ()..b ()] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 a() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static int32 b() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 20 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + test() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + int32 V_3) + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: stloc.0 + IL_000a: ldc.i4.s 20 + IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: stloc.3 + IL_0016: ldloc.0 + IL_0017: stloc.3 + IL_0018: ldloc.1 + IL_0019: ldloc.3 + IL_001a: bge.s IL_001e + + IL_001c: br.s IL_0043 + + IL_001e: br.s IL_002c + + IL_0020: ldloca.s V_2 + IL_0022: ldloc.3 + IL_0023: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0028: ldloc.3 + IL_0029: ldc.i4.1 + IL_002a: add + IL_002b: stloc.3 + IL_002c: ldloc.3 + IL_002d: ldloc.1 + IL_002e: bge.s IL_003d + + IL_0030: ldloc.0 + IL_0031: ldloc.3 + IL_0032: bge.s IL_0037 + + IL_0034: ldc.i4.1 + IL_0035: br.s IL_0041 + + IL_0037: ldloc.0 + IL_0038: ldloc.3 + IL_0039: ceq + IL_003b: br.s IL_0041 + + IL_003d: ldloc.3 + IL_003e: ldloc.1 + IL_003f: ceq + IL_0041: brtrue.s IL_0020 + + IL_0043: ldloca.s V_2 + IL_0045: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004a: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + /// [start..step..finish] + module RangeStep = + [] + let ``Lone RangeInt32 with const args when (finish - start) / step + 1 ≤ 0 lowers to empty list`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + """ + module Test + + let test () = [1..-1..5] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 + test() 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 + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with const args lowers to init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + """ + module Test + + let test () = [1..2..257] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 + test() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + int32 V_1) + IL_0000: ldc.i4.1 + IL_0001: stloc.1 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0012 + + IL_0006: ldloca.s V_0 + IL_0008: ldloc.1 + IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000e: ldloc.1 + IL_000f: ldc.i4.2 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldc.i4 0x101 + IL_0018: bge.s IL_0027 + + IL_001a: ldc.i4.1 + IL_001b: ldloc.1 + IL_001c: bge.s IL_0021 + + IL_001e: ldc.i4.1 + IL_001f: br.s IL_002f + + IL_0021: ldc.i4.1 + IL_0022: ldloc.1 + IL_0023: ceq + IL_0025: br.s IL_002f + + IL_0027: ldloc.1 + IL_0028: ldc.i4 0x101 + IL_002d: ceq + IL_002f: brtrue.s IL_0006 + + IL_0031: ldloca.s V_0 + IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0038: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + """ + module Test + + let test start step finish = [start..step..finish] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 + test(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 (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: ldarg.1 + IL_0005: brtrue.s IL_0012 + + IL_0007: ldloc.1 + IL_0008: ldarg.1 + IL_0009: ldarg.2 + IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000f: pop + IL_0010: br.s IL_0062 + + IL_0012: ldc.i4.0 + IL_0013: ldarg.1 + IL_0014: bge.s IL_003d + + IL_0016: br.s IL_0024 + + IL_0018: ldloca.s V_0 + IL_001a: ldloc.1 + IL_001b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0020: ldloc.1 + IL_0021: ldarg.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldarg.2 + IL_0026: bge.s IL_0035 + + IL_0028: ldarg.0 + IL_0029: ldloc.1 + IL_002a: bge.s IL_002f + + IL_002c: ldc.i4.1 + IL_002d: br.s IL_0039 + + IL_002f: ldarg.0 + IL_0030: ldloc.1 + IL_0031: ceq + IL_0033: br.s IL_0039 + + IL_0035: ldloc.1 + IL_0036: ldarg.2 + IL_0037: ceq + IL_0039: brtrue.s IL_0018 + + IL_003b: br.s IL_0062 + + IL_003d: br.s IL_004b + + IL_003f: ldloca.s V_0 + IL_0041: ldloc.1 + IL_0042: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0047: ldloc.1 + IL_0048: ldarg.1 + IL_0049: add + IL_004a: stloc.1 + IL_004b: ldarg.2 + IL_004c: ldloc.1 + IL_004d: bge.s IL_005c + + IL_004f: ldloc.1 + IL_0050: ldarg.0 + IL_0051: bge.s IL_0056 + + IL_0053: ldc.i4.1 + IL_0054: br.s IL_0060 + + IL_0056: ldloc.1 + IL_0057: ldarg.0 + IL_0058: ceq + IL_005a: br.s IL_0060 + + IL_005c: ldarg.2 + IL_005d: ldloc.1 + IL_005e: ceq + IL_0060: brtrue.s IL_003f + + IL_0062: ldloca.s V_0 + 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 + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) + + [] + let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + """ + module Test + + let a () = (Array.zeroCreate 10).Length + let b () = (Array.zeroCreate 20).Length + let c () = (Array.zeroCreate 300).Length + + let test () = [a () .. b () .. c ()] + """, + (fun verifier -> verifier.VerifyIL [ + """ + .assembly extern runtime { } + .assembly extern FSharp.Core { } + .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.dll + + .imagebase {value} + .file alignment 0x00000200 + .stackreserve 0x00100000 + .subsystem 0x0003 + .corflags 0x00000001 + + + + + + .class public abstract auto ansi sealed Test + 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 a() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static int32 b() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 20 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: ret + } + + .method public static int32 c() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4 0x12c + IL_0005: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_000a: ldlen + IL_000b: conv.i4 + IL_000c: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + test() cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, + int32 V_4) + IL_0000: ldc.i4.s 10 + IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: stloc.0 + IL_000a: ldc.i4.s 20 + IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: stloc.1 + IL_0014: ldc.i4 0x12c + IL_0019: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) + IL_001e: ldlen + IL_001f: conv.i4 + IL_0020: stloc.2 + IL_0021: ldloc.0 + IL_0022: stloc.s V_4 + IL_0024: ldloc.0 + IL_0025: stloc.s V_4 + IL_0027: ldloc.1 + IL_0028: brtrue.s IL_0039 + + IL_002a: ldloc.s V_4 + IL_002c: ldloc.1 + IL_002d: ldloc.2 + IL_002e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0033: pop + IL_0034: br IL_0097 + + IL_0039: ldc.i4.0 + IL_003a: ldloc.1 + IL_003b: bge.s IL_006b + + IL_003d: br.s IL_004e + + IL_003f: ldloca.s V_3 + IL_0041: ldloc.s V_4 + IL_0043: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0048: ldloc.s V_4 + IL_004a: ldloc.1 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.s V_4 + IL_0050: ldloc.2 + IL_0051: bge.s IL_0062 + + IL_0053: ldloc.0 + IL_0054: ldloc.s V_4 + IL_0056: bge.s IL_005b + + IL_0058: ldc.i4.1 + IL_0059: br.s IL_0067 + + IL_005b: ldloc.0 + IL_005c: ldloc.s V_4 + IL_005e: ceq + IL_0060: br.s IL_0067 + + IL_0062: ldloc.s V_4 + IL_0064: ldloc.2 + IL_0065: ceq + IL_0067: brtrue.s IL_003f + + IL_0069: br.s IL_0097 + + IL_006b: br.s IL_007c + + IL_006d: ldloca.s V_3 + IL_006f: ldloc.s V_4 + IL_0071: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0076: ldloc.s V_4 + IL_0078: ldloc.1 + IL_0079: add + IL_007a: stloc.s V_4 + IL_007c: ldloc.2 + IL_007d: ldloc.s V_4 + IL_007f: bge.s IL_0090 + + IL_0081: ldloc.s V_4 + IL_0083: ldloc.0 + IL_0084: bge.s IL_0089 + + IL_0086: ldc.i4.1 + IL_0087: br.s IL_0095 + + IL_0089: ldloc.s V_4 + IL_008b: ldloc.0 + IL_008c: ceq + IL_008e: br.s IL_0095 + + IL_0090: ldloc.2 + IL_0091: ldloc.s V_4 + IL_0093: ceq + IL_0095: brtrue.s IL_006d + + IL_0097: ldloca.s V_3 + IL_0099: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009e: ret + } + + } + + .class private abstract auto ansi sealed ''.$Test + extends [runtime]System.Object + { + } + """ + ])) diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index b6d69d8ae1a..f9a192bdee0 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -72,6 +72,7 @@ + @@ -109,7 +110,7 @@ false - + From 46ee6176ede2b7c94fbb87d49937e859246ade30 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Sun, 4 Feb 2024 20:20:34 -0500 Subject: [PATCH 03/66] Update baselines --- ...onTrivialBranchingBindingInEnd03.fs.il.bsl | 188 +++++--- ...ivialBranchingBindingInEnd03.fs.opt.il.bsl | 188 +++++--- ...ivialBranchingBindingInEnd04.fs.opt.il.bsl | 148 ++++-- .../GenericComparison/Compare08.fsx.il.bsl | 116 +++-- .../GenericComparison/Compare09.fsx.il.bsl | 116 +++-- .../GenericComparison/Equals07.fsx.il.bsl | 116 +++-- .../GenericComparison/Equals08.fsx.il.bsl | 116 +++-- .../GenericComparison/Hash10.fsx.il.bsl | 74 ++- .../GenericComparison/Hash11.fsx.il.bsl | 73 ++- .../ListExpressionStepping02.fs.il.bsl | 244 +++++++--- .../Misc/CodeGenRenamings01.fs.il.bsl | 456 ++++++++++-------- .../EmittedIL/Misc/ForLoop01.fs.il.bsl | 102 ++-- 12 files changed, 1225 insertions(+), 712 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl index f4f037c9936..574d82cfe40 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -177,7 +177,9 @@ .entrypoint .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + int32 V_2) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -188,77 +190,119 @@ IL_000e: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, !!0) IL_0013: stsfld int32[] ''.$assembly::w@7 - IL_0018: ldc.i4.0 - IL_0019: ldc.i4.1 - IL_001a: call int32[] assembly::get_r() - IL_001f: ldlen - IL_0020: conv.i4 - IL_0021: stsfld int32 ''.$assembly::e1@1 - IL_0026: call int32[] assembly::get_w() - IL_002b: ldlen - IL_002c: conv.i4 - IL_002d: stsfld int32 ''.$assembly::e2@1 - IL_0032: call int32 assembly::get_e1@1() - IL_0037: call int32 assembly::get_e2@1() - IL_003c: bge.s IL_0046 - - IL_003e: call int32 assembly::get_e1@1() - IL_0043: nop - IL_0044: br.s IL_004c - - IL_0046: call int32 assembly::get_e2@1() - IL_004b: nop - IL_004c: ldc.i4.1 - IL_004d: sub - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_0018: call int32[] assembly::get_r() + IL_001d: ldlen + IL_001e: conv.i4 + IL_001f: stsfld int32 ''.$assembly::e1@1 + IL_0024: call int32[] assembly::get_w() + IL_0029: ldlen + IL_002a: conv.i4 + IL_002b: stsfld int32 ''.$assembly::e2@1 + IL_0030: call int32 assembly::get_e1@1() + IL_0035: call int32 assembly::get_e2@1() + IL_003a: bge.s IL_0044 + + IL_003c: call int32 assembly::get_e1@1() + IL_0041: nop + IL_0042: br.s IL_004a + + IL_0044: call int32 assembly::get_e2@1() + IL_0049: nop + IL_004a: ldc.i4.1 + IL_004b: sub + IL_004c: stloc.0 + IL_004d: ldc.i4.0 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.2 + IL_0051: ldloc.0 + IL_0052: ldloc.2 + IL_0053: bge.s IL_0058 + + IL_0055: nop + IL_0056: br.s IL_0082 + + IL_0058: br.s IL_0067 + + IL_005a: ldloca.s V_1 + IL_005c: ldloc.2 + IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0062: nop + IL_0063: ldloc.2 + IL_0064: ldc.i4.1 + IL_0065: add + IL_0066: stloc.2 + IL_0067: ldloc.2 + IL_0068: ldloc.0 + IL_0069: bge.s IL_007a + + IL_006b: ldc.i4.0 + IL_006c: ldloc.2 + IL_006d: bge.s IL_0073 + + IL_006f: ldc.i4.1 + IL_0070: nop + IL_0071: br.s IL_007f + + IL_0073: ldc.i4.0 + IL_0074: ldloc.2 + IL_0075: ceq + IL_0077: nop + IL_0078: br.s IL_007f + + IL_007a: ldloc.2 + IL_007b: ldloc.0 + IL_007c: ceq + IL_007e: nop + IL_007f: brtrue.s IL_005a + + IL_0081: nop + IL_0082: ldloca.s V_1 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009d: br.s IL_00e5 + + IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a9: stloc.0 + IL_00aa: call int32[] assembly::get_r() + IL_00af: ldloc.0 + IL_00b0: call int32[] assembly::get_r() + IL_00b5: ldloc.0 + IL_00b6: ldelem [runtime]System.Int32 + IL_00bb: call int32[] assembly::get_w() + IL_00c0: ldloc.0 + IL_00c1: ldelem [runtime]System.Int32 + IL_00c6: add + IL_00c7: stelem [runtime]System.Int32 + IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00ea: brtrue.s IL_009f + + IL_00ec: nop + IL_00ed: nop + IL_00ee: call int32[] assembly::get_r() + IL_00f3: ldc.i4.0 + IL_00f4: ldelem [runtime]System.Int32 + IL_00f9: ldc.i4.3 + IL_00fa: bne.un.s IL_0100 + + IL_00fc: ldc.i4.0 + IL_00fd: nop + IL_00fe: br.s IL_0102 + + IL_0100: ldc.i4.1 + IL_0101: nop + IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0107: pop + IL_0108: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index f4f037c9936..574d82cfe40 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -177,7 +177,9 @@ .entrypoint .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + int32 V_2) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -188,77 +190,119 @@ IL_000e: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, !!0) IL_0013: stsfld int32[] ''.$assembly::w@7 - IL_0018: ldc.i4.0 - IL_0019: ldc.i4.1 - IL_001a: call int32[] assembly::get_r() - IL_001f: ldlen - IL_0020: conv.i4 - IL_0021: stsfld int32 ''.$assembly::e1@1 - IL_0026: call int32[] assembly::get_w() - IL_002b: ldlen - IL_002c: conv.i4 - IL_002d: stsfld int32 ''.$assembly::e2@1 - IL_0032: call int32 assembly::get_e1@1() - IL_0037: call int32 assembly::get_e2@1() - IL_003c: bge.s IL_0046 - - IL_003e: call int32 assembly::get_e1@1() - IL_0043: nop - IL_0044: br.s IL_004c - - IL_0046: call int32 assembly::get_e2@1() - IL_004b: nop - IL_004c: ldc.i4.1 - IL_004d: sub - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_0018: call int32[] assembly::get_r() + IL_001d: ldlen + IL_001e: conv.i4 + IL_001f: stsfld int32 ''.$assembly::e1@1 + IL_0024: call int32[] assembly::get_w() + IL_0029: ldlen + IL_002a: conv.i4 + IL_002b: stsfld int32 ''.$assembly::e2@1 + IL_0030: call int32 assembly::get_e1@1() + IL_0035: call int32 assembly::get_e2@1() + IL_003a: bge.s IL_0044 + + IL_003c: call int32 assembly::get_e1@1() + IL_0041: nop + IL_0042: br.s IL_004a + + IL_0044: call int32 assembly::get_e2@1() + IL_0049: nop + IL_004a: ldc.i4.1 + IL_004b: sub + IL_004c: stloc.0 + IL_004d: ldc.i4.0 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.2 + IL_0051: ldloc.0 + IL_0052: ldloc.2 + IL_0053: bge.s IL_0058 + + IL_0055: nop + IL_0056: br.s IL_0082 + + IL_0058: br.s IL_0067 + + IL_005a: ldloca.s V_1 + IL_005c: ldloc.2 + IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0062: nop + IL_0063: ldloc.2 + IL_0064: ldc.i4.1 + IL_0065: add + IL_0066: stloc.2 + IL_0067: ldloc.2 + IL_0068: ldloc.0 + IL_0069: bge.s IL_007a + + IL_006b: ldc.i4.0 + IL_006c: ldloc.2 + IL_006d: bge.s IL_0073 + + IL_006f: ldc.i4.1 + IL_0070: nop + IL_0071: br.s IL_007f + + IL_0073: ldc.i4.0 + IL_0074: ldloc.2 + IL_0075: ceq + IL_0077: nop + IL_0078: br.s IL_007f + + IL_007a: ldloc.2 + IL_007b: ldloc.0 + IL_007c: ceq + IL_007e: nop + IL_007f: brtrue.s IL_005a + + IL_0081: nop + IL_0082: ldloca.s V_1 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009d: br.s IL_00e5 + + IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a9: stloc.0 + IL_00aa: call int32[] assembly::get_r() + IL_00af: ldloc.0 + IL_00b0: call int32[] assembly::get_r() + IL_00b5: ldloc.0 + IL_00b6: ldelem [runtime]System.Int32 + IL_00bb: call int32[] assembly::get_w() + IL_00c0: ldloc.0 + IL_00c1: ldelem [runtime]System.Int32 + IL_00c6: add + IL_00c7: stelem [runtime]System.Int32 + IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00ea: brtrue.s IL_009f + + IL_00ec: nop + IL_00ed: nop + IL_00ee: call int32[] assembly::get_r() + IL_00f3: ldc.i4.0 + IL_00f4: ldelem [runtime]System.Int32 + IL_00f9: ldc.i4.3 + IL_00fa: bne.un.s IL_0100 + + IL_00fc: ldc.i4.0 + IL_00fd: nop + IL_00fe: br.s IL_0102 + + IL_0100: ldc.i4.1 + IL_0101: nop + IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0107: pop + IL_0108: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index 7229991ff4b..f3d5e50340d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -177,7 +177,9 @@ .entrypoint .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + int32 V_2) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -208,57 +210,99 @@ IL_0049: nop IL_004a: ldc.i4.1 IL_004b: sub - IL_004c: ldc.i4.m1 - IL_004d: ldc.i4.0 - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: stloc.2 + IL_004f: ldloc.0 + IL_0050: stloc.2 + IL_0051: ldloc.2 + IL_0052: ldc.i4.0 + IL_0053: bge.s IL_0058 + + IL_0055: nop + IL_0056: br.s IL_0082 + + IL_0058: br.s IL_0067 + + IL_005a: ldloca.s V_1 + IL_005c: ldloc.2 + IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0062: nop + IL_0063: ldloc.2 + IL_0064: ldc.i4.m1 + IL_0065: add + IL_0066: stloc.2 + IL_0067: ldc.i4.0 + IL_0068: ldloc.2 + IL_0069: bge.s IL_007a + + IL_006b: ldloc.2 + IL_006c: ldloc.0 + IL_006d: bge.s IL_0073 + + IL_006f: ldc.i4.1 + IL_0070: nop + IL_0071: br.s IL_007f + + IL_0073: ldloc.2 + IL_0074: ldloc.0 + IL_0075: ceq + IL_0077: nop + IL_0078: br.s IL_007f + + IL_007a: ldc.i4.0 + IL_007b: ldloc.2 + IL_007c: ceq + IL_007e: nop + IL_007f: brtrue.s IL_005a + + IL_0081: nop + IL_0082: ldloca.s V_1 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009d: br.s IL_00e5 + + IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a9: stloc.0 + IL_00aa: call int32[] assembly::get_r() + IL_00af: ldloc.0 + IL_00b0: call int32[] assembly::get_r() + IL_00b5: ldloc.0 + IL_00b6: ldelem [runtime]System.Int32 + IL_00bb: call int32[] assembly::get_w() + IL_00c0: ldloc.0 + IL_00c1: ldelem [runtime]System.Int32 + IL_00c6: add + IL_00c7: stelem [runtime]System.Int32 + IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00ea: brtrue.s IL_009f + + IL_00ec: nop + IL_00ed: nop + IL_00ee: call int32[] assembly::get_r() + IL_00f3: ldc.i4.0 + IL_00f4: ldelem [runtime]System.Int32 + IL_00f9: ldc.i4.3 + IL_00fa: bne.un.s IL_0100 + + IL_00fc: ldc.i4.0 + IL_00fd: nop + IL_00fe: br.s IL_0102 + + IL_0100: ldc.i4.1 + IL_0101: nop + IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0107: pop + IL_0108: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl index 7c3b365ff57..0f99c58aa9a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl @@ -54,46 +54,88 @@ .locals init (int32 V_0, uint8[] V_1, uint8[] V_2, - int32 V_3) + int32 V_3, + uint8 V_4, + uint8[] V_5) IL_0000: ldc.i4.1 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: newarr [runtime]System.Byte + IL_0009: stloc.2 + IL_000a: ldc.i4.0 + IL_000b: stloc.3 + IL_000c: ldc.i4.0 + IL_000d: stloc.s V_4 + IL_000f: br.s IL_0024 + + IL_0011: ldloc.2 + IL_0012: ldloc.3 + IL_0013: ldloc.s V_4 + IL_0015: stelem [runtime]System.Byte + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: ldloc.2 + IL_0026: ldlen + IL_0027: conv.i4 + IL_0028: blt.s IL_0011 + + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldc.i4.s 101 + IL_002e: newarr [runtime]System.Byte + IL_0033: stloc.s V_5 + IL_0035: ldc.i4.0 + IL_0036: stloc.3 + IL_0037: ldc.i4.0 + IL_0038: stloc.s V_4 + IL_003a: br.s IL_0050 + + IL_003c: ldloc.s V_5 + IL_003e: ldloc.3 + IL_003f: ldloc.s V_4 + IL_0041: stelem [runtime]System.Byte + IL_0046: ldloc.s V_4 + IL_0048: ldc.i4.1 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.3 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.3 + IL_0050: ldloc.3 + IL_0051: ldloc.s V_5 + IL_0053: ldlen + IL_0054: conv.i4 + IL_0055: blt.s IL_003c + + IL_0057: ldloc.s V_5 + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: stloc.3 + IL_005c: br.s IL_006a + + IL_005e: ldloc.1 + IL_005f: ldloc.2 + IL_0060: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x989681 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_0065: stloc.0 + IL_0066: ldloc.3 + IL_0067: ldc.i4.1 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.3 + IL_006b: ldc.i4 0x989681 + IL_0070: blt.s IL_005e + + IL_0072: ldloc.0 + IL_0073: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl index b734a546b40..bebd40ded3d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl @@ -54,46 +54,88 @@ .locals init (int32 V_0, int32[] V_1, int32[] V_2, - int32 V_3) + int32 V_3, + int32 V_4, + int32[] V_5) IL_0000: ldc.i4.1 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.2 + IL_000a: ldc.i4.0 + IL_000b: stloc.3 + IL_000c: ldc.i4.0 + IL_000d: stloc.s V_4 + IL_000f: br.s IL_0024 + + IL_0011: ldloc.2 + IL_0012: ldloc.3 + IL_0013: ldloc.s V_4 + IL_0015: stelem [runtime]System.Int32 + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: ldloc.2 + IL_0026: ldlen + IL_0027: conv.i4 + IL_0028: blt.s IL_0011 + + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldc.i4.s 101 + IL_002e: newarr [runtime]System.Int32 + IL_0033: stloc.s V_5 + IL_0035: ldc.i4.0 + IL_0036: stloc.3 + IL_0037: ldc.i4.0 + IL_0038: stloc.s V_4 + IL_003a: br.s IL_0050 + + IL_003c: ldloc.s V_5 + IL_003e: ldloc.3 + IL_003f: ldloc.s V_4 + IL_0041: stelem [runtime]System.Int32 + IL_0046: ldloc.s V_4 + IL_0048: ldc.i4.1 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.3 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.3 + IL_0050: ldloc.3 + IL_0051: ldloc.s V_5 + IL_0053: ldlen + IL_0054: conv.i4 + IL_0055: blt.s IL_003c + + IL_0057: ldloc.s V_5 + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: stloc.3 + IL_005c: br.s IL_006a + + IL_005e: ldloc.1 + IL_005f: ldloc.2 + IL_0060: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x186a1 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_0065: stloc.0 + IL_0066: ldloc.3 + IL_0067: ldc.i4.1 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.3 + IL_006b: ldc.i4 0x186a1 + IL_0070: blt.s IL_005e + + IL_0072: ldloc.0 + IL_0073: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl index a175818aeb3..e5b275e1947 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl @@ -54,46 +54,88 @@ .locals init (bool V_0, uint8[] V_1, uint8[] V_2, - int32 V_3) + int32 V_3, + uint8 V_4, + uint8[] V_5) IL_0000: ldc.i4.0 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: newarr [runtime]System.Byte + IL_0009: stloc.2 + IL_000a: ldc.i4.0 + IL_000b: stloc.3 + IL_000c: ldc.i4.0 + IL_000d: stloc.s V_4 + IL_000f: br.s IL_0024 + + IL_0011: ldloc.2 + IL_0012: ldloc.3 + IL_0013: ldloc.s V_4 + IL_0015: stelem [runtime]System.Byte + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: ldloc.2 + IL_0026: ldlen + IL_0027: conv.i4 + IL_0028: blt.s IL_0011 + + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldc.i4.s 101 + IL_002e: newarr [runtime]System.Byte + IL_0033: stloc.s V_5 + IL_0035: ldc.i4.0 + IL_0036: stloc.3 + IL_0037: ldc.i4.0 + IL_0038: stloc.s V_4 + IL_003a: br.s IL_0050 + + IL_003c: ldloc.s V_5 + IL_003e: ldloc.3 + IL_003f: ldloc.s V_4 + IL_0041: stelem [runtime]System.Byte + IL_0046: ldloc.s V_4 + IL_0048: ldc.i4.1 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.3 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.3 + IL_0050: ldloc.3 + IL_0051: ldloc.s V_5 + IL_0053: ldlen + IL_0054: conv.i4 + IL_0055: blt.s IL_003c + + IL_0057: ldloc.s V_5 + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: stloc.3 + IL_005c: br.s IL_006a + + IL_005e: ldloc.1 + IL_005f: ldloc.2 + IL_0060: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x989681 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_0065: stloc.0 + IL_0066: ldloc.3 + IL_0067: ldc.i4.1 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.3 + IL_006b: ldc.i4 0x989681 + IL_0070: blt.s IL_005e + + IL_0072: ldloc.0 + IL_0073: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl index 6125092813b..98fb4600674 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl @@ -54,46 +54,88 @@ .locals init (bool V_0, int32[] V_1, int32[] V_2, - int32 V_3) + int32 V_3, + int32 V_4, + int32[] V_5) IL_0000: ldc.i4.0 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.2 + IL_000a: ldc.i4.0 + IL_000b: stloc.3 + IL_000c: ldc.i4.0 + IL_000d: stloc.s V_4 + IL_000f: br.s IL_0024 + + IL_0011: ldloc.2 + IL_0012: ldloc.3 + IL_0013: ldloc.s V_4 + IL_0015: stelem [runtime]System.Int32 + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: ldloc.2 + IL_0026: ldlen + IL_0027: conv.i4 + IL_0028: blt.s IL_0011 + + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldc.i4.s 101 + IL_002e: newarr [runtime]System.Int32 + IL_0033: stloc.s V_5 + IL_0035: ldc.i4.0 + IL_0036: stloc.3 + IL_0037: ldc.i4.0 + IL_0038: stloc.s V_4 + IL_003a: br.s IL_0050 + + IL_003c: ldloc.s V_5 + IL_003e: ldloc.3 + IL_003f: ldloc.s V_4 + IL_0041: stelem [runtime]System.Int32 + IL_0046: ldloc.s V_4 + IL_0048: ldc.i4.1 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.3 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.3 + IL_0050: ldloc.3 + IL_0051: ldloc.s V_5 + IL_0053: ldlen + IL_0054: conv.i4 + IL_0055: blt.s IL_003c + + IL_0057: ldloc.s V_5 + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: stloc.3 + IL_005c: br.s IL_006a + + IL_005e: ldloc.1 + IL_005f: ldloc.2 + IL_0060: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x989681 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_0065: stloc.0 + IL_0066: ldloc.3 + IL_0067: ldc.i4.1 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.3 + IL_006b: ldc.i4 0x989681 + IL_0070: blt.s IL_005e + + IL_0072: ldloc.0 + IL_0073: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl index 3c5b5009606..1d1d41b3695 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl @@ -52,34 +52,56 @@ .maxstack 5 .locals init (uint8[] V_0, - int32 V_1, - int32 V_2) + uint8[] V_1, + int32 V_2, + uint8 V_3, + int32 V_4) IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 100 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000f: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: br.s IL_0024 - - IL_0019: ldloc.0 - IL_001a: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) - IL_001f: stloc.2 + IL_0001: ldc.i4.s 101 + IL_0003: newarr [runtime]System.Byte + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.2 + IL_000b: ldc.i4.0 + IL_000c: stloc.3 + IL_000d: br.s IL_001f + + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: ldloc.3 + IL_0012: stelem [runtime]System.Byte + 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: add + IL_001e: stloc.2 + IL_001f: ldloc.2 IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldc.i4 0x989681 - IL_002a: blt.s IL_0019 - - IL_002c: ret + IL_0021: ldlen + IL_0022: conv.i4 + IL_0023: blt.s IL_000f + + IL_0025: ldloc.1 + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: stloc.2 + IL_0029: br.s IL_0037 + + IL_002b: ldloc.0 + IL_002c: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_0031: stloc.s V_4 + IL_0033: ldloc.2 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.2 + IL_0037: ldloc.2 + IL_0038: ldc.i4 0x989681 + IL_003d: blt.s IL_002b + + IL_003f: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl index ba62710f013..2d5ef45b06b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl @@ -52,34 +52,55 @@ .maxstack 5 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) + int32[] V_1, + int32 V_2, + int32 V_3) IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 100 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000f: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: br.s IL_0024 - - IL_0019: ldloc.0 - IL_001a: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) - IL_001f: stloc.2 + IL_0001: ldc.i4.s 101 + IL_0003: newarr [runtime]System.Int32 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.2 + IL_000b: ldc.i4.0 + IL_000c: stloc.3 + IL_000d: br.s IL_001f + + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: ldloc.3 + IL_0012: stelem [runtime]System.Int32 + 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: add + IL_001e: stloc.2 + IL_001f: ldloc.2 IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldc.i4 0x989681 - IL_002a: blt.s IL_0019 - - IL_002c: ret + IL_0021: ldlen + IL_0022: conv.i4 + IL_0023: blt.s IL_000f + + IL_0025: ldloc.1 + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: stloc.2 + IL_0029: br.s IL_0036 + + IL_002b: ldloc.0 + IL_002c: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_0031: stloc.3 + IL_0032: ldloc.2 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.2 + IL_0036: ldloc.2 + IL_0037: ldc.i4 0x989681 + IL_003c: blt.s IL_002b + + IL_003e: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl index a8e6ce9949c..88c067ce683 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl @@ -295,14 +295,20 @@ .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_3, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_4, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_5, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_6, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_7, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_8, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_9, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_10) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, + int32 V_4, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_5, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_6, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_7, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_8, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_9, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_10, + int32 V_11, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_12, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_13, + int32 V_14, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_15, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_16) IL_0000: ldarg.0 IL_0001: ldarg.0 IL_0002: ldarg.0 @@ -315,80 +321,176 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0017: stloc.1 IL_0018: ldc.i4.0 - IL_0019: ldc.i4.1 - IL_001a: ldc.i4.2 - IL_001b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0020: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0025: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_002a: stloc.2 - IL_002b: ldloc.1 - IL_002c: ldloc.2 - IL_002d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + IL_0019: stloc.s V_4 + IL_001b: ldc.i4.0 + IL_001c: stloc.s V_4 + IL_001e: br.s IL_0030 + + IL_0020: ldloca.s V_3 + IL_0022: ldloc.s V_4 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloc.s V_4 + IL_002c: ldc.i4.1 + IL_002d: add + IL_002e: stloc.s V_4 + IL_0030: ldloc.s V_4 + IL_0032: ldc.i4.2 + IL_0033: bge.s IL_0046 + + IL_0035: ldc.i4.0 + IL_0036: ldloc.s V_4 + IL_0038: bge.s IL_003e + + IL_003a: ldc.i4.1 + IL_003b: nop + IL_003c: br.s IL_004c + + IL_003e: ldc.i4.0 + IL_003f: ldloc.s V_4 + IL_0041: ceq + IL_0043: nop + IL_0044: br.s IL_004c + + IL_0046: ldloc.s V_4 + IL_0048: ldc.i4.2 + IL_0049: ceq + IL_004b: nop + IL_004c: brtrue.s IL_0020 + + IL_004e: ldloca.s V_3 + IL_0050: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0055: stloc.2 + IL_0056: ldloc.1 + IL_0057: ldloc.2 + IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0032: stloc.3 - IL_0033: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance - IL_0038: ldloc.3 - IL_0039: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_005d: stloc.s V_5 + IL_005f: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance + IL_0064: ldloc.s V_5 + IL_0066: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003e: stloc.s V_4 - IL_0040: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance - IL_0045: ldloc.s V_4 - IL_0047: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_006b: stloc.s V_6 + IL_006d: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance + IL_0072: ldloc.s V_6 + IL_0074: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_004c: stloc.0 - IL_004d: ldarg.0 - IL_004e: ldarg.0 - IL_004f: ldarg.0 - IL_0050: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0055: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0079: stloc.0 + IL_007a: ldarg.0 + IL_007b: ldarg.0 + IL_007c: ldarg.0 + IL_007d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0082: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0087: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0064: stloc.s V_6 - IL_0066: ldc.i4.0 - IL_0067: ldc.i4.1 - IL_0068: ldc.i4.2 - IL_0069: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_006e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0078: stloc.s V_7 - IL_007a: ldc.i4.0 - IL_007b: ldc.i4.1 - IL_007c: ldc.i4.2 - IL_007d: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0082: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0087: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_008c: stloc.s V_8 - IL_008e: ldloc.s V_6 - IL_0090: ldloc.s V_7 - IL_0092: ldloc.s V_8 - IL_0094: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + IL_0091: stloc.s V_8 + IL_0093: ldc.i4.0 + IL_0094: stloc.s V_11 + IL_0096: ldc.i4.0 + IL_0097: stloc.s V_11 + IL_0099: br.s IL_00ab + + IL_009b: ldloca.s V_10 + IL_009d: ldloc.s V_11 + IL_009f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00a4: nop + IL_00a5: ldloc.s V_11 + IL_00a7: ldc.i4.1 + IL_00a8: add + IL_00a9: stloc.s V_11 + IL_00ab: ldloc.s V_11 + IL_00ad: ldc.i4.2 + IL_00ae: bge.s IL_00c1 + + IL_00b0: ldc.i4.0 + IL_00b1: ldloc.s V_11 + IL_00b3: bge.s IL_00b9 + + IL_00b5: ldc.i4.1 + IL_00b6: nop + IL_00b7: br.s IL_00c7 + + IL_00b9: ldc.i4.0 + IL_00ba: ldloc.s V_11 + IL_00bc: ceq + IL_00be: nop + IL_00bf: br.s IL_00c7 + + IL_00c1: ldloc.s V_11 + IL_00c3: ldc.i4.2 + IL_00c4: ceq + IL_00c6: nop + IL_00c7: brtrue.s IL_009b + + IL_00c9: ldloca.s V_10 + IL_00cb: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00d0: stloc.s V_9 + IL_00d2: ldc.i4.0 + IL_00d3: stloc.s V_14 + IL_00d5: ldc.i4.0 + IL_00d6: stloc.s V_14 + IL_00d8: br.s IL_00ea + + IL_00da: ldloca.s V_13 + IL_00dc: ldloc.s V_14 + IL_00de: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00e3: nop + IL_00e4: ldloc.s V_14 + IL_00e6: ldc.i4.1 + IL_00e7: add + IL_00e8: stloc.s V_14 + IL_00ea: ldloc.s V_14 + IL_00ec: ldc.i4.2 + IL_00ed: bge.s IL_0100 + + IL_00ef: ldc.i4.0 + IL_00f0: ldloc.s V_14 + IL_00f2: bge.s IL_00f8 + + IL_00f4: ldc.i4.1 + IL_00f5: nop + IL_00f6: br.s IL_0106 + + IL_00f8: ldc.i4.0 + IL_00f9: ldloc.s V_14 + IL_00fb: ceq + IL_00fd: nop + IL_00fe: br.s IL_0106 + + IL_0100: ldloc.s V_14 + IL_0102: ldc.i4.2 + IL_0103: ceq + IL_0105: nop + IL_0106: brtrue.s IL_00da + + IL_0108: ldloca.s V_13 + IL_010a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_010f: stloc.s V_12 + IL_0111: ldloc.s V_8 + IL_0113: ldloc.s V_9 + IL_0115: ldloc.s V_12 + IL_0117: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0099: stloc.s V_9 - IL_009b: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance - IL_00a0: ldloc.s V_9 - IL_00a2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_011c: stloc.s V_15 + IL_011e: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance + IL_0123: ldloc.s V_15 + IL_0125: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00a7: stloc.s V_10 - IL_00a9: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance - IL_00ae: ldloc.s V_10 - IL_00b0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_012a: stloc.s V_16 + IL_012c: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance + IL_0131: ldloc.s V_16 + IL_0133: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b5: stloc.s V_5 - IL_00b7: ldloc.0 - IL_00b8: ldloc.s V_5 - IL_00ba: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, + IL_0138: stloc.s V_7 + IL_013a: ldloc.0 + IL_013b: ldloc.s V_7 + IL_013d: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, !1) - IL_00bf: ret + IL_0142: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl index 2e77dc87b3d..8a93f0441a2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl @@ -413,269 +413,303 @@ int32[0...,0...,0...,0...] V_8, int32[] V_9, int32[] V_10, - int32 V_11, - class [runtime]System.Tuple`4 V_12, - class [runtime]System.Tuple`4 V_13, - int32 V_14, - class [runtime]System.Tuple`3 V_15, - class [runtime]System.Tuple`3 V_16, - int32 V_17, - class [runtime]System.Tuple`4 V_18, - class [runtime]System.Tuple`4 V_19, - int32 V_20) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_11, + int32 V_12, + int32 V_13, + class [runtime]System.Tuple`4 V_14, + class [runtime]System.Tuple`4 V_15, + int32 V_16, + class [runtime]System.Tuple`3 V_17, + class [runtime]System.Tuple`3 V_18, + int32 V_19, + class [runtime]System.Tuple`4 V_20, + class [runtime]System.Tuple`4 V_21, + int32 V_22) IL_0000: ldc.i4.1 - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.s 10 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0013: dup - IL_0014: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::alist@5 - IL_0019: stloc.0 - IL_001a: ldc.i4.3 - IL_001b: newarr [runtime]System.Int32 - IL_0020: dup - IL_0021: ldc.i4.0 - IL_0022: ldc.i4.1 - IL_0023: stelem [runtime]System.Int32 - IL_0028: dup - IL_0029: ldc.i4.1 - IL_002a: ldc.i4.2 - IL_002b: stelem [runtime]System.Int32 - IL_0030: dup - IL_0031: ldc.i4.2 - IL_0032: ldc.i4.3 - IL_0033: stelem [runtime]System.Int32 - IL_0038: dup - IL_0039: stsfld int32[] ''.$assembly::array@6 - IL_003e: stloc.1 - IL_003f: ldc.i4.1 - IL_0040: ldc.i4.1 - IL_0041: ldc.i4.s 10 - IL_0043: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + IL_0001: stloc.s V_12 + IL_0003: ldc.i4.1 + IL_0004: stloc.s V_12 + IL_0006: br.s IL_0018 + + IL_0008: ldloca.s V_11 + IL_000a: ldloc.s V_12 + IL_000c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0011: nop + IL_0012: ldloc.s V_12 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: stloc.s V_12 + IL_0018: ldloc.s V_12 + IL_001a: ldc.i4.s 10 + IL_001c: bge.s IL_002f + + IL_001e: ldc.i4.1 + IL_001f: ldloc.s V_12 + IL_0021: bge.s IL_0027 + + IL_0023: ldc.i4.1 + IL_0024: nop + IL_0025: br.s IL_0036 + + IL_0027: ldc.i4.1 + IL_0028: ldloc.s V_12 + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_0036 + + IL_002f: ldloc.s V_12 + IL_0031: ldc.i4.s 10 + IL_0033: ceq + IL_0035: nop + IL_0036: brtrue.s IL_0008 + + IL_0038: ldloca.s V_11 + IL_003a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003f: dup + IL_0040: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::alist@5 + IL_0045: stloc.0 + IL_0046: ldc.i4.3 + IL_0047: newarr [runtime]System.Int32 + IL_004c: dup + IL_004d: ldc.i4.0 + IL_004e: ldc.i4.1 + IL_004f: stelem [runtime]System.Int32 + IL_0054: dup + IL_0055: ldc.i4.1 + IL_0056: ldc.i4.2 + IL_0057: stelem [runtime]System.Int32 + IL_005c: dup + IL_005d: ldc.i4.2 + IL_005e: ldc.i4.3 + IL_005f: stelem [runtime]System.Int32 + IL_0064: dup + IL_0065: stsfld int32[] ''.$assembly::array@6 + IL_006a: stloc.1 + IL_006b: ldc.i4.1 + IL_006c: ldc.i4.1 + IL_006d: ldc.i4.s 10 + IL_006f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_0048: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_004d: dup - IL_004e: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 ''.$assembly::aseq@7 - IL_0053: stloc.2 - IL_0054: ldc.i4.1 - IL_0055: ldc.i4.1 - IL_0056: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_0074: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0079: dup + IL_007a: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 ''.$assembly::aseq@7 + IL_007f: stloc.2 + IL_0080: ldc.i4.1 + IL_0081: ldc.i4.1 + IL_0082: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_005b: ldc.i4.2 - IL_005c: ldc.i4.2 - IL_005d: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_0087: ldc.i4.2 + IL_0088: ldc.i4.2 + IL_0089: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() - IL_0067: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() + IL_0093: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_006c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + IL_0098: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0071: dup - IL_0072: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> ''.$assembly::list1@8 - IL_0077: stloc.3 - IL_0078: ldc.i4.0 - IL_0079: ldnull - IL_007a: newobj instance void assembly/seq1@9::.ctor(int32, + IL_009d: dup + IL_009e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> ''.$assembly::list1@8 + IL_00a3: stloc.3 + IL_00a4: ldc.i4.0 + IL_00a5: ldnull + IL_00a6: newobj instance void assembly/seq1@9::.ctor(int32, class [runtime]System.Tuple`2) - IL_007f: dup - IL_0080: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> ''.$assembly::seq1@9 - IL_0085: stloc.s V_4 - IL_0087: ldc.i4.2 - IL_0088: newarr class [runtime]System.Tuple`2 - IL_008d: dup - IL_008e: ldc.i4.0 - IL_008f: ldc.i4.1 - IL_0090: ldc.i4.1 - IL_0091: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_00ab: dup + IL_00ac: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> ''.$assembly::seq1@9 + IL_00b1: stloc.s V_4 + IL_00b3: ldc.i4.2 + IL_00b4: newarr class [runtime]System.Tuple`2 + IL_00b9: dup + IL_00ba: ldc.i4.0 + IL_00bb: ldc.i4.1 + IL_00bc: ldc.i4.1 + IL_00bd: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_0096: stelem class [runtime]System.Tuple`2 - IL_009b: dup - IL_009c: ldc.i4.1 - IL_009d: ldc.i4.2 - IL_009e: ldc.i4.2 - IL_009f: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_00c2: stelem class [runtime]System.Tuple`2 + IL_00c7: dup + IL_00c8: ldc.i4.1 + IL_00c9: ldc.i4.2 + IL_00ca: ldc.i4.2 + IL_00cb: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_00a4: stelem class [runtime]System.Tuple`2 - IL_00a9: dup - IL_00aa: stsfld class [runtime]System.Tuple`2[] ''.$assembly::array1@10 - IL_00af: stloc.s V_5 - IL_00b1: ldc.i4.2 - IL_00b2: ldc.i4.2 - IL_00b3: ldc.i4.0 - IL_00b4: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, + IL_00d0: stelem class [runtime]System.Tuple`2 + IL_00d5: dup + IL_00d6: stsfld class [runtime]System.Tuple`2[] ''.$assembly::array1@10 + IL_00db: stloc.s V_5 + IL_00dd: ldc.i4.2 + IL_00de: ldc.i4.2 + IL_00df: ldc.i4.0 + IL_00e0: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, int32, !!0) - IL_00b9: dup - IL_00ba: stsfld int32[0...,0...] ''.$assembly::a3@11 - IL_00bf: stloc.s V_6 - IL_00c1: ldc.i4.3 - IL_00c2: ldc.i4.3 - IL_00c3: ldc.i4.3 - IL_00c4: ldc.i4.0 - IL_00c5: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, + IL_00e5: dup + IL_00e6: stsfld int32[0...,0...] ''.$assembly::a3@11 + IL_00eb: stloc.s V_6 + IL_00ed: ldc.i4.3 + IL_00ee: ldc.i4.3 + IL_00ef: ldc.i4.3 + IL_00f0: ldc.i4.0 + IL_00f1: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, int32, int32, !!0) - IL_00ca: dup - IL_00cb: stsfld int32[0...,0...,0...] ''.$assembly::array3D@12 - IL_00d0: stloc.s V_7 - IL_00d2: ldc.i4.4 - IL_00d3: ldc.i4.4 - IL_00d4: ldc.i4.4 - IL_00d5: ldc.i4.4 - IL_00d6: ldc.i4.0 - IL_00d7: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, + IL_00f6: dup + IL_00f7: stsfld int32[0...,0...,0...] ''.$assembly::array3D@12 + IL_00fc: stloc.s V_7 + IL_00fe: ldc.i4.4 + IL_00ff: ldc.i4.4 + IL_0100: ldc.i4.4 + IL_0101: ldc.i4.4 + IL_0102: ldc.i4.0 + IL_0103: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, int32, int32, int32, !!0) - IL_00dc: dup - IL_00dd: stsfld int32[0...,0...,0...,0...] ''.$assembly::array4D@13 - IL_00e2: stloc.s V_8 - IL_00e4: call int32[] assembly::get_array() - IL_00e9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) - IL_00ee: pop - IL_00ef: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_00f4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_00f9: pop - IL_00fa: call class [runtime]System.Tuple`2[] assembly::get_array1() - IL_00ff: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) - IL_0104: pop - IL_0105: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() - IL_010a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) - IL_010f: pop - IL_0110: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() - IL_0115: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) + IL_0108: dup + IL_0109: stsfld int32[0...,0...,0...,0...] ''.$assembly::array4D@13 + IL_010e: stloc.s V_8 + IL_0110: call int32[] assembly::get_array() + IL_0115: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) IL_011a: pop - IL_011b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() - IL_0120: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0125: dup - IL_0126: stsfld int32[] ''.$assembly::a1@25 - IL_012b: stloc.s V_9 - IL_012d: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_0132: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0137: dup - IL_0138: stsfld int32[] ''.$assembly::a2@26 - IL_013d: stloc.s V_10 - IL_013f: call int32[] assembly::get_a1() - IL_0144: ldc.i4.0 - IL_0145: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], + IL_011b: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_0120: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0125: pop + IL_0126: call class [runtime]System.Tuple`2[] assembly::get_array1() + IL_012b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) + IL_0130: pop + IL_0131: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() + IL_0136: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) + IL_013b: pop + IL_013c: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() + IL_0141: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) + IL_0146: pop + IL_0147: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() + IL_014c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0151: dup + IL_0152: stsfld int32[] ''.$assembly::a1@25 + IL_0157: stloc.s V_9 + IL_0159: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_015e: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0163: dup + IL_0164: stsfld int32[] ''.$assembly::a2@26 + IL_0169: stloc.s V_10 + IL_016b: call int32[] assembly::get_a1() + IL_0170: ldc.i4.0 + IL_0171: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], int32) - IL_014a: stloc.s V_11 - IL_014c: call int32[] assembly::get_a2() - IL_0151: ldc.i4.0 - IL_0152: ldloc.s V_11 - IL_0154: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], + IL_0176: stloc.s V_13 + IL_0178: call int32[] assembly::get_a2() + IL_017d: ldc.i4.0 + IL_017e: ldloc.s V_13 + IL_0180: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], int32, !!0) - IL_0159: nop - IL_015a: call int32[0...,0...] assembly::get_a3() - IL_015f: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) - IL_0164: call int32[0...,0...] assembly::get_a3() - IL_0169: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) - IL_016e: call int32[0...,0...] assembly::get_a3() - IL_0173: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) - IL_0178: call int32[0...,0...] assembly::get_a3() - IL_017d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) - IL_0182: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + IL_0185: nop + IL_0186: call int32[0...,0...] assembly::get_a3() + IL_018b: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) + IL_0190: call int32[0...,0...] assembly::get_a3() + IL_0195: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) + IL_019a: call int32[0...,0...] assembly::get_a3() + IL_019f: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) + IL_01a4: call int32[0...,0...] assembly::get_a3() + IL_01a9: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) + IL_01ae: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, !1, !2, !3) - IL_0187: stloc.s V_12 - IL_0189: ldloc.s V_12 - IL_018b: stloc.s V_13 - IL_018d: call int32[0...,0...] assembly::get_a3() - IL_0192: ldc.i4.0 - IL_0193: ldc.i4.0 - IL_0194: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], + IL_01b3: stloc.s V_14 + IL_01b5: ldloc.s V_14 + IL_01b7: stloc.s V_15 + IL_01b9: call int32[0...,0...] assembly::get_a3() + IL_01be: ldc.i4.0 + IL_01bf: ldc.i4.0 + IL_01c0: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], int32, int32) - IL_0199: stloc.s V_14 - IL_019b: call int32[0...,0...] assembly::get_a3() - IL_01a0: ldc.i4.0 - IL_01a1: ldc.i4.0 - IL_01a2: ldloc.s V_14 - IL_01a4: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], + IL_01c5: stloc.s V_16 + IL_01c7: call int32[0...,0...] assembly::get_a3() + IL_01cc: ldc.i4.0 + IL_01cd: ldc.i4.0 + IL_01ce: ldloc.s V_16 + IL_01d0: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], int32, int32, !!0) - IL_01a9: nop - IL_01aa: call int32[0...,0...,0...] assembly::get_array3D() - IL_01af: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) - IL_01b4: call int32[0...,0...,0...] assembly::get_array3D() - IL_01b9: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) - IL_01be: call int32[0...,0...,0...] assembly::get_array3D() - IL_01c3: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) - IL_01c8: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, + IL_01d5: nop + IL_01d6: call int32[0...,0...,0...] assembly::get_array3D() + IL_01db: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) + IL_01e0: call int32[0...,0...,0...] assembly::get_array3D() + IL_01e5: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) + IL_01ea: call int32[0...,0...,0...] assembly::get_array3D() + IL_01ef: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) + IL_01f4: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, !1, !2) - IL_01cd: stloc.s V_15 - IL_01cf: ldloc.s V_15 - IL_01d1: stloc.s V_16 - IL_01d3: call int32[0...,0...,0...] assembly::get_array3D() - IL_01d8: ldc.i4.0 - IL_01d9: ldc.i4.0 - IL_01da: ldc.i4.0 - IL_01db: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], + IL_01f9: stloc.s V_17 + IL_01fb: ldloc.s V_17 + IL_01fd: stloc.s V_18 + IL_01ff: call int32[0...,0...,0...] assembly::get_array3D() + IL_0204: ldc.i4.0 + IL_0205: ldc.i4.0 + IL_0206: ldc.i4.0 + IL_0207: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], int32, int32, int32) - IL_01e0: stloc.s V_17 - IL_01e2: call int32[0...,0...,0...] assembly::get_array3D() - IL_01e7: ldc.i4.0 - IL_01e8: ldc.i4.0 - IL_01e9: ldc.i4.0 - IL_01ea: ldloc.s V_17 - IL_01ec: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], + IL_020c: stloc.s V_19 + IL_020e: call int32[0...,0...,0...] assembly::get_array3D() + IL_0213: ldc.i4.0 + IL_0214: ldc.i4.0 + IL_0215: ldc.i4.0 + IL_0216: ldloc.s V_19 + IL_0218: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], int32, int32, int32, !!0) - IL_01f1: nop - IL_01f2: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_01f7: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) - IL_01fc: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0201: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) - IL_0206: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_020b: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) - IL_0210: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0215: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) - IL_021a: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + IL_021d: nop + IL_021e: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0223: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) + IL_0228: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_022d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) + IL_0232: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0237: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) + IL_023c: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0241: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) + IL_0246: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, !1, !2, !3) - IL_021f: stloc.s V_18 - IL_0221: ldloc.s V_18 - IL_0223: stloc.s V_19 - IL_0225: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_022a: ldc.i4.0 - IL_022b: ldc.i4.0 - IL_022c: ldc.i4.0 - IL_022d: ldc.i4.0 - IL_022e: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], + IL_024b: stloc.s V_20 + IL_024d: ldloc.s V_20 + IL_024f: stloc.s V_21 + IL_0251: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0256: ldc.i4.0 + IL_0257: ldc.i4.0 + IL_0258: ldc.i4.0 + IL_0259: ldc.i4.0 + IL_025a: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], int32, int32, int32, int32) - IL_0233: stloc.s V_20 - IL_0235: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_023a: ldc.i4.0 - IL_023b: ldc.i4.0 - IL_023c: ldc.i4.0 - IL_023d: ldc.i4.0 - IL_023e: ldloc.s V_20 - IL_0240: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], + IL_025f: stloc.s V_22 + IL_0261: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0266: ldc.i4.0 + IL_0267: ldc.i4.0 + IL_0268: ldc.i4.0 + IL_0269: ldc.i4.0 + IL_026a: ldloc.s V_22 + IL_026c: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], int32, int32, int32, int32, !!0) - IL_0245: nop - IL_0246: ret + IL_0271: nop + IL_0272: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl index 7d0d3f2f625..e797d2fc3bb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl @@ -56,42 +56,76 @@ { .entrypoint - .maxstack 5 + .maxstack 4 .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - int32 V_2) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + int32 V_2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_3, + int32 V_4) IL_0000: ldc.i4.1 - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.3 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0012: stloc.0 - IL_0013: ldloc.0 - IL_0014: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0019: stloc.1 - IL_001a: br.s IL_0042 - - IL_001c: ldloc.0 - IL_001d: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0022: stloc.2 - IL_0023: ldstr "%A" - IL_0028: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_002d: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0032: ldloc.2 - IL_0033: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0038: pop - IL_0039: ldloc.1 - IL_003a: stloc.0 - IL_003b: ldloc.0 - IL_003c: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0041: stloc.1 - IL_0042: ldloc.1 - IL_0043: brtrue.s IL_001c - - IL_0045: ret + IL_0001: stloc.2 + IL_0002: ldc.i4.1 + IL_0003: stloc.2 + IL_0004: br.s IL_0013 + + IL_0006: ldloca.s V_1 + IL_0008: ldloc.2 + IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000e: nop + IL_000f: ldloc.2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: stloc.2 + IL_0013: ldloc.2 + IL_0014: ldc.i4.3 + IL_0015: bge.s IL_0026 + + IL_0017: ldc.i4.1 + IL_0018: ldloc.2 + IL_0019: bge.s IL_001f + + IL_001b: ldc.i4.1 + IL_001c: nop + IL_001d: br.s IL_002b + + IL_001f: ldc.i4.1 + IL_0020: ldloc.2 + IL_0021: ceq + IL_0023: nop + IL_0024: br.s IL_002b + + IL_0026: ldloc.2 + IL_0027: ldc.i4.3 + IL_0028: ceq + IL_002a: nop + IL_002b: brtrue.s IL_0006 + + IL_002d: ldloca.s V_1 + IL_002f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_003b: stloc.3 + IL_003c: br.s IL_0066 + + IL_003e: ldloc.0 + IL_003f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0044: stloc.s V_4 + IL_0046: ldstr "%A" + IL_004b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_0050: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0055: ldloc.s V_4 + IL_0057: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_005c: pop + IL_005d: ldloc.3 + IL_005e: stloc.0 + IL_005f: ldloc.0 + IL_0060: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0065: stloc.3 + IL_0066: ldloc.3 + IL_0067: brtrue.s IL_003e + + IL_0069: ret } } From ae4f97e44f1acbe6b1e12677fe746bed662a2c0f Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Sun, 4 Feb 2024 21:41:58 -0500 Subject: [PATCH 04/66] Update release notes --- docs/release-notes/.FSharp.Compiler.Service/8.0.300.md | 1 + 1 file changed, 1 insertion(+) 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 b8dc1de0de9..9fac05c4fee 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -23,3 +23,4 @@ * Reduce allocations in compiler checking via `ValueOption` usage ([PR #16323](https://github.com/dotnet/fsharp/pull/16323), [PR #16567](https://github.com/dotnet/fsharp/pull/16567)) * 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)) +* Integral range optimizations. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650)) From 97924fdbb3115340677a664b29b08462514cf545 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Sun, 4 Feb 2024 21:45:10 -0500 Subject: [PATCH 05/66] Fmt --- src/Compiler/TypedTree/TypedTreeOps.fsi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index a79f3d2b939..5fccf08cd18 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2552,23 +2552,23 @@ val (|SpecialNotEquatableHeadType|_|): TcGlobals -> TType -> unit option /// /// start..step..finish [] -val (|IntegralRange|_|): g:TcGlobals -> expr: Expr -> (TType * (Expr * Expr * Expr)) voption +val (|IntegralRange|_|): g: TcGlobals -> expr: Expr -> (TType * (Expr * Expr * Expr)) voption /// Matches if the given start, step, and finish represent /// a range that is known to be empty at compile-time. [] -val (|EmptyRange|_|): start:Expr * step: Expr * finish: Expr -> unit voption +val (|EmptyRange|_|): start: Expr * step: Expr * finish: Expr -> unit voption /// Makes an optimized while-loop for the given /// integral start, stop, and finish. val mkOptimizedRangeLoop: g: TcGlobals -> mBody: range * mFor: range * mIn: range * spInWhile: DebugPointAtWhile -> - rangeTy: TType * rangeExpr: Expr -> - start: Expr * step: Expr * finish: Expr -> - loopVarVal: Val * loopVar: Expr -> - body: Expr -> - Expr + rangeTy: TType * rangeExpr: Expr -> + start: Expr * step: Expr * finish: Expr -> + loopVarVal: Val * loopVar: Expr -> + body: Expr -> + Expr type OptimizeForExpressionOptions = | OptimizeIntRangesOnly From 3e335f718cd369bd656f43512d9852fe1737398b Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Sun, 4 Feb 2024 22:15:39 -0500 Subject: [PATCH 06/66] Update more baselines --- .../ComputationExpr07.fs.il.bsl | 81 +++++++--- ...onTrivialBranchingBindingInEnd04.fs.il.bsl | 148 ++++++++++++------ 2 files changed, 154 insertions(+), 75 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl index 6b0f84999c2..917d51428c4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl @@ -170,7 +170,9 @@ { .maxstack 9 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0) + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + int32 V_2) IL_0000: ldc.i4.1 IL_0001: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!0) IL_0006: stloc.0 @@ -179,32 +181,65 @@ IL_000d: ldarg.0 IL_000e: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ IL_0013: ldc.i4.0 - IL_0014: ldc.i4.1 - IL_0015: ldc.i4.3 - IL_0016: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_001b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0020: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0025: ldarg.0 - IL_0026: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_002b: ldloc.0 - IL_002c: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_0014: stloc.2 + IL_0015: ldc.i4.0 + IL_0016: stloc.2 + IL_0017: ldloc.2 + IL_0018: ldc.i4.3 + IL_0019: bge.s IL_002a + + IL_001b: ldc.i4.0 + IL_001c: ldloc.2 + IL_001d: bge.s IL_0023 + + IL_001f: ldc.i4.1 + IL_0020: nop + IL_0021: br.s IL_002f + + IL_0023: ldc.i4.0 + IL_0024: ldloc.2 + IL_0025: ceq + IL_0027: nop + IL_0028: br.s IL_002f + + IL_002a: ldloc.2 + IL_002b: ldc.i4.3 + IL_002c: ceq + IL_002e: nop + IL_002f: brfalse.s IL_0041 + + IL_0031: ldloca.s V_1 + IL_0033: ldloc.2 + IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0039: nop + IL_003a: ldloc.2 + IL_003b: ldc.i4.1 + IL_003c: add + IL_003d: stloc.2 + IL_003e: nop + IL_003f: br.s IL_0017 + + IL_0041: ldloca.s V_1 + IL_0043: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0048: ldarg.0 + IL_0049: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_004e: ldloc.0 + IL_004f: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_0031: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, + IL_0054: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0036: ldarg.0 - IL_0037: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_003c: ldarg.0 - IL_003d: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_0042: ldloc.0 - IL_0043: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_0059: ldarg.0 + IL_005a: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_005f: ldarg.0 + IL_0060: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_0065: ldloc.0 + IL_0066: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_0048: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_004d: tail. - IL_004f: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, + IL_006b: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0070: tail. + IL_0072: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, class [ComputationExprLibrary]Library.Eventually`1) - IL_0054: ret + IL_0077: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl index 7229991ff4b..f3d5e50340d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -177,7 +177,9 @@ .entrypoint .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + int32 V_2) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -208,57 +210,99 @@ IL_0049: nop IL_004a: ldc.i4.1 IL_004b: sub - IL_004c: ldc.i4.m1 - IL_004d: ldc.i4.0 - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: stloc.2 + IL_004f: ldloc.0 + IL_0050: stloc.2 + IL_0051: ldloc.2 + IL_0052: ldc.i4.0 + IL_0053: bge.s IL_0058 + + IL_0055: nop + IL_0056: br.s IL_0082 + + IL_0058: br.s IL_0067 + + IL_005a: ldloca.s V_1 + IL_005c: ldloc.2 + IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0062: nop + IL_0063: ldloc.2 + IL_0064: ldc.i4.m1 + IL_0065: add + IL_0066: stloc.2 + IL_0067: ldc.i4.0 + IL_0068: ldloc.2 + IL_0069: bge.s IL_007a + + IL_006b: ldloc.2 + IL_006c: ldloc.0 + IL_006d: bge.s IL_0073 + + IL_006f: ldc.i4.1 + IL_0070: nop + IL_0071: br.s IL_007f + + IL_0073: ldloc.2 + IL_0074: ldloc.0 + IL_0075: ceq + IL_0077: nop + IL_0078: br.s IL_007f + + IL_007a: ldc.i4.0 + IL_007b: ldloc.2 + IL_007c: ceq + IL_007e: nop + IL_007f: brtrue.s IL_005a + + IL_0081: nop + IL_0082: ldloca.s V_1 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009d: br.s IL_00e5 + + IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a9: stloc.0 + IL_00aa: call int32[] assembly::get_r() + IL_00af: ldloc.0 + IL_00b0: call int32[] assembly::get_r() + IL_00b5: ldloc.0 + IL_00b6: ldelem [runtime]System.Int32 + IL_00bb: call int32[] assembly::get_w() + IL_00c0: ldloc.0 + IL_00c1: ldelem [runtime]System.Int32 + IL_00c6: add + IL_00c7: stelem [runtime]System.Int32 + IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00ea: brtrue.s IL_009f + + IL_00ec: nop + IL_00ed: nop + IL_00ee: call int32[] assembly::get_r() + IL_00f3: ldc.i4.0 + IL_00f4: ldelem [runtime]System.Int32 + IL_00f9: ldc.i4.3 + IL_00fa: bne.un.s IL_0100 + + IL_00fc: ldc.i4.0 + IL_00fd: nop + IL_00fe: br.s IL_0102 + + IL_0100: ldc.i4.1 + IL_0101: nop + IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0107: pop + IL_0108: ret } } From 3b58f816a1e5dbd174c329341a788659fa5b9252 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Sun, 4 Feb 2024 23:39:17 -0500 Subject: [PATCH 07/66] Typo --- src/Compiler/TypedTree/TypedTreeOps.fsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 5fccf08cd18..a7e8f523ea9 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2560,7 +2560,7 @@ val (|IntegralRange|_|): g: TcGlobals -> expr: Expr -> (TType * (Expr * Expr * E val (|EmptyRange|_|): start: Expr * step: Expr * finish: Expr -> unit voption /// Makes an optimized while-loop for the given -/// integral start, stop, and finish. +/// integral start, step, and finish. val mkOptimizedRangeLoop: g: TcGlobals -> mBody: range * mFor: range * mIn: range * spInWhile: DebugPointAtWhile -> From fa515e87239320c7364c22f17151825bc223524d Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 5 Feb 2024 12:06:33 -0500 Subject: [PATCH 08/66] Update comments --- src/Compiler/TypedTree/TypedTreeOps.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index bea18489dc3..447ad94d5aa 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10269,7 +10269,7 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, else mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) - /// while start <= finish do … + /// while start <= finish && originalStart <= start do … let mkUp (startVal, start) originalStart step finish = let origStartLtEqStart = mkCond @@ -10302,7 +10302,7 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, mBody ) - /// while finish <= start do … + /// while finish <= start && start <= originalStart do … let mkDown (startVal, start) originalStart step finish = let startLtEqOrigStart = mkCond @@ -10475,6 +10475,7 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, // for … in 5..-1..1 do … | ConstRange FSharpForLoopDown -> mkNecessaryLetBindingsFor mkDown + // for … in start..finish do … // for … in start..step..finish do … | _, _, _ -> mkNecessaryLetBindingsFor mkIntegralWhileLoop From e1f4356747ad62bb4a56b9c27a34e006a72a70c3 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 5 Feb 2024 12:10:07 -0500 Subject: [PATCH 09/66] Refactor for clarity --- .../Optimize/LowerComputedCollections.fs | 542 ++++++++---------- 1 file changed, 254 insertions(+), 288 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 4a7d98580b6..251443ecab1 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -322,67 +322,193 @@ let (|ConstCount|_|) (start, step, finish) = | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (Const.Char (char (uint16 (finish - start) / uint16 step) + '\001')) | _ -> ValueNone -let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = - // If ListCollector is in FSharp.Core then this optimization kicks in - if g.ListCollector_tcr.CanDeref then - /// Make an expression holding the count - /// to initialize the collection with. - let mkCount m rangeExpr ty start step finish = - match step with - // step = 1: - // finish - start + 1 - | Expr.Const (value = IntegralConst.One) -> - let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) - mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) - - // step = -1: - // -(finish - start) + 1 - | Expr.Const (value = IntegralConst.MinusOne) -> - let diff = mkAsmExpr ([AI_neg], [], [mkAsmExpr ([AI_sub], [], [finish; start], [ty], m)], [ty], m) - mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) - - // step = : - // (finish - start) / step + 1 - | Expr.Const (value = _notOneOrMinusOne) -> - let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) - - let quotient = - if isSignedIntegerTy g ty then - mkAsmExpr ([AI_div], [], [diff; step], [ty], m) - else - mkAsmExpr ([AI_div_un], [], [diff; step], [ty], m) - - mkAsmExpr ([AI_add], [], [quotient; mkOne g m], [ty], m) - - // Arbitrary step: - // (finish - start) / step + 1 - | _notConst -> - // Use the potentially-evaluated-and-bound start, step, and finish. - let rangeExpr = - match rangeExpr with - | Expr.App (funcExpr, formalType, tyargs, _, m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) - | _ -> rangeExpr - - /// This will raise an exception at runtime if step is zero. - let callAndIgnoreRangeExpr = - mkSequential - m - rangeExpr - (mkUnit g m) +/// Bind start, step, and finish exprs to local variables if needed, e.g., +/// +/// [start..finishExpr] → let finish = finishExpr in … +/// +/// [startExpr..finish] → let start = startExpr in … +/// +/// [startExpr..finishExpr] → let start = startExpr in let finish = finishExpr in … +let mkLetBindingsIfNeeded m ty start step finish mkInitExpr = + match start, step, finish with + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + mkInitExpr start step finish + + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish) + + | _, (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkInitExpr start step finish) + + | (Expr.Const _ | Expr.Val _), _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkInitExpr start step finish) + + | _, (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish)) + + | (Expr.Const _ | Expr.Val _), _, _ -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish)) + + | _, _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkInitExpr start step finish)) + + | _, _, _ -> + mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> + mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> + mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> + mkInitExpr start step finish))) + +module List = + /// Makes an expression that will build a list from an integral range. + /// Expects a constant zero step to have already been checked for. + let mkFromIntegralRange tcVal g amap m overallElemTy overallSeqExpr start step finish = + match start, step, finish with + // [5..1] → [] + // [1..-1..5] → [] + | EmptyRange -> mkNil g m overallElemTy + + // [1..5] + // [1..2..5] + // [start..finish] + // [start..step..finish] + | _, _, _ -> + let collectorTy = g.mk_ListCollector_ty overallElemTy + + mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> + mkCompGenLetMutableIn m "collector" collectorTy (mkDefault (m, collectorTy)) (fun (_, collector) -> + mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> + let reader = InfoReader (g, amap) + + let body = mkCallCollectorAdd tcVal g reader m collector loopVar + + let loop = + mkOptimizedRangeLoop + g + (m, m, m, DebugPointAtWhile.No) + (overallElemTy, overallSeqExpr) + (start, step, finish) + (loopVarVal, loopVar) + body + + let close = mkCallCollectorClose tcVal g reader m collector + + mkSequential m loop close + ) + ) + ) - // Let the range call throw the appropriate localized - // exception at runtime if step is zero: - // if step = 0 then (.. ..) start step finish - let throwIfStepIsZero = - mkCond - DebugPointAtBinding.NoneAtInvisible +module Array = + /// Makes an expression that will build an array from an integral range. + /// Expects a constant zero step to have already been checked for. + let mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish = + let arrayTy = mkArrayType g overallElemTy + + /// Triggers an overflow exception at runtime if count doesn't fit in a native int. + let convToNativeIntWithOverflow m overallElemTy count = + if typeEquiv g overallElemTy g.int64_ty then mkAsmExpr ([AI_conv_ovf DT_I], [], [count], [g.nativeint_ty], m) + elif typeEquiv g overallElemTy g.uint64_ty then mkAsmExpr ([AI_conv_ovf_un DT_I], [], [count], [g.nativeint_ty], m) + else count + + let mkInitializer count start step = + let ilTy = + let ty = stripMeasuresFromTy g overallElemTy + if typeEquiv g ty g.int32_ty then g.ilg.typ_Int32 + elif typeEquiv g ty g.int64_ty then g.ilg.typ_Int64 + elif typeEquiv g ty g.uint64_ty then g.ilg.typ_UInt64 + elif typeEquiv g ty g.uint32_ty then g.ilg.typ_UInt32 + elif typeEquiv g ty g.nativeint_ty then g.ilg.typ_IntPtr + elif typeEquiv g ty g.unativeint_ty then g.ilg.typ_UIntPtr + elif typeEquiv g ty g.int16_ty then g.ilg.typ_Int16 + elif typeEquiv g ty g.uint16_ty then g.ilg.typ_UInt16 + elif typeEquiv g ty g.sbyte_ty then g.ilg.typ_SByte + elif typeEquiv g ty g.byte_ty then g.ilg.typ_Byte + elif typeEquiv g ty g.char_ty then g.ilg.typ_Char + else error(InternalError($"Unrecognized integral type '{ty}'.", m)) + + /// (# "newarr !0" type ('T) count : 'T array #) + let mkNewArray count = + mkAsmExpr + ( + [I_newarr (ILArrayShape.SingleDimensional, ilTy)], + [], + [convToNativeIntWithOverflow m overallElemTy count], + [arrayTy], m - g.unit_ty - (mkILAsmCeq g m step (mkZero g m)) - callAndIgnoreRangeExpr - (mkUnit g m) + ) + + mkCompGenLetIn m "array" arrayTy (mkNewArray count) (fun (_, array) -> + mkCompGenLetMutableIn m "i" g.int32_ty (mkZero g m) (fun (iVal, i) -> + mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> + // array[i] <- loopVar + let setArrSubI = mkAsmExpr ([I_stelem_any (ILArrayShape.SingleDimensional, ilTy)], [], [array; i; loopVar], [], m) - let count = + // loopVar <- loopVar + step + let incrV = mkValSet m (mkLocalValRef loopVarVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [overallElemTy], m)) + + // i <- i + 1 + let incrI = mkValSet m (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkOne g m], [g.int32_ty], m)) + + let body = mkSequentials g m [setArrSubI; incrV; incrI] + + let guard = mkILAsmClt g m i (mkLdlen g m array) + + let loop = + mkWhile + g + ( + DebugPointAtWhile.No, + NoSpecialWhileLoopMarker, + guard, + body, + m + ) + + // while i < array.Length do done + // array + mkSequential m loop array + ) + ) + ) + + match start, step, finish with + // [|5..1|] → [||] + // [|1..-1..5|] → [||] + | EmptyRange -> mkArray (overallElemTy, [], m) + + // [|1..5|] + // [|1..2..5|] + | ConstCount count -> mkInitializer (Expr.Const (count, m, overallElemTy)) start step + + // [|start..finish|] + // [|start..step..finish|] + | _, _, _ -> + /// Make an expression holding the size of the array. + let mkCount m rangeExpr ty start step finish = + match step with + // step = 1: + // finish - start + 1 + | Expr.Const (value = IntegralConst.One) -> + let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) + mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) + + // step = -1: + // -(finish - start) + 1 + | Expr.Const (value = IntegralConst.MinusOne) -> + let diff = mkAsmExpr ([AI_neg], [], [mkAsmExpr ([AI_sub], [], [finish; start], [ty], m)], [ty], m) + mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) + + // step = : + // (finish - start) / step + 1 + | Expr.Const (value = _notOneOrZeroOrMinusOne) -> let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) let quotient = @@ -393,80 +519,77 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = mkAsmExpr ([AI_add], [], [quotient; mkOne g m], [ty], m) - mkSequential m throwIfStepIsZero count + // Arbitrary step: + // (finish - start) / step + 1 + | _notConst -> + // Use the potentially-evaluated-and-bound start, step, and finish. + let rangeExpr = + match rangeExpr with + | Expr.App (funcExpr, formalType, tyargs, _, m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) + | _ -> rangeExpr + + /// This will raise an exception at runtime if step is zero. + let callAndIgnoreRangeExpr = + mkSequential + m + rangeExpr + (mkUnit g m) + + // Let the range call throw the appropriate localized + // exception at runtime if step is zero: + // if step = 0 then (.. ..) start step finish + let throwIfStepIsZero = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + g.unit_ty + (mkILAsmCeq g m step (mkZero g m)) + callAndIgnoreRangeExpr + (mkUnit g m) - /// Triggers an overflow exception at runtime if count doesn't fit in a native int. - let convToNativeIntWithOverflow m overallElemTy count = - if typeEquiv g overallElemTy g.int64_ty then mkAsmExpr ([AI_conv_ovf DT_I], [], [count], [g.nativeint_ty], m) - elif typeEquiv g overallElemTy g.uint64_ty then mkAsmExpr ([AI_conv_ovf_un DT_I], [], [count], [g.nativeint_ty], m) - else count + let count = + let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) - let mkSignednessAppropriateClt g m ty e1 e2 = - if isSignedIntegerTy g ty then - mkILAsmClt g m e1 e2 - else - mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) - - /// Bind start, step, and finish exprs to local variables if needed, e.g., - /// - /// [start..finishExpr] → let finish = finishExpr in … - /// - /// [startExpr..finish] → let start = startExpr in … - /// - /// [startExpr..finishExpr] → let start = startExpr in let finish = finishExpr in … - let mkLetBindingsIfNeeded m ty start step finish mkInitExpr = - match start, step, finish with - | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> - mkInitExpr start step finish - - | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), _ -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish) - - | _, (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkInitExpr start step finish) - - | (Expr.Const _ | Expr.Val _), _, (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkInitExpr start step finish) - - | _, (Expr.Const _ | Expr.Val _), _ -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish)) - - | (Expr.Const _ | Expr.Val _), _, _ -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish)) - - | _, _, (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkInitExpr start step finish)) - - | _, _, _ -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish))) - - let mkIlTy m ty = - let ty = stripMeasuresFromTy g ty - if typeEquiv g ty g.int32_ty then g.ilg.typ_Int32 - elif typeEquiv g ty g.int64_ty then g.ilg.typ_Int64 - elif typeEquiv g ty g.uint64_ty then g.ilg.typ_UInt64 - elif typeEquiv g ty g.uint32_ty then g.ilg.typ_UInt32 - elif typeEquiv g ty g.nativeint_ty then g.ilg.typ_IntPtr - elif typeEquiv g ty g.unativeint_ty then g.ilg.typ_UIntPtr - elif typeEquiv g ty g.int16_ty then g.ilg.typ_Int16 - elif typeEquiv g ty g.uint16_ty then g.ilg.typ_UInt16 - elif typeEquiv g ty g.sbyte_ty then g.ilg.typ_SByte - elif typeEquiv g ty g.byte_ty then g.ilg.typ_Byte - elif typeEquiv g ty g.char_ty then g.ilg.typ_Char - else error(InternalError($"Unrecognized integral type '{ty}'.", m)) + let quotient = + if isSignedIntegerTy g ty then + mkAsmExpr ([AI_div], [], [diff; step], [ty], m) + else + mkAsmExpr ([AI_div_un], [], [diff; step], [ty], m) + + mkAsmExpr ([AI_add], [], [quotient; mkOne g m], [ty], m) + + mkSequential m throwIfStepIsZero count + + mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> + mkCompGenLetIn m "count" overallElemTy (mkCount m overallSeqExpr overallElemTy start step finish) (fun (_, count) -> + let mkSignednessAppropriateClt g m ty e1 e2 = + if isSignedIntegerTy g ty then + mkILAsmClt g m e1 e2 + else + mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) + + // count < 1 + let countLtOne = mkSignednessAppropriateClt g m overallElemTy count (mkOne g m) + + // [||] + let empty = mkArray (overallElemTy, [], m) + let initialize = mkInitializer count start step + + // if count < 1 then [||] else + mkCond + DebugPointAtBinding.NoneAtInvisible + m + arrayTy + countLtOne + empty + initialize + ) + ) + +let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = + // If ListCollector is in FSharp.Core then this optimization kicks in + if g.ListCollector_tcr.CanDeref then match overallExpr with // […] | SeqToList g (OptionalCoerce (OptionalSeq g amap (overallSeqExpr, overallElemTy)), m) -> @@ -476,41 +599,10 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = let collectorTy = g.mk_ListCollector_ty overallElemTy LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr - // [5..1] → [] - // [1..-1..5] → [] - | IntegralRange g (_, EmptyRange) -> - Some (mkNil g m overallElemTy) - // [start..finish] // [start..step..finish] | IntegralRange g (_, (start, step, finish)) -> - let collectorTy = g.mk_ListCollector_ty overallElemTy - - let expr = - mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> - mkCompGenLetMutableIn m "collector" collectorTy (mkDefault (m, collectorTy)) (fun (_, collector) -> - mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> - let reader = InfoReader (g, amap) - - let body = mkCallCollectorAdd tcVal g reader m collector loopVar - - let loop = - mkOptimizedRangeLoop - g - (m, m, m, DebugPointAtWhile.No) - (overallElemTy, overallSeqExpr) - (start, step, finish) - (loopVarVal, loopVar) - body - - let close = mkCallCollectorClose tcVal g reader m collector - - mkSequential m loop close - ) - ) - ) - - Some expr + Some (List.mkFromIntegralRange tcVal g amap m overallElemTy overallSeqExpr start step finish) // [(* Anything more complex. *)] | _ -> @@ -525,136 +617,10 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = let collectorTy = g.mk_ArrayCollector_ty overallElemTy LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr - // [|5..1|] → [||] - // [|1..-1..5|] → [||] - | IntegralRange g (_, EmptyRange) -> - Some (mkArray (overallElemTy, [], m)) - - // [|1..5|] - // [|1..2..5|] - | IntegralRange g (_, (start, step, _) & ConstCount count) -> - let arrayTy = mkArrayType g overallElemTy - - // (# "newarr !0" type ('T) count : 'T array #) - let array = - mkAsmExpr - ( - [I_newarr (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], - [], - [convToNativeIntWithOverflow m overallElemTy (Expr.Const (count, m, overallElemTy))], - [arrayTy], - m - ) - - let expr = - mkCompGenLetIn m (nameof array) arrayTy array (fun (_, array) -> - mkCompGenLetMutableIn m "i" g.int32_ty (mkZero g m) (fun (iVal, i) -> - mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> - // array[i] <- loopVar - let setArrSubI = mkAsmExpr ([I_stelem_any (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], [], [array; i; loopVar], [], m) - - // loopVar <- loopVar + step - let incrV = mkValSet m (mkLocalValRef loopVarVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [overallElemTy], m)) - - // i <- i + 1 - let incrI = mkValSet m (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkOne g m], [g.int32_ty], m)) - - let body = mkSequentials g m [setArrSubI; incrV; incrI] - - let guard = mkILAsmClt g m i (mkLdlen g m array) - - let loop = - mkWhile - g - ( - DebugPointAtWhile.No, - NoSpecialWhileLoopMarker, - guard, - body, - m - ) - - // while i < array.Length do done - // array - mkSequential m loop array - ) - ) - ) - - Some expr - // [|start..finish|] // [|start..step..finish|] | IntegralRange g (_, (start, step, finish)) -> - let expr = - mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> - mkCompGenLetIn m "count" overallElemTy (mkCount m overallSeqExpr overallElemTy start step finish) (fun (_, count) -> - let arrayTy = mkArrayType g overallElemTy - - // count < 1 - let countLtOne = mkSignednessAppropriateClt g m overallElemTy count (mkOne g m) - - // [||] - let empty = mkArray (overallElemTy, [], m) - - // (# "newarr !0" type ('T) count : 'T array #) - let array = - mkAsmExpr - ( - [I_newarr (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], - [], - [convToNativeIntWithOverflow m overallElemTy count], - [arrayTy], - m - ) - - let initialize = - mkCompGenLetIn m (nameof array) arrayTy array (fun (_, array) -> - mkCompGenLetMutableIn m "i" g.int32_ty (mkZero g m) (fun (iVal, i) -> - mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> - // array[i] <- loopVar - let setArrSubI = mkAsmExpr ([I_stelem_any (ILArrayShape.SingleDimensional, mkIlTy m overallElemTy)], [], [array; i; loopVar], [], m) - - // loopVar <- loopVar + step - let incrV = mkValSet m (mkLocalValRef loopVarVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [overallElemTy], m)) - - // i <- i + 1 - let incrI = mkValSet m (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkOne g m], [g.int32_ty], m)) - - let body = mkSequentials g m [setArrSubI; incrV; incrI] - - let guard = mkILAsmClt g m i (mkLdlen g m array) - - let loop = - mkWhile - g - ( - DebugPointAtWhile.No, - NoSpecialWhileLoopMarker, - guard, - body, - m - ) - - // while i < array.Length do done - // array - mkSequential m loop array - ) - ) - ) - - // if count < 1 then [||] else - mkCond - DebugPointAtBinding.NoneAtInvisible - m - arrayTy - countLtOne - empty - initialize - ) - ) - - Some expr + Some (Array.mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish) // [|(* Anything more complex. *)|] | _ -> From 963a85ff4e9ce22e7e53f5fb4a624c1f4049d438 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 6 Feb 2024 08:28:21 -0500 Subject: [PATCH 10/66] Fix debug assert --- src/Compiler/TypedTree/TypedTreeOps.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 447ad94d5aa..c7a7bdb38af 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10190,12 +10190,12 @@ let (|EmptyRange|_|) (start, step, finish) = /// 1..5 → start <= finish && step > 0 → FSharpForLoopUp /// 1..2..5 → start <= finish && step > 0 → FSharpForLoopUp -/// 1..-2..-5 → finish < start && step < 0 → FSharpForLoopDown +/// 1..-2..-5 → finish <= start && step < 0 → FSharpForLoopDown [] let (|ConstRange|_|) (start, step, finish) = let inline upOrDown start step finish = assert (step <> LanguagePrimitives.GenericZero) - assert (start <= finish && step > LanguagePrimitives.GenericZero || finish < start && step < LanguagePrimitives.GenericZero) + assert (start <= finish && step > LanguagePrimitives.GenericZero || finish <= start && step < LanguagePrimitives.GenericZero) if start <= finish && step > LanguagePrimitives.GenericZero then FSharpForLoopUp From e44dc371e219424056b7218efef2304190847aa8 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 12 Feb 2024 22:49:01 -0500 Subject: [PATCH 11/66] Just precompute count for all scenarios --- .../Optimize/LowerComputedCollections.fs | 439 ++---- src/Compiler/TypedTree/TypedTreeOps.fs | 718 ++++++---- src/Compiler/TypedTree/TypedTreeOps.fsi | 17 +- .../ComputationExpr07.fs.il.bsl | 91 +- ...onTrivialBranchingBindingInEnd03.fs.il.bsl | 196 +-- ...ivialBranchingBindingInEnd03.fs.opt.il.bsl | 196 +-- ...onTrivialBranchingBindingInEnd04.fs.il.bsl | 194 +-- ...ivialBranchingBindingInEnd04.fs.opt.il.bsl | 194 +-- .../GenericComparison/Compare08.fsx.il.bsl | 127 +- .../GenericComparison/Compare09.fsx.il.bsl | 122 +- .../GenericComparison/Equals07.fsx.il.bsl | 127 +- .../GenericComparison/Equals08.fsx.il.bsl | 122 +- .../GenericComparison/Hash10.fsx.il.bsl | 63 +- .../GenericComparison/Hash11.fsx.il.bsl | 58 +- .../ListExpressionStepping02.fs.il.bsl | 271 ++-- .../Misc/CodeGenRenamings01.fs.il.bsl | 437 +++--- .../EmittedIL/Misc/ForLoop01.fs.il.bsl | 99 +- .../FSharp.Core/PrimTypes.fs | 188 ++- ...putedCollectionRangeLoweringTests.Int32.fs | 1174 ++++++++++------- 19 files changed, 2527 insertions(+), 2306 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 251443ecab1..9f1d1f36daf 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -12,7 +12,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.TypeRelations open FSharp.Compiler.TypedTree -open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TypeHierarchy @@ -256,335 +255,147 @@ let (|SeqToArray|_|) g expr = | ValApp g g.seq_to_array_vref (_, [seqExpr], m) -> ValueSome (seqExpr, m) | _ -> ValueNone -[] -module IntegralConst = - /// Constant 0. - [] - let (|Zero|_|) expr = - match expr with - | Const.Zero - | Const.Int32 0 - | Const.Int64 0L - | Const.UInt64 0UL - | Const.UInt32 0u - | Const.IntPtr 0L - | Const.UIntPtr 0UL - | Const.Int16 0s - | Const.UInt16 0us - | Const.SByte 0y - | Const.Byte 0uy - | Const.Char '\000' -> ValueSome Zero - | _ -> ValueNone - - /// Constant 1. - [] - let (|One|_|) expr = - match expr with - | Const.Int32 1 - | Const.Int64 1L - | Const.UInt64 1UL - | Const.UInt32 1u - | Const.IntPtr 1L - | Const.UIntPtr 1UL - | Const.Int16 1s - | Const.UInt16 1us - | Const.SByte 1y - | Const.Byte 1uy - | Const.Char '\001' -> ValueSome One - | _ -> ValueNone - - /// Constant -1. - [] - let (|MinusOne|_|) expr = - match expr with - | Const.Int32 -1 - | Const.Int64 -1L - | Const.IntPtr -1L - | Const.Int16 -1s - | Const.SByte -1y -> ValueSome MinusOne - | _ -> ValueNone - -/// Note: this assumes that an empty range has already been checked for -/// (otherwise the conversion operations here might overflow). -[] -let (|ConstCount|_|) (start, step, finish) = - match start, step, finish with - | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (Const.Int32 ((finish - start) / step + 1)) - | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.Int64 ((finish - start) / step + 1L)) - | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (Const.UInt64 ((finish - start) / step + 1UL)) - | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (Const.UInt32 ((finish - start) / step + 1u)) - | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.IntPtr ((finish - start) / step + 1L)) - | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) -> ValueSome (Const.UIntPtr ((finish - start) / step + 1UL)) - | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (Const.Int16 ((finish - start) / step + 1s)) - | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (Const.UInt16 ((finish - start) / step + 1us)) - | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (Const.SByte ((finish - start) / step + 1y)) - | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (Const.Byte ((finish - start) / step + 1uy)) - | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (Const.Char (char (uint16 (finish - start) / uint16 step) + '\001')) - | _ -> ValueNone - -/// Bind start, step, and finish exprs to local variables if needed, e.g., -/// -/// [start..finishExpr] → let finish = finishExpr in … -/// -/// [startExpr..finish] → let start = startExpr in … -/// -/// [startExpr..finishExpr] → let start = startExpr in let finish = finishExpr in … -let mkLetBindingsIfNeeded m ty start step finish mkInitExpr = - match start, step, finish with - | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> - mkInitExpr start step finish - - | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), _ -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish) - - | _, (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkInitExpr start step finish) - - | (Expr.Const _ | Expr.Val _), _, (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkInitExpr start step finish) - - | _, (Expr.Const _ | Expr.Val _), _ -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish)) - - | (Expr.Const _ | Expr.Val _), _, _ -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish)) - - | _, _, (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkInitExpr start step finish)) - - | _, _, _ -> - mkCompGenLetIn m (nameof start) ty start (fun (_, start) -> - mkCompGenLetIn m (nameof step) ty step (fun (_, step) -> - mkCompGenLetIn m (nameof finish) ty finish (fun (_, finish) -> - mkInitExpr start step finish))) - module List = /// Makes an expression that will build a list from an integral range. - /// Expects a constant zero step to have already been checked for. - let mkFromIntegralRange tcVal g amap m overallElemTy overallSeqExpr start step finish = - match start, step, finish with - // [5..1] → [] - // [1..-1..5] → [] - | EmptyRange -> mkNil g m overallElemTy - - // [1..5] - // [1..2..5] - // [start..finish] - // [start..step..finish] - | _, _, _ -> - let collectorTy = g.mk_ListCollector_ty overallElemTy - - mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> - mkCompGenLetMutableIn m "collector" collectorTy (mkDefault (m, collectorTy)) (fun (_, collector) -> - mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> - let reader = InfoReader (g, amap) - - let body = mkCallCollectorAdd tcVal g reader m collector loopVar - - let loop = - mkOptimizedRangeLoop - g - (m, m, m, DebugPointAtWhile.No) - (overallElemTy, overallSeqExpr) - (start, step, finish) - (loopVarVal, loopVar) - body - - let close = mkCallCollectorClose tcVal g reader m collector - - mkSequential m loop close - ) - ) + let mkFromIntegralRange tcVal (g: TcGlobals) amap m overallElemTy overallSeqExpr start step finish = + let collectorTy = g.mk_ListCollector_ty overallElemTy + + /// let collector = ListCollector () in + /// + /// collector.Close () + 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 close = mkCallCollectorClose tcVal g reader m collector + mkSequential m loop close + ) + + mkOptimizedRangeLoop + g + (m, m, m, DebugPointAtWhile.No) + (overallElemTy, overallSeqExpr) + (start, step, finish) + (fun count mkLoop -> + match count with + | Expr.Const (value = IntegralConst.Zero) -> + mkNil g m overallElemTy + + | Expr.Const (value = _nonzeroConstant) -> + mkListInit mkLoop + + | _dynamicCount -> + let countTy = tyOfExpr g count + + // count < 1 + let countLtOne = + if isSignedIntegerTy g countTy then + mkILAsmClt g m count (mkOne g m) + else + mkAsmExpr ([AI_clt_un], [], [count; mkOne g m], [g.bool_ty], m) + + // if count < 1 then + // [] + // else + // let collector = ListCollector () in + // + // collector.Close () + mkCond + DebugPointAtBinding.NoneAtInvisible + m + (mkListTy g overallElemTy) + countLtOne + (mkNil g m overallElemTy) + (mkListInit mkLoop) ) module Array = /// Makes an expression that will build an array from an integral range. - /// Expects a constant zero step to have already been checked for. let mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish = let arrayTy = mkArrayType g overallElemTy - /// Triggers an overflow exception at runtime if count doesn't fit in a native int. - let convToNativeIntWithOverflow m overallElemTy count = - if typeEquiv g overallElemTy g.int64_ty then mkAsmExpr ([AI_conv_ovf DT_I], [], [count], [g.nativeint_ty], m) - elif typeEquiv g overallElemTy g.uint64_ty then mkAsmExpr ([AI_conv_ovf_un DT_I], [], [count], [g.nativeint_ty], m) - else count - - let mkInitializer count start step = - let ilTy = - let ty = stripMeasuresFromTy g overallElemTy - if typeEquiv g ty g.int32_ty then g.ilg.typ_Int32 - elif typeEquiv g ty g.int64_ty then g.ilg.typ_Int64 - elif typeEquiv g ty g.uint64_ty then g.ilg.typ_UInt64 - elif typeEquiv g ty g.uint32_ty then g.ilg.typ_UInt32 - elif typeEquiv g ty g.nativeint_ty then g.ilg.typ_IntPtr - elif typeEquiv g ty g.unativeint_ty then g.ilg.typ_UIntPtr - elif typeEquiv g ty g.int16_ty then g.ilg.typ_Int16 - elif typeEquiv g ty g.uint16_ty then g.ilg.typ_UInt16 - elif typeEquiv g ty g.sbyte_ty then g.ilg.typ_SByte - elif typeEquiv g ty g.byte_ty then g.ilg.typ_Byte - elif typeEquiv g ty g.char_ty then g.ilg.typ_Char - else error(InternalError($"Unrecognized integral type '{ty}'.", m)) - - /// (# "newarr !0" type ('T) count : 'T array #) - let mkNewArray count = - mkAsmExpr - ( - [I_newarr (ILArrayShape.SingleDimensional, ilTy)], - [], - [convToNativeIntWithOverflow m overallElemTy count], - [arrayTy], - m - ) + let convToNativeInt expr = + let ty = stripMeasuresFromTy g (tyOfExpr g expr) - mkCompGenLetIn m "array" arrayTy (mkNewArray count) (fun (_, array) -> - mkCompGenLetMutableIn m "i" g.int32_ty (mkZero g m) (fun (iVal, i) -> - mkCompGenLetMutableIn m "loopVar" overallElemTy start (fun (loopVarVal, loopVar) -> - // array[i] <- loopVar - let setArrSubI = mkAsmExpr ([I_stelem_any (ILArrayShape.SingleDimensional, ilTy)], [], [array; i; loopVar], [], m) - - // loopVar <- loopVar + step - let incrV = mkValSet m (mkLocalValRef loopVarVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [overallElemTy], m)) - - // i <- i + 1 - let incrI = mkValSet m (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkOne g m], [g.int32_ty], m)) - - let body = mkSequentials g m [setArrSubI; incrV; incrI] - - let guard = mkILAsmClt g m i (mkLdlen g m array) - - let loop = - mkWhile - g - ( - DebugPointAtWhile.No, - NoSpecialWhileLoopMarker, - guard, - body, - m - ) - - // while i < array.Length do done - // array - mkSequential m loop array - ) + if typeEquiv g ty g.int64_ty || typeEquiv g ty g.nativeint_ty then + mkAsmExpr ([AI_conv_ovf DT_I], [], [expr], [g.nativeint_ty], m) + elif typeEquiv g ty g.uint64_ty || typeEquiv g ty g.unativeint_ty then + mkAsmExpr ([AI_conv_ovf_un DT_I], [], [expr], [g.nativeint_ty], m) + 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)) + + /// (# "newarr !0" type ('T) count : 'T array #) + let mkNewArray count = + mkAsmExpr + ( + [I_newarr (ILArrayShape.SingleDimensional, ilTy)], + [], + [convToNativeInt count], + [arrayTy], + m ) - ) - match start, step, finish with - // [|5..1|] → [||] - // [|1..-1..5|] → [||] - | EmptyRange -> mkArray (overallElemTy, [], m) - - // [|1..5|] - // [|1..2..5|] - | ConstCount count -> mkInitializer (Expr.Const (count, m, overallElemTy)) start step - - // [|start..finish|] - // [|start..step..finish|] - | _, _, _ -> - /// Make an expression holding the size of the array. - let mkCount m rangeExpr ty start step finish = - match step with - // step = 1: - // finish - start + 1 - | Expr.Const (value = IntegralConst.One) -> - let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) - mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) - - // step = -1: - // -(finish - start) + 1 - | Expr.Const (value = IntegralConst.MinusOne) -> - let diff = mkAsmExpr ([AI_neg], [], [mkAsmExpr ([AI_sub], [], [finish; start], [ty], m)], [ty], m) - mkAsmExpr ([AI_add], [], [diff; mkOne g m], [ty], m) - - // step = : - // (finish - start) / step + 1 - | Expr.Const (value = _notOneOrZeroOrMinusOne) -> - let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) - - let quotient = - if isSignedIntegerTy g ty then - mkAsmExpr ([AI_div], [], [diff; step], [ty], m) - else - mkAsmExpr ([AI_div_un], [], [diff; step], [ty], m) - - mkAsmExpr ([AI_add], [], [quotient; mkOne g m], [ty], m) - - // Arbitrary step: - // (finish - start) / step + 1 - | _notConst -> - // Use the potentially-evaluated-and-bound start, step, and finish. - let rangeExpr = - match rangeExpr with - | Expr.App (funcExpr, formalType, tyargs, _, m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) - | _ -> rangeExpr - - /// This will raise an exception at runtime if step is zero. - let callAndIgnoreRangeExpr = - mkSequential - m - rangeExpr - (mkUnit g m) - - // Let the range call throw the appropriate localized - // exception at runtime if step is zero: - // if step = 0 then (.. ..) start step finish - let throwIfStepIsZero = - mkCond - DebugPointAtBinding.NoneAtInvisible - m - g.unit_ty - (mkILAsmCeq g m step (mkZero g m)) - callAndIgnoreRangeExpr - (mkUnit g m) - - let count = - let diff = mkAsmExpr ([AI_sub], [], [finish; start], [ty], m) - - let quotient = - if isSignedIntegerTy g ty then - mkAsmExpr ([AI_div], [], [diff; step], [ty], m) - else - mkAsmExpr ([AI_div_un], [], [diff; step], [ty], m) - - mkAsmExpr ([AI_add], [], [quotient; mkOne g m], [ty], m) - - mkSequential m throwIfStepIsZero count - - mkLetBindingsIfNeeded m overallElemTy start step finish (fun start step finish -> - mkCompGenLetIn m "count" overallElemTy (mkCount m overallSeqExpr overallElemTy start step finish) (fun (_, count) -> - let mkSignednessAppropriateClt g m ty e1 e2 = - if isSignedIntegerTy g ty then - mkILAsmClt g m e1 e2 - else - mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) + /// let array = (# "newarr !0" type ('T) count : 'T array #) in + /// + /// 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 idxVar; loopVar], [], m)) + mkSequential m loop array) - // count < 1 - let countLtOne = mkSignednessAppropriateClt g m overallElemTy count (mkOne g m) + mkOptimizedRangeLoop + g + (m, m, m, DebugPointAtWhile.No) + (overallElemTy, overallSeqExpr) + (start, step, finish) + (fun count mkLoop -> + match count with + | Expr.Const (value = IntegralConst.Zero) -> + mkArray (overallElemTy, [], m) - // [||] - let empty = mkArray (overallElemTy, [], m) + | Expr.Const (value = _nonzeroConstant) -> + mkArrayInit count mkLoop - let initialize = mkInitializer count start step + | _dynamicCount -> + let countTy = tyOfExpr g count - // if count < 1 then [||] else + // count < 1 + let countLtOne = + if isSignedIntegerTy g countTy then + mkILAsmClt g m count (mkOne g m) + else + mkAsmExpr ([AI_clt_un], [], [count; mkOne g m], [g.bool_ty], m) + + // if count < 1 then + // [||] + // else + // let array = (# "newarr !0" type ('T) count : 'T array #) + // in + // + // array mkCond DebugPointAtBinding.NoneAtInvisible m arrayTy countLtOne - empty - initialize - ) + (mkArray (overallElemTy, [], m)) + (mkArrayInit count mkLoop) ) let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = @@ -594,11 +405,6 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = // […] | SeqToList g (OptionalCoerce (OptionalSeq g amap (overallSeqExpr, overallElemTy)), m) -> match overallSeqExpr with - // [start..0..finish] → let the default implementation raise an exception. - | IntegralRange g (_, (_, Expr.Const (value = IntegralConst.Zero), _)) -> - let collectorTy = g.mk_ListCollector_ty overallElemTy - LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr - // [start..finish] // [start..step..finish] | IntegralRange g (_, (start, step, finish)) -> @@ -612,11 +418,6 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = // [|…|] | SeqToArray g (OptionalCoerce (OptionalSeq g amap (overallSeqExpr, overallElemTy)), m) -> match overallSeqExpr with - // [|start..0..finish|] → let the default implementation raise an exception. - | IntegralRange g (_, (_, Expr.Const (value = IntegralConst.Zero), _)) -> - let collectorTy = g.mk_ArrayCollector_ty overallElemTy - LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr - // [|start..finish|] // [|start..step..finish|] | IntegralRange g (_, (start, step, finish)) -> diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index c7a7bdb38af..e8d7913fedb 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10116,8 +10116,8 @@ let (|ValApp|_|) g vref expr = module IntegralConst = /// Constant 0. [] - let (|Zero|_|) expr = - match expr with + let (|Zero|_|) c = + match c with | Const.Zero | Const.Int32 0 | Const.Int64 0L @@ -10132,6 +10132,34 @@ module IntegralConst = | Const.Char '\000' -> ValueSome Zero | _ -> ValueNone + /// Constant 1. + [] + let (|One|_|) expr = + match expr with + | Const.Int32 1 + | Const.Int64 1L + | Const.UInt64 1UL + | Const.UInt32 1u + | Const.IntPtr 1L + | Const.UIntPtr 1UL + | Const.Int16 1s + | Const.UInt16 1us + | Const.SByte 1y + | Const.Byte 1uy + | Const.Char '\001' -> ValueSome One + | _ -> ValueNone + + /// Constant -1. + [] + let (|MinusOne|_|) expr = + match expr with + | Const.Int32 -1 + | Const.Int64 -1L + | Const.IntPtr -1L + | Const.Int16 -1s + | Const.SByte -1y -> ValueSome MinusOne + | _ -> ValueNone + /// Positive constant. [] let (|Positive|_|) expr = @@ -10149,6 +10177,20 @@ module IntegralConst = | Const.Char v when v > '\000' -> ValueSome Positive | _ -> ValueNone + let abs expr = + match expr with + | Const.Int32 Int32.MinValue -> Const.UInt32 (uint Int32.MaxValue + 1u) + | Const.Int64 Int64.MinValue -> Const.UInt64 (uint64 Int64.MaxValue + 1UL) + | Const.IntPtr Int64.MinValue -> Const.UIntPtr (uint64 Int64.MaxValue + 1UL) + | Const.Int16 Int16.MinValue -> Const.UInt16 (uint16 Int16.MaxValue + 1us) + | Const.SByte SByte.MinValue -> Const.Byte (byte SByte.MaxValue + 1uy) + | Const.Int32 v -> Const.Int32 (abs v) + | Const.Int64 v -> Const.Int64 (abs v) + | Const.IntPtr v -> Const.IntPtr (abs v) + | Const.Int16 v -> Const.Int16 (abs v) + | Const.SByte v -> Const.SByte (abs v) + | _ -> expr + /// start..finish /// start..step..finish [] @@ -10164,7 +10206,7 @@ let (|IntegralRange|_|) g expr = | ValApp g g.range_uint16_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint16_ty, (start, step, finish)) | ValApp g g.range_sbyte_op_vref ([], [start; step; finish], _) -> ValueSome (g.sbyte_ty, (start, step, finish)) | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) - | ValApp g g.range_char_op_vref ([], [start; step; finish], _) -> ValueSome (g.char_ty, (start, step, finish)) + | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) | _ -> ValueNone /// 5..1 @@ -10188,155 +10230,52 @@ let (|EmptyRange|_|) (start, step, finish) = | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char _), Expr.Const (value = Const.Char finish) when finish < start -> ValueSome EmptyRange | _ -> ValueNone -/// 1..5 → start <= finish && step > 0 → FSharpForLoopUp -/// 1..2..5 → start <= finish && step > 0 → FSharpForLoopUp -/// 1..-2..-5 → finish <= start && step < 0 → FSharpForLoopDown +/// Note: this assumes that an empty range has already been checked for +/// (otherwise the conversion operations here might overflow). [] -let (|ConstRange|_|) (start, step, finish) = - let inline upOrDown start step finish = - assert (step <> LanguagePrimitives.GenericZero) - assert (start <= finish && step > LanguagePrimitives.GenericZero || finish <= start && step < LanguagePrimitives.GenericZero) - - if start <= finish && step > LanguagePrimitives.GenericZero then - FSharpForLoopUp - else - FSharpForLoopDown - +let (|ConstCount|_|) (start, step, finish) = match start, step, finish with - | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (upOrDown start step finish) - | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (upOrDown start step finish) - | _ -> ValueNone + // This will cause an overflow exception to be raised at runtime, which we need for parity with the library implementation. + | Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 1L), Expr.Const (value = Const.Int64 Int64.MaxValue) + | Expr.Const (value = Const.Int64 Int64.MaxValue), Expr.Const (value = Const.Int64 -1L), Expr.Const (value = Const.Int64 Int64.MinValue) + | Expr.Const (value = Const.UInt64 UInt64.MinValue), Expr.Const (value = Const.UInt64 1UL), Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> ValueSome (Const.UInt64 UInt64.MaxValue) -/// If the start and finish are constant, -/// we can generate a simpler runtime check to determine -/// whether the range is empty. -/// -/// 1..step..5 -[] -let (|ConstStartAndFinish|_|) (start, _step, finish) = - match start, finish with - | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char finish) -> if start <= finish then ValueSome FSharpForLoopUp else ValueSome FSharpForLoopDown - | _ -> ValueNone + | Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr 1L), Expr.Const (value = Const.IntPtr Int64.MaxValue) + | Expr.Const (value = Const.IntPtr Int64.MaxValue), Expr.Const (value = Const.IntPtr -1L), Expr.Const (value = Const.IntPtr Int64.MinValue) + | Expr.Const (value = Const.UIntPtr UInt64.MinValue), Expr.Const (value = Const.UIntPtr 1UL), Expr.Const (value = Const.UIntPtr UInt64.MaxValue) -> ValueSome (Const.UIntPtr UInt64.MaxValue) -let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (loopVarVal: Val, loopVar) body = - let mkNecessaryLetBindingsFor f = - let setLoopVarAndBindRest start = - mkSequential mFor (mkValSet loopVarVal.Range (mkLocalValRef loopVarVal) start) ( - match step, finish with - | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> - f (loopVarVal, loopVar) start step finish + // We must special-case a step of Int64.MinValue, since we cannot call abs on it. + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) - | (Expr.Const _ | Expr.Val _), _ -> - mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> - f (loopVarVal, loopVar) start step finish) - - | _, (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> - f (loopVarVal, loopVar) start step finish) + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) - | _, _ -> - mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> - mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> - f (loopVarVal, loopVar) start step finish)) - ) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when start <= finish -> ValueSome (Const.UIntPtr ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) - match start with - | Expr.Const _ | Expr.Val _ -> setLoopVarAndBindRest start - | _ -> mkCompGenLetIn mFor "originalStart" rangeTy start (fun (_, start) -> setLoopVarAndBindRest start) + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) when start <= finish -> ValueSome (Const.UInt32 (uint32 ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (Const.UInt32 (uint32 ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) - let mkSignednessAppropriateClt g m e1 e2 = - if isSignedIntegerTy g rangeTy then - mkILAsmClt g m e1 e2 - else - mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) when start <= finish -> ValueSome (Const.UInt16 (uint16 ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (Const.UInt16 (uint16 ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) - /// while start <= finish && originalStart <= start do … - let mkUp (startVal, start) originalStart step finish = - let origStartLtEqStart = - mkCond - DebugPointAtBinding.NoneAtInvisible - mFor - g.bool_ty - (mkSignednessAppropriateClt g mFor originalStart start) - (mkTrue g mFor) - (mkILAsmCeq g mFor originalStart start) - - // if start < finish then originalStart <= start else start = finish - let guard = - mkCond - DebugPointAtBinding.NoneAtInvisible - mFor - g.bool_ty - (mkSignednessAppropriateClt g mFor start finish) - origStartLtEqStart - (mkILAsmCeq g mFor start finish) + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when start <= finish -> ValueSome (Const.Byte (byte ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (Const.Byte (byte ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) - let incr = mkValSet mIn (mkLocalValRef startVal) (mkAsmExpr ([AI_add], [], [start; step], [rangeTy], mIn)) + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) -> ValueSome (Const.UIntPtr ((finish - start) / step + 1UL)) + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (Const.UInt64 ((finish - start) / step + 1UL)) + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (Const.UInt32 ((finish - start) / step + 1u)) + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (Const.UInt16 ((finish - start) / step + 1us)) + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (Const.Byte ((finish - start) / step + 1uy)) + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (Const.Char (char (uint16 (finish - start) / uint16 step) + '\001')) - mkWhile - g - ( - spInWhile, - WhileLoopForCompiledForEachExprMarker, - guard, - mkCompGenSequential mIn body incr, - mBody - ) - - /// while finish <= start && start <= originalStart do … - let mkDown (startVal, start) originalStart step finish = - let startLtEqOrigStart = - mkCond - DebugPointAtBinding.NoneAtInvisible - mFor - g.bool_ty - (mkSignednessAppropriateClt g mFor start originalStart) - (mkTrue g mFor) - (mkILAsmCeq g mFor start originalStart) - - // if finish < start then start <= originalStart else finish = start - let guard = - mkCond - DebugPointAtBinding.NoneAtInvisible - mFor - g.bool_ty - (mkSignednessAppropriateClt g mFor finish start) - startLtEqOrigStart - (mkILAsmCeq g mFor finish start) - - let incr = mkValSet mIn (mkLocalValRef startVal) (mkAsmExpr ([AI_add], [], [start; step], [rangeTy], mIn)) - - mkWhile - g - ( - spInWhile, - WhileLoopForCompiledForEachExprMarker, - guard, - mkCompGenSequential mIn body incr, - mBody - ) + | _ -> ValueNone +/// Makes an expression to compute the iteration count for the given integral range. +let mkRangeCount g m rangeTy rangeExpr start step finish = /// This will raise an exception at runtime if step is zero. - let callAndIgnoreRangeExpr start step finish = + let callAndIgnoreRangeExpr = // Use the potentially-evaluated-and-bound start, step, and finish. let rangeExpr = match rangeExpr with @@ -10344,140 +10283,390 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, | _ -> rangeExpr mkSequential - mBody + m rangeExpr - (mkUnit g mIn) + (mkUnit g m) - /// Emits logic to handle arbitrary start, step, and finish values at runtime. - let mkIntegralWhileLoop (startVal, start) originalStart step finish = - match originalStart, step, finish with - // Dynamic start and/or finish, but positive constant step. - // - // step > 0: - // if finish < start then () - // else - | _, Expr.Const (value = IntegralConst.Positive), _ -> - mkCond - DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkSignednessAppropriateClt g mIn finish start) - (mkUnit g mIn) - (mkUp (startVal, start) originalStart step finish) + let mkSignednessAppropriateClt ty e1 e2 = + if isSignedIntegerTy g ty then + mkILAsmClt g m e1 e2 + else + mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) - // Dynamic start and/or finish, but negative constant step. - // - // step < 0: - // if start < finish then () - // else - | _, Expr.Const (value = _negative), _ -> - mkCond - DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkSignednessAppropriateClt g mIn start finish) - (mkUnit g mIn) - (mkDown (startVal, start) originalStart step finish) + let mkZero ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 0, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 0L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 0UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 0u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 0L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 0UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 0s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 0us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 0y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 0uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) + else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + + let mkOne ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) + else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + + let mkMinValue ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 Int32.MinValue, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 Int64.MinValue, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 UInt64.MinValue, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 UInt32.MinValue, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr Int64.MinValue, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr UInt64.MinValue, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 Int16.MinValue, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 UInt16.MinValue, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte SByte.MinValue, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte Byte.MinValue, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) + else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + + let mkMaxValuePlusOneAsUnsigned originalTy destTy = + let underlyingTy = stripMeasuresFromTy g originalTy + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.UInt64 (uint64 (uint Int32.MaxValue + 1u)), m, destTy) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.UInt64 (uint64 Int64.MaxValue + 1UL), m, destTy) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.UIntPtr (uint64 Int64.MaxValue + 1UL), m, destTy) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.UInt64 (uint64 (uint16 Int16.MaxValue + 1us)), m, destTy) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.UInt64 (uint64 (byte SByte.MaxValue + 1uy)), m, destTy) + else error (InternalError ($"Unrecognized signed integral type '{originalTy}'.", m)) + + /// Widened diff as unsigned: unsigned (e1 - e2). + /// Expects that e1 >= e2. + let mkDiff e1 e2 = + if isSignedIntegerTy g rangeTy && not (typeEquiv g (stripMeasuresFromTy g rangeTy) g.nativeint_ty) then + let mkWiden e = mkAsmExpr ([AI_conv DT_I8], [], [e], [g.uint64_ty], m) + mkAsmExpr ([AI_sub], [], [mkWiden e1; mkWiden e2], [g.uint64_ty], m) + else + mkAsmExpr ([AI_sub], [], [e1; e2], [rangeTy], m) - // Dynamic step, but constant start and finish. - // - // start <= finish: - // if step = 0 then - // elif step < 0 then () - // else - | ConstStartAndFinish FSharpForLoopUp -> - mkCond - DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkILAsmCeq g mIn step (mkZero g mIn)) - (callAndIgnoreRangeExpr start step finish) - ( - mkCond - DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkSignednessAppropriateClt g mIn step (mkZero g mIn)) - (mkUnit g mIn) - (mkUp (startVal, start) originalStart step finish) - ) + /// diff / step + let mkQuotient diff step = + let step = + if typeEquiv g (tyOfExpr g diff) g.uint64_ty then + mkAsmExpr ([AI_conv DT_I8], [], [step], [g.uint64_ty], m) + else + step + + mkAsmExpr ([AI_div_un], [], [diff; step], [tyOfExpr g diff], m) + + /// (diff / step + 1) + let mkAddOne pseudoCount = + // For parity with the behavior of (..) and (.. ..) in FSharp.Core, + // we want an overflow exception to be raised at runtime + // instead of returning a 0 count here. + let shouldRaiseOverflowExnAtRuntime = + let ty = stripMeasuresFromTy g rangeTy + + typeEquiv g ty g.int64_ty + || typeEquiv g ty g.uint64_ty + || typeEquiv g ty g.nativeint_ty + || typeEquiv g ty g.unativeint_ty + + let ty = tyOfExpr g pseudoCount + + if shouldRaiseOverflowExnAtRuntime then + mkAsmExpr ([AI_add_ovf_un], [], [pseudoCount; mkOne ty], [ty], m) + else + mkAsmExpr ([AI_add], [], [pseudoCount; mkOne ty], [ty], m) + + match start, step, finish with + // start..0..finish + | _, Expr.Const (value = IntegralConst.Zero), _ -> mkSequential m callAndIgnoreRangeExpr (mkMinusOne g m) + + // 5..1 + // 1..-1..5 + | EmptyRange -> mkZero rangeTy - // Dynamic step, but constant start and finish. + // 1..5 + // 1..2..5 + // 5..-1..1 + | ConstCount count -> Expr.Const (count, m, rangeTy) + + // start..finish + // start..1..finish + // + // if finish < start then 0 else finish - start + 1 + | _, Expr.Const (value = IntegralConst.One), _ -> + let diff = mkDiff finish start + let diffTy = tyOfExpr g diff + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkZero diffTy) + (mkAddOne diff) + + // (Only possible for signed types.) + // + // start..-1..finish + // + // if start < finish then 0 else start - finish + 1 + | _, Expr.Const (value = IntegralConst.MinusOne), _ -> + let diff = mkDiff start finish + let diffTy = tyOfExpr g diff + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkZero diffTy) + (mkAddOne diff) + + // start..2..finish + // + // if finish < start then 0 else (finish - start) / step + 1 + | _, Expr.Const (value = IntegralConst.Positive), _ -> + let diff = mkDiff finish start + let diffTy = tyOfExpr g diff + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkZero diffTy) + (mkAddOne (mkQuotient diff step)) + + // (Only possible for signed types.) + // + // start..-2..finish + // + // if start < finish then 0 else (start - finish) / abs step + 1 + | _, Expr.Const (value = negativeStep), _ -> + let diff = mkDiff start finish + let diffTy = tyOfExpr g diff + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkZero diffTy) + (mkAddOne (mkQuotient diff (Expr.Const (IntegralConst.abs negativeStep, m, diffTy)))) + + // start..step..finish + // + // if step = 0 then + // ignore ((.. ..) start step finish) // Throws. + // if 0 < step then + // if finish < start then 0 else (finish - start) / step + 1 + // else // step < 0 + // if start < finish then 0 else (finish - start) / step + 1 + | _, _, _ -> + // Let the range call throw the appropriate localized + // exception at runtime if step is zero: // - // finish < start: - // if step = 0 then - // elif 0 < step then () - // else - | ConstStartAndFinish FSharpForLoopDown -> + // if step = 0 then ignore ((.. ..) start step finish) + let throwIfStepIsZero = mkCond DebugPointAtBinding.NoneAtInvisible - mIn + m g.unit_ty - (mkILAsmCeq g mIn step (mkZero g mIn)) - (callAndIgnoreRangeExpr start step finish) - ( + (mkILAsmCeq g m step (mkZero rangeTy)) + callAndIgnoreRangeExpr + (mkUnit g m) + + let count = + if isSignedIntegerTy g rangeTy then + let positiveStep = + let diff = mkDiff finish start + let diffTy = tyOfExpr g diff + mkCond DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkSignednessAppropriateClt g mIn (mkZero g mIn) step) - (mkUnit g mIn) - (mkDown (startVal, start) originalStart step finish) - ) + m + diffTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkZero diffTy) + (mkAddOne (mkQuotient diff step)) + + let negativeStep = + let diff = mkDiff start finish + let diffTy = tyOfExpr g diff + + let absStep = + if typeEquiv g (stripMeasuresFromTy g rangeTy) g.nativeint_ty then + mkAsmExpr ([AI_neg], [], [step], [diffTy], m) + else + mkAsmExpr ([AI_conv DT_I8], [], [(mkAsmExpr ([AI_neg], [], [step], [diffTy], m))], [diffTy], m) - // Unsigned ranges can only ever go up. - // - // if step = 0 then - // else (* 0 < step *) - | _ when isUnsignedIntegerTy g rangeTy -> - mkCond - DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkILAsmCeq g mIn step (mkZero g mIn)) - (callAndIgnoreRangeExpr start step finish) - (mkUp (startVal, start) originalStart step finish) + let step = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkILAsmCeq g m step (mkMinValue rangeTy)) + (mkMaxValuePlusOneAsUnsigned rangeTy diffTy) + absStep - // Any other combination of dynamic exprs. - // - // if step = 0 then - // elif 0 < step then - // else (* step < 0 *) - | _ -> - mkCond - DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkILAsmCeq g mIn step (mkZero g mIn)) - (callAndIgnoreRangeExpr start step finish) - ( mkCond DebugPointAtBinding.NoneAtInvisible - mIn - g.unit_ty - (mkSignednessAppropriateClt g mIn (mkZero g mIn) step) - (mkUp (startVal, start) originalStart step finish) - (mkDown (startVal, start) originalStart step finish) + m + diffTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkZero diffTy) + (mkAddOne (mkQuotient diff step)) + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + (tyOfExpr g positiveStep) + (mkSignednessAppropriateClt rangeTy (mkZero rangeTy) step) + positiveStep + negativeStep + else // Unsigned. + let diff = mkDiff finish start + let diffTy = tyOfExpr g diff + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + rangeTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkZero diffTy) + (mkAddOne (mkQuotient diff step)) + + mkSequential m throwIfStepIsZero count + +type Count = Expr +type Idx = Expr +type Elem = Expr +type Body = Expr +type Loop = Expr + +let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) buildLoop = + let mkZero g m ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 0, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 0L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 0UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 0u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 0L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 0UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 0s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 0us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 0y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 0uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) + else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + + let mkOne g m ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) + else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + + let inline mkLetBindingsIfNeeded f = + match start, step, finish with + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + f start step finish + + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish) + + | _, (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> + f start step finish) + + | (Expr.Const _ | Expr.Val _), _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + f start step finish) + + | _, (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish)) + + | (Expr.Const _ | Expr.Val _), _, _ -> + mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish)) + + | _, _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + f start step finish)) + + | _, _, _ -> + mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish))) + + mkLetBindingsIfNeeded (fun start step finish -> + let mkBindCountIfNeeded f = + match mkRangeCount g mIn rangeTy rangeExpr start step finish with + | Expr.Const _ as count -> f count + | count -> mkCompGenLetIn mIn "count" (tyOfExpr g count) count (fun (_, count) -> f count) + + mkBindCountIfNeeded (fun count -> + buildLoop count (fun mkBody -> + let countTy = tyOfExpr g count + + mkCompGenLetMutableIn mIn "i" countTy (mkZero g mIn countTy) (fun (idxVal, idxVar) -> + mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> + // loopVar <- loopVar + step + let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) + + // i <- i + 1 + let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkOne g mIn countTy], [rangeTy], mIn)) + + // + // loopVar <- loopVar + step + // i <- i + 1 + let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI] + + // i < count + let guard = mkAsmExpr ([AI_clt_un], [], [idxVar; count], [g.bool_ty], mFor) + + // while i < count do + // + // loopVar <- loopVar + step + // i <- i + 1 + mkWhile + g + ( + spInWhile, + WhileLoopForCompiledForEachExprMarker, + guard, + body, + mBody + ) + ) ) - - match start, step, finish with - // for … in start..0..finish do … - | _, Expr.Const (value = IntegralConst.Zero), _ -> callAndIgnoreRangeExpr start step finish - - // for … in 5..1 do … - // for … in 1..-1..2 do … - | EmptyRange -> mkUnit g mBody - - // for … in 1..5 do … - // for … in 1..2..5 do … - | ConstRange FSharpForLoopUp -> mkNecessaryLetBindingsFor mkUp - - // for … in 5..-1..1 do … - | ConstRange FSharpForLoopDown -> mkNecessaryLetBindingsFor mkDown - - // for … in start..finish do … - // for … in start..step..finish do … - | _, _, _ -> mkNecessaryLetBindingsFor mkIntegralWhileLoop + ) + ) + ) let mkDebugPoint m expr = Expr.DebugPoint(DebugPointAtLeafExpr.Yes m, expr) @@ -10497,15 +10686,12 @@ let DetectAndOptimizeForEachExpression g option expr = | _, CompiledForEachExpr g (_enumTy, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), elemVar, bodyExpr, ranges) -> let mBody, _spFor, _spIn, mFor, mIn, spInWhile, _mWhole = ranges - mkCompGenLetMutableIn elemVar.Range "loopVar" rangeTy start (fun (loopVarVal, loopVar) -> - mkOptimizedRangeLoop - g - (mBody, mFor, mIn, spInWhile) - (rangeTy, rangeExpr) - (start, step, finish) - (loopVarVal, loopVar) - (mkInvisibleLet elemVar.Range elemVar loopVar bodyExpr) - ) + mkOptimizedRangeLoop + g + (mBody, mFor, mIn, spInWhile) + (rangeTy, rangeExpr) + (start, step, finish) + (fun _count mkLoop -> mkLoop (fun _idxVar loopVar -> mkInvisibleLet elemVar.Range elemVar loopVar bodyExpr)) | OptimizeAllForExpressions, CompiledForEachExpr g (enumerableTy, enumerableExpr, elemVar, bodyExpr, ranges) -> diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index a7e8f523ea9..addc9816304 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2554,11 +2554,23 @@ val (|SpecialNotEquatableHeadType|_|): TcGlobals -> TType -> unit option [] val (|IntegralRange|_|): g: TcGlobals -> expr: Expr -> (TType * (Expr * Expr * Expr)) voption +[] +module IntegralConst = + /// Constant 0. + [] + val (|Zero|_|): c: Const -> unit voption + /// Matches if the given start, step, and finish represent /// a range that is known to be empty at compile-time. [] val (|EmptyRange|_|): start: Expr * step: Expr * finish: Expr -> unit voption +type Count = Expr +type Idx = Expr +type Elem = Expr +type Body = Expr +type Loop = Expr + /// Makes an optimized while-loop for the given /// integral start, step, and finish. val mkOptimizedRangeLoop: @@ -2566,9 +2578,8 @@ val mkOptimizedRangeLoop: mBody: range * mFor: range * mIn: range * spInWhile: DebugPointAtWhile -> rangeTy: TType * rangeExpr: Expr -> start: Expr * step: Expr * finish: Expr -> - loopVarVal: Val * loopVar: Expr -> - body: Expr -> - Expr + buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr) -> + Expr type OptimizeForExpressionOptions = | OptimizeIntRangesOnly diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl index 917d51428c4..c9f93636476 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl @@ -172,7 +172,8 @@ .maxstack 9 .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - int32 V_2) + int32 V_2, + int32 V_3) IL_0000: ldc.i4.1 IL_0001: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!0) IL_0006: stloc.0 @@ -183,63 +184,47 @@ IL_0013: ldc.i4.0 IL_0014: stloc.2 IL_0015: ldc.i4.0 - IL_0016: stloc.2 + IL_0016: stloc.3 IL_0017: ldloc.2 - IL_0018: ldc.i4.3 - IL_0019: bge.s IL_002a - - IL_001b: ldc.i4.0 - IL_001c: ldloc.2 - IL_001d: bge.s IL_0023 - - IL_001f: ldc.i4.1 - IL_0020: nop - IL_0021: br.s IL_002f - - IL_0023: ldc.i4.0 - IL_0024: ldloc.2 - IL_0025: ceq - IL_0027: nop - IL_0028: br.s IL_002f - - IL_002a: ldloc.2 - IL_002b: ldc.i4.3 - IL_002c: ceq - IL_002e: nop - IL_002f: brfalse.s IL_0041 - - IL_0031: ldloca.s V_1 - IL_0033: ldloc.2 - IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0039: nop - IL_003a: ldloc.2 - IL_003b: ldc.i4.1 - IL_003c: add - IL_003d: stloc.2 - IL_003e: nop - IL_003f: br.s IL_0017 - - IL_0041: ldloca.s V_1 - IL_0043: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0048: ldarg.0 - IL_0049: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_004e: ldloc.0 - IL_004f: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_0018: ldc.i4.4 + IL_0019: bge.un.s IL_002f + + IL_001b: ldloca.s V_1 + IL_001d: ldloc.3 + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.3 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.3 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: add + IL_002b: stloc.2 + IL_002c: nop + IL_002d: br.s IL_0017 + + IL_002f: ldloca.s V_1 + IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0036: ldarg.0 + IL_0037: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_003c: ldloc.0 + IL_003d: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_0054: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, + IL_0042: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0059: ldarg.0 - IL_005a: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_005f: ldarg.0 - IL_0060: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_0065: ldloc.0 - IL_0066: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_0047: ldarg.0 + IL_0048: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_004d: ldarg.0 + IL_004e: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_0053: ldloc.0 + IL_0054: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_006b: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0070: tail. - IL_0072: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, + IL_0059: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_005e: tail. + IL_0060: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, class [ComputationExprLibrary]Library.Eventually`1) - IL_0077: ret + IL_0065: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl index 574d82cfe40..cd6afe9a2c4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -178,8 +178,10 @@ .maxstack 7 .locals init (int32 V_0, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - int32 V_2) + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -211,98 +213,104 @@ IL_004a: ldc.i4.1 IL_004b: sub IL_004c: stloc.0 - IL_004d: ldc.i4.0 - IL_004e: stloc.2 - IL_004f: ldc.i4.0 - IL_0050: stloc.2 - IL_0051: ldloc.0 - IL_0052: ldloc.2 - IL_0053: bge.s IL_0058 - - IL_0055: nop - IL_0056: br.s IL_0082 - - IL_0058: br.s IL_0067 - - IL_005a: ldloca.s V_1 - IL_005c: ldloc.2 - IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0062: nop - IL_0063: ldloc.2 - IL_0064: ldc.i4.1 - IL_0065: add - IL_0066: stloc.2 - IL_0067: ldloc.2 - IL_0068: ldloc.0 - IL_0069: bge.s IL_007a - - IL_006b: ldc.i4.0 - IL_006c: ldloc.2 - IL_006d: bge.s IL_0073 - - IL_006f: ldc.i4.1 - IL_0070: nop - IL_0071: br.s IL_007f - - IL_0073: ldc.i4.0 - IL_0074: ldloc.2 - IL_0075: ceq - IL_0077: nop - IL_0078: br.s IL_007f - - IL_007a: ldloc.2 - IL_007b: ldloc.0 - IL_007c: ceq - IL_007e: nop - IL_007f: brtrue.s IL_005a - - IL_0081: nop - IL_0082: ldloca.s V_1 - IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009d: br.s IL_00e5 - - IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a9: stloc.0 - IL_00aa: call int32[] assembly::get_r() - IL_00af: ldloc.0 - IL_00b0: call int32[] assembly::get_r() - IL_00b5: ldloc.0 - IL_00b6: ldelem [runtime]System.Int32 - IL_00bb: call int32[] assembly::get_w() - IL_00c0: ldloc.0 - IL_00c1: ldelem [runtime]System.Int32 - IL_00c6: add - IL_00c7: stelem [runtime]System.Int32 - IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00ea: brtrue.s IL_009f - - IL_00ec: nop - IL_00ed: nop - IL_00ee: call int32[] assembly::get_r() - IL_00f3: ldc.i4.0 - IL_00f4: ldelem [runtime]System.Int32 - IL_00f9: ldc.i4.3 - IL_00fa: bne.un.s IL_0100 - - IL_00fc: ldc.i4.0 - IL_00fd: nop - IL_00fe: br.s IL_0102 - - IL_0100: ldc.i4.1 - IL_0101: nop - IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0107: pop - IL_0108: ret + IL_004d: ldloc.0 + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 + IL_0060: ldloc.1 + IL_0061: ldc.i4.1 + IL_0062: bge.un.s IL_006c + + IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0069: nop + IL_006a: br.s IL_0095 + + IL_006c: ldc.i4.0 + IL_006d: conv.i8 + IL_006e: stloc.3 + IL_006f: ldc.i4.0 + IL_0070: stloc.s V_4 + IL_0072: br.s IL_0089 + + IL_0074: ldloca.s V_2 + IL_0076: ldloc.s V_4 + IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007d: nop + IL_007e: ldloc.s V_4 + IL_0080: ldc.i4.1 + IL_0081: add + IL_0082: stloc.s V_4 + IL_0084: ldloc.3 + IL_0085: ldc.i4.1 + IL_0086: conv.i8 + IL_0087: add + IL_0088: stloc.3 + IL_0089: ldloc.3 + IL_008a: ldloc.1 + IL_008b: blt.un.s IL_0074 + + IL_008d: ldloca.s V_2 + IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0094: nop + IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_00a9: br.s IL_00f1 + + IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b5: stloc.0 + IL_00b6: call int32[] assembly::get_r() + IL_00bb: ldloc.0 + IL_00bc: call int32[] assembly::get_r() + IL_00c1: ldloc.0 + IL_00c2: ldelem [runtime]System.Int32 + IL_00c7: call int32[] assembly::get_w() + IL_00cc: ldloc.0 + IL_00cd: ldelem [runtime]System.Int32 + IL_00d2: add + IL_00d3: stelem [runtime]System.Int32 + IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00f6: brtrue.s IL_00ab + + IL_00f8: nop + IL_00f9: nop + IL_00fa: call int32[] assembly::get_r() + IL_00ff: ldc.i4.0 + IL_0100: ldelem [runtime]System.Int32 + IL_0105: ldc.i4.3 + IL_0106: bne.un.s IL_010c + + IL_0108: ldc.i4.0 + IL_0109: nop + IL_010a: br.s IL_010e + + IL_010c: ldc.i4.1 + IL_010d: nop + IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0113: pop + IL_0114: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index 574d82cfe40..cd6afe9a2c4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -178,8 +178,10 @@ .maxstack 7 .locals init (int32 V_0, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - int32 V_2) + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -211,98 +213,104 @@ IL_004a: ldc.i4.1 IL_004b: sub IL_004c: stloc.0 - IL_004d: ldc.i4.0 - IL_004e: stloc.2 - IL_004f: ldc.i4.0 - IL_0050: stloc.2 - IL_0051: ldloc.0 - IL_0052: ldloc.2 - IL_0053: bge.s IL_0058 - - IL_0055: nop - IL_0056: br.s IL_0082 - - IL_0058: br.s IL_0067 - - IL_005a: ldloca.s V_1 - IL_005c: ldloc.2 - IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0062: nop - IL_0063: ldloc.2 - IL_0064: ldc.i4.1 - IL_0065: add - IL_0066: stloc.2 - IL_0067: ldloc.2 - IL_0068: ldloc.0 - IL_0069: bge.s IL_007a - - IL_006b: ldc.i4.0 - IL_006c: ldloc.2 - IL_006d: bge.s IL_0073 - - IL_006f: ldc.i4.1 - IL_0070: nop - IL_0071: br.s IL_007f - - IL_0073: ldc.i4.0 - IL_0074: ldloc.2 - IL_0075: ceq - IL_0077: nop - IL_0078: br.s IL_007f - - IL_007a: ldloc.2 - IL_007b: ldloc.0 - IL_007c: ceq - IL_007e: nop - IL_007f: brtrue.s IL_005a - - IL_0081: nop - IL_0082: ldloca.s V_1 - IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009d: br.s IL_00e5 - - IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a9: stloc.0 - IL_00aa: call int32[] assembly::get_r() - IL_00af: ldloc.0 - IL_00b0: call int32[] assembly::get_r() - IL_00b5: ldloc.0 - IL_00b6: ldelem [runtime]System.Int32 - IL_00bb: call int32[] assembly::get_w() - IL_00c0: ldloc.0 - IL_00c1: ldelem [runtime]System.Int32 - IL_00c6: add - IL_00c7: stelem [runtime]System.Int32 - IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00ea: brtrue.s IL_009f - - IL_00ec: nop - IL_00ed: nop - IL_00ee: call int32[] assembly::get_r() - IL_00f3: ldc.i4.0 - IL_00f4: ldelem [runtime]System.Int32 - IL_00f9: ldc.i4.3 - IL_00fa: bne.un.s IL_0100 - - IL_00fc: ldc.i4.0 - IL_00fd: nop - IL_00fe: br.s IL_0102 - - IL_0100: ldc.i4.1 - IL_0101: nop - IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0107: pop - IL_0108: ret + IL_004d: ldloc.0 + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 + IL_0060: ldloc.1 + IL_0061: ldc.i4.1 + IL_0062: bge.un.s IL_006c + + IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0069: nop + IL_006a: br.s IL_0095 + + IL_006c: ldc.i4.0 + IL_006d: conv.i8 + IL_006e: stloc.3 + IL_006f: ldc.i4.0 + IL_0070: stloc.s V_4 + IL_0072: br.s IL_0089 + + IL_0074: ldloca.s V_2 + IL_0076: ldloc.s V_4 + IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007d: nop + IL_007e: ldloc.s V_4 + IL_0080: ldc.i4.1 + IL_0081: add + IL_0082: stloc.s V_4 + IL_0084: ldloc.3 + IL_0085: ldc.i4.1 + IL_0086: conv.i8 + IL_0087: add + IL_0088: stloc.3 + IL_0089: ldloc.3 + IL_008a: ldloc.1 + IL_008b: blt.un.s IL_0074 + + IL_008d: ldloca.s V_2 + IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0094: nop + IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_00a9: br.s IL_00f1 + + IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b5: stloc.0 + IL_00b6: call int32[] assembly::get_r() + IL_00bb: ldloc.0 + IL_00bc: call int32[] assembly::get_r() + IL_00c1: ldloc.0 + IL_00c2: ldelem [runtime]System.Int32 + IL_00c7: call int32[] assembly::get_w() + IL_00cc: ldloc.0 + IL_00cd: ldelem [runtime]System.Int32 + IL_00d2: add + IL_00d3: stelem [runtime]System.Int32 + IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00f6: brtrue.s IL_00ab + + IL_00f8: nop + IL_00f9: nop + IL_00fa: call int32[] assembly::get_r() + IL_00ff: ldc.i4.0 + IL_0100: ldelem [runtime]System.Int32 + IL_0105: ldc.i4.3 + IL_0106: bne.un.s IL_010c + + IL_0108: ldc.i4.0 + IL_0109: nop + IL_010a: br.s IL_010e + + IL_010c: ldc.i4.1 + IL_010d: nop + IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0113: pop + IL_0114: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl index f3d5e50340d..b1a13b8392c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -178,8 +178,10 @@ .maxstack 7 .locals init (int32 V_0, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - int32 V_2) + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -212,97 +214,103 @@ IL_004b: sub IL_004c: stloc.0 IL_004d: ldloc.0 - IL_004e: stloc.2 - IL_004f: ldloc.0 - IL_0050: stloc.2 - IL_0051: ldloc.2 - IL_0052: ldc.i4.0 - IL_0053: bge.s IL_0058 - - IL_0055: nop - IL_0056: br.s IL_0082 - - IL_0058: br.s IL_0067 - - IL_005a: ldloca.s V_1 - IL_005c: ldloc.2 - IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0062: nop - IL_0063: ldloc.2 - IL_0064: ldc.i4.m1 - IL_0065: add - IL_0066: stloc.2 - IL_0067: ldc.i4.0 - IL_0068: ldloc.2 - IL_0069: bge.s IL_007a - - IL_006b: ldloc.2 - IL_006c: ldloc.0 - IL_006d: bge.s IL_0073 - - IL_006f: ldc.i4.1 - IL_0070: nop - IL_0071: br.s IL_007f - - IL_0073: ldloc.2 - IL_0074: ldloc.0 - IL_0075: ceq - IL_0077: nop - IL_0078: br.s IL_007f - - IL_007a: ldc.i4.0 - IL_007b: ldloc.2 - IL_007c: ceq - IL_007e: nop - IL_007f: brtrue.s IL_005a - - IL_0081: nop - IL_0082: ldloca.s V_1 - IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009d: br.s IL_00e5 - - IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a9: stloc.0 - IL_00aa: call int32[] assembly::get_r() - IL_00af: ldloc.0 - IL_00b0: call int32[] assembly::get_r() - IL_00b5: ldloc.0 - IL_00b6: ldelem [runtime]System.Int32 - IL_00bb: call int32[] assembly::get_w() - IL_00c0: ldloc.0 - IL_00c1: ldelem [runtime]System.Int32 - IL_00c6: add - IL_00c7: stelem [runtime]System.Int32 - IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00ea: brtrue.s IL_009f - - IL_00ec: nop - IL_00ed: nop - IL_00ee: call int32[] assembly::get_r() - IL_00f3: ldc.i4.0 - IL_00f4: ldelem [runtime]System.Int32 - IL_00f9: ldc.i4.3 - IL_00fa: bne.un.s IL_0100 - - IL_00fc: ldc.i4.0 - IL_00fd: nop - IL_00fe: br.s IL_0102 - - IL_0100: ldc.i4.1 - IL_0101: nop - IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0107: pop - IL_0108: ret + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 + IL_0060: ldloc.1 + IL_0061: ldc.i4.1 + IL_0062: bge.un.s IL_006c + + IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0069: nop + IL_006a: br.s IL_0095 + + IL_006c: ldc.i4.0 + IL_006d: conv.i8 + IL_006e: stloc.3 + IL_006f: ldloc.0 + IL_0070: stloc.s V_4 + IL_0072: br.s IL_0089 + + IL_0074: ldloca.s V_2 + IL_0076: ldloc.s V_4 + IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007d: nop + IL_007e: ldloc.s V_4 + IL_0080: ldc.i4.m1 + IL_0081: add + IL_0082: stloc.s V_4 + IL_0084: ldloc.3 + IL_0085: ldc.i4.1 + IL_0086: conv.i8 + IL_0087: add + IL_0088: stloc.3 + IL_0089: ldloc.3 + IL_008a: ldloc.1 + IL_008b: blt.un.s IL_0074 + + IL_008d: ldloca.s V_2 + IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0094: nop + IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_00a9: br.s IL_00f1 + + IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b5: stloc.0 + IL_00b6: call int32[] assembly::get_r() + IL_00bb: ldloc.0 + IL_00bc: call int32[] assembly::get_r() + IL_00c1: ldloc.0 + IL_00c2: ldelem [runtime]System.Int32 + IL_00c7: call int32[] assembly::get_w() + IL_00cc: ldloc.0 + IL_00cd: ldelem [runtime]System.Int32 + IL_00d2: add + IL_00d3: stelem [runtime]System.Int32 + IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00f6: brtrue.s IL_00ab + + IL_00f8: nop + IL_00f9: nop + IL_00fa: call int32[] assembly::get_r() + IL_00ff: ldc.i4.0 + IL_0100: ldelem [runtime]System.Int32 + IL_0105: ldc.i4.3 + IL_0106: bne.un.s IL_010c + + IL_0108: ldc.i4.0 + IL_0109: nop + IL_010a: br.s IL_010e + + IL_010c: ldc.i4.1 + IL_010d: nop + IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0113: pop + IL_0114: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index f3d5e50340d..b1a13b8392c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -178,8 +178,10 @@ .maxstack 7 .locals init (int32 V_0, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - int32 V_2) + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -212,97 +214,103 @@ IL_004b: sub IL_004c: stloc.0 IL_004d: ldloc.0 - IL_004e: stloc.2 - IL_004f: ldloc.0 - IL_0050: stloc.2 - IL_0051: ldloc.2 - IL_0052: ldc.i4.0 - IL_0053: bge.s IL_0058 - - IL_0055: nop - IL_0056: br.s IL_0082 - - IL_0058: br.s IL_0067 - - IL_005a: ldloca.s V_1 - IL_005c: ldloc.2 - IL_005d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0062: nop - IL_0063: ldloc.2 - IL_0064: ldc.i4.m1 - IL_0065: add - IL_0066: stloc.2 - IL_0067: ldc.i4.0 - IL_0068: ldloc.2 - IL_0069: bge.s IL_007a - - IL_006b: ldloc.2 - IL_006c: ldloc.0 - IL_006d: bge.s IL_0073 - - IL_006f: ldc.i4.1 - IL_0070: nop - IL_0071: br.s IL_007f - - IL_0073: ldloc.2 - IL_0074: ldloc.0 - IL_0075: ceq - IL_0077: nop - IL_0078: br.s IL_007f - - IL_007a: ldc.i4.0 - IL_007b: ldloc.2 - IL_007c: ceq - IL_007e: nop - IL_007f: brtrue.s IL_005a - - IL_0081: nop - IL_0082: ldloca.s V_1 - IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0089: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0093: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0098: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009d: br.s IL_00e5 - - IL_009f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a9: stloc.0 - IL_00aa: call int32[] assembly::get_r() - IL_00af: ldloc.0 - IL_00b0: call int32[] assembly::get_r() - IL_00b5: ldloc.0 - IL_00b6: ldelem [runtime]System.Int32 - IL_00bb: call int32[] assembly::get_w() - IL_00c0: ldloc.0 - IL_00c1: ldelem [runtime]System.Int32 - IL_00c6: add - IL_00c7: stelem [runtime]System.Int32 - IL_00cc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d1: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d6: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00db: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00e0: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00ea: brtrue.s IL_009f - - IL_00ec: nop - IL_00ed: nop - IL_00ee: call int32[] assembly::get_r() - IL_00f3: ldc.i4.0 - IL_00f4: ldelem [runtime]System.Int32 - IL_00f9: ldc.i4.3 - IL_00fa: bne.un.s IL_0100 - - IL_00fc: ldc.i4.0 - IL_00fd: nop - IL_00fe: br.s IL_0102 - - IL_0100: ldc.i4.1 - IL_0101: nop - IL_0102: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0107: pop - IL_0108: ret + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 + IL_0060: ldloc.1 + IL_0061: ldc.i4.1 + IL_0062: bge.un.s IL_006c + + IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0069: nop + IL_006a: br.s IL_0095 + + IL_006c: ldc.i4.0 + IL_006d: conv.i8 + IL_006e: stloc.3 + IL_006f: ldloc.0 + IL_0070: stloc.s V_4 + IL_0072: br.s IL_0089 + + IL_0074: ldloca.s V_2 + IL_0076: ldloc.s V_4 + IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007d: nop + IL_007e: ldloc.s V_4 + IL_0080: ldc.i4.m1 + IL_0081: add + IL_0082: stloc.s V_4 + IL_0084: ldloc.3 + IL_0085: ldc.i4.1 + IL_0086: conv.i8 + IL_0087: add + IL_0088: stloc.3 + IL_0089: ldloc.3 + IL_008a: ldloc.1 + IL_008b: blt.un.s IL_0074 + + IL_008d: ldloca.s V_2 + IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0094: nop + IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_00a9: br.s IL_00f1 + + IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b5: stloc.0 + IL_00b6: call int32[] assembly::get_r() + IL_00bb: ldloc.0 + IL_00bc: call int32[] assembly::get_r() + IL_00c1: ldloc.0 + IL_00c2: ldelem [runtime]System.Int32 + IL_00c7: call int32[] assembly::get_w() + IL_00cc: ldloc.0 + IL_00cd: ldelem [runtime]System.Int32 + IL_00d2: add + IL_00d3: stelem [runtime]System.Int32 + IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00f6: brtrue.s IL_00ab + + IL_00f8: nop + IL_00f9: nop + IL_00fa: call int32[] assembly::get_r() + IL_00ff: ldc.i4.0 + IL_0100: ldelem [runtime]System.Int32 + IL_0105: ldc.i4.3 + IL_0106: bne.un.s IL_010c + + IL_0108: ldc.i4.0 + IL_0109: nop + IL_010a: br.s IL_010e + + IL_010c: ldc.i4.1 + IL_010d: nop + IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0113: pop + IL_0114: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl index 0f99c58aa9a..83ce0aeb1f4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl @@ -54,9 +54,10 @@ .locals init (int32 V_0, uint8[] V_1, uint8[] V_2, - int32 V_3, + uint8 V_3, uint8 V_4, - uint8[] V_5) + uint8[] V_5, + int32 V_6) IL_0000: ldc.i4.1 IL_0001: stloc.0 IL_0002: ldc.i4.s 101 @@ -66,76 +67,72 @@ IL_000b: stloc.3 IL_000c: ldc.i4.0 IL_000d: stloc.s V_4 - IL_000f: br.s IL_0024 + IL_000f: br.s IL_0020 IL_0011: ldloc.2 IL_0012: ldloc.3 IL_0013: ldloc.s V_4 - IL_0015: stelem [runtime]System.Byte - IL_001a: ldloc.s V_4 - IL_001c: ldc.i4.1 - IL_001d: add - IL_001e: stloc.s V_4 + IL_0015: stelem.i1 + IL_0016: ldloc.s V_4 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.s V_4 + IL_001c: ldloc.3 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.3 IL_0020: ldloc.3 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.3 - IL_0024: ldloc.3 + IL_0021: ldc.i4.s 101 + IL_0023: blt.un.s IL_0011 + IL_0025: ldloc.2 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_0011 - - IL_002a: ldloc.2 - IL_002b: stloc.1 - IL_002c: ldc.i4.s 101 - IL_002e: newarr [runtime]System.Byte - IL_0033: stloc.s V_5 - IL_0035: ldc.i4.0 - IL_0036: stloc.3 - IL_0037: ldc.i4.0 - IL_0038: stloc.s V_4 - IL_003a: br.s IL_0050 - - IL_003c: ldloc.s V_5 - IL_003e: ldloc.3 - IL_003f: ldloc.s V_4 - IL_0041: stelem [runtime]System.Byte - IL_0046: ldloc.s V_4 - IL_0048: ldc.i4.1 - IL_0049: add - IL_004a: stloc.s V_4 - IL_004c: ldloc.3 - IL_004d: ldc.i4.1 - IL_004e: add - IL_004f: stloc.3 - IL_0050: ldloc.3 - IL_0051: ldloc.s V_5 - IL_0053: ldlen - IL_0054: conv.i4 - IL_0055: blt.s IL_003c - - IL_0057: ldloc.s V_5 - IL_0059: stloc.2 - IL_005a: ldc.i4.0 - IL_005b: stloc.3 - IL_005c: br.s IL_006a - - IL_005e: ldloc.1 - IL_005f: ldloc.2 - IL_0060: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, + IL_0026: stloc.1 + IL_0027: ldc.i4.s 101 + IL_0029: newarr [runtime]System.Byte + IL_002e: stloc.s V_5 + IL_0030: ldc.i4.0 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0047 + + IL_0037: ldloc.s V_5 + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: stelem.i1 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: add + IL_0041: stloc.s V_4 + IL_0043: ldloc.3 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldc.i4.s 101 + IL_004a: blt.un.s IL_0037 + + IL_004c: ldloc.s V_5 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.s V_6 + IL_0052: br.s IL_0062 + + IL_0054: ldloc.1 + IL_0055: ldloc.2 + IL_0056: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, !!0) - IL_0065: stloc.0 - IL_0066: ldloc.3 - IL_0067: ldc.i4.1 - IL_0068: add - IL_0069: stloc.3 - IL_006a: ldloc.3 - IL_006b: ldc.i4 0x989681 - IL_0070: blt.s IL_005e - - IL_0072: ldloc.0 - IL_0073: ret + IL_005b: stloc.0 + IL_005c: ldloc.s V_6 + IL_005e: ldc.i4.1 + IL_005f: add + IL_0060: stloc.s V_6 + IL_0062: ldloc.s V_6 + IL_0064: ldc.i4 0x989681 + IL_0069: blt.s IL_0054 + + IL_006b: ldloc.0 + IL_006c: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl index bebd40ded3d..0194b6ee8cc 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl @@ -66,76 +66,72 @@ IL_000b: stloc.3 IL_000c: ldc.i4.0 IL_000d: stloc.s V_4 - IL_000f: br.s IL_0024 + IL_000f: br.s IL_0020 IL_0011: ldloc.2 IL_0012: ldloc.3 IL_0013: ldloc.s V_4 - IL_0015: stelem [runtime]System.Int32 - IL_001a: ldloc.s V_4 - IL_001c: ldc.i4.1 - IL_001d: add - IL_001e: stloc.s V_4 + IL_0015: stelem.i4 + IL_0016: ldloc.s V_4 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.s V_4 + IL_001c: ldloc.3 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.3 IL_0020: ldloc.3 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.3 - IL_0024: ldloc.3 + IL_0021: ldc.i4.s 101 + IL_0023: blt.un.s IL_0011 + IL_0025: ldloc.2 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_0011 - - IL_002a: ldloc.2 - IL_002b: stloc.1 - IL_002c: ldc.i4.s 101 - IL_002e: newarr [runtime]System.Int32 - IL_0033: stloc.s V_5 - IL_0035: ldc.i4.0 - IL_0036: stloc.3 - IL_0037: ldc.i4.0 - IL_0038: stloc.s V_4 - IL_003a: br.s IL_0050 - - IL_003c: ldloc.s V_5 - IL_003e: ldloc.3 - IL_003f: ldloc.s V_4 - IL_0041: stelem [runtime]System.Int32 - IL_0046: ldloc.s V_4 - IL_0048: ldc.i4.1 - IL_0049: add - IL_004a: stloc.s V_4 - IL_004c: ldloc.3 - IL_004d: ldc.i4.1 - IL_004e: add - IL_004f: stloc.3 - IL_0050: ldloc.3 - IL_0051: ldloc.s V_5 - IL_0053: ldlen - IL_0054: conv.i4 - IL_0055: blt.s IL_003c - - IL_0057: ldloc.s V_5 - IL_0059: stloc.2 - IL_005a: ldc.i4.0 - IL_005b: stloc.3 - IL_005c: br.s IL_006a - - IL_005e: ldloc.1 - IL_005f: ldloc.2 - IL_0060: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, + IL_0026: stloc.1 + IL_0027: ldc.i4.s 101 + IL_0029: newarr [runtime]System.Int32 + IL_002e: stloc.s V_5 + IL_0030: ldc.i4.0 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0047 + + IL_0037: ldloc.s V_5 + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: stelem.i4 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: add + IL_0041: stloc.s V_4 + IL_0043: ldloc.3 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldc.i4.s 101 + IL_004a: blt.un.s IL_0037 + + IL_004c: ldloc.s V_5 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.3 + IL_0051: br.s IL_005f + + IL_0053: ldloc.1 + IL_0054: ldloc.2 + IL_0055: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, !!0) - IL_0065: stloc.0 - IL_0066: ldloc.3 - IL_0067: ldc.i4.1 - IL_0068: add - IL_0069: stloc.3 - IL_006a: ldloc.3 - IL_006b: ldc.i4 0x186a1 - IL_0070: blt.s IL_005e - - IL_0072: ldloc.0 - IL_0073: ret + IL_005a: stloc.0 + IL_005b: ldloc.3 + IL_005c: ldc.i4.1 + IL_005d: add + IL_005e: stloc.3 + IL_005f: ldloc.3 + IL_0060: ldc.i4 0x186a1 + IL_0065: blt.s IL_0053 + + IL_0067: ldloc.0 + IL_0068: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl index e5b275e1947..96bfcceaa6f 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl @@ -54,9 +54,10 @@ .locals init (bool V_0, uint8[] V_1, uint8[] V_2, - int32 V_3, + uint8 V_3, uint8 V_4, - uint8[] V_5) + uint8[] V_5, + int32 V_6) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: ldc.i4.s 101 @@ -66,76 +67,72 @@ IL_000b: stloc.3 IL_000c: ldc.i4.0 IL_000d: stloc.s V_4 - IL_000f: br.s IL_0024 + IL_000f: br.s IL_0020 IL_0011: ldloc.2 IL_0012: ldloc.3 IL_0013: ldloc.s V_4 - IL_0015: stelem [runtime]System.Byte - IL_001a: ldloc.s V_4 - IL_001c: ldc.i4.1 - IL_001d: add - IL_001e: stloc.s V_4 + IL_0015: stelem.i1 + IL_0016: ldloc.s V_4 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.s V_4 + IL_001c: ldloc.3 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.3 IL_0020: ldloc.3 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.3 - IL_0024: ldloc.3 + IL_0021: ldc.i4.s 101 + IL_0023: blt.un.s IL_0011 + IL_0025: ldloc.2 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_0011 - - IL_002a: ldloc.2 - IL_002b: stloc.1 - IL_002c: ldc.i4.s 101 - IL_002e: newarr [runtime]System.Byte - IL_0033: stloc.s V_5 - IL_0035: ldc.i4.0 - IL_0036: stloc.3 - IL_0037: ldc.i4.0 - IL_0038: stloc.s V_4 - IL_003a: br.s IL_0050 - - IL_003c: ldloc.s V_5 - IL_003e: ldloc.3 - IL_003f: ldloc.s V_4 - IL_0041: stelem [runtime]System.Byte - IL_0046: ldloc.s V_4 - IL_0048: ldc.i4.1 - IL_0049: add - IL_004a: stloc.s V_4 - IL_004c: ldloc.3 - IL_004d: ldc.i4.1 - IL_004e: add - IL_004f: stloc.3 - IL_0050: ldloc.3 - IL_0051: ldloc.s V_5 - IL_0053: ldlen - IL_0054: conv.i4 - IL_0055: blt.s IL_003c - - IL_0057: ldloc.s V_5 - IL_0059: stloc.2 - IL_005a: ldc.i4.0 - IL_005b: stloc.3 - IL_005c: br.s IL_006a - - IL_005e: ldloc.1 - IL_005f: ldloc.2 - IL_0060: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + IL_0026: stloc.1 + IL_0027: ldc.i4.s 101 + IL_0029: newarr [runtime]System.Byte + IL_002e: stloc.s V_5 + IL_0030: ldc.i4.0 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0047 + + IL_0037: ldloc.s V_5 + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: stelem.i1 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: add + IL_0041: stloc.s V_4 + IL_0043: ldloc.3 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldc.i4.s 101 + IL_004a: blt.un.s IL_0037 + + IL_004c: ldloc.s V_5 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.s V_6 + IL_0052: br.s IL_0062 + + IL_0054: ldloc.1 + IL_0055: ldloc.2 + IL_0056: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, !!0) - IL_0065: stloc.0 - IL_0066: ldloc.3 - IL_0067: ldc.i4.1 - IL_0068: add - IL_0069: stloc.3 - IL_006a: ldloc.3 - IL_006b: ldc.i4 0x989681 - IL_0070: blt.s IL_005e - - IL_0072: ldloc.0 - IL_0073: ret + IL_005b: stloc.0 + IL_005c: ldloc.s V_6 + IL_005e: ldc.i4.1 + IL_005f: add + IL_0060: stloc.s V_6 + IL_0062: ldloc.s V_6 + IL_0064: ldc.i4 0x989681 + IL_0069: blt.s IL_0054 + + IL_006b: ldloc.0 + IL_006c: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl index 98fb4600674..4dc06449fa8 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl @@ -66,76 +66,72 @@ IL_000b: stloc.3 IL_000c: ldc.i4.0 IL_000d: stloc.s V_4 - IL_000f: br.s IL_0024 + IL_000f: br.s IL_0020 IL_0011: ldloc.2 IL_0012: ldloc.3 IL_0013: ldloc.s V_4 - IL_0015: stelem [runtime]System.Int32 - IL_001a: ldloc.s V_4 - IL_001c: ldc.i4.1 - IL_001d: add - IL_001e: stloc.s V_4 + IL_0015: stelem.i4 + IL_0016: ldloc.s V_4 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.s V_4 + IL_001c: ldloc.3 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.3 IL_0020: ldloc.3 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.3 - IL_0024: ldloc.3 + IL_0021: ldc.i4.s 101 + IL_0023: blt.un.s IL_0011 + IL_0025: ldloc.2 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_0011 - - IL_002a: ldloc.2 - IL_002b: stloc.1 - IL_002c: ldc.i4.s 101 - IL_002e: newarr [runtime]System.Int32 - IL_0033: stloc.s V_5 - IL_0035: ldc.i4.0 - IL_0036: stloc.3 - IL_0037: ldc.i4.0 - IL_0038: stloc.s V_4 - IL_003a: br.s IL_0050 - - IL_003c: ldloc.s V_5 - IL_003e: ldloc.3 - IL_003f: ldloc.s V_4 - IL_0041: stelem [runtime]System.Int32 - IL_0046: ldloc.s V_4 - IL_0048: ldc.i4.1 - IL_0049: add - IL_004a: stloc.s V_4 - IL_004c: ldloc.3 - IL_004d: ldc.i4.1 - IL_004e: add - IL_004f: stloc.3 - IL_0050: ldloc.3 - IL_0051: ldloc.s V_5 - IL_0053: ldlen - IL_0054: conv.i4 - IL_0055: blt.s IL_003c - - IL_0057: ldloc.s V_5 - IL_0059: stloc.2 - IL_005a: ldc.i4.0 - IL_005b: stloc.3 - IL_005c: br.s IL_006a - - IL_005e: ldloc.1 - IL_005f: ldloc.2 - IL_0060: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + IL_0026: stloc.1 + IL_0027: ldc.i4.s 101 + IL_0029: newarr [runtime]System.Int32 + IL_002e: stloc.s V_5 + IL_0030: ldc.i4.0 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0047 + + IL_0037: ldloc.s V_5 + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: stelem.i4 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: add + IL_0041: stloc.s V_4 + IL_0043: ldloc.3 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldc.i4.s 101 + IL_004a: blt.un.s IL_0037 + + IL_004c: ldloc.s V_5 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.3 + IL_0051: br.s IL_005f + + IL_0053: ldloc.1 + IL_0054: ldloc.2 + IL_0055: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, !!0) - IL_0065: stloc.0 - IL_0066: ldloc.3 - IL_0067: ldc.i4.1 - IL_0068: add - IL_0069: stloc.3 - IL_006a: ldloc.3 - IL_006b: ldc.i4 0x989681 - IL_0070: blt.s IL_005e - - IL_0072: ldloc.0 - IL_0073: ret + IL_005a: stloc.0 + IL_005b: ldloc.3 + IL_005c: ldc.i4.1 + IL_005d: add + IL_005e: stloc.3 + IL_005f: ldloc.3 + IL_0060: ldc.i4 0x989681 + IL_0065: blt.s IL_0053 + + IL_0067: ldloc.0 + IL_0068: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl index 1d1d41b3695..e127d3e8285 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl @@ -53,9 +53,10 @@ .maxstack 5 .locals init (uint8[] V_0, uint8[] V_1, - int32 V_2, + uint8 V_2, uint8 V_3, - int32 V_4) + int32 V_4, + int32 V_5) IL_0000: nop IL_0001: ldc.i4.s 101 IL_0003: newarr [runtime]System.Byte @@ -64,44 +65,42 @@ IL_000a: stloc.2 IL_000b: ldc.i4.0 IL_000c: stloc.3 - IL_000d: br.s IL_001f + IL_000d: br.s IL_001b IL_000f: ldloc.1 IL_0010: ldloc.2 IL_0011: ldloc.3 - IL_0012: stelem [runtime]System.Byte - IL_0017: ldloc.3 + IL_0012: stelem.i1 + IL_0013: ldloc.3 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: stloc.3 + IL_0017: ldloc.2 IL_0018: ldc.i4.1 IL_0019: add - IL_001a: stloc.3 + IL_001a: stloc.2 IL_001b: ldloc.2 - IL_001c: ldc.i4.1 - IL_001d: add - IL_001e: stloc.2 - IL_001f: ldloc.2 + IL_001c: ldc.i4.s 101 + IL_001e: blt.un.s IL_000f + IL_0020: ldloc.1 - IL_0021: ldlen - IL_0022: conv.i4 - IL_0023: blt.s IL_000f - - IL_0025: ldloc.1 - IL_0026: stloc.0 - IL_0027: ldc.i4.0 - IL_0028: stloc.2 - IL_0029: br.s IL_0037 - - IL_002b: ldloc.0 - IL_002c: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) - IL_0031: stloc.s V_4 - IL_0033: ldloc.2 - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.2 - IL_0037: ldloc.2 - IL_0038: ldc.i4 0x989681 - IL_003d: blt.s IL_002b - - IL_003f: ret + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.s V_4 + IL_0025: br.s IL_0035 + + IL_0027: ldloc.0 + IL_0028: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_002d: stloc.s V_5 + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.s V_4 + IL_0037: ldc.i4 0x989681 + IL_003c: blt.s IL_0027 + + IL_003e: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl index 2d5ef45b06b..81975739962 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl @@ -63,44 +63,42 @@ IL_000a: stloc.2 IL_000b: ldc.i4.0 IL_000c: stloc.3 - IL_000d: br.s IL_001f + IL_000d: br.s IL_001b IL_000f: ldloc.1 IL_0010: ldloc.2 IL_0011: ldloc.3 - IL_0012: stelem [runtime]System.Int32 - IL_0017: ldloc.3 + IL_0012: stelem.i4 + IL_0013: ldloc.3 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: stloc.3 + IL_0017: ldloc.2 IL_0018: ldc.i4.1 IL_0019: add - IL_001a: stloc.3 + IL_001a: stloc.2 IL_001b: ldloc.2 - IL_001c: ldc.i4.1 - IL_001d: add - IL_001e: stloc.2 - IL_001f: ldloc.2 + IL_001c: ldc.i4.s 101 + IL_001e: blt.un.s IL_000f + IL_0020: ldloc.1 - IL_0021: ldlen - IL_0022: conv.i4 - IL_0023: blt.s IL_000f - - IL_0025: ldloc.1 - IL_0026: stloc.0 - IL_0027: ldc.i4.0 - IL_0028: stloc.2 - IL_0029: br.s IL_0036 - - IL_002b: ldloc.0 - IL_002c: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) - IL_0031: stloc.3 - IL_0032: ldloc.2 - IL_0033: ldc.i4.1 - IL_0034: add - IL_0035: stloc.2 - IL_0036: ldloc.2 - IL_0037: ldc.i4 0x989681 - IL_003c: blt.s IL_002b - - IL_003e: ret + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.2 + IL_0024: br.s IL_0031 + + IL_0026: ldloc.0 + IL_0027: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_002c: stloc.3 + IL_002d: ldloc.2 + IL_002e: ldc.i4.1 + IL_002f: add + IL_0030: stloc.2 + IL_0031: ldloc.2 + IL_0032: ldc.i4 0x989681 + IL_0037: blt.s IL_0026 + + IL_0039: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl index 88c067ce683..3f9afd4e27a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl @@ -297,18 +297,21 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, int32 V_4, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_5, + int32 V_5, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_6, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_7, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_8, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_9, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_10, - int32 V_11, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_12, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_13, - int32 V_14, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_15, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_16) + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_7, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_8, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_9, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_10, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_11, + int32 V_12, + int32 V_13, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_14, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_15, + int32 V_16, + int32 V_17, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_18, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_19) IL_0000: ldarg.0 IL_0001: ldarg.0 IL_0002: ldarg.0 @@ -323,174 +326,126 @@ IL_0018: ldc.i4.0 IL_0019: stloc.s V_4 IL_001b: ldc.i4.0 - IL_001c: stloc.s V_4 - IL_001e: br.s IL_0030 + IL_001c: stloc.s V_5 + IL_001e: br.s IL_0036 IL_0020: ldloca.s V_3 - IL_0022: ldloc.s V_4 + IL_0022: ldloc.s V_5 IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) IL_0029: nop - IL_002a: ldloc.s V_4 + IL_002a: ldloc.s V_5 IL_002c: ldc.i4.1 IL_002d: add - IL_002e: stloc.s V_4 + IL_002e: stloc.s V_5 IL_0030: ldloc.s V_4 - IL_0032: ldc.i4.2 - IL_0033: bge.s IL_0046 - - IL_0035: ldc.i4.0 + IL_0032: ldc.i4.1 + IL_0033: add + IL_0034: stloc.s V_4 IL_0036: ldloc.s V_4 - IL_0038: bge.s IL_003e - - IL_003a: ldc.i4.1 - IL_003b: nop - IL_003c: br.s IL_004c - - IL_003e: ldc.i4.0 - IL_003f: ldloc.s V_4 - IL_0041: ceq - IL_0043: nop - IL_0044: br.s IL_004c - - IL_0046: ldloc.s V_4 - IL_0048: ldc.i4.2 - IL_0049: ceq - IL_004b: nop - IL_004c: brtrue.s IL_0020 - - IL_004e: ldloca.s V_3 - IL_0050: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0055: stloc.2 - IL_0056: ldloc.1 - IL_0057: ldloc.2 - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + IL_0038: ldc.i4.3 + IL_0039: blt.un.s IL_0020 + + IL_003b: ldloca.s V_3 + IL_003d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0042: stloc.2 + IL_0043: ldloc.1 + IL_0044: ldloc.2 + IL_0045: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005d: stloc.s V_5 - IL_005f: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance - IL_0064: ldloc.s V_5 - IL_0066: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_004a: stloc.s V_6 + IL_004c: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance + IL_0051: ldloc.s V_6 + IL_0053: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_006b: stloc.s V_6 - IL_006d: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance - IL_0072: ldloc.s V_6 - IL_0074: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_0058: stloc.s V_7 + IL_005a: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance + IL_005f: ldloc.s V_7 + IL_0061: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0079: stloc.0 - IL_007a: ldarg.0 - IL_007b: ldarg.0 - IL_007c: ldarg.0 - IL_007d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0082: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0066: stloc.0 + IL_0067: ldarg.0 + IL_0068: ldarg.0 + IL_0069: ldarg.0 + IL_006a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_006f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0087: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0074: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0079: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0091: stloc.s V_8 - IL_0093: ldc.i4.0 - IL_0094: stloc.s V_11 - IL_0096: ldc.i4.0 - IL_0097: stloc.s V_11 - IL_0099: br.s IL_00ab - - IL_009b: ldloca.s V_10 - IL_009d: ldloc.s V_11 - IL_009f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_00a4: nop - IL_00a5: ldloc.s V_11 - IL_00a7: ldc.i4.1 - IL_00a8: add - IL_00a9: stloc.s V_11 - IL_00ab: ldloc.s V_11 - IL_00ad: ldc.i4.2 - IL_00ae: bge.s IL_00c1 - - IL_00b0: ldc.i4.0 - IL_00b1: ldloc.s V_11 - IL_00b3: bge.s IL_00b9 - - IL_00b5: ldc.i4.1 - IL_00b6: nop - IL_00b7: br.s IL_00c7 - - IL_00b9: ldc.i4.0 - IL_00ba: ldloc.s V_11 - IL_00bc: ceq - IL_00be: nop - IL_00bf: br.s IL_00c7 - - IL_00c1: ldloc.s V_11 - IL_00c3: ldc.i4.2 - IL_00c4: ceq - IL_00c6: nop - IL_00c7: brtrue.s IL_009b - - IL_00c9: ldloca.s V_10 - IL_00cb: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00d0: stloc.s V_9 - IL_00d2: ldc.i4.0 - IL_00d3: stloc.s V_14 - IL_00d5: ldc.i4.0 + IL_007e: stloc.s V_9 + IL_0080: ldc.i4.0 + IL_0081: stloc.s V_12 + IL_0083: ldc.i4.0 + IL_0084: stloc.s V_13 + IL_0086: br.s IL_009e + + IL_0088: ldloca.s V_11 + IL_008a: ldloc.s V_13 + IL_008c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0091: nop + IL_0092: ldloc.s V_13 + IL_0094: ldc.i4.1 + IL_0095: add + IL_0096: stloc.s V_13 + IL_0098: ldloc.s V_12 + IL_009a: ldc.i4.1 + IL_009b: add + IL_009c: stloc.s V_12 + IL_009e: ldloc.s V_12 + IL_00a0: ldc.i4.3 + IL_00a1: blt.un.s IL_0088 + + IL_00a3: ldloca.s V_11 + IL_00a5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00aa: stloc.s V_10 + IL_00ac: ldc.i4.0 + IL_00ad: stloc.s V_16 + IL_00af: ldc.i4.0 + IL_00b0: stloc.s V_17 + IL_00b2: br.s IL_00ca + + IL_00b4: ldloca.s V_15 + IL_00b6: ldloc.s V_17 + IL_00b8: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00bd: nop + IL_00be: ldloc.s V_17 + IL_00c0: ldc.i4.1 + IL_00c1: add + IL_00c2: stloc.s V_17 + IL_00c4: ldloc.s V_16 + IL_00c6: ldc.i4.1 + IL_00c7: add + IL_00c8: stloc.s V_16 + IL_00ca: ldloc.s V_16 + IL_00cc: ldc.i4.3 + IL_00cd: blt.un.s IL_00b4 + + IL_00cf: ldloca.s V_15 + IL_00d1: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() IL_00d6: stloc.s V_14 - IL_00d8: br.s IL_00ea - - IL_00da: ldloca.s V_13 + IL_00d8: ldloc.s V_9 + IL_00da: ldloc.s V_10 IL_00dc: ldloc.s V_14 - IL_00de: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_00e3: nop - IL_00e4: ldloc.s V_14 - IL_00e6: ldc.i4.1 - IL_00e7: add - IL_00e8: stloc.s V_14 - IL_00ea: ldloc.s V_14 - IL_00ec: ldc.i4.2 - IL_00ed: bge.s IL_0100 - - IL_00ef: ldc.i4.0 - IL_00f0: ldloc.s V_14 - IL_00f2: bge.s IL_00f8 - - IL_00f4: ldc.i4.1 - IL_00f5: nop - IL_00f6: br.s IL_0106 - - IL_00f8: ldc.i4.0 - IL_00f9: ldloc.s V_14 - IL_00fb: ceq - IL_00fd: nop - IL_00fe: br.s IL_0106 - - IL_0100: ldloc.s V_14 - IL_0102: ldc.i4.2 - IL_0103: ceq - IL_0105: nop - IL_0106: brtrue.s IL_00da - - IL_0108: ldloca.s V_13 - IL_010a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_010f: stloc.s V_12 - IL_0111: ldloc.s V_8 - IL_0113: ldloc.s V_9 - IL_0115: ldloc.s V_12 - IL_0117: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + IL_00de: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_011c: stloc.s V_15 - IL_011e: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance - IL_0123: ldloc.s V_15 - IL_0125: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_00e3: stloc.s V_18 + IL_00e5: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance + IL_00ea: ldloc.s V_18 + IL_00ec: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_012a: stloc.s V_16 - IL_012c: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance - IL_0131: ldloc.s V_16 - IL_0133: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_00f1: stloc.s V_19 + IL_00f3: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance + IL_00f8: ldloc.s V_19 + IL_00fa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0138: stloc.s V_7 - IL_013a: ldloc.0 - IL_013b: ldloc.s V_7 - IL_013d: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, + IL_00ff: stloc.s V_8 + IL_0101: ldloc.0 + IL_0102: ldloc.s V_8 + IL_0104: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, !1) - IL_0142: ret + IL_0109: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl index 8a93f0441a2..495b69d0bea 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl @@ -416,300 +416,285 @@ valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_11, int32 V_12, int32 V_13, - class [runtime]System.Tuple`4 V_14, + int32 V_14, class [runtime]System.Tuple`4 V_15, - int32 V_16, - class [runtime]System.Tuple`3 V_17, + class [runtime]System.Tuple`4 V_16, + int32 V_17, class [runtime]System.Tuple`3 V_18, - int32 V_19, - class [runtime]System.Tuple`4 V_20, + class [runtime]System.Tuple`3 V_19, + int32 V_20, class [runtime]System.Tuple`4 V_21, - int32 V_22) - IL_0000: ldc.i4.1 + class [runtime]System.Tuple`4 V_22, + int32 V_23) + IL_0000: ldc.i4.0 IL_0001: stloc.s V_12 IL_0003: ldc.i4.1 - IL_0004: stloc.s V_12 - IL_0006: br.s IL_0018 + IL_0004: stloc.s V_13 + IL_0006: br.s IL_001e IL_0008: ldloca.s V_11 - IL_000a: ldloc.s V_12 + IL_000a: ldloc.s V_13 IL_000c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) IL_0011: nop - IL_0012: ldloc.s V_12 + IL_0012: ldloc.s V_13 IL_0014: ldc.i4.1 IL_0015: add - IL_0016: stloc.s V_12 + IL_0016: stloc.s V_13 IL_0018: ldloc.s V_12 - IL_001a: ldc.i4.s 10 - IL_001c: bge.s IL_002f - - IL_001e: ldc.i4.1 - IL_001f: ldloc.s V_12 - IL_0021: bge.s IL_0027 - - IL_0023: ldc.i4.1 - IL_0024: nop - IL_0025: br.s IL_0036 - - IL_0027: ldc.i4.1 - IL_0028: ldloc.s V_12 - IL_002a: ceq - IL_002c: nop - IL_002d: br.s IL_0036 - - IL_002f: ldloc.s V_12 - IL_0031: ldc.i4.s 10 - IL_0033: ceq - IL_0035: nop - IL_0036: brtrue.s IL_0008 - - IL_0038: ldloca.s V_11 - IL_003a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_003f: dup - IL_0040: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::alist@5 - IL_0045: stloc.0 - IL_0046: ldc.i4.3 - IL_0047: newarr [runtime]System.Int32 - IL_004c: dup - IL_004d: ldc.i4.0 - IL_004e: ldc.i4.1 - IL_004f: stelem [runtime]System.Int32 - IL_0054: dup - IL_0055: ldc.i4.1 - IL_0056: ldc.i4.2 - IL_0057: stelem [runtime]System.Int32 - IL_005c: dup - IL_005d: ldc.i4.2 - IL_005e: ldc.i4.3 - IL_005f: stelem [runtime]System.Int32 - IL_0064: dup - IL_0065: stsfld int32[] ''.$assembly::array@6 - IL_006a: stloc.1 - IL_006b: ldc.i4.1 - IL_006c: ldc.i4.1 - IL_006d: ldc.i4.s 10 - IL_006f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: stloc.s V_12 + IL_001e: ldloc.s V_12 + IL_0020: ldc.i4.s 10 + IL_0022: blt.un.s IL_0008 + + IL_0024: ldloca.s V_11 + IL_0026: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_002b: dup + IL_002c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::alist@5 + IL_0031: stloc.0 + IL_0032: ldc.i4.3 + IL_0033: newarr [runtime]System.Int32 + IL_0038: dup + IL_0039: ldc.i4.0 + IL_003a: ldc.i4.1 + IL_003b: stelem [runtime]System.Int32 + IL_0040: dup + IL_0041: ldc.i4.1 + IL_0042: ldc.i4.2 + IL_0043: stelem [runtime]System.Int32 + IL_0048: dup + IL_0049: ldc.i4.2 + IL_004a: ldc.i4.3 + IL_004b: stelem [runtime]System.Int32 + IL_0050: dup + IL_0051: stsfld int32[] ''.$assembly::array@6 + IL_0056: stloc.1 + IL_0057: ldc.i4.1 + IL_0058: ldc.i4.1 + IL_0059: ldc.i4.s 10 + IL_005b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_0074: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0079: dup - IL_007a: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 ''.$assembly::aseq@7 - IL_007f: stloc.2 - IL_0080: ldc.i4.1 - IL_0081: ldc.i4.1 - IL_0082: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_0060: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0065: dup + IL_0066: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 ''.$assembly::aseq@7 + IL_006b: stloc.2 + IL_006c: ldc.i4.1 + IL_006d: ldc.i4.1 + IL_006e: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_0087: ldc.i4.2 - IL_0088: ldc.i4.2 - IL_0089: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_0073: ldc.i4.2 + IL_0074: ldc.i4.2 + IL_0075: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_008e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() - IL_0093: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + IL_007a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() + IL_007f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0098: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + IL_0084: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_009d: dup - IL_009e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> ''.$assembly::list1@8 - IL_00a3: stloc.3 - IL_00a4: ldc.i4.0 - IL_00a5: ldnull - IL_00a6: newobj instance void assembly/seq1@9::.ctor(int32, + IL_0089: dup + IL_008a: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> ''.$assembly::list1@8 + IL_008f: stloc.3 + IL_0090: ldc.i4.0 + IL_0091: ldnull + IL_0092: newobj instance void assembly/seq1@9::.ctor(int32, class [runtime]System.Tuple`2) - IL_00ab: dup - IL_00ac: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> ''.$assembly::seq1@9 - IL_00b1: stloc.s V_4 - IL_00b3: ldc.i4.2 - IL_00b4: newarr class [runtime]System.Tuple`2 - IL_00b9: dup - IL_00ba: ldc.i4.0 - IL_00bb: ldc.i4.1 - IL_00bc: ldc.i4.1 - IL_00bd: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_0097: dup + IL_0098: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> ''.$assembly::seq1@9 + IL_009d: stloc.s V_4 + IL_009f: ldc.i4.2 + IL_00a0: newarr class [runtime]System.Tuple`2 + IL_00a5: dup + IL_00a6: ldc.i4.0 + IL_00a7: ldc.i4.1 + IL_00a8: ldc.i4.1 + IL_00a9: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_00c2: stelem class [runtime]System.Tuple`2 - IL_00c7: dup - IL_00c8: ldc.i4.1 + IL_00ae: stelem class [runtime]System.Tuple`2 + IL_00b3: dup + IL_00b4: ldc.i4.1 + IL_00b5: ldc.i4.2 + IL_00b6: ldc.i4.2 + IL_00b7: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_00bc: stelem class [runtime]System.Tuple`2 + IL_00c1: dup + IL_00c2: stsfld class [runtime]System.Tuple`2[] ''.$assembly::array1@10 + IL_00c7: stloc.s V_5 IL_00c9: ldc.i4.2 IL_00ca: ldc.i4.2 - IL_00cb: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_00d0: stelem class [runtime]System.Tuple`2 - IL_00d5: dup - IL_00d6: stsfld class [runtime]System.Tuple`2[] ''.$assembly::array1@10 - IL_00db: stloc.s V_5 - IL_00dd: ldc.i4.2 - IL_00de: ldc.i4.2 - IL_00df: ldc.i4.0 - IL_00e0: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, + IL_00cb: ldc.i4.0 + IL_00cc: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, int32, !!0) - IL_00e5: dup - IL_00e6: stsfld int32[0...,0...] ''.$assembly::a3@11 - IL_00eb: stloc.s V_6 - IL_00ed: ldc.i4.3 - IL_00ee: ldc.i4.3 - IL_00ef: ldc.i4.3 - IL_00f0: ldc.i4.0 - IL_00f1: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, + IL_00d1: dup + IL_00d2: stsfld int32[0...,0...] ''.$assembly::a3@11 + IL_00d7: stloc.s V_6 + IL_00d9: ldc.i4.3 + IL_00da: ldc.i4.3 + IL_00db: ldc.i4.3 + IL_00dc: ldc.i4.0 + IL_00dd: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, int32, int32, !!0) - IL_00f6: dup - IL_00f7: stsfld int32[0...,0...,0...] ''.$assembly::array3D@12 - IL_00fc: stloc.s V_7 - IL_00fe: ldc.i4.4 - IL_00ff: ldc.i4.4 - IL_0100: ldc.i4.4 - IL_0101: ldc.i4.4 - IL_0102: ldc.i4.0 - IL_0103: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, + IL_00e2: dup + IL_00e3: stsfld int32[0...,0...,0...] ''.$assembly::array3D@12 + IL_00e8: stloc.s V_7 + IL_00ea: ldc.i4.4 + IL_00eb: ldc.i4.4 + IL_00ec: ldc.i4.4 + IL_00ed: ldc.i4.4 + IL_00ee: ldc.i4.0 + IL_00ef: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, int32, int32, int32, !!0) - IL_0108: dup - IL_0109: stsfld int32[0...,0...,0...,0...] ''.$assembly::array4D@13 - IL_010e: stloc.s V_8 - IL_0110: call int32[] assembly::get_array() - IL_0115: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) - IL_011a: pop - IL_011b: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_0120: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0125: pop - IL_0126: call class [runtime]System.Tuple`2[] assembly::get_array1() - IL_012b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) - IL_0130: pop - IL_0131: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() - IL_0136: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) - IL_013b: pop - IL_013c: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() - IL_0141: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) - IL_0146: pop - IL_0147: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() - IL_014c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0151: dup - IL_0152: stsfld int32[] ''.$assembly::a1@25 - IL_0157: stloc.s V_9 - IL_0159: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_015e: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0163: dup - IL_0164: stsfld int32[] ''.$assembly::a2@26 - IL_0169: stloc.s V_10 - IL_016b: call int32[] assembly::get_a1() - IL_0170: ldc.i4.0 - IL_0171: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], + IL_00f4: dup + IL_00f5: stsfld int32[0...,0...,0...,0...] ''.$assembly::array4D@13 + IL_00fa: stloc.s V_8 + IL_00fc: call int32[] assembly::get_array() + IL_0101: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) + IL_0106: pop + IL_0107: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_010c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0111: pop + IL_0112: call class [runtime]System.Tuple`2[] assembly::get_array1() + IL_0117: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) + IL_011c: pop + IL_011d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() + IL_0122: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) + IL_0127: pop + IL_0128: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() + IL_012d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) + IL_0132: pop + IL_0133: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() + IL_0138: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_013d: dup + IL_013e: stsfld int32[] ''.$assembly::a1@25 + IL_0143: stloc.s V_9 + IL_0145: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_014a: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_014f: dup + IL_0150: stsfld int32[] ''.$assembly::a2@26 + IL_0155: stloc.s V_10 + IL_0157: call int32[] assembly::get_a1() + IL_015c: ldc.i4.0 + IL_015d: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], int32) - IL_0176: stloc.s V_13 - IL_0178: call int32[] assembly::get_a2() - IL_017d: ldc.i4.0 - IL_017e: ldloc.s V_13 - IL_0180: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], + IL_0162: stloc.s V_14 + IL_0164: call int32[] assembly::get_a2() + IL_0169: ldc.i4.0 + IL_016a: ldloc.s V_14 + IL_016c: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], int32, !!0) - IL_0185: nop + IL_0171: nop + IL_0172: call int32[0...,0...] assembly::get_a3() + IL_0177: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) + IL_017c: call int32[0...,0...] assembly::get_a3() + IL_0181: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) IL_0186: call int32[0...,0...] assembly::get_a3() - IL_018b: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) + IL_018b: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) IL_0190: call int32[0...,0...] assembly::get_a3() - IL_0195: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) - IL_019a: call int32[0...,0...] assembly::get_a3() - IL_019f: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) - IL_01a4: call int32[0...,0...] assembly::get_a3() - IL_01a9: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) - IL_01ae: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + IL_0195: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) + IL_019a: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, !1, !2, !3) - IL_01b3: stloc.s V_14 - IL_01b5: ldloc.s V_14 - IL_01b7: stloc.s V_15 - IL_01b9: call int32[0...,0...] assembly::get_a3() - IL_01be: ldc.i4.0 - IL_01bf: ldc.i4.0 - IL_01c0: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], + IL_019f: stloc.s V_15 + IL_01a1: ldloc.s V_15 + IL_01a3: stloc.s V_16 + IL_01a5: call int32[0...,0...] assembly::get_a3() + IL_01aa: ldc.i4.0 + IL_01ab: ldc.i4.0 + IL_01ac: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], int32, int32) - IL_01c5: stloc.s V_16 - IL_01c7: call int32[0...,0...] assembly::get_a3() - IL_01cc: ldc.i4.0 - IL_01cd: ldc.i4.0 - IL_01ce: ldloc.s V_16 - IL_01d0: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], + IL_01b1: stloc.s V_17 + IL_01b3: call int32[0...,0...] assembly::get_a3() + IL_01b8: ldc.i4.0 + IL_01b9: ldc.i4.0 + IL_01ba: ldloc.s V_17 + IL_01bc: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], int32, int32, !!0) - IL_01d5: nop + IL_01c1: nop + IL_01c2: call int32[0...,0...,0...] assembly::get_array3D() + IL_01c7: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) + IL_01cc: call int32[0...,0...,0...] assembly::get_array3D() + IL_01d1: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) IL_01d6: call int32[0...,0...,0...] assembly::get_array3D() - IL_01db: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) - IL_01e0: call int32[0...,0...,0...] assembly::get_array3D() - IL_01e5: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) - IL_01ea: call int32[0...,0...,0...] assembly::get_array3D() - IL_01ef: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) - IL_01f4: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, + IL_01db: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) + IL_01e0: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, !1, !2) - IL_01f9: stloc.s V_17 - IL_01fb: ldloc.s V_17 - IL_01fd: stloc.s V_18 - IL_01ff: call int32[0...,0...,0...] assembly::get_array3D() - IL_0204: ldc.i4.0 - IL_0205: ldc.i4.0 - IL_0206: ldc.i4.0 - IL_0207: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], + IL_01e5: stloc.s V_18 + IL_01e7: ldloc.s V_18 + IL_01e9: stloc.s V_19 + IL_01eb: call int32[0...,0...,0...] assembly::get_array3D() + IL_01f0: ldc.i4.0 + IL_01f1: ldc.i4.0 + IL_01f2: ldc.i4.0 + IL_01f3: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], int32, int32, int32) - IL_020c: stloc.s V_19 - IL_020e: call int32[0...,0...,0...] assembly::get_array3D() - IL_0213: ldc.i4.0 - IL_0214: ldc.i4.0 - IL_0215: ldc.i4.0 - IL_0216: ldloc.s V_19 - IL_0218: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], + IL_01f8: stloc.s V_20 + IL_01fa: call int32[0...,0...,0...] assembly::get_array3D() + IL_01ff: ldc.i4.0 + IL_0200: ldc.i4.0 + IL_0201: ldc.i4.0 + IL_0202: ldloc.s V_20 + IL_0204: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], int32, int32, int32, !!0) - IL_021d: nop + IL_0209: nop + IL_020a: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_020f: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) + IL_0214: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0219: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) IL_021e: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0223: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) + IL_0223: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) IL_0228: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_022d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) - IL_0232: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0237: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) - IL_023c: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0241: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) - IL_0246: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + IL_022d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) + IL_0232: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, !1, !2, !3) - IL_024b: stloc.s V_20 - IL_024d: ldloc.s V_20 - IL_024f: stloc.s V_21 - IL_0251: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0256: ldc.i4.0 - IL_0257: ldc.i4.0 - IL_0258: ldc.i4.0 - IL_0259: ldc.i4.0 - IL_025a: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], + IL_0237: stloc.s V_21 + IL_0239: ldloc.s V_21 + IL_023b: stloc.s V_22 + IL_023d: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0242: ldc.i4.0 + IL_0243: ldc.i4.0 + IL_0244: ldc.i4.0 + IL_0245: ldc.i4.0 + IL_0246: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], int32, int32, int32, int32) - IL_025f: stloc.s V_22 - IL_0261: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0266: ldc.i4.0 - IL_0267: ldc.i4.0 - IL_0268: ldc.i4.0 - IL_0269: ldc.i4.0 - IL_026a: ldloc.s V_22 - IL_026c: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], + IL_024b: stloc.s V_23 + IL_024d: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0252: ldc.i4.0 + IL_0253: ldc.i4.0 + IL_0254: ldc.i4.0 + IL_0255: ldc.i4.0 + IL_0256: ldloc.s V_23 + IL_0258: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], int32, int32, int32, int32, !!0) - IL_0271: nop - IL_0272: ret + IL_025d: nop + IL_025e: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl index e797d2fc3bb..7b90ebb8713 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl @@ -60,72 +60,57 @@ .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, int32 V_2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_3, - int32 V_4) - IL_0000: ldc.i4.1 + int32 V_3, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_4, + int32 V_5) + IL_0000: ldc.i4.0 IL_0001: stloc.2 IL_0002: ldc.i4.1 - IL_0003: stloc.2 - IL_0004: br.s IL_0013 + IL_0003: stloc.3 + IL_0004: br.s IL_0017 IL_0006: ldloca.s V_1 - IL_0008: ldloc.2 + IL_0008: ldloc.3 IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) IL_000e: nop - IL_000f: ldloc.2 + IL_000f: ldloc.3 IL_0010: ldc.i4.1 IL_0011: add - IL_0012: stloc.2 + IL_0012: stloc.3 IL_0013: ldloc.2 - IL_0014: ldc.i4.3 - IL_0015: bge.s IL_0026 - - IL_0017: ldc.i4.1 - IL_0018: ldloc.2 - IL_0019: bge.s IL_001f - - IL_001b: ldc.i4.1 - IL_001c: nop - IL_001d: br.s IL_002b - - IL_001f: ldc.i4.1 - IL_0020: ldloc.2 - IL_0021: ceq - IL_0023: nop - IL_0024: br.s IL_002b - - IL_0026: ldloc.2 - IL_0027: ldc.i4.3 - IL_0028: ceq - IL_002a: nop - IL_002b: brtrue.s IL_0006 - - IL_002d: ldloca.s V_1 - IL_002f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0034: stloc.0 - IL_0035: ldloc.0 - IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_003b: stloc.3 - IL_003c: br.s IL_0066 - - IL_003e: ldloc.0 - IL_003f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0044: stloc.s V_4 - IL_0046: ldstr "%A" - IL_004b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_0050: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0055: ldloc.s V_4 - IL_0057: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_005c: pop - IL_005d: ldloc.3 - IL_005e: stloc.0 - IL_005f: ldloc.0 - IL_0060: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0065: stloc.3 - IL_0066: ldloc.3 - IL_0067: brtrue.s IL_003e - - IL_0069: ret + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: stloc.2 + IL_0017: ldloc.2 + IL_0018: ldc.i4.3 + IL_0019: blt.un.s IL_0006 + + IL_001b: ldloca.s V_1 + IL_001d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0022: stloc.0 + IL_0023: ldloc.0 + IL_0024: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0029: stloc.s V_4 + IL_002b: br.s IL_0057 + + IL_002d: ldloc.0 + IL_002e: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0033: stloc.s V_5 + IL_0035: ldstr "%A" + IL_003a: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_003f: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0044: ldloc.s V_5 + IL_0046: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_004b: pop + IL_004c: ldloc.s V_4 + IL_004e: stloc.0 + IL_004f: ldloc.0 + IL_0050: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0055: stloc.s V_4 + IL_0057: ldloc.s V_4 + IL_0059: brtrue.s IL_002d + + IL_005b: ret } } diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 018f7419c97..c2a466db5c7 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -821,7 +821,9 @@ module internal RangeTestsHelpers = enumerator.Current |> ignore let inline exceptions zero one two = + Assert.Throws (typeof, (fun () -> {one .. zero .. two} |> Seq.length |> ignore)) |> ignore Assert.Throws (typeof, (fun () -> [one .. zero .. two] |> List.length |> ignore)) |> ignore + Assert.Throws (typeof, (fun () -> [|one .. zero .. two|] |> Array.length |> ignore)) |> ignore Assert.Throws (typeof, (fun () -> regressionExceptionBeforeStartSingleStepRangeEnumerator zero one)) |> ignore Assert.Throws (typeof, (fun () -> regressionExceptionBeforeStartVariableStepIntegralRange zero two)) |> ignore @@ -829,28 +831,64 @@ module internal RangeTestsHelpers = Assert.Throws (typeof, (fun () -> regressionExceptionAfterEndVariableStepIntegralRange zero two)) |> ignore let inline common (min0, min1, min2, min3) (max0, max1, max2, max3) (zero, one, two, three) = + Assert.AreEqual ({min0 .. min3}, seq {yield min0; yield min1; yield min2; yield min3}) + Assert.AreEqual ({min0 .. one .. min3}, seq {min0; min1; min2; min3}) + Assert.AreEqual ({min0 .. two .. min3}, seq {min0; min2}) + Assert.AreEqual ({min0 .. three .. min3}, seq {min0; min3}) + Assert.AreEqual ([min0 .. min3], [min0; min1; min2; min3]) Assert.AreEqual ([min0 .. one .. min3], [min0; min1; min2; min3]) Assert.AreEqual ([min0 .. two .. min3], [min0; min2]) Assert.AreEqual ([min0 .. three .. min3], [min0; min3]) + Assert.AreEqual ([|min0 .. min3|], [|min0; min1; min2; min3|]) + Assert.AreEqual ([|min0 .. one .. min3|], [|min0; min1; min2; min3|]) + Assert.AreEqual ([|min0 .. two .. min3|], [|min0; min2|]) + Assert.AreEqual ([|min0 .. three .. min3|], [|min0; min3|]) + + Assert.AreEqual ({max3 .. max0}, seq {yield max3; yield max2; yield max1; yield max0}) + Assert.AreEqual ({max3 .. one .. max0}, seq {max3; max2; max1; max0}) + Assert.AreEqual ({max3 .. two .. max0}, seq {max3; max1}) + Assert.AreEqual ({max3 .. three .. max0}, seq {max3; max0}) + Assert.AreEqual ([max3 .. max0], [max3; max2; max1; max0]) Assert.AreEqual ([max3 .. one .. max0], [max3; max2; max1; max0]) Assert.AreEqual ([max3 .. two .. max0], [max3; max1]) Assert.AreEqual ([max3 .. three .. max0], [max3; max0]) + Assert.AreEqual ([|max3 .. max0|], [|max3; max2; max1; max0|]) + Assert.AreEqual ([|max3 .. one .. max0|], [|max3; max2; max1; max0|]) + Assert.AreEqual ([|max3 .. two .. max0|], [|max3; max1|]) + Assert.AreEqual ([|max3 .. three .. max0|], [|max3; max0|]) + + Assert.AreEqual ({max0 .. min0}, Seq.empty) + Assert.AreEqual ({max0 .. one .. min0}, Seq.empty) + Assert.AreEqual ({max0 .. two .. min0}, Seq.empty) + Assert.AreEqual ({max0 .. three .. min0}, Seq.empty) + Assert.AreEqual ([max0 .. min0], []) Assert.AreEqual ([max0 .. one .. min0], []) Assert.AreEqual ([max0 .. two .. min0], []) Assert.AreEqual ([max0 .. three .. min0], []) + Assert.AreEqual ([|max0 .. min0|], [||]) + Assert.AreEqual ([|max0 .. one .. min0|], [||]) + Assert.AreEqual ([|max0 .. two .. min0|], [||]) + Assert.AreEqual ([|max0 .. three .. min0|], [||]) + exceptions zero one two // tests for singleStepRangeEnumerator, as it only is used if start and/or end are not the // minimum or maximum of the number range and it is counting by 1s + Assert.AreEqual ({min1 .. min3}, seq {min1; min2; min3}) + Assert.AreEqual ({max3 .. max1}, seq {max3; max2; max1}) + Assert.AreEqual ([min1 .. min3], [min1; min2; min3]) Assert.AreEqual ([max3 .. max1], [max3; max2; max1]) + Assert.AreEqual ([|min1 .. min3|], [|min1; min2; min3|]) + Assert.AreEqual ([|max3 .. max1|], [|max3; max2; max1|]) + let inline signed min0 max0 = let zero = LanguagePrimitives.GenericZero let one = LanguagePrimitives.GenericOne @@ -867,28 +905,72 @@ module internal RangeTestsHelpers = common (min0, min1, min2, min3) (max0, max1, max2, max3) (zero, one, two, three) + Assert.AreEqual ({min0 .. max0 .. max0}, seq { min0; min0 + max0; min0 + max0 + max0 }) + Assert.AreEqual ({min0 .. max1 .. max0}, seq { min0; min0 + max1; min0 + max1 + max1 }) + Assert.AreEqual ({min0 .. max2 .. max0}, seq { min0; min0 + max2; min0 + max2 + max2 }) + Assert.AreEqual ({min0 .. max3 .. max0}, seq { min0; min0 + max3; min0 + max3 + max3 }) + Assert.AreEqual ([min0 .. max0 .. max0], [ min0; min0 + max0; min0 + max0 + max0 ]) Assert.AreEqual ([min0 .. max1 .. max0], [ min0; min0 + max1; min0 + max1 + max1 ]) Assert.AreEqual ([min0 .. max2 .. max0], [ min0; min0 + max2; min0 + max2 + max2 ]) Assert.AreEqual ([min0 .. max3 .. max0], [ min0; min0 + max3; min0 + max3 + max3 ]) + Assert.AreEqual ([|min0 .. max0 .. max0|], [| min0; min0 + max0; min0 + max0 + max0 |]) + Assert.AreEqual ([|min0 .. max1 .. max0|], [| min0; min0 + max1; min0 + max1 + max1 |]) + Assert.AreEqual ([|min0 .. max2 .. max0|], [| min0; min0 + max2; min0 + max2 + max2 |]) + Assert.AreEqual ([|min0 .. max3 .. max0|], [| min0; min0 + max3; min0 + max3 + max3 |]) + + Assert.AreEqual ({min3 .. -one .. min0}, seq {min3; min2; min1; min0}) + Assert.AreEqual ({min3 .. -two .. min0}, seq {min3; min1}) + Assert.AreEqual ({min3 .. -three .. min0}, seq {min3; min0}) + Assert.AreEqual ([min3 .. -one .. min0], [min3; min2; min1; min0]) Assert.AreEqual ([min3 .. -two .. min0], [min3; min1]) Assert.AreEqual ([min3 .. -three .. min0], [min3; min0]) + Assert.AreEqual ([|min3 .. -one .. min0|], [|min3; min2; min1; min0|]) + Assert.AreEqual ([|min3 .. -two .. min0|], [|min3; min1|]) + Assert.AreEqual ([|min3 .. -three .. min0|], [|min3; min0|]) + + Assert.AreEqual ({max0 .. -one .. max3}, seq {max0; max1; max2; max3}) + Assert.AreEqual ({max0 .. -two .. max3}, seq {max0; max2}) + Assert.AreEqual ({max0 .. -three .. max3}, seq {max0; max3}) + Assert.AreEqual ([max0 .. -one .. max3], [max0; max1; max2; max3]) Assert.AreEqual ([max0 .. -two .. max3], [max0; max2]) Assert.AreEqual ([max0 .. -three .. max3], [max0; max3]) + Assert.AreEqual ([|max0 .. -one .. max3|], [|max0; max1; max2; max3|]) + Assert.AreEqual ([|max0 .. -two .. max3|], [|max0; max2|]) + Assert.AreEqual ([|max0 .. -three .. max3|], [|max0; max3|]) + + Assert.AreEqual ({min0 .. -one .. max0}, Seq.empty) + Assert.AreEqual ({min0 .. -two .. max0}, Seq.empty) + Assert.AreEqual ({min0 .. -three .. max0}, Seq.empty) + Assert.AreEqual ([min0 .. -one .. max0], []) Assert.AreEqual ([min0 .. -two .. max0], []) Assert.AreEqual ([min0 .. -three .. max0], []) + Assert.AreEqual ([|min0 .. -one .. max0|], [||]) + Assert.AreEqual ([|min0 .. -two .. max0|], [||]) + Assert.AreEqual ([|min0 .. -three .. max0|], [||]) + + Assert.AreEqual ({max0 .. min0 .. min0}, seq {max0; max0 + min0}) + Assert.AreEqual ({max0 .. min1 .. min0}, seq {max0; max0 + min1; max0 + min1 + min1 }) + Assert.AreEqual ({max0 .. min2 .. min0}, seq {max0; max0 + min2; max0 + min2 + min2 }) + Assert.AreEqual ({max0 .. min3 .. min0}, seq {max0; max0 + min3; max0 + min3 + min3 }) + Assert.AreEqual ([max0 .. min0 .. min0], [max0; max0 + min0]) Assert.AreEqual ([max0 .. min1 .. min0], [max0; max0 + min1; max0 + min1 + min1 ]) Assert.AreEqual ([max0 .. min2 .. min0], [max0; max0 + min2; max0 + min2 + min2 ]) Assert.AreEqual ([max0 .. min3 .. min0], [max0; max0 + min3; max0 + min3 + min3 ]) + Assert.AreEqual ([|max0 .. min0 .. min0|], [|max0; max0 + min0|]) + Assert.AreEqual ([|max0 .. min1 .. min0|], [|max0; max0 + min1; max0 + min1 + min1 |]) + Assert.AreEqual ([|max0 .. min2 .. min0|], [|max0; max0 + min2; max0 + min2 + min2 |]) + Assert.AreEqual ([|max0 .. min3 .. min0|], [|max0; max0 + min3; max0 + min3 + min3 |]) + let inline unsigned min0 max0 = let zero = LanguagePrimitives.GenericZero let one = LanguagePrimitives.GenericOne @@ -905,32 +987,100 @@ module internal RangeTestsHelpers = common (min0, min1, min2, min3) (max0, max1, max2, max3) (zero, one, two, three) + Assert.AreEqual ({min0 .. max0 .. max0}, seq {yield min0; yield min0 + max0}) + Assert.AreEqual ({min0 .. max1 .. max0}, seq {min0; min0 + max1}) + Assert.AreEqual ({min0 .. max2 .. max0}, seq {min0; min0 + max2}) + Assert.AreEqual ({min0 .. max3 .. max0}, seq {min0; min0 + max3}) + Assert.AreEqual ([min0 .. max0 .. max0], [min0; min0 + max0]) Assert.AreEqual ([min0 .. max1 .. max0], [min0; min0 + max1]) Assert.AreEqual ([min0 .. max2 .. max0], [min0; min0 + max2]) Assert.AreEqual ([min0 .. max3 .. max0], [min0; min0 + max3]) + Assert.AreEqual ([|min0 .. max0 .. max0|], [|min0; min0 + max0|]) + Assert.AreEqual ([|min0 .. max1 .. max0|], [|min0; min0 + max1|]) + Assert.AreEqual ([|min0 .. max2 .. max0|], [|min0; min0 + max2|]) + Assert.AreEqual ([|min0 .. max3 .. max0|], [|min0; min0 + max3|]) -type RangeTests() = - [] member _.``Range.SByte`` () = RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue - [] member _.``Range.Byte`` () = RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue - [] member _.``Range.Int16`` () = RangeTestsHelpers.signed System.Int16.MinValue System.Int16.MaxValue - [] member _.``Range.UInt16`` () = RangeTestsHelpers.unsigned System.UInt16.MinValue System.UInt16.MaxValue - [] member _.``Range.Int32`` () = RangeTestsHelpers.signed System.Int32.MinValue System.Int32.MaxValue - [] member _.``Range.UInt32`` () = RangeTestsHelpers.unsigned System.UInt32.MinValue System.UInt32.MaxValue - [] member _.``Range.Int64`` () = RangeTestsHelpers.signed System.Int64.MinValue System.Int64.MaxValue - [] member _.``Range.UInt64`` () = RangeTestsHelpers.unsigned System.UInt64.MinValue System.UInt64.MaxValue +module RangeTests = + module BuildTime = + [] + let ``Range.SByte`` () = RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue - [] - member _.``Range.IntPtr`` () = - if System.IntPtr.Size >= 4 then RangeTestsHelpers.signed (System.IntPtr System.Int32.MinValue) (System.IntPtr System.Int32.MaxValue) - if System.IntPtr.Size >= 8 then RangeTestsHelpers.signed (System.IntPtr System.Int64.MinValue) (System.IntPtr System.Int64.MaxValue) - - [] - member _.``Range.UIntPtr`` () = - if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt32.MinValue) (System.UIntPtr System.UInt32.MaxValue) - if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) - + [] + let ``Range.Byte`` () = RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue + + // Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? + //[] + //let ``Range.Char`` () = RangeTestsHelpers.unsigned System.Char.MinValue System.Char.MaxValue + + [] + let ``Range.Int16`` () = RangeTestsHelpers.signed System.Int16.MinValue System.Int16.MaxValue + + [] + let ``Range.UInt16`` () = RangeTestsHelpers.unsigned System.UInt16.MinValue System.UInt16.MaxValue + + [] + let ``Range.Int32`` () = RangeTestsHelpers.signed System.Int32.MinValue System.Int32.MaxValue + + [] + let ``Range.UInt32`` () = RangeTestsHelpers.unsigned System.UInt32.MinValue System.UInt32.MaxValue + + [] + let ``Range.Int64`` () = RangeTestsHelpers.signed System.Int64.MinValue System.Int64.MaxValue + + [] + let ``Range.UInt64`` () = RangeTestsHelpers.unsigned System.UInt64.MinValue System.UInt64.MaxValue + + [] + let ``Range.IntPtr`` () = + // 0x80000000n is negative on x86, but would be positive on x64. + if System.IntPtr.Size = 4 then RangeTestsHelpers.signed 0x80000000n 0x7fffffffn + if System.IntPtr.Size = 8 then RangeTestsHelpers.signed 0x8000000000000000n 0x7fffffffffffffffn + + [] + let ``Range.UIntPtr`` () = + if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned 0x0un 0xffffffffun + if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned 0x0un 0xffffffffffffffffun + + module RunTime = + [] + let ``Range.SByte`` (min0: sbyte) (max0: sbyte) = RangeTestsHelpers.signed min0 max0 + + [] + let ``Range.Byte`` (min0: byte) (max0: byte) = RangeTestsHelpers.unsigned min0 max0 + + // Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? + //[] + //let ``Range.Char`` (min0: char) (max0: char) = RangeTestsHelpers.unsigned min0 max0 + + [] + let ``Range.Int16`` (min0: int16) (max0: int16) = RangeTestsHelpers.signed min0 max0 + + [] + let ``Range.UInt16`` (min0: uint16) (max0: uint16) = RangeTestsHelpers.unsigned min0 max0 + + [] + let ``Range.Int32`` min0 max0 = RangeTestsHelpers.signed min0 max0 + + [] + let ``Range.UInt32`` (min0: uint) (max0: uint) = RangeTestsHelpers.unsigned min0 max0 + + [] + let ``Range.Int64`` (min0: int64) (max0: int64) = RangeTestsHelpers.signed min0 max0 + + [] + let ``Range.UInt64`` (min0: uint64) (max0: uint64) = RangeTestsHelpers.unsigned min0 max0 + + [] + let ``Range.IntPtr`` () = + if System.IntPtr.Size >= 4 then RangeTestsHelpers.signed (System.IntPtr System.Int32.MinValue) (System.IntPtr System.Int32.MaxValue) + if System.IntPtr.Size >= 8 then RangeTestsHelpers.signed (System.IntPtr System.Int64.MinValue) (System.IntPtr System.Int64.MaxValue) + + [] + let ``Range.UIntPtr`` () = + if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt32.MinValue) (System.UIntPtr System.UInt32.MaxValue) + if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) open NonStructuralComparison diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index ac29ca97c08..0d9d3485621 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -134,28 +134,26 @@ module Int32 = IL_000c: stloc.1 IL_000d: ldc.i4.1 IL_000e: stloc.2 - IL_000f: br.s IL_0021 + IL_000f: br.s IL_001d IL_0011: ldloc.0 IL_0012: ldloc.1 IL_0013: ldloc.2 - IL_0014: stelem [runtime]System.Int32 - IL_0019: ldloc.2 + IL_0014: stelem.i4 + IL_0015: ldloc.2 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.2 + IL_0019: ldloc.1 IL_001a: ldc.i4.1 IL_001b: add - IL_001c: stloc.2 + IL_001c: stloc.1 IL_001d: ldloc.1 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.1 - IL_0021: ldloc.1 - IL_0022: ldloc.0 - IL_0023: ldlen - IL_0024: conv.i4 - IL_0025: blt.s IL_0011 + IL_001e: ldc.i4 0x101 + IL_0023: blt.un.s IL_0011 - IL_0027: ldloc.0 - IL_0028: ret + IL_0025: ldloc.0 + IL_0026: ret } } @@ -219,52 +217,65 @@ module Int32 = .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, + .locals init (uint64 V_0, int32[] V_1, - int32 V_2, + uint64 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: sub - IL_0003: ldc.i4.1 - IL_0004: add - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.1 - IL_0008: bge.s IL_0010 - - IL_000a: call !!0[] [runtime]System.Array::Empty() - IL_000f: ret - - IL_0010: ldloc.0 - IL_0011: newarr [runtime]System.Int32 - IL_0016: stloc.1 - IL_0017: ldc.i4.0 - IL_0018: stloc.2 - IL_0019: ldarg.0 - IL_001a: stloc.3 - IL_001b: br.s IL_002d + IL_0002: bge.s IL_0008 - IL_001d: ldloc.1 - IL_001e: ldloc.2 - IL_001f: ldloc.3 - IL_0020: stelem [runtime]System.Int32 - IL_0025: ldloc.3 - IL_0026: ldc.i4.1 - IL_0027: add - IL_0028: stloc.3 - IL_0029: ldloc.2 - IL_002a: ldc.i4.1 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.2 - IL_002e: ldloc.1 - IL_002f: ldlen - IL_0030: conv.i4 - IL_0031: blt.s IL_001d - - IL_0033: ldloc.1 - IL_0034: ret + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i8 + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: stloc.0 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: bge.un.s IL_001b + + IL_0015: call !!0[] [runtime]System.Array::Empty() + IL_001a: ret + + IL_001b: ldloc.0 + IL_001c: conv.ovf.i.un + IL_001d: newarr [runtime]System.Int32 + IL_0022: stloc.1 + IL_0023: ldc.i4.0 + IL_0024: conv.i8 + IL_0025: stloc.2 + IL_0026: ldarg.0 + IL_0027: stloc.3 + IL_0028: br.s IL_0038 + + IL_002a: ldloc.1 + IL_002b: ldloc.2 + IL_002c: conv.ovf.i.un + IL_002d: ldloc.3 + IL_002e: stelem.i4 + IL_002f: ldloc.3 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.3 + IL_0033: ldloc.2 + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: add + IL_0037: stloc.2 + IL_0038: ldloc.2 + IL_0039: ldloc.0 + IL_003a: blt.un.s IL_002a + + IL_003c: ldloc.1 + IL_003d: ret } } @@ -277,7 +288,7 @@ module Int32 = ])) [] - let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], """ module Test @@ -353,9 +364,9 @@ module Int32 = .maxstack 5 .locals init (int32 V_0, int32 V_1, - int32 V_2, + uint64 V_2, int32[] V_3, - int32 V_4, + uint64 V_4, int32 V_5) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -369,46 +380,59 @@ module Int32 = IL_0013: stloc.1 IL_0014: ldloc.1 IL_0015: ldloc.0 - IL_0016: sub - IL_0017: ldc.i4.1 - IL_0018: add - IL_0019: stloc.2 - IL_001a: ldloc.2 - IL_001b: ldc.i4.1 - IL_001c: bge.s IL_0024 - - IL_001e: call !!0[] [runtime]System.Array::Empty() - IL_0023: ret - - IL_0024: ldloc.2 - IL_0025: newarr [runtime]System.Int32 - IL_002a: stloc.3 - IL_002b: ldc.i4.0 - IL_002c: stloc.s V_4 - IL_002e: ldloc.0 - IL_002f: stloc.s V_5 - IL_0031: br.s IL_0049 - - IL_0033: ldloc.3 - IL_0034: ldloc.s V_4 - IL_0036: ldloc.s V_5 - IL_0038: stelem [runtime]System.Int32 - IL_003d: ldloc.s V_5 - IL_003f: ldc.i4.1 - IL_0040: add - IL_0041: stloc.s V_5 - IL_0043: ldloc.s V_4 - IL_0045: ldc.i4.1 - IL_0046: add - IL_0047: stloc.s V_4 - IL_0049: ldloc.s V_4 - IL_004b: ldloc.3 - IL_004c: ldlen - IL_004d: conv.i4 - IL_004e: blt.s IL_0033 - - IL_0050: ldloc.3 - IL_0051: ret + IL_0016: bge.s IL_001c + + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: br.s IL_0024 + + IL_001c: ldloc.1 + IL_001d: conv.i8 + IL_001e: ldloc.0 + IL_001f: conv.i8 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldc.i4.1 + IL_0027: bge.un.s IL_002f + + IL_0029: call !!0[] [runtime]System.Array::Empty() + IL_002e: ret + + IL_002f: ldloc.2 + IL_0030: conv.ovf.i.un + IL_0031: newarr [runtime]System.Int32 + IL_0036: stloc.3 + IL_0037: ldc.i4.0 + IL_0038: conv.i8 + IL_0039: stloc.s V_4 + IL_003b: ldloc.0 + IL_003c: stloc.s V_5 + IL_003e: br.s IL_0054 + + IL_0040: ldloc.3 + IL_0041: ldloc.s V_4 + IL_0043: conv.ovf.i.un + IL_0044: ldloc.s V_5 + IL_0046: stelem.i4 + IL_0047: ldloc.s V_5 + IL_0049: ldc.i4.1 + IL_004a: add + IL_004b: stloc.s V_5 + IL_004d: ldloc.s V_4 + IL_004f: ldc.i4.1 + IL_0050: conv.i8 + IL_0051: add + IL_0052: stloc.s V_4 + IL_0054: ldloc.s V_4 + IL_0056: ldloc.2 + IL_0057: blt.un.s IL_0040 + + IL_0059: ldloc.3 + IL_005a: ret } } @@ -545,28 +569,26 @@ module Int32 = IL_000c: stloc.1 IL_000d: ldc.i4.1 IL_000e: stloc.2 - IL_000f: br.s IL_0021 + IL_000f: br.s IL_001d IL_0011: ldloc.0 IL_0012: ldloc.1 IL_0013: ldloc.2 - IL_0014: stelem [runtime]System.Int32 - IL_0019: ldloc.2 - IL_001a: ldc.i4.2 + IL_0014: stelem.i4 + IL_0015: ldloc.2 + IL_0016: ldc.i4.2 + IL_0017: add + IL_0018: stloc.2 + IL_0019: ldloc.1 + IL_001a: ldc.i4.1 IL_001b: add - IL_001c: stloc.2 + IL_001c: stloc.1 IL_001d: ldloc.1 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.1 - IL_0021: ldloc.1 - IL_0022: ldloc.0 - IL_0023: ldlen - IL_0024: conv.i4 - IL_0025: blt.s IL_0011 + IL_001e: ldc.i4 0x81 + IL_0023: blt.un.s IL_0011 - IL_0027: ldloc.0 - IL_0028: ret + IL_0025: ldloc.0 + IL_0026: ret } } @@ -632,9 +654,9 @@ module Int32 = 00 00 00 00 ) .maxstack 5 - .locals init (int32 V_0, + .locals init (uint64 V_0, int32[] V_1, - int32 V_2, + uint64 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000e @@ -648,50 +670,99 @@ module Int32 = IL_000b: pop IL_000c: br.s IL_000e - IL_000e: ldarg.2 - IL_000f: ldarg.0 - IL_0010: sub - IL_0011: ldarg.1 - IL_0012: div - IL_0013: ldc.i4.1 - IL_0014: add - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: ldc.i4.1 - IL_0018: bge.s IL_0020 - - IL_001a: call !!0[] [runtime]System.Array::Empty() - IL_001f: ret - - IL_0020: ldloc.0 - IL_0021: newarr [runtime]System.Int32 - IL_0026: stloc.1 - IL_0027: ldc.i4.0 - IL_0028: stloc.2 - IL_0029: ldarg.0 - IL_002a: stloc.3 - IL_002b: br.s IL_003d - - IL_002d: ldloc.1 - IL_002e: ldloc.2 - IL_002f: ldloc.3 - IL_0030: stelem [runtime]System.Int32 - IL_0035: ldloc.3 - IL_0036: ldarg.1 - IL_0037: add - IL_0038: stloc.3 - IL_0039: ldloc.2 - IL_003a: ldc.i4.1 - IL_003b: add - IL_003c: stloc.2 - IL_003d: ldloc.2 - IL_003e: ldloc.1 - IL_003f: ldlen - IL_0040: conv.i4 - IL_0041: blt.s IL_002d - - IL_0043: ldloc.1 - IL_0044: ret + IL_000e: ldc.i4.0 + IL_000f: ldarg.1 + IL_0010: bge.s IL_0027 + + IL_0012: ldarg.2 + IL_0013: ldarg.0 + IL_0014: bge.s IL_001a + + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: br.s IL_004c + + IL_001a: ldarg.2 + IL_001b: conv.i8 + IL_001c: ldarg.0 + IL_001d: conv.i8 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: conv.i8 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add + IL_0025: br.s IL_004c + + IL_0027: ldarg.0 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f + + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: br.s IL_004c + + IL_002f: ldarg.0 + IL_0030: conv.i8 + IL_0031: ldarg.2 + IL_0032: conv.i8 + IL_0033: sub + IL_0034: ldarg.1 + IL_0035: ldc.i4 0x80000000 + IL_003a: bne.un.s IL_0044 + + IL_003c: ldc.i4 0x80000000 + IL_0041: conv.u8 + IL_0042: br.s IL_0047 + + IL_0044: ldarg.1 + IL_0045: neg + IL_0046: conv.i8 + IL_0047: conv.i8 + IL_0048: div.un + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: ldc.i4.1 + IL_004f: bge.un.s IL_0057 + + IL_0051: call !!0[] [runtime]System.Array::Empty() + IL_0056: ret + + IL_0057: ldloc.0 + IL_0058: conv.ovf.i.un + IL_0059: newarr [runtime]System.Int32 + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.2 + IL_0062: ldarg.0 + IL_0063: stloc.3 + IL_0064: br.s IL_0074 + + IL_0066: ldloc.1 + IL_0067: ldloc.2 + IL_0068: conv.ovf.i.un + IL_0069: ldloc.3 + IL_006a: stelem.i4 + IL_006b: ldloc.3 + IL_006c: ldarg.1 + IL_006d: add + IL_006e: stloc.3 + IL_006f: ldloc.2 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.2 + IL_0074: ldloc.2 + IL_0075: ldloc.0 + IL_0076: blt.un.s IL_0066 + + IL_0078: ldloc.1 + IL_0079: ret } } @@ -704,7 +775,7 @@ module Int32 = ])) [] - let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], """ module Test @@ -793,9 +864,9 @@ module Int32 = .locals init (int32 V_0, int32 V_1, int32 V_2, - int32 V_3, + uint64 V_3, int32[] V_4, - int32 V_5, + uint64 V_5, int32 V_6) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -824,50 +895,99 @@ module Int32 = IL_002c: pop IL_002d: br.s IL_002f - IL_002f: ldloc.2 - IL_0030: ldloc.0 - IL_0031: sub - IL_0032: ldloc.1 - IL_0033: div - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.3 - IL_0037: ldloc.3 - IL_0038: ldc.i4.1 - IL_0039: bge.s IL_0041 - - IL_003b: call !!0[] [runtime]System.Array::Empty() - IL_0040: ret - - IL_0041: ldloc.3 - IL_0042: newarr [runtime]System.Int32 - IL_0047: stloc.s V_4 - IL_0049: ldc.i4.0 - IL_004a: stloc.s V_5 - IL_004c: ldloc.0 - IL_004d: stloc.s V_6 - IL_004f: br.s IL_0068 - - IL_0051: ldloc.s V_4 - IL_0053: ldloc.s V_5 - IL_0055: ldloc.s V_6 - IL_0057: stelem [runtime]System.Int32 - IL_005c: ldloc.s V_6 - IL_005e: ldloc.1 - IL_005f: add - IL_0060: stloc.s V_6 - IL_0062: ldloc.s V_5 - IL_0064: ldc.i4.1 - IL_0065: add - IL_0066: stloc.s V_5 - IL_0068: ldloc.s V_5 - IL_006a: ldloc.s V_4 - IL_006c: ldlen - IL_006d: conv.i4 - IL_006e: blt.s IL_0051 - - IL_0070: ldloc.s V_4 - IL_0072: ret + IL_002f: ldc.i4.0 + IL_0030: ldloc.1 + IL_0031: bge.s IL_0048 + + IL_0033: ldloc.2 + IL_0034: ldloc.0 + IL_0035: bge.s IL_003b + + IL_0037: ldc.i4.0 + IL_0038: conv.i8 + IL_0039: br.s IL_006d + + IL_003b: ldloc.2 + IL_003c: conv.i8 + IL_003d: ldloc.0 + IL_003e: conv.i8 + IL_003f: sub + IL_0040: ldloc.1 + IL_0041: conv.i8 + IL_0042: div.un + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: br.s IL_006d + + IL_0048: ldloc.0 + IL_0049: ldloc.2 + IL_004a: bge.s IL_0050 + + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: br.s IL_006d + + IL_0050: ldloc.0 + IL_0051: conv.i8 + IL_0052: ldloc.2 + IL_0053: conv.i8 + IL_0054: sub + IL_0055: ldloc.1 + IL_0056: ldc.i4 0x80000000 + IL_005b: bne.un.s IL_0065 + + IL_005d: ldc.i4 0x80000000 + IL_0062: conv.u8 + IL_0063: br.s IL_0068 + + IL_0065: ldloc.1 + IL_0066: neg + IL_0067: conv.i8 + IL_0068: conv.i8 + IL_0069: div.un + IL_006a: ldc.i4.1 + IL_006b: conv.i8 + IL_006c: add + IL_006d: stloc.3 + IL_006e: ldloc.3 + IL_006f: ldc.i4.1 + IL_0070: bge.un.s IL_0078 + + IL_0072: call !!0[] [runtime]System.Array::Empty() + IL_0077: ret + + IL_0078: ldloc.3 + IL_0079: conv.ovf.i.un + IL_007a: newarr [runtime]System.Int32 + IL_007f: stloc.s V_4 + IL_0081: ldc.i4.0 + IL_0082: conv.i8 + IL_0083: stloc.s V_5 + IL_0085: ldloc.0 + IL_0086: stloc.s V_6 + IL_0088: br.s IL_009f + + IL_008a: ldloc.s V_4 + IL_008c: ldloc.s V_5 + IL_008e: conv.ovf.i.un + IL_008f: ldloc.s V_6 + IL_0091: stelem.i4 + IL_0092: ldloc.s V_6 + IL_0094: ldloc.1 + IL_0095: add + IL_0096: stloc.s V_6 + IL_0098: ldloc.s V_5 + IL_009a: ldc.i4.1 + IL_009b: conv.i8 + IL_009c: add + IL_009d: stloc.s V_5 + IL_009f: ldloc.s V_5 + IL_00a1: ldloc.3 + IL_00a2: blt.un.s IL_008a + + IL_00a4: ldloc.s V_4 + IL_00a6: ret } } @@ -999,44 +1119,32 @@ module Int32 = .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - int32 V_1) - IL_0000: ldc.i4.1 + int32 V_1, + int32 V_2) + IL_0000: ldc.i4.0 IL_0001: stloc.1 IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0012 + IL_0003: stloc.2 + IL_0004: br.s IL_0016 IL_0006: ldloca.s V_0 - IL_0008: ldloc.1 + IL_0008: ldloc.2 IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_000e: ldloc.1 + IL_000e: ldloc.2 IL_000f: ldc.i4.1 IL_0010: add - IL_0011: stloc.1 + IL_0011: stloc.2 IL_0012: ldloc.1 - IL_0013: ldc.i4.s 101 - IL_0015: bge.s IL_0024 - - IL_0017: ldc.i4.1 - IL_0018: ldloc.1 - IL_0019: bge.s IL_001e - - IL_001b: ldc.i4.1 - IL_001c: br.s IL_0029 - - IL_001e: ldc.i4.1 - IL_001f: ldloc.1 - IL_0020: ceq - IL_0022: br.s IL_0029 - - IL_0024: ldloc.1 - IL_0025: ldc.i4.s 101 - IL_0027: ceq - IL_0029: brtrue.s IL_0006 - - IL_002b: ldloca.s V_0 - IL_002d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0032: ret + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.s 101 + IL_0019: blt.un.s IL_0006 + + IL_001b: ldloca.s V_0 + IL_001d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0022: ret } } @@ -1101,51 +1209,60 @@ module Int32 = .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 (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - int32 V_1) - IL_0000: ldarg.0 - IL_0001: stloc.1 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: ldarg.1 - IL_0005: ldloc.1 - IL_0006: bge.s IL_000a - - IL_0008: br.s IL_002f - - IL_000a: br.s IL_0018 - - IL_000c: ldloca.s V_0 - IL_000e: ldloc.1 - IL_000f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0014: ldloc.1 - IL_0015: ldc.i4.1 - IL_0016: add - IL_0017: stloc.1 - IL_0018: ldloc.1 - IL_0019: ldarg.1 - IL_001a: bge.s IL_0029 - - IL_001c: ldarg.0 - IL_001d: ldloc.1 - IL_001e: bge.s IL_0023 - - IL_0020: ldc.i4.1 - IL_0021: br.s IL_002d - - IL_0023: ldarg.0 - IL_0024: ldloc.1 - IL_0025: ceq - IL_0027: br.s IL_002d + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 - IL_0029: ldloc.1 - IL_002a: ldarg.1 - IL_002b: ceq - IL_002d: brtrue.s IL_000c + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: br.s IL_0010 - IL_002f: ldloca.s V_0 - IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0036: ret + IL_0008: ldarg.1 + IL_0009: conv.i8 + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: stloc.0 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: bge.un.s IL_001b + + IL_0015: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_001a: ret + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.2 + IL_001e: ldarg.0 + IL_001f: stloc.3 + IL_0020: br.s IL_0033 + + IL_0022: ldloca.s V_1 + IL_0024: ldloc.3 + IL_0025: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002a: ldloc.3 + IL_002b: ldc.i4.1 + IL_002c: add + IL_002d: stloc.3 + IL_002e: ldloc.2 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: ldloc.0 + IL_0035: blt.un.s IL_0022 + + IL_0037: ldloca.s V_1 + IL_0039: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003e: ret } } @@ -1158,7 +1275,7 @@ module Int32 = ])) [] - let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], """ module Test @@ -1235,8 +1352,10 @@ module Int32 = .maxstack 4 .locals init (int32 V_0, int32 V_1, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - int32 V_3) + uint64 V_2, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, + uint64 V_4, + int32 V_5) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) IL_0007: ldlen @@ -1247,49 +1366,56 @@ module Int32 = IL_0011: ldlen IL_0012: conv.i4 IL_0013: stloc.1 - IL_0014: ldloc.0 - IL_0015: stloc.3 - IL_0016: ldloc.0 - IL_0017: stloc.3 - IL_0018: ldloc.1 - IL_0019: ldloc.3 - IL_001a: bge.s IL_001e - - IL_001c: br.s IL_0043 - - IL_001e: br.s IL_002c - - IL_0020: ldloca.s V_2 - IL_0022: ldloc.3 - IL_0023: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0028: ldloc.3 - IL_0029: ldc.i4.1 - IL_002a: add - IL_002b: stloc.3 - IL_002c: ldloc.3 - IL_002d: ldloc.1 - IL_002e: bge.s IL_003d - - IL_0030: ldloc.0 - IL_0031: ldloc.3 - IL_0032: bge.s IL_0037 - - IL_0034: ldc.i4.1 - IL_0035: br.s IL_0041 + IL_0014: ldloc.1 + IL_0015: ldloc.0 + IL_0016: bge.s IL_001c - IL_0037: ldloc.0 - IL_0038: ldloc.3 - IL_0039: ceq - IL_003b: br.s IL_0041 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: br.s IL_0024 - IL_003d: ldloc.3 - IL_003e: ldloc.1 - IL_003f: ceq - IL_0041: brtrue.s IL_0020 + IL_001c: ldloc.1 + IL_001d: conv.i8 + IL_001e: ldloc.0 + IL_001f: conv.i8 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldc.i4.1 + IL_0027: bge.un.s IL_002f + + IL_0029: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_002e: ret + + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: stloc.s V_4 + IL_0033: ldloc.0 + IL_0034: stloc.s V_5 + IL_0036: br.s IL_004e + + IL_0038: ldloca.s V_3 + IL_003a: ldloc.s V_5 + IL_003c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: add + IL_0045: stloc.s V_5 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.s V_4 + IL_0050: ldloc.2 + IL_0051: blt.un.s IL_0038 - IL_0043: ldloca.s V_2 - IL_0045: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004a: ret + IL_0053: ldloca.s V_3 + IL_0055: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_005a: ret } } @@ -1419,44 +1545,32 @@ module Int32 = .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - int32 V_1) - IL_0000: ldc.i4.1 + int32 V_1, + int32 V_2) + IL_0000: ldc.i4.0 IL_0001: stloc.1 IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0012 + IL_0003: stloc.2 + IL_0004: br.s IL_0016 IL_0006: ldloca.s V_0 - IL_0008: ldloc.1 + IL_0008: ldloc.2 IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_000e: ldloc.1 + IL_000e: ldloc.2 IL_000f: ldc.i4.2 IL_0010: add - IL_0011: stloc.1 + IL_0011: stloc.2 IL_0012: ldloc.1 - IL_0013: ldc.i4 0x101 - IL_0018: bge.s IL_0027 - - IL_001a: ldc.i4.1 - IL_001b: ldloc.1 - IL_001c: bge.s IL_0021 - - IL_001e: ldc.i4.1 - IL_001f: br.s IL_002f - - IL_0021: ldc.i4.1 - IL_0022: ldloc.1 - IL_0023: ceq - IL_0025: br.s IL_002f - - IL_0027: ldloc.1 - IL_0028: ldc.i4 0x101 - IL_002d: ceq - IL_002f: brtrue.s IL_0006 - - IL_0031: ldloca.s V_0 - IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0038: ret + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4 0x81 + IL_001c: blt.un.s IL_0006 + + IL_001e: ldloca.s V_0 + IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0025: ret } } @@ -1523,93 +1637,110 @@ module Int32 = 00 00 00 00 ) .maxstack 5 - .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - int32 V_1) - IL_0000: ldarg.0 - IL_0001: stloc.1 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: ldarg.1 - IL_0005: brtrue.s IL_0012 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000e - IL_0007: ldloc.1 - IL_0008: ldarg.1 - IL_0009: ldarg.2 - IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + IL_0003: ldarg.0 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_000f: pop - IL_0010: br.s IL_0062 + IL_000b: pop + IL_000c: br.s IL_000e - IL_0012: ldc.i4.0 - IL_0013: ldarg.1 - IL_0014: bge.s IL_003d + IL_000e: ldc.i4.0 + IL_000f: ldarg.1 + IL_0010: bge.s IL_0027 - IL_0016: br.s IL_0024 + IL_0012: ldarg.2 + IL_0013: ldarg.0 + IL_0014: bge.s IL_001a - IL_0018: ldloca.s V_0 - IL_001a: ldloc.1 - IL_001b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0020: ldloc.1 - IL_0021: ldarg.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldarg.2 - IL_0026: bge.s IL_0035 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: br.s IL_004c - IL_0028: ldarg.0 - IL_0029: ldloc.1 - IL_002a: bge.s IL_002f + IL_001a: ldarg.2 + IL_001b: conv.i8 + IL_001c: ldarg.0 + IL_001d: conv.i8 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: conv.i8 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add + IL_0025: br.s IL_004c + + IL_0027: ldarg.0 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f - IL_002c: ldc.i4.1 - IL_002d: br.s IL_0039 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: br.s IL_004c IL_002f: ldarg.0 - IL_0030: ldloc.1 - IL_0031: ceq - IL_0033: br.s IL_0039 - - IL_0035: ldloc.1 - IL_0036: ldarg.2 - IL_0037: ceq - IL_0039: brtrue.s IL_0018 - - IL_003b: br.s IL_0062 - - IL_003d: br.s IL_004b - - IL_003f: ldloca.s V_0 - IL_0041: ldloc.1 - IL_0042: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0047: ldloc.1 - IL_0048: ldarg.1 - IL_0049: add - IL_004a: stloc.1 - IL_004b: ldarg.2 - IL_004c: ldloc.1 - IL_004d: bge.s IL_005c - - IL_004f: ldloc.1 - IL_0050: ldarg.0 - IL_0051: bge.s IL_0056 - - IL_0053: ldc.i4.1 - IL_0054: br.s IL_0060 - - IL_0056: ldloc.1 - IL_0057: ldarg.0 - IL_0058: ceq - IL_005a: br.s IL_0060 - - IL_005c: ldarg.2 - IL_005d: ldloc.1 - IL_005e: ceq - IL_0060: brtrue.s IL_003f - - IL_0062: ldloca.s V_0 - 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 + IL_0030: conv.i8 + IL_0031: ldarg.2 + IL_0032: conv.i8 + IL_0033: sub + IL_0034: ldarg.1 + IL_0035: ldc.i4 0x80000000 + IL_003a: bne.un.s IL_0044 + + IL_003c: ldc.i4 0x80000000 + IL_0041: conv.u8 + IL_0042: br.s IL_0047 + + IL_0044: ldarg.1 + IL_0045: neg + IL_0046: conv.i8 + IL_0047: conv.i8 + IL_0048: div.un + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: ldc.i4.1 + IL_004f: bge.un.s IL_0057 + + IL_0051: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0056: ret + + IL_0057: ldc.i4.0 + IL_0058: conv.i8 + IL_0059: stloc.2 + IL_005a: ldarg.0 + IL_005b: stloc.3 + IL_005c: br.s IL_006f + + IL_005e: ldloca.s V_1 + IL_0060: ldloc.3 + IL_0061: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0066: ldloc.3 + IL_0067: ldarg.1 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.2 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.2 + IL_006f: ldloc.2 + IL_0070: ldloc.0 + IL_0071: blt.un.s IL_005e + + IL_0073: ldloca.s V_1 + IL_0075: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_007a: ret } } @@ -1622,7 +1753,7 @@ module Int32 = ])) [] - let ``Lone RangeInt32 with dynamic args that are complex exprs stores those in vars before init loop`` () = + let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], """ module Test @@ -1712,8 +1843,10 @@ module Int32 = .locals init (int32 V_0, int32 V_1, int32 V_2, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, - int32 V_4) + uint64 V_3, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, + uint64 V_5, + int32 V_6) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) IL_0007: ldlen @@ -1729,91 +1862,106 @@ module Int32 = IL_001e: ldlen IL_001f: conv.i4 IL_0020: stloc.2 - IL_0021: ldloc.0 - IL_0022: stloc.s V_4 + IL_0021: ldloc.1 + IL_0022: brtrue.s IL_002f + IL_0024: ldloc.0 - IL_0025: stloc.s V_4 - IL_0027: ldloc.1 - IL_0028: brtrue.s IL_0039 - - IL_002a: ldloc.s V_4 - IL_002c: ldloc.1 - IL_002d: ldloc.2 - IL_002e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + IL_0025: ldloc.1 + IL_0026: ldloc.2 + IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_0033: pop - IL_0034: br IL_0097 - - IL_0039: ldc.i4.0 - IL_003a: ldloc.1 - IL_003b: bge.s IL_006b - - IL_003d: br.s IL_004e - - IL_003f: ldloca.s V_3 - IL_0041: ldloc.s V_4 - IL_0043: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0048: ldloc.s V_4 - IL_004a: ldloc.1 - IL_004b: add - IL_004c: stloc.s V_4 - IL_004e: ldloc.s V_4 - IL_0050: ldloc.2 - IL_0051: bge.s IL_0062 - - IL_0053: ldloc.0 - IL_0054: ldloc.s V_4 - IL_0056: bge.s IL_005b - - IL_0058: ldc.i4.1 - IL_0059: br.s IL_0067 - - IL_005b: ldloc.0 - IL_005c: ldloc.s V_4 - IL_005e: ceq - IL_0060: br.s IL_0067 - - IL_0062: ldloc.s V_4 - IL_0064: ldloc.2 - IL_0065: ceq - IL_0067: brtrue.s IL_003f - - IL_0069: br.s IL_0097 - - IL_006b: br.s IL_007c + IL_002c: pop + IL_002d: br.s IL_002f - IL_006d: ldloca.s V_3 - IL_006f: ldloc.s V_4 - IL_0071: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0076: ldloc.s V_4 - IL_0078: ldloc.1 - IL_0079: add - IL_007a: stloc.s V_4 - IL_007c: ldloc.2 - IL_007d: ldloc.s V_4 - IL_007f: bge.s IL_0090 - - IL_0081: ldloc.s V_4 - IL_0083: ldloc.0 - IL_0084: bge.s IL_0089 - - IL_0086: ldc.i4.1 - IL_0087: br.s IL_0095 - - IL_0089: ldloc.s V_4 - IL_008b: ldloc.0 - IL_008c: ceq - IL_008e: br.s IL_0095 - - IL_0090: ldloc.2 - IL_0091: ldloc.s V_4 - IL_0093: ceq - IL_0095: brtrue.s IL_006d - - IL_0097: ldloca.s V_3 - IL_0099: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_009e: ret + IL_002f: ldc.i4.0 + IL_0030: ldloc.1 + IL_0031: bge.s IL_0048 + + IL_0033: ldloc.2 + IL_0034: ldloc.0 + IL_0035: bge.s IL_003b + + IL_0037: ldc.i4.0 + IL_0038: conv.i8 + IL_0039: br.s IL_006d + + IL_003b: ldloc.2 + IL_003c: conv.i8 + IL_003d: ldloc.0 + IL_003e: conv.i8 + IL_003f: sub + IL_0040: ldloc.1 + IL_0041: conv.i8 + IL_0042: div.un + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: br.s IL_006d + + IL_0048: ldloc.0 + IL_0049: ldloc.2 + IL_004a: bge.s IL_0050 + + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: br.s IL_006d + + IL_0050: ldloc.0 + IL_0051: conv.i8 + IL_0052: ldloc.2 + IL_0053: conv.i8 + IL_0054: sub + IL_0055: ldloc.1 + IL_0056: ldc.i4 0x80000000 + IL_005b: bne.un.s IL_0065 + + IL_005d: ldc.i4 0x80000000 + IL_0062: conv.u8 + IL_0063: br.s IL_0068 + + IL_0065: ldloc.1 + IL_0066: neg + IL_0067: conv.i8 + IL_0068: conv.i8 + IL_0069: div.un + IL_006a: ldc.i4.1 + IL_006b: conv.i8 + IL_006c: add + IL_006d: stloc.3 + IL_006e: ldloc.3 + IL_006f: ldc.i4.1 + IL_0070: bge.un.s IL_0078 + + IL_0072: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0077: ret + + IL_0078: ldc.i4.0 + IL_0079: conv.i8 + IL_007a: stloc.s V_5 + IL_007c: ldloc.0 + IL_007d: stloc.s V_6 + IL_007f: br.s IL_0097 + + IL_0081: ldloca.s V_4 + IL_0083: ldloc.s V_6 + IL_0085: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_008a: ldloc.s V_6 + IL_008c: ldloc.1 + IL_008d: add + IL_008e: stloc.s V_6 + IL_0090: ldloc.s V_5 + IL_0092: ldc.i4.1 + IL_0093: conv.i8 + IL_0094: add + IL_0095: stloc.s V_5 + IL_0097: ldloc.s V_5 + IL_0099: ldloc.3 + IL_009a: blt.un.s IL_0081 + + IL_009c: ldloca.s V_4 + IL_009e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00a3: ret } } From 5c49febb3dd20fc46333cd70d51dac219e30f7c5 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 12 Feb 2024 23:14:18 -0500 Subject: [PATCH 12/66] Add missing detail to comment --- src/Compiler/TypedTree/TypedTreeOps.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index e8d7913fedb..952209ec557 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10469,9 +10469,9 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // if step = 0 then // ignore ((.. ..) start step finish) // Throws. // if 0 < step then - // if finish < start then 0 else (finish - start) / step + 1 + // if finish < start then 0 else unsigned (finish - start) / unsigned step + 1 // else // step < 0 - // if start < finish then 0 else (finish - start) / step + 1 + // if start < finish then 0 else unsigned (start - finish) / unsigned (abs step) + 1 | _, _, _ -> // Let the range call throw the appropriate localized // exception at runtime if step is zero: From f8a2b6f3a7e06e3ef748381bf5dd00ee10d5733a Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 12 Feb 2024 23:26:18 -0500 Subject: [PATCH 13/66] Don't need to expose that --- src/Compiler/TypedTree/TypedTreeOps.fsi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index addc9816304..87ab6717362 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2560,11 +2560,6 @@ module IntegralConst = [] val (|Zero|_|): c: Const -> unit voption -/// Matches if the given start, step, and finish represent -/// a range that is known to be empty at compile-time. -[] -val (|EmptyRange|_|): start: Expr * step: Expr * finish: Expr -> unit voption - type Count = Expr type Idx = Expr type Elem = Expr From ff1d3dbaab6e4aefd44eb2ca0a8a8fcc36062ec1 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 13:15:19 -0500 Subject: [PATCH 14/66] Remove bad & unneeded comparison --- .../Optimize/LowerComputedCollections.fs | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 9f1d1f36daf..7af88cb3e82 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -285,28 +285,7 @@ module List = mkListInit mkLoop | _dynamicCount -> - let countTy = tyOfExpr g count - - // count < 1 - let countLtOne = - if isSignedIntegerTy g countTy then - mkILAsmClt g m count (mkOne g m) - else - mkAsmExpr ([AI_clt_un], [], [count; mkOne g m], [g.bool_ty], m) - - // if count < 1 then - // [] - // else - // let collector = ListCollector () in - // - // collector.Close () - mkCond - DebugPointAtBinding.NoneAtInvisible - m - (mkListTy g overallElemTy) - countLtOne - (mkNil g m overallElemTy) - (mkListInit mkLoop) + mkListInit mkLoop ) module Array = From e419414dddfc172810a7c9490de4b5cebd9160a5 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 13:16:52 -0500 Subject: [PATCH 15/66] Comments --- src/Compiler/Optimize/LowerComputedCollections.fs | 3 +-- src/Compiler/TypedTree/TypedTreeOps.fs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 7af88cb3e82..e77a4d16dce 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -364,8 +364,7 @@ module Array = // if count < 1 then // [||] // else - // let array = (# "newarr !0" type ('T) count : 'T array #) - // in + // let array = (# "newarr !0" type ('T) count : 'T array #) in // // array mkCond diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 952209ec557..4557436227a 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10235,7 +10235,6 @@ let (|EmptyRange|_|) (start, step, finish) = [] let (|ConstCount|_|) (start, step, finish) = match start, step, finish with - // This will cause an overflow exception to be raised at runtime, which we need for parity with the library implementation. | Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 1L), Expr.Const (value = Const.Int64 Int64.MaxValue) | Expr.Const (value = Const.Int64 Int64.MaxValue), Expr.Const (value = Const.Int64 -1L), Expr.Const (value = Const.Int64 Int64.MinValue) | Expr.Const (value = Const.UInt64 UInt64.MinValue), Expr.Const (value = Const.UInt64 1UL), Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> ValueSome (Const.UInt64 UInt64.MaxValue) From 89c69030942e04c613170ab7da7e7d1d11b46194 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 13:17:06 -0500 Subject: [PATCH 16/66] Better ranges --- src/Compiler/TypedTree/TypedTreeOps.fs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 4557436227a..1c058c4bef3 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10590,36 +10590,36 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, f start step finish | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), _ -> - mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> f start step finish) | _, (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> f start step finish) | (Expr.Const _ | Expr.Val _), _, (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> f start step finish) | _, (Expr.Const _ | Expr.Val _), _ -> - mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> - mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> f start step finish)) | (Expr.Const _ | Expr.Val _), _, _ -> - mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> - mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> f start step finish)) | _, _, (Expr.Const _ | Expr.Val _) -> - mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> - mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> f start step finish)) | _, _, _ -> - mkCompGenLetIn mIn (nameof start) rangeTy start (fun (_, start) -> - mkCompGenLetIn mIn (nameof step) rangeTy step (fun (_, step) -> - mkCompGenLetIn mIn (nameof finish) rangeTy finish (fun (_, finish) -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> f start step finish))) mkLetBindingsIfNeeded (fun start step finish -> From e1a315c3ff8853265770fc6154c1cf5a30cb4ff0 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 13:27:17 -0500 Subject: [PATCH 17/66] Update baselines --- ...onTrivialBranchingBindingInEnd03.fs.il.bsl | 173 ++++++------- ...ivialBranchingBindingInEnd03.fs.opt.il.bsl | 173 ++++++------- ...onTrivialBranchingBindingInEnd04.fs.il.bsl | 173 ++++++------- ...ivialBranchingBindingInEnd04.fs.opt.il.bsl | 173 ++++++------- ...putedCollectionRangeLoweringTests.Int32.fs | 242 ++++++++---------- 5 files changed, 418 insertions(+), 516 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl index cd6afe9a2c4..19cb73a18d0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -43,8 +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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -232,85 +224,76 @@ IL_005d: add IL_005e: nop IL_005f: stloc.1 - IL_0060: ldloc.1 - IL_0061: ldc.i4.1 - IL_0062: bge.un.s IL_006c - - IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0069: nop - IL_006a: br.s IL_0095 - - IL_006c: ldc.i4.0 - IL_006d: conv.i8 - IL_006e: stloc.3 - IL_006f: ldc.i4.0 - IL_0070: stloc.s V_4 - IL_0072: br.s IL_0089 - - IL_0074: ldloca.s V_2 - IL_0076: ldloc.s V_4 - IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_007d: nop - IL_007e: ldloc.s V_4 - IL_0080: ldc.i4.1 - IL_0081: add - IL_0082: stloc.s V_4 - IL_0084: ldloc.3 - IL_0085: ldc.i4.1 - IL_0086: conv.i8 - IL_0087: add - IL_0088: stloc.3 - IL_0089: ldloc.3 - IL_008a: ldloc.1 - IL_008b: blt.un.s IL_0074 - - IL_008d: ldloca.s V_2 - IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0094: nop - IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_00a9: br.s IL_00f1 - - IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00b5: stloc.0 - IL_00b6: call int32[] assembly::get_r() - IL_00bb: ldloc.0 - IL_00bc: call int32[] assembly::get_r() - IL_00c1: ldloc.0 - IL_00c2: ldelem [runtime]System.Int32 - IL_00c7: call int32[] assembly::get_w() - IL_00cc: ldloc.0 - IL_00cd: ldelem [runtime]System.Int32 - IL_00d2: add - IL_00d3: stelem [runtime]System.Int32 - IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00f6: brtrue.s IL_00ab - - IL_00f8: nop - IL_00f9: nop - IL_00fa: call int32[] assembly::get_r() - IL_00ff: ldc.i4.0 - IL_0100: ldelem [runtime]System.Int32 - IL_0105: ldc.i4.3 - IL_0106: bne.un.s IL_010c - - IL_0108: ldc.i4.0 - IL_0109: nop - IL_010a: br.s IL_010e - - IL_010c: ldc.i4.1 - IL_010d: nop - IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0113: pop - IL_0114: ret + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldc.i4.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 + IL_00fc: nop + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index cd6afe9a2c4..19cb73a18d0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -43,8 +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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -232,85 +224,76 @@ IL_005d: add IL_005e: nop IL_005f: stloc.1 - IL_0060: ldloc.1 - IL_0061: ldc.i4.1 - IL_0062: bge.un.s IL_006c - - IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0069: nop - IL_006a: br.s IL_0095 - - IL_006c: ldc.i4.0 - IL_006d: conv.i8 - IL_006e: stloc.3 - IL_006f: ldc.i4.0 - IL_0070: stloc.s V_4 - IL_0072: br.s IL_0089 - - IL_0074: ldloca.s V_2 - IL_0076: ldloc.s V_4 - IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_007d: nop - IL_007e: ldloc.s V_4 - IL_0080: ldc.i4.1 - IL_0081: add - IL_0082: stloc.s V_4 - IL_0084: ldloc.3 - IL_0085: ldc.i4.1 - IL_0086: conv.i8 - IL_0087: add - IL_0088: stloc.3 - IL_0089: ldloc.3 - IL_008a: ldloc.1 - IL_008b: blt.un.s IL_0074 - - IL_008d: ldloca.s V_2 - IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0094: nop - IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_00a9: br.s IL_00f1 - - IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00b5: stloc.0 - IL_00b6: call int32[] assembly::get_r() - IL_00bb: ldloc.0 - IL_00bc: call int32[] assembly::get_r() - IL_00c1: ldloc.0 - IL_00c2: ldelem [runtime]System.Int32 - IL_00c7: call int32[] assembly::get_w() - IL_00cc: ldloc.0 - IL_00cd: ldelem [runtime]System.Int32 - IL_00d2: add - IL_00d3: stelem [runtime]System.Int32 - IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00f6: brtrue.s IL_00ab - - IL_00f8: nop - IL_00f9: nop - IL_00fa: call int32[] assembly::get_r() - IL_00ff: ldc.i4.0 - IL_0100: ldelem [runtime]System.Int32 - IL_0105: ldc.i4.3 - IL_0106: bne.un.s IL_010c - - IL_0108: ldc.i4.0 - IL_0109: nop - IL_010a: br.s IL_010e - - IL_010c: ldc.i4.1 - IL_010d: nop - IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0113: pop - IL_0114: ret + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldc.i4.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 + IL_00fc: nop + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl index b1a13b8392c..575c04908a1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -43,8 +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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -232,85 +224,76 @@ IL_005d: add IL_005e: nop IL_005f: stloc.1 - IL_0060: ldloc.1 - IL_0061: ldc.i4.1 - IL_0062: bge.un.s IL_006c - - IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0069: nop - IL_006a: br.s IL_0095 - - IL_006c: ldc.i4.0 - IL_006d: conv.i8 - IL_006e: stloc.3 - IL_006f: ldloc.0 - IL_0070: stloc.s V_4 - IL_0072: br.s IL_0089 - - IL_0074: ldloca.s V_2 - IL_0076: ldloc.s V_4 - IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_007d: nop - IL_007e: ldloc.s V_4 - IL_0080: ldc.i4.m1 - IL_0081: add - IL_0082: stloc.s V_4 - IL_0084: ldloc.3 - IL_0085: ldc.i4.1 - IL_0086: conv.i8 - IL_0087: add - IL_0088: stloc.3 - IL_0089: ldloc.3 - IL_008a: ldloc.1 - IL_008b: blt.un.s IL_0074 - - IL_008d: ldloca.s V_2 - IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0094: nop - IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_00a9: br.s IL_00f1 - - IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00b5: stloc.0 - IL_00b6: call int32[] assembly::get_r() - IL_00bb: ldloc.0 - IL_00bc: call int32[] assembly::get_r() - IL_00c1: ldloc.0 - IL_00c2: ldelem [runtime]System.Int32 - IL_00c7: call int32[] assembly::get_w() - IL_00cc: ldloc.0 - IL_00cd: ldelem [runtime]System.Int32 - IL_00d2: add - IL_00d3: stelem [runtime]System.Int32 - IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00f6: brtrue.s IL_00ab - - IL_00f8: nop - IL_00f9: nop - IL_00fa: call int32[] assembly::get_r() - IL_00ff: ldc.i4.0 - IL_0100: ldelem [runtime]System.Int32 - IL_0105: ldc.i4.3 - IL_0106: bne.un.s IL_010c - - IL_0108: ldc.i4.0 - IL_0109: nop - IL_010a: br.s IL_010e - - IL_010c: ldc.i4.1 - IL_010d: nop - IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0113: pop - IL_0114: ret + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldloc.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.m1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 + IL_00fc: nop + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index b1a13b8392c..575c04908a1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -43,8 +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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -232,85 +224,76 @@ IL_005d: add IL_005e: nop IL_005f: stloc.1 - IL_0060: ldloc.1 - IL_0061: ldc.i4.1 - IL_0062: bge.un.s IL_006c - - IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0069: nop - IL_006a: br.s IL_0095 - - IL_006c: ldc.i4.0 - IL_006d: conv.i8 - IL_006e: stloc.3 - IL_006f: ldloc.0 - IL_0070: stloc.s V_4 - IL_0072: br.s IL_0089 - - IL_0074: ldloca.s V_2 - IL_0076: ldloc.s V_4 - IL_0078: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_007d: nop - IL_007e: ldloc.s V_4 - IL_0080: ldc.i4.m1 - IL_0081: add - IL_0082: stloc.s V_4 - IL_0084: ldloc.3 - IL_0085: ldc.i4.1 - IL_0086: conv.i8 - IL_0087: add - IL_0088: stloc.3 - IL_0089: ldloc.3 - IL_008a: ldloc.1 - IL_008b: blt.un.s IL_0074 - - IL_008d: ldloca.s V_2 - IL_008f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0094: nop - IL_0095: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00a4: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_00a9: br.s IL_00f1 - - IL_00ab: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00b0: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00b5: stloc.0 - IL_00b6: call int32[] assembly::get_r() - IL_00bb: ldloc.0 - IL_00bc: call int32[] assembly::get_r() - IL_00c1: ldloc.0 - IL_00c2: ldelem [runtime]System.Int32 - IL_00c7: call int32[] assembly::get_w() - IL_00cc: ldloc.0 - IL_00cd: ldelem [runtime]System.Int32 - IL_00d2: add - IL_00d3: stelem [runtime]System.Int32 - IL_00d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00dd: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00e7: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00ec: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00f1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00f6: brtrue.s IL_00ab - - IL_00f8: nop - IL_00f9: nop - IL_00fa: call int32[] assembly::get_r() - IL_00ff: ldc.i4.0 - IL_0100: ldelem [runtime]System.Int32 - IL_0105: ldc.i4.3 - IL_0106: bne.un.s IL_010c - - IL_0108: ldc.i4.0 - IL_0109: nop - IL_010a: br.s IL_010e - - IL_010c: ldc.i4.1 - IL_010d: nop - IL_010e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0113: pop - IL_0114: ret + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldloc.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.m1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 + IL_00fc: nop + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index 0d9d3485621..05a931ad783 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -1230,39 +1230,32 @@ module Int32 = IL_000e: conv.i8 IL_000f: add IL_0010: stloc.0 - IL_0011: ldloc.0 - IL_0012: ldc.i4.1 - IL_0013: bge.un.s IL_001b - - IL_0015: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_001a: ret - - IL_001b: ldc.i4.0 - IL_001c: conv.i8 - IL_001d: stloc.2 - IL_001e: ldarg.0 - IL_001f: stloc.3 - IL_0020: br.s IL_0033 - - IL_0022: ldloca.s V_1 - IL_0024: ldloc.3 - IL_0025: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002a: ldloc.3 - IL_002b: ldc.i4.1 - IL_002c: add - IL_002d: stloc.3 - IL_002e: ldloc.2 - IL_002f: ldc.i4.1 - IL_0030: conv.i8 - IL_0031: add - IL_0032: stloc.2 - IL_0033: ldloc.2 - IL_0034: ldloc.0 - IL_0035: blt.un.s IL_0022 - - IL_0037: ldloca.s V_1 - IL_0039: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_003e: ret + IL_0011: ldc.i4.0 + IL_0012: conv.i8 + IL_0013: stloc.2 + IL_0014: ldarg.0 + IL_0015: stloc.3 + IL_0016: br.s IL_0029 + + IL_0018: ldloca.s V_1 + IL_001a: ldloc.3 + IL_001b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.3 + IL_0024: ldloc.2 + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.2 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_0018 + + IL_002d: ldloca.s V_1 + IL_002f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0034: ret } } @@ -1345,8 +1338,7 @@ module Int32 = IL_0009: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - test() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 test() cil managed { .maxstack 4 @@ -1383,39 +1375,32 @@ module Int32 = IL_0022: conv.i8 IL_0023: add IL_0024: stloc.2 - IL_0025: ldloc.2 - IL_0026: ldc.i4.1 - IL_0027: bge.un.s IL_002f - - IL_0029: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_002e: ret - - IL_002f: ldc.i4.0 - IL_0030: conv.i8 - IL_0031: stloc.s V_4 - IL_0033: ldloc.0 - IL_0034: stloc.s V_5 - IL_0036: br.s IL_004e - - IL_0038: ldloca.s V_3 - IL_003a: ldloc.s V_5 - IL_003c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0041: ldloc.s V_5 - IL_0043: ldc.i4.1 - IL_0044: add - IL_0045: stloc.s V_5 - IL_0047: ldloc.s V_4 - IL_0049: ldc.i4.1 - IL_004a: conv.i8 - IL_004b: add - IL_004c: stloc.s V_4 - IL_004e: ldloc.s V_4 - IL_0050: ldloc.2 - IL_0051: blt.un.s IL_0038 - - IL_0053: ldloca.s V_3 - IL_0055: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_005a: ret + IL_0025: ldc.i4.0 + IL_0026: conv.i8 + IL_0027: stloc.s V_4 + IL_0029: ldloc.0 + IL_002a: stloc.s V_5 + IL_002c: br.s IL_0044 + + IL_002e: ldloca.s V_3 + IL_0030: ldloc.s V_5 + IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0037: ldloc.s V_5 + IL_0039: ldc.i4.1 + IL_003a: add + IL_003b: stloc.s V_5 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.s V_4 + IL_0046: ldloc.2 + IL_0047: blt.un.s IL_002e + + IL_0049: ldloca.s V_3 + IL_004b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0050: ret } } @@ -1708,39 +1693,32 @@ module Int32 = IL_004a: conv.i8 IL_004b: add IL_004c: stloc.0 - IL_004d: ldloc.0 - IL_004e: ldc.i4.1 - IL_004f: bge.un.s IL_0057 - - IL_0051: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0056: ret - - IL_0057: ldc.i4.0 - IL_0058: conv.i8 - IL_0059: stloc.2 - IL_005a: ldarg.0 - IL_005b: stloc.3 - IL_005c: br.s IL_006f - - IL_005e: ldloca.s V_1 - IL_0060: ldloc.3 - IL_0061: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0066: ldloc.3 - IL_0067: ldarg.1 - IL_0068: add - IL_0069: stloc.3 - IL_006a: ldloc.2 - IL_006b: ldc.i4.1 - IL_006c: conv.i8 - IL_006d: add - IL_006e: stloc.2 - IL_006f: ldloc.2 - IL_0070: ldloc.0 - IL_0071: blt.un.s IL_005e - - IL_0073: ldloca.s V_1 - IL_0075: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_007a: ret + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: stloc.2 + IL_0050: ldarg.0 + IL_0051: stloc.3 + IL_0052: br.s IL_0065 + + IL_0054: ldloca.s V_1 + IL_0056: ldloc.3 + IL_0057: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_005c: ldloc.3 + IL_005d: ldarg.1 + IL_005e: add + IL_005f: stloc.3 + IL_0060: ldloc.2 + IL_0061: ldc.i4.1 + IL_0062: conv.i8 + IL_0063: add + IL_0064: stloc.2 + IL_0065: ldloc.2 + IL_0066: ldloc.0 + IL_0067: blt.un.s IL_0054 + + IL_0069: ldloca.s V_1 + IL_006b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0070: ret } } @@ -1835,8 +1813,7 @@ module Int32 = IL_000c: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - test() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 test() cil managed { .maxstack 5 @@ -1929,39 +1906,32 @@ module Int32 = IL_006b: conv.i8 IL_006c: add IL_006d: stloc.3 - IL_006e: ldloc.3 - IL_006f: ldc.i4.1 - IL_0070: bge.un.s IL_0078 - - IL_0072: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0077: ret - - IL_0078: ldc.i4.0 - IL_0079: conv.i8 - IL_007a: stloc.s V_5 - IL_007c: ldloc.0 - IL_007d: stloc.s V_6 - IL_007f: br.s IL_0097 - - IL_0081: ldloca.s V_4 - IL_0083: ldloc.s V_6 - IL_0085: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_008a: ldloc.s V_6 - IL_008c: ldloc.1 - IL_008d: add - IL_008e: stloc.s V_6 - IL_0090: ldloc.s V_5 - IL_0092: ldc.i4.1 - IL_0093: conv.i8 - IL_0094: add - IL_0095: stloc.s V_5 - IL_0097: ldloc.s V_5 - IL_0099: ldloc.3 - IL_009a: blt.un.s IL_0081 - - IL_009c: ldloca.s V_4 - IL_009e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00a3: ret + IL_006e: ldc.i4.0 + IL_006f: conv.i8 + IL_0070: stloc.s V_5 + IL_0072: ldloc.0 + IL_0073: stloc.s V_6 + IL_0075: br.s IL_008d + + IL_0077: ldloca.s V_4 + IL_0079: ldloc.s V_6 + IL_007b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0080: ldloc.s V_6 + IL_0082: ldloc.1 + IL_0083: add + IL_0084: stloc.s V_6 + IL_0086: ldloc.s V_5 + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: stloc.s V_5 + IL_008d: ldloc.s V_5 + IL_008f: ldloc.3 + IL_0090: blt.un.s IL_0077 + + IL_0092: ldloca.s V_4 + IL_0094: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0099: ret } } From b99c4a67fa08d7293ef84c6e94c823f9054347a0 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 16:02:39 -0500 Subject: [PATCH 18/66] Use `Seq.toArray` This was failing only on net472. For some reason, `sbyte` arrays (as well as `byte` arrays, since type-testing for either will match both) were using `System.Linq.Enumerable.ToArray` instead of `Seq.toArray`. --- tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs b/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs index 32ca65bfe73..d5fe22cc3b3 100644 --- a/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs +++ b/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs @@ -49,7 +49,7 @@ module private Impl = | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj - | :? seq as seq -> Enumerable.ToArray(seq) :>obj + | :? seq as seq -> seq |> Seq.toArray :> obj | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj From 8f5985328e834f1932d2161349555a1afa511282 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 17:34:39 -0500 Subject: [PATCH 19/66] Better name --- src/Compiler/TypedTree/TypedTreeOps.fs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 1c058c4bef3..529c96aeffd 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10151,8 +10151,8 @@ module IntegralConst = /// Constant -1. [] - let (|MinusOne|_|) expr = - match expr with + let (|MinusOne|_|) c = + match c with | Const.Int32 -1 | Const.Int64 -1L | Const.IntPtr -1L @@ -10162,8 +10162,8 @@ module IntegralConst = /// Positive constant. [] - let (|Positive|_|) expr = - match expr with + let (|Positive|_|) c = + match c with | Const.Int32 v when v > 0 -> ValueSome Positive | Const.Int64 v when v > 0L -> ValueSome Positive | Const.IntPtr v when v > 0L -> ValueSome Positive @@ -10177,8 +10177,9 @@ module IntegralConst = | Const.Char v when v > '\000' -> ValueSome Positive | _ -> ValueNone - let abs expr = - match expr with + /// Returns the absolute value of the given integral constant. + let abs c = + match c with | Const.Int32 Int32.MinValue -> Const.UInt32 (uint Int32.MaxValue + 1u) | Const.Int64 Int64.MinValue -> Const.UInt64 (uint64 Int64.MaxValue + 1UL) | Const.IntPtr Int64.MinValue -> Const.UIntPtr (uint64 Int64.MaxValue + 1UL) @@ -10189,7 +10190,7 @@ module IntegralConst = | Const.IntPtr v -> Const.IntPtr (abs v) | Const.Int16 v -> Const.Int16 (abs v) | Const.SByte v -> Const.SByte (abs v) - | _ -> expr + | _ -> c /// start..finish /// start..step..finish From 1b15640d9bc96f7357abf8366bd13b76e6efc55e Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 20:27:17 -0500 Subject: [PATCH 20/66] Hmm --- src/Compiler/TypedTree/TypedTreeOps.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 529c96aeffd..aeb4d17bfa1 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10208,6 +10208,8 @@ let (|IntegralRange|_|) g expr = | ValApp g g.range_sbyte_op_vref ([], [start; step; finish], _) -> ValueSome (g.sbyte_ty, (start, step, finish)) | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) + | ValApp g g.range_op_vref ([ty], [start; finish], _) -> ValueSome (ty, (start, Expr.Const (Const.Int32 1, Text.Range.range0, ty), finish)) + | ValApp g g.range_step_op_vref ([ty], [start; step; finish], _) -> ValueSome (ty, (start, step, finish)) | _ -> ValueNone /// 5..1 From 5ebb56167c87cccb8a9ef81464fa7d1319736cb3 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 20:38:12 -0500 Subject: [PATCH 21/66] Hmm --- src/Compiler/TypedTree/TypedTreeOps.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index aeb4d17bfa1..317d80e8f21 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10209,7 +10209,7 @@ let (|IntegralRange|_|) g expr = | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) | ValApp g g.range_op_vref ([ty], [start; finish], _) -> ValueSome (ty, (start, Expr.Const (Const.Int32 1, Text.Range.range0, ty), finish)) - | ValApp g g.range_step_op_vref ([ty], [start; step; finish], _) -> ValueSome (ty, (start, step, finish)) + | ValApp g g.range_step_op_vref (ty :: _, [start; step; finish], _) -> ValueSome (ty, (start, step, finish)) | _ -> ValueNone /// 5..1 From 66f131b91cd27bf488f0cd2e9db4ca3efbed0270 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 21:26:44 -0500 Subject: [PATCH 22/66] Update baselines --- ...onSteppingTest07.fs.il.netcore.release.bsl | 212 +++++++++--------- 1 file changed, 108 insertions(+), 104 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl index fd8f60ce0c4..fb1d75e8743 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl @@ -44,8 +44,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 specialname static int32 - get_r() cil managed + .method public specialname static int32 get_r() cil managed { .maxstack 8 @@ -53,8 +52,7 @@ IL_0005: ret } - .method public specialname static void - set_r(int32 'value') cil managed + .method public specialname static void set_r(int32 'value') cil managed { .maxstack 8 @@ -63,8 +61,7 @@ IL_0006: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - f() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f() cil managed { .maxstack 5 @@ -423,113 +420,121 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0035 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, + object) + IL_002c: ldloc.2 + IL_002d: ldc.i4.m1 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.1 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.1 + IL_0035: ldloc.1 + IL_0036: ldloc.0 + IL_0037: blt.un.s IL_001a - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0039: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0045 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, + object) + IL_002c: ldstr "{0}" + IL_0031: ldloc.3 + IL_0032: box [runtime]System.Int32 + IL_0037: call void [runtime]System.Console::WriteLine(string, + object) + IL_003c: ldloc.2 + IL_003d: ldc.i4.m1 + IL_003e: add + IL_003f: stloc.2 + IL_0040: ldloc.1 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.1 + IL_0045: ldloc.1 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_001a + + IL_0049: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, @@ -674,8 +679,7 @@ IL_0032: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - ListExpressionSteppingTest7() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ListExpressionSteppingTest7() cil managed { .maxstack 5 From 6ae6005b6282ebb3f22a93949943469620194907 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 13 Feb 2024 21:41:57 -0500 Subject: [PATCH 23/66] Meh --- src/Compiler/TypedTree/TypedTreeOps.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 317d80e8f21..10a9bc4de70 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10208,8 +10208,8 @@ let (|IntegralRange|_|) g expr = | ValApp g g.range_sbyte_op_vref ([], [start; step; finish], _) -> ValueSome (g.sbyte_ty, (start, step, finish)) | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) - | ValApp g g.range_op_vref ([ty], [start; finish], _) -> ValueSome (ty, (start, Expr.Const (Const.Int32 1, Text.Range.range0, ty), finish)) - | ValApp g g.range_step_op_vref (ty :: _, [start; step; finish], _) -> ValueSome (ty, (start, step, finish)) + | ValApp g g.range_op_vref (ty :: _, [start; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, Expr.Const (Const.Int32 1, Text.Range.range0, ty), finish)) + | ValApp g g.range_step_op_vref (ty :: _, [start; step; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, step, finish)) | _ -> ValueNone /// 5..1 From 01b9b6cbe60fd1ddb093c26161a77e4380ec26e6 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 14 Feb 2024 12:50:24 -0500 Subject: [PATCH 24/66] That was it --- src/Compiler/TypedTree/TypedTreeOps.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 10a9bc4de70..969d139f120 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10685,7 +10685,7 @@ let DetectAndOptimizeForEachExpression g option expr = let spFor = match spFor with DebugPointAtBinding.Yes mFor -> DebugPointAtFor.Yes mFor | _ -> DebugPointAtFor.No mkFastForLoop g (spFor, spIn, mWholeExpr, elemVar, startExpr, (step = 1), finishExpr, bodyExpr) - | _, CompiledForEachExpr g (_enumTy, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), elemVar, bodyExpr, ranges) -> + | OptimizeAllForExpressions, CompiledForEachExpr g (_enumTy, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), elemVar, bodyExpr, ranges) -> let mBody, _spFor, _spIn, mFor, mIn, spInWhile, _mWhole = ranges mkOptimizedRangeLoop From b602519b5ff68f7c037017d578a9a8c1a79a0ad9 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 14 Feb 2024 12:51:24 -0500 Subject: [PATCH 25/66] Better comments --- src/Compiler/TypedTree/TypedTreeOps.fsi | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 87ab6717362..16b2053d819 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2545,8 +2545,8 @@ val (|SpecialEquatableHeadType|_|): TcGlobals -> TType -> TType list option val (|SpecialNotEquatableHeadType|_|): TcGlobals -> TType -> unit option /// Matches if the given expression is an application -/// of an integral range operator and returns the -/// type, start, step, and finish if so. +/// of the range or range-step operator on an integral type +/// and returns the type, start, step, and finish if so. /// /// start..finish /// @@ -2560,14 +2560,26 @@ module IntegralConst = [] val (|Zero|_|): c: Const -> unit voption +/// An expression holding the loop's iteration count. type Count = Expr + +/// An expression representing the loop's current iteration index. type Idx = Expr + +/// An expression representing the current loop element. type Elem = Expr + +/// An expression representing the loop body. type Body = Expr + +/// An expression representing the overall loop. type Loop = Expr -/// Makes an optimized while-loop for the given -/// integral start, step, and finish. +/// Makes an optimized while-loop for a range expression with the given integral start, step, and finish: +/// +/// start..step..finish +/// +/// The buildLoop function enables using the precomputed iteration count in an optional initialization step before the loop is executed. val mkOptimizedRangeLoop: g: TcGlobals -> mBody: range * mFor: range * mIn: range * spInWhile: DebugPointAtWhile -> From 9296f1834710aeb5ac749a86fe7ca5d6ce1cff9e Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 14 Feb 2024 12:57:00 -0500 Subject: [PATCH 26/66] Clarity --- src/Compiler/TypedTree/TypedTreeOps.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 969d139f120..e63e588b2ec 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10238,6 +10238,7 @@ let (|EmptyRange|_|) (start, step, finish) = [] let (|ConstCount|_|) (start, step, finish) = match start, step, finish with + // Such a range would use up the entire address space, but for parity with the library implementation we need it to fail at runtime, not at build time. | Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 1L), Expr.Const (value = Const.Int64 Int64.MaxValue) | Expr.Const (value = Const.Int64 Int64.MaxValue), Expr.Const (value = Const.Int64 -1L), Expr.Const (value = Const.Int64 Int64.MinValue) | Expr.Const (value = Const.UInt64 UInt64.MinValue), Expr.Const (value = Const.UInt64 1UL), Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> ValueSome (Const.UInt64 UInt64.MaxValue) @@ -10556,7 +10557,7 @@ type Elem = Expr type Body = Expr type Loop = Expr -let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) buildLoop = +let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr)) = let mkZero g m ty = let underlyingTy = stripMeasuresFromTy g ty if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 0, m, ty) From 3f2736f16f2619bfd39085476fedafcb18b6e767 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 14 Feb 2024 14:32:49 -0500 Subject: [PATCH 27/66] Update net472 baseline --- ...ionSteppingTest07.fs.il.net472.release.bsl | 212 +++++++++--------- 1 file changed, 108 insertions(+), 104 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl index d96fed2e849..da6effebb3b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl @@ -43,8 +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 specialname static int32 - get_r() cil managed + .method public specialname static int32 get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static void - set_r(int32 'value') cil managed + .method public specialname static void set_r(int32 'value') cil managed { .maxstack 8 @@ -62,8 +60,7 @@ IL_0006: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - f() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f() cil managed { .maxstack 5 @@ -422,113 +419,121 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0035 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, + object) + IL_002c: ldloc.2 + IL_002d: ldc.i4.m1 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.1 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.1 + IL_0035: ldloc.1 + IL_0036: ldloc.0 + IL_0037: blt.un.s IL_001a - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0039: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0045 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, + object) + IL_002c: ldstr "{0}" + IL_0031: ldloc.3 + IL_0032: box [runtime]System.Int32 + IL_0037: call void [runtime]System.Console::WriteLine(string, + object) + IL_003c: ldloc.2 + IL_003d: ldc.i4.m1 + IL_003e: add + IL_003f: stloc.2 + IL_0040: ldloc.1 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.1 + IL_0045: ldloc.1 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_001a + + IL_0049: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, @@ -673,8 +678,7 @@ IL_0032: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - ListExpressionSteppingTest7() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ListExpressionSteppingTest7() cil managed { .maxstack 5 From 89401bcff9c3d214ca485743f50cbadbd1664ee1 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 14 Feb 2024 14:33:27 -0500 Subject: [PATCH 28/66] Use simpler abs --- src/Compiler/TypedTree/TypedTreeOps.fs | 44 +- ...putedCollectionRangeLoweringTests.Int32.fs | 382 ++++++++---------- 2 files changed, 182 insertions(+), 244 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index e63e588b2ec..a4c027148b9 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10099,7 +10099,7 @@ let (|CompiledForEachExpr|_|) g expr = Some (enumerableTy, enumerableExpr, elemVar, bodyExpr, (mBody, spFor, spIn, mFor, mIn, spInWhile, mWholeExpr)) | _ -> None - + let (|CompiledInt32RangeForEachExpr|_|) g expr = match expr with @@ -10326,30 +10326,6 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) - let mkMinValue ty = - let underlyingTy = stripMeasuresFromTy g ty - if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 Int32.MinValue, m, ty) - elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 Int64.MinValue, m, ty) - elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 UInt64.MinValue, m, ty) - elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 UInt32.MinValue, m, ty) - elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr Int64.MinValue, m, ty) - elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr UInt64.MinValue, m, ty) - elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 Int16.MinValue, m, ty) - elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 UInt16.MinValue, m, ty) - elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte SByte.MinValue, m, ty) - elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte Byte.MinValue, m, ty) - elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) - else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) - - let mkMaxValuePlusOneAsUnsigned originalTy destTy = - let underlyingTy = stripMeasuresFromTy g originalTy - if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.UInt64 (uint64 (uint Int32.MaxValue + 1u)), m, destTy) - elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.UInt64 (uint64 Int64.MaxValue + 1UL), m, destTy) - elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.UIntPtr (uint64 Int64.MaxValue + 1UL), m, destTy) - elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.UInt64 (uint64 (uint16 Int16.MaxValue + 1us)), m, destTy) - elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.UInt64 (uint64 (byte SByte.MaxValue + 1uy)), m, destTy) - else error (InternalError ($"Unrecognized signed integral type '{originalTy}'.", m)) - /// Widened diff as unsigned: unsigned (e1 - e2). /// Expects that e1 >= e2. let mkDiff e1 e2 = @@ -10506,21 +10482,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let negativeStep = let diff = mkDiff start finish let diffTy = tyOfExpr g diff - - let absStep = - if typeEquiv g (stripMeasuresFromTy g rangeTy) g.nativeint_ty then - mkAsmExpr ([AI_neg], [], [step], [diffTy], m) - else - mkAsmExpr ([AI_conv DT_I8], [], [(mkAsmExpr ([AI_neg], [], [step], [diffTy], m))], [diffTy], m) - - let step = - mkCond - DebugPointAtBinding.NoneAtInvisible - m - diffTy - (mkILAsmCeq g m step (mkMinValue rangeTy)) - (mkMaxValuePlusOneAsUnsigned rangeTy diffTy) - absStep + let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [diffTy], m); mkOne diffTy], [diffTy], m) mkCond DebugPointAtBinding.NoneAtInvisible @@ -10528,7 +10490,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = diffTy (mkSignednessAppropriateClt rangeTy start finish) (mkZero diffTy) - (mkAddOne (mkQuotient diff step)) + (mkAddOne (mkQuotient diff absStep)) mkCond DebugPointAtBinding.NoneAtInvisible diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index 05a931ad783..55a85008d40 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -680,7 +680,7 @@ module Int32 = IL_0016: ldc.i4.0 IL_0017: conv.i8 - IL_0018: br.s IL_004c + IL_0018: br.s IL_003e IL_001a: ldarg.2 IL_001b: conv.i8 @@ -693,7 +693,7 @@ module Int32 = IL_0022: ldc.i4.1 IL_0023: conv.i8 IL_0024: add - IL_0025: br.s IL_004c + IL_0025: br.s IL_003e IL_0027: ldarg.0 IL_0028: ldarg.2 @@ -701,7 +701,7 @@ module Int32 = IL_002b: ldc.i4.0 IL_002c: conv.i8 - IL_002d: br.s IL_004c + IL_002d: br.s IL_003e IL_002f: ldarg.0 IL_0030: conv.i8 @@ -709,60 +709,54 @@ module Int32 = IL_0032: conv.i8 IL_0033: sub IL_0034: ldarg.1 - IL_0035: ldc.i4 0x80000000 - IL_003a: bne.un.s IL_0044 - - IL_003c: ldc.i4 0x80000000 - IL_0041: conv.u8 - IL_0042: br.s IL_0047 - - IL_0044: ldarg.1 - IL_0045: neg - IL_0046: conv.i8 - IL_0047: conv.i8 - IL_0048: div.un - IL_0049: ldc.i4.1 - IL_004a: conv.i8 - IL_004b: add - IL_004c: stloc.0 - IL_004d: ldloc.0 - IL_004e: ldc.i4.1 - IL_004f: bge.un.s IL_0057 - - IL_0051: call !!0[] [runtime]System.Array::Empty() - IL_0056: ret - - IL_0057: ldloc.0 - IL_0058: conv.ovf.i.un - IL_0059: newarr [runtime]System.Int32 - IL_005e: stloc.1 - IL_005f: ldc.i4.0 - IL_0060: conv.i8 - IL_0061: stloc.2 - IL_0062: ldarg.0 - IL_0063: stloc.3 - IL_0064: br.s IL_0074 - - IL_0066: ldloc.1 - IL_0067: ldloc.2 - IL_0068: conv.ovf.i.un - IL_0069: ldloc.3 - IL_006a: stelem.i4 - IL_006b: ldloc.3 - IL_006c: ldarg.1 - IL_006d: add - IL_006e: stloc.3 - IL_006f: ldloc.2 - IL_0070: ldc.i4.1 - IL_0071: conv.i8 - IL_0072: add - IL_0073: stloc.2 - IL_0074: ldloc.2 - IL_0075: ldloc.0 - IL_0076: blt.un.s IL_0066 - - IL_0078: ldloc.1 - IL_0079: ret + IL_0035: not + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: conv.i8 + IL_003a: div.un + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: stloc.0 + IL_003f: ldloc.0 + IL_0040: ldc.i4.1 + IL_0041: bge.un.s IL_0049 + + IL_0043: call !!0[] [runtime]System.Array::Empty() + IL_0048: ret + + IL_0049: ldloc.0 + IL_004a: conv.ovf.i.un + IL_004b: newarr [runtime]System.Int32 + IL_0050: stloc.1 + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: stloc.2 + IL_0054: ldarg.0 + IL_0055: stloc.3 + IL_0056: br.s IL_0066 + + IL_0058: ldloc.1 + IL_0059: ldloc.2 + IL_005a: conv.ovf.i.un + IL_005b: ldloc.3 + IL_005c: stelem.i4 + 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_0058 + + IL_006a: ldloc.1 + IL_006b: ret } } @@ -905,7 +899,7 @@ module Int32 = IL_0037: ldc.i4.0 IL_0038: conv.i8 - IL_0039: br.s IL_006d + IL_0039: br.s IL_005f IL_003b: ldloc.2 IL_003c: conv.i8 @@ -918,7 +912,7 @@ module Int32 = IL_0043: ldc.i4.1 IL_0044: conv.i8 IL_0045: add - IL_0046: br.s IL_006d + IL_0046: br.s IL_005f IL_0048: ldloc.0 IL_0049: ldloc.2 @@ -926,7 +920,7 @@ module Int32 = IL_004c: ldc.i4.0 IL_004d: conv.i8 - IL_004e: br.s IL_006d + IL_004e: br.s IL_005f IL_0050: ldloc.0 IL_0051: conv.i8 @@ -934,60 +928,54 @@ module Int32 = IL_0053: conv.i8 IL_0054: sub IL_0055: ldloc.1 - IL_0056: ldc.i4 0x80000000 - IL_005b: bne.un.s IL_0065 - - IL_005d: ldc.i4 0x80000000 - IL_0062: conv.u8 - IL_0063: br.s IL_0068 - - IL_0065: ldloc.1 - IL_0066: neg - IL_0067: conv.i8 - IL_0068: conv.i8 - IL_0069: div.un - IL_006a: ldc.i4.1 - IL_006b: conv.i8 - IL_006c: add - IL_006d: stloc.3 - IL_006e: ldloc.3 - IL_006f: ldc.i4.1 - IL_0070: bge.un.s IL_0078 - - IL_0072: call !!0[] [runtime]System.Array::Empty() - IL_0077: ret - - IL_0078: ldloc.3 - IL_0079: conv.ovf.i.un - IL_007a: newarr [runtime]System.Int32 - IL_007f: stloc.s V_4 - IL_0081: ldc.i4.0 - IL_0082: conv.i8 - IL_0083: stloc.s V_5 - IL_0085: ldloc.0 - IL_0086: stloc.s V_6 - IL_0088: br.s IL_009f - - IL_008a: ldloc.s V_4 - IL_008c: ldloc.s V_5 - IL_008e: conv.ovf.i.un - IL_008f: ldloc.s V_6 - IL_0091: stelem.i4 - IL_0092: ldloc.s V_6 - IL_0094: ldloc.1 - IL_0095: add - IL_0096: stloc.s V_6 - IL_0098: ldloc.s V_5 - IL_009a: ldc.i4.1 - IL_009b: conv.i8 - IL_009c: add - IL_009d: stloc.s V_5 - IL_009f: ldloc.s V_5 - IL_00a1: ldloc.3 - IL_00a2: blt.un.s IL_008a - - IL_00a4: ldloc.s V_4 - IL_00a6: ret + IL_0056: not + IL_0057: ldc.i4.1 + IL_0058: conv.i8 + IL_0059: add + IL_005a: conv.i8 + IL_005b: div.un + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.3 + IL_0060: ldloc.3 + IL_0061: ldc.i4.1 + IL_0062: bge.un.s IL_006a + + IL_0064: call !!0[] [runtime]System.Array::Empty() + IL_0069: ret + + IL_006a: ldloc.3 + IL_006b: conv.ovf.i.un + IL_006c: newarr [runtime]System.Int32 + IL_0071: stloc.s V_4 + IL_0073: ldc.i4.0 + IL_0074: conv.i8 + IL_0075: stloc.s V_5 + IL_0077: ldloc.0 + IL_0078: stloc.s V_6 + IL_007a: br.s IL_0091 + + IL_007c: ldloc.s V_4 + IL_007e: ldloc.s V_5 + IL_0080: conv.ovf.i.un + IL_0081: ldloc.s V_6 + IL_0083: stelem.i4 + IL_0084: ldloc.s V_6 + IL_0086: ldloc.1 + IL_0087: add + IL_0088: stloc.s V_6 + IL_008a: ldloc.s V_5 + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add + IL_008f: stloc.s V_5 + IL_0091: ldloc.s V_5 + IL_0093: ldloc.3 + IL_0094: blt.un.s IL_007c + + IL_0096: ldloc.s V_4 + IL_0098: ret } } @@ -1648,7 +1636,7 @@ module Int32 = IL_0016: ldc.i4.0 IL_0017: conv.i8 - IL_0018: br.s IL_004c + IL_0018: br.s IL_003e IL_001a: ldarg.2 IL_001b: conv.i8 @@ -1661,7 +1649,7 @@ module Int32 = IL_0022: ldc.i4.1 IL_0023: conv.i8 IL_0024: add - IL_0025: br.s IL_004c + IL_0025: br.s IL_003e IL_0027: ldarg.0 IL_0028: ldarg.2 @@ -1669,7 +1657,7 @@ module Int32 = IL_002b: ldc.i4.0 IL_002c: conv.i8 - IL_002d: br.s IL_004c + IL_002d: br.s IL_003e IL_002f: ldarg.0 IL_0030: conv.i8 @@ -1677,48 +1665,42 @@ module Int32 = IL_0032: conv.i8 IL_0033: sub IL_0034: ldarg.1 - IL_0035: ldc.i4 0x80000000 - IL_003a: bne.un.s IL_0044 - - IL_003c: ldc.i4 0x80000000 - IL_0041: conv.u8 - IL_0042: br.s IL_0047 - - IL_0044: ldarg.1 - IL_0045: neg - IL_0046: conv.i8 - IL_0047: conv.i8 - IL_0048: div.un - IL_0049: ldc.i4.1 - IL_004a: conv.i8 - IL_004b: add - IL_004c: stloc.0 - IL_004d: ldc.i4.0 - IL_004e: conv.i8 - IL_004f: stloc.2 - IL_0050: ldarg.0 + IL_0035: not + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: conv.i8 + IL_003a: div.un + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: stloc.0 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 + IL_0041: stloc.2 + IL_0042: ldarg.0 + IL_0043: stloc.3 + IL_0044: br.s IL_0057 + + IL_0046: ldloca.s V_1 + IL_0048: ldloc.3 + IL_0049: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_004e: ldloc.3 + IL_004f: ldarg.1 + IL_0050: add IL_0051: stloc.3 - IL_0052: br.s IL_0065 - - IL_0054: ldloca.s V_1 - IL_0056: ldloc.3 - IL_0057: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_005c: ldloc.3 - IL_005d: ldarg.1 - IL_005e: add - IL_005f: stloc.3 - IL_0060: ldloc.2 - IL_0061: ldc.i4.1 - IL_0062: conv.i8 - IL_0063: add - IL_0064: stloc.2 - IL_0065: ldloc.2 - IL_0066: ldloc.0 - IL_0067: blt.un.s IL_0054 - - IL_0069: ldloca.s V_1 - IL_006b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0070: ret + IL_0052: ldloc.2 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.2 + IL_0057: ldloc.2 + IL_0058: ldloc.0 + IL_0059: blt.un.s IL_0046 + + IL_005b: ldloca.s V_1 + IL_005d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0062: ret } } @@ -1861,7 +1843,7 @@ module Int32 = IL_0037: ldc.i4.0 IL_0038: conv.i8 - IL_0039: br.s IL_006d + IL_0039: br.s IL_005f IL_003b: ldloc.2 IL_003c: conv.i8 @@ -1874,7 +1856,7 @@ module Int32 = IL_0043: ldc.i4.1 IL_0044: conv.i8 IL_0045: add - IL_0046: br.s IL_006d + IL_0046: br.s IL_005f IL_0048: ldloc.0 IL_0049: ldloc.2 @@ -1882,7 +1864,7 @@ module Int32 = IL_004c: ldc.i4.0 IL_004d: conv.i8 - IL_004e: br.s IL_006d + IL_004e: br.s IL_005f IL_0050: ldloc.0 IL_0051: conv.i8 @@ -1890,48 +1872,42 @@ module Int32 = IL_0053: conv.i8 IL_0054: sub IL_0055: ldloc.1 - IL_0056: ldc.i4 0x80000000 - IL_005b: bne.un.s IL_0065 - - IL_005d: ldc.i4 0x80000000 - IL_0062: conv.u8 - IL_0063: br.s IL_0068 - - IL_0065: ldloc.1 - IL_0066: neg - IL_0067: conv.i8 - IL_0068: conv.i8 - IL_0069: div.un - IL_006a: ldc.i4.1 - IL_006b: conv.i8 - IL_006c: add - IL_006d: stloc.3 - IL_006e: ldc.i4.0 - IL_006f: conv.i8 - IL_0070: stloc.s V_5 - IL_0072: ldloc.0 - IL_0073: stloc.s V_6 - IL_0075: br.s IL_008d - - IL_0077: ldloca.s V_4 - IL_0079: ldloc.s V_6 - IL_007b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0080: ldloc.s V_6 - IL_0082: ldloc.1 - IL_0083: add - IL_0084: stloc.s V_6 - IL_0086: ldloc.s V_5 - IL_0088: ldc.i4.1 - IL_0089: conv.i8 - IL_008a: add - IL_008b: stloc.s V_5 - IL_008d: ldloc.s V_5 - IL_008f: ldloc.3 - IL_0090: blt.un.s IL_0077 - - IL_0092: ldloca.s V_4 - IL_0094: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0099: ret + IL_0056: not + IL_0057: ldc.i4.1 + IL_0058: conv.i8 + IL_0059: add + IL_005a: conv.i8 + IL_005b: div.un + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.3 + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.s V_5 + IL_0064: ldloc.0 + IL_0065: stloc.s V_6 + IL_0067: br.s IL_007f + + IL_0069: ldloca.s V_4 + IL_006b: ldloc.s V_6 + IL_006d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0072: ldloc.s V_6 + IL_0074: ldloc.1 + IL_0075: add + IL_0076: stloc.s V_6 + IL_0078: ldloc.s V_5 + IL_007a: ldc.i4.1 + IL_007b: conv.i8 + IL_007c: add + IL_007d: stloc.s V_5 + IL_007f: ldloc.s V_5 + IL_0081: ldloc.3 + IL_0082: blt.un.s IL_0069 + + IL_0084: ldloca.s V_4 + IL_0086: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_008b: ret } } From d171669d3ebd209d718ee76ec4d49d1aa5183355 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 15 Feb 2024 14:03:45 -0500 Subject: [PATCH 29/66] Use correctly typed (& sized) one --- .../Optimize/LowerComputedCollections.fs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index e77a4d16dce..d81597edf3e 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -293,6 +293,21 @@ module Array = let mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish = let arrayTy = mkArrayType g overallElemTy + let mkOne ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) + else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + let convToNativeInt expr = let ty = stripMeasuresFromTy g (tyOfExpr g expr) @@ -357,9 +372,9 @@ module Array = // count < 1 let countLtOne = if isSignedIntegerTy g countTy then - mkILAsmClt g m count (mkOne g m) + mkILAsmClt g m count (mkOne countTy) else - mkAsmExpr ([AI_clt_un], [], [count; mkOne g m], [g.bool_ty], m) + mkAsmExpr ([AI_clt_un], [], [count; mkOne countTy], [g.bool_ty], m) // if count < 1 then // [||] From e45dd55d6c51a783730a56b24ccfac947986b589 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 15 Feb 2024 14:04:44 -0500 Subject: [PATCH 30/66] Handle ativeint literals properly --- src/Compiler/TypedTree/TypedTreeOps.fs | 91 ++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 14 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index a4c027148b9..2fb93497121 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10166,17 +10166,31 @@ module IntegralConst = match c with | Const.Int32 v when v > 0 -> ValueSome Positive | Const.Int64 v when v > 0L -> ValueSome Positive - | Const.IntPtr v when v > 0L -> ValueSome Positive + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Const.IntPtr v when v > 0L && uint64 v < 0x80000000UL -> ValueSome Positive | Const.Int16 v when v > 0s -> ValueSome Positive | Const.SByte v when v > 0y -> ValueSome Positive | Const.UInt64 v when v > 0UL -> ValueSome Positive | Const.UInt32 v when v > 0u -> ValueSome Positive - | Const.UIntPtr v when v > 0UL -> ValueSome Positive + // sizeof is not constant, so |𝑐| > 0xffffffffun cannot be treated as a constant. + | Const.UIntPtr v when v > 0UL && v <= 0xffffffffUL -> ValueSome Positive | Const.UInt16 v when v > 0us -> ValueSome Positive | Const.Byte v when v > 0uy -> ValueSome Positive | Const.Char v when v > '\000' -> ValueSome Positive | _ -> ValueNone + /// Negative constant. + [] + let (|Negative|_|) c = + match c with + | Const.Int32 v when v < 0 -> ValueSome Negative + | Const.Int64 v when v < 0L -> ValueSome Negative + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Const.IntPtr v when v < 0L && uint64 v < 0x80000000UL -> ValueSome Negative + | Const.Int16 v when v < 0s -> ValueSome Negative + | Const.SByte v when v < 0y -> ValueSome Negative + | _ -> ValueNone + /// Returns the absolute value of the given integral constant. let abs c = match c with @@ -10224,8 +10238,25 @@ let (|EmptyRange|_|) (start, step, finish) = | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when finish < start && step > 0L || finish > start && step < 0L -> ValueSome EmptyRange | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 _), Expr.Const (value = Const.UInt64 finish) when finish < start -> ValueSome EmptyRange | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 _), Expr.Const (value = Const.UInt32 finish) when finish < start -> ValueSome EmptyRange - | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when finish < start && step > 0L || finish > start && step < 0L -> ValueSome EmptyRange - | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr _), Expr.Const (value = Const.UIntPtr finish) when finish < start -> ValueSome EmptyRange + + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when + uint64 start < 0x80000000UL + && uint64 step < 0x80000000UL + && uint64 finish < 0x80000000UL + && (finish < start && step > 0L || finish > start && step < 0L) + -> + ValueSome EmptyRange + + // sizeof is not constant, so |𝑐| > 0xffffffffun cannot be treated as a constant. + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) when + start <= 0xffffffffUL + && step <= 0xffffffffUL + && finish <= 0xffffffffUL + && finish <= start + -> + ValueSome EmptyRange + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) when finish < start && step > 0s || finish > start && step < 0s -> ValueSome EmptyRange | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 _), Expr.Const (value = Const.UInt16 finish) when finish < start -> ValueSome EmptyRange | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when finish < start && step > 0y || finish > start && step < 0y -> ValueSome EmptyRange @@ -10254,8 +10285,21 @@ let (|ConstCount|_|) (start, step, finish) = | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) - | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when start <= finish -> ValueSome (Const.UIntPtr ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) - | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when + uint64 start < 0x80000000UL + && uint64 step < 0x80000000UL + && uint64 finish < 0x80000000UL + && start <= finish + -> + ValueSome (Const.UIntPtr ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) + + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when + uint64 start < 0x80000000UL + && uint64 step < 0x80000000UL + && uint64 finish < 0x80000000UL + -> + ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) when start <= finish -> ValueSome (Const.UInt32 (uint32 ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (Const.UInt32 (uint32 ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) @@ -10266,7 +10310,14 @@ let (|ConstCount|_|) (start, step, finish) = | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when start <= finish -> ValueSome (Const.Byte (byte ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (Const.Byte (byte ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) - | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) -> ValueSome (Const.UIntPtr ((finish - start) / step + 1UL)) + // sizeof is not constant, so |𝑐| > 0xffffffffun cannot be treated as a constant. + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) when + start <= 0xffffffffUL + && step <= 0xffffffffUL + && finish <= 0xffffffffUL + -> + ValueSome (Const.UIntPtr ((finish - start) / step + 1UL)) + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (Const.UInt64 ((finish - start) / step + 1UL)) | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (Const.UInt32 ((finish - start) / step + 1u)) | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (Const.UInt16 ((finish - start) / step + 1us)) @@ -10326,14 +10377,26 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + let mkWiden e = + let ty = stripMeasuresFromTy g (tyOfExpr g e) + + if typeEquiv g ty g.int64_ty then + mkAsmExpr ([AI_conv DT_I8], [], [e], [g.uint64_ty], m) + elif typeEquiv g ty g.int32_ty then + mkAsmExpr ([AI_conv DT_I4], [], [e], [g.uint32_ty], m) + elif typeEquiv g ty g.int16_ty then + mkAsmExpr ([AI_conv DT_I2], [], [e], [g.uint16_ty], m) + elif typeEquiv g ty g.sbyte_ty then + mkAsmExpr ([AI_conv DT_I1], [], [e], [g.byte_ty], m) + else + e + /// Widened diff as unsigned: unsigned (e1 - e2). - /// Expects that e1 >= e2. + /// Expects that |e1| ≥ |e2|. let mkDiff e1 e2 = - if isSignedIntegerTy g rangeTy && not (typeEquiv g (stripMeasuresFromTy g rangeTy) g.nativeint_ty) then - let mkWiden e = mkAsmExpr ([AI_conv DT_I8], [], [e], [g.uint64_ty], m) - mkAsmExpr ([AI_sub], [], [mkWiden e1; mkWiden e2], [g.uint64_ty], m) - else - mkAsmExpr ([AI_sub], [], [e1; e2], [rangeTy], m) + let e1 = mkWiden e1 + let e2 = mkWiden e2 + mkAsmExpr ([AI_sub], [], [e1; e2], [tyOfExpr g e1], m) /// diff / step let mkQuotient diff step = @@ -10431,7 +10494,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // start..-2..finish // // if start < finish then 0 else (start - finish) / abs step + 1 - | _, Expr.Const (value = negativeStep), _ -> + | _, Expr.Const (value = IntegralConst.Negative as negativeStep), _ -> let diff = mkDiff start finish let diffTy = tyOfExpr g diff From e5e411256707cc75ddfad84af35a3b299e7d435c Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 15 Feb 2024 14:05:12 -0500 Subject: [PATCH 31/66] Handle conversions like C# does --- src/Compiler/Optimize/LowerComputedCollections.fs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index d81597edf3e..c32876cc169 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -311,10 +311,14 @@ module Array = let convToNativeInt expr = let ty = stripMeasuresFromTy g (tyOfExpr g expr) - if typeEquiv g ty g.int64_ty || typeEquiv g ty g.nativeint_ty then + if typeEquiv g ty g.int64_ty then mkAsmExpr ([AI_conv_ovf DT_I], [], [expr], [g.nativeint_ty], m) - elif typeEquiv g ty g.uint64_ty || typeEquiv g ty g.unativeint_ty then + elif typeEquiv g ty g.nativeint_ty then + mkAsmExpr ([AI_conv_ovf DT_I], [], [mkAsmExpr ([AI_conv DT_I8], [], [expr], [g.int64_ty], m)], [g.nativeint_ty], m) + elif typeEquiv g ty g.uint64_ty then mkAsmExpr ([AI_conv_ovf_un DT_I], [], [expr], [g.nativeint_ty], m) + elif typeEquiv g ty g.unativeint_ty then + mkAsmExpr ([AI_conv_ovf_un DT_I], [], [mkAsmExpr ([AI_conv DT_U8], [], [expr], [g.uint64_ty], m)], [g.nativeint_ty], m) else expr From 29f5ca8e09d552fd33168e17ce99b23d237c3b60 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 15 Feb 2024 14:14:22 -0500 Subject: [PATCH 32/66] Update baselines --- ...onTrivialBranchingBindingInEnd03.fs.il.bsl | 166 ++++++++--------- ...ivialBranchingBindingInEnd03.fs.opt.il.bsl | 166 ++++++++--------- ...onTrivialBranchingBindingInEnd04.fs.il.bsl | 168 +++++++++-------- ...ivialBranchingBindingInEnd04.fs.opt.il.bsl | 168 +++++++++-------- ...ionSteppingTest07.fs.il.net472.release.bsl | 174 +++++++++--------- ...onSteppingTest07.fs.il.netcore.release.bsl | 174 +++++++++--------- 6 files changed, 492 insertions(+), 524 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl index 19cb73a18d0..0a2533347cb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint64 V_1, + uint32 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, + uint32 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,93 +207,89 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0056 + IL_004f: bge.s IL_0055 IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: nop - IL_0054: br.s IL_005f - - IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 - IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add - IL_005e: nop - IL_005f: stloc.1 + IL_0052: nop + IL_0053: br.s IL_005d + + IL_0055: ldloc.0 + IL_0056: conv.i4 + IL_0057: ldc.i4.0 + IL_0058: conv.i4 + IL_0059: sub + IL_005a: ldc.i4.1 + IL_005b: add + IL_005c: nop + IL_005d: stloc.1 + IL_005e: ldc.i4.0 + IL_005f: stloc.3 IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldc.i4.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - - IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 + IL_0061: stloc.s V_4 + IL_0063: br.s IL_0079 + + IL_0065: ldloca.s V_2 + IL_0067: ldloc.s V_4 + IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006e: nop + IL_006f: ldloc.s V_4 + IL_0071: ldc.i4.1 + IL_0072: add + IL_0073: stloc.s V_4 + IL_0075: ldloc.3 + IL_0076: ldc.i4.1 + IL_0077: add + IL_0078: stloc.3 + IL_0079: ldloc.3 + IL_007a: ldloc.1 + IL_007b: blt.un.s IL_0065 + + IL_007d: ldloca.s V_2 + IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_0098: br.s IL_00e0 + + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a4: stloc.0 + IL_00a5: call int32[] assembly::get_r() + IL_00aa: ldloc.0 + IL_00ab: call int32[] assembly::get_r() + IL_00b0: ldloc.0 + IL_00b1: ldelem [runtime]System.Int32 + IL_00b6: call int32[] assembly::get_w() + IL_00bb: ldloc.0 + IL_00bc: ldelem [runtime]System.Int32 + IL_00c1: add + IL_00c2: stelem [runtime]System.Int32 + IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e5: brtrue.s IL_009a + + IL_00e7: nop + IL_00e8: nop + IL_00e9: call int32[] assembly::get_r() + IL_00ee: ldc.i4.0 + IL_00ef: ldelem [runtime]System.Int32 + IL_00f4: ldc.i4.3 + IL_00f5: bne.un.s IL_00fb + + IL_00f7: ldc.i4.0 + IL_00f8: nop + IL_00f9: br.s IL_00fd + + IL_00fb: ldc.i4.1 IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0102: pop + IL_0103: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index 19cb73a18d0..0a2533347cb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint64 V_1, + uint32 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, + uint32 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,93 +207,89 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0056 + IL_004f: bge.s IL_0055 IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: nop - IL_0054: br.s IL_005f - - IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 - IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add - IL_005e: nop - IL_005f: stloc.1 + IL_0052: nop + IL_0053: br.s IL_005d + + IL_0055: ldloc.0 + IL_0056: conv.i4 + IL_0057: ldc.i4.0 + IL_0058: conv.i4 + IL_0059: sub + IL_005a: ldc.i4.1 + IL_005b: add + IL_005c: nop + IL_005d: stloc.1 + IL_005e: ldc.i4.0 + IL_005f: stloc.3 IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldc.i4.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - - IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 + IL_0061: stloc.s V_4 + IL_0063: br.s IL_0079 + + IL_0065: ldloca.s V_2 + IL_0067: ldloc.s V_4 + IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006e: nop + IL_006f: ldloc.s V_4 + IL_0071: ldc.i4.1 + IL_0072: add + IL_0073: stloc.s V_4 + IL_0075: ldloc.3 + IL_0076: ldc.i4.1 + IL_0077: add + IL_0078: stloc.3 + IL_0079: ldloc.3 + IL_007a: ldloc.1 + IL_007b: blt.un.s IL_0065 + + IL_007d: ldloca.s V_2 + IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_0098: br.s IL_00e0 + + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a4: stloc.0 + IL_00a5: call int32[] assembly::get_r() + IL_00aa: ldloc.0 + IL_00ab: call int32[] assembly::get_r() + IL_00b0: ldloc.0 + IL_00b1: ldelem [runtime]System.Int32 + IL_00b6: call int32[] assembly::get_w() + IL_00bb: ldloc.0 + IL_00bc: ldelem [runtime]System.Int32 + IL_00c1: add + IL_00c2: stelem [runtime]System.Int32 + IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e5: brtrue.s IL_009a + + IL_00e7: nop + IL_00e8: nop + IL_00e9: call int32[] assembly::get_r() + IL_00ee: ldc.i4.0 + IL_00ef: ldelem [runtime]System.Int32 + IL_00f4: ldc.i4.3 + IL_00f5: bne.un.s IL_00fb + + IL_00f7: ldc.i4.0 + IL_00f8: nop + IL_00f9: br.s IL_00fd + + IL_00fb: ldc.i4.1 IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0102: pop + IL_0103: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl index 575c04908a1..693c83d7540 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint64 V_1, + uint32 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, + uint32 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,93 +207,89 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0056 + IL_004f: bge.s IL_0055 IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: nop - IL_0054: br.s IL_005f - - IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 - IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add - IL_005e: nop - IL_005f: stloc.1 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldloc.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.m1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - - IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 + IL_0052: nop + IL_0053: br.s IL_005d + + IL_0055: ldloc.0 + IL_0056: conv.i4 + IL_0057: ldc.i4.0 + IL_0058: conv.i4 + IL_0059: sub + IL_005a: ldc.i4.1 + IL_005b: add + IL_005c: nop + IL_005d: stloc.1 + IL_005e: ldc.i4.0 + IL_005f: stloc.3 + IL_0060: ldloc.0 + IL_0061: stloc.s V_4 + IL_0063: br.s IL_0079 + + IL_0065: ldloca.s V_2 + IL_0067: ldloc.s V_4 + IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006e: nop + IL_006f: ldloc.s V_4 + IL_0071: ldc.i4.m1 + IL_0072: add + IL_0073: stloc.s V_4 + IL_0075: ldloc.3 + IL_0076: ldc.i4.1 + IL_0077: add + IL_0078: stloc.3 + IL_0079: ldloc.3 + IL_007a: ldloc.1 + IL_007b: blt.un.s IL_0065 + + IL_007d: ldloca.s V_2 + IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_0098: br.s IL_00e0 + + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a4: stloc.0 + IL_00a5: call int32[] assembly::get_r() + IL_00aa: ldloc.0 + IL_00ab: call int32[] assembly::get_r() + IL_00b0: ldloc.0 + IL_00b1: ldelem [runtime]System.Int32 + IL_00b6: call int32[] assembly::get_w() + IL_00bb: ldloc.0 + IL_00bc: ldelem [runtime]System.Int32 + IL_00c1: add + IL_00c2: stelem [runtime]System.Int32 + IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e5: brtrue.s IL_009a + + IL_00e7: nop + IL_00e8: nop + IL_00e9: call int32[] assembly::get_r() + IL_00ee: ldc.i4.0 + IL_00ef: ldelem [runtime]System.Int32 + IL_00f4: ldc.i4.3 + IL_00f5: bne.un.s IL_00fb + + IL_00f7: ldc.i4.0 + IL_00f8: nop + IL_00f9: br.s IL_00fd + + IL_00fb: ldc.i4.1 IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0102: pop + IL_0103: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index 575c04908a1..693c83d7540 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint64 V_1, + uint32 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, + uint32 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,93 +207,89 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0056 + IL_004f: bge.s IL_0055 IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: nop - IL_0054: br.s IL_005f - - IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 - IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add - IL_005e: nop - IL_005f: stloc.1 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldloc.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.m1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - - IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 + IL_0052: nop + IL_0053: br.s IL_005d + + IL_0055: ldloc.0 + IL_0056: conv.i4 + IL_0057: ldc.i4.0 + IL_0058: conv.i4 + IL_0059: sub + IL_005a: ldc.i4.1 + IL_005b: add + IL_005c: nop + IL_005d: stloc.1 + IL_005e: ldc.i4.0 + IL_005f: stloc.3 + IL_0060: ldloc.0 + IL_0061: stloc.s V_4 + IL_0063: br.s IL_0079 + + IL_0065: ldloca.s V_2 + IL_0067: ldloc.s V_4 + IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006e: nop + IL_006f: ldloc.s V_4 + IL_0071: ldc.i4.m1 + IL_0072: add + IL_0073: stloc.s V_4 + IL_0075: ldloc.3 + IL_0076: ldc.i4.1 + IL_0077: add + IL_0078: stloc.3 + IL_0079: ldloc.3 + IL_007a: ldloc.1 + IL_007b: blt.un.s IL_0065 + + IL_007d: ldloca.s V_2 + IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_0098: br.s IL_00e0 + + IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a4: stloc.0 + IL_00a5: call int32[] assembly::get_r() + IL_00aa: ldloc.0 + IL_00ab: call int32[] assembly::get_r() + IL_00b0: ldloc.0 + IL_00b1: ldelem [runtime]System.Int32 + IL_00b6: call int32[] assembly::get_w() + IL_00bb: ldloc.0 + IL_00bc: ldelem [runtime]System.Int32 + IL_00c1: add + IL_00c2: stelem [runtime]System.Int32 + IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e5: brtrue.s IL_009a + + IL_00e7: nop + IL_00e8: nop + IL_00e9: call int32[] assembly::get_r() + IL_00ee: ldc.i4.0 + IL_00ef: ldelem [runtime]System.Int32 + IL_00f4: ldc.i4.3 + IL_00f5: bne.un.s IL_00fb + + IL_00f7: ldc.i4.0 + IL_00f8: nop + IL_00f9: br.s IL_00fd + + IL_00fb: ldc.i4.1 IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0102: pop + IL_0103: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl index da6effebb3b..72a8641da81 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl @@ -420,57 +420,53 @@ { .maxstack 4 - .locals init (uint64 V_0, - uint64 V_1, + .locals init (uint32 V_0, + uint32 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0009 + IL_0002: bge.s IL_0008 IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: nop - IL_0007: br.s IL_0012 - - IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 - IL_000c: conv.i8 - IL_000d: sub - 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.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0035 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldarg.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0031 + + IL_0017: ldloc.2 + IL_0018: stloc.3 + IL_0019: ldstr "{0}" + IL_001e: ldloc.3 + IL_001f: box [runtime]System.Int32 + IL_0024: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldloc.2 - IL_002d: ldc.i4.m1 - IL_002e: add - IL_002f: stloc.2 - IL_0030: ldloc.1 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.1 - IL_0035: ldloc.1 - IL_0036: ldloc.0 - IL_0037: blt.un.s IL_001a + IL_0029: ldloc.2 + IL_002a: ldc.i4.m1 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.1 + IL_002e: ldc.i4.1 + IL_002f: add + IL_0030: stloc.1 + IL_0031: ldloc.1 + IL_0032: ldloc.0 + IL_0033: blt.un.s IL_0017 - IL_0039: ret + IL_0035: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, @@ -478,62 +474,58 @@ { .maxstack 4 - .locals init (uint64 V_0, - uint64 V_1, + .locals init (uint32 V_0, + uint32 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0009 + IL_0002: bge.s IL_0008 IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: nop - IL_0007: br.s IL_0012 - - IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 - IL_000c: conv.i8 - IL_000d: sub - 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.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0045 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldarg.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0041 + + IL_0017: ldloc.2 + IL_0018: stloc.3 + IL_0019: ldstr "{0}" + IL_001e: ldloc.3 + IL_001f: box [runtime]System.Int32 + IL_0024: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldstr "{0}" - IL_0031: ldloc.3 - IL_0032: box [runtime]System.Int32 - IL_0037: call void [runtime]System.Console::WriteLine(string, + IL_0029: ldstr "{0}" + IL_002e: ldloc.3 + IL_002f: box [runtime]System.Int32 + IL_0034: call void [runtime]System.Console::WriteLine(string, object) - IL_003c: ldloc.2 - IL_003d: ldc.i4.m1 - IL_003e: add - IL_003f: stloc.2 - IL_0040: ldloc.1 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add - IL_0044: stloc.1 - IL_0045: ldloc.1 - IL_0046: ldloc.0 - IL_0047: blt.un.s IL_001a - - IL_0049: ret + IL_0039: ldloc.2 + IL_003a: ldc.i4.m1 + IL_003b: add + IL_003c: stloc.2 + IL_003d: ldloc.1 + IL_003e: ldc.i4.1 + IL_003f: add + IL_0040: stloc.1 + IL_0041: ldloc.1 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0017 + + IL_0045: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl index fb1d75e8743..5aadb5c2879 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl @@ -421,57 +421,53 @@ { .maxstack 4 - .locals init (uint64 V_0, - uint64 V_1, + .locals init (uint32 V_0, + uint32 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0009 + IL_0002: bge.s IL_0008 IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: nop - IL_0007: br.s IL_0012 - - IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 - IL_000c: conv.i8 - IL_000d: sub - 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.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0035 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldarg.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0031 + + IL_0017: ldloc.2 + IL_0018: stloc.3 + IL_0019: ldstr "{0}" + IL_001e: ldloc.3 + IL_001f: box [runtime]System.Int32 + IL_0024: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldloc.2 - IL_002d: ldc.i4.m1 - IL_002e: add - IL_002f: stloc.2 - IL_0030: ldloc.1 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.1 - IL_0035: ldloc.1 - IL_0036: ldloc.0 - IL_0037: blt.un.s IL_001a + IL_0029: ldloc.2 + IL_002a: ldc.i4.m1 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.1 + IL_002e: ldc.i4.1 + IL_002f: add + IL_0030: stloc.1 + IL_0031: ldloc.1 + IL_0032: ldloc.0 + IL_0033: blt.un.s IL_0017 - IL_0039: ret + IL_0035: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, @@ -479,62 +475,58 @@ { .maxstack 4 - .locals init (uint64 V_0, - uint64 V_1, + .locals init (uint32 V_0, + uint32 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0009 + IL_0002: bge.s IL_0008 IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: nop - IL_0007: br.s IL_0012 - - IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 - IL_000c: conv.i8 - IL_000d: sub - 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.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0045 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldarg.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0041 + + IL_0017: ldloc.2 + IL_0018: stloc.3 + IL_0019: ldstr "{0}" + IL_001e: ldloc.3 + IL_001f: box [runtime]System.Int32 + IL_0024: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldstr "{0}" - IL_0031: ldloc.3 - IL_0032: box [runtime]System.Int32 - IL_0037: call void [runtime]System.Console::WriteLine(string, + IL_0029: ldstr "{0}" + IL_002e: ldloc.3 + IL_002f: box [runtime]System.Int32 + IL_0034: call void [runtime]System.Console::WriteLine(string, object) - IL_003c: ldloc.2 - IL_003d: ldc.i4.m1 - IL_003e: add - IL_003f: stloc.2 - IL_0040: ldloc.1 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add - IL_0044: stloc.1 - IL_0045: ldloc.1 - IL_0046: ldloc.0 - IL_0047: blt.un.s IL_001a - - IL_0049: ret + IL_0039: ldloc.2 + IL_003a: ldc.i4.m1 + IL_003b: add + IL_003c: stloc.2 + IL_003d: ldloc.1 + IL_003e: ldc.i4.1 + IL_003f: add + IL_0040: stloc.1 + IL_0041: ldloc.1 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0017 + + IL_0045: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, From 458f14aa4e39875c805f5034253307996b0593a2 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 15 Feb 2024 14:15:38 -0500 Subject: [PATCH 33/66] Expose `mkTypedZero` & `mkTypedOne` --- .../Optimize/LowerComputedCollections.fs | 19 +-- src/Compiler/TypedTree/TypedTreeOps.fs | 126 +++++++----------- src/Compiler/TypedTree/TypedTreeOps.fsi | 6 + 3 files changed, 59 insertions(+), 92 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index c32876cc169..31cfd5d8ca4 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -293,21 +293,6 @@ module Array = let mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish = let arrayTy = mkArrayType g overallElemTy - let mkOne ty = - let underlyingTy = stripMeasuresFromTy g ty - if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) - elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) - elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) - elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) - elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) - elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) - elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) - elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) - elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) - elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) - elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) - else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) - let convToNativeInt expr = let ty = stripMeasuresFromTy g (tyOfExpr g expr) @@ -376,9 +361,9 @@ module Array = // count < 1 let countLtOne = if isSignedIntegerTy g countTy then - mkILAsmClt g m count (mkOne countTy) + mkILAsmClt g m count (mkTypedOne g m countTy) else - mkAsmExpr ([AI_clt_un], [], [count; mkOne countTy], [g.bool_ty], m) + mkAsmExpr ([AI_clt_un], [], [count; mkTypedOne g m countTy], [g.bool_ty], m) // if count < 1 then // [||] diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 2fb93497121..ac9960019e2 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -7403,6 +7403,42 @@ let mkTwo g m = mkInt g m 2 let mkMinusOne g m = mkInt g m -1 +let mkTypedZero g m ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 0, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 0L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 0UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 0u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 0L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 0UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 0s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 0us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 0y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 0uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) + elif typeEquiv g underlyingTy g.float32_ty then Expr.Const (Const.Single 0.0f, m, ty) + elif typeEquiv g underlyingTy g.float_ty then Expr.Const (Const.Double 0.0, m, ty) + elif typeEquiv g underlyingTy g.decimal_ty then Expr.Const (Const.Decimal 0m, m, ty) + else error (InternalError ($"Unrecognized numeric type '{ty}'.", m)) + +let mkTypedOne g m ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) + elif typeEquiv g underlyingTy g.float32_ty then Expr.Const (Const.Single 1.0f, m, ty) + elif typeEquiv g underlyingTy g.float_ty then Expr.Const (Const.Double 1.0, m, ty) + elif typeEquiv g underlyingTy g.decimal_ty then Expr.Const (Const.Decimal 1m, m, ty) + else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + let destInt32 = function Expr.Const (Const.Int32 n, _, _) -> Some n | _ -> None let isIDelegateEventType g ty = @@ -10347,36 +10383,6 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = else mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) - let mkZero ty = - let underlyingTy = stripMeasuresFromTy g ty - if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 0, m, ty) - elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 0L, m, ty) - elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 0UL, m, ty) - elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 0u, m, ty) - elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 0L, m, ty) - elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 0UL, m, ty) - elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 0s, m, ty) - elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 0us, m, ty) - elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 0y, m, ty) - elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 0uy, m, ty) - elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) - else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) - - let mkOne ty = - let underlyingTy = stripMeasuresFromTy g ty - if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) - elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) - elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) - elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) - elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) - elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) - elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) - elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) - elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) - elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) - elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) - else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) - let mkWiden e = let ty = stripMeasuresFromTy g (tyOfExpr g e) @@ -10424,9 +10430,9 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let ty = tyOfExpr g pseudoCount if shouldRaiseOverflowExnAtRuntime then - mkAsmExpr ([AI_add_ovf_un], [], [pseudoCount; mkOne ty], [ty], m) + mkAsmExpr ([AI_add_ovf_un], [], [pseudoCount; mkTypedOne g m ty], [ty], m) else - mkAsmExpr ([AI_add], [], [pseudoCount; mkOne ty], [ty], m) + mkAsmExpr ([AI_add], [], [pseudoCount; mkTypedOne g m ty], [ty], m) match start, step, finish with // start..0..finish @@ -10434,7 +10440,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // 5..1 // 1..-1..5 - | EmptyRange -> mkZero rangeTy + | EmptyRange -> mkTypedZero g m rangeTy // 1..5 // 1..2..5 @@ -10454,7 +10460,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = m diffTy (mkSignednessAppropriateClt rangeTy finish start) - (mkZero diffTy) + (mkTypedZero g m diffTy) (mkAddOne diff) // (Only possible for signed types.) @@ -10471,7 +10477,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = m diffTy (mkSignednessAppropriateClt rangeTy start finish) - (mkZero diffTy) + (mkTypedZero g m diffTy) (mkAddOne diff) // start..2..finish @@ -10486,7 +10492,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = m diffTy (mkSignednessAppropriateClt rangeTy finish start) - (mkZero diffTy) + (mkTypedZero g m diffTy) (mkAddOne (mkQuotient diff step)) // (Only possible for signed types.) @@ -10503,7 +10509,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = m diffTy (mkSignednessAppropriateClt rangeTy start finish) - (mkZero diffTy) + (mkTypedZero g m diffTy) (mkAddOne (mkQuotient diff (Expr.Const (IntegralConst.abs negativeStep, m, diffTy)))) // start..step..finish @@ -10524,7 +10530,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = DebugPointAtBinding.NoneAtInvisible m g.unit_ty - (mkILAsmCeq g m step (mkZero rangeTy)) + (mkILAsmCeq g m step (mkTypedZero g m rangeTy)) callAndIgnoreRangeExpr (mkUnit g m) @@ -10539,27 +10545,27 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = m diffTy (mkSignednessAppropriateClt rangeTy finish start) - (mkZero diffTy) + (mkTypedZero g m diffTy) (mkAddOne (mkQuotient diff step)) let negativeStep = let diff = mkDiff start finish let diffTy = tyOfExpr g diff - let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [diffTy], m); mkOne diffTy], [diffTy], m) + let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [diffTy], m); mkTypedOne g m diffTy], [diffTy], m) mkCond DebugPointAtBinding.NoneAtInvisible m diffTy (mkSignednessAppropriateClt rangeTy start finish) - (mkZero diffTy) + (mkTypedZero g m diffTy) (mkAddOne (mkQuotient diff absStep)) mkCond DebugPointAtBinding.NoneAtInvisible m (tyOfExpr g positiveStep) - (mkSignednessAppropriateClt rangeTy (mkZero rangeTy) step) + (mkSignednessAppropriateClt rangeTy (mkTypedZero g m rangeTy) step) positiveStep negativeStep else // Unsigned. @@ -10571,7 +10577,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = m rangeTy (mkSignednessAppropriateClt rangeTy finish start) - (mkZero diffTy) + (mkTypedZero g m diffTy) (mkAddOne (mkQuotient diff step)) mkSequential m throwIfStepIsZero count @@ -10583,36 +10589,6 @@ type Body = Expr type Loop = Expr let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr)) = - let mkZero g m ty = - let underlyingTy = stripMeasuresFromTy g ty - if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 0, m, ty) - elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 0L, m, ty) - elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 0UL, m, ty) - elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 0u, m, ty) - elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 0L, m, ty) - elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 0UL, m, ty) - elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 0s, m, ty) - elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 0us, m, ty) - elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 0y, m, ty) - elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 0uy, m, ty) - elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) - else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) - - let mkOne g m ty = - let underlyingTy = stripMeasuresFromTy g ty - if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) - elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) - elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) - elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) - elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) - elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) - elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) - elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) - elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) - elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) - elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) - else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) - let inline mkLetBindingsIfNeeded f = match start, step, finish with | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> @@ -10661,13 +10637,13 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, buildLoop count (fun mkBody -> let countTy = tyOfExpr g count - mkCompGenLetMutableIn mIn "i" countTy (mkZero g mIn countTy) (fun (idxVal, idxVar) -> + mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> // loopVar <- loopVar + step let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) // i <- i + 1 - let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkOne g mIn countTy], [rangeTy], mIn)) + let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) // // loopVar <- loopVar + step diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 16b2053d819..912ae1b4edc 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1958,6 +1958,12 @@ val mkTwo: TcGlobals -> range -> Expr val mkMinusOne: TcGlobals -> range -> Expr +/// Makes an expression holding a constant 0 value of the given numeric type. +val mkTypedZero: g: TcGlobals -> m: range -> ty: TType -> Expr + +/// Makes an expression holding a constant 1 value of the given numeric type. +val mkTypedOne: g: TcGlobals -> m: range -> ty: TType -> Expr + val destInt32: Expr -> int32 option //------------------------------------------------------------------------- From 31d80ccfbeb17ebc30e8af53a1f2682f29104352 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 15 Feb 2024 14:21:43 -0500 Subject: [PATCH 34/66] Update baselines --- ...putedCollectionRangeLoweringTests.Int32.fs | 938 ++++++++---------- 1 file changed, 439 insertions(+), 499 deletions(-) diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index 55a85008d40..5d22002102d 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -217,65 +217,59 @@ module Int32 = .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, + .locals init (uint32 V_0, int32[] V_1, - uint64 V_2, + uint32 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: bge.s IL_0008 + IL_0002: bge.s IL_0007 IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: br.s IL_0010 - - IL_0008: ldarg.1 - IL_0009: conv.i8 - IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: conv.i8 - IL_000f: add - IL_0010: stloc.0 - IL_0011: ldloc.0 - IL_0012: ldc.i4.1 - IL_0013: bge.un.s IL_001b - - IL_0015: call !!0[] [runtime]System.Array::Empty() - IL_001a: ret + IL_0005: br.s IL_000e - IL_001b: ldloc.0 - IL_001c: conv.ovf.i.un - IL_001d: newarr [runtime]System.Int32 - IL_0022: stloc.1 - IL_0023: ldc.i4.0 - IL_0024: conv.i8 - IL_0025: stloc.2 - IL_0026: ldarg.0 - IL_0027: stloc.3 - IL_0028: br.s IL_0038 - - IL_002a: ldloc.1 - IL_002b: ldloc.2 - IL_002c: conv.ovf.i.un - IL_002d: ldloc.3 - IL_002e: stelem.i4 - IL_002f: ldloc.3 - IL_0030: ldc.i4.1 - IL_0031: add - IL_0032: stloc.3 - IL_0033: ldloc.2 - IL_0034: ldc.i4.1 - IL_0035: conv.i8 - IL_0036: add - IL_0037: stloc.2 - IL_0038: ldloc.2 - IL_0039: ldloc.0 - IL_003a: blt.un.s IL_002a - - IL_003c: ldloc.1 - IL_003d: ret + IL_0007: ldarg.1 + IL_0008: conv.i4 + IL_0009: ldarg.0 + IL_000a: conv.i4 + IL_000b: sub + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.1 + IL_0011: bge.un.s IL_0019 + + IL_0013: call !!0[] [runtime]System.Array::Empty() + IL_0018: ret + + IL_0019: ldloc.0 + IL_001a: newarr [runtime]System.Int32 + IL_001f: stloc.1 + IL_0020: ldc.i4.0 + IL_0021: stloc.2 + IL_0022: ldarg.0 + IL_0023: stloc.3 + IL_0024: br.s IL_0032 + + IL_0026: ldloc.1 + IL_0027: ldloc.2 + IL_0028: ldloc.3 + IL_0029: stelem.i4 + IL_002a: ldloc.3 + IL_002b: ldc.i4.1 + IL_002c: add + IL_002d: stloc.3 + IL_002e: ldloc.2 + IL_002f: ldc.i4.1 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: ldloc.0 + IL_0034: blt.un.s IL_0026 + + IL_0036: ldloc.1 + IL_0037: ret } } @@ -364,9 +358,9 @@ module Int32 = .maxstack 5 .locals init (int32 V_0, int32 V_1, - uint64 V_2, + uint32 V_2, int32[] V_3, - uint64 V_4, + uint32 V_4, int32 V_5) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -380,59 +374,53 @@ module Int32 = IL_0013: stloc.1 IL_0014: ldloc.1 IL_0015: ldloc.0 - IL_0016: bge.s IL_001c + IL_0016: bge.s IL_001b IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: br.s IL_0024 - - IL_001c: ldloc.1 - IL_001d: conv.i8 - IL_001e: ldloc.0 - IL_001f: conv.i8 - IL_0020: sub - IL_0021: ldc.i4.1 - IL_0022: conv.i8 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.2 - IL_0026: ldc.i4.1 - IL_0027: bge.un.s IL_002f - - IL_0029: call !!0[] [runtime]System.Array::Empty() - IL_002e: ret - - IL_002f: ldloc.2 - IL_0030: conv.ovf.i.un - IL_0031: newarr [runtime]System.Int32 - IL_0036: stloc.3 - IL_0037: ldc.i4.0 - IL_0038: conv.i8 - IL_0039: stloc.s V_4 - IL_003b: ldloc.0 - IL_003c: stloc.s V_5 - IL_003e: br.s IL_0054 - - IL_0040: ldloc.3 - IL_0041: ldloc.s V_4 - IL_0043: conv.ovf.i.un - IL_0044: ldloc.s V_5 - IL_0046: stelem.i4 - IL_0047: ldloc.s V_5 - IL_0049: ldc.i4.1 - IL_004a: add - IL_004b: stloc.s V_5 - IL_004d: ldloc.s V_4 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: add - IL_0052: stloc.s V_4 - IL_0054: ldloc.s V_4 - IL_0056: ldloc.2 - IL_0057: blt.un.s IL_0040 - - IL_0059: ldloc.3 - IL_005a: ret + IL_0019: br.s IL_0022 + + IL_001b: ldloc.1 + IL_001c: conv.i4 + IL_001d: ldloc.0 + IL_001e: conv.i4 + IL_001f: sub + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.2 + IL_0024: ldc.i4.1 + IL_0025: bge.un.s IL_002d + + IL_0027: call !!0[] [runtime]System.Array::Empty() + IL_002c: ret + + IL_002d: ldloc.2 + IL_002e: newarr [runtime]System.Int32 + IL_0033: stloc.3 + IL_0034: ldc.i4.0 + IL_0035: stloc.s V_4 + IL_0037: ldloc.0 + IL_0038: stloc.s V_5 + IL_003a: br.s IL_004e + + IL_003c: ldloc.3 + IL_003d: ldloc.s V_4 + IL_003f: ldloc.s V_5 + IL_0041: stelem.i4 + IL_0042: ldloc.s V_5 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.s V_5 + IL_0048: ldloc.s V_4 + IL_004a: ldc.i4.1 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.s V_4 + IL_0050: ldloc.2 + IL_0051: blt.un.s IL_003c + + IL_0053: ldloc.3 + IL_0054: ret } } @@ -654,9 +642,9 @@ module Int32 = 00 00 00 00 ) .maxstack 5 - .locals init (uint64 V_0, + .locals init (uint32 V_0, int32[] V_1, - uint64 V_2, + uint32 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000e @@ -665,98 +653,87 @@ module Int32 = IL_0004: ldarg.1 IL_0005: ldarg.2 IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_000b: pop IL_000c: br.s IL_000e IL_000e: ldc.i4.0 IL_000f: ldarg.1 - IL_0010: bge.s IL_0027 + IL_0010: bge.s IL_0024 IL_0012: ldarg.2 IL_0013: ldarg.0 - IL_0014: bge.s IL_001a + IL_0014: bge.s IL_0019 IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: br.s IL_003e - - IL_001a: ldarg.2 - IL_001b: conv.i8 - IL_001c: ldarg.0 - IL_001d: conv.i8 - IL_001e: sub - IL_001f: ldarg.1 - IL_0020: conv.i8 - IL_0021: div.un - IL_0022: ldc.i4.1 - IL_0023: conv.i8 - IL_0024: add - IL_0025: br.s IL_003e - - IL_0027: ldarg.0 - IL_0028: ldarg.2 - IL_0029: bge.s IL_002f - - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: br.s IL_003e - - IL_002f: ldarg.0 - IL_0030: conv.i8 - IL_0031: ldarg.2 - IL_0032: conv.i8 - IL_0033: sub - IL_0034: ldarg.1 - IL_0035: not - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: conv.i8 - IL_003a: div.un - IL_003b: ldc.i4.1 - IL_003c: conv.i8 - IL_003d: add - IL_003e: stloc.0 - IL_003f: ldloc.0 - IL_0040: ldc.i4.1 - IL_0041: bge.un.s IL_0049 - - IL_0043: call !!0[] [runtime]System.Array::Empty() - IL_0048: ret - - IL_0049: ldloc.0 - IL_004a: conv.ovf.i.un - IL_004b: newarr [runtime]System.Int32 - IL_0050: stloc.1 - IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: stloc.2 - IL_0054: ldarg.0 - IL_0055: stloc.3 - IL_0056: br.s IL_0066 - - IL_0058: ldloc.1 - IL_0059: ldloc.2 - IL_005a: conv.ovf.i.un - IL_005b: ldloc.3 - IL_005c: stelem.i4 - 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_0058 - - IL_006a: ldloc.1 - IL_006b: ret + IL_0017: br.s IL_0037 + + IL_0019: ldarg.2 + IL_001a: conv.i4 + IL_001b: ldarg.0 + IL_001c: conv.i4 + IL_001d: sub + IL_001e: ldarg.1 + IL_001f: div.un + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: br.s IL_0037 + + IL_0024: ldarg.0 + IL_0025: ldarg.2 + IL_0026: bge.s IL_002b + + IL_0028: ldc.i4.0 + IL_0029: br.s IL_0037 + + IL_002b: ldarg.0 + IL_002c: conv.i4 + IL_002d: ldarg.2 + IL_002e: conv.i4 + IL_002f: sub + IL_0030: ldarg.1 + IL_0031: not + IL_0032: ldc.i4.1 + IL_0033: add + IL_0034: div.un + IL_0035: ldc.i4.1 + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i4.1 + IL_003a: bge.un.s IL_0042 + + IL_003c: call !!0[] [runtime]System.Array::Empty() + IL_0041: ret + + IL_0042: ldloc.0 + IL_0043: newarr [runtime]System.Int32 + IL_0048: stloc.1 + IL_0049: ldc.i4.0 + IL_004a: stloc.2 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_005b + + IL_004f: ldloc.1 + IL_0050: ldloc.2 + IL_0051: ldloc.3 + IL_0052: stelem.i4 + IL_0053: ldloc.3 + IL_0054: ldarg.1 + IL_0055: add + IL_0056: stloc.3 + IL_0057: ldloc.2 + IL_0058: ldc.i4.1 + IL_0059: add + IL_005a: stloc.2 + IL_005b: ldloc.2 + IL_005c: ldloc.0 + IL_005d: blt.un.s IL_004f + + IL_005f: ldloc.1 + IL_0060: ret } } @@ -858,9 +835,9 @@ module Int32 = .locals init (int32 V_0, int32 V_1, int32 V_2, - uint64 V_3, + uint32 V_3, int32[] V_4, - uint64 V_5, + uint32 V_5, int32 V_6) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -884,98 +861,87 @@ module Int32 = IL_0025: ldloc.1 IL_0026: ldloc.2 IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_002c: pop IL_002d: br.s IL_002f IL_002f: ldc.i4.0 IL_0030: ldloc.1 - IL_0031: bge.s IL_0048 + IL_0031: bge.s IL_0045 IL_0033: ldloc.2 IL_0034: ldloc.0 - IL_0035: bge.s IL_003b + IL_0035: bge.s IL_003a IL_0037: ldc.i4.0 - IL_0038: conv.i8 - IL_0039: br.s IL_005f - - IL_003b: ldloc.2 - IL_003c: conv.i8 - IL_003d: ldloc.0 - IL_003e: conv.i8 - IL_003f: sub - IL_0040: ldloc.1 - IL_0041: conv.i8 - IL_0042: div.un - IL_0043: ldc.i4.1 - IL_0044: conv.i8 - IL_0045: add - IL_0046: br.s IL_005f - - IL_0048: ldloc.0 - IL_0049: ldloc.2 - IL_004a: bge.s IL_0050 - - IL_004c: ldc.i4.0 - IL_004d: conv.i8 - IL_004e: br.s IL_005f - - IL_0050: ldloc.0 - IL_0051: conv.i8 - IL_0052: ldloc.2 - IL_0053: conv.i8 - IL_0054: sub - IL_0055: ldloc.1 - IL_0056: not - IL_0057: ldc.i4.1 - IL_0058: conv.i8 - IL_0059: add - IL_005a: conv.i8 - IL_005b: div.un - IL_005c: ldc.i4.1 - IL_005d: conv.i8 - IL_005e: add - IL_005f: stloc.3 - IL_0060: ldloc.3 - IL_0061: ldc.i4.1 - IL_0062: bge.un.s IL_006a - - IL_0064: call !!0[] [runtime]System.Array::Empty() - IL_0069: ret - - IL_006a: ldloc.3 - IL_006b: conv.ovf.i.un - IL_006c: newarr [runtime]System.Int32 - IL_0071: stloc.s V_4 - IL_0073: ldc.i4.0 - IL_0074: conv.i8 - IL_0075: stloc.s V_5 - IL_0077: ldloc.0 - IL_0078: stloc.s V_6 - IL_007a: br.s IL_0091 - - IL_007c: ldloc.s V_4 - IL_007e: ldloc.s V_5 - IL_0080: conv.ovf.i.un - IL_0081: ldloc.s V_6 - IL_0083: stelem.i4 - IL_0084: ldloc.s V_6 - IL_0086: ldloc.1 - IL_0087: add - IL_0088: stloc.s V_6 - IL_008a: ldloc.s V_5 - IL_008c: ldc.i4.1 - IL_008d: conv.i8 - IL_008e: add - IL_008f: stloc.s V_5 - IL_0091: ldloc.s V_5 - IL_0093: ldloc.3 - IL_0094: blt.un.s IL_007c - - IL_0096: ldloc.s V_4 - IL_0098: ret + IL_0038: br.s IL_0058 + + IL_003a: ldloc.2 + IL_003b: conv.i4 + IL_003c: ldloc.0 + IL_003d: conv.i4 + IL_003e: sub + IL_003f: ldloc.1 + IL_0040: div.un + IL_0041: ldc.i4.1 + IL_0042: add + IL_0043: br.s IL_0058 + + IL_0045: ldloc.0 + IL_0046: ldloc.2 + IL_0047: bge.s IL_004c + + IL_0049: ldc.i4.0 + IL_004a: br.s IL_0058 + + IL_004c: ldloc.0 + IL_004d: conv.i4 + IL_004e: ldloc.2 + IL_004f: conv.i4 + IL_0050: sub + IL_0051: ldloc.1 + IL_0052: not + IL_0053: ldc.i4.1 + IL_0054: add + IL_0055: div.un + IL_0056: ldc.i4.1 + IL_0057: add + IL_0058: stloc.3 + IL_0059: ldloc.3 + IL_005a: ldc.i4.1 + IL_005b: bge.un.s IL_0063 + + IL_005d: call !!0[] [runtime]System.Array::Empty() + IL_0062: ret + + IL_0063: ldloc.3 + IL_0064: newarr [runtime]System.Int32 + IL_0069: stloc.s V_4 + IL_006b: ldc.i4.0 + IL_006c: stloc.s V_5 + IL_006e: ldloc.0 + IL_006f: stloc.s V_6 + IL_0071: br.s IL_0086 + + IL_0073: ldloc.s V_4 + IL_0075: ldloc.s V_5 + IL_0077: ldloc.s V_6 + IL_0079: stelem.i4 + IL_007a: ldloc.s V_6 + IL_007c: ldloc.1 + IL_007d: add + IL_007e: stloc.s V_6 + IL_0080: ldloc.s V_5 + IL_0082: ldc.i4.1 + IL_0083: add + IL_0084: stloc.s V_5 + IL_0086: ldloc.s V_5 + IL_0088: ldloc.3 + IL_0089: blt.un.s IL_0073 + + IL_008b: ldloc.s V_4 + IL_008d: ret } } @@ -1197,53 +1163,49 @@ module Int32 = .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, + .locals init (uint32 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - uint64 V_2, + uint32 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: bge.s IL_0008 + IL_0002: bge.s IL_0007 IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: br.s IL_0010 - - IL_0008: ldarg.1 - IL_0009: conv.i8 - IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: conv.i8 - IL_000f: add - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: conv.i8 - IL_0013: stloc.2 - IL_0014: ldarg.0 - IL_0015: stloc.3 - IL_0016: br.s IL_0029 - - IL_0018: ldloca.s V_1 - IL_001a: ldloc.3 - IL_001b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0020: ldloc.3 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.3 - IL_0024: ldloc.2 - IL_0025: ldc.i4.1 - IL_0026: conv.i8 - IL_0027: add - IL_0028: stloc.2 - IL_0029: ldloc.2 - IL_002a: ldloc.0 - IL_002b: blt.un.s IL_0018 - - IL_002d: ldloca.s V_1 - IL_002f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0034: ret + IL_0005: br.s IL_000e + + IL_0007: ldarg.1 + IL_0008: conv.i4 + IL_0009: ldarg.0 + IL_000a: conv.i4 + IL_000b: sub + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: stloc.0 + IL_000f: ldc.i4.0 + IL_0010: stloc.2 + IL_0011: ldarg.0 + IL_0012: stloc.3 + IL_0013: br.s IL_0025 + + IL_0015: ldloca.s V_1 + IL_0017: ldloc.3 + IL_0018: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_001d: ldloc.3 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.3 + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0015 + + IL_0029: ldloca.s V_1 + 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 } } @@ -1332,9 +1294,9 @@ module Int32 = .maxstack 4 .locals init (int32 V_0, int32 V_1, - uint64 V_2, + uint32 V_2, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, - uint64 V_4, + uint32 V_4, int32 V_5) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -1348,47 +1310,43 @@ module Int32 = IL_0013: stloc.1 IL_0014: ldloc.1 IL_0015: ldloc.0 - IL_0016: bge.s IL_001c + IL_0016: bge.s IL_001b IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: br.s IL_0024 - - IL_001c: ldloc.1 - IL_001d: conv.i8 - IL_001e: ldloc.0 - IL_001f: conv.i8 - IL_0020: sub - IL_0021: ldc.i4.1 - IL_0022: conv.i8 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldc.i4.0 - IL_0026: conv.i8 - IL_0027: stloc.s V_4 - IL_0029: ldloc.0 - IL_002a: stloc.s V_5 - IL_002c: br.s IL_0044 - - IL_002e: ldloca.s V_3 - IL_0030: ldloc.s V_5 - IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0037: ldloc.s V_5 - IL_0039: ldc.i4.1 - IL_003a: add - IL_003b: stloc.s V_5 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.s V_4 - IL_0046: ldloc.2 - IL_0047: blt.un.s IL_002e - - IL_0049: ldloca.s V_3 - IL_004b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0050: ret + IL_0019: br.s IL_0022 + + IL_001b: ldloc.1 + IL_001c: conv.i4 + IL_001d: ldloc.0 + IL_001e: conv.i4 + IL_001f: sub + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldc.i4.0 + IL_0024: stloc.s V_4 + IL_0026: ldloc.0 + IL_0027: stloc.s V_5 + IL_0029: br.s IL_0040 + + IL_002b: ldloca.s V_3 + IL_002d: ldloc.s V_5 + IL_002f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0034: ldloc.s V_5 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.s V_5 + IL_003a: ldloc.s V_4 + IL_003c: ldc.i4.1 + IL_003d: add + IL_003e: stloc.s V_4 + IL_0040: ldloc.s V_4 + IL_0042: ldloc.2 + IL_0043: blt.un.s IL_002b + + IL_0045: ldloca.s V_3 + IL_0047: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004c: ret } } @@ -1610,9 +1568,9 @@ module Int32 = 00 00 00 00 ) .maxstack 5 - .locals init (uint64 V_0, + .locals init (uint32 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - uint64 V_2, + uint32 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000e @@ -1621,86 +1579,77 @@ module Int32 = IL_0004: ldarg.1 IL_0005: ldarg.2 IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_000b: pop IL_000c: br.s IL_000e IL_000e: ldc.i4.0 IL_000f: ldarg.1 - IL_0010: bge.s IL_0027 + IL_0010: bge.s IL_0024 IL_0012: ldarg.2 IL_0013: ldarg.0 - IL_0014: bge.s IL_001a + IL_0014: bge.s IL_0019 IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: br.s IL_003e - - IL_001a: ldarg.2 - IL_001b: conv.i8 - IL_001c: ldarg.0 - IL_001d: conv.i8 - IL_001e: sub - IL_001f: ldarg.1 - IL_0020: conv.i8 - IL_0021: div.un - IL_0022: ldc.i4.1 - IL_0023: conv.i8 - IL_0024: add - IL_0025: br.s IL_003e - - IL_0027: ldarg.0 - IL_0028: ldarg.2 - IL_0029: bge.s IL_002f - - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: br.s IL_003e - - IL_002f: ldarg.0 - IL_0030: conv.i8 - IL_0031: ldarg.2 - IL_0032: conv.i8 - IL_0033: sub - IL_0034: ldarg.1 - IL_0035: not - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: conv.i8 - IL_003a: div.un - IL_003b: ldc.i4.1 - IL_003c: conv.i8 - IL_003d: add - IL_003e: stloc.0 - IL_003f: ldc.i4.0 - IL_0040: conv.i8 - IL_0041: stloc.2 - IL_0042: ldarg.0 - IL_0043: stloc.3 - IL_0044: br.s IL_0057 - - IL_0046: ldloca.s V_1 - IL_0048: ldloc.3 - IL_0049: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_004e: ldloc.3 - IL_004f: ldarg.1 - IL_0050: add - IL_0051: stloc.3 - IL_0052: ldloc.2 - IL_0053: ldc.i4.1 - IL_0054: conv.i8 - IL_0055: add - IL_0056: stloc.2 - IL_0057: ldloc.2 - IL_0058: ldloc.0 - IL_0059: blt.un.s IL_0046 - - IL_005b: ldloca.s V_1 - IL_005d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0062: ret + IL_0017: br.s IL_0037 + + IL_0019: ldarg.2 + IL_001a: conv.i4 + IL_001b: ldarg.0 + IL_001c: conv.i4 + IL_001d: sub + IL_001e: ldarg.1 + IL_001f: div.un + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: br.s IL_0037 + + IL_0024: ldarg.0 + IL_0025: ldarg.2 + IL_0026: bge.s IL_002b + + IL_0028: ldc.i4.0 + IL_0029: br.s IL_0037 + + IL_002b: ldarg.0 + IL_002c: conv.i4 + IL_002d: ldarg.2 + IL_002e: conv.i4 + IL_002f: sub + IL_0030: ldarg.1 + IL_0031: not + IL_0032: ldc.i4.1 + IL_0033: add + IL_0034: div.un + IL_0035: ldc.i4.1 + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldc.i4.0 + IL_0039: stloc.2 + IL_003a: ldarg.0 + IL_003b: stloc.3 + IL_003c: br.s IL_004e + + IL_003e: ldloca.s V_1 + IL_0040: ldloc.3 + IL_0041: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0046: ldloc.3 + IL_0047: ldarg.1 + IL_0048: add + IL_0049: stloc.3 + IL_004a: ldloc.2 + IL_004b: ldc.i4.1 + IL_004c: add + IL_004d: stloc.2 + IL_004e: ldloc.2 + IL_004f: ldloc.0 + IL_0050: blt.un.s IL_003e + + IL_0052: ldloca.s V_1 + IL_0054: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0059: ret } } @@ -1802,9 +1751,9 @@ module Int32 = .locals init (int32 V_0, int32 V_1, int32 V_2, - uint64 V_3, + uint32 V_3, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, - uint64 V_5, + uint32 V_5, int32 V_6) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -1828,86 +1777,77 @@ module Int32 = IL_0025: ldloc.1 IL_0026: ldloc.2 IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_002c: pop IL_002d: br.s IL_002f IL_002f: ldc.i4.0 IL_0030: ldloc.1 - IL_0031: bge.s IL_0048 + IL_0031: bge.s IL_0045 IL_0033: ldloc.2 IL_0034: ldloc.0 - IL_0035: bge.s IL_003b + IL_0035: bge.s IL_003a IL_0037: ldc.i4.0 - IL_0038: conv.i8 - IL_0039: br.s IL_005f - - IL_003b: ldloc.2 - IL_003c: conv.i8 - IL_003d: ldloc.0 - IL_003e: conv.i8 - IL_003f: sub - IL_0040: ldloc.1 - IL_0041: conv.i8 - IL_0042: div.un - IL_0043: ldc.i4.1 - IL_0044: conv.i8 - IL_0045: add - IL_0046: br.s IL_005f - - IL_0048: ldloc.0 - IL_0049: ldloc.2 - IL_004a: bge.s IL_0050 - - IL_004c: ldc.i4.0 - IL_004d: conv.i8 - IL_004e: br.s IL_005f - - IL_0050: ldloc.0 - IL_0051: conv.i8 - IL_0052: ldloc.2 - IL_0053: conv.i8 - IL_0054: sub - IL_0055: ldloc.1 - IL_0056: not - IL_0057: ldc.i4.1 - IL_0058: conv.i8 - IL_0059: add - IL_005a: conv.i8 - IL_005b: div.un - IL_005c: ldc.i4.1 - IL_005d: conv.i8 - IL_005e: add - IL_005f: stloc.3 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.s V_5 - IL_0064: ldloc.0 - IL_0065: stloc.s V_6 - IL_0067: br.s IL_007f - - IL_0069: ldloca.s V_4 - IL_006b: ldloc.s V_6 - IL_006d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0072: ldloc.s V_6 - IL_0074: ldloc.1 - IL_0075: add - IL_0076: stloc.s V_6 - IL_0078: ldloc.s V_5 - IL_007a: ldc.i4.1 - IL_007b: conv.i8 - IL_007c: add - IL_007d: stloc.s V_5 - IL_007f: ldloc.s V_5 - IL_0081: ldloc.3 - IL_0082: blt.un.s IL_0069 - - IL_0084: ldloca.s V_4 - IL_0086: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_008b: ret + IL_0038: br.s IL_0058 + + IL_003a: ldloc.2 + IL_003b: conv.i4 + IL_003c: ldloc.0 + IL_003d: conv.i4 + IL_003e: sub + IL_003f: ldloc.1 + IL_0040: div.un + IL_0041: ldc.i4.1 + IL_0042: add + IL_0043: br.s IL_0058 + + IL_0045: ldloc.0 + IL_0046: ldloc.2 + IL_0047: bge.s IL_004c + + IL_0049: ldc.i4.0 + IL_004a: br.s IL_0058 + + IL_004c: ldloc.0 + IL_004d: conv.i4 + IL_004e: ldloc.2 + IL_004f: conv.i4 + IL_0050: sub + IL_0051: ldloc.1 + IL_0052: not + IL_0053: ldc.i4.1 + IL_0054: add + IL_0055: div.un + IL_0056: ldc.i4.1 + IL_0057: add + IL_0058: stloc.3 + IL_0059: ldc.i4.0 + IL_005a: stloc.s V_5 + IL_005c: ldloc.0 + IL_005d: stloc.s V_6 + IL_005f: br.s IL_0076 + + IL_0061: ldloca.s V_4 + IL_0063: ldloc.s V_6 + IL_0065: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006a: ldloc.s V_6 + IL_006c: ldloc.1 + IL_006d: add + IL_006e: stloc.s V_6 + IL_0070: ldloc.s V_5 + IL_0072: ldc.i4.1 + IL_0073: add + IL_0074: stloc.s V_5 + IL_0076: ldloc.s V_5 + IL_0078: ldloc.3 + IL_0079: blt.un.s IL_0061 + + IL_007b: ldloca.s V_4 + IL_007d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0082: ret } } From d5341f55d1964adcb09aa4fd4156ddcdc84ced62 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 16 Feb 2024 11:56:42 -0500 Subject: [PATCH 35/66] =?UTF-8?q?integral=20=E2=86=92=20numeric?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Compiler/TypedTree/TypedTreeOps.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index ac9960019e2..668df50cd93 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -7437,7 +7437,7 @@ let mkTypedOne g m ty = elif typeEquiv g underlyingTy g.float32_ty then Expr.Const (Const.Single 1.0f, m, ty) elif typeEquiv g underlyingTy g.float_ty then Expr.Const (Const.Double 1.0, m, ty) elif typeEquiv g underlyingTy g.decimal_ty then Expr.Const (Const.Decimal 1m, m, ty) - else error (InternalError ($"Unrecognized integral type '{ty}'.", m)) + else error (InternalError ($"Unrecognized numeric type '{ty}'.", m)) let destInt32 = function Expr.Const (Const.Int32 n, _, _) -> Some n | _ -> None From a98fcde60ae82031fa22c2314b34e1f67aa07c4f Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 16 Feb 2024 11:57:16 -0500 Subject: [PATCH 36/66] Use `mkTypedOne` --- src/Compiler/TypedTree/TypedTreeOps.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 668df50cd93..bce2bc20371 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10258,7 +10258,7 @@ let (|IntegralRange|_|) g expr = | ValApp g g.range_sbyte_op_vref ([], [start; step; finish], _) -> ValueSome (g.sbyte_ty, (start, step, finish)) | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) - | ValApp g g.range_op_vref (ty :: _, [start; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, Expr.Const (Const.Int32 1, Text.Range.range0, ty), finish)) + | ValApp g g.range_op_vref (ty :: _, [start; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, mkTypedOne g Text.Range.range0 ty, finish)) | ValApp g g.range_step_op_vref (ty :: _, [start; step; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, step, finish)) | _ -> ValueNone From 7ba11fc53c96af7603f968e2fc466130d16734aa Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 16 Feb 2024 12:14:24 -0500 Subject: [PATCH 37/66] Handle unspecialized cases --- src/Compiler/TypedTree/TcGlobals.fs | 4 ++++ src/Compiler/TypedTree/TypedTreeOps.fs | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 78584629a25..9d233e3dfe9 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -819,6 +819,8 @@ type TcGlobals( let v_range_sbyte_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeSByte" , None , None , [], ([[v_sbyte_ty];[v_sbyte_ty];[v_sbyte_ty]], mkSeqTy v_sbyte_ty)) let v_range_byte_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeByte" , None , None , [], ([[v_byte_ty];[v_byte_ty];[v_byte_ty]], mkSeqTy v_byte_ty)) let v_range_char_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeChar" , None , None , [], ([[v_char_ty];[v_char_ty];[v_char_ty]], mkSeqTy v_char_ty)) + let v_range_generic_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeGeneric" , None , None , [vara], ([[varaTy];[varaTy]], mkSeqTy varaTy)) + let v_range_step_generic_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeStepGeneric" , None , None , [vara;varb], ([[varaTy];[varbTy];[varaTy]], mkSeqTy varaTy)) let v_array_length_info = makeIntrinsicValRef(fslib_MFArrayModule_nleref, "length" , None , Some "Length" , [vara], ([[mkArrayType 1 varaTy]], v_int_ty)) let v_array_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray" , None , None , [vara], ([[mkArrayType 1 varaTy]; [v_int_ty]], varaTy)) @@ -1707,6 +1709,8 @@ type TcGlobals( member val range_sbyte_op_vref = ValRefForIntrinsic v_range_sbyte_op_info member val range_byte_op_vref = ValRefForIntrinsic v_range_byte_op_info member val range_char_op_vref = ValRefForIntrinsic v_range_char_op_info + member val range_generic_op_vref = ValRefForIntrinsic v_range_generic_op_info + member val range_step_generic_op_vref = ValRefForIntrinsic v_range_step_generic_op_info member val array_get_vref = ValRefForIntrinsic v_array_get_info member val array2D_get_vref = ValRefForIntrinsic v_array2D_get_info member val array3D_get_vref = ValRefForIntrinsic v_array3D_get_info diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index bce2bc20371..93b61572ad1 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10259,7 +10259,9 @@ let (|IntegralRange|_|) g expr = | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) | ValApp g g.range_op_vref (ty :: _, [start; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, mkTypedOne g Text.Range.range0 ty, finish)) - | ValApp g g.range_step_op_vref (ty :: _, [start; step; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, step, finish)) + | ValApp g g.range_step_op_vref ([ty; ty2], [start; step; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, step, finish)) + | ValApp g g.range_generic_op_vref ([ty; ty2], [_one; _add; start; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, mkTypedOne g Text.Range.range0 ty, finish)) + | ValApp g g.range_step_generic_op_vref ([ty; ty2], [_zero; _add; start; step; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, step, finish)) | _ -> ValueNone /// 5..1 @@ -10365,12 +10367,17 @@ let (|ConstCount|_|) (start, step, finish) = /// Makes an expression to compute the iteration count for the given integral range. let mkRangeCount g m rangeTy rangeExpr start step finish = /// This will raise an exception at runtime if step is zero. - let callAndIgnoreRangeExpr = + let mkCallAndIgnoreRangeExpr start step finish = // Use the potentially-evaluated-and-bound start, step, and finish. let rangeExpr = match rangeExpr with - | Expr.App (funcExpr, formalType, tyargs, _, m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) - | _ -> rangeExpr + // Type-specific range op (RangeInt32, etc.). + | Expr.App (funcExpr, formalType, tyargs, [_start; _step; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) + // Generic range op (RangeGeneric). + | Expr.App (funcExpr, formalType, tyargs, [one; add; _start; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [one; add; start; finish], m) + // Generic range–step op (RangeStepGeneric). + | Expr.App (funcExpr, formalType, tyargs, [zero; add; _start; _ste; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [zero; add; start; step; finish], m) + | _ -> error (InternalError ($"Unrecognized range function application '{rangeExpr}'.", m)) mkSequential m @@ -10436,7 +10443,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = match start, step, finish with // start..0..finish - | _, Expr.Const (value = IntegralConst.Zero), _ -> mkSequential m callAndIgnoreRangeExpr (mkMinusOne g m) + | _, Expr.Const (value = IntegralConst.Zero), _ -> mkSequential m (mkCallAndIgnoreRangeExpr start step finish) (mkMinusOne g m) // 5..1 // 1..-1..5 @@ -10531,7 +10538,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = m g.unit_ty (mkILAsmCeq g m step (mkTypedZero g m rangeTy)) - callAndIgnoreRangeExpr + (mkCallAndIgnoreRangeExpr start step finish) (mkUnit g m) let count = From 574595a20e195ce825721d53c22105f32d7cb07d Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 19 Feb 2024 18:58:31 -0500 Subject: [PATCH 38/66] Add comments to range tests --- .../FSharp.Core/PrimTypes.fs | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index c2a466db5c7..880dd7bd0c0 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -1003,82 +1003,88 @@ module internal RangeTestsHelpers = Assert.AreEqual ([|min0 .. max3 .. max0|], [|min0; min0 + max3|]) module RangeTests = + /// These tests' constant arguments are inlined, + /// and the size of the computed collection is thus computed at build-time. module BuildTime = [] - let ``Range.SByte`` () = RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue + let ``Range.SByte`` () = RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue [] - let ``Range.Byte`` () = RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue + let ``Range.Byte`` () = RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue // Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? //[] - //let ``Range.Char`` () = RangeTestsHelpers.unsigned System.Char.MinValue System.Char.MaxValue + //let ``Range.Char`` () = RangeTestsHelpers.unsigned System.Char.MinValue System.Char.MaxValue [] - let ``Range.Int16`` () = RangeTestsHelpers.signed System.Int16.MinValue System.Int16.MaxValue + let ``Range.Int16`` () = RangeTestsHelpers.signed System.Int16.MinValue System.Int16.MaxValue [] let ``Range.UInt16`` () = RangeTestsHelpers.unsigned System.UInt16.MinValue System.UInt16.MaxValue [] - let ``Range.Int32`` () = RangeTestsHelpers.signed System.Int32.MinValue System.Int32.MaxValue + let ``Range.Int32`` () = RangeTestsHelpers.signed System.Int32.MinValue System.Int32.MaxValue [] let ``Range.UInt32`` () = RangeTestsHelpers.unsigned System.UInt32.MinValue System.UInt32.MaxValue [] - let ``Range.Int64`` () = RangeTestsHelpers.signed System.Int64.MinValue System.Int64.MaxValue + let ``Range.Int64`` () = RangeTestsHelpers.signed System.Int64.MinValue System.Int64.MaxValue [] let ``Range.UInt64`` () = RangeTestsHelpers.unsigned System.UInt64.MinValue System.UInt64.MaxValue [] let ``Range.IntPtr`` () = - // 0x80000000n is negative on x86, but would be positive on x64. - if System.IntPtr.Size = 4 then RangeTestsHelpers.signed 0x80000000n 0x7fffffffn + // 0x80000000n is negative on x86, but would be positive on x64. + if System.IntPtr.Size = 4 then RangeTestsHelpers.signed 0x80000000n 0x7fffffffn if System.IntPtr.Size = 8 then RangeTestsHelpers.signed 0x8000000000000000n 0x7fffffffffffffffn - + [] let ``Range.UIntPtr`` () = - if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned 0x0un 0xffffffffun - if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned 0x0un 0xffffffffffffffffun + if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned 0x0un 0xffffffffun + if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned 0x0un 0xffffffffffffffffun - module RunTime = + /// These tests' arguments are intentionally _not_ inlined, + /// and so the size of the computed collection must thus be computed at runtime. + module Runtime = [] - let ``Range.SByte`` (min0: sbyte) (max0: sbyte) = RangeTestsHelpers.signed min0 max0 + let ``Range.SByte`` (min0: sbyte) (max0: sbyte) = RangeTestsHelpers.signed min0 max0 [] - let ``Range.Byte`` (min0: byte) (max0: byte) = RangeTestsHelpers.unsigned min0 max0 + let ``Range.Byte`` (min0: byte) (max0: byte) = RangeTestsHelpers.unsigned min0 max0 // Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? //[] - //let ``Range.Char`` (min0: char) (max0: char) = RangeTestsHelpers.unsigned min0 max0 + //let ``Range.Char`` (min0: char) (max0: char) = RangeTestsHelpers.unsigned min0 max0 [] - let ``Range.Int16`` (min0: int16) (max0: int16) = RangeTestsHelpers.signed min0 max0 + let ``Range.Int16`` (min0: int16) (max0: int16) = RangeTestsHelpers.signed min0 max0 [] let ``Range.UInt16`` (min0: uint16) (max0: uint16) = RangeTestsHelpers.unsigned min0 max0 [] - let ``Range.Int32`` min0 max0 = RangeTestsHelpers.signed min0 max0 + let ``Range.Int32`` min0 max0 = RangeTestsHelpers.signed min0 max0 [] let ``Range.UInt32`` (min0: uint) (max0: uint) = RangeTestsHelpers.unsigned min0 max0 [] - let ``Range.Int64`` (min0: int64) (max0: int64) = RangeTestsHelpers.signed min0 max0 + let ``Range.Int64`` (min0: int64) (max0: int64) = RangeTestsHelpers.signed min0 max0 [] let ``Range.UInt64`` (min0: uint64) (max0: uint64) = RangeTestsHelpers.unsigned min0 max0 [] let ``Range.IntPtr`` () = + // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. if System.IntPtr.Size >= 4 then RangeTestsHelpers.signed (System.IntPtr System.Int32.MinValue) (System.IntPtr System.Int32.MaxValue) if System.IntPtr.Size >= 8 then RangeTestsHelpers.signed (System.IntPtr System.Int64.MinValue) (System.IntPtr System.Int64.MaxValue) - + [] let ``Range.UIntPtr`` () = + // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt32.MinValue) (System.UIntPtr System.UInt32.MaxValue) if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) From 6056c45d1ffb330dc0bc1dabec7c2a8b59ab5dad Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 20 Feb 2024 11:50:15 -0500 Subject: [PATCH 39/66] Add `LowerIntegralRangesToFastLoops` lang feature --- docs/release-notes/.Language/preview.md | 1 + src/Compiler/FSComp.txt | 1 + src/Compiler/Facilities/LanguageFeatures.fs | 3 ++ src/Compiler/Facilities/LanguageFeatures.fsi | 1 + .../Optimize/LowerComputedCollections.fs | 5 +-- src/Compiler/TypedTree/TypedTreeOps.fs | 4 ++- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.de.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.es.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 +++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 +++ .../ComputationExpressions.fs | 1 + .../EmittedIL/ForLoop/ForLoop.fs | 4 +++ .../GenericComparison/GenericComparison.fs | 6 ++++ .../ListExpressionStepping.fs | 1 + .../EmittedIL/Misc/Misc.fs | 2 ++ .../SeqExpressionStepping.fs | 1 + ...putedCollectionRangeLoweringTests.Int32.fs | 32 +++++++++---------- 26 files changed, 108 insertions(+), 19 deletions(-) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 832dd924a44..13f35b79080 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -1,5 +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)) * 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)) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index a9fc2692157..76e947833ef 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1594,6 +1594,7 @@ featureWarningIndexedPropertiesGetSetSameType,"Indexed properties getter and set featureChkTailCallAttrOnNonRec,"Raises warnings if the 'TailCall' attribute is used on non-recursive functions." featureUnionIsPropertiesVisible,"Union case test properties" featureBooleanReturningAndReturnTypeDirectedPartialActivePattern,"Boolean-returning and return-type-directed partial active patterns" +featureLowerIntegralRangesToFastLoops,"Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops." 3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3355,tcNotAnIndexerNamedIndexingNotYetEnabled,"The value '%s' is not a function and does not support index notation." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index e7c2a25ee3d..e9f73f32af0 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -85,6 +85,7 @@ type LanguageFeature = | WarningIndexedPropertiesGetSetSameType | WarningWhenTailCallAttrOnNonRec | BooleanReturningAndReturnTypeDirectedPartialActivePattern + | LowerIntegralRangesToFastLoops /// LanguageVersion management type LanguageVersion(versionText) = @@ -197,6 +198,7 @@ type LanguageVersion(versionText) = LanguageFeature.WarningWhenTailCallAttrOnNonRec, previewVersion LanguageFeature.UnionIsPropertiesVisible, previewVersion LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern, previewVersion + LanguageFeature.LowerIntegralRangesToFastLoops, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -340,6 +342,7 @@ type LanguageVersion(versionText) = | LanguageFeature.WarningWhenTailCallAttrOnNonRec -> FSComp.SR.featureChkTailCallAttrOnNonRec () | LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern -> FSComp.SR.featureBooleanReturningAndReturnTypeDirectedPartialActivePattern () + | LanguageFeature.LowerIntegralRangesToFastLoops -> FSComp.SR.featureLowerIntegralRangesToFastLoops () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 29d6c2c33a3..8b7e7c752e9 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -76,6 +76,7 @@ type LanguageFeature = | WarningIndexedPropertiesGetSetSameType | WarningWhenTailCallAttrOnNonRec | BooleanReturningAndReturnTypeDirectedPartialActivePattern + | LowerIntegralRangesToFastLoops /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 31cfd5d8ca4..a231c35ca7b 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -5,6 +5,7 @@ module internal FSharp.Compiler.LowerComputedCollectionExpressions open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Features open FSharp.Compiler.InfoReader open FSharp.Compiler.LowerSequenceExpressions open FSharp.Compiler.MethodCalls @@ -389,7 +390,7 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = match overallSeqExpr with // [start..finish] // [start..step..finish] - | IntegralRange g (_, (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) // [(* Anything more complex. *)] @@ -402,7 +403,7 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = match overallSeqExpr with // [|start..finish|] // [|start..step..finish|] - | IntegralRange g (_, (start, step, finish)) -> + | IntegralRange g (_, (start, step, finish)) when g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops -> Some (Array.mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish) // [|(* Anything more complex. *)|] diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 93b61572ad1..fe2a9c9dfe9 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10694,7 +10694,9 @@ let DetectAndOptimizeForEachExpression g option expr = let spFor = match spFor with DebugPointAtBinding.Yes mFor -> DebugPointAtFor.Yes mFor | _ -> DebugPointAtFor.No mkFastForLoop g (spFor, spIn, mWholeExpr, elemVar, startExpr, (step = 1), finishExpr, bodyExpr) - | OptimizeAllForExpressions, CompiledForEachExpr g (_enumTy, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), elemVar, bodyExpr, ranges) -> + | OptimizeAllForExpressions, CompiledForEachExpr g (_enumTy, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), elemVar, bodyExpr, ranges) when + g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops + -> let mBody, _spFor, _spIn, mFor, mIn, spInWhile, _mWhole = ranges mkOptimizedRangeLoop diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index c7dbc64bac7..749686f0dc4 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -372,6 +372,11 @@ rozhraní s vícenásobným obecným vytvářením instancí + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Povolit duplikát malými písmeny při atributu RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index d5800420f00..fee0c752b26 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -372,6 +372,11 @@ Schnittstellen mit mehrfacher generischer Instanziierung + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute DU in Kleinbuchstaben zulassen, wenn requireQualifiedAccess-Attribut diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index dcfce175697..e502a7695a9 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -372,6 +372,11 @@ interfaces con creación de instancias genéricas múltiples + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Permitir DU en minúsculas con el atributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 590c4fb8e15..b4507602c67 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -372,6 +372,11 @@ interfaces avec plusieurs instanciations génériques + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Autoriser les DU en minuscules pour l'attribut RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 70613984b76..6f45382d6c6 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -372,6 +372,11 @@ interfacce con più creazioni di istanze generiche + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Consentire l’unione discriminata minuscola quando l'attributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 84a9ca6ef70..a6f82878ad5 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -372,6 +372,11 @@ 複数のジェネリックのインスタンス化を含むインターフェイス + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess 属性の場合に小文字 DU を許可する diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 38ffac7d32d..2d8d51b840c 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -372,6 +372,11 @@ 여러 제네릭 인스턴스화가 포함된 인터페이스 + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess 특성이 있는 경우 소문자 DU 허용 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index ac1d54f63c4..39697014d12 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -372,6 +372,11 @@ interfejsy z wieloma ogólnymi wystąpieniami + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Zezwalaj na małą literę DU, gdy występuje RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 6beb1946267..99650a00303 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -372,6 +372,11 @@ interfaces com várias instanciações genéricas + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Permitir DU em minúsculas quando o atributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 1b83dc7cc6b..b899a31f764 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -372,6 +372,11 @@ интерфейсы с множественным универсальным созданием экземпляра + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Разрешить du в нижнем регистре, если атрибут RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 43f5069b2eb..38d9adf8b9c 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -372,6 +372,11 @@ birden çok genel örnek oluşturma içeren arabirimler + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess özniteliğinde küçük harf DU'ya izin ver diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 91cad01e99e..03a81803212 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -372,6 +372,11 @@ 具有多个泛型实例化的接口 + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute 当 RequireQualifiedAccess 属性时允许小写 DU diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index f12b3fd0b5e..b60f6a242b5 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -372,6 +372,11 @@ 具有多個泛型具現化的介面 + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess 屬性時允許小寫 DU diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs index e75263be3e9..25ac3a2001c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs @@ -56,4 +56,5 @@ module ComputationExpressions = [] let ``ComputationExpr07_fs`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs index 22607c2542c..7b2b94f3c16 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs @@ -98,24 +98,28 @@ module ForLoop = [] let ``NonTrivialBranchingBindingInEnd03_fs_opt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd03.fs SCFLAGS="--optimize-" # NonTrivialBranchingBindingInEnd03.fs --optimize- [] let ``NonTrivialBranchingBindingInEnd03_fs_nonopt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd04.fs SCFLAGS="--optimize+" # NonTrivialBranchingBindingInEnd04.fs --optimize+ [] let ``NonTrivialBranchingBindingInEnd04_fs_opt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd04.fs SCFLAGS="--optimize-" # NonTrivialBranchingBindingInEnd04.fs --optimize- [] let ``NonTrivialBranchingBindingInEnd04_fs_nonopt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd05.fs SCFLAGS="--optimize+" # NonTrivialBranchingBindingInEnd05.fs --optimize+ diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs index b421ca1bf11..57d287f2c42 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs @@ -62,12 +62,14 @@ module GenericComparison = [] let ``Compare08_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Compare09.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Compare09.dll" # Compare09.fs [] let ``Compare09_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Compare10.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Compare10.dll" # Compare10.fs - @@ -142,12 +144,14 @@ module GenericComparison = [] let ``Hash10_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Hash11.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Hash11.dll" # Hash11.fs [] let ``Hash11_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Hash12.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Hash12.dll" # Hash12.fs - @@ -197,12 +201,14 @@ module GenericComparison = [] let ``Equals07_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Equals08.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Equals08.dll" # Equals08.fs - [] let ``Equals08_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Equals09.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Equals09.dll" # Equals09.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs index 85b40d306f4..659c31442fb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs @@ -26,6 +26,7 @@ module ListExpressionStepping = [] let ``ListExpressionStepping02_fs`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=ListExpressionSteppingTest3.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ListExpressionSteppingTest3.exe" # ListExpressionSteppingTest3.fs diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs index 49bd8a47ff5..89b6dfad60b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs @@ -27,6 +27,7 @@ module Misc = [] let ``CodeGenRenamings01_fs`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> asExe |> verifyCompilation @@ -62,6 +63,7 @@ module Misc = [] let ``ForLoop01_fs`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> asExe |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs index b11679b96a6..e83ae1a600a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs @@ -57,4 +57,5 @@ module SeqExpressionStepping = [] let ``SeqExpressionSteppingTest07_fs`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index 5d22002102d..4ed3395b743 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -13,7 +13,7 @@ module Int32 = module Range = [] let ``Lone RangeInt32 with const args when start > finish lowers to empty array`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -76,7 +76,7 @@ module Int32 = [] let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -167,7 +167,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -283,7 +283,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -436,7 +436,7 @@ module Int32 = module RangeStep = [] let ``Lone RangeInt32 with const args when (finish - start) / step + 1 ≤ 0 lowers to empty array`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -499,7 +499,7 @@ module Int32 = [] let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -590,7 +590,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -747,7 +747,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -959,7 +959,7 @@ module Int32 = module Range = [] let ``Lone RangeInt32 with const args when start > finish lowers to empty list`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -1023,7 +1023,7 @@ module Int32 = [] let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -1112,7 +1112,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args lowers to init loop``() = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -1219,7 +1219,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"|], + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], """ module Test @@ -1362,7 +1362,7 @@ module Int32 = module RangeStep = [] let ``Lone RangeInt32 with const args when (finish - start) / step + 1 ≤ 0 lowers to empty list`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], """ module Test @@ -1426,7 +1426,7 @@ module Int32 = [] let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], """ module Test @@ -1515,7 +1515,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], """ module Test @@ -1663,7 +1663,7 @@ module Int32 = [] let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"], + CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], """ module Test From d92366a643613e4fe51a12e2623a5a115196dec6 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 20 Feb 2024 11:53:09 -0500 Subject: [PATCH 40/66] Use better name --- src/Compiler/TypedTree/TypedTreeOps.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index fe2a9c9dfe9..6e09aa433f2 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10390,7 +10390,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = else mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) - let mkWiden e = + let mkConvToUnsigned e = let ty = stripMeasuresFromTy g (tyOfExpr g e) if typeEquiv g ty g.int64_ty then @@ -10404,11 +10404,11 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = else e - /// Widened diff as unsigned: unsigned (e1 - e2). + /// Unsigned diff: unsigned (e1 - e2). /// Expects that |e1| ≥ |e2|. let mkDiff e1 e2 = - let e1 = mkWiden e1 - let e2 = mkWiden e2 + let e1 = mkConvToUnsigned e1 + let e2 = mkConvToUnsigned e2 mkAsmExpr ([AI_sub], [], [e1; e2], [tyOfExpr g e1], m) /// diff / step From 6ed642e9d4e90e109f485169e6e62c6aa948f251 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 20 Feb 2024 11:57:33 -0500 Subject: [PATCH 41/66] Missed a spot --- .../Language/ComputedCollectionRangeLoweringTests.Int32.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index 4ed3395b743..f5b45364e2c 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -5,6 +5,7 @@ namespace FSharp.Compiler.UnitTests.ComputedCollectionRangeLoweringTests open NUnit.Framework open FSharp.Test +// TODO https://github.com/dotnet/fsharp/issues/16739: Remove /langversion:preview from these tests when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. [] module Int32 = /// [|…|] From 469b8c567c55efe3d801f70f5dc2d85a86fb2137 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 21 Feb 2024 11:11:47 -0500 Subject: [PATCH 42/66] Handle MinValue..MaxValue, MaxValue..-1..MinValue * When the range is `MinValue..MaxValue`, `MinValue..1..MaxValue`, or `MaxValue..-1..MinValue`, the count will not fit in the original type's range, so we must widen it to the next-widest unsigned type. There is no easy way to do that for 64-bit types, so an overflow exception is raised at runtime. --- src/Compiler/TypedTree/TypedTreeOps.fs | 76 ++++++++++++++++---------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 6e09aa433f2..d618edb853c 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10307,17 +10307,18 @@ let (|EmptyRange|_|) (start, step, finish) = [] let (|ConstCount|_|) (start, step, finish) = match start, step, finish with - // Such a range would use up the entire address space, but for parity with the library implementation we need it to fail at runtime, not at build time. + // The count for these ranges is 2⁶⁴ + 1. Let the count calculation raise an overflow exception at runtime. | Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 1L), Expr.Const (value = Const.Int64 Int64.MaxValue) | Expr.Const (value = Const.Int64 Int64.MaxValue), Expr.Const (value = Const.Int64 -1L), Expr.Const (value = Const.Int64 Int64.MinValue) - | Expr.Const (value = Const.UInt64 UInt64.MinValue), Expr.Const (value = Const.UInt64 1UL), Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> ValueSome (Const.UInt64 UInt64.MaxValue) - + | Expr.Const (value = Const.UInt64 UInt64.MinValue), Expr.Const (value = Const.UInt64 1UL), Expr.Const (value = Const.UInt64 UInt64.MaxValue) | Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr 1L), Expr.Const (value = Const.IntPtr Int64.MaxValue) | Expr.Const (value = Const.IntPtr Int64.MaxValue), Expr.Const (value = Const.IntPtr -1L), Expr.Const (value = Const.IntPtr Int64.MinValue) - | Expr.Const (value = Const.UIntPtr UInt64.MinValue), Expr.Const (value = Const.UIntPtr 1UL), Expr.Const (value = Const.UIntPtr UInt64.MaxValue) -> ValueSome (Const.UIntPtr UInt64.MaxValue) + | Expr.Const (value = Const.UIntPtr UInt64.MinValue), Expr.Const (value = Const.UIntPtr 1UL), Expr.Const (value = Const.UIntPtr UInt64.MaxValue) -> ValueNone // We must special-case a step of Int64.MinValue, since we cannot call abs on it. + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / (uint64 Int64.MaxValue + 1UL) + 1UL)) | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) when start<= finish -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) @@ -10339,14 +10340,14 @@ let (|ConstCount|_|) (start, step, finish) = -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) - | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) when start <= finish -> ValueSome (Const.UInt32 (uint32 ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) - | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (Const.UInt32 (uint32 ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL)) + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL)) - | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) when start <= finish -> ValueSome (Const.UInt16 (uint16 ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) - | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (Const.UInt16 (uint16 ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) when start <= finish -> ValueSome (Const.UInt32 ((uint finish - uint start) / uint (abs (int step)) + 1u)) + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (Const.UInt32 ((uint start - uint finish) / uint (abs (int step)) + 1u)) - | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when start <= finish -> ValueSome (Const.Byte (byte ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL))) - | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (Const.Byte (byte ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL))) + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when start <= finish -> ValueSome (Const.UInt16 ((uint16 finish - uint16 start) / uint16 (abs (int16 step)) + 1us)) + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (Const.UInt16 ((uint16 start - uint16 finish) / uint16 (abs (int16 step)) + 1us)) // sizeof is not constant, so |𝑐| > 0xffffffffun cannot be treated as a constant. | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) when @@ -10356,11 +10357,16 @@ let (|ConstCount|_|) (start, step, finish) = -> ValueSome (Const.UIntPtr ((finish - start) / step + 1UL)) - | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (Const.UInt64 ((finish - start) / step + 1UL)) - | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (Const.UInt32 ((finish - start) / step + 1u)) - | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (Const.UInt16 ((finish - start) / step + 1us)) - | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (Const.Byte ((finish - start) / step + 1uy)) - | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (Const.Char (char (uint16 (finish - start) / uint16 step) + '\001')) + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) when start <= finish -> ValueSome (Const.UInt64 ((finish - start) / step + 1UL)) + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (Const.UInt64 ((start - finish) / step + 1UL)) + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) when start <= finish -> ValueSome (Const.UInt64 (uint64 (finish - start) / uint64 step + 1UL)) + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (Const.UInt64 (uint64 (start - finish) / uint64 step + 1UL)) + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) when start <= finish -> ValueSome (Const.UInt32 (uint (finish - start) / uint step + 1u)) + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (Const.UInt32 (uint (start - finish) / uint step + 1u)) + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) when start <= finish -> ValueSome (Const.UInt16 (uint16 (finish - start) / uint16 step + 1us)) + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (Const.UInt16 (uint16 (start - finish) / uint16 step + 1us)) + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) when start <= finish -> ValueSome (Const.UInt32 (uint (finish - start) / uint step + 1u)) + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (Const.UInt32 (uint (start - finish) / uint step + 1u)) | _ -> ValueNone @@ -10390,25 +10396,39 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = else mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) - let mkConvToUnsigned e = + /// Find the unsigned type with twice the width of the given type, if available. + let nextWidestUnsignedTy ty = + let ty = stripMeasuresFromTy g ty + + if typeEquiv g ty g.int64_ty || typeEquiv g ty g.int32_ty || typeEquiv g ty g.uint32_ty then + g.uint64_ty + elif typeEquiv g ty g.int16_ty || typeEquiv g ty g.uint16_ty || typeEquiv g ty g.char_ty then + g.uint32_ty + elif typeEquiv g ty g.sbyte_ty || typeEquiv g ty g.byte_ty then + g.uint16_ty + else + ty + + /// Convert the value to the next-widest unsigned type. + /// We do this so that adding one won't result in overflow. + /// If finish - start (or start - finish) = 2⁶⁴, an overflow exception will be raised when we try to add one in a subsequent step. + let mkWiden e = let ty = stripMeasuresFromTy g (tyOfExpr g e) - if typeEquiv g ty g.int64_ty then + if typeEquiv g ty g.int64_ty || typeEquiv g ty g.int32_ty || typeEquiv g ty g.uint32_ty then mkAsmExpr ([AI_conv DT_I8], [], [e], [g.uint64_ty], m) - elif typeEquiv g ty g.int32_ty then + elif typeEquiv g ty g.int16_ty || typeEquiv g ty g.uint16_ty || typeEquiv g ty g.char_ty then mkAsmExpr ([AI_conv DT_I4], [], [e], [g.uint32_ty], m) - elif typeEquiv g ty g.int16_ty then + elif typeEquiv g ty g.sbyte_ty || typeEquiv g ty g.byte_ty then mkAsmExpr ([AI_conv DT_I2], [], [e], [g.uint16_ty], m) - elif typeEquiv g ty g.sbyte_ty then - mkAsmExpr ([AI_conv DT_I1], [], [e], [g.byte_ty], m) else e - /// Unsigned diff: unsigned (e1 - e2). + /// Unsigned, widened diff. /// Expects that |e1| ≥ |e2|. let mkDiff e1 e2 = - let e1 = mkConvToUnsigned e1 - let e2 = mkConvToUnsigned e2 + let e1 = mkWiden e1 + let e2 = mkWiden e2 mkAsmExpr ([AI_sub], [], [e1; e2], [tyOfExpr g e1], m) /// diff / step @@ -10425,7 +10445,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let mkAddOne pseudoCount = // For parity with the behavior of (..) and (.. ..) in FSharp.Core, // we want an overflow exception to be raised at runtime - // instead of returning a 0 count here. + // instead of returning a 0 or negative count here. let shouldRaiseOverflowExnAtRuntime = let ty = stripMeasuresFromTy g rangeTy @@ -10452,7 +10472,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // 1..5 // 1..2..5 // 5..-1..1 - | ConstCount count -> Expr.Const (count, m, rangeTy) + | ConstCount count -> Expr.Const (count, m, nextWidestUnsignedTy rangeTy) // start..finish // start..1..finish @@ -10558,7 +10578,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let negativeStep = let diff = mkDiff start finish let diffTy = tyOfExpr g diff - let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [diffTy], m); mkTypedOne g m diffTy], [diffTy], m) + let absStep = mkAsmExpr ([AI_add], [], [mkWiden (mkAsmExpr ([AI_not], [], [step], [rangeTy], m)); mkTypedOne g m diffTy], [diffTy], m) mkCond DebugPointAtBinding.NoneAtInvisible @@ -10582,7 +10602,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = mkCond DebugPointAtBinding.NoneAtInvisible m - rangeTy + diffTy (mkSignednessAppropriateClt rangeTy finish start) (mkTypedZero g m diffTy) (mkAddOne (mkQuotient diff step)) From 966d0aeccad4891cf50a78847c4f32fd7174f127 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 21 Feb 2024 11:17:03 -0500 Subject: [PATCH 43/66] Add tests for MinValue..MaxValue, &c. --- .../FSharp.Core/PrimTypes.fs | 104 ++++++++++++++++-- 1 file changed, 94 insertions(+), 10 deletions(-) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 880dd7bd0c0..4e160e6d448 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -1003,16 +1003,78 @@ module internal RangeTestsHelpers = Assert.AreEqual ([|min0 .. max3 .. max0|], [|min0; min0 + max3|]) module RangeTests = + /// [|Byte.MinValue..Byte.MaxValue|] + let allBytesArray = + [| + 0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy; 0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy + 0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy; 0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy + 0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy; 0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy + 0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy; 0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy + 0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy; 0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy + 0x50uy; 0x51uy; 0x52uy; 0x53uy; 0x54uy; 0x55uy; 0x56uy; 0x57uy; 0x58uy; 0x59uy; 0x5auy; 0x5buy; 0x5cuy; 0x5duy; 0x5euy; 0x5fuy + 0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy; 0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy + 0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy; 0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy + 0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy; 0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy + 0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy; 0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy + 0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy; 0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy + 0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy; 0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy + 0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy; 0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy + 0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy; 0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy + 0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy; 0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy + 0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy; 0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy + |] + + /// [Byte.MinValue..Byte.MaxValue] + let allBytesList = List.ofArray allBytesArray + + /// {Byte.MinValue..Byte.MaxValue} + let allBytesSeq = Seq.ofArray allBytesArray + + /// [|SByte.MinValue..SByte.MaxValue|] + let allSBytesArray = + [| + 0x80y; 0x81y; 0x82y; 0x83y; 0x84y; 0x85y; 0x86y; 0x87y; 0x88y; 0x89y; 0x8ay; 0x8by; 0x8cy; 0x8dy; 0x8ey; 0x8fy + 0x90y; 0x91y; 0x92y; 0x93y; 0x94y; 0x95y; 0x96y; 0x97y; 0x98y; 0x99y; 0x9ay; 0x9by; 0x9cy; 0x9dy; 0x9ey; 0x9fy + 0xa0y; 0xa1y; 0xa2y; 0xa3y; 0xa4y; 0xa5y; 0xa6y; 0xa7y; 0xa8y; 0xa9y; 0xaay; 0xaby; 0xacy; 0xady; 0xaey; 0xafy + 0xb0y; 0xb1y; 0xb2y; 0xb3y; 0xb4y; 0xb5y; 0xb6y; 0xb7y; 0xb8y; 0xb9y; 0xbay; 0xbby; 0xbcy; 0xbdy; 0xbey; 0xbfy + 0xc0y; 0xc1y; 0xc2y; 0xc3y; 0xc4y; 0xc5y; 0xc6y; 0xc7y; 0xc8y; 0xc9y; 0xcay; 0xcby; 0xccy; 0xcdy; 0xcey; 0xcfy + 0xd0y; 0xd1y; 0xd2y; 0xd3y; 0xd4y; 0xd5y; 0xd6y; 0xd7y; 0xd8y; 0xd9y; 0xday; 0xdby; 0xdcy; 0xddy; 0xdey; 0xdfy + 0xe0y; 0xe1y; 0xe2y; 0xe3y; 0xe4y; 0xe5y; 0xe6y; 0xe7y; 0xe8y; 0xe9y; 0xeay; 0xeby; 0xecy; 0xedy; 0xeey; 0xefy + 0xf0y; 0xf1y; 0xf2y; 0xf3y; 0xf4y; 0xf5y; 0xf6y; 0xf7y; 0xf8y; 0xf9y; 0xfay; 0xfby; 0xfcy; 0xfdy; 0xfey; 0xffy + 0x00y; 0x01y; 0x02y; 0x03y; 0x04y; 0x05y; 0x06y; 0x07y; 0x08y; 0x09y; 0x0ay; 0x0by; 0x0cy; 0x0dy; 0x0ey; 0x0fy + 0x10y; 0x11y; 0x12y; 0x13y; 0x14y; 0x15y; 0x16y; 0x17y; 0x18y; 0x19y; 0x1ay; 0x1by; 0x1cy; 0x1dy; 0x1ey; 0x1fy + 0x20y; 0x21y; 0x22y; 0x23y; 0x24y; 0x25y; 0x26y; 0x27y; 0x28y; 0x29y; 0x2ay; 0x2by; 0x2cy; 0x2dy; 0x2ey; 0x2fy + 0x30y; 0x31y; 0x32y; 0x33y; 0x34y; 0x35y; 0x36y; 0x37y; 0x38y; 0x39y; 0x3ay; 0x3by; 0x3cy; 0x3dy; 0x3ey; 0x3fy + 0x40y; 0x41y; 0x42y; 0x43y; 0x44y; 0x45y; 0x46y; 0x47y; 0x48y; 0x49y; 0x4ay; 0x4by; 0x4cy; 0x4dy; 0x4ey; 0x4fy + 0x50y; 0x51y; 0x52y; 0x53y; 0x54y; 0x55y; 0x56y; 0x57y; 0x58y; 0x59y; 0x5ay; 0x5by; 0x5cy; 0x5dy; 0x5ey; 0x5fy + 0x60y; 0x61y; 0x62y; 0x63y; 0x64y; 0x65y; 0x66y; 0x67y; 0x68y; 0x69y; 0x6ay; 0x6by; 0x6cy; 0x6dy; 0x6ey; 0x6fy + 0x70y; 0x71y; 0x72y; 0x73y; 0x74y; 0x75y; 0x76y; 0x77y; 0x78y; 0x79y; 0x7ay; 0x7by; 0x7cy; 0x7dy; 0x7ey; 0x7fy + |] + + /// [SByte.MinValue..SByte.MaxValue] + let allSBytesList = List.ofArray allSBytesArray + + /// {Byte.SMinValue..SByte.MaxValue} + let allSBytesSeq = Seq.ofArray allSBytesArray + /// These tests' constant arguments are inlined, - /// and the size of the computed collection is thus computed at build-time. + /// and the size of the collection (for lists and arrays) is computed at build-time. module BuildTime = [] - let ``Range.SByte`` () = RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue + let ``Range.SByte`` () = + Assert.AreEqual(allSBytesSeq, {System.SByte.MinValue..System.SByte.MaxValue}) + Assert.AreEqual(allSBytesList, [System.SByte.MinValue..System.SByte.MaxValue]) + Assert.AreEqual(allSBytesArray, [|System.SByte.MinValue..System.SByte.MaxValue|]) + RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue [] - let ``Range.Byte`` () = RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue + let ``Range.Byte`` () = + Assert.AreEqual(allBytesSeq, {System.Byte.MinValue..System.Byte.MaxValue}) + Assert.AreEqual(allBytesList, [System.Byte.MinValue..System.Byte.MaxValue]) + Assert.AreEqual(allBytesArray, [|System.Byte.MinValue..System.Byte.MaxValue|]) + RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue - // Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? + //// Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? //[] //let ``Range.Char`` () = RangeTestsHelpers.unsigned System.Char.MinValue System.Char.MaxValue @@ -1036,7 +1098,7 @@ module RangeTests = [] let ``Range.IntPtr`` () = - // 0x80000000n is negative on x86, but would be positive on x64. + // 0x80000000n is negative on x86, but would be positive on x64. if System.IntPtr.Size = 4 then RangeTestsHelpers.signed 0x80000000n 0x7fffffffn if System.IntPtr.Size = 8 then RangeTestsHelpers.signed 0x8000000000000000n 0x7fffffffffffffffn @@ -1048,13 +1110,35 @@ module RangeTests = /// These tests' arguments are intentionally _not_ inlined, /// and so the size of the computed collection must thus be computed at runtime. module Runtime = - [] - let ``Range.SByte`` (min0: sbyte) (max0: sbyte) = RangeTestsHelpers.signed min0 max0 + [] + let ``Range.SByte`` (min0: sbyte) (one: sbyte) (max0: sbyte) = + Assert.AreEqual(allSBytesSeq, {min0..max0}) + Assert.AreEqual(allSBytesList, [min0..max0]) + Assert.AreEqual(allSBytesArray, [|min0..max0|]) + + Assert.AreEqual(allSBytesSeq, {min0..one..max0}) + Assert.AreEqual(allSBytesList, [min0..one..max0]) + Assert.AreEqual(allSBytesArray, [|min0..one..max0|]) + + Assert.AreEqual(Seq.rev allSBytesSeq, {max0 .. -one .. min0}) + Assert.AreEqual(List.rev allSBytesList, [max0 .. -one .. min0]) + Assert.AreEqual(Array.rev allSBytesArray, [|max0 .. -one .. min0|]) + + RangeTestsHelpers.signed min0 max0 + + [] + let ``Range.Byte`` (min0: byte) (one: byte) (max0: byte) = + Assert.AreEqual(allBytesSeq, {min0..max0}) + Assert.AreEqual(allBytesList, [min0..max0]) + Assert.AreEqual(allBytesArray, [|min0..max0|]) + + Assert.AreEqual(allBytesSeq, {min0..one..max0}) + Assert.AreEqual(allBytesList, [min0..one..max0]) + Assert.AreEqual(allBytesArray, [|min0..one..max0|]) - [] - let ``Range.Byte`` (min0: byte) (max0: byte) = RangeTestsHelpers.unsigned min0 max0 + RangeTestsHelpers.unsigned min0 max0 - // Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? + //// Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? //[] //let ``Range.Char`` (min0: char) (max0: char) = RangeTestsHelpers.unsigned min0 max0 From 5b105469e23f4da5638dc5bc3c8608a30249c409 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 21 Feb 2024 11:18:09 -0500 Subject: [PATCH 44/66] Update baselines --- .../ComputationExpr07.fs.il.bsl | 98 +- ...onTrivialBranchingBindingInEnd03.fs.il.bsl | 166 +-- ...ivialBranchingBindingInEnd03.fs.opt.il.bsl | 166 +-- ...onTrivialBranchingBindingInEnd04.fs.il.bsl | 168 +-- ...ivialBranchingBindingInEnd04.fs.opt.il.bsl | 168 +-- .../GenericComparison/Compare08.fsx.il.bsl | 2 +- .../GenericComparison/Compare09.fsx.il.bsl | 152 ++- .../GenericComparison/Equals07.fsx.il.bsl | 2 +- .../GenericComparison/Equals08.fsx.il.bsl | 152 ++- .../GenericComparison/Hash10.fsx.il.bsl | 2 +- .../GenericComparison/Hash11.fsx.il.bsl | 87 +- .../ListExpressionStepping02.fs.il.bsl | 277 ++-- .../Misc/CodeGenRenamings01.fs.il.bsl | 483 ++++--- .../EmittedIL/Misc/ForLoop01.fs.il.bsl | 99 +- ...ionSteppingTest07.fs.il.net472.release.bsl | 174 +-- ...onSteppingTest07.fs.il.netcore.release.bsl | 174 +-- ...putedCollectionRangeLoweringTests.Int32.fs | 1144 +++++++++-------- 17 files changed, 1822 insertions(+), 1692 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl index c9f93636476..1af6d7ef89d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.il.bsl @@ -74,8 +74,7 @@ IL_0014: ret } - .method public strict virtual instance class [ComputationExprLibrary]Library.Eventually`1 - Invoke(int32 _arg1) cil managed + .method public strict virtual instance class [ComputationExprLibrary]Library.Eventually`1 Invoke(int32 _arg1) cil managed { .maxstack 7 @@ -126,8 +125,7 @@ IL_0014: ret } - .method public strict virtual instance class [ComputationExprLibrary]Library.Eventually`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [ComputationExprLibrary]Library.Eventually`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 8 @@ -150,8 +148,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -165,14 +162,13 @@ IL_000d: ret } - .method public strict virtual instance class [ComputationExprLibrary]Library.Eventually`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [ComputationExprLibrary]Library.Eventually`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 9 .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - int32 V_2, + uint64 V_2, int32 V_3) IL_0000: ldc.i4.1 IL_0001: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!0) @@ -182,55 +178,57 @@ IL_000d: ldarg.0 IL_000e: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ IL_0013: ldc.i4.0 - IL_0014: stloc.2 - IL_0015: ldc.i4.0 - IL_0016: stloc.3 - IL_0017: ldloc.2 - IL_0018: ldc.i4.4 - IL_0019: bge.un.s IL_002f - - IL_001b: ldloca.s V_1 - IL_001d: ldloc.3 - IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.3 - IL_0025: ldc.i4.1 - IL_0026: add - IL_0027: stloc.3 - IL_0028: ldloc.2 - IL_0029: ldc.i4.1 - IL_002a: add - IL_002b: stloc.2 - IL_002c: nop - IL_002d: br.s IL_0017 - - IL_002f: ldloca.s V_1 - IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0036: ldarg.0 - IL_0037: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_003c: ldloc.0 - IL_003d: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldc.i4.0 + IL_0017: stloc.3 + IL_0018: ldloc.2 + IL_0019: ldc.i4.4 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0032 + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: nop + IL_0030: br.s IL_0018 + + IL_0032: ldloca.s V_1 + IL_0034: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0039: ldarg.0 + IL_003a: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_003f: ldloc.0 + IL_0040: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_0042: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, + IL_0045: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0047: ldarg.0 - IL_0048: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_004d: ldarg.0 - IL_004e: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_0053: ldloc.0 - IL_0054: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_004a: ldarg.0 + IL_004b: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_0050: ldarg.0 + IL_0051: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_0056: ldloc.0 + IL_0057: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_0059: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_005e: tail. - IL_0060: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, + IL_005c: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0061: tail. + IL_0063: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, class [ComputationExprLibrary]Library.Eventually`1) - IL_0065: ret + IL_0068: ret } } - .method public specialname static class [ComputationExprLibrary]Library.Eventually`1 - get_res7() cil managed + .method public specialname static class [ComputationExprLibrary]Library.Eventually`1 get_res7() cil managed { .maxstack 8 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl index 0a2533347cb..19cb73a18d0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint32 V_1, + uint64 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint32 V_3, + uint64 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,89 +207,93 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0055 + IL_004f: bge.s IL_0056 IL_0051: ldc.i4.0 - IL_0052: nop - IL_0053: br.s IL_005d - - IL_0055: ldloc.0 - IL_0056: conv.i4 - IL_0057: ldc.i4.0 - IL_0058: conv.i4 - IL_0059: sub - IL_005a: ldc.i4.1 - IL_005b: add - IL_005c: nop - IL_005d: stloc.1 - IL_005e: ldc.i4.0 - IL_005f: stloc.3 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 IL_0060: ldc.i4.0 - IL_0061: stloc.s V_4 - IL_0063: br.s IL_0079 - - IL_0065: ldloca.s V_2 - IL_0067: ldloc.s V_4 - IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006e: nop - IL_006f: ldloc.s V_4 - IL_0071: ldc.i4.1 - IL_0072: add - IL_0073: stloc.s V_4 - IL_0075: ldloc.3 - IL_0076: ldc.i4.1 - IL_0077: add - IL_0078: stloc.3 - IL_0079: ldloc.3 - IL_007a: ldloc.1 - IL_007b: blt.un.s IL_0065 - - IL_007d: ldloca.s V_2 - IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0098: br.s IL_00e0 - - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a4: stloc.0 - IL_00a5: call int32[] assembly::get_r() - IL_00aa: ldloc.0 - IL_00ab: call int32[] assembly::get_r() - IL_00b0: ldloc.0 - IL_00b1: ldelem [runtime]System.Int32 - IL_00b6: call int32[] assembly::get_w() - IL_00bb: ldloc.0 - IL_00bc: ldelem [runtime]System.Int32 - IL_00c1: add - IL_00c2: stelem [runtime]System.Int32 - IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e5: brtrue.s IL_009a - - IL_00e7: nop - IL_00e8: nop - IL_00e9: call int32[] assembly::get_r() - IL_00ee: ldc.i4.0 - IL_00ef: ldelem [runtime]System.Int32 - IL_00f4: ldc.i4.3 - IL_00f5: bne.un.s IL_00fb - - IL_00f7: ldc.i4.0 - IL_00f8: nop - IL_00f9: br.s IL_00fd - - IL_00fb: ldc.i4.1 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldc.i4.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 IL_00fc: nop - IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0102: pop - IL_0103: ret + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index 0a2533347cb..19cb73a18d0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint32 V_1, + uint64 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint32 V_3, + uint64 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,89 +207,93 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0055 + IL_004f: bge.s IL_0056 IL_0051: ldc.i4.0 - IL_0052: nop - IL_0053: br.s IL_005d - - IL_0055: ldloc.0 - IL_0056: conv.i4 - IL_0057: ldc.i4.0 - IL_0058: conv.i4 - IL_0059: sub - IL_005a: ldc.i4.1 - IL_005b: add - IL_005c: nop - IL_005d: stloc.1 - IL_005e: ldc.i4.0 - IL_005f: stloc.3 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 IL_0060: ldc.i4.0 - IL_0061: stloc.s V_4 - IL_0063: br.s IL_0079 - - IL_0065: ldloca.s V_2 - IL_0067: ldloc.s V_4 - IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006e: nop - IL_006f: ldloc.s V_4 - IL_0071: ldc.i4.1 - IL_0072: add - IL_0073: stloc.s V_4 - IL_0075: ldloc.3 - IL_0076: ldc.i4.1 - IL_0077: add - IL_0078: stloc.3 - IL_0079: ldloc.3 - IL_007a: ldloc.1 - IL_007b: blt.un.s IL_0065 - - IL_007d: ldloca.s V_2 - IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0098: br.s IL_00e0 - - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a4: stloc.0 - IL_00a5: call int32[] assembly::get_r() - IL_00aa: ldloc.0 - IL_00ab: call int32[] assembly::get_r() - IL_00b0: ldloc.0 - IL_00b1: ldelem [runtime]System.Int32 - IL_00b6: call int32[] assembly::get_w() - IL_00bb: ldloc.0 - IL_00bc: ldelem [runtime]System.Int32 - IL_00c1: add - IL_00c2: stelem [runtime]System.Int32 - IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e5: brtrue.s IL_009a - - IL_00e7: nop - IL_00e8: nop - IL_00e9: call int32[] assembly::get_r() - IL_00ee: ldc.i4.0 - IL_00ef: ldelem [runtime]System.Int32 - IL_00f4: ldc.i4.3 - IL_00f5: bne.un.s IL_00fb - - IL_00f7: ldc.i4.0 - IL_00f8: nop - IL_00f9: br.s IL_00fd - - IL_00fb: ldc.i4.1 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldc.i4.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 IL_00fc: nop - IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0102: pop - IL_0103: ret + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl index 693c83d7540..575c04908a1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint32 V_1, + uint64 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint32 V_3, + uint64 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,89 +207,93 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0055 + IL_004f: bge.s IL_0056 IL_0051: ldc.i4.0 - IL_0052: nop - IL_0053: br.s IL_005d - - IL_0055: ldloc.0 - IL_0056: conv.i4 - IL_0057: ldc.i4.0 - IL_0058: conv.i4 - IL_0059: sub - IL_005a: ldc.i4.1 - IL_005b: add - IL_005c: nop - IL_005d: stloc.1 - IL_005e: ldc.i4.0 - IL_005f: stloc.3 - IL_0060: ldloc.0 - IL_0061: stloc.s V_4 - IL_0063: br.s IL_0079 - - IL_0065: ldloca.s V_2 - IL_0067: ldloc.s V_4 - IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006e: nop - IL_006f: ldloc.s V_4 - IL_0071: ldc.i4.m1 - IL_0072: add - IL_0073: stloc.s V_4 - IL_0075: ldloc.3 - IL_0076: ldc.i4.1 - IL_0077: add - IL_0078: stloc.3 - IL_0079: ldloc.3 - IL_007a: ldloc.1 - IL_007b: blt.un.s IL_0065 - - IL_007d: ldloca.s V_2 - IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0098: br.s IL_00e0 - - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a4: stloc.0 - IL_00a5: call int32[] assembly::get_r() - IL_00aa: ldloc.0 - IL_00ab: call int32[] assembly::get_r() - IL_00b0: ldloc.0 - IL_00b1: ldelem [runtime]System.Int32 - IL_00b6: call int32[] assembly::get_w() - IL_00bb: ldloc.0 - IL_00bc: ldelem [runtime]System.Int32 - IL_00c1: add - IL_00c2: stelem [runtime]System.Int32 - IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e5: brtrue.s IL_009a - - IL_00e7: nop - IL_00e8: nop - IL_00e9: call int32[] assembly::get_r() - IL_00ee: ldc.i4.0 - IL_00ef: ldelem [runtime]System.Int32 - IL_00f4: ldc.i4.3 - IL_00f5: bne.un.s IL_00fb - - IL_00f7: ldc.i4.0 - IL_00f8: nop - IL_00f9: br.s IL_00fd - - IL_00fb: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldloc.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.m1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 IL_00fc: nop - IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0102: pop - IL_0103: ret + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index 693c83d7540..575c04908a1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -170,9 +170,9 @@ .maxstack 7 .locals init (int32 V_0, - uint32 V_1, + uint64 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint32 V_3, + uint64 V_3, int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 @@ -207,89 +207,93 @@ IL_004c: stloc.0 IL_004d: ldloc.0 IL_004e: ldc.i4.0 - IL_004f: bge.s IL_0055 + IL_004f: bge.s IL_0056 IL_0051: ldc.i4.0 - IL_0052: nop - IL_0053: br.s IL_005d - - IL_0055: ldloc.0 - IL_0056: conv.i4 - IL_0057: ldc.i4.0 - IL_0058: conv.i4 - IL_0059: sub - IL_005a: ldc.i4.1 - IL_005b: add - IL_005c: nop - IL_005d: stloc.1 - IL_005e: ldc.i4.0 - IL_005f: stloc.3 - IL_0060: ldloc.0 - IL_0061: stloc.s V_4 - IL_0063: br.s IL_0079 - - IL_0065: ldloca.s V_2 - IL_0067: ldloc.s V_4 - IL_0069: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006e: nop - IL_006f: ldloc.s V_4 - IL_0071: ldc.i4.m1 - IL_0072: add - IL_0073: stloc.s V_4 - IL_0075: ldloc.3 - IL_0076: ldc.i4.1 - IL_0077: add - IL_0078: stloc.3 - IL_0079: ldloc.3 - IL_007a: ldloc.1 - IL_007b: blt.un.s IL_0065 - - IL_007d: ldloca.s V_2 - IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0084: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_0089: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0093: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_0098: br.s IL_00e0 - - IL_009a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_009f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a4: stloc.0 - IL_00a5: call int32[] assembly::get_r() - IL_00aa: ldloc.0 - IL_00ab: call int32[] assembly::get_r() - IL_00b0: ldloc.0 - IL_00b1: ldelem [runtime]System.Int32 - IL_00b6: call int32[] assembly::get_w() - IL_00bb: ldloc.0 - IL_00bc: ldelem [runtime]System.Int32 - IL_00c1: add - IL_00c2: stelem [runtime]System.Int32 - IL_00c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00cc: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d1: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00d6: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00db: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e5: brtrue.s IL_009a - - IL_00e7: nop - IL_00e8: nop - IL_00e9: call int32[] assembly::get_r() - IL_00ee: ldc.i4.0 - IL_00ef: ldelem [runtime]System.Int32 - IL_00f4: ldc.i4.3 - IL_00f5: bne.un.s IL_00fb - - IL_00f7: ldc.i4.0 - IL_00f8: nop - IL_00f9: br.s IL_00fd - - IL_00fb: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005f + + IL_0056: ldloc.0 + IL_0057: conv.i8 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: sub + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: nop + IL_005f: stloc.1 + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldloc.0 + IL_0064: stloc.s V_4 + IL_0066: br.s IL_007d + + IL_0068: ldloca.s V_2 + IL_006a: ldloc.s V_4 + IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0071: nop + IL_0072: ldloc.s V_4 + IL_0074: ldc.i4.m1 + IL_0075: add + IL_0076: stloc.s V_4 + IL_0078: ldloc.3 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.3 + IL_007d: ldloc.3 + IL_007e: ldloc.1 + IL_007f: blt.un.s IL_0068 + + IL_0081: ldloca.s V_2 + IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009c: br.s IL_00e4 + + IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a8: stloc.0 + IL_00a9: call int32[] assembly::get_r() + IL_00ae: ldloc.0 + IL_00af: call int32[] assembly::get_r() + IL_00b4: ldloc.0 + IL_00b5: ldelem [runtime]System.Int32 + IL_00ba: call int32[] assembly::get_w() + IL_00bf: ldloc.0 + IL_00c0: ldelem [runtime]System.Int32 + IL_00c5: add + IL_00c6: stelem [runtime]System.Int32 + IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e9: brtrue.s IL_009e + + IL_00eb: nop + IL_00ec: nop + IL_00ed: call int32[] assembly::get_r() + IL_00f2: ldc.i4.0 + IL_00f3: ldelem [runtime]System.Int32 + IL_00f8: ldc.i4.3 + IL_00f9: bne.un.s IL_00ff + + IL_00fb: ldc.i4.0 IL_00fc: nop - IL_00fd: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0102: pop - IL_0103: ret + IL_00fd: br.s IL_0101 + + IL_00ff: ldc.i4.1 + IL_0100: nop + IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0106: pop + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl index 83ce0aeb1f4..5ad3388f883 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl @@ -54,7 +54,7 @@ .locals init (int32 V_0, uint8[] V_1, uint8[] V_2, - uint8 V_3, + uint16 V_3, uint8 V_4, uint8[] V_5, int32 V_6) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl index 0194b6ee8cc..a21afa34f83 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl @@ -54,84 +54,96 @@ .locals init (int32 V_0, int32[] V_1, int32[] V_2, - int32 V_3, + uint64 V_3, int32 V_4, int32[] V_5) IL_0000: ldc.i4.1 IL_0001: stloc.0 IL_0002: ldc.i4.s 101 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.2 - IL_000a: ldc.i4.0 - IL_000b: stloc.3 + IL_0004: conv.i8 + IL_0005: conv.ovf.i.un + IL_0006: newarr [runtime]System.Int32 + IL_000b: stloc.2 IL_000c: ldc.i4.0 - IL_000d: stloc.s V_4 - IL_000f: br.s IL_0020 - - IL_0011: ldloc.2 - IL_0012: ldloc.3 - IL_0013: ldloc.s V_4 - IL_0015: stelem.i4 - IL_0016: ldloc.s V_4 - IL_0018: ldc.i4.1 - IL_0019: add - IL_001a: stloc.s V_4 - IL_001c: ldloc.3 - IL_001d: ldc.i4.1 - IL_001e: add - IL_001f: stloc.3 + IL_000d: conv.i8 + IL_000e: stloc.3 + IL_000f: ldc.i4.0 + IL_0010: stloc.s V_4 + IL_0012: br.s IL_0025 + + IL_0014: ldloc.2 + IL_0015: ldloc.3 + IL_0016: conv.ovf.i.un + IL_0017: ldloc.s V_4 + IL_0019: stelem.i4 + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 IL_0020: ldloc.3 - IL_0021: ldc.i4.s 101 - IL_0023: blt.un.s IL_0011 - - IL_0025: ldloc.2 - IL_0026: stloc.1 - IL_0027: ldc.i4.s 101 - IL_0029: newarr [runtime]System.Int32 - IL_002e: stloc.s V_5 - IL_0030: ldc.i4.0 - IL_0031: stloc.3 - IL_0032: ldc.i4.0 - IL_0033: stloc.s V_4 - IL_0035: br.s IL_0047 - - IL_0037: ldloc.s V_5 - IL_0039: ldloc.3 - IL_003a: ldloc.s V_4 - IL_003c: stelem.i4 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: add - IL_0041: stloc.s V_4 - IL_0043: ldloc.3 - IL_0044: ldc.i4.1 - IL_0045: add - IL_0046: stloc.3 - IL_0047: ldloc.3 - IL_0048: ldc.i4.s 101 - IL_004a: blt.un.s IL_0037 - - IL_004c: ldloc.s V_5 - IL_004e: stloc.2 - IL_004f: ldc.i4.0 - IL_0050: stloc.3 - IL_0051: br.s IL_005f - - IL_0053: ldloc.1 - IL_0054: ldloc.2 - IL_0055: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.3 + IL_0025: ldloc.3 + IL_0026: ldc.i4.s 101 + IL_0028: conv.i8 + IL_0029: blt.un.s IL_0014 + + IL_002b: ldloc.2 + IL_002c: stloc.1 + IL_002d: ldc.i4.s 101 + IL_002f: conv.i8 + IL_0030: conv.ovf.i.un + IL_0031: newarr [runtime]System.Int32 + IL_0036: stloc.s V_5 + IL_0038: ldc.i4.0 + IL_0039: conv.i8 + IL_003a: stloc.3 + IL_003b: ldc.i4.0 + IL_003c: stloc.s V_4 + IL_003e: br.s IL_0052 + + IL_0040: ldloc.s V_5 + IL_0042: ldloc.3 + IL_0043: conv.ovf.i.un + IL_0044: ldloc.s V_4 + IL_0046: stelem.i4 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.3 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.3 + IL_0053: ldc.i4.s 101 + IL_0055: conv.i8 + IL_0056: blt.un.s IL_0040 + + IL_0058: ldloc.s V_5 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: stloc.s V_4 + IL_005e: br.s IL_006e + + IL_0060: ldloc.1 + IL_0061: ldloc.2 + IL_0062: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, !!0) - IL_005a: stloc.0 - IL_005b: ldloc.3 - IL_005c: ldc.i4.1 - IL_005d: add - IL_005e: stloc.3 - IL_005f: ldloc.3 - IL_0060: ldc.i4 0x186a1 - IL_0065: blt.s IL_0053 - - IL_0067: ldloc.0 - IL_0068: ret + IL_0067: stloc.0 + IL_0068: ldloc.s V_4 + IL_006a: ldc.i4.1 + IL_006b: add + IL_006c: stloc.s V_4 + IL_006e: ldloc.s V_4 + IL_0070: ldc.i4 0x186a1 + IL_0075: blt.s IL_0060 + + IL_0077: ldloc.0 + IL_0078: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl index 96bfcceaa6f..9e7afe0aa8c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl @@ -54,7 +54,7 @@ .locals init (bool V_0, uint8[] V_1, uint8[] V_2, - uint8 V_3, + uint16 V_3, uint8 V_4, uint8[] V_5, int32 V_6) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl index 4dc06449fa8..2f33f892b34 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl @@ -54,84 +54,96 @@ .locals init (bool V_0, int32[] V_1, int32[] V_2, - int32 V_3, + uint64 V_3, int32 V_4, int32[] V_5) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: ldc.i4.s 101 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.2 - IL_000a: ldc.i4.0 - IL_000b: stloc.3 + IL_0004: conv.i8 + IL_0005: conv.ovf.i.un + IL_0006: newarr [runtime]System.Int32 + IL_000b: stloc.2 IL_000c: ldc.i4.0 - IL_000d: stloc.s V_4 - IL_000f: br.s IL_0020 - - IL_0011: ldloc.2 - IL_0012: ldloc.3 - IL_0013: ldloc.s V_4 - IL_0015: stelem.i4 - IL_0016: ldloc.s V_4 - IL_0018: ldc.i4.1 - IL_0019: add - IL_001a: stloc.s V_4 - IL_001c: ldloc.3 - IL_001d: ldc.i4.1 - IL_001e: add - IL_001f: stloc.3 + IL_000d: conv.i8 + IL_000e: stloc.3 + IL_000f: ldc.i4.0 + IL_0010: stloc.s V_4 + IL_0012: br.s IL_0025 + + IL_0014: ldloc.2 + IL_0015: ldloc.3 + IL_0016: conv.ovf.i.un + IL_0017: ldloc.s V_4 + IL_0019: stelem.i4 + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 IL_0020: ldloc.3 - IL_0021: ldc.i4.s 101 - IL_0023: blt.un.s IL_0011 - - IL_0025: ldloc.2 - IL_0026: stloc.1 - IL_0027: ldc.i4.s 101 - IL_0029: newarr [runtime]System.Int32 - IL_002e: stloc.s V_5 - IL_0030: ldc.i4.0 - IL_0031: stloc.3 - IL_0032: ldc.i4.0 - IL_0033: stloc.s V_4 - IL_0035: br.s IL_0047 - - IL_0037: ldloc.s V_5 - IL_0039: ldloc.3 - IL_003a: ldloc.s V_4 - IL_003c: stelem.i4 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: add - IL_0041: stloc.s V_4 - IL_0043: ldloc.3 - IL_0044: ldc.i4.1 - IL_0045: add - IL_0046: stloc.3 - IL_0047: ldloc.3 - IL_0048: ldc.i4.s 101 - IL_004a: blt.un.s IL_0037 - - IL_004c: ldloc.s V_5 - IL_004e: stloc.2 - IL_004f: ldc.i4.0 - IL_0050: stloc.3 - IL_0051: br.s IL_005f - - IL_0053: ldloc.1 - IL_0054: ldloc.2 - IL_0055: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.3 + IL_0025: ldloc.3 + IL_0026: ldc.i4.s 101 + IL_0028: conv.i8 + IL_0029: blt.un.s IL_0014 + + IL_002b: ldloc.2 + IL_002c: stloc.1 + IL_002d: ldc.i4.s 101 + IL_002f: conv.i8 + IL_0030: conv.ovf.i.un + IL_0031: newarr [runtime]System.Int32 + IL_0036: stloc.s V_5 + IL_0038: ldc.i4.0 + IL_0039: conv.i8 + IL_003a: stloc.3 + IL_003b: ldc.i4.0 + IL_003c: stloc.s V_4 + IL_003e: br.s IL_0052 + + IL_0040: ldloc.s V_5 + IL_0042: ldloc.3 + IL_0043: conv.ovf.i.un + IL_0044: ldloc.s V_4 + IL_0046: stelem.i4 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.3 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.3 + IL_0053: ldc.i4.s 101 + IL_0055: conv.i8 + IL_0056: blt.un.s IL_0040 + + IL_0058: ldloc.s V_5 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: stloc.s V_4 + IL_005e: br.s IL_006e + + IL_0060: ldloc.1 + IL_0061: ldloc.2 + IL_0062: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, !!0) - IL_005a: stloc.0 - IL_005b: ldloc.3 - IL_005c: ldc.i4.1 - IL_005d: add - IL_005e: stloc.3 - IL_005f: ldloc.3 - IL_0060: ldc.i4 0x989681 - IL_0065: blt.s IL_0053 - - IL_0067: ldloc.0 - IL_0068: ret + IL_0067: stloc.0 + IL_0068: ldloc.s V_4 + IL_006a: ldc.i4.1 + IL_006b: add + IL_006c: stloc.s V_4 + IL_006e: ldloc.s V_4 + IL_0070: ldc.i4 0x989681 + IL_0075: blt.s IL_0060 + + IL_0077: ldloc.0 + IL_0078: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl index e127d3e8285..0ad4e24c843 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl @@ -53,7 +53,7 @@ .maxstack 5 .locals init (uint8[] V_0, uint8[] V_1, - uint8 V_2, + uint16 V_2, uint8 V_3, int32 V_4, int32 V_5) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl index 81975739962..5df65bf7461 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl @@ -53,52 +53,59 @@ .maxstack 5 .locals init (int32[] V_0, int32[] V_1, - int32 V_2, - int32 V_3) + uint64 V_2, + int32 V_3, + int32 V_4) IL_0000: nop IL_0001: ldc.i4.s 101 - IL_0003: newarr [runtime]System.Int32 - IL_0008: stloc.1 - IL_0009: ldc.i4.0 - IL_000a: stloc.2 + IL_0003: conv.i8 + IL_0004: conv.ovf.i.un + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 IL_000b: ldc.i4.0 - IL_000c: stloc.3 - IL_000d: br.s IL_001b - - IL_000f: ldloc.1 - IL_0010: ldloc.2 - IL_0011: ldloc.3 - IL_0012: stelem.i4 - IL_0013: ldloc.3 - IL_0014: ldc.i4.1 - IL_0015: add - IL_0016: stloc.3 - IL_0017: ldloc.2 + IL_000c: conv.i8 + IL_000d: stloc.2 + IL_000e: ldc.i4.0 + IL_000f: stloc.3 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.1 + IL_0013: ldloc.2 + IL_0014: conv.ovf.i.un + IL_0015: ldloc.3 + IL_0016: stelem.i4 + IL_0017: ldloc.3 IL_0018: ldc.i4.1 IL_0019: add - IL_001a: stloc.2 + IL_001a: stloc.3 IL_001b: ldloc.2 - IL_001c: ldc.i4.s 101 - IL_001e: blt.un.s IL_000f - - IL_0020: ldloc.1 - IL_0021: stloc.0 - IL_0022: ldc.i4.0 - IL_0023: stloc.2 - IL_0024: br.s IL_0031 - - IL_0026: ldloc.0 - IL_0027: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) - IL_002c: stloc.3 - IL_002d: ldloc.2 - IL_002e: ldc.i4.1 - IL_002f: add - IL_0030: stloc.2 - IL_0031: ldloc.2 - IL_0032: ldc.i4 0x989681 - IL_0037: blt.s IL_0026 - - IL_0039: ret + 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 101 + IL_0023: conv.i8 + IL_0024: blt.un.s IL_0012 + + IL_0026: ldloc.1 + IL_0027: stloc.0 + IL_0028: ldc.i4.0 + IL_0029: stloc.3 + IL_002a: br.s IL_0038 + + IL_002c: ldloc.0 + IL_002d: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_0032: stloc.s V_4 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldc.i4 0x989681 + IL_003e: blt.s IL_002c + + IL_0040: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl index 3f9afd4e27a..152628d3105 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.il.bsl @@ -51,8 +51,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`2> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -63,8 +62,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`2 - Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`2 Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed { .maxstack 7 @@ -85,8 +83,7 @@ IL_0017: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -101,8 +98,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`2> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -113,8 +109,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`2 - Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`2 Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed { .maxstack 7 @@ -135,8 +130,7 @@ IL_0017: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -151,8 +145,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`3> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -163,8 +156,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`3 - Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`3 Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed { .maxstack 7 @@ -191,8 +183,7 @@ IL_001f: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -207,8 +198,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`3> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -219,8 +209,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`3 - Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`3 Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed { .maxstack 7 @@ -247,8 +236,7 @@ IL_001f: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -259,8 +247,7 @@ } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - f1() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f1() cil managed { .maxstack 4 @@ -287,8 +274,7 @@ IL_003a: ret } - .method public static class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> - f2(!!a x) cil managed + .method public static class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> f2(!!a x) cil managed { .maxstack 6 @@ -296,7 +282,7 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, - int32 V_4, + uint64 V_4, int32 V_5, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_6, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_7, @@ -304,11 +290,11 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_9, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_10, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_11, - int32 V_12, + uint64 V_12, int32 V_13, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_14, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_15, - int32 V_16, + uint64 V_16, int32 V_17, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_18, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_19) @@ -324,128 +310,137 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0017: stloc.1 IL_0018: ldc.i4.0 - IL_0019: stloc.s V_4 - IL_001b: ldc.i4.0 - IL_001c: stloc.s V_5 - IL_001e: br.s IL_0036 - - IL_0020: ldloca.s V_3 - IL_0022: ldloc.s V_5 - IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0029: nop - IL_002a: ldloc.s V_5 - IL_002c: ldc.i4.1 - IL_002d: add - IL_002e: stloc.s V_5 - IL_0030: ldloc.s V_4 - IL_0032: ldc.i4.1 - IL_0033: add - IL_0034: stloc.s V_4 - IL_0036: ldloc.s V_4 - IL_0038: ldc.i4.3 - IL_0039: blt.un.s IL_0020 - - IL_003b: ldloca.s V_3 - IL_003d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0042: stloc.2 - IL_0043: ldloc.1 - IL_0044: ldloc.2 - IL_0045: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + IL_0019: conv.i8 + IL_001a: stloc.s V_4 + IL_001c: ldc.i4.0 + IL_001d: stloc.s V_5 + IL_001f: br.s IL_0038 + + IL_0021: ldloca.s V_3 + IL_0023: ldloc.s V_5 + IL_0025: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002a: nop + IL_002b: ldloc.s V_5 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.s V_5 + IL_0031: ldloc.s V_4 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add + IL_0036: stloc.s V_4 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.3 + IL_003b: conv.i8 + IL_003c: blt.un.s IL_0021 + + IL_003e: ldloca.s V_3 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: stloc.2 + IL_0046: ldloc.1 + IL_0047: ldloc.2 + IL_0048: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_004a: stloc.s V_6 - IL_004c: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance - IL_0051: ldloc.s V_6 - IL_0053: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_004d: stloc.s V_6 + IL_004f: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance + IL_0054: ldloc.s V_6 + IL_0056: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0058: stloc.s V_7 - IL_005a: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance - IL_005f: ldloc.s V_7 - IL_0061: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_005b: stloc.s V_7 + IL_005d: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance + IL_0062: ldloc.s V_7 + IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0066: stloc.0 - IL_0067: ldarg.0 - IL_0068: ldarg.0 - IL_0069: ldarg.0 - IL_006a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_006f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0069: stloc.0 + IL_006a: ldarg.0 + IL_006b: ldarg.0 + IL_006c: ldarg.0 + IL_006d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0072: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0074: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0077: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0079: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_007c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_007e: stloc.s V_9 - IL_0080: ldc.i4.0 - IL_0081: stloc.s V_12 + IL_0081: stloc.s V_9 IL_0083: ldc.i4.0 - IL_0084: stloc.s V_13 - IL_0086: br.s IL_009e - - IL_0088: ldloca.s V_11 - IL_008a: ldloc.s V_13 - IL_008c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0091: nop - IL_0092: ldloc.s V_13 - IL_0094: ldc.i4.1 - IL_0095: add - IL_0096: stloc.s V_13 - IL_0098: ldloc.s V_12 - IL_009a: ldc.i4.1 - IL_009b: add - IL_009c: stloc.s V_12 - IL_009e: ldloc.s V_12 - IL_00a0: ldc.i4.3 - IL_00a1: blt.un.s IL_0088 - - IL_00a3: ldloca.s V_11 - IL_00a5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00aa: stloc.s V_10 - IL_00ac: ldc.i4.0 - IL_00ad: stloc.s V_16 - IL_00af: ldc.i4.0 - IL_00b0: stloc.s V_17 - IL_00b2: br.s IL_00ca - - IL_00b4: ldloca.s V_15 - IL_00b6: ldloc.s V_17 - IL_00b8: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_00bd: nop - IL_00be: ldloc.s V_17 - IL_00c0: ldc.i4.1 - IL_00c1: add - IL_00c2: stloc.s V_17 - IL_00c4: ldloc.s V_16 - IL_00c6: ldc.i4.1 - IL_00c7: add - IL_00c8: stloc.s V_16 - IL_00ca: ldloc.s V_16 - IL_00cc: ldc.i4.3 - IL_00cd: blt.un.s IL_00b4 - - IL_00cf: ldloca.s V_15 - IL_00d1: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00d6: stloc.s V_14 - IL_00d8: ldloc.s V_9 - IL_00da: ldloc.s V_10 - IL_00dc: ldloc.s V_14 - IL_00de: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + IL_0084: conv.i8 + IL_0085: stloc.s V_12 + IL_0087: ldc.i4.0 + IL_0088: stloc.s V_13 + IL_008a: br.s IL_00a3 + + IL_008c: ldloca.s V_11 + IL_008e: ldloc.s V_13 + IL_0090: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0095: nop + IL_0096: ldloc.s V_13 + IL_0098: ldc.i4.1 + IL_0099: add + IL_009a: stloc.s V_13 + IL_009c: ldloc.s V_12 + IL_009e: ldc.i4.1 + IL_009f: conv.i8 + IL_00a0: add + IL_00a1: stloc.s V_12 + IL_00a3: ldloc.s V_12 + IL_00a5: ldc.i4.3 + IL_00a6: conv.i8 + IL_00a7: blt.un.s IL_008c + + IL_00a9: ldloca.s V_11 + IL_00ab: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b0: stloc.s V_10 + IL_00b2: ldc.i4.0 + IL_00b3: conv.i8 + IL_00b4: stloc.s V_16 + IL_00b6: ldc.i4.0 + IL_00b7: stloc.s V_17 + IL_00b9: br.s IL_00d2 + + IL_00bb: ldloca.s V_15 + IL_00bd: ldloc.s V_17 + IL_00bf: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00c4: nop + IL_00c5: ldloc.s V_17 + IL_00c7: ldc.i4.1 + IL_00c8: add + IL_00c9: stloc.s V_17 + IL_00cb: ldloc.s V_16 + IL_00cd: ldc.i4.1 + IL_00ce: conv.i8 + IL_00cf: add + IL_00d0: stloc.s V_16 + IL_00d2: ldloc.s V_16 + IL_00d4: ldc.i4.3 + IL_00d5: conv.i8 + IL_00d6: blt.un.s IL_00bb + + IL_00d8: ldloca.s V_15 + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00df: stloc.s V_14 + IL_00e1: ldloc.s V_9 + IL_00e3: ldloc.s V_10 + IL_00e5: ldloc.s V_14 + IL_00e7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e3: stloc.s V_18 - IL_00e5: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance - IL_00ea: ldloc.s V_18 - IL_00ec: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_00ec: stloc.s V_18 + IL_00ee: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance + IL_00f3: ldloc.s V_18 + IL_00f5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00f1: stloc.s V_19 - IL_00f3: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance - IL_00f8: ldloc.s V_19 - IL_00fa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_00fa: stloc.s V_19 + IL_00fc: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance + IL_0101: ldloc.s V_19 + IL_0103: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00ff: stloc.s V_8 - IL_0101: ldloc.0 - IL_0102: ldloc.s V_8 - IL_0104: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, + IL_0108: stloc.s V_8 + IL_010a: ldloc.0 + IL_010b: ldloc.s V_8 + IL_010d: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, !1) - IL_0109: ret + IL_0112: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl index 495b69d0bea..8adceb1f839 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.il.bsl @@ -72,8 +72,7 @@ IL_0014: ret } - .method public strict virtual instance int32 - GenerateNext(class [runtime]System.Collections.Generic.IEnumerable`1>& next) cil managed + .method public strict virtual instance int32 GenerateNext(class [runtime]System.Collections.Generic.IEnumerable`1>& next) cil managed { .maxstack 7 @@ -131,8 +130,7 @@ IL_0060: ret } - .method public strict virtual instance void - Close() cil managed + .method public strict virtual instance void Close() cil managed { .maxstack 8 @@ -142,8 +140,7 @@ IL_0007: ret } - .method public strict virtual instance bool - get_CheckClose() cil managed + .method public strict virtual instance bool get_CheckClose() cil managed { .maxstack 8 @@ -179,8 +176,7 @@ IL_002f: ret } - .method public strict virtual instance class [runtime]System.Tuple`2 - get_LastGenerated() cil managed + .method public strict virtual instance class [runtime]System.Tuple`2 get_LastGenerated() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -191,8 +187,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Collections.Generic.IEnumerator`1> - GetFreshEnumerator() cil managed + .method public strict virtual instance class [runtime]System.Collections.Generic.IEnumerator`1> GetFreshEnumerator() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -207,8 +202,7 @@ } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_alist() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_alist() cil managed { .maxstack 8 @@ -216,8 +210,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_array() cil managed + .method public specialname static int32[] get_array() cil managed { .maxstack 8 @@ -225,8 +218,7 @@ IL_0005: ret } - .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1 - get_aseq() cil managed + .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1 get_aseq() cil managed { .maxstack 8 @@ -234,8 +226,7 @@ IL_0005: ret } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - get_list1() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> get_list1() cil managed { .maxstack 8 @@ -243,8 +234,7 @@ IL_0005: ret } - .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1> - get_seq1() cil managed + .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1> get_seq1() cil managed { .maxstack 8 @@ -252,8 +242,7 @@ IL_0005: ret } - .method public specialname static class [runtime]System.Tuple`2[] - get_array1() cil managed + .method public specialname static class [runtime]System.Tuple`2[] get_array1() cil managed { .maxstack 8 @@ -261,8 +250,7 @@ IL_0005: ret } - .method public specialname static int32[0...,0...] - get_a3() cil managed + .method public specialname static int32[0...,0...] get_a3() cil managed { .maxstack 8 @@ -270,8 +258,7 @@ IL_0005: ret } - .method public specialname static int32[0...,0...,0...] - get_array3D() cil managed + .method public specialname static int32[0...,0...,0...] get_array3D() cil managed { .maxstack 8 @@ -279,8 +266,7 @@ IL_0005: ret } - .method public specialname static int32[0...,0...,0...,0...] - get_array4D() cil managed + .method public specialname static int32[0...,0...,0...,0...] get_array4D() cil managed { .maxstack 8 @@ -288,8 +274,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_a1() cil managed + .method public specialname static int32[] get_a1() cil managed { .maxstack 8 @@ -297,8 +282,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_a2() cil managed + .method public specialname static int32[] get_a2() cil managed { .maxstack 8 @@ -414,7 +398,7 @@ int32[] V_9, int32[] V_10, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_11, - int32 V_12, + uint64 V_12, int32 V_13, int32 V_14, class [runtime]System.Tuple`4 V_15, @@ -427,274 +411,277 @@ class [runtime]System.Tuple`4 V_22, int32 V_23) IL_0000: ldc.i4.0 - IL_0001: stloc.s V_12 - IL_0003: ldc.i4.1 - IL_0004: stloc.s V_13 - IL_0006: br.s IL_001e - - IL_0008: ldloca.s V_11 - IL_000a: ldloc.s V_13 - IL_000c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0011: nop - IL_0012: ldloc.s V_13 - IL_0014: ldc.i4.1 - IL_0015: add - IL_0016: stloc.s V_13 - IL_0018: ldloc.s V_12 - IL_001a: ldc.i4.1 - IL_001b: add - IL_001c: stloc.s V_12 - IL_001e: ldloc.s V_12 - IL_0020: ldc.i4.s 10 - IL_0022: blt.un.s IL_0008 - - IL_0024: ldloca.s V_11 - IL_0026: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_002b: dup - IL_002c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::alist@5 - IL_0031: stloc.0 - IL_0032: ldc.i4.3 - IL_0033: newarr [runtime]System.Int32 - IL_0038: dup - IL_0039: ldc.i4.0 - IL_003a: ldc.i4.1 - IL_003b: stelem [runtime]System.Int32 - IL_0040: dup - IL_0041: ldc.i4.1 - IL_0042: ldc.i4.2 - IL_0043: stelem [runtime]System.Int32 - IL_0048: dup - IL_0049: ldc.i4.2 - IL_004a: ldc.i4.3 - IL_004b: stelem [runtime]System.Int32 - IL_0050: dup - IL_0051: stsfld int32[] ''.$assembly::array@6 - IL_0056: stloc.1 - IL_0057: ldc.i4.1 - IL_0058: ldc.i4.1 - IL_0059: ldc.i4.s 10 - IL_005b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + IL_0001: conv.i8 + IL_0002: stloc.s V_12 + IL_0004: ldc.i4.1 + IL_0005: stloc.s V_13 + IL_0007: br.s IL_0020 + + IL_0009: ldloca.s V_11 + IL_000b: ldloc.s V_13 + IL_000d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0012: nop + IL_0013: ldloc.s V_13 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stloc.s V_13 + IL_0019: ldloc.s V_12 + IL_001b: ldc.i4.1 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.s V_12 + IL_0020: ldloc.s V_12 + IL_0022: ldc.i4.s 10 + IL_0024: conv.i8 + IL_0025: blt.un.s IL_0009 + + IL_0027: ldloca.s V_11 + IL_0029: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_002e: dup + IL_002f: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::alist@5 + IL_0034: stloc.0 + IL_0035: ldc.i4.3 + IL_0036: newarr [runtime]System.Int32 + IL_003b: dup + IL_003c: ldc.i4.0 + IL_003d: ldc.i4.1 + IL_003e: stelem [runtime]System.Int32 + IL_0043: dup + IL_0044: ldc.i4.1 + IL_0045: ldc.i4.2 + IL_0046: stelem [runtime]System.Int32 + IL_004b: dup + IL_004c: ldc.i4.2 + IL_004d: ldc.i4.3 + IL_004e: stelem [runtime]System.Int32 + IL_0053: dup + IL_0054: stsfld int32[] ''.$assembly::array@6 + IL_0059: stloc.1 + IL_005a: ldc.i4.1 + IL_005b: ldc.i4.1 + IL_005c: ldc.i4.s 10 + IL_005e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_0060: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0065: dup - IL_0066: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 ''.$assembly::aseq@7 - IL_006b: stloc.2 - IL_006c: ldc.i4.1 - IL_006d: ldc.i4.1 - IL_006e: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_0063: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0068: dup + IL_0069: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 ''.$assembly::aseq@7 + IL_006e: stloc.2 + IL_006f: ldc.i4.1 + IL_0070: ldc.i4.1 + IL_0071: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_0073: ldc.i4.2 - IL_0074: ldc.i4.2 - IL_0075: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_0076: ldc.i4.2 + IL_0077: ldc.i4.2 + IL_0078: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_007a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() - IL_007f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + IL_007d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() + IL_0082: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0084: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + IL_0087: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0089: dup - IL_008a: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> ''.$assembly::list1@8 - IL_008f: stloc.3 - IL_0090: ldc.i4.0 - IL_0091: ldnull - IL_0092: newobj instance void assembly/seq1@9::.ctor(int32, + IL_008c: dup + IL_008d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> ''.$assembly::list1@8 + IL_0092: stloc.3 + IL_0093: ldc.i4.0 + IL_0094: ldnull + IL_0095: newobj instance void assembly/seq1@9::.ctor(int32, class [runtime]System.Tuple`2) - IL_0097: dup - IL_0098: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> ''.$assembly::seq1@9 - IL_009d: stloc.s V_4 - IL_009f: ldc.i4.2 - IL_00a0: newarr class [runtime]System.Tuple`2 - IL_00a5: dup - IL_00a6: ldc.i4.0 - IL_00a7: ldc.i4.1 - IL_00a8: ldc.i4.1 - IL_00a9: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_009a: dup + IL_009b: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> ''.$assembly::seq1@9 + IL_00a0: stloc.s V_4 + IL_00a2: ldc.i4.2 + IL_00a3: newarr class [runtime]System.Tuple`2 + IL_00a8: dup + IL_00a9: ldc.i4.0 + IL_00aa: ldc.i4.1 + IL_00ab: ldc.i4.1 + IL_00ac: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_00ae: stelem class [runtime]System.Tuple`2 - IL_00b3: dup - IL_00b4: ldc.i4.1 - IL_00b5: ldc.i4.2 - IL_00b6: ldc.i4.2 - IL_00b7: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + IL_00b1: stelem class [runtime]System.Tuple`2 + IL_00b6: dup + IL_00b7: ldc.i4.1 + IL_00b8: ldc.i4.2 + IL_00b9: ldc.i4.2 + IL_00ba: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, !1) - IL_00bc: stelem class [runtime]System.Tuple`2 - IL_00c1: dup - IL_00c2: stsfld class [runtime]System.Tuple`2[] ''.$assembly::array1@10 - IL_00c7: stloc.s V_5 - IL_00c9: ldc.i4.2 - IL_00ca: ldc.i4.2 - IL_00cb: ldc.i4.0 - IL_00cc: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, + IL_00bf: stelem class [runtime]System.Tuple`2 + IL_00c4: dup + IL_00c5: stsfld class [runtime]System.Tuple`2[] ''.$assembly::array1@10 + IL_00ca: stloc.s V_5 + IL_00cc: ldc.i4.2 + IL_00cd: ldc.i4.2 + IL_00ce: ldc.i4.0 + IL_00cf: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, int32, !!0) - IL_00d1: dup - IL_00d2: stsfld int32[0...,0...] ''.$assembly::a3@11 - IL_00d7: stloc.s V_6 - IL_00d9: ldc.i4.3 - IL_00da: ldc.i4.3 - IL_00db: ldc.i4.3 - IL_00dc: ldc.i4.0 - IL_00dd: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, + IL_00d4: dup + IL_00d5: stsfld int32[0...,0...] ''.$assembly::a3@11 + IL_00da: stloc.s V_6 + IL_00dc: ldc.i4.3 + IL_00dd: ldc.i4.3 + IL_00de: ldc.i4.3 + IL_00df: ldc.i4.0 + IL_00e0: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, int32, int32, !!0) - IL_00e2: dup - IL_00e3: stsfld int32[0...,0...,0...] ''.$assembly::array3D@12 - IL_00e8: stloc.s V_7 - IL_00ea: ldc.i4.4 - IL_00eb: ldc.i4.4 - IL_00ec: ldc.i4.4 + IL_00e5: dup + IL_00e6: stsfld int32[0...,0...,0...] ''.$assembly::array3D@12 + IL_00eb: stloc.s V_7 IL_00ed: ldc.i4.4 - IL_00ee: ldc.i4.0 - IL_00ef: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, + IL_00ee: ldc.i4.4 + IL_00ef: ldc.i4.4 + IL_00f0: ldc.i4.4 + IL_00f1: ldc.i4.0 + IL_00f2: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, int32, int32, int32, !!0) - IL_00f4: dup - IL_00f5: stsfld int32[0...,0...,0...,0...] ''.$assembly::array4D@13 - IL_00fa: stloc.s V_8 - IL_00fc: call int32[] assembly::get_array() - IL_0101: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) - IL_0106: pop - IL_0107: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_010c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0111: pop - IL_0112: call class [runtime]System.Tuple`2[] assembly::get_array1() - IL_0117: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) - IL_011c: pop - IL_011d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() - IL_0122: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) - IL_0127: pop - IL_0128: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() - IL_012d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) - IL_0132: pop - IL_0133: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() - IL_0138: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_013d: dup - IL_013e: stsfld int32[] ''.$assembly::a1@25 - IL_0143: stloc.s V_9 - IL_0145: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_014a: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_014f: dup - IL_0150: stsfld int32[] ''.$assembly::a2@26 - IL_0155: stloc.s V_10 - IL_0157: call int32[] assembly::get_a1() - IL_015c: ldc.i4.0 - IL_015d: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], + IL_00f7: dup + IL_00f8: stsfld int32[0...,0...,0...,0...] ''.$assembly::array4D@13 + IL_00fd: stloc.s V_8 + IL_00ff: call int32[] assembly::get_array() + IL_0104: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) + IL_0109: pop + IL_010a: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_010f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0114: pop + IL_0115: call class [runtime]System.Tuple`2[] assembly::get_array1() + IL_011a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) + IL_011f: pop + IL_0120: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() + IL_0125: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) + IL_012a: pop + IL_012b: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() + IL_0130: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) + IL_0135: pop + IL_0136: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() + IL_013b: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0140: dup + IL_0141: stsfld int32[] ''.$assembly::a1@25 + IL_0146: stloc.s V_9 + IL_0148: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_014d: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0152: dup + IL_0153: stsfld int32[] ''.$assembly::a2@26 + IL_0158: stloc.s V_10 + IL_015a: call int32[] assembly::get_a1() + IL_015f: ldc.i4.0 + IL_0160: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], int32) - IL_0162: stloc.s V_14 - IL_0164: call int32[] assembly::get_a2() - IL_0169: ldc.i4.0 - IL_016a: ldloc.s V_14 - IL_016c: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], + IL_0165: stloc.s V_14 + IL_0167: call int32[] assembly::get_a2() + IL_016c: ldc.i4.0 + IL_016d: ldloc.s V_14 + IL_016f: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], int32, !!0) - IL_0171: nop - IL_0172: call int32[0...,0...] assembly::get_a3() - IL_0177: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) - IL_017c: call int32[0...,0...] assembly::get_a3() - IL_0181: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) - IL_0186: call int32[0...,0...] assembly::get_a3() - IL_018b: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) - IL_0190: call int32[0...,0...] assembly::get_a3() - IL_0195: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) - IL_019a: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + IL_0174: nop + IL_0175: call int32[0...,0...] assembly::get_a3() + IL_017a: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) + IL_017f: call int32[0...,0...] assembly::get_a3() + IL_0184: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) + IL_0189: call int32[0...,0...] assembly::get_a3() + IL_018e: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) + IL_0193: call int32[0...,0...] assembly::get_a3() + IL_0198: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) + IL_019d: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, !1, !2, !3) - IL_019f: stloc.s V_15 - IL_01a1: ldloc.s V_15 - IL_01a3: stloc.s V_16 - IL_01a5: call int32[0...,0...] assembly::get_a3() - IL_01aa: ldc.i4.0 - IL_01ab: ldc.i4.0 - IL_01ac: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], + IL_01a2: stloc.s V_15 + IL_01a4: ldloc.s V_15 + IL_01a6: stloc.s V_16 + IL_01a8: call int32[0...,0...] assembly::get_a3() + IL_01ad: ldc.i4.0 + IL_01ae: ldc.i4.0 + IL_01af: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], int32, int32) - IL_01b1: stloc.s V_17 - IL_01b3: call int32[0...,0...] assembly::get_a3() - IL_01b8: ldc.i4.0 - IL_01b9: ldc.i4.0 - IL_01ba: ldloc.s V_17 - IL_01bc: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], + IL_01b4: stloc.s V_17 + IL_01b6: call int32[0...,0...] assembly::get_a3() + IL_01bb: ldc.i4.0 + IL_01bc: ldc.i4.0 + IL_01bd: ldloc.s V_17 + IL_01bf: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], int32, int32, !!0) - IL_01c1: nop - IL_01c2: call int32[0...,0...,0...] assembly::get_array3D() - IL_01c7: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) - IL_01cc: call int32[0...,0...,0...] assembly::get_array3D() - IL_01d1: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) - IL_01d6: call int32[0...,0...,0...] assembly::get_array3D() - IL_01db: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) - IL_01e0: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, + IL_01c4: nop + IL_01c5: call int32[0...,0...,0...] assembly::get_array3D() + IL_01ca: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) + IL_01cf: call int32[0...,0...,0...] assembly::get_array3D() + IL_01d4: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) + IL_01d9: call int32[0...,0...,0...] assembly::get_array3D() + IL_01de: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) + IL_01e3: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, !1, !2) - IL_01e5: stloc.s V_18 - IL_01e7: ldloc.s V_18 - IL_01e9: stloc.s V_19 - IL_01eb: call int32[0...,0...,0...] assembly::get_array3D() - IL_01f0: ldc.i4.0 - IL_01f1: ldc.i4.0 - IL_01f2: ldc.i4.0 - IL_01f3: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], + IL_01e8: stloc.s V_18 + IL_01ea: ldloc.s V_18 + IL_01ec: stloc.s V_19 + IL_01ee: call int32[0...,0...,0...] assembly::get_array3D() + IL_01f3: ldc.i4.0 + IL_01f4: ldc.i4.0 + IL_01f5: ldc.i4.0 + IL_01f6: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], int32, int32, int32) - IL_01f8: stloc.s V_20 - IL_01fa: call int32[0...,0...,0...] assembly::get_array3D() - IL_01ff: ldc.i4.0 - IL_0200: ldc.i4.0 - IL_0201: ldc.i4.0 - IL_0202: ldloc.s V_20 - IL_0204: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], + IL_01fb: stloc.s V_20 + IL_01fd: call int32[0...,0...,0...] assembly::get_array3D() + IL_0202: ldc.i4.0 + IL_0203: ldc.i4.0 + IL_0204: ldc.i4.0 + IL_0205: ldloc.s V_20 + IL_0207: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], int32, int32, int32, !!0) - IL_0209: nop - IL_020a: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_020f: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) - IL_0214: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0219: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) - IL_021e: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0223: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) - IL_0228: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_022d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) - IL_0232: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + IL_020c: nop + IL_020d: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0212: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) + IL_0217: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_021c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) + IL_0221: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0226: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) + IL_022b: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0230: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) + IL_0235: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, !1, !2, !3) - IL_0237: stloc.s V_21 - IL_0239: ldloc.s V_21 - IL_023b: stloc.s V_22 - IL_023d: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0242: ldc.i4.0 - IL_0243: ldc.i4.0 - IL_0244: ldc.i4.0 + IL_023a: stloc.s V_21 + IL_023c: ldloc.s V_21 + IL_023e: stloc.s V_22 + IL_0240: call int32[0...,0...,0...,0...] assembly::get_array4D() IL_0245: ldc.i4.0 - IL_0246: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], + IL_0246: ldc.i4.0 + IL_0247: ldc.i4.0 + IL_0248: ldc.i4.0 + IL_0249: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], int32, int32, int32, int32) - IL_024b: stloc.s V_23 - IL_024d: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0252: ldc.i4.0 - IL_0253: ldc.i4.0 - IL_0254: ldc.i4.0 + IL_024e: stloc.s V_23 + IL_0250: call int32[0...,0...,0...,0...] assembly::get_array4D() IL_0255: ldc.i4.0 - IL_0256: ldloc.s V_23 - IL_0258: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], + IL_0256: ldc.i4.0 + IL_0257: ldc.i4.0 + IL_0258: ldc.i4.0 + IL_0259: ldloc.s V_23 + IL_025b: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], int32, int32, int32, int32, !!0) - IL_025d: nop - IL_025e: ret + IL_0260: nop + IL_0261: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl index 7b90ebb8713..f15078e1d26 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.il.bsl @@ -59,58 +59,61 @@ .maxstack 4 .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - int32 V_2, + uint64 V_2, int32 V_3, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_4, int32 V_5) IL_0000: ldc.i4.0 - IL_0001: stloc.2 - IL_0002: ldc.i4.1 - IL_0003: stloc.3 - IL_0004: br.s IL_0017 - - IL_0006: ldloca.s V_1 - IL_0008: ldloc.3 - IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_000e: nop - IL_000f: ldloc.3 - IL_0010: ldc.i4.1 - IL_0011: add - IL_0012: stloc.3 - IL_0013: ldloc.2 - IL_0014: ldc.i4.1 - IL_0015: add - IL_0016: stloc.2 - IL_0017: ldloc.2 - IL_0018: ldc.i4.3 - IL_0019: blt.un.s IL_0006 - - IL_001b: ldloca.s V_1 - IL_001d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0022: stloc.0 - IL_0023: ldloc.0 - IL_0024: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0029: stloc.s V_4 - IL_002b: br.s IL_0057 - - IL_002d: ldloc.0 - IL_002e: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0033: stloc.s V_5 - IL_0035: ldstr "%A" - IL_003a: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_003f: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0044: ldloc.s V_5 - IL_0046: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_004b: pop - IL_004c: ldloc.s V_4 - IL_004e: stloc.0 - IL_004f: ldloc.0 - IL_0050: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0055: stloc.s V_4 - IL_0057: ldloc.s V_4 - IL_0059: brtrue.s IL_002d - - IL_005b: ret + IL_0001: conv.i8 + IL_0002: stloc.2 + IL_0003: ldc.i4.1 + IL_0004: stloc.3 + IL_0005: br.s IL_0019 + + IL_0007: ldloca.s V_1 + IL_0009: ldloc.3 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.3 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.3 + IL_0014: ldloc.2 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.2 + IL_0019: ldloc.2 + IL_001a: ldc.i4.3 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0007 + + IL_001e: ldloca.s V_1 + IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0025: stloc.0 + IL_0026: ldloc.0 + IL_0027: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_002c: stloc.s V_4 + IL_002e: br.s IL_005a + + IL_0030: ldloc.0 + IL_0031: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0036: stloc.s V_5 + IL_0038: ldstr "%A" + IL_003d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_0042: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0047: ldloc.s V_5 + IL_0049: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_004e: pop + IL_004f: ldloc.s V_4 + IL_0051: stloc.0 + IL_0052: ldloc.0 + IL_0053: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0058: stloc.s V_4 + IL_005a: ldloc.s V_4 + IL_005c: brtrue.s IL_0030 + + IL_005e: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl index 72a8641da81..da6effebb3b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl @@ -420,53 +420,57 @@ { .maxstack 4 - .locals init (uint32 V_0, - uint32 V_1, + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0008 + IL_0002: bge.s IL_0009 IL_0004: ldc.i4.0 - IL_0005: nop - IL_0006: br.s IL_0010 - - IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldarg.1 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0031 - - IL_0017: ldloc.2 - IL_0018: stloc.3 - IL_0019: ldstr "{0}" - IL_001e: ldloc.3 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0035 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, object) - IL_0029: ldloc.2 - IL_002a: ldc.i4.m1 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.1 - IL_002e: ldc.i4.1 - IL_002f: add - IL_0030: stloc.1 - IL_0031: ldloc.1 - IL_0032: ldloc.0 - IL_0033: blt.un.s IL_0017 + IL_002c: ldloc.2 + IL_002d: ldc.i4.m1 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.1 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.1 + IL_0035: ldloc.1 + IL_0036: ldloc.0 + IL_0037: blt.un.s IL_001a - IL_0035: ret + IL_0039: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, @@ -474,58 +478,62 @@ { .maxstack 4 - .locals init (uint32 V_0, - uint32 V_1, + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0008 + IL_0002: bge.s IL_0009 IL_0004: ldc.i4.0 - IL_0005: nop - IL_0006: br.s IL_0010 - - IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldarg.1 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0041 - - IL_0017: ldloc.2 - IL_0018: stloc.3 - IL_0019: ldstr "{0}" - IL_001e: ldloc.3 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0045 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.3 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, + IL_002c: ldstr "{0}" + IL_0031: ldloc.3 + IL_0032: box [runtime]System.Int32 + IL_0037: call void [runtime]System.Console::WriteLine(string, object) - IL_0039: ldloc.2 - IL_003a: ldc.i4.m1 - IL_003b: add - IL_003c: stloc.2 - IL_003d: ldloc.1 - IL_003e: ldc.i4.1 - IL_003f: add - IL_0040: stloc.1 - IL_0041: ldloc.1 - IL_0042: ldloc.0 - IL_0043: blt.un.s IL_0017 - - IL_0045: ret + IL_003c: ldloc.2 + IL_003d: ldc.i4.m1 + IL_003e: add + IL_003f: stloc.2 + IL_0040: ldloc.1 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.1 + IL_0045: ldloc.1 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_001a + + IL_0049: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl index 5aadb5c2879..fb1d75e8743 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl @@ -421,53 +421,57 @@ { .maxstack 4 - .locals init (uint32 V_0, - uint32 V_1, + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0008 + IL_0002: bge.s IL_0009 IL_0004: ldc.i4.0 - IL_0005: nop - IL_0006: br.s IL_0010 - - IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldarg.1 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0031 - - IL_0017: ldloc.2 - IL_0018: stloc.3 - IL_0019: ldstr "{0}" - IL_001e: ldloc.3 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0035 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, object) - IL_0029: ldloc.2 - IL_002a: ldc.i4.m1 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.1 - IL_002e: ldc.i4.1 - IL_002f: add - IL_0030: stloc.1 - IL_0031: ldloc.1 - IL_0032: ldloc.0 - IL_0033: blt.un.s IL_0017 + IL_002c: ldloc.2 + IL_002d: ldc.i4.m1 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.1 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.1 + IL_0035: ldloc.1 + IL_0036: ldloc.0 + IL_0037: blt.un.s IL_001a - IL_0035: ret + IL_0039: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, @@ -475,58 +479,62 @@ { .maxstack 4 - .locals init (uint32 V_0, - uint32 V_1, + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, int32 V_3) IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: bge.s IL_0008 + IL_0002: bge.s IL_0009 IL_0004: ldc.i4.0 - IL_0005: nop - IL_0006: br.s IL_0010 - - IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldarg.1 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0041 - - IL_0017: ldloc.2 - IL_0018: stloc.3 - IL_0019: ldstr "{0}" - IL_001e: ldloc.3 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldarg.1 + IL_000c: conv.i8 + IL_000d: sub + 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.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0045 + + IL_001a: ldloc.2 + IL_001b: stloc.3 + IL_001c: ldstr "{0}" + IL_0021: ldloc.3 + IL_0022: box [runtime]System.Int32 + IL_0027: call void [runtime]System.Console::WriteLine(string, object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.3 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, + IL_002c: ldstr "{0}" + IL_0031: ldloc.3 + IL_0032: box [runtime]System.Int32 + IL_0037: call void [runtime]System.Console::WriteLine(string, object) - IL_0039: ldloc.2 - IL_003a: ldc.i4.m1 - IL_003b: add - IL_003c: stloc.2 - IL_003d: ldloc.1 - IL_003e: ldc.i4.1 - IL_003f: add - IL_0040: stloc.1 - IL_0041: ldloc.1 - IL_0042: ldloc.0 - IL_0043: blt.un.s IL_0017 - - IL_0045: ret + IL_003c: ldloc.2 + IL_003d: ldc.i4.m1 + IL_003e: add + IL_003f: stloc.2 + IL_0040: ldloc.1 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.1 + IL_0045: ldloc.1 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_001a + + IL_0049: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index f5b45364e2c..08ebf205a7d 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -126,35 +126,41 @@ module Int32 = .maxstack 5 .locals init (int32[] V_0, - int32 V_1, + uint64 V_1, int32 V_2) IL_0000: ldc.i4 0x101 - IL_0005: newarr [runtime]System.Int32 - IL_000a: stloc.0 - IL_000b: ldc.i4.0 - IL_000c: stloc.1 - IL_000d: ldc.i4.1 - IL_000e: stloc.2 - IL_000f: br.s IL_001d - - IL_0011: ldloc.0 - IL_0012: ldloc.1 - IL_0013: ldloc.2 - IL_0014: stelem.i4 - IL_0015: ldloc.2 - IL_0016: ldc.i4.1 - IL_0017: add - IL_0018: stloc.2 - IL_0019: ldloc.1 + IL_0005: conv.i8 + IL_0006: conv.ovf.i.un + IL_0007: newarr [runtime]System.Int32 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldc.i4.1 + IL_0011: stloc.2 + IL_0012: br.s IL_0022 + + IL_0014: ldloc.0 + IL_0015: ldloc.1 + IL_0016: conv.ovf.i.un + IL_0017: ldloc.2 + IL_0018: stelem.i4 + IL_0019: ldloc.2 IL_001a: ldc.i4.1 IL_001b: add - IL_001c: stloc.1 + IL_001c: stloc.2 IL_001d: ldloc.1 - IL_001e: ldc.i4 0x101 - IL_0023: blt.un.s IL_0011 - - IL_0025: ldloc.0 - IL_0026: ret + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: add + IL_0021: stloc.1 + IL_0022: ldloc.1 + IL_0023: ldc.i4 0x101 + IL_0028: conv.i8 + IL_0029: blt.un.s IL_0014 + + IL_002b: ldloc.0 + IL_002c: ret } } @@ -218,59 +224,66 @@ module Int32 = .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 (uint32 V_0, + .locals init (uint64 V_0, int32[] V_1, - uint32 V_2, + uint64 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: bge.s IL_0007 + IL_0002: bge.s IL_0008 IL_0004: ldc.i4.0 - IL_0005: br.s IL_000e - - IL_0007: ldarg.1 - IL_0008: conv.i4 - IL_0009: ldarg.0 - IL_000a: conv.i4 - IL_000b: sub - IL_000c: ldc.i4.1 - IL_000d: add - IL_000e: stloc.0 - IL_000f: ldloc.0 - IL_0010: ldc.i4.1 - IL_0011: bge.un.s IL_0019 - - IL_0013: call !!0[] [runtime]System.Array::Empty() - IL_0018: ret + IL_0005: conv.i8 + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i8 + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: stloc.0 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: bge.un.s IL_001c + + IL_0016: call !!0[] [runtime]System.Array::Empty() + IL_001b: ret + + IL_001c: ldloc.0 + IL_001d: conv.ovf.i.un + IL_001e: newarr [runtime]System.Int32 + IL_0023: stloc.1 + IL_0024: ldc.i4.0 + IL_0025: conv.i8 + IL_0026: stloc.2 + IL_0027: ldarg.0 + IL_0028: stloc.3 + IL_0029: br.s IL_0039 + + IL_002b: ldloc.1 + IL_002c: ldloc.2 + IL_002d: conv.ovf.i.un + IL_002e: ldloc.3 + IL_002f: stelem.i4 + IL_0030: ldloc.3 + IL_0031: ldc.i4.1 + IL_0032: add + IL_0033: stloc.3 + IL_0034: ldloc.2 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.2 + IL_003a: ldloc.0 + IL_003b: blt.un.s IL_002b - IL_0019: ldloc.0 - IL_001a: newarr [runtime]System.Int32 - IL_001f: stloc.1 - IL_0020: ldc.i4.0 - IL_0021: stloc.2 - IL_0022: ldarg.0 - IL_0023: stloc.3 - IL_0024: br.s IL_0032 - - IL_0026: ldloc.1 - IL_0027: ldloc.2 - IL_0028: ldloc.3 - IL_0029: stelem.i4 - IL_002a: ldloc.3 - IL_002b: ldc.i4.1 - IL_002c: add - IL_002d: stloc.3 - IL_002e: ldloc.2 - IL_002f: ldc.i4.1 - IL_0030: add - IL_0031: stloc.2 - IL_0032: ldloc.2 - IL_0033: ldloc.0 - IL_0034: blt.un.s IL_0026 - - IL_0036: ldloc.1 - IL_0037: ret + IL_003d: ldloc.1 + IL_003e: ret } } @@ -359,9 +372,9 @@ module Int32 = .maxstack 5 .locals init (int32 V_0, int32 V_1, - uint32 V_2, + uint64 V_2, int32[] V_3, - uint32 V_4, + uint64 V_4, int32 V_5) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -375,53 +388,60 @@ module Int32 = IL_0013: stloc.1 IL_0014: ldloc.1 IL_0015: ldloc.0 - IL_0016: bge.s IL_001b + IL_0016: bge.s IL_001c IL_0018: ldc.i4.0 - IL_0019: br.s IL_0022 - - IL_001b: ldloc.1 - IL_001c: conv.i4 - IL_001d: ldloc.0 - IL_001e: conv.i4 - IL_001f: sub - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.2 - IL_0024: ldc.i4.1 - IL_0025: bge.un.s IL_002d - - IL_0027: call !!0[] [runtime]System.Array::Empty() - IL_002c: ret + IL_0019: conv.i8 + IL_001a: br.s IL_0024 + + IL_001c: ldloc.1 + IL_001d: conv.i8 + IL_001e: ldloc.0 + IL_001f: conv.i8 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: bge.un.s IL_0030 - IL_002d: ldloc.2 - IL_002e: newarr [runtime]System.Int32 - IL_0033: stloc.3 - IL_0034: ldc.i4.0 - IL_0035: stloc.s V_4 - IL_0037: ldloc.0 - IL_0038: stloc.s V_5 - IL_003a: br.s IL_004e + IL_002a: call !!0[] [runtime]System.Array::Empty() + IL_002f: ret - IL_003c: ldloc.3 - IL_003d: ldloc.s V_4 - IL_003f: ldloc.s V_5 - IL_0041: stelem.i4 - IL_0042: ldloc.s V_5 - IL_0044: ldc.i4.1 - IL_0045: add - IL_0046: stloc.s V_5 - IL_0048: ldloc.s V_4 + IL_0030: ldloc.2 + IL_0031: conv.ovf.i.un + IL_0032: newarr [runtime]System.Int32 + IL_0037: stloc.3 + IL_0038: ldc.i4.0 + IL_0039: conv.i8 + IL_003a: stloc.s V_4 + IL_003c: ldloc.0 + IL_003d: stloc.s V_5 + IL_003f: br.s IL_0055 + + IL_0041: ldloc.3 + IL_0042: ldloc.s V_4 + IL_0044: conv.ovf.i.un + IL_0045: ldloc.s V_5 + IL_0047: stelem.i4 + IL_0048: ldloc.s V_5 IL_004a: ldc.i4.1 IL_004b: add - IL_004c: stloc.s V_4 + IL_004c: stloc.s V_5 IL_004e: ldloc.s V_4 - IL_0050: ldloc.2 - IL_0051: blt.un.s IL_003c + IL_0050: ldc.i4.1 + IL_0051: conv.i8 + IL_0052: add + IL_0053: stloc.s V_4 + IL_0055: ldloc.s V_4 + IL_0057: ldloc.2 + IL_0058: blt.un.s IL_0041 - IL_0053: ldloc.3 - IL_0054: ret + IL_005a: ldloc.3 + IL_005b: ret } } @@ -549,35 +569,41 @@ module Int32 = .maxstack 5 .locals init (int32[] V_0, - int32 V_1, + uint64 V_1, int32 V_2) IL_0000: ldc.i4 0x81 - IL_0005: newarr [runtime]System.Int32 - IL_000a: stloc.0 - IL_000b: ldc.i4.0 - IL_000c: stloc.1 - IL_000d: ldc.i4.1 - IL_000e: stloc.2 - IL_000f: br.s IL_001d - - IL_0011: ldloc.0 - IL_0012: ldloc.1 - IL_0013: ldloc.2 - IL_0014: stelem.i4 - IL_0015: ldloc.2 - IL_0016: ldc.i4.2 - IL_0017: add - IL_0018: stloc.2 - IL_0019: ldloc.1 - IL_001a: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: conv.ovf.i.un + IL_0007: newarr [runtime]System.Int32 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldc.i4.1 + IL_0011: stloc.2 + IL_0012: br.s IL_0022 + + IL_0014: ldloc.0 + IL_0015: ldloc.1 + IL_0016: conv.ovf.i.un + IL_0017: ldloc.2 + IL_0018: stelem.i4 + IL_0019: ldloc.2 + IL_001a: ldc.i4.2 IL_001b: add - IL_001c: stloc.1 + IL_001c: stloc.2 IL_001d: ldloc.1 - IL_001e: ldc.i4 0x81 - IL_0023: blt.un.s IL_0011 - - IL_0025: ldloc.0 - IL_0026: ret + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: add + IL_0021: stloc.1 + IL_0022: ldloc.1 + IL_0023: ldc.i4 0x81 + IL_0028: conv.i8 + IL_0029: blt.un.s IL_0014 + + IL_002b: ldloc.0 + IL_002c: ret } } @@ -643,9 +669,9 @@ module Int32 = 00 00 00 00 ) .maxstack 5 - .locals init (uint32 V_0, + .locals init (uint64 V_0, int32[] V_1, - uint32 V_2, + uint64 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000e @@ -654,87 +680,100 @@ module Int32 = IL_0004: ldarg.1 IL_0005: ldarg.2 IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_000b: pop IL_000c: br.s IL_000e IL_000e: ldc.i4.0 IL_000f: ldarg.1 - IL_0010: bge.s IL_0024 + IL_0010: bge.s IL_0027 IL_0012: ldarg.2 IL_0013: ldarg.0 - IL_0014: bge.s IL_0019 + IL_0014: bge.s IL_001a IL_0016: ldc.i4.0 - IL_0017: br.s IL_0037 - - IL_0019: ldarg.2 - IL_001a: conv.i4 - IL_001b: ldarg.0 - IL_001c: conv.i4 - IL_001d: sub - IL_001e: ldarg.1 - IL_001f: div.un - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: br.s IL_0037 - - IL_0024: ldarg.0 - IL_0025: ldarg.2 - IL_0026: bge.s IL_002b - - IL_0028: ldc.i4.0 - IL_0029: br.s IL_0037 - - IL_002b: ldarg.0 - IL_002c: conv.i4 - IL_002d: ldarg.2 - IL_002e: conv.i4 - IL_002f: sub - IL_0030: ldarg.1 - IL_0031: not - IL_0032: ldc.i4.1 - IL_0033: add - IL_0034: div.un - IL_0035: ldc.i4.1 - IL_0036: add - IL_0037: stloc.0 - IL_0038: ldloc.0 - IL_0039: ldc.i4.1 - IL_003a: bge.un.s IL_0042 - - IL_003c: call !!0[] [runtime]System.Array::Empty() - IL_0041: ret - - IL_0042: ldloc.0 - IL_0043: newarr [runtime]System.Int32 - IL_0048: stloc.1 - IL_0049: ldc.i4.0 - IL_004a: stloc.2 - IL_004b: ldarg.0 - IL_004c: stloc.3 - IL_004d: br.s IL_005b - - IL_004f: ldloc.1 - IL_0050: ldloc.2 - IL_0051: ldloc.3 - IL_0052: stelem.i4 - IL_0053: ldloc.3 - IL_0054: ldarg.1 - IL_0055: add - IL_0056: stloc.3 - IL_0057: ldloc.2 - IL_0058: ldc.i4.1 - IL_0059: add - IL_005a: stloc.2 + IL_0017: conv.i8 + IL_0018: br.s IL_003f + + IL_001a: ldarg.2 + IL_001b: conv.i8 + IL_001c: ldarg.0 + IL_001d: conv.i8 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: conv.i8 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add + IL_0025: br.s IL_003f + + IL_0027: ldarg.0 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f + + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: br.s IL_003f + + IL_002f: ldarg.0 + IL_0030: conv.i8 + IL_0031: ldarg.2 + IL_0032: conv.i8 + IL_0033: sub + IL_0034: ldarg.1 + IL_0035: not + IL_0036: conv.i8 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: add + IL_003a: conv.i8 + IL_003b: div.un + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: stloc.0 + IL_0040: ldloc.0 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: bge.un.s IL_004b + + IL_0045: call !!0[] [runtime]System.Array::Empty() + IL_004a: ret + + IL_004b: ldloc.0 + IL_004c: conv.ovf.i.un + IL_004d: newarr [runtime]System.Int32 + IL_0052: stloc.1 + IL_0053: ldc.i4.0 + IL_0054: conv.i8 + IL_0055: stloc.2 + IL_0056: ldarg.0 + IL_0057: stloc.3 + IL_0058: br.s IL_0068 + + IL_005a: ldloc.1 IL_005b: ldloc.2 - IL_005c: ldloc.0 - IL_005d: blt.un.s IL_004f + IL_005c: conv.ovf.i.un + IL_005d: ldloc.3 + IL_005e: stelem.i4 + IL_005f: ldloc.3 + IL_0060: ldarg.1 + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i4.1 + IL_0065: conv.i8 + IL_0066: add + IL_0067: stloc.2 + IL_0068: ldloc.2 + IL_0069: ldloc.0 + IL_006a: blt.un.s IL_005a - IL_005f: ldloc.1 - IL_0060: ret + IL_006c: ldloc.1 + IL_006d: ret } } @@ -836,9 +875,9 @@ module Int32 = .locals init (int32 V_0, int32 V_1, int32 V_2, - uint32 V_3, + uint64 V_3, int32[] V_4, - uint32 V_5, + uint64 V_5, int32 V_6) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -862,87 +901,100 @@ module Int32 = IL_0025: ldloc.1 IL_0026: ldloc.2 IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_002c: pop IL_002d: br.s IL_002f IL_002f: ldc.i4.0 IL_0030: ldloc.1 - IL_0031: bge.s IL_0045 + IL_0031: bge.s IL_0048 IL_0033: ldloc.2 IL_0034: ldloc.0 - IL_0035: bge.s IL_003a + IL_0035: bge.s IL_003b IL_0037: ldc.i4.0 - IL_0038: br.s IL_0058 - - IL_003a: ldloc.2 - IL_003b: conv.i4 - IL_003c: ldloc.0 - IL_003d: conv.i4 - IL_003e: sub - IL_003f: ldloc.1 - IL_0040: div.un - IL_0041: ldc.i4.1 - IL_0042: add - IL_0043: br.s IL_0058 - - IL_0045: ldloc.0 - IL_0046: ldloc.2 - IL_0047: bge.s IL_004c - - IL_0049: ldc.i4.0 - IL_004a: br.s IL_0058 - - IL_004c: ldloc.0 - IL_004d: conv.i4 - IL_004e: ldloc.2 - IL_004f: conv.i4 - IL_0050: sub - IL_0051: ldloc.1 - IL_0052: not - IL_0053: ldc.i4.1 - IL_0054: add - IL_0055: div.un - IL_0056: ldc.i4.1 - IL_0057: add - IL_0058: stloc.3 - IL_0059: ldloc.3 - IL_005a: ldc.i4.1 - IL_005b: bge.un.s IL_0063 - - IL_005d: call !!0[] [runtime]System.Array::Empty() - IL_0062: ret - - IL_0063: ldloc.3 - IL_0064: newarr [runtime]System.Int32 - IL_0069: stloc.s V_4 - IL_006b: ldc.i4.0 - IL_006c: stloc.s V_5 - IL_006e: ldloc.0 - IL_006f: stloc.s V_6 - IL_0071: br.s IL_0086 - - IL_0073: ldloc.s V_4 - IL_0075: ldloc.s V_5 - IL_0077: ldloc.s V_6 - IL_0079: stelem.i4 - IL_007a: ldloc.s V_6 - IL_007c: ldloc.1 - IL_007d: add - IL_007e: stloc.s V_6 + IL_0038: conv.i8 + IL_0039: br.s IL_0060 + + IL_003b: ldloc.2 + IL_003c: conv.i8 + IL_003d: ldloc.0 + IL_003e: conv.i8 + IL_003f: sub + IL_0040: ldloc.1 + IL_0041: conv.i8 + IL_0042: div.un + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: br.s IL_0060 + + IL_0048: ldloc.0 + IL_0049: ldloc.2 + IL_004a: bge.s IL_0050 + + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: br.s IL_0060 + + IL_0050: ldloc.0 + IL_0051: conv.i8 + IL_0052: ldloc.2 + IL_0053: conv.i8 + IL_0054: sub + IL_0055: ldloc.1 + IL_0056: not + IL_0057: conv.i8 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: conv.i8 + IL_005c: div.un + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: add + IL_0060: stloc.3 + IL_0061: ldloc.3 + IL_0062: ldc.i4.1 + IL_0063: conv.i8 + IL_0064: bge.un.s IL_006c + + IL_0066: call !!0[] [runtime]System.Array::Empty() + IL_006b: ret + + IL_006c: ldloc.3 + IL_006d: conv.ovf.i.un + IL_006e: newarr [runtime]System.Int32 + IL_0073: stloc.s V_4 + IL_0075: ldc.i4.0 + IL_0076: conv.i8 + IL_0077: stloc.s V_5 + IL_0079: ldloc.0 + IL_007a: stloc.s V_6 + IL_007c: br.s IL_0093 + + IL_007e: ldloc.s V_4 IL_0080: ldloc.s V_5 - IL_0082: ldc.i4.1 - IL_0083: add - IL_0084: stloc.s V_5 - IL_0086: ldloc.s V_5 - IL_0088: ldloc.3 - IL_0089: blt.un.s IL_0073 - - IL_008b: ldloc.s V_4 - IL_008d: ret + IL_0082: conv.ovf.i.un + IL_0083: ldloc.s V_6 + IL_0085: stelem.i4 + IL_0086: ldloc.s V_6 + IL_0088: ldloc.1 + IL_0089: add + IL_008a: stloc.s V_6 + IL_008c: ldloc.s V_5 + IL_008e: ldc.i4.1 + IL_008f: conv.i8 + IL_0090: add + IL_0091: stloc.s V_5 + IL_0093: ldloc.s V_5 + IL_0095: ldloc.3 + IL_0096: blt.un.s IL_007e + + IL_0098: ldloc.s V_4 + IL_009a: ret } } @@ -1068,38 +1120,40 @@ module Int32 = 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 - test() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 test() cil managed { .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - int32 V_1, + uint64 V_1, int32 V_2) IL_0000: ldc.i4.0 - IL_0001: stloc.1 - IL_0002: ldc.i4.1 - IL_0003: stloc.2 - IL_0004: br.s IL_0016 - - IL_0006: ldloca.s V_0 - IL_0008: ldloc.2 - IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_000e: ldloc.2 - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: stloc.2 - IL_0012: ldloc.1 - IL_0013: ldc.i4.1 - IL_0014: add - IL_0015: stloc.1 - IL_0016: ldloc.1 - IL_0017: ldc.i4.s 101 - IL_0019: blt.un.s IL_0006 - - IL_001b: ldloca.s V_0 - IL_001d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0022: ret + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_0018 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: ldloc.2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: stloc.2 + IL_0013: ldloc.1 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.s 101 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0007 + + IL_001e: ldloca.s V_0 + IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0025: ret } } @@ -1164,49 +1218,53 @@ module Int32 = .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 (uint32 V_0, + .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - uint32 V_2, + uint64 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: bge.s IL_0007 + IL_0002: bge.s IL_0008 IL_0004: ldc.i4.0 - IL_0005: br.s IL_000e - - IL_0007: ldarg.1 - IL_0008: conv.i4 - IL_0009: ldarg.0 - IL_000a: conv.i4 - IL_000b: sub - IL_000c: ldc.i4.1 - IL_000d: add - IL_000e: stloc.0 - IL_000f: ldc.i4.0 - IL_0010: stloc.2 - IL_0011: ldarg.0 - IL_0012: stloc.3 - IL_0013: br.s IL_0025 - - IL_0015: ldloca.s V_1 - IL_0017: ldloc.3 - IL_0018: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_001d: ldloc.3 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.3 - IL_0021: ldloc.2 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.2 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0015 - - IL_0029: ldloca.s V_1 - 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 + IL_0005: conv.i8 + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i8 + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: conv.i8 + IL_0013: stloc.2 + IL_0014: ldarg.0 + IL_0015: stloc.3 + IL_0016: br.s IL_0029 + + IL_0018: ldloca.s V_1 + IL_001a: ldloc.3 + IL_001b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.3 + IL_0024: ldloc.2 + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.2 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_0018 + + IL_002d: ldloca.s V_1 + IL_002f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0034: ret } } @@ -1295,9 +1353,9 @@ module Int32 = .maxstack 4 .locals init (int32 V_0, int32 V_1, - uint32 V_2, + uint64 V_2, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, - uint32 V_4, + uint64 V_4, int32 V_5) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -1311,43 +1369,47 @@ module Int32 = IL_0013: stloc.1 IL_0014: ldloc.1 IL_0015: ldloc.0 - IL_0016: bge.s IL_001b + IL_0016: bge.s IL_001c IL_0018: ldc.i4.0 - IL_0019: br.s IL_0022 - - IL_001b: ldloc.1 - IL_001c: conv.i4 - IL_001d: ldloc.0 - IL_001e: conv.i4 - IL_001f: sub - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldc.i4.0 - IL_0024: stloc.s V_4 - IL_0026: ldloc.0 - IL_0027: stloc.s V_5 - IL_0029: br.s IL_0040 - - IL_002b: ldloca.s V_3 - IL_002d: ldloc.s V_5 - IL_002f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0034: ldloc.s V_5 - IL_0036: ldc.i4.1 - IL_0037: add - IL_0038: stloc.s V_5 - IL_003a: ldloc.s V_4 - IL_003c: ldc.i4.1 - IL_003d: add - IL_003e: stloc.s V_4 - IL_0040: ldloc.s V_4 - IL_0042: ldloc.2 - IL_0043: blt.un.s IL_002b - - IL_0045: ldloca.s V_3 - IL_0047: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004c: ret + IL_0019: conv.i8 + IL_001a: br.s IL_0024 + + IL_001c: ldloc.1 + IL_001d: conv.i8 + IL_001e: ldloc.0 + IL_001f: conv.i8 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldc.i4.0 + IL_0026: conv.i8 + IL_0027: stloc.s V_4 + IL_0029: ldloc.0 + IL_002a: stloc.s V_5 + IL_002c: br.s IL_0044 + + IL_002e: ldloca.s V_3 + IL_0030: ldloc.s V_5 + IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0037: ldloc.s V_5 + IL_0039: ldc.i4.1 + IL_003a: add + IL_003b: stloc.s V_5 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.s V_4 + IL_0046: ldloc.2 + IL_0047: blt.un.s IL_002e + + IL_0049: ldloca.s V_3 + IL_004b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0050: ret } } @@ -1471,38 +1533,40 @@ module Int32 = 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 - test() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 test() cil managed { .maxstack 4 .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - int32 V_1, + uint64 V_1, int32 V_2) IL_0000: ldc.i4.0 - IL_0001: stloc.1 - IL_0002: ldc.i4.1 - IL_0003: stloc.2 - IL_0004: br.s IL_0016 - - IL_0006: ldloca.s V_0 - IL_0008: ldloc.2 - IL_0009: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_000e: ldloc.2 - IL_000f: ldc.i4.2 - IL_0010: add - IL_0011: stloc.2 - IL_0012: ldloc.1 - IL_0013: ldc.i4.1 - IL_0014: add - IL_0015: stloc.1 - IL_0016: ldloc.1 - IL_0017: ldc.i4 0x81 - IL_001c: blt.un.s IL_0006 - - IL_001e: ldloca.s V_0 - IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0025: ret + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_0018 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: ldloc.2 + IL_0010: ldc.i4.2 + IL_0011: add + IL_0012: stloc.2 + IL_0013: ldloc.1 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4 0x81 + 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 } } @@ -1569,9 +1633,9 @@ module Int32 = 00 00 00 00 ) .maxstack 5 - .locals init (uint32 V_0, + .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, - uint32 V_2, + uint64 V_2, int32 V_3) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000e @@ -1580,77 +1644,87 @@ module Int32 = IL_0004: ldarg.1 IL_0005: ldarg.2 IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_000b: pop IL_000c: br.s IL_000e IL_000e: ldc.i4.0 IL_000f: ldarg.1 - IL_0010: bge.s IL_0024 + IL_0010: bge.s IL_0027 IL_0012: ldarg.2 IL_0013: ldarg.0 - IL_0014: bge.s IL_0019 + IL_0014: bge.s IL_001a IL_0016: ldc.i4.0 - IL_0017: br.s IL_0037 - - IL_0019: ldarg.2 - IL_001a: conv.i4 - IL_001b: ldarg.0 - IL_001c: conv.i4 - IL_001d: sub - IL_001e: ldarg.1 - IL_001f: div.un - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: br.s IL_0037 - - IL_0024: ldarg.0 - IL_0025: ldarg.2 - IL_0026: bge.s IL_002b - - IL_0028: ldc.i4.0 - IL_0029: br.s IL_0037 - - IL_002b: ldarg.0 - IL_002c: conv.i4 - IL_002d: ldarg.2 - IL_002e: conv.i4 - IL_002f: sub - IL_0030: ldarg.1 - IL_0031: not - IL_0032: ldc.i4.1 - IL_0033: add - IL_0034: div.un - IL_0035: ldc.i4.1 - IL_0036: add - IL_0037: stloc.0 - IL_0038: ldc.i4.0 - IL_0039: stloc.2 - IL_003a: ldarg.0 - IL_003b: stloc.3 - IL_003c: br.s IL_004e - - IL_003e: ldloca.s V_1 - IL_0040: ldloc.3 - IL_0041: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0046: ldloc.3 - IL_0047: ldarg.1 - IL_0048: add - IL_0049: stloc.3 - IL_004a: ldloc.2 - IL_004b: ldc.i4.1 - IL_004c: add - IL_004d: stloc.2 - IL_004e: ldloc.2 - IL_004f: ldloc.0 - IL_0050: blt.un.s IL_003e - - IL_0052: ldloca.s V_1 - IL_0054: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0059: ret + IL_0017: conv.i8 + IL_0018: br.s IL_003f + + IL_001a: ldarg.2 + IL_001b: conv.i8 + IL_001c: ldarg.0 + IL_001d: conv.i8 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: conv.i8 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add + IL_0025: br.s IL_003f + + IL_0027: ldarg.0 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f + + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: br.s IL_003f + + IL_002f: ldarg.0 + IL_0030: conv.i8 + IL_0031: ldarg.2 + IL_0032: conv.i8 + IL_0033: sub + IL_0034: ldarg.1 + IL_0035: not + IL_0036: conv.i8 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: add + IL_003a: conv.i8 + IL_003b: div.un + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: stloc.0 + IL_0040: ldc.i4.0 + IL_0041: conv.i8 + IL_0042: stloc.2 + IL_0043: ldarg.0 + IL_0044: stloc.3 + IL_0045: br.s IL_0058 + + IL_0047: ldloca.s V_1 + IL_0049: ldloc.3 + IL_004a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_004f: ldloc.3 + IL_0050: ldarg.1 + IL_0051: add + IL_0052: stloc.3 + IL_0053: ldloc.2 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add + IL_0057: stloc.2 + IL_0058: ldloc.2 + IL_0059: ldloc.0 + IL_005a: blt.un.s IL_0047 + + IL_005c: ldloca.s V_1 + IL_005e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0063: ret } } @@ -1752,9 +1826,9 @@ module Int32 = .locals init (int32 V_0, int32 V_1, int32 V_2, - uint32 V_3, + uint64 V_3, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, - uint32 V_5, + uint64 V_5, int32 V_6) IL_0000: ldc.i4.s 10 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) @@ -1778,77 +1852,87 @@ module Int32 = IL_0025: ldloc.1 IL_0026: ldloc.2 IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) + int32, + int32) IL_002c: pop IL_002d: br.s IL_002f IL_002f: ldc.i4.0 IL_0030: ldloc.1 - IL_0031: bge.s IL_0045 + IL_0031: bge.s IL_0048 IL_0033: ldloc.2 IL_0034: ldloc.0 - IL_0035: bge.s IL_003a + IL_0035: bge.s IL_003b IL_0037: ldc.i4.0 - IL_0038: br.s IL_0058 - - IL_003a: ldloc.2 - IL_003b: conv.i4 - IL_003c: ldloc.0 - IL_003d: conv.i4 - IL_003e: sub - IL_003f: ldloc.1 - IL_0040: div.un - IL_0041: ldc.i4.1 - IL_0042: add - IL_0043: br.s IL_0058 + IL_0038: conv.i8 + IL_0039: br.s IL_0060 + + IL_003b: ldloc.2 + IL_003c: conv.i8 + IL_003d: ldloc.0 + IL_003e: conv.i8 + IL_003f: sub + IL_0040: ldloc.1 + IL_0041: conv.i8 + IL_0042: div.un + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: br.s IL_0060 + + IL_0048: ldloc.0 + IL_0049: ldloc.2 + IL_004a: bge.s IL_0050 + + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: br.s IL_0060 + + IL_0050: ldloc.0 + IL_0051: conv.i8 + IL_0052: ldloc.2 + IL_0053: conv.i8 + IL_0054: sub + IL_0055: ldloc.1 + IL_0056: not + IL_0057: conv.i8 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: conv.i8 + IL_005c: div.un + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: add + IL_0060: stloc.3 + IL_0061: ldc.i4.0 + IL_0062: conv.i8 + IL_0063: stloc.s V_5 + IL_0065: ldloc.0 + IL_0066: stloc.s V_6 + IL_0068: br.s IL_0080 + + IL_006a: ldloca.s V_4 + IL_006c: ldloc.s V_6 + IL_006e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0073: ldloc.s V_6 + IL_0075: ldloc.1 + IL_0076: add + IL_0077: stloc.s V_6 + IL_0079: ldloc.s V_5 + IL_007b: ldc.i4.1 + IL_007c: conv.i8 + IL_007d: add + IL_007e: stloc.s V_5 + IL_0080: ldloc.s V_5 + IL_0082: ldloc.3 + IL_0083: blt.un.s IL_006a - IL_0045: ldloc.0 - IL_0046: ldloc.2 - IL_0047: bge.s IL_004c - - IL_0049: ldc.i4.0 - IL_004a: br.s IL_0058 - - IL_004c: ldloc.0 - IL_004d: conv.i4 - IL_004e: ldloc.2 - IL_004f: conv.i4 - IL_0050: sub - IL_0051: ldloc.1 - IL_0052: not - IL_0053: ldc.i4.1 - IL_0054: add - IL_0055: div.un - IL_0056: ldc.i4.1 - IL_0057: add - IL_0058: stloc.3 - IL_0059: ldc.i4.0 - IL_005a: stloc.s V_5 - IL_005c: ldloc.0 - IL_005d: stloc.s V_6 - IL_005f: br.s IL_0076 - - IL_0061: ldloca.s V_4 - IL_0063: ldloc.s V_6 - IL_0065: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006a: ldloc.s V_6 - IL_006c: ldloc.1 - IL_006d: add - IL_006e: stloc.s V_6 - IL_0070: ldloc.s V_5 - IL_0072: ldc.i4.1 - IL_0073: add - IL_0074: stloc.s V_5 - IL_0076: ldloc.s V_5 - IL_0078: ldloc.3 - IL_0079: blt.un.s IL_0061 - - IL_007b: ldloca.s V_4 - IL_007d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0082: ret + IL_0085: ldloca.s V_4 + IL_0087: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_008c: ret } } From e35cf4dc560f4d814f72c9a3474925a011058e12 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 21 Feb 2024 11:35:33 -0500 Subject: [PATCH 45/66] Parameterize zero & one * This forces the "runtime" tests to excercise the all-runtime count calculation code. --- .../FSharp.Core/PrimTypes.fs | 86 +++++++++---------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 4e160e6d448..fd38edd723c 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -889,9 +889,7 @@ module internal RangeTestsHelpers = Assert.AreEqual ([|min1 .. min3|], [|min1; min2; min3|]) Assert.AreEqual ([|max3 .. max1|], [|max3; max2; max1|]) - let inline signed min0 max0 = - let zero = LanguagePrimitives.GenericZero - let one = LanguagePrimitives.GenericOne + let inline signed zero one min0 max0 = let two = one + one let three = two + one @@ -971,9 +969,7 @@ module internal RangeTestsHelpers = Assert.AreEqual ([|max0 .. min2 .. min0|], [|max0; max0 + min2; max0 + min2 + min2 |]) Assert.AreEqual ([|max0 .. min3 .. min0|], [|max0; max0 + min3; max0 + min3 + min3 |]) - let inline unsigned min0 max0 = - let zero = LanguagePrimitives.GenericZero - let one = LanguagePrimitives.GenericOne + let inline unsigned zero one min0 max0 = let two = one + one let three = two + one @@ -1065,53 +1061,53 @@ module RangeTests = Assert.AreEqual(allSBytesSeq, {System.SByte.MinValue..System.SByte.MaxValue}) Assert.AreEqual(allSBytesList, [System.SByte.MinValue..System.SByte.MaxValue]) Assert.AreEqual(allSBytesArray, [|System.SByte.MinValue..System.SByte.MaxValue|]) - RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue + RangeTestsHelpers.signed 0y 1y System.SByte.MinValue System.SByte.MaxValue [] let ``Range.Byte`` () = Assert.AreEqual(allBytesSeq, {System.Byte.MinValue..System.Byte.MaxValue}) Assert.AreEqual(allBytesList, [System.Byte.MinValue..System.Byte.MaxValue]) Assert.AreEqual(allBytesArray, [|System.Byte.MinValue..System.Byte.MaxValue|]) - RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue + RangeTestsHelpers.unsigned 0uy 1uy System.Byte.MinValue System.Byte.MaxValue //// Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? //[] - //let ``Range.Char`` () = RangeTestsHelpers.unsigned System.Char.MinValue System.Char.MaxValue + //let ``Range.Char`` () = RangeTestsHelpers.unsigned '\000' '\001' System.Char.MinValue System.Char.MaxValue [] - let ``Range.Int16`` () = RangeTestsHelpers.signed System.Int16.MinValue System.Int16.MaxValue + let ``Range.Int16`` () = RangeTestsHelpers.signed 0s 1s System.Int16.MinValue System.Int16.MaxValue [] - let ``Range.UInt16`` () = RangeTestsHelpers.unsigned System.UInt16.MinValue System.UInt16.MaxValue + let ``Range.UInt16`` () = RangeTestsHelpers.unsigned 0us 1us System.UInt16.MinValue System.UInt16.MaxValue [] - let ``Range.Int32`` () = RangeTestsHelpers.signed System.Int32.MinValue System.Int32.MaxValue + let ``Range.Int32`` () = RangeTestsHelpers.signed 0 1 System.Int32.MinValue System.Int32.MaxValue [] - let ``Range.UInt32`` () = RangeTestsHelpers.unsigned System.UInt32.MinValue System.UInt32.MaxValue + let ``Range.UInt32`` () = RangeTestsHelpers.unsigned 0u 1u System.UInt32.MinValue System.UInt32.MaxValue [] - let ``Range.Int64`` () = RangeTestsHelpers.signed System.Int64.MinValue System.Int64.MaxValue + let ``Range.Int64`` () = RangeTestsHelpers.signed 0L 1L System.Int64.MinValue System.Int64.MaxValue [] - let ``Range.UInt64`` () = RangeTestsHelpers.unsigned System.UInt64.MinValue System.UInt64.MaxValue + let ``Range.UInt64`` () = RangeTestsHelpers.unsigned 0UL 1UL System.UInt64.MinValue System.UInt64.MaxValue [] let ``Range.IntPtr`` () = // 0x80000000n is negative on x86, but would be positive on x64. - if System.IntPtr.Size = 4 then RangeTestsHelpers.signed 0x80000000n 0x7fffffffn - if System.IntPtr.Size = 8 then RangeTestsHelpers.signed 0x8000000000000000n 0x7fffffffffffffffn + if System.IntPtr.Size = 4 then RangeTestsHelpers.signed 0x0n 0x1n 0x80000000n 0x7fffffffn + if System.IntPtr.Size = 8 then RangeTestsHelpers.signed 0x0n 0x1n 0x8000000000000000n 0x7fffffffffffffffn [] let ``Range.UIntPtr`` () = - if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned 0x0un 0xffffffffun - if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned 0x0un 0xffffffffffffffffun + if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffun + if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffffffffffun - /// These tests' arguments are intentionally _not_ inlined, - /// and so the size of the computed collection must thus be computed at runtime. + /// These tests' arguments are intentionally _not_ inlined + /// to force the size of the collection (for lists and arrays) to be computed at runtime. module Runtime = - [] - let ``Range.SByte`` (min0: sbyte) (one: sbyte) (max0: sbyte) = + [] + let ``Range.SByte`` (zero: sbyte) (one: sbyte) (min0: sbyte) (max0: sbyte) = Assert.AreEqual(allSBytesSeq, {min0..max0}) Assert.AreEqual(allSBytesList, [min0..max0]) Assert.AreEqual(allSBytesArray, [|min0..max0|]) @@ -1124,10 +1120,10 @@ module RangeTests = Assert.AreEqual(List.rev allSBytesList, [max0 .. -one .. min0]) Assert.AreEqual(Array.rev allSBytesArray, [|max0 .. -one .. min0|]) - RangeTestsHelpers.signed min0 max0 + RangeTestsHelpers.signed zero one min0 max0 - [] - let ``Range.Byte`` (min0: byte) (one: byte) (max0: byte) = + [] + let ``Range.Byte`` (zero: byte) (one: byte) (min0: byte) (max0: byte) = Assert.AreEqual(allBytesSeq, {min0..max0}) Assert.AreEqual(allBytesList, [min0..max0]) Assert.AreEqual(allBytesArray, [|min0..max0|]) @@ -1136,41 +1132,41 @@ module RangeTests = Assert.AreEqual(allBytesList, [min0..one..max0]) Assert.AreEqual(allBytesArray, [|min0..one..max0|]) - RangeTestsHelpers.unsigned min0 max0 + RangeTestsHelpers.unsigned zero one min0 max0 //// Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? - //[] - //let ``Range.Char`` (min0: char) (max0: char) = RangeTestsHelpers.unsigned min0 max0 + //[] + //let ``Range.Char`` (zero: char) (one: char) (min0: char) (max0: char) = RangeTestsHelpers.unsigned zero one min0 max0 - [] - let ``Range.Int16`` (min0: int16) (max0: int16) = RangeTestsHelpers.signed min0 max0 + [] + let ``Range.Int16`` (zero: int16) (one: int16) (min0: int16) (max0: int16) = RangeTestsHelpers.signed zero one min0 max0 - [] - let ``Range.UInt16`` (min0: uint16) (max0: uint16) = RangeTestsHelpers.unsigned min0 max0 + [] + let ``Range.UInt16`` (zero: uint16) (one: uint16) (min0: uint16) (max0: uint16) = RangeTestsHelpers.unsigned zero one min0 max0 - [] - let ``Range.Int32`` min0 max0 = RangeTestsHelpers.signed min0 max0 + [] + let ``Range.Int32`` (zero: int) (one: int) (min0: int) (max0: int) = RangeTestsHelpers.signed zero one min0 max0 - [] - let ``Range.UInt32`` (min0: uint) (max0: uint) = RangeTestsHelpers.unsigned min0 max0 + [] + let ``Range.UInt32`` (zero: uint) (one: uint) (min0: uint) (max0: uint) = RangeTestsHelpers.unsigned zero one min0 max0 - [] - let ``Range.Int64`` (min0: int64) (max0: int64) = RangeTestsHelpers.signed min0 max0 + [] + let ``Range.Int64`` (zero: int64) (one: int64) (min0: int64) (max0: int64) = RangeTestsHelpers.signed zero one min0 max0 - [] - let ``Range.UInt64`` (min0: uint64) (max0: uint64) = RangeTestsHelpers.unsigned min0 max0 + [] + let ``Range.UInt64`` (zero: uint64) (one: uint64) (min0: uint64) (max0: uint64) = RangeTestsHelpers.unsigned zero one min0 max0 [] let ``Range.IntPtr`` () = // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. - if System.IntPtr.Size >= 4 then RangeTestsHelpers.signed (System.IntPtr System.Int32.MinValue) (System.IntPtr System.Int32.MaxValue) - if System.IntPtr.Size >= 8 then RangeTestsHelpers.signed (System.IntPtr System.Int64.MinValue) (System.IntPtr System.Int64.MaxValue) + if System.IntPtr.Size >= 4 then RangeTestsHelpers.signed (System.IntPtr 0) (System.IntPtr 1) (System.IntPtr System.Int32.MinValue) (System.IntPtr System.Int32.MaxValue) + if System.IntPtr.Size >= 8 then RangeTestsHelpers.signed (System.IntPtr 0) (System.IntPtr 1) (System.IntPtr System.Int64.MinValue) (System.IntPtr System.Int64.MaxValue) [] let ``Range.UIntPtr`` () = // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. - if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt32.MinValue) (System.UIntPtr System.UInt32.MaxValue) - if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) + if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned (System.UIntPtr 0u) (System.UIntPtr 1u) (System.UIntPtr System.UInt32.MinValue) (System.UIntPtr System.UInt32.MaxValue) + if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr 0u) (System.UIntPtr 1u) (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) open NonStructuralComparison From e263702ea5486aa8bd01ab475e68710a1df07e31 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 21 Feb 2024 12:31:59 -0500 Subject: [PATCH 46/66] Add more tests for range edge cases --- .../FSharp.Core/PrimTypes.fs | 118 +++++++++++++++--- 1 file changed, 103 insertions(+), 15 deletions(-) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index fd38edd723c..2b7add1611a 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -1050,24 +1050,45 @@ module RangeTests = /// [SByte.MinValue..SByte.MaxValue] let allSBytesList = List.ofArray allSBytesArray - /// {Byte.SMinValue..SByte.MaxValue} + /// {SByte.MinValue..SByte.MaxValue} let allSBytesSeq = Seq.ofArray allSBytesArray /// These tests' constant arguments are inlined, - /// and the size of the collection (for lists and arrays) is computed at build-time. + /// and the size of the collection (for lists and arrays) or count (for for-loops) is computed at build-time. module BuildTime = [] let ``Range.SByte`` () = + Assert.AreEqual(256, let mutable c = 0 in for _ in System.SByte.MinValue..System.SByte.MaxValue do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in System.SByte.MinValue..1y..System.SByte.MaxValue do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in System.SByte.MaxValue .. -1y .. System.SByte.MinValue do c <- c + 1 done; c) + Assert.AreEqual(allSBytesSeq, {System.SByte.MinValue..System.SByte.MaxValue}) Assert.AreEqual(allSBytesList, [System.SByte.MinValue..System.SByte.MaxValue]) Assert.AreEqual(allSBytesArray, [|System.SByte.MinValue..System.SByte.MaxValue|]) + + Assert.AreEqual(allSBytesSeq, {System.SByte.MinValue..1y..System.SByte.MaxValue}) + Assert.AreEqual(allSBytesList, [System.SByte.MinValue..1y..System.SByte.MaxValue]) + Assert.AreEqual(allSBytesArray, [|System.SByte.MinValue..1y..System.SByte.MaxValue|]) + + Assert.AreEqual(Seq.rev allSBytesSeq, {System.SByte.MaxValue .. -1y .. System.SByte.MinValue}) + Assert.AreEqual(List.rev allSBytesList, [System.SByte.MaxValue .. -1y .. System.SByte.MinValue]) + Assert.AreEqual(Array.rev allSBytesArray, [|System.SByte.MaxValue .. -1y .. System.SByte.MinValue|]) + RangeTestsHelpers.signed 0y 1y System.SByte.MinValue System.SByte.MaxValue [] let ``Range.Byte`` () = + Assert.AreEqual(256, let mutable c = 0 in for _ in System.Byte.MinValue..System.Byte.MaxValue do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in System.Byte.MinValue..1uy..System.Byte.MaxValue do c <- c + 1 done; c) + Assert.AreEqual(allBytesSeq, {System.Byte.MinValue..System.Byte.MaxValue}) Assert.AreEqual(allBytesList, [System.Byte.MinValue..System.Byte.MaxValue]) Assert.AreEqual(allBytesArray, [|System.Byte.MinValue..System.Byte.MaxValue|]) + + Assert.AreEqual(allBytesSeq, {System.Byte.MinValue..1uy..System.Byte.MaxValue}) + Assert.AreEqual(allBytesList, [System.Byte.MinValue..1uy..System.Byte.MaxValue]) + Assert.AreEqual(allBytesArray, [|System.Byte.MinValue..1uy..System.Byte.MaxValue|]) + RangeTestsHelpers.unsigned 0uy 1uy System.Byte.MinValue System.Byte.MaxValue //// Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? @@ -1087,27 +1108,58 @@ module RangeTests = let ``Range.UInt32`` () = RangeTestsHelpers.unsigned 0u 1u System.UInt32.MinValue System.UInt32.MaxValue [] - let ``Range.Int64`` () = RangeTestsHelpers.signed 0L 1L System.Int64.MinValue System.Int64.MaxValue + let ``Range.Int64`` () = + ignore <| Assert.Throws(fun () -> for n in Int64.MinValue..Int64.MaxValue do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in Int64.MinValue..1L..Int64.MaxValue do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in Int64.MaxValue .. -1L .. Int64.MinValue do ignore (float n ** float n)) + RangeTestsHelpers.signed 0L 1L System.Int64.MinValue System.Int64.MaxValue [] - let ``Range.UInt64`` () = RangeTestsHelpers.unsigned 0UL 1UL System.UInt64.MinValue System.UInt64.MaxValue + let ``Range.UInt64`` () = + ignore <| Assert.Throws(fun () -> for n in UInt64.MinValue..UInt64.MaxValue do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in UInt64.MinValue..1UL..UInt64.MaxValue do ignore (float n ** float n)) + RangeTestsHelpers.unsigned 0UL 1UL System.UInt64.MinValue System.UInt64.MaxValue [] let ``Range.IntPtr`` () = // 0x80000000n is negative on x86, but would be positive on x64. - if System.IntPtr.Size = 4 then RangeTestsHelpers.signed 0x0n 0x1n 0x80000000n 0x7fffffffn - if System.IntPtr.Size = 8 then RangeTestsHelpers.signed 0x0n 0x1n 0x8000000000000000n 0x7fffffffffffffffn + if System.IntPtr.Size = 4 then + ignore <| Assert.Throws(fun () -> for n in 0x80000000n..0x7fffffffn do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in 0x80000000n..0x1n..0x7fffffffn do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in 0x7fffffffn .. 0xffffffffn .. 0x80000000n do ignore (float n ** float n)) + RangeTestsHelpers.signed 0x0n 0x1n 0x80000000n 0x7fffffffn + + if System.IntPtr.Size = 8 then + ignore <| Assert.Throws(fun () -> for n in 0x8000000000000000n..0x7fffffffffffffffn do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in 0x8000000000000000n..0x1n..0x7fffffffffffffffn do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in 0x7fffffffffffffffn .. 0xffffffffffffffffn .. 0x8000000000000000n do ignore (float n ** float n)) + RangeTestsHelpers.signed 0x0n 0x1n 0x8000000000000000n 0x7fffffffffffffffn [] let ``Range.UIntPtr`` () = - if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffun - if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffffffffffun + if System.UIntPtr.Size >= 4 then + if System.UIntPtr.Size = 4 then + ignore <| Assert.Throws(fun () -> for n in 0x0un..0xffffffffun do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in 0x0un..0x1un..0xffffffffun do ignore (float n ** float n)) + + RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffun + + if System.UIntPtr.Size >= 8 then + if System.UIntPtr.Size = 8 then + ignore <| Assert.Throws(fun () -> for n in 0x0un..0xffffffffffffffffun do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in 0x0un..0x1un..0xffffffffffffffffun do ignore (float n ** float n)) + + RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffffffffffun /// These tests' arguments are intentionally _not_ inlined - /// to force the size of the collection (for lists and arrays) to be computed at runtime. + /// to force the size of the collection (for lists and arrays) or count (for for-loops) to be computed at runtime. module Runtime = [] let ``Range.SByte`` (zero: sbyte) (one: sbyte) (min0: sbyte) (max0: sbyte) = + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..max0 do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..one..max0 do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in max0 .. -one .. min0 do c <- c + 1 done; c) + Assert.AreEqual(allSBytesSeq, {min0..max0}) Assert.AreEqual(allSBytesList, [min0..max0]) Assert.AreEqual(allSBytesArray, [|min0..max0|]) @@ -1124,6 +1176,9 @@ module RangeTests = [] let ``Range.Byte`` (zero: byte) (one: byte) (min0: byte) (max0: byte) = + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..max0 do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..one..max0 do c <- c + 1 done; c) + Assert.AreEqual(allBytesSeq, {min0..max0}) Assert.AreEqual(allBytesList, [min0..max0]) Assert.AreEqual(allBytesArray, [|min0..max0|]) @@ -1151,22 +1206,55 @@ module RangeTests = let ``Range.UInt32`` (zero: uint) (one: uint) (min0: uint) (max0: uint) = RangeTestsHelpers.unsigned zero one min0 max0 [] - let ``Range.Int64`` (zero: int64) (one: int64) (min0: int64) (max0: int64) = RangeTestsHelpers.signed zero one min0 max0 + let ``Range.Int64`` (zero: int64) (one: int64) (min0: int64) (max0: int64) = + ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in max0 .. -one .. min0 do ignore (float n ** float n)) + RangeTestsHelpers.signed zero one min0 max0 [] - let ``Range.UInt64`` (zero: uint64) (one: uint64) (min0: uint64) (max0: uint64) = RangeTestsHelpers.unsigned zero one min0 max0 + let ``Range.UInt64`` (zero: uint64) (one: uint64) (min0: uint64) (max0: uint64) = + ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) + RangeTestsHelpers.unsigned zero one min0 max0 [] let ``Range.IntPtr`` () = // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. - if System.IntPtr.Size >= 4 then RangeTestsHelpers.signed (System.IntPtr 0) (System.IntPtr 1) (System.IntPtr System.Int32.MinValue) (System.IntPtr System.Int32.MaxValue) - if System.IntPtr.Size >= 8 then RangeTestsHelpers.signed (System.IntPtr 0) (System.IntPtr 1) (System.IntPtr System.Int64.MinValue) (System.IntPtr System.Int64.MaxValue) + if System.IntPtr.Size = 4 then + let zero, one, min0, max0 = System.IntPtr 0, System.IntPtr 1, System.IntPtr System.Int32.MinValue, System.IntPtr System.Int32.MaxValue + ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in max0 .. -one .. min0 do ignore (float n ** float n)) + RangeTestsHelpers.signed zero one min0 max0 + + if System.IntPtr.Size = 8 then + let zero, one, min0, max0 = System.IntPtr 0, System.IntPtr 1, System.IntPtr System.Int64.MinValue, System.IntPtr System.Int64.MaxValue + ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in max0 .. -one .. min0 do ignore (float n ** float n)) + RangeTestsHelpers.signed zero one min0 max0 [] let ``Range.UIntPtr`` () = // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. - if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned (System.UIntPtr 0u) (System.UIntPtr 1u) (System.UIntPtr System.UInt32.MinValue) (System.UIntPtr System.UInt32.MaxValue) - if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr 0u) (System.UIntPtr 1u) (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) + if System.UIntPtr.Size >= 4 then + let zero, one, min0, max0 = System.UIntPtr 0u, System.UIntPtr 1u, System.UIntPtr System.UInt32.MinValue, System.UIntPtr System.UInt32.MaxValue + + if System.UIntPtr.Size = 4 then + ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) + + RangeTestsHelpers.unsigned zero one min0 max0 + + if System.UIntPtr.Size >= 8 then + let zero, one, min0, max0 = System.UIntPtr 0u, System.UIntPtr 1u, System.UIntPtr System.UInt64.MinValue, System.UIntPtr System.UInt64.MaxValue + + if System.UIntPtr.Size = 8 then + ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) + ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) + + RangeTestsHelpers.unsigned zero one min0 max0 open NonStructuralComparison From b558079ec9b1d2d3ce34ab38ab888a13af8b5eae Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 21 Feb 2024 18:21:04 -0500 Subject: [PATCH 47/66] Don't check for ovf when not needed * We don't need to check for overflow when converting the index variable to a native int to index into the array, since we know it is always less than count, and, if we've made it that far, we already know that count didn't overflow when we initialized the array. --- .../Optimize/LowerComputedCollections.fs | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index a231c35ca7b..35bd203878b 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -290,21 +290,36 @@ module List = ) module Array = + /// Whether to check for overflow when converting a value to a native int. + type Ovf = + /// Check for overflow. We need this when passing the count into newarr. + | CheckOvf + + /// Don't check for overflow. We don't need to check when indexing into the array, + /// since we already know count didn't overflow during initialization. + | NoCheckOvf + /// Makes an expression that will build an array from an integral range. let mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish = let arrayTy = mkArrayType g overallElemTy - let convToNativeInt expr = + let convToNativeInt ovf expr = let ty = stripMeasuresFromTy g (tyOfExpr g expr) + let conv = + match ovf with + | NoCheckOvf -> AI_conv DT_I + | CheckOvf when isSignedIntegerTy g ty -> AI_conv_ovf DT_I + | CheckOvf -> AI_conv_ovf_un DT_I + if typeEquiv g ty g.int64_ty then - mkAsmExpr ([AI_conv_ovf DT_I], [], [expr], [g.nativeint_ty], m) + mkAsmExpr ([conv], [], [expr], [g.nativeint_ty], m) elif typeEquiv g ty g.nativeint_ty then - mkAsmExpr ([AI_conv_ovf DT_I], [], [mkAsmExpr ([AI_conv DT_I8], [], [expr], [g.int64_ty], m)], [g.nativeint_ty], m) + mkAsmExpr ([conv], [], [mkAsmExpr ([AI_conv DT_I8], [], [expr], [g.int64_ty], m)], [g.nativeint_ty], m) elif typeEquiv g ty g.uint64_ty then - mkAsmExpr ([AI_conv_ovf_un DT_I], [], [expr], [g.nativeint_ty], m) + mkAsmExpr ([conv], [], [expr], [g.nativeint_ty], m) elif typeEquiv g ty g.unativeint_ty then - mkAsmExpr ([AI_conv_ovf_un DT_I], [], [mkAsmExpr ([AI_conv DT_U8], [], [expr], [g.uint64_ty], m)], [g.nativeint_ty], m) + mkAsmExpr ([conv], [], [mkAsmExpr ([AI_conv DT_U8], [], [expr], [g.uint64_ty], m)], [g.nativeint_ty], m) else expr @@ -330,7 +345,7 @@ module Array = ( [I_newarr (ILArrayShape.SingleDimensional, ilTy)], [], - [convToNativeInt count], + [convToNativeInt CheckOvf count], [arrayTy], m ) @@ -340,7 +355,7 @@ 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 idxVar; loopVar], [], m)) + let loop = mkLoop (fun idxVar loopVar -> mkAsmExpr ([I_stelem ilBasicTy], [], [array; convToNativeInt NoCheckOvf idxVar; loopVar], [], m)) mkSequential m loop array) mkOptimizedRangeLoop From 13a2d4621b71f310b56d739e61bc38a887740f91 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 21 Feb 2024 18:23:34 -0500 Subject: [PATCH 48/66] Update baselines --- .../EmittedIL/GenericComparison/Compare09.fsx.il.bsl | 4 ++-- .../EmittedIL/GenericComparison/Equals08.fsx.il.bsl | 4 ++-- .../EmittedIL/GenericComparison/Hash11.fsx.il.bsl | 2 +- .../ComputedCollectionRangeLoweringTests.Int32.fs | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl index a21afa34f83..261d118d9a9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl @@ -73,7 +73,7 @@ IL_0014: ldloc.2 IL_0015: ldloc.3 - IL_0016: conv.ovf.i.un + IL_0016: conv.i IL_0017: ldloc.s V_4 IL_0019: stelem.i4 IL_001a: ldloc.s V_4 @@ -106,7 +106,7 @@ IL_0040: ldloc.s V_5 IL_0042: ldloc.3 - IL_0043: conv.ovf.i.un + IL_0043: conv.i IL_0044: ldloc.s V_4 IL_0046: stelem.i4 IL_0047: ldloc.s V_4 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl index 2f33f892b34..02acab4575c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl @@ -73,7 +73,7 @@ IL_0014: ldloc.2 IL_0015: ldloc.3 - IL_0016: conv.ovf.i.un + IL_0016: conv.i IL_0017: ldloc.s V_4 IL_0019: stelem.i4 IL_001a: ldloc.s V_4 @@ -106,7 +106,7 @@ IL_0040: ldloc.s V_5 IL_0042: ldloc.3 - IL_0043: conv.ovf.i.un + IL_0043: conv.i IL_0044: ldloc.s V_4 IL_0046: stelem.i4 IL_0047: ldloc.s V_4 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl index 5df65bf7461..5e8ba8dc8f5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl @@ -71,7 +71,7 @@ IL_0012: ldloc.1 IL_0013: ldloc.2 - IL_0014: conv.ovf.i.un + IL_0014: conv.i IL_0015: ldloc.3 IL_0016: stelem.i4 IL_0017: ldloc.3 diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs index 08ebf205a7d..3229d670b16 100644 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs @@ -142,7 +142,7 @@ module Int32 = IL_0014: ldloc.0 IL_0015: ldloc.1 - IL_0016: conv.ovf.i.un + IL_0016: conv.i IL_0017: ldloc.2 IL_0018: stelem.i4 IL_0019: ldloc.2 @@ -266,7 +266,7 @@ module Int32 = IL_002b: ldloc.1 IL_002c: ldloc.2 - IL_002d: conv.ovf.i.un + IL_002d: conv.i IL_002e: ldloc.3 IL_002f: stelem.i4 IL_0030: ldloc.3 @@ -424,7 +424,7 @@ module Int32 = IL_0041: ldloc.3 IL_0042: ldloc.s V_4 - IL_0044: conv.ovf.i.un + IL_0044: conv.i IL_0045: ldloc.s V_5 IL_0047: stelem.i4 IL_0048: ldloc.s V_5 @@ -585,7 +585,7 @@ module Int32 = IL_0014: ldloc.0 IL_0015: ldloc.1 - IL_0016: conv.ovf.i.un + IL_0016: conv.i IL_0017: ldloc.2 IL_0018: stelem.i4 IL_0019: ldloc.2 @@ -756,7 +756,7 @@ module Int32 = IL_005a: ldloc.1 IL_005b: ldloc.2 - IL_005c: conv.ovf.i.un + IL_005c: conv.i IL_005d: ldloc.3 IL_005e: stelem.i4 IL_005f: ldloc.3 @@ -977,7 +977,7 @@ module Int32 = IL_007e: ldloc.s V_4 IL_0080: ldloc.s V_5 - IL_0082: conv.ovf.i.un + IL_0082: conv.i IL_0083: ldloc.s V_6 IL_0085: stelem.i4 IL_0086: ldloc.s V_6 From da5f1148fc0fde9b49973a84f7c23406d1abd3ea Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 22 Feb 2024 08:21:22 -0500 Subject: [PATCH 49/66] Add some debug stepping samples --- .../TheBigFileOfDebugStepping.fsx | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx b/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx index 59e13687105..a9ae82e956b 100644 --- a/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx +++ b/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx @@ -1072,6 +1072,46 @@ module ForLoopRegularCode = printfn $"hello, x = {x}" printfn $"hello, x = {x}" + let testSimpleForEachIntRangeStepLoopWithOneStatement (start, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + + let testSimpleForEachIntRangeStepLoopWithTwoStatements (start, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopWithOneStatement (start: int64, stop) = + for x in start .. stop do + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopWithTwoStatements (start: int64, stop) = + for x in start .. stop do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopDownWithOneStatement (start: int64, stop) = + for x in stop .. -1L .. start do + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopDownWithTwoStatements (start: int64, stop) = + for x in stop .. -1L .. start do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeStepLoopWithOneStatement (start: int64, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeStepLoopWithTwoStatements (start: int64, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeStepLoopWithConstCount () = + for x in 1L .. 3L .. 9L do + printfn $"hello, x = {x}" + let testSimpleForEachIntLoopWithOneStatement (start, stop) = for x = start to stop do printfn $"hello, x = {x}" @@ -1102,6 +1142,17 @@ module ForLoopRegularCode = testSimpleForEachIntRangeLoopWithTwoStatements (1, 3) testSimpleForEachIntRangeLoopDownWithOneStatement (1, 3) testSimpleForEachIntRangeLoopDownWithTwoStatements (1, 3) + + testSimpleForEachIntRangeStepLoopWithOneStatement (-1, 5, 10) + testSimpleForEachIntRangeStepLoopWithTwoStatements (-1, 5, 10) + testSimpleForEachInt64RangeLoopWithOneStatement (3L, 7L) + testSimpleForEachInt64RangeLoopWithTwoStatements (-4L, 0L) + testSimpleForEachInt64RangeLoopDownWithOneStatement (3L, -1L) + testSimpleForEachInt64RangeLoopDownWithTwoStatements (3L, -1L) + testSimpleForEachInt64RangeStepLoopWithOneStatement (0L, 2L, 5L) + testSimpleForEachInt64RangeStepLoopWithTwoStatements (0L, 2L, 5L) + testSimpleForEachInt64RangeStepLoopWithConstCount () + testSimpleForEachIntLoopWithOneStatement (1, 3) testSimpleForEachIntLoopWithTwoStatements (1, 3) testSimpleForEachIntLoopDownWithOneStatement (1, 3) From 2323b20f6c1156d56bc8841b20034402fd6a1663 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 22 Feb 2024 14:39:18 -0500 Subject: [PATCH 50/66] Add comment to help future contributors * This happened to me, and it could easily happen again :) Maybe someday these tests should be wrapped in a timeout or the like. --- tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 2b7add1611a..97dd669bc92 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -998,6 +998,8 @@ module internal RangeTestsHelpers = Assert.AreEqual ([|min0 .. max2 .. max0|], [|min0; min0 + max2|]) Assert.AreEqual ([|min0 .. max3 .. max0|], [|min0; min0 + max3|]) +// Note to future contributors: if the code gen for ranges is not correct, +// some of these tests may loop forever or use up all available memory instead of failing outright. module RangeTests = /// [|Byte.MinValue..Byte.MaxValue|] let allBytesArray = From 1293e339b268dfcd95792dfa14f50c78902cd9fd Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 27 Feb 2024 13:21:43 -0500 Subject: [PATCH 51/66] =?UTF-8?q?Handle=20ranges=20with=20count=202?= =?UTF-8?q?=E2=81=B6=E2=81=B4=20+=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Optimize/LowerComputedCollections.fs | 46 +- src/Compiler/TypedTree/TypedTreeOps.fs | 391 ++- .../ComputedCollections.fs | 36 + .../ComputedCollections/Int32RangeArrays.fs | 25 + .../Int32RangeArrays.fs.il.bsl | 1827 ++++++++++++++ .../ComputedCollections/Int32RangeLists.fs | 25 + .../Int32RangeLists.fs.il.bsl | 1605 +++++++++++++ .../ComputedCollections/UInt64RangeArrays.fs | 22 + .../UInt64RangeArrays.fs.il.bsl | 2134 +++++++++++++++++ .../ComputedCollections/UInt64RangeLists.fs | 22 + .../UInt64RangeLists.fs.il.bsl | 1850 ++++++++++++++ .../EmittedIL/ForLoop/ForEachRangeStepChar.fs | 57 + .../ForEachRangeStepChar.fs.opt.il.bsl | 807 +++++++ .../ForLoop/ForEachRangeStepInt16.fs | 65 + .../ForEachRangeStepInt16.fs.opt.il.bsl | 728 ++++++ .../ForLoop/ForEachRangeStepInt32.fs | 65 + .../ForEachRangeStepInt32.fs.opt.il.bsl | 689 ++++++ .../ForLoop/ForEachRangeStepInt64.fs | 65 + .../ForEachRangeStepInt64.fs.opt.il.bsl | 960 ++++++++ .../ForLoop/ForEachRangeStepIntPtr.fs | 65 + .../ForEachRangeStepIntPtr.fs.opt.il.bsl | 1348 +++++++++++ .../ForLoop/ForEachRangeStepSByte.fs | 65 + .../ForEachRangeStepSByte.fs.opt.il.bsl | 728 ++++++ .../ForLoop/ForEachRangeStepUInt16.fs | 57 + .../ForEachRangeStepUInt16.fs.opt.il.bsl | 633 +++++ .../ForLoop/ForEachRangeStepUInt32.fs | 57 + .../ForEachRangeStepUInt32.fs.opt.il.bsl | 673 ++++++ .../ForLoop/ForEachRangeStepUInt64.fs | 57 + .../ForEachRangeStepUInt64.fs.opt.il.bsl | 834 +++++++ .../ForLoop/ForEachRangeStepUIntPtr.fs | 57 + .../ForEachRangeStepUIntPtr.fs.opt.il.bsl | 1007 ++++++++ .../EmittedIL/ForLoop/ForLoop.fs | 76 + ...onTrivialBranchingBindingInEnd03.fs.il.bsl | 2 +- ...ivialBranchingBindingInEnd03.fs.opt.il.bsl | 2 +- ...onTrivialBranchingBindingInEnd04.fs.il.bsl | 2 +- ...ivialBranchingBindingInEnd04.fs.opt.il.bsl | 2 +- .../FSharp.Core/PrimTypes.fs | 46 +- 37 files changed, 16943 insertions(+), 187 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 35bd203878b..e6a06559ed8 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -372,28 +372,30 @@ module Array = mkArrayInit count mkLoop | _dynamicCount -> - let countTy = tyOfExpr g count - - // count < 1 - let countLtOne = - if isSignedIntegerTy g countTy then - mkILAsmClt g m count (mkTypedOne g m countTy) - else - mkAsmExpr ([AI_clt_un], [], [count; mkTypedOne g m countTy], [g.bool_ty], m) - - // if count < 1 then - // [||] - // else - // let array = (# "newarr !0" type ('T) count : 'T array #) in - // - // array - mkCond - DebugPointAtBinding.NoneAtInvisible - m - arrayTy - countLtOne - (mkArray (overallElemTy, [], m)) - (mkArrayInit count mkLoop) + mkCompGenLetIn m (nameof count) (tyOfExpr g count) count (fun (_, count) -> + let countTy = tyOfExpr g count + + // count < 1 + let countLtOne = + if isSignedIntegerTy g countTy then + mkILAsmClt g m count (mkTypedOne g m countTy) + else + mkAsmExpr ([AI_clt_un], [], [count; mkTypedOne g m countTy], [g.bool_ty], m) + + // if count < 1 then + // [||] + // else + // let array = (# "newarr !0" type ('T) count : 'T array #) in + // + // array + mkCond + DebugPointAtBinding.NoneAtInvisible + m + arrayTy + countLtOne + (mkArray (overallElemTy, [], m)) + (mkArrayInit count mkLoop) + ) ) let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index d618edb853c..6c163e00ab6 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10370,6 +10370,29 @@ let (|ConstCount|_|) (start, step, finish) = | _ -> ValueNone +type Count = Expr +type Idx = Expr +type Elem = Expr +type Body = Expr +type Loop = Expr +type WouldOvf = Expr + +[] +type RangeCount = + /// A count known at compile time. + | Constant of Count + + /// A "count" whose step is known to be zero at compile time. + /// Evaluating this expression at runtime will raise an exception. + | ConstantZeroStep of Expr + + /// A count that will be computed at runtime but will definitely fit in 64 bits without overflow. + | Safe of Count + + /// A count that, when one is added to it, might not fit in 64 bits without overflow, + /// in which case evaluating the expression would raise an overflow exception at runtime. + | PossiblyOversize of ((Count -> WouldOvf -> Count) -> Count) + /// Makes an expression to compute the iteration count for the given integral range. let mkRangeCount g m rangeTy rangeExpr start step finish = /// This will raise an exception at runtime if step is zero. @@ -10379,8 +10402,6 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = match rangeExpr with // Type-specific range op (RangeInt32, etc.). | Expr.App (funcExpr, formalType, tyargs, [_start; _step; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) - // Generic range op (RangeGeneric). - | Expr.App (funcExpr, formalType, tyargs, [one; add; _start; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [one; add; start; finish], m) // Generic range–step op (RangeStepGeneric). | Expr.App (funcExpr, formalType, tyargs, [zero; add; _start; _ste; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [zero; add; start; step; finish], m) | _ -> error (InternalError ($"Unrecognized range function application '{rangeExpr}'.", m)) @@ -10411,7 +10432,6 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = /// Convert the value to the next-widest unsigned type. /// We do this so that adding one won't result in overflow. - /// If finish - start (or start - finish) = 2⁶⁴, an overflow exception will be raised when we try to add one in a subsequent step. let mkWiden e = let ty = stripMeasuresFromTy g (tyOfExpr g e) @@ -10441,38 +10461,62 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = mkAsmExpr ([AI_div_un], [], [diff; step], [tyOfExpr g diff], m) - /// (diff / step + 1) - let mkAddOne pseudoCount = - // For parity with the behavior of (..) and (.. ..) in FSharp.Core, - // we want an overflow exception to be raised at runtime - // instead of returning a 0 or negative count here. - let shouldRaiseOverflowExnAtRuntime = - let ty = stripMeasuresFromTy g rangeTy + /// Whether the total count might not fit in 64 bits. + let couldBeTooBig ty = + let underlying = stripMeasuresFromTy g ty - typeEquiv g ty g.int64_ty - || typeEquiv g ty g.uint64_ty - || typeEquiv g ty g.nativeint_ty - || typeEquiv g ty g.unativeint_ty + typeEquiv g underlying g.int64_ty + || typeEquiv g underlying g.uint64_ty + || typeEquiv g underlying g.nativeint_ty + || typeEquiv g underlying g.unativeint_ty + /// pseudoCount + 1 + let mkAddOne pseudoCount = let ty = tyOfExpr g pseudoCount - if shouldRaiseOverflowExnAtRuntime then + if couldBeTooBig ty then mkAsmExpr ([AI_add_ovf_un], [], [pseudoCount; mkTypedOne g m ty], [ty], m) else mkAsmExpr ([AI_add], [], [pseudoCount; mkTypedOne g m ty], [ty], m) + let mkRuntimeCalc pseudoCount count = + let underlying = stripMeasuresFromTy g rangeTy + + if typeEquiv g underlying g.int64_ty || typeEquiv g underlying g.uint64_ty then + RangeCount.PossiblyOversize (fun f -> + mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> + let wouldOvf = mkILAsmCeq g m pseudoCount (Expr.Const (Const.UInt64 UInt64.MaxValue, m, g.uint64_ty)) + mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> + f count wouldOvf))) + elif typeEquiv g underlying g.nativeint_ty || typeEquiv g underlying g.unativeint_ty then // We have a nativeint ty whose size we won't know till runtime. + RangeCount.PossiblyOversize (fun f -> + mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> + let wouldOvf = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + g.bool_ty + (mkILAsmCeq g m (mkAsmExpr ([I_sizeof g.ilg.typ_IntPtr], [], [], [g.uint32_ty], m)) (Expr.Const (Const.UInt32 4u, m, g.uint32_ty))) + (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr (uint64 UInt32.MaxValue), m, g.unativeint_ty))) + (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr UInt64.MaxValue, m, g.unativeint_ty))) + + mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> + f count wouldOvf))) + else + RangeCount.Safe count + match start, step, finish with // start..0..finish - | _, Expr.Const (value = IntegralConst.Zero), _ -> mkSequential m (mkCallAndIgnoreRangeExpr start step finish) (mkMinusOne g m) + | _, Expr.Const (value = IntegralConst.Zero), _ -> RangeCount.ConstantZeroStep (mkSequential m (mkCallAndIgnoreRangeExpr start step finish) (mkMinusOne g m)) // 5..1 // 1..-1..5 - | EmptyRange -> mkTypedZero g m rangeTy + | EmptyRange -> RangeCount.Constant (mkTypedZero g m rangeTy) // 1..5 // 1..2..5 // 5..-1..1 - | ConstCount count -> Expr.Const (count, m, nextWidestUnsignedTy rangeTy) + | ConstCount count -> RangeCount.Constant (Expr.Const (count, m, nextWidestUnsignedTy rangeTy)) // start..finish // start..1..finish @@ -10482,13 +10526,27 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let diff = mkDiff finish start let diffTy = tyOfExpr g diff - mkCond - DebugPointAtBinding.NoneAtInvisible - m - diffTy - (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m diffTy) - (mkAddOne diff) + let mkCount mkAddOne = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m diffTy) + (mkAddOne diff) + + match start, finish with + // The total count could exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 Int64.MinValue), _ | _, Expr.Const (value = Const.Int64 Int64.MaxValue) + | Expr.Const (value = Const.UInt64 UInt64.MinValue), _ | _, Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> + mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + + // The total count could not exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) + | Expr.Const (value = Const.UInt64 _), _ | _, Expr.Const (value = Const.UInt64 _) -> + RangeCount.Safe (mkCount mkAddOne) + + | _ -> mkRuntimeCalc (mkCount id) (mkCount mkAddOne) // (Only possible for signed types.) // @@ -10499,13 +10557,25 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let diff = mkDiff start finish let diffTy = tyOfExpr g diff - mkCond - DebugPointAtBinding.NoneAtInvisible - m - diffTy - (mkSignednessAppropriateClt rangeTy start finish) - (mkTypedZero g m diffTy) - (mkAddOne diff) + let mkCount mkAddOne = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkTypedZero g m diffTy) + (mkAddOne diff) + + match start, finish with + // The total count could exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 Int64.MaxValue), _ | _, Expr.Const (value = Const.Int64 Int64.MinValue) -> + mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + + // The total count could not exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) -> + RangeCount.Safe (mkCount mkAddOne) + + | _ -> mkRuntimeCalc (mkCount id) (mkCount mkAddOne) // start..2..finish // @@ -10514,13 +10584,18 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let diff = mkDiff finish start let diffTy = tyOfExpr g diff - mkCond - DebugPointAtBinding.NoneAtInvisible - m - diffTy - (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff step)) + let count = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m diffTy) + (mkAddOne (mkQuotient diff step)) + + // We know that the magnitude of step is greater than one, + // so we know that the total count won't overflow. + RangeCount.Safe count // (Only possible for signed types.) // @@ -10531,13 +10606,18 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let diff = mkDiff start finish let diffTy = tyOfExpr g diff - mkCond - DebugPointAtBinding.NoneAtInvisible - m - diffTy - (mkSignednessAppropriateClt rangeTy start finish) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff (Expr.Const (IntegralConst.abs negativeStep, m, diffTy)))) + let count = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkTypedZero g m diffTy) + (mkAddOne (mkQuotient diff (Expr.Const (IntegralConst.abs negativeStep, m, diffTy)))) + + // We know that the magnitude of step is greater than one, + // so we know that the total count won't overflow. + RangeCount.Safe count // start..step..finish // @@ -10561,9 +10641,42 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = (mkCallAndIgnoreRangeExpr start step finish) (mkUnit g m) - let count = - if isSignedIntegerTy g rangeTy then - let positiveStep = + let mkCount mkAddOne = + let count = + if isSignedIntegerTy g rangeTy then + let positiveStep = + let diff = mkDiff finish start + let diffTy = tyOfExpr g diff + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m diffTy) + (mkAddOne (mkQuotient diff step)) + + let negativeStep = + let diff = mkDiff start finish + let diffTy = tyOfExpr g diff + let absStep = mkAsmExpr ([AI_add], [], [mkWiden (mkAsmExpr ([AI_not], [], [step], [rangeTy], m)); mkTypedOne g m diffTy], [diffTy], m) + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + diffTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkTypedZero g m diffTy) + (mkAddOne (mkQuotient diff absStep)) + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + (tyOfExpr g positiveStep) + (mkSignednessAppropriateClt rangeTy (mkTypedZero g m rangeTy) step) + positiveStep + negativeStep + else // Unsigned. let diff = mkDiff finish start let diffTy = tyOfExpr g diff @@ -10575,45 +10688,21 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = (mkTypedZero g m diffTy) (mkAddOne (mkQuotient diff step)) - let negativeStep = - let diff = mkDiff start finish - let diffTy = tyOfExpr g diff - let absStep = mkAsmExpr ([AI_add], [], [mkWiden (mkAsmExpr ([AI_not], [], [step], [rangeTy], m)); mkTypedOne g m diffTy], [diffTy], m) + mkSequential m throwIfStepIsZero count - mkCond - DebugPointAtBinding.NoneAtInvisible - m - diffTy - (mkSignednessAppropriateClt rangeTy start finish) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff absStep)) - - mkCond - DebugPointAtBinding.NoneAtInvisible - m - (tyOfExpr g positiveStep) - (mkSignednessAppropriateClt rangeTy (mkTypedZero g m rangeTy) step) - positiveStep - negativeStep - else // Unsigned. - let diff = mkDiff finish start - let diffTy = tyOfExpr g diff - - mkCond - DebugPointAtBinding.NoneAtInvisible - m - diffTy - (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff step)) - - mkSequential m throwIfStepIsZero count + match start, finish with + // The total count could exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 Int64.MinValue), _ | _, Expr.Const (value = Const.Int64 Int64.MaxValue) + | Expr.Const (value = Const.Int64 Int64.MaxValue), _ | _, Expr.Const (value = Const.Int64 Int64.MinValue) + | Expr.Const (value = Const.UInt64 UInt64.MinValue), _ | _, Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> + mkRuntimeCalc (mkCount id) (mkCount mkAddOne) -type Count = Expr -type Idx = Expr -type Elem = Expr -type Body = Expr -type Loop = Expr + // The total count could not exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) + | Expr.Const (value = Const.UInt64 _), _ | _, Expr.Const (value = Const.UInt64 _) -> + RangeCount.Safe (mkCount mkAddOne) + + | _ -> mkRuntimeCalc (mkCount id) (mkCount mkAddOne) let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr)) = let inline mkLetBindingsIfNeeded f = @@ -10655,35 +10744,74 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, f start step finish))) mkLetBindingsIfNeeded (fun start step finish -> - let mkBindCountIfNeeded f = - match mkRangeCount g mIn rangeTy rangeExpr start step finish with - | Expr.Const _ as count -> f count - | count -> mkCompGenLetIn mIn "count" (tyOfExpr g count) count (fun (_, count) -> f count) - - mkBindCountIfNeeded (fun count -> - buildLoop count (fun mkBody -> - let countTy = tyOfExpr g count - - mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> - mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> - // loopVar <- loopVar + step - let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) - - // i <- i + 1 - let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) - - // - // loopVar <- loopVar + step - // i <- i + 1 - let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI] - - // i < count - let guard = mkAsmExpr ([AI_clt_un], [], [idxVar; count], [g.bool_ty], mFor) - - // while i < count do - // - // loopVar <- loopVar + step - // i <- i + 1 + /// Start at 0 and count up through count - 1. + /// + /// while i < count do + /// + /// i <- i + 1 + let mkCountUpExclusive mkBody count = + let countTy = tyOfExpr g count + + mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> + mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> + // loopVar <- loopVar + step + let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) + + // i <- i + 1 + let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) + + // + // loopVar <- loopVar + step + // i <- i + 1 + let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI] + + // i < count + let guard = mkAsmExpr ([AI_clt_un], [], [idxVar; count], [g.bool_ty], mFor) + + // while i < count do + // + // loopVar <- loopVar + step + // i <- i + 1 + mkWhile + g + ( + spInWhile, + WhileLoopForCompiledForEachExprMarker, + guard, + body, + mBody + ) + ) + ) + + /// Start at 0 and count up till we have wrapped around. + /// + ///  + /// while i > 0 do + /// + /// i <- i + 1 + let mkCountUpInclusive mkBody countTy = + mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> + mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> + // loopVar <- loopVar + step + let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) + + // i <- i + 1 + let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) + + // + // loopVar <- loopVar + step + // i <- i + 1 + let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI] + + // i > 0 + let guard = mkAsmExpr ([AI_cgt_un], [], [idxVar; mkTypedZero g mFor countTy], [g.bool_ty], mFor) + + // while i > 0 do + // + // loopVar <- loopVar + step + // i <- i + 1 + let loop = mkWhile g ( @@ -10693,10 +10821,39 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, body, mBody ) - ) + + // + // loopVar <- loopVar + step + // i <- i + 1 + // while i > 0 do + // + // loopVar <- loopVar + step + // i <- i + 1 + mkSequential mBody body loop ) ) - ) + + match mkRangeCount g mIn rangeTy rangeExpr start step finish with + | RangeCount.Constant count -> + buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count) + + | RangeCount.ConstantZeroStep count -> + buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count) + + | RangeCount.Safe count -> + mkCompGenLetIn mIn (nameof count) (tyOfExpr g count) count (fun (_, count) -> + buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count)) + + | RangeCount.PossiblyOversize calc -> + calc (fun count wouldOvf -> + buildLoop count (fun mkBody -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + wouldOvf + (mkCountUpInclusive mkBody (tyOfExpr g count)) + (mkCompGenLetIn mIn (nameof count) (tyOfExpr g count) count (fun (_, count) -> mkCountUpExclusive mkBody count)))) ) let mkDebugPoint m expr = diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs new file mode 100644 index 00000000000..b97d6e164fb --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs @@ -0,0 +1,36 @@ +namespace EmittedIL + +open FSharp.Test +open FSharp.Test.Compiler +open Xunit + +module ComputedCollections = + let verifyCompilation compilation = + compilation + |> asExe + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> withOptimize + |> withEmbeddedPdb + |> withEmbedAllSource + |> ignoreWarnings + |> verifyILBaseline + + [] + let ``Int32RangeArrays_fs`` compilation = + compilation + |> verifyCompilation + + [] + let ``Int32RangeLists_fs`` compilation = + compilation + |> verifyCompilation + + [] + let ``UInt64RangeArrays_fs`` compilation = + compilation + |> verifyCompilation + + [] + let ``UInt64RangeLists_fs`` compilation = + compilation + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs new file mode 100644 index 00000000000..6c862181398 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs @@ -0,0 +1,25 @@ +let f1 () = [|1..10|] +let f2 () = [|10..1|] +let f3 () = [|1..1..10|] +let f4 () = [|1..2..10|] +let f5 () = [|10..1..1|] +let f6 () = [|1..-1..10|] +let f7 () = [|10..-1..1|] +let f8 () = [|10..-2..1|] +let f9 start = [|start..10|] +let f10 finish = [|1..finish|] +let f11 start finish = [|start..finish|] +let f12 start = [|start..1..10|] +let f13 step = [|1..step..10|] +let f14 finish = [|1..1..finish|] +let f15 start step = [|start..step..10|] +let f16 start finish = [|start..1..finish|] +let f17 step finish = [|1..step..finish|] +let f18 start step finish = [|start..step..finish|] +let f19 f = [|f ()..10|] +let f20 f = [|1..f ()|] +let f21 f g = [|f ()..g()|] +let f22 f = [|f ()..1..10|] +let f23 f = [|1..f ()..10|] +let f24 f = [|1..1..f ()|] +let f25 f g h= [|f ()..g ()..h ()|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl new file mode 100644 index 00000000000..4698da12f75 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl @@ -0,0 +1,1827 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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[] f1() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + 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_001f + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i4 + IL_0016: ldloc.2 + IL_0017: ldc.i4.1 + IL_0018: add + IL_0019: stloc.2 + IL_001a: ldloc.1 + IL_001b: ldc.i4.1 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.0 + IL_0026: 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) + 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_001f + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i4 + IL_0016: ldloc.2 + IL_0017: ldc.i4.1 + IL_0018: add + IL_0019: stloc.2 + IL_001a: ldloc.1 + IL_001b: ldc.i4.1 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static int32[] f4() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + 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_001e + + IL_0010: ldloc.0 + IL_0011: ldloc.1 + IL_0012: conv.i + IL_0013: ldloc.2 + IL_0014: stelem.i4 + IL_0015: ldloc.2 + IL_0016: ldc.i4.2 + IL_0017: add + IL_0018: stloc.2 + IL_0019: ldloc.1 + IL_001a: ldc.i4.1 + IL_001b: conv.i8 + IL_001c: add + IL_001d: stloc.1 + IL_001e: ldloc.1 + IL_001f: ldc.i4.5 + IL_0020: conv.i8 + IL_0021: blt.un.s IL_0010 + + IL_0023: ldloc.0 + IL_0024: 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) + 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_0020 + + IL_0012: ldloc.0 + IL_0013: ldloc.1 + IL_0014: conv.i + IL_0015: ldloc.2 + IL_0016: stelem.i4 + IL_0017: ldloc.2 + IL_0018: ldc.i4.m1 + 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.s 10 + IL_0023: conv.i8 + IL_0024: blt.un.s IL_0012 + + IL_0026: ldloc.0 + IL_0027: ret + } + + .method public static int32[] f8() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + 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_0020 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i4 + IL_0016: ldloc.2 + IL_0017: ldc.i4.s -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_0011 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static int32[] f9(int32 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_0015 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: conv.i8 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.0 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.Int32 + IL_0028: stloc.1 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.2 + IL_002c: ldarg.0 + IL_002d: stloc.3 + IL_002e: br.s IL_003e + + IL_0030: ldloc.1 + IL_0031: ldloc.2 + IL_0032: conv.i + IL_0033: ldloc.3 + IL_0034: stelem.i4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.2 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.2 + IL_003e: ldloc.2 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_0030 + + IL_0042: ldloc.1 + IL_0043: ret + } + + .method public static int32[] f10(int32 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_0013 + + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: bge.un.s IL_001f + + IL_0019: call !!0[] [runtime]System.Array::Empty() + IL_001e: ret + + IL_001f: ldloc.0 + IL_0020: conv.ovf.i.un + IL_0021: newarr [runtime]System.Int32 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldc.i4.1 + IL_002b: stloc.3 + IL_002c: br.s IL_003c + + IL_002e: ldloc.1 + IL_002f: ldloc.2 + IL_0030: conv.i + IL_0031: ldloc.3 + IL_0032: stelem.i4 + IL_0033: ldloc.3 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.2 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: add + IL_003b: stloc.2 + IL_003c: ldloc.2 + IL_003d: ldloc.0 + IL_003e: blt.un.s IL_002e + + IL_0040: ldloc.1 + IL_0041: 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, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_0013 + + IL_000a: ldarg.1 + IL_000b: conv.i8 + IL_000c: ldarg.0 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: bge.un.s IL_001f + + IL_0019: call !!0[] [runtime]System.Array::Empty() + IL_001e: ret + + IL_001f: ldloc.0 + IL_0020: conv.ovf.i.un + IL_0021: newarr [runtime]System.Int32 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldarg.0 + IL_002b: stloc.3 + IL_002c: br.s IL_003c + + IL_002e: ldloc.1 + IL_002f: ldloc.2 + IL_0030: conv.i + IL_0031: ldloc.3 + IL_0032: stelem.i4 + IL_0033: ldloc.3 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.2 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: add + IL_003b: stloc.2 + IL_003c: ldloc.2 + IL_003d: ldloc.0 + IL_003e: blt.un.s IL_002e + + IL_0040: ldloc.1 + IL_0041: ret + } + + .method public static int32[] f12(int32 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_0015 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: conv.i8 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.0 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.Int32 + IL_0028: stloc.1 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.2 + IL_002c: ldarg.0 + IL_002d: stloc.3 + IL_002e: br.s IL_003e + + IL_0030: ldloc.1 + IL_0031: ldloc.2 + IL_0032: conv.i + IL_0033: ldloc.3 + IL_0034: stelem.i4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.2 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.2 + IL_003e: ldloc.2 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_0030 + + IL_0042: ldloc.1 + IL_0043: ret + } + + .method public static int32[] f13(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_002f + + 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_004b + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: conv.i8 + IL_0028: div.un + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add.ovf.un + IL_002c: nop + IL_002d: br.s IL_004b + + IL_002f: ldc.i4.1 + IL_0030: ldc.i4.s 10 + IL_0032: bge.s IL_0039 + + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: nop + IL_0037: br.s IL_004b + + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: ldc.i4.s 10 + IL_003d: conv.i8 + IL_003e: sub + IL_003f: ldarg.0 + IL_0040: not + IL_0041: conv.i8 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: conv.i8 + IL_0046: div.un + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add.ovf.un + IL_004a: nop + IL_004b: stloc.0 + IL_004c: ldloc.0 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: bge.un.s IL_0057 + + IL_0051: call !!0[] [runtime]System.Array::Empty() + IL_0056: ret + + IL_0057: ldloc.0 + IL_0058: conv.ovf.i.un + IL_0059: newarr [runtime]System.Int32 + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.2 + IL_0062: ldc.i4.1 + IL_0063: stloc.3 + IL_0064: br.s IL_0074 + + IL_0066: ldloc.1 + IL_0067: ldloc.2 + IL_0068: conv.i + IL_0069: ldloc.3 + IL_006a: stelem.i4 + IL_006b: ldloc.3 + IL_006c: ldarg.0 + IL_006d: add + IL_006e: stloc.3 + IL_006f: ldloc.2 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.2 + IL_0074: ldloc.2 + IL_0075: ldloc.0 + IL_0076: blt.un.s IL_0066 + + IL_0078: ldloc.1 + IL_0079: ret + } + + .method public static int32[] f14(int32 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_0013 + + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: bge.un.s IL_001f + + IL_0019: call !!0[] [runtime]System.Array::Empty() + IL_001e: ret + + IL_001f: ldloc.0 + IL_0020: conv.ovf.i.un + IL_0021: newarr [runtime]System.Int32 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldc.i4.1 + IL_002b: stloc.3 + IL_002c: br.s IL_003c + + IL_002e: ldloc.1 + IL_002f: ldloc.2 + IL_0030: conv.i + IL_0031: ldloc.3 + IL_0032: stelem.i4 + IL_0033: ldloc.3 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.2 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: add + IL_003b: stloc.2 + IL_003c: ldloc.2 + IL_003d: ldloc.0 + IL_003e: blt.un.s IL_002e + + IL_0040: ldloc.1 + IL_0041: 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, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_002f + + 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_004b + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldarg.0 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.1 + IL_0027: conv.i8 + IL_0028: div.un + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add.ovf.un + IL_002c: nop + IL_002d: br.s IL_004b + + IL_002f: ldarg.0 + IL_0030: ldc.i4.s 10 + IL_0032: bge.s IL_0039 + + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: nop + IL_0037: br.s IL_004b + + IL_0039: ldarg.0 + IL_003a: conv.i8 + IL_003b: ldc.i4.s 10 + IL_003d: conv.i8 + IL_003e: sub + IL_003f: ldarg.1 + IL_0040: not + IL_0041: conv.i8 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: conv.i8 + IL_0046: div.un + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add.ovf.un + IL_004a: nop + IL_004b: stloc.0 + IL_004c: ldloc.0 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: bge.un.s IL_0057 + + IL_0051: call !!0[] [runtime]System.Array::Empty() + IL_0056: ret + + IL_0057: ldloc.0 + IL_0058: conv.ovf.i.un + IL_0059: newarr [runtime]System.Int32 + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.2 + IL_0062: ldarg.0 + IL_0063: stloc.3 + IL_0064: br.s IL_0074 + + IL_0066: ldloc.1 + IL_0067: ldloc.2 + IL_0068: conv.i + IL_0069: ldloc.3 + IL_006a: stelem.i4 + IL_006b: ldloc.3 + IL_006c: ldarg.1 + IL_006d: add + IL_006e: stloc.3 + IL_006f: ldloc.2 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.2 + IL_0074: ldloc.2 + IL_0075: ldloc.0 + IL_0076: blt.un.s IL_0066 + + IL_0078: ldloc.1 + IL_0079: 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, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_0013 + + IL_000a: ldarg.1 + IL_000b: conv.i8 + IL_000c: ldarg.0 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: bge.un.s IL_001f + + IL_0019: call !!0[] [runtime]System.Array::Empty() + IL_001e: ret + + IL_001f: ldloc.0 + IL_0020: conv.ovf.i.un + IL_0021: newarr [runtime]System.Int32 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldarg.0 + IL_002b: stloc.3 + IL_002c: br.s IL_003c + + IL_002e: ldloc.1 + IL_002f: ldloc.2 + IL_0030: conv.i + IL_0031: ldloc.3 + IL_0032: stelem.i4 + IL_0033: ldloc.3 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.2 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: add + IL_003b: stloc.2 + IL_003c: ldloc.2 + IL_003d: ldloc.0 + IL_003e: blt.un.s IL_002e + + IL_0040: ldloc.1 + IL_0041: 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, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_002c + + 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_0046 + + IL_001e: ldarg.1 + IL_001f: conv.i8 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: sub + IL_0023: ldarg.0 + IL_0024: conv.i8 + IL_0025: div.un + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add.ovf.un + IL_0029: nop + IL_002a: br.s IL_0046 + + IL_002c: ldc.i4.1 + IL_002d: ldarg.1 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0046 + + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: ldarg.1 + IL_0038: conv.i8 + IL_0039: sub + IL_003a: ldarg.0 + IL_003b: not + IL_003c: conv.i8 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: conv.i8 + IL_0041: div.un + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.0 + IL_0047: ldloc.0 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: bge.un.s IL_0052 + + IL_004c: call !!0[] [runtime]System.Array::Empty() + IL_0051: ret + + IL_0052: ldloc.0 + IL_0053: conv.ovf.i.un + IL_0054: newarr [runtime]System.Int32 + IL_0059: stloc.1 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.2 + IL_005d: ldc.i4.1 + IL_005e: stloc.3 + IL_005f: br.s IL_006f + + IL_0061: ldloc.1 + IL_0062: ldloc.2 + IL_0063: conv.i + IL_0064: ldloc.3 + IL_0065: stelem.i4 + IL_0066: ldloc.3 + IL_0067: ldarg.0 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.2 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.2 + IL_006f: ldloc.2 + IL_0070: ldloc.0 + IL_0071: blt.un.s IL_0061 + + IL_0073: ldloc.1 + IL_0074: 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, + int32[] V_1, + uint64 V_2, + int32 V_3) + 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_002c + + 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_0046 + + IL_001e: ldarg.2 + IL_001f: conv.i8 + IL_0020: ldarg.0 + IL_0021: conv.i8 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: conv.i8 + IL_0025: div.un + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add.ovf.un + IL_0029: nop + IL_002a: br.s IL_0046 + + IL_002c: ldarg.0 + IL_002d: ldarg.2 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0046 + + IL_0035: ldarg.0 + IL_0036: conv.i8 + IL_0037: ldarg.2 + IL_0038: conv.i8 + IL_0039: sub + IL_003a: ldarg.1 + IL_003b: not + IL_003c: conv.i8 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: conv.i8 + IL_0041: div.un + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.0 + IL_0047: ldloc.0 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: bge.un.s IL_0052 + + IL_004c: call !!0[] [runtime]System.Array::Empty() + IL_0051: ret + + IL_0052: ldloc.0 + IL_0053: conv.ovf.i.un + IL_0054: newarr [runtime]System.Int32 + IL_0059: stloc.1 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.2 + IL_005d: ldarg.0 + IL_005e: stloc.3 + IL_005f: br.s IL_006f + + IL_0061: ldloc.1 + IL_0062: ldloc.2 + IL_0063: conv.i + IL_0064: ldloc.3 + IL_0065: stelem.i4 + IL_0066: ldloc.3 + IL_0067: ldarg.1 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.2 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.2 + IL_006f: ldloc.2 + IL_0070: ldloc.0 + IL_0071: blt.un.s IL_0061 + + IL_0073: ldloc.1 + IL_0074: 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, + int32[] V_2, + uint64 V_3, + int32 V_4) + 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_001c + + IL_0012: ldc.i4.s 10 + IL_0014: conv.i8 + IL_0015: ldloc.0 + IL_0016: conv.i8 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 + + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.1 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.Int32 + IL_002f: stloc.2 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.3 + IL_0033: ldloc.0 + IL_0034: stloc.s V_4 + IL_0036: br.s IL_0049 + + IL_0038: ldloc.2 + IL_0039: ldloc.3 + IL_003a: conv.i + IL_003b: ldloc.s V_4 + IL_003d: stelem.i4 + IL_003e: ldloc.s V_4 + IL_0040: ldc.i4.1 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: add + IL_0048: stloc.3 + IL_0049: ldloc.3 + IL_004a: ldloc.1 + IL_004b: blt.un.s IL_0038 + + IL_004d: ldloc.2 + IL_004e: 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, + int32[] V_2, + uint64 V_3, + int32 V_4) + 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_001a + + IL_0011: ldloc.0 + IL_0012: conv.i8 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: bge.un.s IL_0026 + + IL_0020: call !!0[] [runtime]System.Array::Empty() + IL_0025: ret + + IL_0026: ldloc.1 + IL_0027: conv.ovf.i.un + IL_0028: newarr [runtime]System.Int32 + IL_002d: stloc.2 + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: stloc.3 + IL_0031: ldc.i4.1 + IL_0032: stloc.s V_4 + IL_0034: br.s IL_0047 + + IL_0036: ldloc.2 + IL_0037: ldloc.3 + IL_0038: conv.i + IL_0039: ldloc.s V_4 + 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.1 + IL_0049: blt.un.s IL_0036 + + IL_004b: ldloc.2 + IL_004c: 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, + int32[] V_3, + uint64 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: 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_0022 + + IL_0019: ldloc.1 + IL_001a: conv.i8 + IL_001b: ldloc.0 + IL_001c: conv.i8 + IL_001d: sub + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: add.ovf.un + IL_0021: nop + IL_0022: stloc.2 + IL_0023: ldloc.2 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: bge.un.s IL_002e + + IL_0028: call !!0[] [runtime]System.Array::Empty() + IL_002d: ret + + IL_002e: ldloc.2 + IL_002f: conv.ovf.i.un + IL_0030: newarr [runtime]System.Int32 + IL_0035: stloc.3 + IL_0036: ldc.i4.0 + IL_0037: conv.i8 + IL_0038: stloc.s V_4 + IL_003a: ldloc.0 + IL_003b: stloc.s V_5 + IL_003d: br.s IL_0053 + + IL_003f: ldloc.3 + IL_0040: ldloc.s V_4 + IL_0042: conv.i + IL_0043: ldloc.s V_5 + IL_0045: stelem.i4 + IL_0046: ldloc.s V_5 + IL_0048: ldc.i4.1 + IL_0049: add + IL_004a: stloc.s V_5 + IL_004c: ldloc.s V_4 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.s V_4 + IL_0053: ldloc.s V_4 + IL_0055: ldloc.2 + IL_0056: blt.un.s IL_003f + + IL_0058: ldloc.3 + IL_0059: 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, + int32[] V_2, + uint64 V_3, + int32 V_4) + 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_001c + + IL_0012: ldc.i4.s 10 + IL_0014: conv.i8 + IL_0015: ldloc.0 + IL_0016: conv.i8 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 + + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.1 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.Int32 + IL_002f: stloc.2 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.3 + IL_0033: ldloc.0 + IL_0034: stloc.s V_4 + IL_0036: br.s IL_0049 + + IL_0038: ldloc.2 + IL_0039: ldloc.3 + IL_003a: conv.i + IL_003b: ldloc.s V_4 + IL_003d: stelem.i4 + IL_003e: ldloc.s V_4 + IL_0040: ldc.i4.1 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: add + IL_0048: stloc.3 + IL_0049: ldloc.3 + IL_004a: ldloc.1 + IL_004b: blt.un.s IL_0038 + + IL_004d: ldloc.2 + IL_004e: 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, + int32[] V_2, + uint64 V_3, + int32 V_4) + 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_0036 + + 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_0052 + + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: conv.i8 + IL_002f: div.un + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add.ovf.un + IL_0033: nop + IL_0034: br.s IL_0052 + + IL_0036: ldc.i4.1 + IL_0037: ldc.i4.s 10 + IL_0039: bge.s IL_0040 + + IL_003b: ldc.i4.0 + IL_003c: conv.i8 + IL_003d: nop + IL_003e: br.s IL_0052 + + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: ldc.i4.s 10 + IL_0044: conv.i8 + IL_0045: sub + IL_0046: ldloc.0 + IL_0047: not + IL_0048: conv.i8 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: conv.i8 + IL_004d: div.un + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add.ovf.un + IL_0051: nop + IL_0052: stloc.1 + IL_0053: ldloc.1 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: bge.un.s IL_005e + + IL_0058: call !!0[] [runtime]System.Array::Empty() + IL_005d: ret + + IL_005e: ldloc.1 + IL_005f: conv.ovf.i.un + IL_0060: newarr [runtime]System.Int32 + IL_0065: stloc.2 + IL_0066: ldc.i4.0 + IL_0067: conv.i8 + IL_0068: stloc.3 + IL_0069: ldc.i4.1 + IL_006a: stloc.s V_4 + IL_006c: br.s IL_007f + + IL_006e: ldloc.2 + IL_006f: ldloc.3 + IL_0070: conv.i + IL_0071: ldloc.s V_4 + IL_0073: stelem.i4 + IL_0074: ldloc.s V_4 + IL_0076: ldloc.0 + 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.1 + IL_0081: blt.un.s IL_006e + + IL_0083: ldloc.2 + IL_0084: 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, + int32[] V_2, + uint64 V_3, + int32 V_4) + 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_001a + + IL_0011: ldloc.0 + IL_0012: conv.i8 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: bge.un.s IL_0026 + + IL_0020: call !!0[] [runtime]System.Array::Empty() + IL_0025: ret + + IL_0026: ldloc.1 + IL_0027: conv.ovf.i.un + IL_0028: newarr [runtime]System.Int32 + IL_002d: stloc.2 + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: stloc.3 + IL_0031: ldc.i4.1 + IL_0032: stloc.s V_4 + IL_0034: br.s IL_0047 + + IL_0036: ldloc.2 + IL_0037: ldloc.3 + IL_0038: conv.i + IL_0039: ldloc.s V_4 + 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.1 + IL_0049: blt.un.s IL_0036 + + IL_004b: ldloc.2 + IL_004c: 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, + int32[] V_4, + uint64 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: 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_0043 + + 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_005d + + IL_0035: ldloc.2 + IL_0036: conv.i8 + IL_0037: ldloc.0 + IL_0038: conv.i8 + IL_0039: sub + IL_003a: ldloc.1 + IL_003b: conv.i8 + IL_003c: div.un + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add.ovf.un + IL_0040: nop + IL_0041: br.s IL_005d + + IL_0043: ldloc.0 + IL_0044: ldloc.2 + IL_0045: bge.s IL_004c + + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: nop + IL_004a: br.s IL_005d + + IL_004c: ldloc.0 + IL_004d: conv.i8 + IL_004e: ldloc.2 + IL_004f: conv.i8 + IL_0050: sub + IL_0051: ldloc.1 + IL_0052: not + IL_0053: conv.i8 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add + IL_0057: conv.i8 + IL_0058: div.un + IL_0059: ldc.i4.1 + IL_005a: conv.i8 + IL_005b: add.ovf.un + IL_005c: nop + IL_005d: stloc.3 + IL_005e: ldloc.3 + IL_005f: ldc.i4.1 + IL_0060: conv.i8 + IL_0061: bge.un.s IL_0069 + + IL_0063: call !!0[] [runtime]System.Array::Empty() + IL_0068: ret + + IL_0069: ldloc.3 + IL_006a: conv.ovf.i.un + IL_006b: newarr [runtime]System.Int32 + IL_0070: stloc.s V_4 + IL_0072: ldc.i4.0 + IL_0073: conv.i8 + IL_0074: stloc.s V_5 + IL_0076: ldloc.0 + IL_0077: stloc.s V_6 + IL_0079: br.s IL_0090 + + IL_007b: ldloc.s V_4 + IL_007d: ldloc.s V_5 + IL_007f: conv.i + IL_0080: ldloc.s V_6 + IL_0082: stelem.i4 + IL_0083: ldloc.s V_6 + IL_0085: ldloc.1 + IL_0086: add + IL_0087: stloc.s V_6 + IL_0089: ldloc.s V_5 + IL_008b: ldc.i4.1 + IL_008c: conv.i8 + IL_008d: add + IL_008e: stloc.s V_5 + IL_0090: ldloc.s V_5 + IL_0092: ldloc.3 + IL_0093: blt.un.s IL_007b + + IL_0095: ldloc.s V_4 + IL_0097: 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/Int32RangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs new file mode 100644 index 00000000000..37ab02c314b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs @@ -0,0 +1,25 @@ +let f1 () = [1..10] +let f2 () = [10..1] +let f3 () = [1..1..10] +let f4 () = [1..2..10] +let f5 () = [10..1..1] +let f6 () = [1..-1..10] +let f7 () = [10..-1..1] +let f8 () = [10..-2..1] +let f9 start = [start..10] +let f10 finish = [1..finish] +let f11 start finish = [start..finish] +let f12 start = [start..1..10] +let f13 step = [1..step..10] +let f14 finish = [1..1..finish] +let f15 start step = [start..step..10] +let f16 start finish = [start..1..finish] +let f17 step finish = [1..step..finish] +let f18 start step finish = [start..step..finish] +let f19 f = [f ()..10] +let f20 f = [1..f ()] +let f21 f g = [f ()..g()] +let f22 f = [f ()..1..10] +let f23 f = [1..f ()..10] +let f24 f = [1..1..f ()] +let f25 f g h= [f ()..g ()..h ()] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl new file mode 100644 index 00000000000..93cd75890ff --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl @@ -0,0 +1,1605 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 f1() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2) + 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_0019 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.2 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.2 + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.s 10 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0007 + + IL_001f: ldloca.s V_0 + IL_0021: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0026: 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) + 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_0019 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.2 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.2 + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.s 10 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0007 + + IL_001f: ldloca.s V_0 + IL_0021: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0026: 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) + 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_0019 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.2 + IL_0011: ldc.i4.2 + IL_0012: add + IL_0013: stloc.2 + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.5 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0007 + + IL_001e: ldloca.s V_0 + IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0025: 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) + 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_001a + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.m1 + IL_0013: add + IL_0014: stloc.2 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: blt.un.s IL_0008 + + 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 f8() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2) + 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_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.s -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_0008 + + 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 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) + 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_0015 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: conv.i8 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: ldarg.0 + IL_001a: stloc.3 + IL_001b: br.s IL_002f + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.2 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001d + + IL_0033: ldloca.s V_1 + IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003a: 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) + 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_0013 + + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldc.i4.1 + IL_0018: stloc.3 + IL_0019: br.s IL_002d + + IL_001b: ldloca.s V_1 + IL_001d: ldloc.3 + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.3 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.3 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001b + + IL_0031: ldloca.s V_1 + IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0038: 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) + 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_0013 + + IL_000a: ldarg.1 + IL_000b: conv.i8 + IL_000c: ldarg.0 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldarg.0 + IL_0018: stloc.3 + IL_0019: br.s IL_002d + + IL_001b: ldloca.s V_1 + IL_001d: ldloc.3 + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.3 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.3 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001b + + IL_0031: ldloca.s V_1 + IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0038: 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) + 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_0015 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: conv.i8 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: ldarg.0 + IL_001a: stloc.3 + IL_001b: br.s IL_002f + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.2 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001d + + IL_0033: ldloca.s V_1 + IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003a: 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) + 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_002f + + 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_004b + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: conv.i8 + IL_0028: div.un + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add.ovf.un + IL_002c: nop + IL_002d: br.s IL_004b + + IL_002f: ldc.i4.1 + IL_0030: ldc.i4.s 10 + IL_0032: bge.s IL_0039 + + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: nop + IL_0037: br.s IL_004b + + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: ldc.i4.s 10 + IL_003d: conv.i8 + IL_003e: sub + IL_003f: ldarg.0 + IL_0040: not + IL_0041: conv.i8 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: conv.i8 + IL_0046: div.un + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add.ovf.un + IL_004a: nop + IL_004b: stloc.0 + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: stloc.2 + IL_004f: ldc.i4.1 + IL_0050: stloc.3 + IL_0051: br.s IL_0065 + + IL_0053: ldloca.s V_1 + IL_0055: ldloc.3 + IL_0056: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_005b: nop + IL_005c: ldloc.3 + IL_005d: ldarg.0 + IL_005e: add + IL_005f: stloc.3 + IL_0060: ldloc.2 + IL_0061: ldc.i4.1 + IL_0062: conv.i8 + IL_0063: add + IL_0064: stloc.2 + IL_0065: ldloc.2 + IL_0066: ldloc.0 + IL_0067: blt.un.s IL_0053 + + IL_0069: ldloca.s V_1 + IL_006b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0070: 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) + 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_0013 + + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldc.i4.1 + IL_0018: stloc.3 + IL_0019: br.s IL_002d + + IL_001b: ldloca.s V_1 + IL_001d: ldloc.3 + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.3 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.3 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001b + + IL_0031: ldloca.s V_1 + IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0038: 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) + 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_002f + + 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_004b + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldarg.0 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.1 + IL_0027: conv.i8 + IL_0028: div.un + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add.ovf.un + IL_002c: nop + IL_002d: br.s IL_004b + + IL_002f: ldarg.0 + IL_0030: ldc.i4.s 10 + IL_0032: bge.s IL_0039 + + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: nop + IL_0037: br.s IL_004b + + IL_0039: ldarg.0 + IL_003a: conv.i8 + IL_003b: ldc.i4.s 10 + IL_003d: conv.i8 + IL_003e: sub + IL_003f: ldarg.1 + IL_0040: not + IL_0041: conv.i8 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: conv.i8 + IL_0046: div.un + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add.ovf.un + IL_004a: nop + IL_004b: stloc.0 + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: stloc.2 + IL_004f: ldarg.0 + IL_0050: stloc.3 + IL_0051: br.s IL_0065 + + IL_0053: ldloca.s V_1 + IL_0055: ldloc.3 + IL_0056: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_005b: nop + IL_005c: ldloc.3 + IL_005d: ldarg.1 + IL_005e: add + IL_005f: stloc.3 + IL_0060: ldloc.2 + IL_0061: ldc.i4.1 + IL_0062: conv.i8 + IL_0063: add + IL_0064: stloc.2 + IL_0065: ldloc.2 + IL_0066: ldloc.0 + IL_0067: blt.un.s IL_0053 + + IL_0069: ldloca.s V_1 + IL_006b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0070: 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) + 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_0013 + + IL_000a: ldarg.1 + IL_000b: conv.i8 + IL_000c: ldarg.0 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldarg.0 + IL_0018: stloc.3 + IL_0019: br.s IL_002d + + IL_001b: ldloca.s V_1 + IL_001d: ldloc.3 + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.3 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.3 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001b + + IL_0031: ldloca.s V_1 + IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0038: 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) + 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_002c + + 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_0046 + + IL_001e: ldarg.1 + IL_001f: conv.i8 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: sub + IL_0023: ldarg.0 + IL_0024: conv.i8 + IL_0025: div.un + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add.ovf.un + IL_0029: nop + IL_002a: br.s IL_0046 + + IL_002c: ldc.i4.1 + IL_002d: ldarg.1 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0046 + + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: ldarg.1 + IL_0038: conv.i8 + IL_0039: sub + IL_003a: ldarg.0 + IL_003b: not + IL_003c: conv.i8 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: conv.i8 + IL_0041: div.un + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.0 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.2 + IL_004a: ldc.i4.1 + IL_004b: stloc.3 + IL_004c: br.s IL_0060 + + IL_004e: ldloca.s V_1 + IL_0050: ldloc.3 + IL_0051: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0056: nop + IL_0057: ldloc.3 + IL_0058: ldarg.0 + IL_0059: add + IL_005a: stloc.3 + IL_005b: ldloc.2 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.2 + IL_0061: ldloc.0 + IL_0062: blt.un.s IL_004e + + IL_0064: ldloca.s V_1 + IL_0066: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006b: 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) + 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_002c + + 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_0046 + + IL_001e: ldarg.2 + IL_001f: conv.i8 + IL_0020: ldarg.0 + IL_0021: conv.i8 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: conv.i8 + IL_0025: div.un + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add.ovf.un + IL_0029: nop + IL_002a: br.s IL_0046 + + IL_002c: ldarg.0 + IL_002d: ldarg.2 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0046 + + IL_0035: ldarg.0 + IL_0036: conv.i8 + IL_0037: ldarg.2 + IL_0038: conv.i8 + IL_0039: sub + IL_003a: ldarg.1 + IL_003b: not + IL_003c: conv.i8 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: conv.i8 + IL_0041: div.un + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.0 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.2 + IL_004a: ldarg.0 + IL_004b: stloc.3 + IL_004c: br.s IL_0060 + + IL_004e: ldloca.s V_1 + IL_0050: ldloc.3 + IL_0051: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0056: nop + IL_0057: ldloc.3 + IL_0058: ldarg.1 + IL_0059: add + IL_005a: stloc.3 + IL_005b: ldloc.2 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.2 + IL_0061: ldloc.0 + IL_0062: blt.un.s IL_004e + + IL_0064: ldloca.s V_1 + IL_0066: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006b: 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) + 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_001c + + IL_0012: ldc.i4.s 10 + IL_0014: conv.i8 + IL_0015: ldloc.0 + IL_0016: conv.i8 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldc.i4.0 + IL_001e: conv.i8 + IL_001f: stloc.3 + IL_0020: ldloc.0 + IL_0021: stloc.s V_4 + IL_0023: br.s IL_003a + + IL_0025: ldloca.s V_2 + IL_0027: ldloc.s V_4 + IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002e: nop + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.3 + IL_003b: ldloc.1 + IL_003c: blt.un.s IL_0025 + + IL_003e: ldloca.s V_2 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: 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) + 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_001a + + IL_0011: ldloc.0 + IL_0012: conv.i8 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.3 + IL_001e: ldc.i4.1 + IL_001f: stloc.s V_4 + IL_0021: br.s IL_0038 + + IL_0023: ldloca.s V_2 + IL_0025: ldloc.s V_4 + IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002c: nop + IL_002d: ldloc.s V_4 + IL_002f: ldc.i4.1 + IL_0030: add + IL_0031: stloc.s V_4 + IL_0033: ldloc.3 + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldloc.1 + IL_003a: blt.un.s IL_0023 + + IL_003c: ldloca.s V_2 + IL_003e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0043: 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) + 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_0022 + + IL_0019: ldloc.1 + IL_001a: conv.i8 + IL_001b: ldloc.0 + IL_001c: conv.i8 + IL_001d: sub + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: add.ovf.un + IL_0021: nop + IL_0022: stloc.2 + IL_0023: ldc.i4.0 + IL_0024: conv.i8 + IL_0025: stloc.s V_4 + IL_0027: ldloc.0 + IL_0028: stloc.s V_5 + IL_002a: br.s IL_0043 + + IL_002c: ldloca.s V_3 + IL_002e: ldloc.s V_5 + IL_0030: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0035: nop + IL_0036: ldloc.s V_5 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_5 + IL_003c: ldloc.s V_4 + IL_003e: ldc.i4.1 + IL_003f: conv.i8 + IL_0040: add + IL_0041: stloc.s V_4 + IL_0043: ldloc.s V_4 + IL_0045: ldloc.2 + IL_0046: blt.un.s IL_002c + + IL_0048: ldloca.s V_3 + IL_004a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004f: 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) + 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_001c + + IL_0012: ldc.i4.s 10 + IL_0014: conv.i8 + IL_0015: ldloc.0 + IL_0016: conv.i8 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldc.i4.0 + IL_001e: conv.i8 + IL_001f: stloc.3 + IL_0020: ldloc.0 + IL_0021: stloc.s V_4 + IL_0023: br.s IL_003a + + IL_0025: ldloca.s V_2 + IL_0027: ldloc.s V_4 + IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002e: nop + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.3 + IL_003b: ldloc.1 + IL_003c: blt.un.s IL_0025 + + IL_003e: ldloca.s V_2 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: 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) + 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_0036 + + 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_0052 + + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: conv.i8 + IL_002f: div.un + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add.ovf.un + IL_0033: nop + IL_0034: br.s IL_0052 + + IL_0036: ldc.i4.1 + IL_0037: ldc.i4.s 10 + IL_0039: bge.s IL_0040 + + IL_003b: ldc.i4.0 + IL_003c: conv.i8 + IL_003d: nop + IL_003e: br.s IL_0052 + + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: ldc.i4.s 10 + IL_0044: conv.i8 + IL_0045: sub + IL_0046: ldloc.0 + IL_0047: not + IL_0048: conv.i8 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: conv.i8 + IL_004d: div.un + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add.ovf.un + IL_0051: nop + IL_0052: stloc.1 + IL_0053: ldc.i4.0 + IL_0054: conv.i8 + IL_0055: stloc.3 + IL_0056: ldc.i4.1 + IL_0057: stloc.s V_4 + IL_0059: br.s IL_0070 + + IL_005b: ldloca.s V_2 + IL_005d: ldloc.s V_4 + IL_005f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0064: nop + IL_0065: ldloc.s V_4 + IL_0067: ldloc.0 + IL_0068: add + IL_0069: stloc.s V_4 + IL_006b: ldloc.3 + IL_006c: ldc.i4.1 + IL_006d: conv.i8 + IL_006e: add + IL_006f: stloc.3 + IL_0070: ldloc.3 + IL_0071: ldloc.1 + IL_0072: blt.un.s IL_005b + + IL_0074: ldloca.s V_2 + IL_0076: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_007b: 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) + 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_001a + + IL_0011: ldloc.0 + IL_0012: conv.i8 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.3 + IL_001e: ldc.i4.1 + IL_001f: stloc.s V_4 + IL_0021: br.s IL_0038 + + IL_0023: ldloca.s V_2 + IL_0025: ldloc.s V_4 + IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002c: nop + IL_002d: ldloc.s V_4 + IL_002f: ldc.i4.1 + IL_0030: add + IL_0031: stloc.s V_4 + IL_0033: ldloc.3 + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldloc.1 + IL_003a: blt.un.s IL_0023 + + IL_003c: ldloca.s V_2 + IL_003e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0043: 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) + 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_0043 + + 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_005d + + IL_0035: ldloc.2 + IL_0036: conv.i8 + IL_0037: ldloc.0 + IL_0038: conv.i8 + IL_0039: sub + IL_003a: ldloc.1 + IL_003b: conv.i8 + IL_003c: div.un + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add.ovf.un + IL_0040: nop + IL_0041: br.s IL_005d + + IL_0043: ldloc.0 + IL_0044: ldloc.2 + IL_0045: bge.s IL_004c + + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: nop + IL_004a: br.s IL_005d + + IL_004c: ldloc.0 + IL_004d: conv.i8 + IL_004e: ldloc.2 + IL_004f: conv.i8 + IL_0050: sub + IL_0051: ldloc.1 + IL_0052: not + IL_0053: conv.i8 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add + IL_0057: conv.i8 + IL_0058: div.un + IL_0059: ldc.i4.1 + IL_005a: conv.i8 + IL_005b: add.ovf.un + IL_005c: nop + IL_005d: stloc.3 + IL_005e: ldc.i4.0 + IL_005f: conv.i8 + IL_0060: stloc.s V_5 + IL_0062: ldloc.0 + IL_0063: stloc.s V_6 + IL_0065: br.s IL_007e + + IL_0067: ldloca.s V_4 + IL_0069: ldloc.s V_6 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_6 + IL_0073: ldloc.1 + IL_0074: add + IL_0075: stloc.s V_6 + IL_0077: ldloc.s V_5 + IL_0079: ldc.i4.1 + IL_007a: conv.i8 + IL_007b: add + IL_007c: stloc.s V_5 + IL_007e: ldloc.s V_5 + IL_0080: ldloc.3 + IL_0081: blt.un.s IL_0067 + + IL_0083: ldloca.s V_4 + IL_0085: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_008a: 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/UInt64RangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs new file mode 100644 index 00000000000..fd23cacc03d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs @@ -0,0 +1,22 @@ +let f1 () = [|1UL..10UL|] +let f2 () = [|10UL..1UL|] +let f3 () = [|1UL..1UL..10UL|] +let f4 () = [|1UL..2UL..10UL|] +let f5 () = [|10UL..1UL..1UL|] +let f6 start = [|start..10UL|] +let f7 finish = [|1UL..finish|] +let f8 (start: uint64) finish = [|start..finish|] +let f9 start = [|start..1UL..10UL|] +let f10 step = [|1UL..step..10UL|] +let f11 finish = [|1UL..1UL..finish|] +let f12 start step = [|start..step..10UL|] +let f13 start finish = [|start..1UL..finish|] +let f14 step finish = [|1UL..step..finish|] +let f15 (start: uint64) step finish = [|start..step..finish|] +let f16 f = [|f ()..10UL|] +let f17 f = [|1UL..f ()|] +let f18 (f: unit -> uint64) g = [|f ()..g()|] +let f19 f = [|f ()..1UL..10UL|] +let f20 f = [|1UL..f ()..10UL|] +let f21 f = [|1UL..1UL..f ()|] +let f22 (f: unit -> uint64) g h= [|f ()..g ()..h ()|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl new file mode 100644 index 00000000000..2bd26ed98f3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl @@ -0,0 +1,2134 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 uint64[] f1() cil managed + { + + .maxstack 5 + .locals init (uint64[] V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.UInt64 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: stloc.2 + IL_0010: br.s IL_0021 + + IL_0012: ldloc.0 + IL_0013: ldloc.1 + IL_0014: conv.i + IL_0015: ldloc.2 + IL_0016: stelem.i8 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + 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_0012 + + IL_0027: ldloc.0 + IL_0028: ret + } + + .method public static uint64[] f2() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static uint64[] f3() cil managed + { + + .maxstack 5 + .locals init (uint64[] V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.UInt64 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: stloc.2 + IL_0010: br.s IL_0021 + + IL_0012: ldloc.0 + IL_0013: ldloc.1 + IL_0014: conv.i + IL_0015: ldloc.2 + IL_0016: stelem.i8 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + 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_0012 + + IL_0027: ldloc.0 + IL_0028: ret + } + + .method public static uint64[] f4() cil managed + { + + .maxstack 5 + .locals init (uint64[] V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.5 + IL_0001: conv.i8 + IL_0002: conv.ovf.i.un + IL_0003: newarr [runtime]System.UInt64 + IL_0008: stloc.0 + IL_0009: ldc.i4.0 + IL_000a: conv.i8 + IL_000b: stloc.1 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: stloc.2 + IL_000f: br.s IL_0020 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i8 + IL_0016: ldloc.2 + IL_0017: ldc.i4.2 + IL_0018: conv.i8 + 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_0011 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static uint64[] f5() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static uint64[] f6(uint64 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64[] V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.0 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.UInt64 + IL_0028: stloc.1 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.2 + IL_002c: ldarg.0 + IL_002d: stloc.3 + IL_002e: br.s IL_003f + + IL_0030: ldloc.1 + IL_0031: ldloc.2 + IL_0032: conv.i + IL_0033: ldloc.3 + IL_0034: stelem.i8 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.2 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.2 + IL_0040: ldloc.0 + IL_0041: blt.un.s IL_0030 + + IL_0043: ldloc.1 + IL_0044: ret + } + + .method public static uint64[] f7(uint64 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64[] V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: bge.un.s IL_001f + + IL_0019: call !!0[] [runtime]System.Array::Empty() + IL_001e: ret + + IL_001f: ldloc.0 + IL_0020: conv.ovf.i.un + IL_0021: newarr [runtime]System.UInt64 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: br.s IL_003e + + IL_002f: ldloc.1 + IL_0030: ldloc.2 + IL_0031: conv.i + IL_0032: ldloc.3 + IL_0033: stelem.i8 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.2 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.2 + IL_003e: ldloc.2 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_002f + + IL_0042: ldloc.1 + IL_0043: ret + } + + .method public static uint64[] f8(uint64 start, + uint64 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, + bool V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldloc.0 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 + + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret + + IL_0023: ldloc.0 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add.ovf.un + IL_0027: conv.ovf.i.un + IL_0028: newarr [runtime]System.UInt64 + IL_002d: stloc.2 + IL_002e: ldloc.1 + IL_002f: brfalse.s IL_0065 + + IL_0031: ldc.i4.0 + IL_0032: conv.i8 + IL_0033: stloc.3 + IL_0034: ldarg.0 + IL_0035: stloc.s V_4 + IL_0037: ldloc.2 + IL_0038: ldloc.3 + IL_0039: conv.i + IL_003a: ldloc.s V_4 + IL_003c: stelem.i8 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: add + IL_0048: stloc.3 + IL_0049: br.s IL_005d + + IL_004b: ldloc.2 + IL_004c: ldloc.3 + IL_004d: conv.i + IL_004e: ldloc.s V_4 + IL_0050: stelem.i8 + IL_0051: ldloc.s V_4 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.s V_4 + IL_0058: ldloc.3 + IL_0059: ldc.i4.1 + IL_005a: conv.i8 + IL_005b: add + IL_005c: stloc.3 + IL_005d: ldloc.3 + IL_005e: ldc.i4.0 + IL_005f: conv.i8 + IL_0060: bgt.un.s IL_004b + + IL_0062: nop + IL_0063: br.s IL_008e + + IL_0065: ldloc.0 + IL_0066: ldc.i4.1 + IL_0067: conv.i8 + IL_0068: add.ovf.un + IL_0069: stloc.3 + IL_006a: ldc.i4.0 + IL_006b: conv.i8 + IL_006c: stloc.s V_4 + IL_006e: ldarg.0 + IL_006f: stloc.s V_5 + IL_0071: br.s IL_0088 + + IL_0073: ldloc.2 + IL_0074: ldloc.s V_4 + IL_0076: conv.i + IL_0077: ldloc.s V_5 + IL_0079: stelem.i8 + IL_007a: ldloc.s V_5 + IL_007c: ldc.i4.1 + IL_007d: conv.i8 + IL_007e: add + IL_007f: stloc.s V_5 + IL_0081: ldloc.s V_4 + IL_0083: ldc.i4.1 + IL_0084: conv.i8 + IL_0085: add + IL_0086: stloc.s V_4 + IL_0088: ldloc.s V_4 + IL_008a: ldloc.3 + IL_008b: blt.un.s IL_0073 + + IL_008d: nop + IL_008e: ldloc.2 + IL_008f: ret + } + + .method public static uint64[] f9(uint64 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64[] V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.0 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.UInt64 + IL_0028: stloc.1 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.2 + IL_002c: ldarg.0 + IL_002d: stloc.3 + IL_002e: br.s IL_003f + + IL_0030: ldloc.1 + IL_0031: ldloc.2 + IL_0032: conv.i + IL_0033: ldloc.3 + IL_0034: stelem.i8 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.2 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.2 + IL_0040: ldloc.0 + IL_0041: blt.un.s IL_0030 + + IL_0043: ldloc.1 + IL_0044: ret + } + + .method public static uint64[] f10(uint64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0013 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldc.i4.s 10 + IL_0009: conv.i8 + IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000f: pop + IL_0010: nop + IL_0011: br.s IL_0014 + + IL_0013: nop + IL_0014: ldc.i4.s 10 + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_002a + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: conv.i8 + IL_0028: div.un + IL_0029: nop + IL_002a: stloc.0 + IL_002b: ldloc.0 + IL_002c: ldc.i4.m1 + IL_002d: conv.i8 + IL_002e: ceq + IL_0030: stloc.1 + IL_0031: ldloc.0 + IL_0032: ldc.i4.1 + IL_0033: conv.i8 + IL_0034: add.ovf.un + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: bge.un.s IL_003f + + IL_0039: call !!0[] [runtime]System.Array::Empty() + IL_003e: ret + + IL_003f: ldloc.0 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add.ovf.un + IL_0043: conv.ovf.i.un + IL_0044: newarr [runtime]System.UInt64 + IL_0049: stloc.2 + IL_004a: ldloc.1 + IL_004b: brfalse.s IL_0080 + + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: stloc.3 + IL_0050: ldc.i4.1 + IL_0051: conv.i8 + IL_0052: stloc.s V_4 + IL_0054: ldloc.2 + IL_0055: ldloc.3 + IL_0056: conv.i + IL_0057: ldloc.s V_4 + IL_0059: stelem.i8 + IL_005a: ldloc.s V_4 + IL_005c: ldarg.0 + IL_005d: add + IL_005e: stloc.s V_4 + IL_0060: ldloc.3 + IL_0061: ldc.i4.1 + IL_0062: conv.i8 + IL_0063: add + IL_0064: stloc.3 + IL_0065: br.s IL_0078 + + IL_0067: ldloc.2 + IL_0068: ldloc.3 + IL_0069: conv.i + IL_006a: ldloc.s V_4 + IL_006c: stelem.i8 + 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: ldc.i4.0 + IL_007a: conv.i8 + IL_007b: bgt.un.s IL_0067 + + IL_007d: nop + IL_007e: br.s IL_00a9 + + IL_0080: ldloc.0 + IL_0081: ldc.i4.1 + IL_0082: conv.i8 + IL_0083: add.ovf.un + IL_0084: stloc.3 + IL_0085: ldc.i4.0 + IL_0086: conv.i8 + IL_0087: stloc.s V_4 + IL_0089: ldc.i4.1 + IL_008a: conv.i8 + IL_008b: stloc.s V_5 + IL_008d: br.s IL_00a3 + + IL_008f: ldloc.2 + IL_0090: ldloc.s V_4 + IL_0092: conv.i + IL_0093: ldloc.s V_5 + IL_0095: stelem.i8 + IL_0096: ldloc.s V_5 + IL_0098: ldarg.0 + IL_0099: add + IL_009a: stloc.s V_5 + IL_009c: ldloc.s V_4 + IL_009e: ldc.i4.1 + IL_009f: conv.i8 + IL_00a0: add + IL_00a1: stloc.s V_4 + IL_00a3: ldloc.s V_4 + IL_00a5: ldloc.3 + IL_00a6: blt.un.s IL_008f + + IL_00a8: nop + IL_00a9: ldloc.2 + IL_00aa: ret + } + + .method public static uint64[] f11(uint64 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64[] V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: bge.un.s IL_001f + + IL_0019: call !!0[] [runtime]System.Array::Empty() + IL_001e: ret + + IL_001f: ldloc.0 + IL_0020: conv.ovf.i.un + IL_0021: newarr [runtime]System.UInt64 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: br.s IL_003e + + IL_002f: ldloc.1 + IL_0030: ldloc.2 + IL_0031: conv.i + IL_0032: ldloc.3 + IL_0033: stelem.i8 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.2 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.2 + IL_003e: ldloc.2 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_002f + + IL_0042: ldloc.1 + IL_0043: ret + } + + .method public static uint64[] f12(uint64 start, + uint64 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, + bool V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0012 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0027 + + IL_001e: ldc.i4.s 10 + IL_0020: conv.i8 + IL_0021: ldarg.0 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: conv.i8 + IL_0025: div.un + IL_0026: nop + IL_0027: stloc.0 + IL_0028: ldloc.0 + IL_0029: ldc.i4.m1 + IL_002a: conv.i8 + IL_002b: ceq + IL_002d: stloc.1 + IL_002e: ldloc.0 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add.ovf.un + IL_0032: ldc.i4.1 + IL_0033: conv.i8 + IL_0034: bge.un.s IL_003c + + IL_0036: call !!0[] [runtime]System.Array::Empty() + IL_003b: ret + + IL_003c: ldloc.0 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add.ovf.un + IL_0040: conv.ovf.i.un + IL_0041: newarr [runtime]System.UInt64 + IL_0046: stloc.2 + IL_0047: ldloc.1 + IL_0048: brfalse.s IL_007c + + IL_004a: ldc.i4.0 + IL_004b: conv.i8 + IL_004c: stloc.3 + IL_004d: ldarg.0 + IL_004e: stloc.s V_4 + IL_0050: ldloc.2 + IL_0051: ldloc.3 + IL_0052: conv.i + IL_0053: ldloc.s V_4 + IL_0055: stelem.i8 + IL_0056: ldloc.s V_4 + IL_0058: ldarg.1 + IL_0059: add + IL_005a: stloc.s V_4 + IL_005c: ldloc.3 + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: add + IL_0060: stloc.3 + IL_0061: br.s IL_0074 + + IL_0063: ldloc.2 + IL_0064: ldloc.3 + IL_0065: conv.i + IL_0066: ldloc.s V_4 + IL_0068: stelem.i8 + IL_0069: ldloc.s V_4 + IL_006b: ldarg.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.3 + IL_0074: ldloc.3 + IL_0075: ldc.i4.0 + IL_0076: conv.i8 + IL_0077: bgt.un.s IL_0063 + + IL_0079: nop + IL_007a: br.s IL_00a4 + + IL_007c: ldloc.0 + IL_007d: ldc.i4.1 + IL_007e: conv.i8 + IL_007f: add.ovf.un + IL_0080: stloc.3 + IL_0081: ldc.i4.0 + IL_0082: conv.i8 + IL_0083: stloc.s V_4 + IL_0085: ldarg.0 + IL_0086: stloc.s V_5 + IL_0088: br.s IL_009e + + IL_008a: ldloc.2 + IL_008b: ldloc.s V_4 + IL_008d: conv.i + IL_008e: ldloc.s V_5 + IL_0090: stelem.i8 + IL_0091: ldloc.s V_5 + IL_0093: ldarg.1 + IL_0094: add + IL_0095: stloc.s V_5 + IL_0097: ldloc.s V_4 + IL_0099: ldc.i4.1 + IL_009a: conv.i8 + IL_009b: add + IL_009c: stloc.s V_4 + IL_009e: ldloc.s V_4 + IL_00a0: ldloc.3 + IL_00a1: blt.un.s IL_008a + + IL_00a3: nop + IL_00a4: ldloc.2 + IL_00a5: ret + } + + .method public static uint64[] f13(uint64 start, + uint64 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, + bool V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldloc.0 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 + + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret + + IL_0023: ldloc.0 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add.ovf.un + IL_0027: conv.ovf.i.un + IL_0028: newarr [runtime]System.UInt64 + IL_002d: stloc.2 + IL_002e: ldloc.1 + IL_002f: brfalse.s IL_0065 + + IL_0031: ldc.i4.0 + IL_0032: conv.i8 + IL_0033: stloc.3 + IL_0034: ldarg.0 + IL_0035: stloc.s V_4 + IL_0037: ldloc.2 + IL_0038: ldloc.3 + IL_0039: conv.i + IL_003a: ldloc.s V_4 + IL_003c: stelem.i8 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: add + IL_0048: stloc.3 + IL_0049: br.s IL_005d + + IL_004b: ldloc.2 + IL_004c: ldloc.3 + IL_004d: conv.i + IL_004e: ldloc.s V_4 + IL_0050: stelem.i8 + IL_0051: ldloc.s V_4 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.s V_4 + IL_0058: ldloc.3 + IL_0059: ldc.i4.1 + IL_005a: conv.i8 + IL_005b: add + IL_005c: stloc.3 + IL_005d: ldloc.3 + IL_005e: ldc.i4.0 + IL_005f: conv.i8 + IL_0060: bgt.un.s IL_004b + + IL_0062: nop + IL_0063: br.s IL_008e + + IL_0065: ldloc.0 + IL_0066: ldc.i4.1 + IL_0067: conv.i8 + IL_0068: add.ovf.un + IL_0069: stloc.3 + IL_006a: ldc.i4.0 + IL_006b: conv.i8 + IL_006c: stloc.s V_4 + IL_006e: ldarg.0 + IL_006f: stloc.s V_5 + IL_0071: br.s IL_0088 + + IL_0073: ldloc.2 + IL_0074: ldloc.s V_4 + IL_0076: conv.i + IL_0077: ldloc.s V_5 + IL_0079: stelem.i8 + IL_007a: ldloc.s V_5 + IL_007c: ldc.i4.1 + IL_007d: conv.i8 + IL_007e: add + IL_007f: stloc.s V_5 + IL_0081: ldloc.s V_4 + IL_0083: ldc.i4.1 + IL_0084: conv.i8 + IL_0085: add + IL_0086: stloc.s V_4 + IL_0088: ldloc.s V_4 + IL_008a: ldloc.3 + IL_008b: blt.un.s IL_0073 + + IL_008d: nop + IL_008e: ldloc.2 + IL_008f: ret + } + + .method public static uint64[] f14(uint64 step, + uint64 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, + bool V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldarg.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: bge.un.s IL_001c + + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: nop + IL_001a: br.s IL_0024 + + IL_001c: ldarg.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: conv.i8 + IL_0022: div.un + IL_0023: nop + IL_0024: stloc.0 + IL_0025: ldloc.0 + IL_0026: ldc.i4.m1 + IL_0027: conv.i8 + IL_0028: ceq + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add.ovf.un + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: bge.un.s IL_0039 + + IL_0033: call !!0[] [runtime]System.Array::Empty() + IL_0038: ret + + IL_0039: ldloc.0 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add.ovf.un + IL_003d: conv.ovf.i.un + IL_003e: newarr [runtime]System.UInt64 + IL_0043: stloc.2 + IL_0044: ldloc.1 + IL_0045: brfalse.s IL_007a + + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.3 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: stloc.s V_4 + IL_004e: ldloc.2 + IL_004f: ldloc.3 + IL_0050: conv.i + IL_0051: ldloc.s V_4 + IL_0053: stelem.i8 + IL_0054: ldloc.s V_4 + IL_0056: ldarg.0 + IL_0057: add + IL_0058: stloc.s V_4 + IL_005a: ldloc.3 + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: stloc.3 + IL_005f: br.s IL_0072 + + IL_0061: ldloc.2 + IL_0062: ldloc.3 + IL_0063: conv.i + IL_0064: ldloc.s V_4 + IL_0066: stelem.i8 + IL_0067: ldloc.s V_4 + IL_0069: ldarg.0 + IL_006a: add + IL_006b: stloc.s V_4 + IL_006d: ldloc.3 + IL_006e: ldc.i4.1 + IL_006f: conv.i8 + IL_0070: add + IL_0071: stloc.3 + IL_0072: ldloc.3 + IL_0073: ldc.i4.0 + IL_0074: conv.i8 + IL_0075: bgt.un.s IL_0061 + + IL_0077: nop + IL_0078: br.s IL_00a3 + + IL_007a: ldloc.0 + IL_007b: ldc.i4.1 + IL_007c: conv.i8 + IL_007d: add.ovf.un + IL_007e: stloc.3 + IL_007f: ldc.i4.0 + IL_0080: conv.i8 + IL_0081: stloc.s V_4 + IL_0083: ldc.i4.1 + IL_0084: conv.i8 + IL_0085: stloc.s V_5 + IL_0087: br.s IL_009d + + IL_0089: ldloc.2 + IL_008a: ldloc.s V_4 + IL_008c: conv.i + IL_008d: ldloc.s V_5 + IL_008f: stelem.i8 + IL_0090: ldloc.s V_5 + IL_0092: ldarg.0 + IL_0093: add + IL_0094: stloc.s V_5 + IL_0096: ldloc.s V_4 + IL_0098: ldc.i4.1 + IL_0099: conv.i8 + IL_009a: add + IL_009b: stloc.s V_4 + IL_009d: ldloc.s V_4 + IL_009f: ldloc.3 + IL_00a0: blt.un.s IL_0089 + + IL_00a2: nop + IL_00a3: ldloc.2 + IL_00a4: ret + } + + .method public static uint64[] f15(uint64 start, + uint64 step, + uint64 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, + bool V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4, + uint64 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::RangeUInt64(uint64, + uint64, + uint64) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldarg.2 + IL_0012: ldarg.0 + IL_0013: bge.un.s IL_001a + + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: nop + IL_0018: br.s IL_0021 + + IL_001a: ldarg.2 + IL_001b: ldarg.0 + IL_001c: sub + IL_001d: ldarg.1 + IL_001e: conv.i8 + IL_001f: div.un + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldloc.0 + IL_0023: ldc.i4.m1 + IL_0024: conv.i8 + IL_0025: ceq + IL_0027: stloc.1 + IL_0028: ldloc.0 + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add.ovf.un + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: bge.un.s IL_0036 + + IL_0030: call !!0[] [runtime]System.Array::Empty() + IL_0035: ret + + IL_0036: ldloc.0 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: add.ovf.un + IL_003a: conv.ovf.i.un + IL_003b: newarr [runtime]System.UInt64 + IL_0040: stloc.2 + IL_0041: ldloc.1 + IL_0042: brfalse.s IL_0076 + + IL_0044: ldc.i4.0 + IL_0045: conv.i8 + IL_0046: stloc.3 + IL_0047: ldarg.0 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldloc.3 + IL_004c: conv.i + IL_004d: ldloc.s V_4 + IL_004f: stelem.i8 + IL_0050: ldloc.s V_4 + IL_0052: ldarg.1 + IL_0053: add + IL_0054: stloc.s V_4 + IL_0056: ldloc.3 + IL_0057: ldc.i4.1 + IL_0058: conv.i8 + IL_0059: add + IL_005a: stloc.3 + IL_005b: br.s IL_006e + + IL_005d: ldloc.2 + IL_005e: ldloc.3 + IL_005f: conv.i + IL_0060: ldloc.s V_4 + IL_0062: stelem.i8 + IL_0063: ldloc.s V_4 + IL_0065: ldarg.1 + 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: ldc.i4.0 + IL_0070: conv.i8 + IL_0071: bgt.un.s IL_005d + + IL_0073: nop + IL_0074: br.s IL_009e + + IL_0076: ldloc.0 + IL_0077: ldc.i4.1 + IL_0078: conv.i8 + IL_0079: add.ovf.un + IL_007a: stloc.3 + IL_007b: ldc.i4.0 + IL_007c: conv.i8 + IL_007d: stloc.s V_4 + IL_007f: ldarg.0 + IL_0080: stloc.s V_5 + IL_0082: br.s IL_0098 + + IL_0084: ldloc.2 + IL_0085: ldloc.s V_4 + IL_0087: conv.i + IL_0088: ldloc.s V_5 + IL_008a: stelem.i8 + IL_008b: ldloc.s V_5 + IL_008d: ldarg.1 + IL_008e: add + IL_008f: stloc.s V_5 + IL_0091: ldloc.s V_4 + IL_0093: ldc.i4.1 + IL_0094: conv.i8 + IL_0095: add + IL_0096: stloc.s V_4 + IL_0098: ldloc.s V_4 + IL_009a: ldloc.3 + IL_009b: blt.un.s IL_0084 + + IL_009d: nop + IL_009e: ldloc.2 + IL_009f: ret + } + + .method public static uint64[] f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 + + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.1 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.UInt64 + IL_002f: stloc.2 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.3 + IL_0033: ldloc.0 + IL_0034: stloc.s V_4 + IL_0036: br.s IL_004a + + IL_0038: ldloc.2 + IL_0039: ldloc.3 + IL_003a: conv.i + IL_003b: ldloc.s V_4 + IL_003d: stelem.i8 + IL_003e: ldloc.s V_4 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.s V_4 + IL_0045: ldloc.3 + IL_0046: ldc.i4.1 + IL_0047: conv.i8 + IL_0048: add + IL_0049: stloc.3 + IL_004a: ldloc.3 + IL_004b: ldloc.1 + IL_004c: blt.un.s IL_0038 + + IL_004e: ldloc.2 + IL_004f: ret + } + + .method public static uint64[] f17(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: bge.un.s IL_0026 + + IL_0020: call !!0[] [runtime]System.Array::Empty() + IL_0025: ret + + IL_0026: ldloc.1 + IL_0027: conv.ovf.i.un + IL_0028: newarr [runtime]System.UInt64 + IL_002d: stloc.2 + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: stloc.3 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0049 + + IL_0037: ldloc.2 + IL_0038: ldloc.3 + IL_0039: conv.i + IL_003a: ldloc.s V_4 + IL_003c: stelem.i8 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: add + IL_0048: stloc.3 + IL_0049: ldloc.3 + IL_004a: ldloc.1 + IL_004b: blt.un.s IL_0037 + + IL_004d: ldloc.2 + IL_004e: ret + } + + .method public static uint64[] f18(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 (uint64 V_0, + uint64 V_1, + uint64 V_2, + bool V_3, + uint64[] V_4, + uint64 V_5, + uint64 V_6, + uint64 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.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_001d + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: nop + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.m1 + IL_0020: conv.i8 + IL_0021: ceq + IL_0023: stloc.3 + IL_0024: ldloc.2 + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: bge.un.s IL_0032 + + IL_002c: call !!0[] [runtime]System.Array::Empty() + IL_0031: ret + + IL_0032: ldloc.2 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add.ovf.un + IL_0036: conv.ovf.i.un + IL_0037: newarr [runtime]System.UInt64 + IL_003c: stloc.s V_4 + IL_003e: ldloc.3 + IL_003f: brfalse.s IL_007f + + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.s V_5 + IL_0045: ldloc.0 + IL_0046: stloc.s V_6 + IL_0048: ldloc.s V_4 + IL_004a: ldloc.s V_5 + IL_004c: conv.i + IL_004d: ldloc.s V_6 + IL_004f: stelem.i8 + IL_0050: ldloc.s V_6 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.s V_6 + IL_0057: ldloc.s V_5 + IL_0059: ldc.i4.1 + IL_005a: conv.i8 + IL_005b: add + IL_005c: stloc.s V_5 + IL_005e: br.s IL_0076 + + IL_0060: ldloc.s V_4 + IL_0062: ldloc.s V_5 + IL_0064: conv.i + IL_0065: ldloc.s V_6 + IL_0067: stelem.i8 + IL_0068: ldloc.s V_6 + IL_006a: ldc.i4.1 + IL_006b: conv.i8 + IL_006c: add + IL_006d: stloc.s V_6 + IL_006f: ldloc.s V_5 + IL_0071: ldc.i4.1 + IL_0072: conv.i8 + IL_0073: add + IL_0074: stloc.s V_5 + IL_0076: ldloc.s V_5 + IL_0078: ldc.i4.0 + IL_0079: conv.i8 + IL_007a: bgt.un.s IL_0060 + + IL_007c: nop + IL_007d: br.s IL_00ab + + IL_007f: ldloc.2 + IL_0080: ldc.i4.1 + IL_0081: conv.i8 + IL_0082: add.ovf.un + IL_0083: stloc.s V_5 + IL_0085: ldc.i4.0 + IL_0086: conv.i8 + IL_0087: stloc.s V_6 + IL_0089: ldloc.0 + IL_008a: stloc.s V_7 + IL_008c: br.s IL_00a4 + + IL_008e: ldloc.s V_4 + IL_0090: ldloc.s V_6 + IL_0092: conv.i + IL_0093: ldloc.s V_7 + IL_0095: stelem.i8 + IL_0096: ldloc.s V_7 + IL_0098: ldc.i4.1 + IL_0099: conv.i8 + IL_009a: add + IL_009b: stloc.s V_7 + IL_009d: ldloc.s V_6 + IL_009f: ldc.i4.1 + IL_00a0: conv.i8 + IL_00a1: add + IL_00a2: stloc.s V_6 + IL_00a4: ldloc.s V_6 + IL_00a6: ldloc.s V_5 + IL_00a8: blt.un.s IL_008e + + IL_00aa: nop + IL_00ab: ldloc.s V_4 + IL_00ad: ret + } + + .method public static uint64[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 + + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.1 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.UInt64 + IL_002f: stloc.2 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.3 + IL_0033: ldloc.0 + IL_0034: stloc.s V_4 + IL_0036: br.s IL_004a + + IL_0038: ldloc.2 + IL_0039: ldloc.3 + IL_003a: conv.i + IL_003b: ldloc.s V_4 + IL_003d: stelem.i8 + IL_003e: ldloc.s V_4 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.s V_4 + IL_0045: ldloc.3 + IL_0046: ldc.i4.1 + IL_0047: conv.i8 + IL_0048: add + IL_0049: stloc.3 + IL_004a: ldloc.3 + IL_004b: ldloc.1 + IL_004c: blt.un.s IL_0038 + + IL_004e: ldloc.2 + IL_004f: ret + } + + .method public static uint64[] f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + bool V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5, + uint64 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_001a + + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: ldloc.0 + IL_000e: ldc.i4.s 10 + IL_0010: conv.i8 + IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0016: pop + IL_0017: nop + IL_0018: br.s IL_001b + + IL_001a: nop + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_0031 + + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: conv.i8 + IL_002f: div.un + IL_0030: nop + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: ldc.i4.m1 + IL_0034: conv.i8 + IL_0035: ceq + IL_0037: stloc.2 + IL_0038: ldloc.1 + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: add.ovf.un + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: bge.un.s IL_0046 + + IL_0040: call !!0[] [runtime]System.Array::Empty() + IL_0045: ret + + IL_0046: ldloc.1 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add.ovf.un + IL_004a: conv.ovf.i.un + IL_004b: newarr [runtime]System.UInt64 + IL_0050: stloc.3 + IL_0051: ldloc.2 + IL_0052: brfalse.s IL_008f + + IL_0054: ldc.i4.0 + IL_0055: conv.i8 + IL_0056: stloc.s V_4 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: stloc.s V_5 + IL_005c: ldloc.3 + IL_005d: ldloc.s V_4 + IL_005f: conv.i + IL_0060: ldloc.s V_5 + IL_0062: stelem.i8 + IL_0063: ldloc.s V_5 + IL_0065: ldloc.0 + IL_0066: add + IL_0067: stloc.s V_5 + IL_0069: ldloc.s V_4 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.s V_4 + IL_0070: br.s IL_0086 + + IL_0072: ldloc.3 + IL_0073: ldloc.s V_4 + IL_0075: conv.i + IL_0076: ldloc.s V_5 + IL_0078: stelem.i8 + IL_0079: ldloc.s V_5 + IL_007b: ldloc.0 + IL_007c: add + IL_007d: stloc.s V_5 + IL_007f: ldloc.s V_4 + IL_0081: ldc.i4.1 + IL_0082: conv.i8 + IL_0083: add + IL_0084: stloc.s V_4 + IL_0086: ldloc.s V_4 + IL_0088: ldc.i4.0 + IL_0089: conv.i8 + IL_008a: bgt.un.s IL_0072 + + IL_008c: nop + IL_008d: br.s IL_00ba + + IL_008f: ldloc.1 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add.ovf.un + IL_0093: stloc.s V_4 + IL_0095: ldc.i4.0 + IL_0096: conv.i8 + IL_0097: stloc.s V_5 + IL_0099: ldc.i4.1 + IL_009a: conv.i8 + IL_009b: stloc.s V_6 + IL_009d: br.s IL_00b3 + + IL_009f: ldloc.3 + IL_00a0: ldloc.s V_5 + IL_00a2: conv.i + IL_00a3: ldloc.s V_6 + IL_00a5: stelem.i8 + IL_00a6: ldloc.s V_6 + IL_00a8: ldloc.0 + IL_00a9: add + IL_00aa: stloc.s V_6 + IL_00ac: ldloc.s V_5 + IL_00ae: ldc.i4.1 + IL_00af: conv.i8 + IL_00b0: add + IL_00b1: stloc.s V_5 + IL_00b3: ldloc.s V_5 + IL_00b5: ldloc.s V_4 + IL_00b7: blt.un.s IL_009f + + IL_00b9: nop + IL_00ba: ldloc.3 + IL_00bb: ret + } + + .method public static uint64[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: bge.un.s IL_0026 + + IL_0020: call !!0[] [runtime]System.Array::Empty() + IL_0025: ret + + IL_0026: ldloc.1 + IL_0027: conv.ovf.i.un + IL_0028: newarr [runtime]System.UInt64 + IL_002d: stloc.2 + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: stloc.3 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0049 + + IL_0037: ldloc.2 + IL_0038: ldloc.3 + IL_0039: conv.i + IL_003a: ldloc.s V_4 + IL_003c: stelem.i8 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: add + IL_0048: stloc.3 + IL_0049: ldloc.3 + IL_004a: ldloc.1 + IL_004b: blt.un.s IL_0037 + + IL_004d: ldloc.2 + IL_004e: ret + } + + .method public static uint64[] f22(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 (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64 V_3, + bool V_4, + uint64[] V_5, + uint64 V_6, + uint64 V_7, + uint64 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::RangeUInt64(uint64, + uint64, + uint64) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldloc.2 + IL_0029: ldloc.0 + IL_002a: bge.un.s IL_0031 + + IL_002c: ldc.i4.0 + IL_002d: conv.i8 + IL_002e: nop + IL_002f: br.s IL_0038 + + IL_0031: ldloc.2 + IL_0032: ldloc.0 + IL_0033: sub + IL_0034: ldloc.1 + IL_0035: conv.i8 + IL_0036: div.un + IL_0037: nop + IL_0038: stloc.3 + IL_0039: ldloc.3 + IL_003a: ldc.i4.m1 + IL_003b: conv.i8 + IL_003c: ceq + IL_003e: stloc.s V_4 + IL_0040: ldloc.3 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add.ovf.un + 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.3 + IL_004f: ldc.i4.1 + IL_0050: conv.i8 + IL_0051: add.ovf.un + IL_0052: conv.ovf.i.un + IL_0053: newarr [runtime]System.UInt64 + IL_0058: stloc.s V_5 + IL_005a: ldloc.s V_4 + IL_005c: brfalse.s IL_009a + + IL_005e: ldc.i4.0 + IL_005f: conv.i8 + IL_0060: stloc.s V_6 + IL_0062: ldloc.0 + IL_0063: stloc.s V_7 + IL_0065: ldloc.s V_5 + IL_0067: ldloc.s V_6 + IL_0069: conv.i + IL_006a: ldloc.s V_7 + IL_006c: stelem.i8 + IL_006d: ldloc.s V_7 + IL_006f: ldloc.1 + IL_0070: add + IL_0071: stloc.s V_7 + IL_0073: ldloc.s V_6 + IL_0075: ldc.i4.1 + IL_0076: conv.i8 + IL_0077: add + IL_0078: stloc.s V_6 + IL_007a: br.s IL_0091 + + IL_007c: ldloc.s V_5 + IL_007e: ldloc.s V_6 + IL_0080: conv.i + IL_0081: ldloc.s V_7 + IL_0083: stelem.i8 + IL_0084: ldloc.s V_7 + IL_0086: ldloc.1 + IL_0087: add + IL_0088: stloc.s V_7 + IL_008a: ldloc.s V_6 + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add + IL_008f: stloc.s V_6 + IL_0091: ldloc.s V_6 + IL_0093: ldc.i4.0 + IL_0094: conv.i8 + IL_0095: bgt.un.s IL_007c + + IL_0097: nop + IL_0098: br.s IL_00c5 + + IL_009a: ldloc.3 + IL_009b: ldc.i4.1 + IL_009c: conv.i8 + IL_009d: add.ovf.un + IL_009e: stloc.s V_6 + IL_00a0: ldc.i4.0 + IL_00a1: conv.i8 + IL_00a2: stloc.s V_7 + IL_00a4: ldloc.0 + IL_00a5: stloc.s V_8 + IL_00a7: br.s IL_00be + + IL_00a9: ldloc.s V_5 + IL_00ab: ldloc.s V_7 + IL_00ad: conv.i + IL_00ae: ldloc.s V_8 + IL_00b0: stelem.i8 + IL_00b1: ldloc.s V_8 + IL_00b3: ldloc.1 + IL_00b4: add + IL_00b5: stloc.s V_8 + IL_00b7: ldloc.s V_7 + IL_00b9: ldc.i4.1 + IL_00ba: conv.i8 + IL_00bb: add + IL_00bc: stloc.s V_7 + IL_00be: ldloc.s V_7 + IL_00c0: ldloc.s V_6 + IL_00c2: blt.un.s IL_00a9 + + IL_00c4: nop + IL_00c5: ldloc.s V_5 + IL_00c7: 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/UInt64RangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs new file mode 100644 index 00000000000..0b67ae93dee --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs @@ -0,0 +1,22 @@ +let f1 () = [1UL..10UL] +let f2 () = [10UL..1UL] +let f3 () = [1UL..1UL..10UL] +let f4 () = [1UL..2UL..10UL] +let f5 () = [10UL..1UL..1UL] +let f6 start = [start..10UL] +let f7 finish = [1UL..finish] +let f8 (start: uint64) finish = [start..finish] +let f9 start = [start..1UL..10UL] +let f10 step = [1UL..step..10UL] +let f11 finish = [1UL..1UL..finish] +let f12 start step = [start..step..10UL] +let f13 start finish = [start..1UL..finish] +let f14 step finish = [1UL..step..finish] +let f15 (start: uint64) step finish = [start..step..finish] +let f16 f = [f ()..10UL] +let f17 f = [1UL..f ()] +let f18 (f: unit -> uint64) g = [f ()..g()] +let f19 f = [f ()..1UL..10UL] +let f20 f = [1UL..f ()..10UL] +let f21 f = [1UL..1UL..f ()] +let f22 (f: unit -> uint64) g h= [f ()..g ()..h ()] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl new file mode 100644 index 00000000000..4d233c1912a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl @@ -0,0 +1,1850 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 f1() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.2 + IL_0006: br.s IL_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + 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_0008 + + 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, + uint64 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.2 + IL_0006: br.s IL_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + 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_0008 + + 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, + uint64 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.2 + IL_0006: br.s IL_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.2 + IL_0013: conv.i8 + 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_0008 + + 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(uint64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: ldarg.0 + IL_001a: stloc.3 + IL_001b: br.s IL_0030 + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + 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_001d + + 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 f7(uint64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: stloc.3 + IL_001a: br.s IL_002f + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.2 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001c + + IL_0033: ldloca.s V_1 + IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f8(uint64 start, + uint64 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, + bool V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_0054 + + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.3 + IL_001b: ldarg.0 + IL_001c: stloc.s V_4 + IL_001e: ldloca.s V_2 + IL_0020: ldloc.s V_4 + IL_0022: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0027: nop + IL_0028: ldloc.s V_4 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.s V_4 + IL_002f: ldloc.3 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.3 + IL_0034: br.s IL_004c + + IL_0036: ldloca.s V_2 + IL_0038: ldloc.s V_4 + IL_003a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003f: nop + IL_0040: ldloc.s V_4 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: stloc.s V_4 + IL_0047: ldloc.3 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: stloc.3 + IL_004c: ldloc.3 + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: bgt.un.s IL_0036 + + IL_0051: nop + IL_0052: br.s IL_0080 + + IL_0054: ldloc.0 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add.ovf.un + IL_0058: stloc.3 + IL_0059: ldc.i4.0 + IL_005a: conv.i8 + IL_005b: stloc.s V_4 + IL_005d: ldarg.0 + IL_005e: stloc.s V_5 + IL_0060: br.s IL_007a + + IL_0062: ldloca.s V_2 + IL_0064: ldloc.s V_5 + IL_0066: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006b: nop + IL_006c: ldloc.s V_5 + IL_006e: ldc.i4.1 + IL_006f: conv.i8 + IL_0070: add + IL_0071: stloc.s V_5 + IL_0073: ldloc.s V_4 + IL_0075: ldc.i4.1 + IL_0076: conv.i8 + IL_0077: add + IL_0078: stloc.s V_4 + IL_007a: ldloc.s V_4 + IL_007c: ldloc.3 + IL_007d: blt.un.s IL_0062 + + IL_007f: nop + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f9(uint64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: ldarg.0 + IL_001a: stloc.3 + IL_001b: br.s IL_0030 + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + 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_001d + + 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 f10(uint64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0013 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldc.i4.s 10 + IL_0009: conv.i8 + IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000f: pop + IL_0010: nop + IL_0011: br.s IL_0014 + + IL_0013: nop + IL_0014: ldc.i4.s 10 + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_002a + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: conv.i8 + IL_0028: div.un + IL_0029: nop + IL_002a: stloc.0 + IL_002b: ldloc.0 + IL_002c: ldc.i4.m1 + IL_002d: conv.i8 + IL_002e: ceq + IL_0030: stloc.1 + IL_0031: ldloc.1 + IL_0032: brfalse.s IL_006f + + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: stloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: stloc.s V_4 + IL_003b: ldloca.s V_2 + IL_003d: ldloc.s V_4 + IL_003f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0044: nop + IL_0045: ldloc.s V_4 + IL_0047: ldarg.0 + IL_0048: add + IL_0049: stloc.s V_4 + IL_004b: ldloc.3 + IL_004c: ldc.i4.1 + IL_004d: conv.i8 + IL_004e: add + IL_004f: stloc.3 + IL_0050: br.s IL_0067 + + IL_0052: ldloca.s V_2 + IL_0054: ldloc.s V_4 + IL_0056: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_005b: nop + IL_005c: ldloc.s V_4 + IL_005e: ldarg.0 + IL_005f: add + IL_0060: stloc.s V_4 + IL_0062: ldloc.3 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: add + IL_0066: stloc.3 + IL_0067: ldloc.3 + IL_0068: ldc.i4.0 + IL_0069: conv.i8 + IL_006a: bgt.un.s IL_0052 + + IL_006c: nop + IL_006d: br.s IL_009b + + IL_006f: ldloc.0 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add.ovf.un + IL_0073: stloc.3 + IL_0074: ldc.i4.0 + IL_0075: conv.i8 + IL_0076: stloc.s V_4 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: stloc.s V_5 + IL_007c: br.s IL_0095 + + IL_007e: ldloca.s V_2 + IL_0080: ldloc.s V_5 + IL_0082: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0087: nop + IL_0088: ldloc.s V_5 + IL_008a: ldarg.0 + IL_008b: add + IL_008c: stloc.s V_5 + IL_008e: ldloc.s V_4 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add + IL_0093: stloc.s V_4 + IL_0095: ldloc.s V_4 + IL_0097: ldloc.3 + IL_0098: blt.un.s IL_007e + + IL_009a: nop + IL_009b: ldloca.s V_2 + IL_009d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00a2: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f11(uint64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: stloc.3 + IL_001a: br.s IL_002f + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.2 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001c + + IL_0033: ldloca.s V_1 + IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f12(uint64 start, + uint64 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, + bool V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0012 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0027 + + IL_001e: ldc.i4.s 10 + IL_0020: conv.i8 + IL_0021: ldarg.0 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: conv.i8 + IL_0025: div.un + IL_0026: nop + IL_0027: stloc.0 + IL_0028: ldloc.0 + IL_0029: ldc.i4.m1 + IL_002a: conv.i8 + IL_002b: ceq + IL_002d: stloc.1 + IL_002e: ldloc.1 + IL_002f: brfalse.s IL_006b + + IL_0031: ldc.i4.0 + IL_0032: conv.i8 + IL_0033: stloc.3 + IL_0034: ldarg.0 + IL_0035: stloc.s V_4 + IL_0037: ldloca.s V_2 + IL_0039: ldloc.s V_4 + IL_003b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0040: nop + IL_0041: ldloc.s V_4 + IL_0043: ldarg.1 + IL_0044: add + IL_0045: stloc.s V_4 + IL_0047: ldloc.3 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: stloc.3 + IL_004c: br.s IL_0063 + + IL_004e: ldloca.s V_2 + IL_0050: ldloc.s V_4 + IL_0052: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0057: nop + IL_0058: ldloc.s V_4 + IL_005a: ldarg.1 + IL_005b: add + IL_005c: stloc.s V_4 + IL_005e: ldloc.3 + IL_005f: ldc.i4.1 + IL_0060: conv.i8 + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.3 + IL_0064: ldc.i4.0 + IL_0065: conv.i8 + IL_0066: bgt.un.s IL_004e + + IL_0068: nop + IL_0069: br.s IL_0096 + + IL_006b: ldloc.0 + IL_006c: ldc.i4.1 + IL_006d: conv.i8 + IL_006e: add.ovf.un + IL_006f: stloc.3 + IL_0070: ldc.i4.0 + IL_0071: conv.i8 + IL_0072: stloc.s V_4 + IL_0074: ldarg.0 + IL_0075: stloc.s V_5 + IL_0077: br.s IL_0090 + + IL_0079: ldloca.s V_2 + IL_007b: ldloc.s V_5 + IL_007d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0082: nop + IL_0083: ldloc.s V_5 + IL_0085: ldarg.1 + IL_0086: add + IL_0087: stloc.s V_5 + IL_0089: ldloc.s V_4 + IL_008b: ldc.i4.1 + IL_008c: conv.i8 + IL_008d: add + IL_008e: stloc.s V_4 + IL_0090: ldloc.s V_4 + IL_0092: ldloc.3 + IL_0093: blt.un.s IL_0079 + + IL_0095: nop + IL_0096: ldloca.s V_2 + IL_0098: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f13(uint64 start, + uint64 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, + bool V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_0054 + + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.3 + IL_001b: ldarg.0 + IL_001c: stloc.s V_4 + IL_001e: ldloca.s V_2 + IL_0020: ldloc.s V_4 + IL_0022: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0027: nop + IL_0028: ldloc.s V_4 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.s V_4 + IL_002f: ldloc.3 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.3 + IL_0034: br.s IL_004c + + IL_0036: ldloca.s V_2 + IL_0038: ldloc.s V_4 + IL_003a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003f: nop + IL_0040: ldloc.s V_4 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: stloc.s V_4 + IL_0047: ldloc.3 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: stloc.3 + IL_004c: ldloc.3 + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: bgt.un.s IL_0036 + + IL_0051: nop + IL_0052: br.s IL_0080 + + IL_0054: ldloc.0 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add.ovf.un + IL_0058: stloc.3 + IL_0059: ldc.i4.0 + IL_005a: conv.i8 + IL_005b: stloc.s V_4 + IL_005d: ldarg.0 + IL_005e: stloc.s V_5 + IL_0060: br.s IL_007a + + IL_0062: ldloca.s V_2 + IL_0064: ldloc.s V_5 + IL_0066: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006b: nop + IL_006c: ldloc.s V_5 + IL_006e: ldc.i4.1 + IL_006f: conv.i8 + IL_0070: add + IL_0071: stloc.s V_5 + IL_0073: ldloc.s V_4 + IL_0075: ldc.i4.1 + IL_0076: conv.i8 + IL_0077: add + IL_0078: stloc.s V_4 + IL_007a: ldloc.s V_4 + IL_007c: ldloc.3 + IL_007d: blt.un.s IL_0062 + + IL_007f: nop + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f14(uint64 step, + uint64 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, + bool V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4, + uint64 V_5) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldarg.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: bge.un.s IL_001c + + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: nop + IL_001a: br.s IL_0024 + + IL_001c: ldarg.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: conv.i8 + IL_0022: div.un + IL_0023: nop + IL_0024: stloc.0 + IL_0025: ldloc.0 + IL_0026: ldc.i4.m1 + IL_0027: conv.i8 + IL_0028: ceq + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: brfalse.s IL_0069 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: stloc.3 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: stloc.s V_4 + IL_0035: ldloca.s V_2 + IL_0037: ldloc.s V_4 + IL_0039: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003e: nop + IL_003f: ldloc.s V_4 + IL_0041: ldarg.0 + IL_0042: add + IL_0043: stloc.s V_4 + IL_0045: ldloc.3 + IL_0046: ldc.i4.1 + IL_0047: conv.i8 + IL_0048: add + IL_0049: stloc.3 + IL_004a: br.s IL_0061 + + IL_004c: ldloca.s V_2 + IL_004e: ldloc.s V_4 + IL_0050: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0055: nop + IL_0056: ldloc.s V_4 + IL_0058: ldarg.0 + IL_0059: add + IL_005a: stloc.s V_4 + IL_005c: ldloc.3 + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: add + IL_0060: stloc.3 + IL_0061: ldloc.3 + IL_0062: ldc.i4.0 + IL_0063: conv.i8 + IL_0064: bgt.un.s IL_004c + + IL_0066: nop + IL_0067: br.s IL_0095 + + IL_0069: ldloc.0 + IL_006a: ldc.i4.1 + IL_006b: conv.i8 + IL_006c: add.ovf.un + IL_006d: stloc.3 + IL_006e: ldc.i4.0 + IL_006f: conv.i8 + IL_0070: stloc.s V_4 + IL_0072: ldc.i4.1 + IL_0073: conv.i8 + IL_0074: stloc.s V_5 + IL_0076: br.s IL_008f + + IL_0078: ldloca.s V_2 + IL_007a: ldloc.s V_5 + IL_007c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0081: nop + IL_0082: ldloc.s V_5 + IL_0084: ldarg.0 + IL_0085: add + IL_0086: stloc.s V_5 + IL_0088: ldloc.s V_4 + IL_008a: ldc.i4.1 + IL_008b: conv.i8 + IL_008c: add + IL_008d: stloc.s V_4 + IL_008f: ldloc.s V_4 + IL_0091: ldloc.3 + IL_0092: blt.un.s IL_0078 + + IL_0094: nop + IL_0095: ldloca.s V_2 + IL_0097: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009c: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f15(uint64 start, + uint64 step, + uint64 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, + bool V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4, + uint64 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::RangeUInt64(uint64, + uint64, + uint64) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldarg.2 + IL_0012: ldarg.0 + IL_0013: bge.un.s IL_001a + + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: nop + IL_0018: br.s IL_0021 + + IL_001a: ldarg.2 + IL_001b: ldarg.0 + IL_001c: sub + IL_001d: ldarg.1 + IL_001e: conv.i8 + IL_001f: div.un + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldloc.0 + IL_0023: ldc.i4.m1 + IL_0024: conv.i8 + IL_0025: ceq + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: brfalse.s IL_0065 + + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: stloc.3 + IL_002e: ldarg.0 + IL_002f: stloc.s V_4 + IL_0031: ldloca.s V_2 + IL_0033: ldloc.s V_4 + IL_0035: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003a: nop + IL_003b: ldloc.s V_4 + IL_003d: ldarg.1 + IL_003e: add + IL_003f: stloc.s V_4 + IL_0041: ldloc.3 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: stloc.3 + IL_0046: br.s IL_005d + + IL_0048: ldloca.s V_2 + IL_004a: ldloc.s V_4 + IL_004c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0051: nop + IL_0052: ldloc.s V_4 + IL_0054: ldarg.1 + IL_0055: add + IL_0056: stloc.s V_4 + IL_0058: ldloc.3 + IL_0059: ldc.i4.1 + IL_005a: conv.i8 + IL_005b: add + IL_005c: stloc.3 + IL_005d: ldloc.3 + IL_005e: ldc.i4.0 + IL_005f: conv.i8 + IL_0060: bgt.un.s IL_0048 + + IL_0062: nop + IL_0063: br.s IL_0090 + + IL_0065: ldloc.0 + IL_0066: ldc.i4.1 + IL_0067: conv.i8 + IL_0068: add.ovf.un + IL_0069: stloc.3 + IL_006a: ldc.i4.0 + IL_006b: conv.i8 + IL_006c: stloc.s V_4 + IL_006e: ldarg.0 + IL_006f: stloc.s V_5 + IL_0071: br.s IL_008a + + IL_0073: ldloca.s V_2 + IL_0075: ldloc.s V_5 + IL_0077: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007c: nop + IL_007d: ldloc.s V_5 + IL_007f: ldarg.1 + IL_0080: add + IL_0081: stloc.s V_5 + IL_0083: ldloc.s V_4 + IL_0085: ldc.i4.1 + IL_0086: conv.i8 + IL_0087: add + IL_0088: stloc.s V_4 + IL_008a: ldloc.s V_4 + IL_008c: ldloc.3 + IL_008d: blt.un.s IL_0073 + + IL_008f: nop + IL_0090: ldloca.s V_2 + IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0097: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldc.i4.0 + IL_001e: conv.i8 + IL_001f: stloc.3 + IL_0020: ldloc.0 + IL_0021: stloc.s V_4 + IL_0023: br.s IL_003b + + IL_0025: ldloca.s V_2 + IL_0027: ldloc.s V_4 + IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002e: nop + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + 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_0025 + + 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 f17(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.3 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_003a + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.3 + IL_003b: ldloc.1 + IL_003c: blt.un.s IL_0024 + + IL_003e: ldloca.s V_2 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f18(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 (uint64 V_0, + uint64 V_1, + uint64 V_2, + bool V_3, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, + uint64 V_5, + uint64 V_6, + uint64 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.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_001d + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: nop + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.m1 + IL_0020: conv.i8 + IL_0021: ceq + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: brfalse.s IL_0069 + + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.s V_5 + IL_002b: ldloc.0 + IL_002c: stloc.s V_6 + IL_002e: ldloca.s V_4 + IL_0030: ldloc.s V_6 + IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0037: nop + IL_0038: ldloc.s V_6 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.s V_6 + IL_003f: ldloc.s V_5 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.s V_5 + IL_0046: br.s IL_0060 + + IL_0048: ldloca.s V_4 + IL_004a: ldloc.s V_6 + IL_004c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0051: nop + IL_0052: ldloc.s V_6 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add + IL_0057: stloc.s V_6 + IL_0059: ldloc.s V_5 + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: stloc.s V_5 + IL_0060: ldloc.s V_5 + IL_0062: ldc.i4.0 + IL_0063: conv.i8 + IL_0064: bgt.un.s IL_0048 + + IL_0066: nop + IL_0067: br.s IL_0097 + + IL_0069: ldloc.2 + IL_006a: ldc.i4.1 + IL_006b: conv.i8 + IL_006c: add.ovf.un + IL_006d: stloc.s V_5 + IL_006f: ldc.i4.0 + IL_0070: conv.i8 + IL_0071: stloc.s V_6 + IL_0073: ldloc.0 + IL_0074: stloc.s V_7 + IL_0076: br.s IL_0090 + + IL_0078: ldloca.s V_4 + IL_007a: ldloc.s V_7 + IL_007c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0081: nop + IL_0082: ldloc.s V_7 + IL_0084: ldc.i4.1 + IL_0085: conv.i8 + IL_0086: add + IL_0087: stloc.s V_7 + IL_0089: ldloc.s V_6 + IL_008b: ldc.i4.1 + IL_008c: conv.i8 + IL_008d: add + IL_008e: stloc.s V_6 + IL_0090: ldloc.s V_6 + IL_0092: ldloc.s V_5 + IL_0094: blt.un.s IL_0078 + + IL_0096: nop + IL_0097: ldloca.s V_4 + IL_0099: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009e: 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 (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldc.i4.0 + IL_001e: conv.i8 + IL_001f: stloc.3 + IL_0020: ldloc.0 + IL_0021: stloc.s V_4 + IL_0023: br.s IL_003b + + IL_0025: ldloca.s V_2 + IL_0027: ldloc.s V_4 + IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002e: nop + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + 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_0025 + + 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 f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + bool V_2, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, + uint64 V_4, + uint64 V_5, + uint64 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_001a + + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: ldloc.0 + IL_000e: ldc.i4.s 10 + IL_0010: conv.i8 + IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0016: pop + IL_0017: nop + IL_0018: br.s IL_001b + + IL_001a: nop + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_0031 + + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: conv.i8 + IL_002f: div.un + IL_0030: nop + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: ldc.i4.m1 + IL_0034: conv.i8 + IL_0035: ceq + IL_0037: stloc.2 + IL_0038: ldloc.2 + IL_0039: brfalse.s IL_007c + + IL_003b: ldc.i4.0 + IL_003c: conv.i8 + IL_003d: stloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: stloc.s V_5 + IL_0043: ldloca.s V_3 + IL_0045: ldloc.s V_5 + IL_0047: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_004c: nop + IL_004d: ldloc.s V_5 + IL_004f: ldloc.0 + IL_0050: add + IL_0051: stloc.s V_5 + IL_0053: ldloc.s V_4 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add + IL_0058: stloc.s V_4 + IL_005a: br.s IL_0073 + + IL_005c: ldloca.s V_3 + IL_005e: ldloc.s V_5 + IL_0060: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0065: nop + IL_0066: ldloc.s V_5 + IL_0068: ldloc.0 + IL_0069: add + IL_006a: stloc.s V_5 + IL_006c: ldloc.s V_4 + IL_006e: ldc.i4.1 + IL_006f: conv.i8 + IL_0070: add + IL_0071: stloc.s V_4 + IL_0073: ldloc.s V_4 + IL_0075: ldc.i4.0 + IL_0076: conv.i8 + IL_0077: bgt.un.s IL_005c + + IL_0079: nop + IL_007a: br.s IL_00aa + + IL_007c: ldloc.1 + IL_007d: ldc.i4.1 + IL_007e: conv.i8 + IL_007f: add.ovf.un + IL_0080: stloc.s V_4 + IL_0082: ldc.i4.0 + IL_0083: conv.i8 + IL_0084: stloc.s V_5 + IL_0086: ldc.i4.1 + IL_0087: conv.i8 + IL_0088: stloc.s V_6 + IL_008a: br.s IL_00a3 + + IL_008c: ldloca.s V_3 + IL_008e: ldloc.s V_6 + IL_0090: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0095: nop + IL_0096: ldloc.s V_6 + IL_0098: ldloc.0 + IL_0099: add + IL_009a: stloc.s V_6 + IL_009c: ldloc.s V_5 + IL_009e: ldc.i4.1 + IL_009f: conv.i8 + IL_00a0: add + IL_00a1: stloc.s V_5 + IL_00a3: ldloc.s V_5 + IL_00a5: ldloc.s V_4 + IL_00a7: blt.un.s IL_008c + + IL_00a9: nop + IL_00aa: ldloca.s V_3 + IL_00ac: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b1: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + 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: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.3 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_003a + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.3 + IL_003b: ldloc.1 + IL_003c: blt.un.s IL_0024 + + IL_003e: ldloca.s V_2 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f22(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 (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64 V_3, + bool V_4, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_5, + uint64 V_6, + uint64 V_7, + uint64 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::RangeUInt64(uint64, + uint64, + uint64) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldloc.2 + IL_0029: ldloc.0 + IL_002a: bge.un.s IL_0031 + + IL_002c: ldc.i4.0 + IL_002d: conv.i8 + IL_002e: nop + IL_002f: br.s IL_0038 + + IL_0031: ldloc.2 + IL_0032: ldloc.0 + IL_0033: sub + IL_0034: ldloc.1 + IL_0035: conv.i8 + IL_0036: div.un + IL_0037: nop + IL_0038: stloc.3 + IL_0039: ldloc.3 + IL_003a: ldc.i4.m1 + IL_003b: conv.i8 + IL_003c: ceq + IL_003e: stloc.s V_4 + IL_0040: ldloc.s V_4 + IL_0042: brfalse.s IL_0084 + + IL_0044: ldc.i4.0 + IL_0045: conv.i8 + IL_0046: stloc.s V_6 + IL_0048: ldloc.0 + IL_0049: stloc.s V_7 + IL_004b: ldloca.s V_5 + IL_004d: ldloc.s V_7 + IL_004f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0054: nop + IL_0055: ldloc.s V_7 + IL_0057: ldloc.1 + IL_0058: add + IL_0059: stloc.s V_7 + IL_005b: ldloc.s V_6 + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: add + IL_0060: stloc.s V_6 + IL_0062: br.s IL_007b + + IL_0064: ldloca.s V_5 + IL_0066: ldloc.s V_7 + IL_0068: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006d: nop + IL_006e: ldloc.s V_7 + IL_0070: ldloc.1 + IL_0071: add + IL_0072: stloc.s V_7 + IL_0074: ldloc.s V_6 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.s V_6 + IL_007b: ldloc.s V_6 + IL_007d: ldc.i4.0 + IL_007e: conv.i8 + IL_007f: bgt.un.s IL_0064 + + IL_0081: nop + IL_0082: br.s IL_00b1 + + IL_0084: ldloc.3 + IL_0085: ldc.i4.1 + IL_0086: conv.i8 + IL_0087: add.ovf.un + IL_0088: stloc.s V_6 + IL_008a: ldc.i4.0 + IL_008b: conv.i8 + IL_008c: stloc.s V_7 + IL_008e: ldloc.0 + IL_008f: stloc.s V_8 + IL_0091: br.s IL_00aa + + IL_0093: ldloca.s V_5 + IL_0095: ldloc.s V_8 + IL_0097: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_009c: nop + IL_009d: ldloc.s V_8 + IL_009f: ldloc.1 + IL_00a0: add + IL_00a1: stloc.s V_8 + IL_00a3: ldloc.s V_7 + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add + IL_00a8: stloc.s V_7 + IL_00aa: ldloc.s V_7 + IL_00ac: ldloc.s V_6 + IL_00ae: blt.un.s IL_0093 + + IL_00b0: nop + IL_00b1: ldloca.s V_5 + IL_00b3: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b8: 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/ForLoop/ForEachRangeStepChar.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs new file mode 100644 index 00000000000..137044d13b9 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs @@ -0,0 +1,57 @@ +let mutable c = '\000' + +let f0 () = + for n in 'z'..'a' do + c <- n + +let f00 () = + for n in 'z'..'\001'..'a' do + c <- n + +let f1 () = + for n in 'a'..'z' do + c <- n + +let f2 start = + for n in start..'z' do + c <- n + +let f3 finish = + for n in 'a'..finish do + c <- n + +let f4 (start: char) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 'a'..'\001'..'z' do + c <- n + +let f6 () = + for n in 'a'..'\002'..'z' do + c <- n + +let f7 start = + for n in start..'\002'..'z' do + c <- n + +let f8 step = + for n in 'a'..step..'z' do + c <- n + +let f9 finish = + for n in 'a'..'\002'..finish do + c <- n + +let f10 (start: char) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..'\000'..finish do + c <- n + +let f12 () = + for n in 'a'..'\000'..'z' do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl new file mode 100644 index 00000000000..0ad01b843fa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl @@ -0,0 +1,807 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 ) + .class auto ansi serializable sealed nested assembly beforefieldinit f8@40 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f8@40 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f8@40::.ctor() + IL_0005: stsfld class assembly/f8@40 assembly/f8@40::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f10@48 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f10@48 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f10@48::.ctor() + IL_0005: stsfld class assembly/f10@48 assembly/f10@48::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f11@52 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f11@52 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f11@52::.ctor() + IL_0005: stsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f12@56 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f12@56 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f12@56::.ctor() + IL_0005: stsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_000a: ret + } + + } + + .method public specialname static char get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld char ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(char 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld char ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (char V_0, + char V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 122 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (char V_0, + char V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 122 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + char V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 97 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 26 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void f2(char start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldc.i4.s 122 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldc.i4.s 122 + IL_000b: conv.i4 + IL_000c: ldarg.0 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(char) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f3(char finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.s 97 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i4 + IL_000b: ldc.i4.s 97 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.s 97 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(char) + 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: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f4(char start, + char 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 (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i4 + IL_000a: ldarg.0 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(char) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + char V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 97 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 26 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + char V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 97 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.2 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 13 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void f7(char start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldc.i4.s 122 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0014 + + IL_0009: ldc.i4.s 122 + IL_000b: conv.i4 + IL_000c: ldarg.0 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.2 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: stloc.1 + IL_0017: ldarg.0 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(char) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret + } + + .method public static void f8(char step) cil managed + { + + .maxstack 7 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: bne.un.s IL_0018 + + IL_0004: ldc.i4.0 + IL_0005: ldsfld class assembly/f8@40 assembly/f8@40::@_instance + IL_000a: ldc.i4.s 97 + IL_000c: ldarg.0 + IL_000d: ldc.i4.s 122 + IL_000f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_0014: pop + IL_0015: nop + IL_0016: br.s IL_0019 + + IL_0018: nop + IL_0019: ldc.i4.s 122 + IL_001b: conv.i4 + IL_001c: ldc.i4.s 97 + IL_001e: conv.i4 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.0 + IL_0025: ldc.i4.0 + IL_0026: stloc.1 + IL_0027: ldc.i4.s 97 + IL_0029: stloc.2 + IL_002a: br.s IL_003a + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(char) + IL_0032: ldloc.2 + IL_0033: ldarg.0 + IL_0034: add + IL_0035: stloc.2 + IL_0036: ldloc.1 + IL_0037: ldc.i4.1 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldloc.0 + IL_003c: blt.un.s IL_002c + + IL_003e: ret + } + + .method public static void f9(char finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.s 97 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0014 + + IL_0009: ldarg.0 + IL_000a: conv.i4 + IL_000b: ldc.i4.s 97 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.2 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: stloc.1 + IL_0017: ldc.i4.s 97 + IL_0019: stloc.2 + IL_001a: br.s IL_002a + + IL_001c: ldloc.2 + IL_001d: call void assembly::set_c(char) + IL_0022: ldloc.2 + IL_0023: ldc.i4.2 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 + IL_0028: add + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldloc.0 + IL_002c: blt.un.s IL_001c + + IL_002e: ret + } + + .method public static void f10(char start, + char step, + char 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 7 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.1 + IL_0001: ldc.i4.0 + IL_0002: bne.un.s IL_0016 + + IL_0004: ldc.i4.0 + IL_0005: ldsfld class assembly/f10@48 assembly/f10@48::@_instance + IL_000a: ldarg.2 + IL_000b: ldarg.1 + IL_000c: ldarg.2 + IL_000d: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_0012: pop + IL_0013: nop + IL_0014: br.s IL_0017 + + IL_0016: nop + IL_0017: ldarg.2 + IL_0018: ldarg.2 + IL_0019: bge.un.s IL_001f + + IL_001b: ldc.i4.0 + IL_001c: nop + IL_001d: br.s IL_0029 + + IL_001f: ldarg.2 + IL_0020: conv.i4 + IL_0021: ldarg.2 + IL_0022: conv.i4 + IL_0023: sub + IL_0024: ldarg.1 + IL_0025: div.un + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldc.i4.0 + IL_002b: stloc.1 + IL_002c: ldarg.2 + IL_002d: stloc.2 + IL_002e: br.s IL_003e + + IL_0030: ldloc.2 + IL_0031: call void assembly::set_c(char) + IL_0036: ldloc.2 + IL_0037: ldarg.1 + IL_0038: add + IL_0039: stloc.2 + IL_003a: ldloc.1 + IL_003b: ldc.i4.1 + IL_003c: add + IL_003d: stloc.1 + IL_003e: ldloc.1 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_0030 + + IL_0042: ret + } + + .method public static void f11(char start, + char 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 8 + IL_0000: ldc.i4.0 + IL_0001: ldsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_0006: ldarg.0 + IL_0007: ldc.i4.0 + IL_0008: ldarg.1 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_000e: pop + IL_000f: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: ldsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_0006: ldc.i4.s 97 + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.s 122 + IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_0010: pop + IL_0011: ret + } + + .property char c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(char) + .get char assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly char c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld char ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs new file mode 100644 index 00000000000..2b51677e9f8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs @@ -0,0 +1,65 @@ +let mutable c = 0s + +let f0 () = + for n in 10s..1s do + c <- n + +let f00 () = + for n in 10s..1s..1s do + c <- n + +let f1 () = + for n in 1s..10s do + c <- n + +let f2s start = + for n in start..10s do + c <- n + +let f3s finish = + for n in 1s..finish do + c <- n + +let f4s (start: int16) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1s..1s..10s do + c <- n + +let f6 () = + for n in 1s..2s..10s do + c <- n + +let f7s start = + for n in start..2s..10s do + c <- n + +let f8s step = + for n in 1s..step..10s do + c <- n + +let f9s finish = + for n in 1s..2s..finish do + c <- n + +let f10s (start: int16) step finish = + for n in finish..step..finish do + c <- n + +let f11s start finish = + for n in start..0s..finish do + c <- n + +let f12 () = + for n in 1s..0s..10s do + c <- n + +let f13 () = + for n in 10s .. -1s .. 1s do + c <- n + +let f14 () = + for n in 10s .. -2s .. 1s do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl new file mode 100644 index 00000000000..ee794f80b20 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl @@ -0,0 +1,728 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static int16 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int16 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(int16 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int16 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (int16 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (int16 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f2s(int16 start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i4 + IL_000c: ldarg.0 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(int16) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f3s(int16 finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldc.i4.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(int16) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f4s(int16 start, + int16 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 (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i4 + IL_000a: ldarg.0 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(int16) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.2 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7s(int16 start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0014 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i4 + IL_000c: ldarg.0 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.2 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: stloc.1 + IL_0017: ldarg.0 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(int16) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret + } + + .method public static void f8s(int16 step) cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + 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_0022 + + IL_0015: ldc.i4.s 10 + IL_0017: conv.i4 + IL_0018: ldc.i4.1 + IL_0019: conv.i4 + IL_001a: sub + IL_001b: ldarg.0 + IL_001c: div.un + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: nop + IL_0020: br.s IL_0024 + + IL_0022: ldc.i4.0 + IL_0023: nop + IL_0024: stloc.0 + IL_0025: ldc.i4.0 + IL_0026: stloc.1 + IL_0027: ldc.i4.1 + IL_0028: stloc.2 + IL_0029: br.s IL_0039 + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(int16) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: ldloc.0 + IL_003b: blt.un.s IL_002b + + IL_003d: ret + } + + .method public static void f9s(int16 finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0012 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldc.i4.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.1 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(int16) + IL_001f: ldloc.2 + IL_0020: ldc.i4.2 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f10s(int16 start, + int16 step, + int16 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 (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0028 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001c + + IL_0018: ldc.i4.0 + IL_0019: nop + IL_001a: br.s IL_003e + + IL_001c: ldarg.2 + IL_001d: conv.i4 + IL_001e: ldarg.2 + IL_001f: conv.i4 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: nop + IL_0026: br.s IL_003e + + IL_0028: ldarg.2 + IL_0029: ldarg.2 + IL_002a: bge.s IL_0030 + + IL_002c: ldc.i4.0 + IL_002d: nop + IL_002e: br.s IL_003e + + IL_0030: ldarg.2 + IL_0031: conv.i4 + IL_0032: ldarg.2 + IL_0033: conv.i4 + IL_0034: sub + IL_0035: ldarg.1 + IL_0036: not + IL_0037: conv.i4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: ldc.i4.1 + IL_003c: add + IL_003d: nop + IL_003e: stloc.0 + IL_003f: ldc.i4.0 + IL_0040: stloc.1 + IL_0041: ldarg.2 + IL_0042: stloc.2 + IL_0043: br.s IL_0053 + + IL_0045: ldloc.2 + IL_0046: call void assembly::set_c(int16) + IL_004b: ldloc.2 + IL_004c: ldarg.1 + IL_004d: add + IL_004e: stloc.2 + IL_004f: ldloc.1 + IL_0050: ldc.i4.1 + IL_0051: add + IL_0052: stloc.1 + IL_0053: ldloc.1 + IL_0054: ldloc.0 + IL_0055: blt.un.s IL_0045 + + IL_0057: ret + } + + .method public static void f11s(int16 start, + int16 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_0008: pop + IL_0009: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_0009: pop + IL_000a: ret + } + + .method public static void f13() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.m1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 10 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void f14() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.s -2 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .property int16 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int16) + .get int16 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int16 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int16 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs new file mode 100644 index 00000000000..32bca951da3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs @@ -0,0 +1,65 @@ +let mutable c = 0 + +let f0 () = + for n in 10..1 do + c <- n + +let f00 () = + for n in 10..1..1 do + c <- n + +let f1 () = + for n in 1..10 do + c <- n + +let f2 start = + for n in start..10 do + c <- n + +let f3 finish = + for n in 1..finish do + c <- n + +let f4 start finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1..1..10 do + c <- n + +let f6 () = + for n in 1..2..10 do + c <- n + +let f7 start = + for n in start..2..10 do + c <- n + +let f8 step = + for n in 1..step..10 do + c <- n + +let f9 finish = + for n in 1..2..finish do + c <- n + +let f10 start step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0..finish do + c <- n + +let f12 () = + for n in 1..0..10 do + c <- n + +let f13 () = + for n in 10..-1..1 do + c <- n + +let f14 () = + for n in 10..-2..1 do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl new file mode 100644 index 00000000000..22f085d5e90 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl @@ -0,0 +1,689 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static int32 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int32 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(int32 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int32 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldc.i4.s 10 + IL_0002: stloc.0 + IL_0003: br.s IL_000f + + IL_0005: ldloc.0 + IL_0006: call void assembly::set_c(int32) + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.2 + IL_0011: blt.s IL_0005 + + IL_0013: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: br.s IL_000e + + IL_0004: ldloc.0 + IL_0005: call void assembly::set_c(int32) + IL_000a: ldloc.0 + IL_000b: ldc.i4.1 + IL_000c: add + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.s 11 + IL_0011: blt.s IL_0004 + + IL_0013: ret + } + + .method public static void f2(int32 start) cil managed + { + + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: br.s IL_000e + + IL_0004: ldloc.0 + IL_0005: call void assembly::set_c(int32) + IL_000a: ldloc.0 + IL_000b: ldc.i4.1 + IL_000c: add + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.s 11 + IL_0011: blt.s IL_0004 + + IL_0013: ret + } + + .method public static void f3(int32 finish) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.1 + IL_0001: stloc.1 + IL_0002: ldarg.0 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void f4(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 (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.s 10 + IL_0019: conv.i8 + IL_001a: blt.un.s IL_0007 + + IL_001c: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.2 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: conv.i8 + IL_0019: blt.un.s IL_0007 + + IL_001b: ret + } + + .method public static void f7(int32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.s 10 + 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_0017 + + IL_000a: ldc.i4.s 10 + IL_000c: conv.i8 + IL_000d: ldarg.0 + IL_000e: conv.i8 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002e + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(int32) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ldloc.1 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001f + + IL_0032: ret + } + + .method public static void f8(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + 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_0024 + + IL_0015: ldc.i4.s 10 + IL_0017: conv.i8 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: sub + IL_001b: ldarg.0 + IL_001c: conv.i8 + IL_001d: div.un + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: add.ovf.un + IL_0021: nop + IL_0022: br.s IL_0027 + + IL_0024: ldc.i4.0 + IL_0025: conv.i8 + IL_0026: nop + IL_0027: stloc.0 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.1 + IL_002b: ldc.i4.1 + IL_002c: stloc.2 + IL_002d: br.s IL_003e + + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(int32) + IL_0035: ldloc.2 + IL_0036: ldarg.0 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.1 + IL_003e: ldloc.1 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_002f + + IL_0042: ret + } + + .method public static void f9(int32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0015 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 + IL_001a: stloc.2 + IL_001b: br.s IL_002c + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(int32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001d + + IL_0030: ret + } + + .method public static void f10(!!a 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) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_002b + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001d + + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: nop + IL_001b: br.s IL_0045 + + IL_001d: ldarg.2 + IL_001e: conv.i8 + IL_001f: ldarg.2 + IL_0020: conv.i8 + IL_0021: sub + IL_0022: ldarg.1 + IL_0023: conv.i8 + IL_0024: div.un + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: nop + IL_0029: br.s IL_0045 + + IL_002b: ldarg.2 + IL_002c: ldarg.2 + IL_002d: bge.s IL_0034 + + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: nop + IL_0032: br.s IL_0045 + + IL_0034: ldarg.2 + IL_0035: conv.i8 + IL_0036: ldarg.2 + IL_0037: conv.i8 + IL_0038: sub + IL_0039: ldarg.1 + IL_003a: not + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: conv.i8 + IL_0040: div.un + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add.ovf.un + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: stloc.1 + IL_0049: ldarg.2 + IL_004a: stloc.2 + IL_004b: br.s IL_005c + + IL_004d: ldloc.2 + IL_004e: call void assembly::set_c(int32) + IL_0053: ldloc.2 + IL_0054: ldarg.1 + IL_0055: add + IL_0056: stloc.2 + IL_0057: ldloc.1 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.1 + IL_005c: ldloc.1 + IL_005d: ldloc.0 + IL_005e: blt.un.s IL_004d + + IL_0060: ret + } + + .method public static void 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0008: pop + IL_0009: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0009: pop + IL_000a: ret + } + + .method public static void f13() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.1 + IL_0006: br.s IL_0017 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.m1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add + IL_0016: stloc.0 + IL_0017: ldloc.0 + IL_0018: ldc.i4.s 10 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f14() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.s -2 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .property int32 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int32) + .get int32 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs new file mode 100644 index 00000000000..9e272eb300a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs @@ -0,0 +1,65 @@ +let mutable c = 0L + +let f0 () = + for n in 10L..1L do + c <- n + +let f00 () = + for n in 10L..1L..1L do + c <- n + +let f1 () = + for n in 1L..10L do + c <- n + +let f2 start = + for n in start..10L do + c <- n + +let f3 finish = + for n in 1L..finish do + c <- n + +let f4 (start: int64) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1L..1L..10L do + c <- n + +let f6 () = + for n in 1L..2L..10L do + c <- n + +let f7 start = + for n in start..2L..10L do + c <- n + +let f8 step = + for n in 1L..step..10L do + c <- n + +let f9 finish = + for n in 1L..2L..finish do + c <- n + +let f10 (start: int64) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0L..finish do + c <- n + +let f12 () = + for n in 1L..0L..10L do + c <- n + +let f13 () = + for n in 10L.. -1L ..1L do + c <- n + +let f14 () = + for n in 10L.. -2L ..1L do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl new file mode 100644 index 00000000000..b8fc20e98ec --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl @@ -0,0 +1,960 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static int64 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int64 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(int64 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int64 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (int64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0009 + + IL_001e: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (int64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0009 + + IL_001e: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.s 10 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0008 + + IL_001e: ret + } + + .method public static void f2(int64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + 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_0016 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: conv.i8 + IL_0011: sub + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add.ovf.un + IL_0015: nop + IL_0016: stloc.0 + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: stloc.1 + IL_001a: ldarg.0 + IL_001b: stloc.2 + IL_001c: br.s IL_002e + + IL_001e: ldloc.2 + IL_001f: call void assembly::set_c(int64) + IL_0024: ldloc.2 + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ldloc.1 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001e + + IL_0032: ret + } + + .method public static void f3(int64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: conv.i8 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0014 + + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: conv.i8 + IL_000f: sub + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add.ovf.un + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: stloc.2 + IL_001b: br.s IL_002d + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(int64) + IL_0023: ldloc.2 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + 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: ldloc.0 + IL_002f: blt.un.s IL_001d + + IL_0031: ret + } + + .method public static void f4(int64 start, + int64 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, + uint64 V_1, + int64 V_2, + uint64 V_3) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000f + + IL_0009: ldarg.1 + IL_000a: conv.i8 + IL_000b: ldarg.0 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldloc.0 + IL_0011: ldc.i4.m1 + IL_0012: conv.i8 + IL_0013: bne.un.s IL_0042 + + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldarg.0 + IL_0019: stloc.2 + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int64) + IL_0020: ldloc.2 + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.1 + IL_002a: br.s IL_003c + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(int64) + IL_0032: ldloc.2 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add + IL_0036: stloc.2 + IL_0037: ldloc.1 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: add + IL_003b: stloc.1 + IL_003c: ldloc.1 + IL_003d: ldc.i4.0 + IL_003e: conv.i8 + IL_003f: bgt.un.s IL_002c + + IL_0041: ret + + IL_0042: ldloc.0 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add.ovf.un + IL_0046: stloc.1 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.3 + IL_004a: ldarg.0 + IL_004b: stloc.2 + IL_004c: br.s IL_005e + + IL_004e: ldloc.2 + IL_004f: call void assembly::set_c(int64) + IL_0054: ldloc.2 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add + IL_0058: stloc.2 + IL_0059: ldloc.3 + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: stloc.3 + IL_005e: ldloc.3 + IL_005f: ldloc.1 + IL_0060: blt.un.s IL_004e + + IL_0062: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.s 10 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0008 + + IL_001e: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.2 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f7(int64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + 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_001a + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: conv.i8 + IL_0011: sub + IL_0012: ldc.i4.2 + IL_0013: conv.i8 + IL_0014: conv.i8 + IL_0015: div.un + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.0 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.1 + IL_001e: ldarg.0 + IL_001f: stloc.2 + IL_0020: br.s IL_0032 + + IL_0022: ldloc.2 + IL_0023: call void assembly::set_c(int64) + IL_0028: ldloc.2 + IL_0029: ldc.i4.2 + IL_002a: conv.i8 + IL_002b: add + IL_002c: stloc.2 + IL_002d: ldloc.1 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: add + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: ldloc.0 + IL_0034: blt.un.s IL_0022 + + IL_0036: ret + } + + .method public static void f8(int64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2, + uint64 V_3) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 + + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: ldarg.0 + IL_0016: bge.s IL_0026 + + IL_0018: ldc.i4.s 10 + IL_001a: conv.i8 + IL_001b: conv.i8 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: conv.i8 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: conv.i8 + IL_0022: div.un + IL_0023: nop + IL_0024: br.s IL_0029 + + IL_0026: ldc.i4.0 + IL_0027: conv.i8 + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldloc.0 + IL_002b: ldc.i4.m1 + IL_002c: conv.i8 + IL_002d: bne.un.s IL_005b + + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: stloc.1 + IL_0032: ldc.i4.1 + IL_0033: conv.i8 + IL_0034: stloc.2 + IL_0035: ldloc.2 + IL_0036: call void assembly::set_c(int64) + IL_003b: ldloc.2 + IL_003c: ldarg.0 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: br.s IL_0055 + + IL_0046: ldloc.2 + IL_0047: call void assembly::set_c(int64) + IL_004c: ldloc.2 + IL_004d: ldarg.0 + IL_004e: add + IL_004f: stloc.2 + IL_0050: ldloc.1 + IL_0051: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: add + IL_0054: stloc.1 + IL_0055: ldloc.1 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: bgt.un.s IL_0046 + + IL_005a: ret + + IL_005b: ldloc.0 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add.ovf.un + IL_005f: stloc.1 + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.3 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: stloc.2 + IL_0066: br.s IL_0077 + + IL_0068: ldloc.2 + IL_0069: call void assembly::set_c(int64) + IL_006e: ldloc.2 + IL_006f: ldarg.0 + IL_0070: add + IL_0071: stloc.2 + 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.1 + IL_0079: blt.un.s IL_0068 + + IL_007b: ret + } + + .method public static void f9(int64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: conv.i8 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0018 + + IL_000a: ldarg.0 + IL_000b: conv.i8 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: conv.i8 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: conv.i8 + IL_0013: div.un + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add.ovf.un + IL_0017: nop + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: stloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: stloc.2 + IL_001f: br.s IL_0031 + + IL_0021: ldloc.2 + IL_0022: call void assembly::set_c(int64) + IL_0027: ldloc.2 + IL_0028: ldc.i4.2 + IL_0029: conv.i8 + 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: ldloc.0 + IL_0033: blt.un.s IL_0021 + + IL_0035: ret + } + + .method public static void f10(int64 start, + int64 step, + int64 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, + int64 V_2, + uint64 V_3) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: ldarg.1 + IL_0013: bge.s IL_0029 + + IL_0015: ldarg.2 + IL_0016: ldarg.2 + 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: conv.i8 + IL_0020: ldarg.2 + IL_0021: conv.i8 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: conv.i8 + IL_0025: div.un + IL_0026: nop + IL_0027: br.s IL_0040 + + IL_0029: ldarg.2 + IL_002a: ldarg.2 + IL_002b: bge.s IL_0032 + + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: nop + IL_0030: br.s IL_0040 + + IL_0032: ldarg.2 + IL_0033: conv.i8 + IL_0034: ldarg.2 + IL_0035: conv.i8 + IL_0036: sub + IL_0037: ldarg.1 + IL_0038: not + IL_0039: conv.i8 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: conv.i8 + IL_003e: div.un + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: ldc.i4.m1 + IL_0043: conv.i8 + IL_0044: bne.un.s IL_0071 + + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: stloc.1 + IL_0049: ldarg.2 + IL_004a: stloc.2 + IL_004b: ldloc.2 + IL_004c: call void assembly::set_c(int64) + IL_0051: ldloc.2 + IL_0052: ldarg.1 + IL_0053: add + IL_0054: stloc.2 + IL_0055: ldloc.1 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.1 + IL_005a: br.s IL_006b + + IL_005c: ldloc.2 + IL_005d: call void assembly::set_c(int64) + IL_0062: ldloc.2 + IL_0063: ldarg.1 + IL_0064: add + IL_0065: stloc.2 + IL_0066: ldloc.1 + IL_0067: ldc.i4.1 + IL_0068: conv.i8 + IL_0069: add + IL_006a: stloc.1 + IL_006b: ldloc.1 + IL_006c: ldc.i4.0 + IL_006d: conv.i8 + IL_006e: bgt.un.s IL_005c + + IL_0070: ret + + IL_0071: ldloc.0 + IL_0072: ldc.i4.1 + IL_0073: conv.i8 + IL_0074: add.ovf.un + IL_0075: stloc.1 + IL_0076: ldc.i4.0 + IL_0077: conv.i8 + IL_0078: stloc.3 + IL_0079: ldarg.2 + IL_007a: stloc.2 + IL_007b: br.s IL_008c + + IL_007d: ldloc.2 + IL_007e: call void assembly::set_c(int64) + IL_0083: ldloc.2 + IL_0084: ldarg.1 + IL_0085: add + IL_0086: stloc.2 + IL_0087: ldloc.3 + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: stloc.3 + IL_008c: ldloc.3 + IL_008d: ldloc.1 + IL_008e: blt.un.s IL_007d + + IL_0090: ret + } + + .method public static void f11(int64 start, + int64 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_0009: pop + IL_000a: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 + IL_0003: conv.i8 + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000c: pop + IL_000d: ret + } + + .method public static void f13() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.s 10 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0009 + + IL_001f: ret + } + + .method public static void f14() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_001a + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.s -2 + IL_0012: conv.i8 + IL_0013: add + IL_0014: stloc.1 + IL_0015: ldloc.0 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldloc.0 + IL_001b: ldc.i4.5 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0009 + + IL_001f: ret + } + + .property int64 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int64) + .get int64 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int64 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stsfld int64 ''.$assembly::c@1 + IL_0007: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs new file mode 100644 index 00000000000..31464a36932 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs @@ -0,0 +1,65 @@ +let mutable c = 0n + +let f0 () = + for n in 10n..1n do + c <- n + +let f00 () = + for n in 10n..1n..1n do + c <- n + +let f1 () = + for n in 1n..10n do + c <- n + +let f2 start = + for n in start..10n do + c <- n + +let f3 finish = + for n in 1n..finish do + c <- n + +let f4 (start: nativeint) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1n..1n..10n do + c <- n + +let f6 () = + for n in 1n..2n..10n do + c <- n + +let f7 start = + for n in start..2n..10n do + c <- n + +let f8 step = + for n in 1n..step..10n do + c <- n + +let f9 finish = + for n in 1n..2n..finish do + c <- n + +let f10 (start: nativeint) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0n..finish do + c <- n + +let f12 () = + for n in 1n..0n..10n do + c <- n + +let f13 () = + for n in 10n.. -1n ..1n do + c <- n + +let f14 () = + for n in 10n.. -2n ..1n do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl new file mode 100644 index 00000000000..ecbe22d4fad --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -0,0 +1,1348 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static native int get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld native int ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(native int 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld native int ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stloc.0 + IL_000b: ldc.i8 0xa + IL_0014: conv.i + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native int) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.i + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.i + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x0 + IL_0042: conv.i + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stloc.0 + IL_000b: ldc.i8 0xa + IL_0014: conv.i + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native int) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.i + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.i + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x0 + IL_0042: conv.i + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.i + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native int) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.i + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.i + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0xa + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f2(native int start) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2, + native int V_3) + IL_0000: ldc.i8 0xa + IL_0009: conv.i + IL_000a: ldarg.0 + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldc.i8 0xa + IL_0023: conv.i + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_00ae + + IL_0051: ldc.i8 0x0 + IL_005a: conv.i + IL_005b: stloc.1 + IL_005c: ldarg.0 + IL_005d: stloc.2 + IL_005e: ldloc.2 + IL_005f: call void assembly::set_c(native int) + IL_0064: ldloc.2 + IL_0065: ldc.i8 0x1 + IL_006e: conv.i + IL_006f: add + IL_0070: stloc.2 + IL_0071: ldloc.1 + IL_0072: ldc.i8 0x1 + IL_007b: conv.i + IL_007c: add + IL_007d: stloc.1 + IL_007e: br.s IL_00a0 + + IL_0080: ldloc.2 + IL_0081: call void assembly::set_c(native int) + IL_0086: ldloc.2 + IL_0087: ldc.i8 0x1 + IL_0090: conv.i + IL_0091: add + IL_0092: stloc.2 + IL_0093: ldloc.1 + IL_0094: ldc.i8 0x1 + IL_009d: conv.i + IL_009e: add + IL_009f: stloc.1 + IL_00a0: ldloc.1 + IL_00a1: ldc.i8 0x0 + IL_00aa: conv.i + IL_00ab: bgt.un.s IL_0080 + + IL_00ad: ret + + IL_00ae: ldloc.0 + IL_00af: ldc.i8 0x1 + IL_00b8: conv.i + IL_00b9: add.ovf.un + IL_00ba: stloc.1 + IL_00bb: ldc.i8 0x0 + IL_00c4: conv.i + IL_00c5: stloc.2 + IL_00c6: ldarg.0 + IL_00c7: stloc.3 + IL_00c8: br.s IL_00ea + + IL_00ca: ldloc.3 + IL_00cb: call void assembly::set_c(native int) + IL_00d0: ldloc.3 + IL_00d1: ldc.i8 0x1 + IL_00da: conv.i + IL_00db: add + IL_00dc: stloc.3 + IL_00dd: ldloc.2 + IL_00de: ldc.i8 0x1 + IL_00e7: conv.i + IL_00e8: add + IL_00e9: stloc.2 + IL_00ea: ldloc.2 + IL_00eb: ldloc.1 + IL_00ec: blt.un.s IL_00ca + + IL_00ee: ret + } + + .method public static void f3(native int finish) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2, + native int V_3) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x1 + IL_000a: conv.i + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.i + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_00b7 + + IL_0051: ldc.i8 0x0 + IL_005a: conv.i + IL_005b: stloc.1 + IL_005c: ldc.i8 0x1 + IL_0065: conv.i + IL_0066: stloc.2 + IL_0067: ldloc.2 + IL_0068: call void assembly::set_c(native int) + IL_006d: ldloc.2 + IL_006e: ldc.i8 0x1 + IL_0077: conv.i + IL_0078: add + IL_0079: stloc.2 + IL_007a: ldloc.1 + IL_007b: ldc.i8 0x1 + IL_0084: conv.i + IL_0085: add + IL_0086: stloc.1 + IL_0087: br.s IL_00a9 + + IL_0089: ldloc.2 + IL_008a: call void assembly::set_c(native int) + IL_008f: ldloc.2 + IL_0090: ldc.i8 0x1 + IL_0099: conv.i + IL_009a: add + IL_009b: stloc.2 + IL_009c: ldloc.1 + IL_009d: ldc.i8 0x1 + IL_00a6: conv.i + IL_00a7: add + IL_00a8: stloc.1 + IL_00a9: ldloc.1 + IL_00aa: ldc.i8 0x0 + IL_00b3: conv.i + IL_00b4: bgt.un.s IL_0089 + + IL_00b6: ret + + IL_00b7: ldloc.0 + IL_00b8: ldc.i8 0x1 + IL_00c1: conv.i + IL_00c2: add.ovf.un + IL_00c3: stloc.1 + IL_00c4: ldc.i8 0x0 + IL_00cd: conv.i + IL_00ce: stloc.2 + IL_00cf: ldc.i8 0x1 + IL_00d8: conv.i + IL_00d9: stloc.3 + IL_00da: br.s IL_00fc + + IL_00dc: ldloc.3 + IL_00dd: call void assembly::set_c(native int) + IL_00e2: ldloc.3 + IL_00e3: ldc.i8 0x1 + IL_00ec: conv.i + IL_00ed: add + IL_00ee: stloc.3 + IL_00ef: ldloc.2 + IL_00f0: ldc.i8 0x1 + IL_00f9: conv.i + IL_00fa: add + IL_00fb: stloc.2 + IL_00fc: ldloc.2 + IL_00fd: ldloc.1 + IL_00fe: blt.un.s IL_00dc + + IL_0100: ret + } + + .method public static void f4(native int start, + native int 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 (native int V_0, + native int V_1, + native int V_2, + native int V_3) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.i + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_009c + + IL_003f: ldc.i8 0x0 + IL_0048: conv.i + IL_0049: stloc.1 + IL_004a: ldarg.0 + IL_004b: stloc.2 + IL_004c: ldloc.2 + IL_004d: call void assembly::set_c(native int) + IL_0052: ldloc.2 + IL_0053: ldc.i8 0x1 + IL_005c: conv.i + IL_005d: add + IL_005e: stloc.2 + IL_005f: ldloc.1 + IL_0060: ldc.i8 0x1 + IL_0069: conv.i + IL_006a: add + IL_006b: stloc.1 + IL_006c: br.s IL_008e + + IL_006e: ldloc.2 + IL_006f: call void assembly::set_c(native int) + IL_0074: ldloc.2 + IL_0075: ldc.i8 0x1 + IL_007e: conv.i + IL_007f: add + IL_0080: stloc.2 + IL_0081: ldloc.1 + IL_0082: ldc.i8 0x1 + IL_008b: conv.i + IL_008c: add + IL_008d: stloc.1 + IL_008e: ldloc.1 + IL_008f: ldc.i8 0x0 + IL_0098: conv.i + IL_0099: bgt.un.s IL_006e + + IL_009b: ret + + IL_009c: ldloc.0 + IL_009d: ldc.i8 0x1 + IL_00a6: conv.i + IL_00a7: add.ovf.un + IL_00a8: stloc.1 + IL_00a9: ldc.i8 0x0 + IL_00b2: conv.i + IL_00b3: stloc.2 + IL_00b4: ldarg.0 + IL_00b5: stloc.3 + IL_00b6: br.s IL_00d8 + + IL_00b8: ldloc.3 + IL_00b9: call void assembly::set_c(native int) + IL_00be: ldloc.3 + IL_00bf: ldc.i8 0x1 + IL_00c8: conv.i + IL_00c9: add + IL_00ca: stloc.3 + IL_00cb: ldloc.2 + IL_00cc: ldc.i8 0x1 + IL_00d5: conv.i + IL_00d6: add + IL_00d7: stloc.2 + IL_00d8: ldloc.2 + IL_00d9: ldloc.1 + IL_00da: blt.un.s IL_00b8 + + IL_00dc: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.i + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native int) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.i + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.i + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0xa + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.i + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native int) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x2 + IL_0028: conv.i + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.i + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x5 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f7(native int start) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldc.i8 0xa + IL_0009: conv.i + IL_000a: ldarg.0 + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_003d + + IL_001a: ldc.i8 0xa + IL_0023: conv.i + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.i + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.i + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: stloc.1 + IL_0049: ldarg.0 + IL_004a: stloc.2 + IL_004b: br.s IL_006d + + IL_004d: ldloc.2 + IL_004e: call void assembly::set_c(native int) + IL_0053: ldloc.2 + IL_0054: ldc.i8 0x2 + IL_005d: conv.i + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.1 + IL_0061: ldc.i8 0x1 + IL_006a: conv.i + IL_006b: add + IL_006c: stloc.1 + IL_006d: ldloc.1 + IL_006e: ldloc.0 + IL_006f: blt.un.s IL_004d + + IL_0071: ret + } + + .method public static void f8(native int step) cil managed + { + + .maxstack 5 + .locals init (native int V_0, + native int V_1, + native int V_2, + native int V_3) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: bne.un.s IL_002b + + IL_000d: ldc.i8 0x1 + IL_0016: conv.i + IL_0017: ldarg.0 + IL_0018: ldc.i8 0xa + IL_0021: conv.i + IL_0022: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0027: pop + IL_0028: nop + IL_0029: br.s IL_002c + + IL_002b: nop + IL_002c: ldc.i8 0x0 + IL_0035: conv.i + IL_0036: ldarg.0 + IL_0037: bge.s IL_0076 + + IL_0039: ldc.i8 0xa + IL_0042: conv.i + IL_0043: ldc.i8 0x1 + IL_004c: conv.i + IL_004d: bge.s IL_005c + + IL_004f: ldc.i8 0x0 + IL_0058: conv.i + IL_0059: nop + IL_005a: br.s IL_00bd + + IL_005c: ldc.i8 0xa + IL_0065: conv.i + IL_0066: ldc.i8 0x1 + IL_006f: conv.i + IL_0070: sub + IL_0071: ldarg.0 + IL_0072: div.un + IL_0073: nop + IL_0074: br.s IL_00bd + + IL_0076: ldc.i8 0x1 + IL_007f: conv.i + IL_0080: ldc.i8 0xa + IL_0089: conv.i + IL_008a: bge.s IL_0099 + + IL_008c: ldc.i8 0x0 + IL_0095: conv.i + IL_0096: nop + IL_0097: br.s IL_00bd + + IL_0099: ldc.i8 0x1 + IL_00a2: conv.i + IL_00a3: ldc.i8 0xa + IL_00ac: conv.i + IL_00ad: sub + IL_00ae: ldarg.0 + IL_00af: not + IL_00b0: ldc.i8 0x1 + IL_00b9: conv.i + IL_00ba: add + IL_00bb: div.un + IL_00bc: nop + IL_00bd: stloc.0 + IL_00be: sizeof [runtime]System.IntPtr + IL_00c4: ldc.i4.4 + IL_00c5: bne.un.s IL_00d7 + + IL_00c7: ldloc.0 + IL_00c8: ldc.i8 0xffffffff + IL_00d1: conv.u + IL_00d2: ceq + IL_00d4: nop + IL_00d5: br.s IL_00e5 + + IL_00d7: ldloc.0 + IL_00d8: ldc.i8 0xffffffffffffffff + IL_00e1: conv.u + IL_00e2: ceq + IL_00e4: nop + IL_00e5: brfalse.s IL_013b + + IL_00e7: ldc.i8 0x0 + IL_00f0: conv.i + IL_00f1: stloc.1 + IL_00f2: ldc.i8 0x1 + IL_00fb: conv.i + IL_00fc: stloc.2 + IL_00fd: ldloc.2 + IL_00fe: call void assembly::set_c(native int) + IL_0103: ldloc.2 + IL_0104: ldarg.0 + IL_0105: add + IL_0106: stloc.2 + IL_0107: ldloc.1 + IL_0108: ldc.i8 0x1 + IL_0111: conv.i + IL_0112: add + IL_0113: stloc.1 + IL_0114: br.s IL_012d + + IL_0116: ldloc.2 + IL_0117: call void assembly::set_c(native int) + IL_011c: ldloc.2 + IL_011d: ldarg.0 + IL_011e: add + IL_011f: stloc.2 + IL_0120: ldloc.1 + IL_0121: ldc.i8 0x1 + IL_012a: conv.i + IL_012b: add + IL_012c: stloc.1 + IL_012d: ldloc.1 + IL_012e: ldc.i8 0x0 + IL_0137: conv.i + IL_0138: bgt.un.s IL_0116 + + IL_013a: ret + + IL_013b: ldloc.0 + IL_013c: ldc.i8 0x1 + IL_0145: conv.i + IL_0146: add.ovf.un + IL_0147: stloc.1 + IL_0148: ldc.i8 0x0 + IL_0151: conv.i + IL_0152: stloc.2 + IL_0153: ldc.i8 0x1 + IL_015c: conv.i + IL_015d: stloc.3 + IL_015e: br.s IL_0177 + + IL_0160: ldloc.3 + IL_0161: call void assembly::set_c(native int) + IL_0166: ldloc.3 + IL_0167: ldarg.0 + IL_0168: add + IL_0169: stloc.3 + IL_016a: ldloc.2 + IL_016b: ldc.i8 0x1 + IL_0174: conv.i + IL_0175: add + IL_0176: stloc.2 + IL_0177: ldloc.2 + IL_0178: ldloc.1 + IL_0179: blt.un.s IL_0160 + + IL_017b: ret + } + + .method public static void f9(native int finish) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x1 + IL_000a: conv.i + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_003d + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.i + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.i + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.i + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: stloc.1 + IL_0049: ldc.i8 0x1 + IL_0052: conv.i + IL_0053: stloc.2 + IL_0054: br.s IL_0076 + + IL_0056: ldloc.2 + IL_0057: call void assembly::set_c(native int) + IL_005c: ldloc.2 + IL_005d: ldc.i8 0x2 + IL_0066: conv.i + IL_0067: add + IL_0068: stloc.2 + IL_0069: ldloc.1 + IL_006a: ldc.i8 0x1 + IL_0073: conv.i + IL_0074: add + IL_0075: stloc.1 + IL_0076: ldloc.1 + IL_0077: ldloc.0 + IL_0078: blt.un.s IL_0056 + + IL_007a: ret + } + + .method public static void f10(native int start, + native int step, + native int 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 (native int V_0, + native int V_1, + native int V_2, + native int V_3) + IL_0000: ldarg.1 + IL_0001: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: bne.un.s IL_0019 + + IL_000d: ldarg.2 + IL_000e: ldarg.1 + IL_000f: ldarg.2 + IL_0010: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0015: pop + IL_0016: nop + IL_0017: br.s IL_001a + + IL_0019: nop + IL_001a: ldc.i8 0x0 + IL_0023: conv.i + IL_0024: ldarg.1 + IL_0025: bge.s IL_0040 + + IL_0027: ldarg.2 + IL_0028: ldarg.2 + IL_0029: bge.s IL_0038 + + IL_002b: ldc.i8 0x0 + IL_0034: conv.i + IL_0035: nop + IL_0036: br.s IL_0063 + + IL_0038: ldarg.2 + IL_0039: ldarg.2 + IL_003a: sub + IL_003b: ldarg.1 + IL_003c: div.un + IL_003d: nop + IL_003e: br.s IL_0063 + + IL_0040: ldarg.2 + IL_0041: ldarg.2 + IL_0042: bge.s IL_0051 + + IL_0044: ldc.i8 0x0 + IL_004d: conv.i + IL_004e: nop + IL_004f: br.s IL_0063 + + IL_0051: ldarg.2 + IL_0052: ldarg.2 + IL_0053: sub + IL_0054: ldarg.1 + IL_0055: not + IL_0056: ldc.i8 0x1 + IL_005f: conv.i + IL_0060: add + IL_0061: div.un + IL_0062: nop + IL_0063: stloc.0 + IL_0064: sizeof [runtime]System.IntPtr + IL_006a: ldc.i4.4 + IL_006b: bne.un.s IL_007d + + IL_006d: ldloc.0 + IL_006e: ldc.i8 0xffffffff + IL_0077: conv.u + IL_0078: ceq + IL_007a: nop + IL_007b: br.s IL_008b + + IL_007d: ldloc.0 + IL_007e: ldc.i8 0xffffffffffffffff + IL_0087: conv.u + IL_0088: ceq + IL_008a: nop + IL_008b: brfalse.s IL_00d8 + + IL_008d: ldc.i8 0x0 + IL_0096: conv.i + IL_0097: stloc.1 + IL_0098: ldarg.2 + IL_0099: stloc.2 + IL_009a: ldloc.2 + IL_009b: call void assembly::set_c(native int) + IL_00a0: ldloc.2 + IL_00a1: ldarg.1 + IL_00a2: add + IL_00a3: stloc.2 + IL_00a4: ldloc.1 + IL_00a5: ldc.i8 0x1 + IL_00ae: conv.i + IL_00af: add + IL_00b0: stloc.1 + IL_00b1: br.s IL_00ca + + IL_00b3: ldloc.2 + IL_00b4: call void assembly::set_c(native int) + IL_00b9: ldloc.2 + IL_00ba: ldarg.1 + IL_00bb: add + IL_00bc: stloc.2 + IL_00bd: ldloc.1 + IL_00be: ldc.i8 0x1 + IL_00c7: conv.i + IL_00c8: add + IL_00c9: stloc.1 + IL_00ca: ldloc.1 + IL_00cb: ldc.i8 0x0 + IL_00d4: conv.i + IL_00d5: bgt.un.s IL_00b3 + + IL_00d7: ret + + IL_00d8: ldloc.0 + IL_00d9: ldc.i8 0x1 + IL_00e2: conv.i + IL_00e3: add.ovf.un + IL_00e4: stloc.1 + IL_00e5: ldc.i8 0x0 + IL_00ee: conv.i + IL_00ef: stloc.2 + IL_00f0: ldarg.2 + IL_00f1: stloc.3 + IL_00f2: br.s IL_010b + + IL_00f4: ldloc.3 + IL_00f5: call void assembly::set_c(native int) + IL_00fa: ldloc.3 + IL_00fb: ldarg.1 + IL_00fc: add + IL_00fd: stloc.3 + IL_00fe: ldloc.2 + IL_00ff: ldc.i8 0x1 + IL_0108: conv.i + IL_0109: add + IL_010a: stloc.2 + IL_010b: ldloc.2 + IL_010c: ldloc.1 + IL_010d: blt.un.s IL_00f4 + + IL_010f: ret + } + + .method public static void f11(native int start, + native int 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0011: pop + IL_0012: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i8 0x1 + IL_0009: conv.i + IL_000a: ldc.i8 0x0 + IL_0013: conv.i + IL_0014: ldc.i8 0xa + IL_001d: conv.i + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0023: pop + IL_0024: ret + } + + .method public static void f13() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2, + native int V_3) + IL_0000: ldc.i8 0xa + IL_0009: conv.i + IL_000a: ldc.i8 0x1 + IL_0013: conv.i + IL_0014: bge.s IL_0023 + + IL_0016: ldc.i8 0x0 + IL_001f: conv.i + IL_0020: nop + IL_0021: br.s IL_0039 + + IL_0023: ldc.i8 0xa + IL_002c: conv.i + IL_002d: ldc.i8 0x1 + IL_0036: conv.i + IL_0037: sub + IL_0038: nop + IL_0039: stloc.0 + IL_003a: sizeof [runtime]System.IntPtr + IL_0040: ldc.i4.4 + IL_0041: bne.un.s IL_0053 + + IL_0043: ldloc.0 + IL_0044: ldc.i8 0xffffffff + IL_004d: conv.u + IL_004e: ceq + IL_0050: nop + IL_0051: br.s IL_0061 + + IL_0053: ldloc.0 + IL_0054: ldc.i8 0xffffffffffffffff + IL_005d: conv.u + IL_005e: ceq + IL_0060: nop + IL_0061: brfalse.s IL_00c9 + + IL_0063: ldc.i8 0x0 + IL_006c: conv.i + IL_006d: stloc.1 + IL_006e: ldc.i8 0xa + IL_0077: conv.i + IL_0078: stloc.2 + IL_0079: ldloc.2 + IL_007a: call void assembly::set_c(native int) + IL_007f: ldloc.2 + IL_0080: ldc.i8 0xffffffffffffffff + IL_0089: conv.i + IL_008a: add + IL_008b: stloc.2 + IL_008c: ldloc.1 + IL_008d: ldc.i8 0x1 + IL_0096: conv.i + IL_0097: add + IL_0098: stloc.1 + IL_0099: br.s IL_00bb + + IL_009b: ldloc.2 + IL_009c: call void assembly::set_c(native int) + IL_00a1: ldloc.2 + IL_00a2: ldc.i8 0xffffffffffffffff + IL_00ab: conv.i + IL_00ac: add + IL_00ad: stloc.2 + IL_00ae: ldloc.1 + IL_00af: ldc.i8 0x1 + IL_00b8: conv.i + IL_00b9: add + IL_00ba: stloc.1 + IL_00bb: ldloc.1 + IL_00bc: ldc.i8 0x0 + IL_00c5: conv.i + IL_00c6: bgt.un.s IL_009b + + IL_00c8: ret + + IL_00c9: ldloc.0 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add.ovf.un + IL_00d5: stloc.1 + IL_00d6: ldc.i8 0x0 + IL_00df: conv.i + IL_00e0: stloc.2 + IL_00e1: ldc.i8 0xa + IL_00ea: conv.i + IL_00eb: stloc.3 + IL_00ec: br.s IL_010e + + IL_00ee: ldloc.3 + IL_00ef: call void assembly::set_c(native int) + IL_00f4: ldloc.3 + IL_00f5: ldc.i8 0xffffffffffffffff + IL_00fe: conv.i + IL_00ff: add + IL_0100: stloc.3 + IL_0101: ldloc.2 + IL_0102: ldc.i8 0x1 + IL_010b: conv.i + IL_010c: add + IL_010d: stloc.2 + IL_010e: ldloc.2 + IL_010f: ldloc.1 + IL_0110: blt.un.s IL_00ee + + IL_0112: ret + } + + .method public static void f14() cil managed + { + + .maxstack 5 + .locals init (native int V_0, + native int V_1, + native int V_2, + native int V_3) + IL_0000: ldc.i8 0xfffffffffffffffe + IL_0009: conv.i + IL_000a: ldc.i8 0x0 + IL_0013: conv.i + IL_0014: bne.un.s IL_003d + + IL_0016: ldc.i8 0xa + IL_001f: conv.i + IL_0020: ldc.i8 0xfffffffffffffffe + IL_0029: conv.i + IL_002a: ldc.i8 0x1 + IL_0033: conv.i + IL_0034: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0039: pop + IL_003a: nop + IL_003b: br.s IL_003e + + IL_003d: nop + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: ldc.i8 0xfffffffffffffffe + IL_0051: conv.i + IL_0052: bge.s IL_009a + + IL_0054: ldc.i8 0x1 + IL_005d: conv.i + IL_005e: ldc.i8 0xa + IL_0067: conv.i + IL_0068: bge.s IL_0077 + + IL_006a: ldc.i8 0x0 + IL_0073: conv.i + IL_0074: nop + IL_0075: br.s IL_00ea + + IL_0077: ldc.i8 0x1 + IL_0080: conv.i + IL_0081: ldc.i8 0xa + IL_008a: conv.i + IL_008b: sub + IL_008c: ldc.i8 0xfffffffffffffffe + IL_0095: conv.i + IL_0096: div.un + IL_0097: nop + IL_0098: br.s IL_00ea + + IL_009a: ldc.i8 0xa + IL_00a3: conv.i + IL_00a4: ldc.i8 0x1 + IL_00ad: conv.i + IL_00ae: bge.s IL_00bd + + IL_00b0: ldc.i8 0x0 + IL_00b9: conv.i + IL_00ba: nop + IL_00bb: br.s IL_00ea + + IL_00bd: ldc.i8 0xa + IL_00c6: conv.i + IL_00c7: ldc.i8 0x1 + IL_00d0: conv.i + IL_00d1: sub + IL_00d2: ldc.i8 0xfffffffffffffffe + IL_00db: conv.i + IL_00dc: not + IL_00dd: ldc.i8 0x1 + IL_00e6: conv.i + IL_00e7: add + IL_00e8: div.un + IL_00e9: nop + IL_00ea: stloc.0 + IL_00eb: sizeof [runtime]System.IntPtr + IL_00f1: ldc.i4.4 + IL_00f2: bne.un.s IL_0104 + + IL_00f4: ldloc.0 + IL_00f5: ldc.i8 0xffffffff + IL_00fe: conv.u + IL_00ff: ceq + IL_0101: nop + IL_0102: br.s IL_0112 + + IL_0104: ldloc.0 + IL_0105: ldc.i8 0xffffffffffffffff + IL_010e: conv.u + IL_010f: ceq + IL_0111: nop + IL_0112: brfalse.s IL_017a + + IL_0114: ldc.i8 0x0 + IL_011d: conv.i + IL_011e: stloc.1 + IL_011f: ldc.i8 0xa + IL_0128: conv.i + IL_0129: stloc.2 + IL_012a: ldloc.2 + IL_012b: call void assembly::set_c(native int) + IL_0130: ldloc.2 + IL_0131: ldc.i8 0xfffffffffffffffe + IL_013a: conv.i + IL_013b: add + IL_013c: stloc.2 + IL_013d: ldloc.1 + IL_013e: ldc.i8 0x1 + IL_0147: conv.i + IL_0148: add + IL_0149: stloc.1 + IL_014a: br.s IL_016c + + IL_014c: ldloc.2 + IL_014d: call void assembly::set_c(native int) + IL_0152: ldloc.2 + IL_0153: ldc.i8 0xfffffffffffffffe + IL_015c: conv.i + IL_015d: add + IL_015e: stloc.2 + IL_015f: ldloc.1 + IL_0160: ldc.i8 0x1 + IL_0169: conv.i + IL_016a: add + IL_016b: stloc.1 + IL_016c: ldloc.1 + IL_016d: ldc.i8 0x0 + IL_0176: conv.i + IL_0177: bgt.un.s IL_014c + + IL_0179: ret + + IL_017a: ldloc.0 + IL_017b: ldc.i8 0x1 + IL_0184: conv.i + IL_0185: add.ovf.un + IL_0186: stloc.1 + IL_0187: ldc.i8 0x0 + IL_0190: conv.i + IL_0191: stloc.2 + IL_0192: ldc.i8 0xa + IL_019b: conv.i + IL_019c: stloc.3 + IL_019d: br.s IL_01bf + + IL_019f: ldloc.3 + IL_01a0: call void assembly::set_c(native int) + IL_01a5: ldloc.3 + IL_01a6: ldc.i8 0xfffffffffffffffe + IL_01af: conv.i + IL_01b0: add + IL_01b1: stloc.3 + IL_01b2: ldloc.2 + IL_01b3: ldc.i8 0x1 + IL_01bc: conv.i + IL_01bd: add + IL_01be: stloc.2 + IL_01bf: ldloc.2 + IL_01c0: ldloc.1 + IL_01c1: blt.un.s IL_019f + + IL_01c3: ret + } + + .property native int c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(native int) + .get native int assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly native int c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stsfld native int ''.$assembly::c@1 + IL_000f: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs new file mode 100644 index 00000000000..e351abab66a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs @@ -0,0 +1,65 @@ +let mutable c = 0y + +let f0 () = + for n in 10y..1y do + c <- n + +let f00 () = + for n in 10y..1y..1y do + c <- n + +let f1 () = + for n in 1y..10y do + c <- n + +let f2y start = + for n in start..10y do + c <- n + +let f3y finish = + for n in 1y..finish do + c <- n + +let f4y (start: sbyte) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1y..1y..10y do + c <- n + +let f6 () = + for n in 1y..2y..10y do + c <- n + +let f7y start = + for n in start..2y..10y do + c <- n + +let f8y step = + for n in 1y..step..10y do + c <- n + +let f9y finish = + for n in 1y..2y..finish do + c <- n + +let f10y (start: sbyte) step finish = + for n in finish..step..finish do + c <- n + +let f11y start finish = + for n in start..0y..finish do + c <- n + +let f12 () = + for n in 1y..0y..10y do + c <- n + +let f13 () = + for n in 10y .. -1y .. 1y do + c <- n + +let f14 () = + for n in 10y .. -2y .. 1y do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl new file mode 100644 index 00000000000..f9244515f3f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl @@ -0,0 +1,728 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static int8 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int8 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(int8 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int8 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (int8 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (int8 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f2y(int8 start) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i2 + IL_000c: ldarg.0 + IL_000d: conv.i2 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(int8) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f3y(int8 finish) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i2 + IL_000a: ldc.i4.1 + IL_000b: conv.i2 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(int8) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f4y(int8 start, + int8 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 (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i2 + IL_000a: ldarg.0 + IL_000b: conv.i2 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(int8) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.2 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7y(int8 start) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0014 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i2 + IL_000c: ldarg.0 + IL_000d: conv.i2 + IL_000e: sub + IL_000f: ldc.i4.2 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: stloc.1 + IL_0017: ldarg.0 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(int8) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret + } + + .method public static void f8y(int8 step) cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + 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_0022 + + IL_0015: ldc.i4.s 10 + IL_0017: conv.i2 + IL_0018: ldc.i4.1 + IL_0019: conv.i2 + IL_001a: sub + IL_001b: ldarg.0 + IL_001c: div.un + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: nop + IL_0020: br.s IL_0024 + + IL_0022: ldc.i4.0 + IL_0023: nop + IL_0024: stloc.0 + IL_0025: ldc.i4.0 + IL_0026: stloc.1 + IL_0027: ldc.i4.1 + IL_0028: stloc.2 + IL_0029: br.s IL_0039 + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(int8) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: ldloc.0 + IL_003b: blt.un.s IL_002b + + IL_003d: ret + } + + .method public static void f9y(int8 finish) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0012 + + IL_0008: ldarg.0 + IL_0009: conv.i2 + IL_000a: ldc.i4.1 + IL_000b: conv.i2 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.1 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(int8) + IL_001f: ldloc.2 + IL_0020: ldc.i4.2 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f10y(int8 start, + int8 step, + int8 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 (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0028 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001c + + IL_0018: ldc.i4.0 + IL_0019: nop + IL_001a: br.s IL_003e + + IL_001c: ldarg.2 + IL_001d: conv.i2 + IL_001e: ldarg.2 + IL_001f: conv.i2 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: nop + IL_0026: br.s IL_003e + + IL_0028: ldarg.2 + IL_0029: ldarg.2 + IL_002a: bge.s IL_0030 + + IL_002c: ldc.i4.0 + IL_002d: nop + IL_002e: br.s IL_003e + + IL_0030: ldarg.2 + IL_0031: conv.i2 + IL_0032: ldarg.2 + IL_0033: conv.i2 + IL_0034: sub + IL_0035: ldarg.1 + IL_0036: not + IL_0037: conv.i2 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: ldc.i4.1 + IL_003c: add + IL_003d: nop + IL_003e: stloc.0 + IL_003f: ldc.i4.0 + IL_0040: stloc.1 + IL_0041: ldarg.2 + IL_0042: stloc.2 + IL_0043: br.s IL_0053 + + IL_0045: ldloc.2 + IL_0046: call void assembly::set_c(int8) + IL_004b: ldloc.2 + IL_004c: ldarg.1 + IL_004d: add + IL_004e: stloc.2 + IL_004f: ldloc.1 + IL_0050: ldc.i4.1 + IL_0051: add + IL_0052: stloc.1 + IL_0053: ldloc.1 + IL_0054: ldloc.0 + IL_0055: blt.un.s IL_0045 + + IL_0057: ret + } + + .method public static void f11y(int8 start, + int8 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_0008: pop + IL_0009: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_0009: pop + IL_000a: ret + } + + .method public static void f13() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.m1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 10 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void f14() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.s -2 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .property int8 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int8) + .get int8 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int8 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int8 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs new file mode 100644 index 00000000000..64028b65394 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs @@ -0,0 +1,57 @@ +let mutable c = 0us + +let f0 () = + for n in 10us..1us do + c <- n + +let f00 () = + for n in 10us..1us..1us do + c <- n + +let f1 () = + for n in 1us..10us do + c <- n + +let f2 start = + for n in start..10us do + c <- n + +let f3 finish = + for n in 1us..finish do + c <- n + +let f4 (start: uint16) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1us..1us..10us do + c <- n + +let f6 () = + for n in 1us..2us..10us do + c <- n + +let f7 start = + for n in start..2us..10us do + c <- n + +let f8 step = + for n in 1us..step..10us do + c <- n + +let f9 finish = + for n in 1us..2us..finish do + c <- n + +let f10 (start: uint16) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0us..finish do + c <- n + +let f12 () = + for n in 1us..0us..10us do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl new file mode 100644 index 00000000000..a3f877906b8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl @@ -0,0 +1,633 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static uint16 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint16 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint16 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint16 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f2(uint16 start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i4 + IL_000c: ldarg.0 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint16) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f3(uint16 finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldc.i4.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(uint16) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f4(uint16 start, + uint16 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 (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i4 + IL_000a: ldarg.0 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(uint16) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.2 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7(uint16 start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0014 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i4 + IL_000c: ldarg.0 + IL_000d: conv.i4 + IL_000e: sub + IL_000f: ldc.i4.2 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: stloc.1 + IL_0017: ldarg.0 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(uint16) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret + } + + .method public static void f8(uint16 step) cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 10 + IL_0013: conv.i4 + IL_0014: ldc.i4.1 + IL_0015: conv.i4 + IL_0016: sub + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stloc.0 + IL_001c: ldc.i4.0 + IL_001d: stloc.1 + IL_001e: ldc.i4.1 + IL_001f: stloc.2 + IL_0020: br.s IL_0030 + + IL_0022: ldloc.2 + IL_0023: call void assembly::set_c(uint16) + IL_0028: ldloc.2 + IL_0029: ldarg.0 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.1 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.1 + IL_0030: ldloc.1 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_0022 + + IL_0034: ret + } + + .method public static void f9(uint16 finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0012 + + IL_0008: ldarg.0 + IL_0009: conv.i4 + IL_000a: ldc.i4.1 + IL_000b: conv.i4 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.1 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint16) + IL_001f: ldloc.2 + IL_0020: ldc.i4.2 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f10(uint16 start, + uint16 step, + uint16 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 (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0018 + + IL_0014: ldc.i4.0 + IL_0015: nop + IL_0016: br.s IL_0022 + + IL_0018: ldarg.2 + IL_0019: conv.i4 + IL_001a: ldarg.2 + IL_001b: conv.i4 + IL_001c: sub + IL_001d: ldarg.1 + IL_001e: div.un + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: nop + IL_0022: stloc.0 + IL_0023: ldc.i4.0 + IL_0024: stloc.1 + IL_0025: ldarg.2 + IL_0026: stloc.2 + IL_0027: br.s IL_0037 + + IL_0029: ldloc.2 + IL_002a: call void assembly::set_c(uint16) + IL_002f: ldloc.2 + IL_0030: ldarg.1 + IL_0031: add + IL_0032: stloc.2 + IL_0033: ldloc.1 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.1 + IL_0037: ldloc.1 + IL_0038: ldloc.0 + IL_0039: blt.un.s IL_0029 + + IL_003b: ret + } + + .method public static void f11(uint16 start, + uint16 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_0008: pop + IL_0009: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_0009: pop + IL_000a: ret + } + + .property uint16 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint16) + .get uint16 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly uint16 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld uint16 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs new file mode 100644 index 00000000000..d689d8d393a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs @@ -0,0 +1,57 @@ +let mutable c = 0u + +let f0 () = + for n in 10u..1u do + c <- n + +let f00 () = + for n in 10u..1u..1u do + c <- n + +let f1 () = + for n in 1u..10u do + c <- n + +let f2 start = + for n in start..10u do + c <- n + +let f3 finish = + for n in 1u..finish do + c <- n + +let f4 (start: uint32) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1u..1u..10u do + c <- n + +let f6 () = + for n in 1u..2u..10u do + c <- n + +let f7 start = + for n in start..2u..10u do + c <- n + +let f8 step = + for n in 1u..step..10u do + c <- n + +let f9 finish = + for n in 1u..2u..finish do + c <- n + +let f10 (start: uint32) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0u..finish do + c <- n + +let f12 () = + for n in 1u..0u..10u do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl new file mode 100644 index 00000000000..e18c7784f63 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl @@ -0,0 +1,673 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static uint32 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint32 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint32 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint32 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.s 10 + IL_0019: conv.i8 + IL_001a: blt.un.s IL_0007 + + IL_001c: ret + } + + .method public static void f2(uint32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0014 + + IL_000a: ldc.i4.s 10 + IL_000c: conv.i8 + IL_000d: ldarg.0 + IL_000e: conv.i8 + IL_000f: sub + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add.ovf.un + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldarg.0 + IL_0019: stloc.2 + IL_001a: br.s IL_002b + + IL_001c: ldloc.2 + IL_001d: call void assembly::set_c(uint32) + 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: ldloc.0 + IL_002d: blt.un.s IL_001c + + IL_002f: ret + } + + .method public static void f3(uint32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add.ovf.un + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldc.i4.1 + IL_0017: stloc.2 + IL_0018: br.s IL_0029 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint32) + 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: ldloc.0 + IL_002b: blt.un.s IL_001a + + IL_002d: ret + } + + .method public static void f4(uint32 start, + uint32 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, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldarg.1 + IL_000a: conv.i8 + IL_000b: ldarg.0 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add.ovf.un + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0029 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint32) + 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: ldloc.0 + IL_002b: blt.un.s IL_001a + + IL_002d: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.s 10 + IL_0019: conv.i8 + IL_001a: blt.un.s IL_0007 + + IL_001c: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.2 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: conv.i8 + IL_0019: blt.un.s IL_0007 + + IL_001b: ret + } + + .method public static void f7(uint32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0017 + + IL_000a: ldc.i4.s 10 + IL_000c: conv.i8 + IL_000d: ldarg.0 + IL_000e: conv.i8 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002e + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint32) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ldloc.1 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001f + + IL_0032: ret + } + + .method public static void f8(uint32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 10 + IL_0013: conv.i8 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: sub + IL_0017: ldarg.0 + IL_0018: conv.i8 + IL_0019: div.un + IL_001a: ldc.i4.1 + IL_001b: conv.i8 + IL_001c: add.ovf.un + IL_001d: stloc.0 + IL_001e: ldc.i4.0 + IL_001f: conv.i8 + IL_0020: stloc.1 + IL_0021: ldc.i4.1 + IL_0022: stloc.2 + IL_0023: br.s IL_0034 + + IL_0025: ldloc.2 + IL_0026: call void assembly::set_c(uint32) + IL_002b: ldloc.2 + IL_002c: ldarg.0 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0025 + + IL_0038: ret + } + + .method public static void f9(uint32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0015 + + IL_0009: ldarg.0 + IL_000a: conv.i8 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 + IL_001a: stloc.2 + IL_001b: br.s IL_002c + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(uint32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001d + + IL_0030: ret + } + + .method public static void f10(uint32 start, + uint32 step, + uint32 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, + uint32 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0025 + + IL_0019: ldarg.2 + IL_001a: conv.i8 + IL_001b: ldarg.2 + IL_001c: conv.i8 + IL_001d: sub + IL_001e: ldarg.1 + IL_001f: conv.i8 + IL_0020: div.un + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add.ovf.un + IL_0024: nop + IL_0025: stloc.0 + IL_0026: ldc.i4.0 + IL_0027: conv.i8 + IL_0028: stloc.1 + IL_0029: ldarg.2 + IL_002a: stloc.2 + IL_002b: br.s IL_003c + + IL_002d: ldloc.2 + IL_002e: call void assembly::set_c(uint32) + IL_0033: ldloc.2 + IL_0034: ldarg.1 + IL_0035: add + IL_0036: stloc.2 + IL_0037: ldloc.1 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: add + IL_003b: stloc.1 + IL_003c: ldloc.1 + IL_003d: ldloc.0 + IL_003e: blt.un.s IL_002d + + IL_0040: ret + } + + .method public static void f11(uint32 start, + uint32 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_0008: pop + IL_0009: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_0009: pop + IL_000a: ret + } + + .property uint32 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint32) + .get uint32 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly uint32 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld uint32 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs new file mode 100644 index 00000000000..2a9b1627344 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs @@ -0,0 +1,57 @@ +let mutable c = 0UL + +let f0 () = + for n in 10UL..1UL do + c <- n + +let f00 () = + for n in 10UL..1UL..1UL do + c <- n + +let f1 () = + for n in 1UL..10UL do + c <- n + +let f2 start = + for n in start..10UL do + c <- n + +let f3 finish = + for n in 1UL..finish do + c <- n + +let f4 (start: uint64) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1UL..1UL..10UL do + c <- n + +let f6 () = + for n in 1UL..2UL..10UL do + c <- n + +let f7 start = + for n in start..2UL..10UL do + c <- n + +let f8 step = + for n in 1UL..step..10UL do + c <- n + +let f9 finish = + for n in 1UL..2UL..finish do + c <- n + +let f10 (start: uint64) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0UL..finish do + c <- n + +let f12 () = + for n in 1UL..0UL..10UL do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl new file mode 100644 index 00000000000..ed358d884c4 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -0,0 +1,834 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static uint64 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint64 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint64 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint64 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(uint64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0009 + + IL_001e: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(uint64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0009 + + IL_001e: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(uint64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.s 10 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0008 + + IL_001e: ret + } + + .method public static void f2(uint64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: ldarg.0 + IL_0004: bge.un.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: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add.ovf.un + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldarg.0 + IL_0019: stloc.2 + IL_001a: br.s IL_002c + + IL_001c: ldloc.2 + IL_001d: call void assembly::set_c(uint64) + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001c + + IL_0030: ret + } + + .method public static void f3(uint64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: conv.i8 + IL_0003: bge.un.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: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add.ovf.un + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: br.s IL_002b + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(uint64) + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + 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: ldloc.0 + IL_002d: blt.un.s IL_001b + + IL_002f: ret + } + + .method public static void f4(uint64 start, + uint64 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, + uint64 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0040 + + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: br.s IL_003a + + IL_002a: ldloc.2 + IL_002b: call void assembly::set_c(uint64) + IL_0030: ldloc.2 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldc.i4.0 + IL_003c: conv.i8 + IL_003d: bgt.un.s IL_002a + + IL_003f: ret + + IL_0040: ldloc.0 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add.ovf.un + IL_0044: stloc.1 + IL_0045: ldc.i4.0 + IL_0046: conv.i8 + IL_0047: stloc.2 + IL_0048: ldarg.0 + IL_0049: stloc.3 + IL_004a: br.s IL_005c + + IL_004c: ldloc.3 + IL_004d: call void assembly::set_c(uint64) + IL_0052: ldloc.3 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.3 + IL_0057: ldloc.2 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.2 + IL_005c: ldloc.2 + IL_005d: ldloc.1 + IL_005e: blt.un.s IL_004c + + IL_0060: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(uint64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.s 10 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0008 + + IL_001e: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(uint64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.2 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f7(uint64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: ldarg.0 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0018 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: conv.i8 + IL_0013: div.un + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add.ovf.un + IL_0017: nop + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: stloc.1 + IL_001c: ldarg.0 + IL_001d: stloc.2 + IL_001e: br.s IL_0030 + + IL_0020: ldloc.2 + IL_0021: call void assembly::set_c(uint64) + IL_0026: ldloc.2 + IL_0027: ldc.i4.2 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.1 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.1 + IL_0030: ldloc.1 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_0020 + + IL_0034: ret + } + + .method public static void f8(uint64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 + + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 9 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: conv.i8 + IL_0018: div.un + IL_0019: stloc.0 + IL_001a: ldloc.0 + IL_001b: ldc.i4.m1 + IL_001c: conv.i8 + IL_001d: bne.un.s IL_004b + + IL_001f: ldc.i4.0 + IL_0020: conv.i8 + IL_0021: stloc.1 + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: call void assembly::set_c(uint64) + IL_002b: ldloc.2 + IL_002c: ldarg.0 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: br.s IL_0045 + + IL_0036: ldloc.2 + IL_0037: call void assembly::set_c(uint64) + IL_003c: ldloc.2 + IL_003d: ldarg.0 + IL_003e: add + IL_003f: stloc.2 + IL_0040: ldloc.1 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.1 + IL_0045: ldloc.1 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: bgt.un.s IL_0036 + + IL_004a: ret + + IL_004b: ldloc.0 + IL_004c: ldc.i4.1 + IL_004d: conv.i8 + IL_004e: add.ovf.un + IL_004f: stloc.1 + IL_0050: ldc.i4.0 + IL_0051: conv.i8 + IL_0052: stloc.2 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: stloc.3 + IL_0056: br.s IL_0067 + + IL_0058: ldloc.3 + IL_0059: call void assembly::set_c(uint64) + IL_005e: ldloc.3 + IL_005f: ldarg.0 + IL_0060: add + IL_0061: stloc.3 + IL_0062: ldloc.2 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: add + IL_0066: stloc.2 + IL_0067: ldloc.2 + IL_0068: ldloc.1 + IL_0069: blt.un.s IL_0058 + + IL_006b: ret + } + + .method public static void f9(uint64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: conv.i8 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0016 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: conv.i8 + IL_0011: div.un + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add.ovf.un + IL_0015: nop + IL_0016: stloc.0 + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: stloc.1 + IL_001a: ldc.i4.1 + IL_001b: conv.i8 + IL_001c: stloc.2 + IL_001d: br.s IL_002f + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint64) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.2 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001f + + IL_0033: ret + } + + .method public static void f10(uint64 start, + uint64 step, + uint64 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, + uint64 V_2, + uint64 V_3) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0020 + + IL_0019: ldarg.2 + IL_001a: ldarg.2 + IL_001b: sub + IL_001c: ldarg.1 + IL_001d: conv.i8 + IL_001e: div.un + IL_001f: nop + IL_0020: stloc.0 + IL_0021: ldloc.0 + IL_0022: ldc.i4.m1 + IL_0023: conv.i8 + IL_0024: bne.un.s IL_0051 + + IL_0026: ldc.i4.0 + IL_0027: conv.i8 + IL_0028: stloc.1 + IL_0029: ldarg.2 + IL_002a: stloc.2 + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(uint64) + IL_0031: ldloc.2 + IL_0032: ldarg.1 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: br.s IL_004b + + IL_003c: ldloc.2 + IL_003d: call void assembly::set_c(uint64) + IL_0042: ldloc.2 + IL_0043: ldarg.1 + IL_0044: add + IL_0045: stloc.2 + IL_0046: ldloc.1 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add + IL_004a: stloc.1 + IL_004b: ldloc.1 + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: bgt.un.s IL_003c + + IL_0050: ret + + IL_0051: ldloc.0 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add.ovf.un + IL_0055: stloc.1 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.2 + IL_0059: ldarg.2 + IL_005a: stloc.3 + IL_005b: br.s IL_006c + + IL_005d: ldloc.3 + IL_005e: call void assembly::set_c(uint64) + IL_0063: ldloc.3 + IL_0064: ldarg.1 + IL_0065: add + IL_0066: stloc.3 + IL_0067: ldloc.2 + IL_0068: ldc.i4.1 + IL_0069: conv.i8 + IL_006a: add + IL_006b: stloc.2 + IL_006c: ldloc.2 + IL_006d: ldloc.1 + IL_006e: blt.un.s IL_005d + + IL_0070: ret + } + + .method public static void f11(uint64 start, + uint64 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0009: pop + IL_000a: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 + IL_0003: conv.i8 + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000c: pop + IL_000d: ret + } + + .property uint64 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint64) + .get uint64 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly uint64 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stsfld uint64 ''.$assembly::c@1 + IL_0007: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs new file mode 100644 index 00000000000..0ec7970c52a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs @@ -0,0 +1,57 @@ +let mutable c = 0un + +let f0 () = + for n in 10un..1un do + c <- n + +let f00 () = + for n in 10un..1un..1un do + c <- n + +let f1 () = + for n in 1un..10un do + c <- n + +let f2 start = + for n in start..10un do + c <- n + +let f3 finish = + for n in 1un..finish do + c <- n + +let f4 (start: unativeint) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1un..1un..10un do + c <- n + +let f6 () = + for n in 1un..2un..10un do + c <- n + +let f7 start = + for n in start..2un..10un do + c <- n + +let f8 step = + for n in 1un..step..10un do + c <- n + +let f9 finish = + for n in 1un..2un..finish do + c <- n + +let f10 (start: unativeint) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0un..finish do + c <- n + +let f12 () = + for n in 1un..0un..10un do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl new file mode 100644 index 00000000000..c2314bb4cb7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -0,0 +1,1007 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static native uint get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld native uint ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(native uint 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld native uint ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stloc.0 + IL_000b: ldc.i8 0xa + IL_0014: conv.u + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native uint) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.u + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.u + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x0 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stloc.0 + IL_000b: ldc.i8 0xa + IL_0014: conv.u + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native uint) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.u + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.u + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x0 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.u + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native uint) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.u + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.u + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0xa + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f2(native uint start) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2, + native uint V_3) + IL_0000: ldc.i8 0xa + IL_0009: conv.u + IL_000a: ldarg.0 + IL_000b: bge.un.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.u + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldc.i8 0xa + IL_0023: conv.u + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_00ae + + IL_0051: ldc.i8 0x0 + IL_005a: conv.u + IL_005b: stloc.1 + IL_005c: ldarg.0 + IL_005d: stloc.2 + IL_005e: ldloc.2 + IL_005f: call void assembly::set_c(native uint) + IL_0064: ldloc.2 + IL_0065: ldc.i8 0x1 + IL_006e: conv.u + IL_006f: add + IL_0070: stloc.2 + IL_0071: ldloc.1 + IL_0072: ldc.i8 0x1 + IL_007b: conv.u + IL_007c: add + IL_007d: stloc.1 + IL_007e: br.s IL_00a0 + + IL_0080: ldloc.2 + IL_0081: call void assembly::set_c(native uint) + IL_0086: ldloc.2 + IL_0087: ldc.i8 0x1 + IL_0090: conv.u + IL_0091: add + IL_0092: stloc.2 + IL_0093: ldloc.1 + IL_0094: ldc.i8 0x1 + IL_009d: conv.u + IL_009e: add + IL_009f: stloc.1 + IL_00a0: ldloc.1 + IL_00a1: ldc.i8 0x0 + IL_00aa: conv.u + IL_00ab: bgt.un.s IL_0080 + + IL_00ad: ret + + IL_00ae: ldloc.0 + IL_00af: ldc.i8 0x1 + IL_00b8: conv.u + IL_00b9: add.ovf.un + IL_00ba: stloc.1 + IL_00bb: ldc.i8 0x0 + IL_00c4: conv.u + IL_00c5: stloc.2 + IL_00c6: ldarg.0 + IL_00c7: stloc.3 + IL_00c8: br.s IL_00ea + + IL_00ca: ldloc.3 + IL_00cb: call void assembly::set_c(native uint) + IL_00d0: ldloc.3 + IL_00d1: ldc.i8 0x1 + IL_00da: conv.u + IL_00db: add + IL_00dc: stloc.3 + IL_00dd: ldloc.2 + IL_00de: ldc.i8 0x1 + IL_00e7: conv.u + IL_00e8: add + IL_00e9: stloc.2 + IL_00ea: ldloc.2 + IL_00eb: ldloc.1 + IL_00ec: blt.un.s IL_00ca + + IL_00ee: ret + } + + .method public static void f3(native uint finish) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2, + native uint V_3) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x1 + IL_000a: conv.u + IL_000b: bge.un.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.u + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.u + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_00b7 + + IL_0051: ldc.i8 0x0 + IL_005a: conv.u + IL_005b: stloc.1 + IL_005c: ldc.i8 0x1 + IL_0065: conv.u + IL_0066: stloc.2 + IL_0067: ldloc.2 + IL_0068: call void assembly::set_c(native uint) + IL_006d: ldloc.2 + IL_006e: ldc.i8 0x1 + IL_0077: conv.u + IL_0078: add + IL_0079: stloc.2 + IL_007a: ldloc.1 + IL_007b: ldc.i8 0x1 + IL_0084: conv.u + IL_0085: add + IL_0086: stloc.1 + IL_0087: br.s IL_00a9 + + IL_0089: ldloc.2 + IL_008a: call void assembly::set_c(native uint) + IL_008f: ldloc.2 + IL_0090: ldc.i8 0x1 + IL_0099: conv.u + IL_009a: add + IL_009b: stloc.2 + IL_009c: ldloc.1 + IL_009d: ldc.i8 0x1 + IL_00a6: conv.u + IL_00a7: add + IL_00a8: stloc.1 + IL_00a9: ldloc.1 + IL_00aa: ldc.i8 0x0 + IL_00b3: conv.u + IL_00b4: bgt.un.s IL_0089 + + IL_00b6: ret + + IL_00b7: ldloc.0 + IL_00b8: ldc.i8 0x1 + IL_00c1: conv.u + IL_00c2: add.ovf.un + IL_00c3: stloc.1 + IL_00c4: ldc.i8 0x0 + IL_00cd: conv.u + IL_00ce: stloc.2 + IL_00cf: ldc.i8 0x1 + IL_00d8: conv.u + IL_00d9: stloc.3 + IL_00da: br.s IL_00fc + + IL_00dc: ldloc.3 + IL_00dd: call void assembly::set_c(native uint) + IL_00e2: ldloc.3 + IL_00e3: ldc.i8 0x1 + IL_00ec: conv.u + IL_00ed: add + IL_00ee: stloc.3 + IL_00ef: ldloc.2 + IL_00f0: ldc.i8 0x1 + IL_00f9: conv.u + IL_00fa: add + IL_00fb: stloc.2 + IL_00fc: ldloc.2 + IL_00fd: ldloc.1 + IL_00fe: blt.un.s IL_00dc + + IL_0100: ret + } + + .method public static void f4(native uint start, + native uint 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 (native uint V_0, + native uint V_1, + native uint V_2, + native uint V_3) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.u + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_009c + + IL_003f: ldc.i8 0x0 + IL_0048: conv.u + IL_0049: stloc.1 + IL_004a: ldarg.0 + IL_004b: stloc.2 + IL_004c: ldloc.2 + IL_004d: call void assembly::set_c(native uint) + IL_0052: ldloc.2 + IL_0053: ldc.i8 0x1 + IL_005c: conv.u + IL_005d: add + IL_005e: stloc.2 + IL_005f: ldloc.1 + IL_0060: ldc.i8 0x1 + IL_0069: conv.u + IL_006a: add + IL_006b: stloc.1 + IL_006c: br.s IL_008e + + IL_006e: ldloc.2 + IL_006f: call void assembly::set_c(native uint) + IL_0074: ldloc.2 + IL_0075: ldc.i8 0x1 + IL_007e: conv.u + IL_007f: add + IL_0080: stloc.2 + IL_0081: ldloc.1 + IL_0082: ldc.i8 0x1 + IL_008b: conv.u + IL_008c: add + IL_008d: stloc.1 + IL_008e: ldloc.1 + IL_008f: ldc.i8 0x0 + IL_0098: conv.u + IL_0099: bgt.un.s IL_006e + + IL_009b: ret + + IL_009c: ldloc.0 + IL_009d: ldc.i8 0x1 + IL_00a6: conv.u + IL_00a7: add.ovf.un + IL_00a8: stloc.1 + IL_00a9: ldc.i8 0x0 + IL_00b2: conv.u + IL_00b3: stloc.2 + IL_00b4: ldarg.0 + IL_00b5: stloc.3 + IL_00b6: br.s IL_00d8 + + IL_00b8: ldloc.3 + IL_00b9: call void assembly::set_c(native uint) + IL_00be: ldloc.3 + IL_00bf: ldc.i8 0x1 + IL_00c8: conv.u + IL_00c9: add + IL_00ca: stloc.3 + IL_00cb: ldloc.2 + IL_00cc: ldc.i8 0x1 + IL_00d5: conv.u + IL_00d6: add + IL_00d7: stloc.2 + IL_00d8: ldloc.2 + IL_00d9: ldloc.1 + IL_00da: blt.un.s IL_00b8 + + IL_00dc: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.u + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native uint) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.u + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.u + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0xa + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.u + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native uint) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x2 + IL_0028: conv.u + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.u + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x5 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f7(native uint start) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldc.i8 0xa + IL_0009: conv.u + IL_000a: ldarg.0 + IL_000b: bge.un.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.u + IL_0017: nop + IL_0018: br.s IL_003d + + IL_001a: ldc.i8 0xa + IL_0023: conv.u + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.u + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.u + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.u + IL_0048: stloc.1 + IL_0049: ldarg.0 + IL_004a: stloc.2 + IL_004b: br.s IL_006d + + IL_004d: ldloc.2 + IL_004e: call void assembly::set_c(native uint) + IL_0053: ldloc.2 + IL_0054: ldc.i8 0x2 + IL_005d: conv.u + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.1 + IL_0061: ldc.i8 0x1 + IL_006a: conv.u + IL_006b: add + IL_006c: stloc.1 + IL_006d: ldloc.1 + IL_006e: ldloc.0 + IL_006f: blt.un.s IL_004d + + IL_0071: ret + } + + .method public static void f8(native uint step) cil managed + { + + .maxstack 5 + .locals init (native uint V_0, + native uint V_1, + native uint V_2, + native uint V_3) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: bne.un.s IL_002b + + IL_000d: ldc.i8 0x1 + IL_0016: conv.u + IL_0017: ldarg.0 + IL_0018: ldc.i8 0xa + IL_0021: conv.u + IL_0022: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0027: pop + IL_0028: nop + IL_0029: br.s IL_002c + + IL_002b: nop + IL_002c: ldc.i8 0xa + IL_0035: conv.u + IL_0036: ldc.i8 0x1 + IL_003f: conv.u + IL_0040: bge.un.s IL_004f + + IL_0042: ldc.i8 0x0 + IL_004b: conv.u + IL_004c: nop + IL_004d: br.s IL_0067 + + IL_004f: ldc.i8 0xa + IL_0058: conv.u + IL_0059: ldc.i8 0x1 + IL_0062: conv.u + IL_0063: sub + IL_0064: ldarg.0 + IL_0065: div.un + IL_0066: nop + IL_0067: stloc.0 + IL_0068: sizeof [runtime]System.IntPtr + IL_006e: ldc.i4.4 + IL_006f: bne.un.s IL_0081 + + IL_0071: ldloc.0 + IL_0072: ldc.i8 0xffffffff + IL_007b: conv.u + IL_007c: ceq + IL_007e: nop + IL_007f: br.s IL_008f + + IL_0081: ldloc.0 + IL_0082: ldc.i8 0xffffffffffffffff + IL_008b: conv.u + IL_008c: ceq + IL_008e: nop + IL_008f: brfalse.s IL_00e5 + + IL_0091: ldc.i8 0x0 + IL_009a: conv.u + IL_009b: stloc.1 + IL_009c: ldc.i8 0x1 + IL_00a5: conv.u + IL_00a6: stloc.2 + IL_00a7: ldloc.2 + IL_00a8: call void assembly::set_c(native uint) + IL_00ad: ldloc.2 + IL_00ae: ldarg.0 + IL_00af: add + IL_00b0: stloc.2 + IL_00b1: ldloc.1 + IL_00b2: ldc.i8 0x1 + IL_00bb: conv.u + IL_00bc: add + IL_00bd: stloc.1 + IL_00be: br.s IL_00d7 + + IL_00c0: ldloc.2 + IL_00c1: call void assembly::set_c(native uint) + IL_00c6: ldloc.2 + IL_00c7: ldarg.0 + IL_00c8: add + IL_00c9: stloc.2 + IL_00ca: ldloc.1 + IL_00cb: ldc.i8 0x1 + IL_00d4: conv.u + IL_00d5: add + IL_00d6: stloc.1 + IL_00d7: ldloc.1 + IL_00d8: ldc.i8 0x0 + IL_00e1: conv.u + IL_00e2: bgt.un.s IL_00c0 + + IL_00e4: ret + + IL_00e5: ldloc.0 + IL_00e6: ldc.i8 0x1 + IL_00ef: conv.u + IL_00f0: add.ovf.un + IL_00f1: stloc.1 + IL_00f2: ldc.i8 0x0 + IL_00fb: conv.u + IL_00fc: stloc.2 + IL_00fd: ldc.i8 0x1 + IL_0106: conv.u + IL_0107: stloc.3 + IL_0108: br.s IL_0121 + + IL_010a: ldloc.3 + IL_010b: call void assembly::set_c(native uint) + IL_0110: ldloc.3 + IL_0111: ldarg.0 + IL_0112: add + IL_0113: stloc.3 + IL_0114: ldloc.2 + IL_0115: ldc.i8 0x1 + IL_011e: conv.u + IL_011f: add + IL_0120: stloc.2 + IL_0121: ldloc.2 + IL_0122: ldloc.1 + IL_0123: blt.un.s IL_010a + + IL_0125: ret + } + + .method public static void f9(native uint finish) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x1 + IL_000a: conv.u + IL_000b: bge.un.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.u + IL_0017: nop + IL_0018: br.s IL_003d + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.u + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.u + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.u + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.u + IL_0048: stloc.1 + IL_0049: ldc.i8 0x1 + IL_0052: conv.u + IL_0053: stloc.2 + IL_0054: br.s IL_0076 + + IL_0056: ldloc.2 + IL_0057: call void assembly::set_c(native uint) + IL_005c: ldloc.2 + IL_005d: ldc.i8 0x2 + IL_0066: conv.u + IL_0067: add + IL_0068: stloc.2 + IL_0069: ldloc.1 + IL_006a: ldc.i8 0x1 + IL_0073: conv.u + IL_0074: add + IL_0075: stloc.1 + IL_0076: ldloc.1 + IL_0077: ldloc.0 + IL_0078: blt.un.s IL_0056 + + IL_007a: ret + } + + .method public static void f10(native uint start, + native uint step, + native uint 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 (native uint V_0, + native uint V_1, + native uint V_2, + native uint V_3) + IL_0000: ldarg.1 + IL_0001: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: bne.un.s IL_0019 + + IL_000d: ldarg.2 + IL_000e: ldarg.1 + IL_000f: ldarg.2 + IL_0010: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0015: pop + IL_0016: nop + IL_0017: br.s IL_001a + + IL_0019: nop + IL_001a: ldarg.2 + IL_001b: ldarg.2 + IL_001c: bge.un.s IL_002b + + IL_001e: ldc.i8 0x0 + IL_0027: conv.u + IL_0028: nop + IL_0029: br.s IL_0031 + + IL_002b: ldarg.2 + IL_002c: ldarg.2 + IL_002d: sub + IL_002e: ldarg.1 + IL_002f: div.un + IL_0030: nop + IL_0031: stloc.0 + IL_0032: sizeof [runtime]System.IntPtr + IL_0038: ldc.i4.4 + IL_0039: bne.un.s IL_004b + + IL_003b: ldloc.0 + IL_003c: ldc.i8 0xffffffff + IL_0045: conv.u + IL_0046: ceq + IL_0048: nop + IL_0049: br.s IL_0059 + + IL_004b: ldloc.0 + IL_004c: ldc.i8 0xffffffffffffffff + IL_0055: conv.u + IL_0056: ceq + IL_0058: nop + IL_0059: brfalse.s IL_00a6 + + IL_005b: ldc.i8 0x0 + IL_0064: conv.u + IL_0065: stloc.1 + IL_0066: ldarg.2 + IL_0067: stloc.2 + IL_0068: ldloc.2 + IL_0069: call void assembly::set_c(native uint) + IL_006e: ldloc.2 + IL_006f: ldarg.1 + IL_0070: add + IL_0071: stloc.2 + IL_0072: ldloc.1 + IL_0073: ldc.i8 0x1 + IL_007c: conv.u + IL_007d: add + IL_007e: stloc.1 + IL_007f: br.s IL_0098 + + IL_0081: ldloc.2 + IL_0082: call void assembly::set_c(native uint) + IL_0087: ldloc.2 + IL_0088: ldarg.1 + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.1 + IL_008c: ldc.i8 0x1 + IL_0095: conv.u + IL_0096: add + IL_0097: stloc.1 + IL_0098: ldloc.1 + IL_0099: ldc.i8 0x0 + IL_00a2: conv.u + IL_00a3: bgt.un.s IL_0081 + + IL_00a5: ret + + IL_00a6: ldloc.0 + IL_00a7: ldc.i8 0x1 + IL_00b0: conv.u + IL_00b1: add.ovf.un + IL_00b2: stloc.1 + IL_00b3: ldc.i8 0x0 + IL_00bc: conv.u + IL_00bd: stloc.2 + IL_00be: ldarg.2 + IL_00bf: stloc.3 + IL_00c0: br.s IL_00d9 + + IL_00c2: ldloc.3 + IL_00c3: call void assembly::set_c(native uint) + IL_00c8: ldloc.3 + IL_00c9: ldarg.1 + IL_00ca: add + IL_00cb: stloc.3 + IL_00cc: ldloc.2 + IL_00cd: ldc.i8 0x1 + IL_00d6: conv.u + IL_00d7: add + IL_00d8: stloc.2 + IL_00d9: ldloc.2 + IL_00da: ldloc.1 + IL_00db: blt.un.s IL_00c2 + + IL_00dd: ret + } + + .method public static void f11(native uint start, + native uint 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 8 + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0011: pop + IL_0012: ret + } + + .method public static void f12() cil managed + { + + .maxstack 8 + IL_0000: ldc.i8 0x1 + IL_0009: conv.u + IL_000a: ldc.i8 0x0 + IL_0013: conv.u + IL_0014: ldc.i8 0xa + IL_001d: conv.u + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0023: pop + IL_0024: ret + } + + .property native uint c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(native uint) + .get native uint assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly native uint c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stsfld native uint ''.$assembly::c@1 + IL_000f: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs index 7b2b94f3c16..a780e5ff4cb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs @@ -134,3 +134,79 @@ module ForLoop = compilation |> verifyCompilation + // SOURCE=ForEachRangeStepSByte.fs SCFLAGS="--optimize+" # ForEachRangeStepSByte.fs --optimize+ + [] + let ``ForEachRangeStepSByte_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepByte.fs SCFLAGS="--optimize+" # ForEachRangeStepByte.fs --optimize+ + [] + let ``ForEachRangeStepByte_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepChar.fs SCFLAGS="--optimize+" # ForEachRangeStepChar.fs --optimize+ + [] + let ``ForEachRangeStepChar_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt16.fs SCFLAGS="--optimize+" # ForEachRangeStepInt16.fs --optimize+ + [] + let ``ForEachRangeStepInt16_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt16.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt16.fs --optimize+ + [] + let ``ForEachRangeStepUInt16_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt32.fs SCFLAGS="--optimize+" # ForEachRangeStepInt32.fs --optimize+ + [] + let ``ForEachRangeStepInt32_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt32.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt32.fs --optimize+ + [] + let ``ForEachRangeStepUInt32_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt64.fs SCFLAGS="--optimize+" # ForEachRangeStepInt64.fs --optimize+ + [] + let ``ForEachRangeStepInt64_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt64.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt64.fs --optimize+ + [] + let ``ForEachRangeStepUInt64_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepIntPtr.fs SCFLAGS="--optimize+" # ForEachRangeStepIntPtr.fs --optimize+ + [] + let ``ForEachRangeStepIntPtr_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUIntPtr.fs SCFLAGS="--optimize+" # ForEachRangeStepUIntPtr.fs --optimize+ + [] + let ``ForEachRangeStepUIntPtr_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl index 19cb73a18d0..00b93f1edd6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -221,7 +221,7 @@ IL_005a: sub IL_005b: ldc.i4.1 IL_005c: conv.i8 - IL_005d: add + IL_005d: add.ovf.un IL_005e: nop IL_005f: stloc.1 IL_0060: ldc.i4.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index 19cb73a18d0..00b93f1edd6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -221,7 +221,7 @@ IL_005a: sub IL_005b: ldc.i4.1 IL_005c: conv.i8 - IL_005d: add + IL_005d: add.ovf.un IL_005e: nop IL_005f: stloc.1 IL_0060: ldc.i4.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl index 575c04908a1..11d0b805ea1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -221,7 +221,7 @@ IL_005a: sub IL_005b: ldc.i4.1 IL_005c: conv.i8 - IL_005d: add + IL_005d: add.ovf.un IL_005e: nop IL_005f: stloc.1 IL_0060: ldc.i4.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index 575c04908a1..11d0b805ea1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -221,7 +221,7 @@ IL_005a: sub IL_005b: ldc.i4.1 IL_005c: conv.i8 - IL_005d: add + IL_005d: add.ovf.un IL_005e: nop IL_005f: stloc.1 IL_0060: ldc.i4.0 diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 97dd669bc92..b07b0d43999 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -1110,47 +1110,26 @@ module RangeTests = let ``Range.UInt32`` () = RangeTestsHelpers.unsigned 0u 1u System.UInt32.MinValue System.UInt32.MaxValue [] - let ``Range.Int64`` () = - ignore <| Assert.Throws(fun () -> for n in Int64.MinValue..Int64.MaxValue do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in Int64.MinValue..1L..Int64.MaxValue do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in Int64.MaxValue .. -1L .. Int64.MinValue do ignore (float n ** float n)) - RangeTestsHelpers.signed 0L 1L System.Int64.MinValue System.Int64.MaxValue + let ``Range.Int64`` () = RangeTestsHelpers.signed 0L 1L System.Int64.MinValue System.Int64.MaxValue [] - let ``Range.UInt64`` () = - ignore <| Assert.Throws(fun () -> for n in UInt64.MinValue..UInt64.MaxValue do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in UInt64.MinValue..1UL..UInt64.MaxValue do ignore (float n ** float n)) - RangeTestsHelpers.unsigned 0UL 1UL System.UInt64.MinValue System.UInt64.MaxValue + let ``Range.UInt64`` () = RangeTestsHelpers.unsigned 0UL 1UL System.UInt64.MinValue System.UInt64.MaxValue [] let ``Range.IntPtr`` () = // 0x80000000n is negative on x86, but would be positive on x64. if System.IntPtr.Size = 4 then - ignore <| Assert.Throws(fun () -> for n in 0x80000000n..0x7fffffffn do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in 0x80000000n..0x1n..0x7fffffffn do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in 0x7fffffffn .. 0xffffffffn .. 0x80000000n do ignore (float n ** float n)) RangeTestsHelpers.signed 0x0n 0x1n 0x80000000n 0x7fffffffn if System.IntPtr.Size = 8 then - ignore <| Assert.Throws(fun () -> for n in 0x8000000000000000n..0x7fffffffffffffffn do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in 0x8000000000000000n..0x1n..0x7fffffffffffffffn do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in 0x7fffffffffffffffn .. 0xffffffffffffffffn .. 0x8000000000000000n do ignore (float n ** float n)) RangeTestsHelpers.signed 0x0n 0x1n 0x8000000000000000n 0x7fffffffffffffffn [] let ``Range.UIntPtr`` () = if System.UIntPtr.Size >= 4 then - if System.UIntPtr.Size = 4 then - ignore <| Assert.Throws(fun () -> for n in 0x0un..0xffffffffun do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in 0x0un..0x1un..0xffffffffun do ignore (float n ** float n)) - RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffun if System.UIntPtr.Size >= 8 then - if System.UIntPtr.Size = 8 then - ignore <| Assert.Throws(fun () -> for n in 0x0un..0xffffffffffffffffun do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in 0x0un..0x1un..0xffffffffffffffffun do ignore (float n ** float n)) - RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffffffffffun /// These tests' arguments are intentionally _not_ inlined @@ -1209,15 +1188,10 @@ module RangeTests = [] let ``Range.Int64`` (zero: int64) (one: int64) (min0: int64) (max0: int64) = - ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in max0 .. -one .. min0 do ignore (float n ** float n)) RangeTestsHelpers.signed zero one min0 max0 [] let ``Range.UInt64`` (zero: uint64) (one: uint64) (min0: uint64) (max0: uint64) = - ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) RangeTestsHelpers.unsigned zero one min0 max0 [] @@ -1225,16 +1199,10 @@ module RangeTests = // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. if System.IntPtr.Size = 4 then let zero, one, min0, max0 = System.IntPtr 0, System.IntPtr 1, System.IntPtr System.Int32.MinValue, System.IntPtr System.Int32.MaxValue - ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in max0 .. -one .. min0 do ignore (float n ** float n)) RangeTestsHelpers.signed zero one min0 max0 if System.IntPtr.Size = 8 then let zero, one, min0, max0 = System.IntPtr 0, System.IntPtr 1, System.IntPtr System.Int64.MinValue, System.IntPtr System.Int64.MaxValue - ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in max0 .. -one .. min0 do ignore (float n ** float n)) RangeTestsHelpers.signed zero one min0 max0 [] @@ -1242,20 +1210,10 @@ module RangeTests = // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. if System.UIntPtr.Size >= 4 then let zero, one, min0, max0 = System.UIntPtr 0u, System.UIntPtr 1u, System.UIntPtr System.UInt32.MinValue, System.UIntPtr System.UInt32.MaxValue - - if System.UIntPtr.Size = 4 then - ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) - RangeTestsHelpers.unsigned zero one min0 max0 if System.UIntPtr.Size >= 8 then let zero, one, min0, max0 = System.UIntPtr 0u, System.UIntPtr 1u, System.UIntPtr System.UInt64.MinValue, System.UIntPtr System.UInt64.MaxValue - - if System.UIntPtr.Size = 8 then - ignore <| Assert.Throws(fun () -> for n in min0..max0 do ignore (float n ** float n)) - ignore <| Assert.Throws(fun () -> for n in min0..one..max0 do ignore (float n ** float n)) - RangeTestsHelpers.unsigned zero one min0 max0 open NonStructuralComparison From c045c975694b0193ac2e745f479d538d2462d3e3 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 27 Feb 2024 13:36:48 -0500 Subject: [PATCH 52/66] Add more comprehensive IL tests * Better to have 'em. --- .../ComputedCollections/Int32RangeArrays.fs | 2 +- .../Int32RangeArrays.fs.il.bsl | 1347 +++++----- .../ComputedCollections/Int32RangeLists.fs | 2 +- .../ComputedCollections/UInt64RangeArrays.fs | 2 +- .../UInt64RangeArrays.fs.il.bsl | 2365 ++++++++--------- .../ComputedCollections/UInt64RangeLists.fs | 2 +- .../UInt64RangeLists.fs.il.bsl | 953 +++---- .../EmittedIL/ForLoop/ForEachRangeStepByte.fs | 57 + .../ForEachRangeStepByte.fs.opt.il.bsl | 677 +++++ .../ForEachRangeStepChar.fs.opt.il.bsl | 72 +- .../ForEachRangeStepInt16.fs.opt.il.bsl | 72 +- .../ForEachRangeStepInt32.fs.opt.il.bsl | 72 +- .../ForEachRangeStepInt64.fs.opt.il.bsl | 362 ++- .../ForEachRangeStepIntPtr.fs.opt.il.bsl | 729 +++-- .../ForEachRangeStepSByte.fs.opt.il.bsl | 72 +- .../ForEachRangeStepUInt16.fs.opt.il.bsl | 72 +- .../ForEachRangeStepUInt32.fs.opt.il.bsl | 72 +- .../ForEachRangeStepUInt64.fs.opt.il.bsl | 313 ++- .../ForEachRangeStepUIntPtr.fs.opt.il.bsl | 459 ++-- ...ionSteppingTest07.fs.il.net472.release.bsl | 4 +- ...onSteppingTest07.fs.il.netcore.release.bsl | 4 +- .../FSharp.Compiler.ComponentTests.fsproj | 1 + 22 files changed, 4595 insertions(+), 3116 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs index 6c862181398..6d51226e87d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs @@ -22,4 +22,4 @@ let f21 f g = [|f ()..g()|] let f22 f = [|f ()..1..10|] let f23 f = [|1..f ()..10|] let f24 f = [|1..1..f ()|] -let f25 f g h= [|f ()..g ()..h ()|] +let f25 f g h = [|f ()..g ()..h ()|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl index 4698da12f75..c3949d99dc9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl @@ -282,9 +282,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldc.i4.s 10 IL_0003: ldarg.0 @@ -306,44 +307,46 @@ IL_0014: nop IL_0015: stloc.0 IL_0016: ldloc.0 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret - IL_0021: ldloc.0 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.Int32 - IL_0028: stloc.1 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.2 - IL_002c: ldarg.0 + IL_0023: ldloc.1 + IL_0024: conv.ovf.i.un + IL_0025: newarr [runtime]System.Int32 + IL_002a: stloc.2 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 IL_002d: stloc.3 - IL_002e: br.s IL_003e - - IL_0030: ldloc.1 - IL_0031: ldloc.2 - IL_0032: conv.i - IL_0033: ldloc.3 - IL_0034: stelem.i4 - IL_0035: ldloc.3 - IL_0036: ldc.i4.1 - IL_0037: add - IL_0038: stloc.3 - IL_0039: ldloc.2 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 + IL_002e: ldarg.0 + IL_002f: stloc.s V_4 + IL_0031: br.s IL_0044 + + IL_0033: ldloc.2 + IL_0034: ldloc.3 + IL_0035: conv.i + IL_0036: ldloc.s V_4 + IL_0038: stelem.i4 + IL_0039: ldloc.s V_4 + IL_003b: ldc.i4.1 IL_003c: add - IL_003d: stloc.2 - IL_003e: ldloc.2 - IL_003f: ldloc.0 - IL_0040: blt.un.s IL_0030 + IL_003d: stloc.s V_4 + IL_003f: ldloc.3 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.3 + IL_0044: ldloc.3 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0033 - IL_0042: ldloc.1 - IL_0043: ret + IL_0048: ldloc.2 + IL_0049: ret } .method public static int32[] f10(int32 finish) cil managed @@ -351,9 +354,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldc.i4.1 @@ -375,44 +379,46 @@ IL_0012: nop IL_0013: stloc.0 IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: conv.i8 - IL_0017: bge.un.s IL_001f - - IL_0019: call !!0[] [runtime]System.Array::Empty() - IL_001e: ret - - IL_001f: ldloc.0 - IL_0020: conv.ovf.i.un - IL_0021: newarr [runtime]System.Int32 - IL_0026: stloc.1 - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.2 - IL_002a: ldc.i4.1 + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.Int32 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 IL_002b: stloc.3 - IL_002c: br.s IL_003c - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: conv.i - IL_0031: ldloc.3 - IL_0032: stelem.i4 - IL_0033: ldloc.3 - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.3 - IL_0037: ldloc.2 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 + IL_002c: ldc.i4.1 + IL_002d: stloc.s V_4 + IL_002f: br.s IL_0042 + + IL_0031: ldloc.2 + IL_0032: ldloc.3 + IL_0033: conv.i + IL_0034: ldloc.s V_4 + IL_0036: stelem.i4 + IL_0037: ldloc.s V_4 + IL_0039: ldc.i4.1 IL_003a: add - IL_003b: stloc.2 - IL_003c: ldloc.2 - IL_003d: ldloc.0 - IL_003e: blt.un.s IL_002e + IL_003b: stloc.s V_4 + IL_003d: ldloc.3 + IL_003e: ldc.i4.1 + IL_003f: conv.i8 + IL_0040: add + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: ldloc.0 + IL_0044: blt.un.s IL_0031 - IL_0040: ldloc.1 - IL_0041: ret + IL_0046: ldloc.2 + IL_0047: ret } .method public static int32[] f11(int32 start, @@ -422,9 +428,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -446,44 +453,46 @@ IL_0012: nop IL_0013: stloc.0 IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: conv.i8 - IL_0017: bge.un.s IL_001f - - IL_0019: call !!0[] [runtime]System.Array::Empty() - IL_001e: ret - - IL_001f: ldloc.0 - IL_0020: conv.ovf.i.un - IL_0021: newarr [runtime]System.Int32 - IL_0026: stloc.1 - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.2 - IL_002a: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.Int32 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 IL_002b: stloc.3 - IL_002c: br.s IL_003c - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: conv.i - IL_0031: ldloc.3 - IL_0032: stelem.i4 - IL_0033: ldloc.3 - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.3 - IL_0037: ldloc.2 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 + IL_002c: ldarg.0 + IL_002d: stloc.s V_4 + IL_002f: br.s IL_0042 + + IL_0031: ldloc.2 + IL_0032: ldloc.3 + IL_0033: conv.i + IL_0034: ldloc.s V_4 + IL_0036: stelem.i4 + IL_0037: ldloc.s V_4 + IL_0039: ldc.i4.1 IL_003a: add - IL_003b: stloc.2 - IL_003c: ldloc.2 - IL_003d: ldloc.0 - IL_003e: blt.un.s IL_002e + IL_003b: stloc.s V_4 + IL_003d: ldloc.3 + IL_003e: ldc.i4.1 + IL_003f: conv.i8 + IL_0040: add + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: ldloc.0 + IL_0044: blt.un.s IL_0031 - IL_0040: ldloc.1 - IL_0041: ret + IL_0046: ldloc.2 + IL_0047: ret } .method public static int32[] f12(int32 start) cil managed @@ -491,9 +500,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldc.i4.s 10 IL_0003: ldarg.0 @@ -515,44 +525,46 @@ IL_0014: nop IL_0015: stloc.0 IL_0016: ldloc.0 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret - IL_0021: ldloc.0 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.Int32 - IL_0028: stloc.1 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.2 - IL_002c: ldarg.0 + IL_0023: ldloc.1 + IL_0024: conv.ovf.i.un + IL_0025: newarr [runtime]System.Int32 + IL_002a: stloc.2 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 IL_002d: stloc.3 - IL_002e: br.s IL_003e - - IL_0030: ldloc.1 - IL_0031: ldloc.2 - IL_0032: conv.i - IL_0033: ldloc.3 - IL_0034: stelem.i4 - IL_0035: ldloc.3 - IL_0036: ldc.i4.1 - IL_0037: add - IL_0038: stloc.3 - IL_0039: ldloc.2 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 + IL_002e: ldarg.0 + IL_002f: stloc.s V_4 + IL_0031: br.s IL_0044 + + IL_0033: ldloc.2 + IL_0034: ldloc.3 + IL_0035: conv.i + IL_0036: ldloc.s V_4 + IL_0038: stelem.i4 + IL_0039: ldloc.s V_4 + IL_003b: ldc.i4.1 IL_003c: add - IL_003d: stloc.2 - IL_003e: ldloc.2 - IL_003f: ldloc.0 - IL_0040: blt.un.s IL_0030 + IL_003d: stloc.s V_4 + IL_003f: ldloc.3 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.3 + IL_0044: ldloc.3 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0033 - IL_0042: ldloc.1 - IL_0043: ret + IL_0048: ldloc.2 + IL_0049: ret } .method public static int32[] f13(int32 step) cil managed @@ -560,9 +572,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: brtrue.s IL_0011 @@ -633,44 +646,46 @@ IL_004a: nop IL_004b: stloc.0 IL_004c: ldloc.0 - IL_004d: ldc.i4.1 - IL_004e: conv.i8 - IL_004f: bge.un.s IL_0057 - - IL_0051: call !!0[] [runtime]System.Array::Empty() - IL_0056: ret - - IL_0057: ldloc.0 - IL_0058: conv.ovf.i.un - IL_0059: newarr [runtime]System.Int32 - IL_005e: stloc.1 - IL_005f: ldc.i4.0 - IL_0060: conv.i8 - IL_0061: stloc.2 - IL_0062: ldc.i4.1 + IL_004d: stloc.1 + IL_004e: ldloc.1 + IL_004f: ldc.i4.1 + IL_0050: conv.i8 + IL_0051: bge.un.s IL_0059 + + IL_0053: call !!0[] [runtime]System.Array::Empty() + IL_0058: ret + + IL_0059: ldloc.1 + IL_005a: conv.ovf.i.un + IL_005b: newarr [runtime]System.Int32 + IL_0060: stloc.2 + IL_0061: ldc.i4.0 + IL_0062: conv.i8 IL_0063: stloc.3 - IL_0064: br.s IL_0074 - - IL_0066: ldloc.1 - IL_0067: ldloc.2 - IL_0068: conv.i - IL_0069: ldloc.3 - IL_006a: stelem.i4 - IL_006b: ldloc.3 - IL_006c: ldarg.0 - IL_006d: add - IL_006e: stloc.3 - IL_006f: ldloc.2 - IL_0070: ldc.i4.1 - IL_0071: conv.i8 + IL_0064: ldc.i4.1 + IL_0065: stloc.s V_4 + IL_0067: br.s IL_007a + + IL_0069: ldloc.2 + IL_006a: ldloc.3 + IL_006b: conv.i + IL_006c: ldloc.s V_4 + IL_006e: stelem.i4 + IL_006f: ldloc.s V_4 + IL_0071: ldarg.0 IL_0072: add - IL_0073: stloc.2 - IL_0074: ldloc.2 - IL_0075: ldloc.0 - IL_0076: blt.un.s IL_0066 + IL_0073: stloc.s V_4 + IL_0075: ldloc.3 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.3 + IL_007a: ldloc.3 + IL_007b: ldloc.0 + IL_007c: blt.un.s IL_0069 - IL_0078: ldloc.1 - IL_0079: ret + IL_007e: ldloc.2 + IL_007f: ret } .method public static int32[] f14(int32 finish) cil managed @@ -678,9 +693,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldc.i4.1 @@ -702,44 +718,46 @@ IL_0012: nop IL_0013: stloc.0 IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: conv.i8 - IL_0017: bge.un.s IL_001f - - IL_0019: call !!0[] [runtime]System.Array::Empty() - IL_001e: ret - - IL_001f: ldloc.0 - IL_0020: conv.ovf.i.un - IL_0021: newarr [runtime]System.Int32 - IL_0026: stloc.1 - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.2 - IL_002a: ldc.i4.1 + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.Int32 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 IL_002b: stloc.3 - IL_002c: br.s IL_003c - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: conv.i - IL_0031: ldloc.3 - IL_0032: stelem.i4 - IL_0033: ldloc.3 - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.3 - IL_0037: ldloc.2 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 + IL_002c: ldc.i4.1 + IL_002d: stloc.s V_4 + IL_002f: br.s IL_0042 + + IL_0031: ldloc.2 + IL_0032: ldloc.3 + IL_0033: conv.i + IL_0034: ldloc.s V_4 + IL_0036: stelem.i4 + IL_0037: ldloc.s V_4 + IL_0039: ldc.i4.1 IL_003a: add - IL_003b: stloc.2 - IL_003c: ldloc.2 - IL_003d: ldloc.0 - IL_003e: blt.un.s IL_002e + IL_003b: stloc.s V_4 + IL_003d: ldloc.3 + IL_003e: ldc.i4.1 + IL_003f: conv.i8 + IL_0040: add + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: ldloc.0 + IL_0044: blt.un.s IL_0031 - IL_0040: ldloc.1 - IL_0041: ret + IL_0046: ldloc.2 + IL_0047: ret } .method public static int32[] f15(int32 start, @@ -749,9 +767,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.1 IL_0002: brtrue.s IL_0011 @@ -822,44 +841,46 @@ IL_004a: nop IL_004b: stloc.0 IL_004c: ldloc.0 - IL_004d: ldc.i4.1 - IL_004e: conv.i8 - IL_004f: bge.un.s IL_0057 - - IL_0051: call !!0[] [runtime]System.Array::Empty() - IL_0056: ret - - IL_0057: ldloc.0 - IL_0058: conv.ovf.i.un - IL_0059: newarr [runtime]System.Int32 - IL_005e: stloc.1 - IL_005f: ldc.i4.0 - IL_0060: conv.i8 - IL_0061: stloc.2 - IL_0062: ldarg.0 + IL_004d: stloc.1 + IL_004e: ldloc.1 + IL_004f: ldc.i4.1 + IL_0050: conv.i8 + IL_0051: bge.un.s IL_0059 + + IL_0053: call !!0[] [runtime]System.Array::Empty() + IL_0058: ret + + IL_0059: ldloc.1 + IL_005a: conv.ovf.i.un + IL_005b: newarr [runtime]System.Int32 + IL_0060: stloc.2 + IL_0061: ldc.i4.0 + IL_0062: conv.i8 IL_0063: stloc.3 - IL_0064: br.s IL_0074 - - IL_0066: ldloc.1 - IL_0067: ldloc.2 - IL_0068: conv.i - IL_0069: ldloc.3 - IL_006a: stelem.i4 - IL_006b: ldloc.3 - IL_006c: ldarg.1 - IL_006d: add - IL_006e: stloc.3 - IL_006f: ldloc.2 - IL_0070: ldc.i4.1 - IL_0071: conv.i8 + IL_0064: ldarg.0 + IL_0065: stloc.s V_4 + IL_0067: br.s IL_007a + + IL_0069: ldloc.2 + IL_006a: ldloc.3 + IL_006b: conv.i + IL_006c: ldloc.s V_4 + IL_006e: stelem.i4 + IL_006f: ldloc.s V_4 + IL_0071: ldarg.1 IL_0072: add - IL_0073: stloc.2 - IL_0074: ldloc.2 - IL_0075: ldloc.0 - IL_0076: blt.un.s IL_0066 + IL_0073: stloc.s V_4 + IL_0075: ldloc.3 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.3 + IL_007a: ldloc.3 + IL_007b: ldloc.0 + IL_007c: blt.un.s IL_0069 - IL_0078: ldloc.1 - IL_0079: ret + IL_007e: ldloc.2 + IL_007f: ret } .method public static int32[] f16(int32 start, @@ -869,9 +890,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -893,44 +915,46 @@ IL_0012: nop IL_0013: stloc.0 IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: conv.i8 - IL_0017: bge.un.s IL_001f - - IL_0019: call !!0[] [runtime]System.Array::Empty() - IL_001e: ret - - IL_001f: ldloc.0 - IL_0020: conv.ovf.i.un - IL_0021: newarr [runtime]System.Int32 - IL_0026: stloc.1 - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.2 - IL_002a: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.Int32 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 IL_002b: stloc.3 - IL_002c: br.s IL_003c - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: conv.i - IL_0031: ldloc.3 - IL_0032: stelem.i4 - IL_0033: ldloc.3 - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.3 - IL_0037: ldloc.2 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 + IL_002c: ldarg.0 + IL_002d: stloc.s V_4 + IL_002f: br.s IL_0042 + + IL_0031: ldloc.2 + IL_0032: ldloc.3 + IL_0033: conv.i + IL_0034: ldloc.s V_4 + IL_0036: stelem.i4 + IL_0037: ldloc.s V_4 + IL_0039: ldc.i4.1 IL_003a: add - IL_003b: stloc.2 - IL_003c: ldloc.2 - IL_003d: ldloc.0 - IL_003e: blt.un.s IL_002e + IL_003b: stloc.s V_4 + IL_003d: ldloc.3 + IL_003e: ldc.i4.1 + IL_003f: conv.i8 + IL_0040: add + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: ldloc.0 + IL_0044: blt.un.s IL_0031 - IL_0040: ldloc.1 - IL_0041: ret + IL_0046: ldloc.2 + IL_0047: ret } .method public static int32[] f17(int32 step, @@ -940,9 +964,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: brtrue.s IL_0010 @@ -1013,44 +1038,46 @@ IL_0045: nop IL_0046: stloc.0 IL_0047: ldloc.0 - IL_0048: ldc.i4.1 - IL_0049: conv.i8 - IL_004a: bge.un.s IL_0052 - - IL_004c: call !!0[] [runtime]System.Array::Empty() - IL_0051: ret - - IL_0052: ldloc.0 - IL_0053: conv.ovf.i.un - IL_0054: newarr [runtime]System.Int32 - IL_0059: stloc.1 - IL_005a: ldc.i4.0 - IL_005b: conv.i8 - IL_005c: stloc.2 - IL_005d: ldc.i4.1 + IL_0048: stloc.1 + IL_0049: ldloc.1 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: bge.un.s IL_0054 + + IL_004e: call !!0[] [runtime]System.Array::Empty() + IL_0053: ret + + IL_0054: ldloc.1 + IL_0055: conv.ovf.i.un + IL_0056: newarr [runtime]System.Int32 + IL_005b: stloc.2 + IL_005c: ldc.i4.0 + IL_005d: conv.i8 IL_005e: stloc.3 - IL_005f: br.s IL_006f - - IL_0061: ldloc.1 - IL_0062: ldloc.2 - IL_0063: conv.i - IL_0064: ldloc.3 - IL_0065: stelem.i4 - IL_0066: ldloc.3 - IL_0067: ldarg.0 - IL_0068: add - IL_0069: stloc.3 - IL_006a: ldloc.2 - IL_006b: ldc.i4.1 - IL_006c: conv.i8 + IL_005f: ldc.i4.1 + IL_0060: stloc.s V_4 + IL_0062: br.s IL_0075 + + IL_0064: ldloc.2 + IL_0065: ldloc.3 + IL_0066: conv.i + IL_0067: ldloc.s V_4 + IL_0069: stelem.i4 + IL_006a: ldloc.s V_4 + IL_006c: ldarg.0 IL_006d: add - IL_006e: stloc.2 - IL_006f: ldloc.2 - IL_0070: ldloc.0 - IL_0071: blt.un.s IL_0061 + IL_006e: stloc.s V_4 + IL_0070: ldloc.3 + IL_0071: ldc.i4.1 + IL_0072: conv.i8 + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.3 + IL_0076: ldloc.0 + IL_0077: blt.un.s IL_0064 - IL_0073: ldloc.1 - IL_0074: ret + IL_0079: ldloc.2 + IL_007a: ret } .method public static int32[] f18(int32 start, @@ -1062,9 +1089,10 @@ .maxstack 5 .locals init (uint64 V_0, - int32[] V_1, - uint64 V_2, - int32 V_3) + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.1 IL_0002: brtrue.s IL_0010 @@ -1135,44 +1163,46 @@ IL_0045: nop IL_0046: stloc.0 IL_0047: ldloc.0 - IL_0048: ldc.i4.1 - IL_0049: conv.i8 - IL_004a: bge.un.s IL_0052 - - IL_004c: call !!0[] [runtime]System.Array::Empty() - IL_0051: ret - - IL_0052: ldloc.0 - IL_0053: conv.ovf.i.un - IL_0054: newarr [runtime]System.Int32 - IL_0059: stloc.1 - IL_005a: ldc.i4.0 - IL_005b: conv.i8 - IL_005c: stloc.2 - IL_005d: ldarg.0 + IL_0048: stloc.1 + IL_0049: ldloc.1 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: bge.un.s IL_0054 + + IL_004e: call !!0[] [runtime]System.Array::Empty() + IL_0053: ret + + IL_0054: ldloc.1 + IL_0055: conv.ovf.i.un + IL_0056: newarr [runtime]System.Int32 + IL_005b: stloc.2 + IL_005c: ldc.i4.0 + IL_005d: conv.i8 IL_005e: stloc.3 - IL_005f: br.s IL_006f - - IL_0061: ldloc.1 - IL_0062: ldloc.2 - IL_0063: conv.i - IL_0064: ldloc.3 - IL_0065: stelem.i4 - IL_0066: ldloc.3 - IL_0067: ldarg.1 - IL_0068: add - IL_0069: stloc.3 - IL_006a: ldloc.2 - IL_006b: ldc.i4.1 - IL_006c: conv.i8 + IL_005f: ldarg.0 + IL_0060: stloc.s V_4 + IL_0062: br.s IL_0075 + + IL_0064: ldloc.2 + IL_0065: ldloc.3 + IL_0066: conv.i + IL_0067: ldloc.s V_4 + IL_0069: stelem.i4 + IL_006a: ldloc.s V_4 + IL_006c: ldarg.1 IL_006d: add - IL_006e: stloc.2 - IL_006f: ldloc.2 - IL_0070: ldloc.0 - IL_0071: blt.un.s IL_0061 + IL_006e: stloc.s V_4 + IL_0070: ldloc.3 + IL_0071: ldc.i4.1 + IL_0072: conv.i8 + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.3 + IL_0076: ldloc.0 + IL_0077: blt.un.s IL_0064 - IL_0073: ldloc.1 - IL_0074: ret + IL_0079: ldloc.2 + IL_007a: ret } .method public static int32[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1181,9 +1211,10 @@ .maxstack 5 .locals init (int32 V_0, uint64 V_1, - int32[] V_2, - uint64 V_3, - int32 V_4) + uint64 V_2, + int32[] V_3, + uint64 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) @@ -1208,44 +1239,46 @@ IL_001b: nop IL_001c: stloc.1 IL_001d: ldloc.1 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0028 + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: bge.un.s IL_002a - IL_0022: call !!0[] [runtime]System.Array::Empty() - IL_0027: ret + IL_0024: call !!0[] [runtime]System.Array::Empty() + IL_0029: ret - IL_0028: ldloc.1 - IL_0029: conv.ovf.i.un - IL_002a: newarr [runtime]System.Int32 - IL_002f: stloc.2 - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: stloc.3 - IL_0033: ldloc.0 + IL_002a: ldloc.2 + IL_002b: conv.ovf.i.un + IL_002c: newarr [runtime]System.Int32 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: conv.i8 IL_0034: stloc.s V_4 - IL_0036: br.s IL_0049 + IL_0036: ldloc.0 + IL_0037: stloc.s V_5 + IL_0039: br.s IL_004f - IL_0038: ldloc.2 - IL_0039: ldloc.3 - IL_003a: conv.i - IL_003b: ldloc.s V_4 - IL_003d: stelem.i4 - IL_003e: ldloc.s V_4 - IL_0040: ldc.i4.1 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.3 - IL_0045: ldc.i4.1 - IL_0046: conv.i8 - IL_0047: add - IL_0048: stloc.3 - IL_0049: ldloc.3 - IL_004a: ldloc.1 - IL_004b: blt.un.s IL_0038 - - IL_004d: ldloc.2 - IL_004e: ret + IL_003b: ldloc.3 + IL_003c: ldloc.s V_4 + IL_003e: conv.i + IL_003f: ldloc.s V_5 + IL_0041: stelem.i4 + IL_0042: ldloc.s V_5 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.s V_5 + IL_0048: ldloc.s V_4 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: add + IL_004d: stloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: ldloc.1 + IL_0052: blt.un.s IL_003b + + IL_0054: ldloc.3 + IL_0055: ret } .method public static int32[] f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1254,9 +1287,10 @@ .maxstack 5 .locals init (int32 V_0, uint64 V_1, - int32[] V_2, - uint64 V_3, - int32 V_4) + uint64 V_2, + int32[] V_3, + uint64 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) @@ -1281,44 +1315,46 @@ IL_0019: nop IL_001a: stloc.1 IL_001b: ldloc.1 - IL_001c: ldc.i4.1 - IL_001d: conv.i8 - IL_001e: bge.un.s IL_0026 - - IL_0020: call !!0[] [runtime]System.Array::Empty() - IL_0025: ret - - IL_0026: ldloc.1 - IL_0027: conv.ovf.i.un - IL_0028: newarr [runtime]System.Int32 - IL_002d: stloc.2 - IL_002e: ldc.i4.0 - IL_002f: conv.i8 - IL_0030: stloc.3 - IL_0031: ldc.i4.1 - IL_0032: stloc.s V_4 - IL_0034: br.s IL_0047 + IL_001c: stloc.2 + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 - IL_0036: ldloc.2 - IL_0037: ldloc.3 - IL_0038: conv.i - IL_0039: ldloc.s V_4 - 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.1 - IL_0049: blt.un.s IL_0036 + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.2 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.Int32 + IL_002f: stloc.3 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: stloc.s V_5 + IL_0037: br.s IL_004d - IL_004b: ldloc.2 - IL_004c: ret + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: conv.i + IL_003d: ldloc.s V_5 + IL_003f: stelem.i4 + IL_0040: ldloc.s V_5 + IL_0042: ldc.i4.1 + IL_0043: add + IL_0044: stloc.s V_5 + IL_0046: ldloc.s V_4 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.s V_4 + IL_004f: ldloc.1 + IL_0050: blt.un.s IL_0039 + + IL_0052: ldloc.3 + IL_0053: ret } .method public static int32[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1330,9 +1366,10 @@ .locals init (int32 V_0, int32 V_1, uint64 V_2, - int32[] V_3, - uint64 V_4, - int32 V_5) + uint64 V_3, + int32[] V_4, + uint64 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) @@ -1361,44 +1398,46 @@ IL_0021: nop IL_0022: stloc.2 IL_0023: ldloc.2 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: bge.un.s IL_002e - - IL_0028: call !!0[] [runtime]System.Array::Empty() - IL_002d: ret - - IL_002e: ldloc.2 - IL_002f: conv.ovf.i.un - IL_0030: newarr [runtime]System.Int32 - IL_0035: stloc.3 - IL_0036: ldc.i4.0 - IL_0037: conv.i8 - IL_0038: stloc.s V_4 - IL_003a: ldloc.0 - IL_003b: stloc.s V_5 - IL_003d: br.s IL_0053 + IL_0024: stloc.3 + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: bge.un.s IL_0030 - IL_003f: ldloc.3 - IL_0040: ldloc.s V_4 - IL_0042: conv.i - IL_0043: ldloc.s V_5 - IL_0045: stelem.i4 - IL_0046: ldloc.s V_5 - IL_0048: ldc.i4.1 - IL_0049: add - IL_004a: stloc.s V_5 - IL_004c: ldloc.s V_4 - IL_004e: ldc.i4.1 - IL_004f: conv.i8 - IL_0050: add - IL_0051: stloc.s V_4 - IL_0053: ldloc.s V_4 - IL_0055: ldloc.2 - IL_0056: blt.un.s IL_003f + IL_002a: call !!0[] [runtime]System.Array::Empty() + IL_002f: ret - IL_0058: ldloc.3 - IL_0059: ret + IL_0030: ldloc.3 + IL_0031: conv.ovf.i.un + IL_0032: newarr [runtime]System.Int32 + IL_0037: stloc.s V_4 + IL_0039: ldc.i4.0 + IL_003a: conv.i8 + IL_003b: stloc.s V_5 + IL_003d: ldloc.0 + IL_003e: stloc.s V_6 + IL_0040: br.s IL_0057 + + IL_0042: ldloc.s V_4 + IL_0044: ldloc.s V_5 + IL_0046: conv.i + IL_0047: ldloc.s V_6 + IL_0049: stelem.i4 + IL_004a: ldloc.s V_6 + IL_004c: ldc.i4.1 + IL_004d: add + IL_004e: stloc.s V_6 + IL_0050: ldloc.s V_5 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.s V_5 + IL_0057: ldloc.s V_5 + IL_0059: ldloc.2 + IL_005a: blt.un.s IL_0042 + + IL_005c: ldloc.s V_4 + IL_005e: ret } .method public static int32[] f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1407,9 +1446,10 @@ .maxstack 5 .locals init (int32 V_0, uint64 V_1, - int32[] V_2, - uint64 V_3, - int32 V_4) + uint64 V_2, + int32[] V_3, + uint64 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) @@ -1434,44 +1474,46 @@ IL_001b: nop IL_001c: stloc.1 IL_001d: ldloc.1 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0028 + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: bge.un.s IL_002a - IL_0022: call !!0[] [runtime]System.Array::Empty() - IL_0027: ret + IL_0024: call !!0[] [runtime]System.Array::Empty() + IL_0029: ret - IL_0028: ldloc.1 - IL_0029: conv.ovf.i.un - IL_002a: newarr [runtime]System.Int32 - IL_002f: stloc.2 - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: stloc.3 - IL_0033: ldloc.0 + IL_002a: ldloc.2 + IL_002b: conv.ovf.i.un + IL_002c: newarr [runtime]System.Int32 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: conv.i8 IL_0034: stloc.s V_4 - IL_0036: br.s IL_0049 + IL_0036: ldloc.0 + IL_0037: stloc.s V_5 + IL_0039: br.s IL_004f - IL_0038: ldloc.2 - IL_0039: ldloc.3 - IL_003a: conv.i - IL_003b: ldloc.s V_4 - IL_003d: stelem.i4 - IL_003e: ldloc.s V_4 - IL_0040: ldc.i4.1 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.3 - IL_0045: ldc.i4.1 - IL_0046: conv.i8 - IL_0047: add - IL_0048: stloc.3 - IL_0049: ldloc.3 - IL_004a: ldloc.1 - IL_004b: blt.un.s IL_0038 - - IL_004d: ldloc.2 - IL_004e: ret + IL_003b: ldloc.3 + IL_003c: ldloc.s V_4 + IL_003e: conv.i + IL_003f: ldloc.s V_5 + IL_0041: stelem.i4 + IL_0042: ldloc.s V_5 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.s V_5 + IL_0048: ldloc.s V_4 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: add + IL_004d: stloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: ldloc.1 + IL_0052: blt.un.s IL_003b + + IL_0054: ldloc.3 + IL_0055: ret } .method public static int32[] f23(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1480,9 +1522,10 @@ .maxstack 5 .locals init (int32 V_0, uint64 V_1, - int32[] V_2, - uint64 V_3, - int32 V_4) + uint64 V_2, + int32[] V_3, + uint64 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) @@ -1556,44 +1599,46 @@ IL_0051: nop IL_0052: stloc.1 IL_0053: ldloc.1 - IL_0054: ldc.i4.1 - IL_0055: conv.i8 - IL_0056: bge.un.s IL_005e - - IL_0058: call !!0[] [runtime]System.Array::Empty() - IL_005d: ret - - IL_005e: ldloc.1 - IL_005f: conv.ovf.i.un - IL_0060: newarr [runtime]System.Int32 - IL_0065: stloc.2 - IL_0066: ldc.i4.0 - IL_0067: conv.i8 - IL_0068: stloc.3 - IL_0069: ldc.i4.1 + IL_0054: stloc.2 + IL_0055: ldloc.2 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: bge.un.s IL_0060 + + IL_005a: call !!0[] [runtime]System.Array::Empty() + IL_005f: ret + + IL_0060: ldloc.2 + IL_0061: conv.ovf.i.un + IL_0062: newarr [runtime]System.Int32 + IL_0067: stloc.3 + IL_0068: ldc.i4.0 + IL_0069: conv.i8 IL_006a: stloc.s V_4 - IL_006c: br.s IL_007f - - IL_006e: ldloc.2 - IL_006f: ldloc.3 - IL_0070: conv.i - IL_0071: ldloc.s V_4 - IL_0073: stelem.i4 - IL_0074: ldloc.s V_4 - IL_0076: ldloc.0 - 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.1 - IL_0081: blt.un.s IL_006e - - IL_0083: ldloc.2 - IL_0084: ret + IL_006c: ldc.i4.1 + IL_006d: stloc.s V_5 + IL_006f: br.s IL_0085 + + IL_0071: ldloc.3 + IL_0072: ldloc.s V_4 + IL_0074: conv.i + IL_0075: ldloc.s V_5 + IL_0077: stelem.i4 + IL_0078: ldloc.s V_5 + IL_007a: ldloc.0 + IL_007b: add + IL_007c: stloc.s V_5 + IL_007e: ldloc.s V_4 + IL_0080: ldc.i4.1 + IL_0081: conv.i8 + IL_0082: add + IL_0083: stloc.s V_4 + IL_0085: ldloc.s V_4 + IL_0087: ldloc.1 + IL_0088: blt.un.s IL_0071 + + IL_008a: ldloc.3 + IL_008b: ret } .method public static int32[] f24(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1602,9 +1647,10 @@ .maxstack 5 .locals init (int32 V_0, uint64 V_1, - int32[] V_2, - uint64 V_3, - int32 V_4) + uint64 V_2, + int32[] V_3, + uint64 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) @@ -1629,44 +1675,46 @@ IL_0019: nop IL_001a: stloc.1 IL_001b: ldloc.1 - IL_001c: ldc.i4.1 - IL_001d: conv.i8 - IL_001e: bge.un.s IL_0026 - - IL_0020: call !!0[] [runtime]System.Array::Empty() - IL_0025: ret - - IL_0026: ldloc.1 - IL_0027: conv.ovf.i.un - IL_0028: newarr [runtime]System.Int32 - IL_002d: stloc.2 - IL_002e: ldc.i4.0 - IL_002f: conv.i8 - IL_0030: stloc.3 - IL_0031: ldc.i4.1 - IL_0032: stloc.s V_4 - IL_0034: br.s IL_0047 + IL_001c: stloc.2 + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 - IL_0036: ldloc.2 - IL_0037: ldloc.3 - IL_0038: conv.i - IL_0039: ldloc.s V_4 - 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.1 - IL_0049: blt.un.s IL_0036 + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.2 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.Int32 + IL_002f: stloc.3 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: stloc.s V_5 + IL_0037: br.s IL_004d - IL_004b: ldloc.2 - IL_004c: ret + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: conv.i + IL_003d: ldloc.s V_5 + IL_003f: stelem.i4 + IL_0040: ldloc.s V_5 + IL_0042: ldc.i4.1 + IL_0043: add + IL_0044: stloc.s V_5 + IL_0046: ldloc.s V_4 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.s V_4 + IL_004f: ldloc.1 + IL_0050: blt.un.s IL_0039 + + IL_0052: ldloc.3 + IL_0053: ret } .method public static int32[] f25(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1681,9 +1729,10 @@ int32 V_1, int32 V_2, uint64 V_3, - int32[] V_4, - uint64 V_5, - int32 V_6) + uint64 V_4, + int32[] V_5, + uint64 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) @@ -1765,44 +1814,46 @@ IL_005c: nop IL_005d: stloc.3 IL_005e: ldloc.3 - IL_005f: ldc.i4.1 - IL_0060: conv.i8 - IL_0061: bge.un.s IL_0069 - - IL_0063: call !!0[] [runtime]System.Array::Empty() - IL_0068: ret - - IL_0069: ldloc.3 - IL_006a: conv.ovf.i.un - IL_006b: newarr [runtime]System.Int32 - IL_0070: stloc.s V_4 - IL_0072: ldc.i4.0 - IL_0073: conv.i8 - IL_0074: stloc.s V_5 - IL_0076: ldloc.0 - IL_0077: stloc.s V_6 - IL_0079: br.s IL_0090 - - IL_007b: ldloc.s V_4 - IL_007d: ldloc.s V_5 - IL_007f: conv.i - IL_0080: ldloc.s V_6 - IL_0082: stelem.i4 - IL_0083: ldloc.s V_6 - IL_0085: ldloc.1 - IL_0086: add - IL_0087: stloc.s V_6 - IL_0089: ldloc.s V_5 - IL_008b: ldc.i4.1 - IL_008c: conv.i8 - IL_008d: add - IL_008e: stloc.s V_5 - IL_0090: ldloc.s V_5 - IL_0092: ldloc.3 - IL_0093: blt.un.s IL_007b - - IL_0095: ldloc.s V_4 - IL_0097: ret + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: bge.un.s IL_006d + + IL_0067: call !!0[] [runtime]System.Array::Empty() + IL_006c: ret + + IL_006d: ldloc.s V_4 + IL_006f: conv.ovf.i.un + IL_0070: newarr [runtime]System.Int32 + IL_0075: stloc.s V_5 + IL_0077: ldc.i4.0 + IL_0078: conv.i8 + IL_0079: stloc.s V_6 + IL_007b: ldloc.0 + IL_007c: stloc.s V_7 + IL_007e: br.s IL_0095 + + IL_0080: ldloc.s V_5 + IL_0082: ldloc.s V_6 + IL_0084: conv.i + IL_0085: ldloc.s V_7 + IL_0087: stelem.i4 + IL_0088: ldloc.s V_7 + IL_008a: ldloc.1 + IL_008b: add + IL_008c: stloc.s V_7 + IL_008e: ldloc.s V_6 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add + IL_0093: stloc.s V_6 + IL_0095: ldloc.s V_6 + IL_0097: ldloc.3 + IL_0098: blt.un.s IL_0080 + + IL_009a: ldloc.s V_5 + IL_009c: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs index 37ab02c314b..8e67d795f65 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs @@ -22,4 +22,4 @@ let f21 f g = [f ()..g()] let f22 f = [f ()..1..10] let f23 f = [1..f ()..10] let f24 f = [1..1..f ()] -let f25 f g h= [f ()..g ()..h ()] +let f25 f g h = [f ()..g ()..h ()] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs index fd23cacc03d..21fa8db2428 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs @@ -19,4 +19,4 @@ let f18 (f: unit -> uint64) g = [|f ()..g()|] let f19 f = [|f ()..1UL..10UL|] let f20 f = [|1UL..f ()..10UL|] let f21 f = [|1UL..1UL..f ()|] -let f22 (f: unit -> uint64) g h= [|f ()..g ()..h ()|] +let f22 (f: unit -> uint64) g h = [|f ()..g ()..h ()|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl index 2bd26ed98f3..fb3e440b1aa 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl @@ -196,9 +196,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64[] V_1, - uint64 V_2, - uint64 V_3) + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) IL_0000: nop IL_0001: ldc.i4.s 10 IL_0003: conv.i8 @@ -220,45 +221,47 @@ IL_0014: nop IL_0015: stloc.0 IL_0016: ldloc.0 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret - IL_0021: ldloc.0 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.UInt64 - IL_0028: stloc.1 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.2 - IL_002c: ldarg.0 + IL_0023: ldloc.1 + IL_0024: conv.ovf.i.un + IL_0025: newarr [runtime]System.UInt64 + IL_002a: stloc.2 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 IL_002d: stloc.3 - IL_002e: br.s IL_003f + IL_002e: ldarg.0 + IL_002f: stloc.s V_4 + IL_0031: br.s IL_0045 - IL_0030: ldloc.1 - IL_0031: ldloc.2 - IL_0032: conv.i - IL_0033: ldloc.3 - IL_0034: stelem.i8 - IL_0035: ldloc.3 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.2 + IL_0033: ldloc.2 + IL_0034: ldloc.3 + IL_0035: conv.i + IL_0036: ldloc.s V_4 + IL_0038: stelem.i8 + IL_0039: ldloc.s V_4 IL_003b: ldc.i4.1 IL_003c: conv.i8 IL_003d: add - IL_003e: stloc.2 - IL_003f: ldloc.2 - IL_0040: ldloc.0 - IL_0041: blt.un.s IL_0030 + 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_0033 - IL_0043: ldloc.1 - IL_0044: ret + IL_0049: ldloc.2 + IL_004a: ret } .method public static uint64[] f7(uint64 finish) cil managed @@ -266,9 +269,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64[] V_1, - uint64 V_2, - uint64 V_3) + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldc.i4.1 @@ -290,46 +294,48 @@ IL_0012: nop IL_0013: stloc.0 IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: conv.i8 - IL_0017: bge.un.s IL_001f + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 - IL_0019: call !!0[] [runtime]System.Array::Empty() - IL_001e: ret + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret - IL_001f: ldloc.0 - IL_0020: conv.ovf.i.un - IL_0021: newarr [runtime]System.UInt64 - IL_0026: stloc.1 - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.2 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: stloc.3 - IL_002d: br.s IL_003e - - IL_002f: ldloc.1 - IL_0030: ldloc.2 - IL_0031: conv.i - IL_0032: ldloc.3 - IL_0033: stelem.i8 - IL_0034: ldloc.3 - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: add - IL_0038: stloc.3 - IL_0039: ldloc.2 + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.UInt64 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.3 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0044 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i8 + IL_0038: ldloc.s V_4 IL_003a: ldc.i4.1 IL_003b: conv.i8 IL_003c: add - IL_003d: stloc.2 - IL_003e: ldloc.2 - IL_003f: ldloc.0 - IL_0040: blt.un.s IL_002f + IL_003d: stloc.s V_4 + IL_003f: ldloc.3 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.3 + IL_0044: ldloc.3 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0032 - IL_0042: ldloc.1 - IL_0043: ret + IL_0048: ldloc.2 + IL_0049: ret } .method public static uint64[] f8(uint64 start, @@ -340,10 +346,11 @@ .maxstack 5 .locals init (uint64 V_0, bool V_1, - uint64[] V_2, - uint64 V_3, + uint64 V_2, + uint64[] V_3, uint64 V_4, - uint64 V_5) + uint64 V_5, + uint64 V_6) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -364,106 +371,129 @@ IL_0011: conv.i8 IL_0012: ceq IL_0014: stloc.1 - IL_0015: ldloc.0 - IL_0016: ldc.i4.1 - IL_0017: conv.i8 - IL_0018: add.ovf.un - IL_0019: ldc.i4.1 + IL_0015: ldarg.1 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 IL_001a: conv.i8 - IL_001b: bge.un.s IL_0023 + IL_001b: nop + IL_001c: br.s IL_0025 - IL_001d: call !!0[] [runtime]System.Array::Empty() - IL_0022: ret + IL_001e: ldarg.1 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add.ovf.un + IL_0024: nop + IL_0025: stloc.2 + IL_0026: ldloc.2 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: bge.un.s IL_0031 - IL_0023: ldloc.0 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: add.ovf.un - IL_0027: conv.ovf.i.un - IL_0028: newarr [runtime]System.UInt64 - IL_002d: stloc.2 - IL_002e: ldloc.1 - IL_002f: brfalse.s IL_0065 - - IL_0031: ldc.i4.0 - IL_0032: conv.i8 - IL_0033: stloc.3 - IL_0034: ldarg.0 - IL_0035: stloc.s V_4 - IL_0037: ldloc.2 - IL_0038: ldloc.3 - IL_0039: conv.i - IL_003a: ldloc.s V_4 - IL_003c: stelem.i8 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.3 - IL_0045: ldc.i4.1 - IL_0046: conv.i8 - IL_0047: add - IL_0048: stloc.3 - IL_0049: br.s IL_005d + IL_002b: call !!0[] [runtime]System.Array::Empty() + IL_0030: ret - IL_004b: ldloc.2 - IL_004c: ldloc.3 - IL_004d: conv.i - IL_004e: ldloc.s V_4 - IL_0050: stelem.i8 + IL_0031: ldloc.2 + IL_0032: conv.ovf.i.un + IL_0033: newarr [runtime]System.UInt64 + IL_0038: stloc.3 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_0078 + + IL_003c: ldc.i4.0 + IL_003d: conv.i8 + IL_003e: stloc.s V_4 + IL_0040: ldarg.0 + IL_0041: stloc.s V_5 + IL_0043: ldloc.3 + IL_0044: ldloc.s V_4 + IL_0046: conv.i + IL_0047: ldloc.s V_5 + IL_0049: stelem.i8 + IL_004a: ldloc.s V_5 + IL_004c: ldc.i4.1 + IL_004d: conv.i8 + IL_004e: add + IL_004f: stloc.s V_5 IL_0051: ldloc.s V_4 IL_0053: ldc.i4.1 IL_0054: conv.i8 IL_0055: add IL_0056: stloc.s V_4 - IL_0058: ldloc.3 - IL_0059: ldc.i4.1 - IL_005a: conv.i8 - IL_005b: add - IL_005c: stloc.3 - IL_005d: ldloc.3 - IL_005e: ldc.i4.0 - IL_005f: conv.i8 - IL_0060: bgt.un.s IL_004b + IL_0058: br.s IL_006f - IL_0062: nop - IL_0063: br.s IL_008e - - IL_0065: ldloc.0 - IL_0066: ldc.i4.1 - IL_0067: conv.i8 - IL_0068: add.ovf.un - IL_0069: stloc.3 - IL_006a: ldc.i4.0 + IL_005a: ldloc.3 + IL_005b: ldloc.s V_4 + IL_005d: conv.i + IL_005e: ldloc.s V_5 + IL_0060: stelem.i8 + IL_0061: ldloc.s V_5 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: add + IL_0066: stloc.s V_5 + IL_0068: ldloc.s V_4 + IL_006a: ldc.i4.1 IL_006b: conv.i8 - IL_006c: stloc.s V_4 - IL_006e: ldarg.0 - IL_006f: stloc.s V_5 - IL_0071: br.s IL_0088 - - IL_0073: ldloc.2 - IL_0074: ldloc.s V_4 - IL_0076: conv.i - IL_0077: ldloc.s V_5 - IL_0079: stelem.i8 - IL_007a: ldloc.s V_5 - IL_007c: ldc.i4.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.s V_4 + IL_0071: ldc.i4.0 + IL_0072: conv.i8 + IL_0073: bgt.un.s IL_005a + + IL_0075: nop + IL_0076: br.s IL_00af + + IL_0078: ldarg.1 + IL_0079: ldarg.0 + IL_007a: bge.un.s IL_0081 + + IL_007c: ldc.i4.0 IL_007d: conv.i8 - IL_007e: add - IL_007f: stloc.s V_5 - IL_0081: ldloc.s V_4 - IL_0083: ldc.i4.1 - IL_0084: conv.i8 - IL_0085: add - IL_0086: stloc.s V_4 - IL_0088: ldloc.s V_4 - IL_008a: ldloc.3 - IL_008b: blt.un.s IL_0073 - - IL_008d: nop - IL_008e: ldloc.2 - IL_008f: ret + IL_007e: nop + IL_007f: br.s IL_0088 + + IL_0081: ldarg.1 + IL_0082: ldarg.0 + IL_0083: sub + IL_0084: ldc.i4.1 + IL_0085: conv.i8 + IL_0086: add.ovf.un + IL_0087: nop + IL_0088: stloc.s V_4 + IL_008a: ldc.i4.0 + IL_008b: conv.i8 + IL_008c: stloc.s V_5 + IL_008e: ldarg.0 + IL_008f: stloc.s V_6 + IL_0091: br.s IL_00a8 + + IL_0093: ldloc.3 + IL_0094: ldloc.s V_5 + IL_0096: conv.i + IL_0097: ldloc.s V_6 + IL_0099: stelem.i8 + IL_009a: ldloc.s V_6 + IL_009c: ldc.i4.1 + IL_009d: conv.i8 + IL_009e: add + IL_009f: stloc.s V_6 + IL_00a1: ldloc.s V_5 + IL_00a3: ldc.i4.1 + IL_00a4: conv.i8 + IL_00a5: add + IL_00a6: stloc.s V_5 + IL_00a8: ldloc.s V_5 + IL_00aa: ldloc.s V_4 + IL_00ac: blt.un.s IL_0093 + + IL_00ae: nop + IL_00af: ldloc.3 + IL_00b0: ret } .method public static uint64[] f9(uint64 start) cil managed @@ -471,9 +501,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64[] V_1, - uint64 V_2, - uint64 V_3) + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) IL_0000: nop IL_0001: ldc.i4.s 10 IL_0003: conv.i8 @@ -495,45 +526,47 @@ IL_0014: nop IL_0015: stloc.0 IL_0016: ldloc.0 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret - IL_0021: ldloc.0 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.UInt64 - IL_0028: stloc.1 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.2 - IL_002c: ldarg.0 + IL_0023: ldloc.1 + IL_0024: conv.ovf.i.un + IL_0025: newarr [runtime]System.UInt64 + IL_002a: stloc.2 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 IL_002d: stloc.3 - IL_002e: br.s IL_003f + IL_002e: ldarg.0 + IL_002f: stloc.s V_4 + IL_0031: br.s IL_0045 - IL_0030: ldloc.1 - IL_0031: ldloc.2 - IL_0032: conv.i - IL_0033: ldloc.3 - IL_0034: stelem.i8 - IL_0035: ldloc.3 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.2 + IL_0033: ldloc.2 + IL_0034: ldloc.3 + IL_0035: conv.i + IL_0036: ldloc.s V_4 + IL_0038: stelem.i8 + IL_0039: ldloc.s V_4 IL_003b: ldc.i4.1 IL_003c: conv.i8 IL_003d: add - IL_003e: stloc.2 - IL_003f: ldloc.2 - IL_0040: ldloc.0 - IL_0041: blt.un.s IL_0030 + 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_0033 - IL_0043: ldloc.1 - IL_0044: ret + IL_0049: ldloc.2 + IL_004a: ret } .method public static uint64[] f10(uint64 step) cil managed @@ -541,11 +574,10 @@ .maxstack 5 .locals init (uint64 V_0, - bool V_1, + uint64 V_1, uint64[] V_2, uint64 V_3, - uint64 V_4, - uint64 V_5) + uint64 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: brtrue.s IL_0013 @@ -572,7 +604,7 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_002a + IL_001e: br.s IL_002d IL_0020: ldc.i4.s 10 IL_0022: conv.i8 @@ -582,112 +614,53 @@ IL_0026: ldarg.0 IL_0027: conv.i8 IL_0028: div.un - IL_0029: nop - IL_002a: stloc.0 - IL_002b: ldloc.0 - IL_002c: ldc.i4.m1 - IL_002d: conv.i8 - IL_002e: ceq - IL_0030: stloc.1 - IL_0031: ldloc.0 - IL_0032: ldc.i4.1 - IL_0033: conv.i8 - IL_0034: add.ovf.un - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: bge.un.s IL_003f - - IL_0039: call !!0[] [runtime]System.Array::Empty() - IL_003e: ret - - IL_003f: ldloc.0 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: add.ovf.un - IL_0043: conv.ovf.i.un - IL_0044: newarr [runtime]System.UInt64 - IL_0049: stloc.2 - IL_004a: ldloc.1 - IL_004b: brfalse.s IL_0080 - - IL_004d: ldc.i4.0 - IL_004e: conv.i8 - IL_004f: stloc.3 - IL_0050: ldc.i4.1 - IL_0051: conv.i8 - IL_0052: stloc.s V_4 - IL_0054: ldloc.2 - IL_0055: ldloc.3 - IL_0056: conv.i - IL_0057: ldloc.s V_4 - IL_0059: stelem.i8 - IL_005a: ldloc.s V_4 - IL_005c: ldarg.0 - IL_005d: add - IL_005e: stloc.s V_4 - IL_0060: ldloc.3 - IL_0061: ldc.i4.1 - IL_0062: conv.i8 - IL_0063: add - IL_0064: stloc.3 - IL_0065: br.s IL_0078 - - IL_0067: ldloc.2 - IL_0068: ldloc.3 - IL_0069: conv.i - IL_006a: ldloc.s V_4 - IL_006c: stelem.i8 - 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: ldc.i4.0 - IL_007a: conv.i8 - IL_007b: bgt.un.s IL_0067 - - IL_007d: nop - IL_007e: br.s IL_00a9 - - IL_0080: ldloc.0 - IL_0081: ldc.i4.1 - IL_0082: conv.i8 - IL_0083: add.ovf.un - IL_0084: stloc.3 - IL_0085: ldc.i4.0 - IL_0086: conv.i8 - IL_0087: stloc.s V_4 - IL_0089: ldc.i4.1 - IL_008a: conv.i8 - IL_008b: stloc.s V_5 - IL_008d: br.s IL_00a3 - - IL_008f: ldloc.2 - IL_0090: ldloc.s V_4 - IL_0092: conv.i - IL_0093: ldloc.s V_5 - IL_0095: stelem.i8 - IL_0096: ldloc.s V_5 - IL_0098: ldarg.0 - IL_0099: add - IL_009a: stloc.s V_5 - IL_009c: ldloc.s V_4 - IL_009e: ldc.i4.1 - IL_009f: conv.i8 - IL_00a0: add - IL_00a1: stloc.s V_4 - IL_00a3: ldloc.s V_4 - IL_00a5: ldloc.3 - IL_00a6: blt.un.s IL_008f + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add.ovf.un + IL_002c: nop + IL_002d: stloc.0 + IL_002e: ldloc.0 + IL_002f: stloc.1 + IL_0030: ldloc.1 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: bge.un.s IL_003b + + IL_0035: call !!0[] [runtime]System.Array::Empty() + IL_003a: ret + + IL_003b: ldloc.1 + IL_003c: conv.ovf.i.un + IL_003d: newarr [runtime]System.UInt64 + IL_0042: stloc.2 + IL_0043: ldc.i4.0 + IL_0044: conv.i8 + IL_0045: stloc.3 + IL_0046: ldc.i4.1 + IL_0047: conv.i8 + IL_0048: stloc.s V_4 + IL_004a: br.s IL_005d + + IL_004c: ldloc.2 + IL_004d: ldloc.3 + IL_004e: conv.i + IL_004f: ldloc.s V_4 + IL_0051: stelem.i8 + IL_0052: ldloc.s V_4 + IL_0054: ldarg.0 + IL_0055: add + IL_0056: stloc.s V_4 + IL_0058: ldloc.3 + IL_0059: ldc.i4.1 + IL_005a: conv.i8 + IL_005b: add + IL_005c: stloc.3 + IL_005d: ldloc.3 + IL_005e: ldloc.0 + IL_005f: blt.un.s IL_004c - IL_00a8: nop - IL_00a9: ldloc.2 - IL_00aa: ret + IL_0061: ldloc.2 + IL_0062: ret } .method public static uint64[] f11(uint64 finish) cil managed @@ -695,9 +668,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64[] V_1, - uint64 V_2, - uint64 V_3) + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldc.i4.1 @@ -719,46 +693,48 @@ IL_0012: nop IL_0013: stloc.0 IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: conv.i8 - IL_0017: bge.un.s IL_001f + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 - IL_0019: call !!0[] [runtime]System.Array::Empty() - IL_001e: ret + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret - IL_001f: ldloc.0 - IL_0020: conv.ovf.i.un - IL_0021: newarr [runtime]System.UInt64 - IL_0026: stloc.1 - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.2 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: stloc.3 - IL_002d: br.s IL_003e - - IL_002f: ldloc.1 - IL_0030: ldloc.2 - IL_0031: conv.i - IL_0032: ldloc.3 - IL_0033: stelem.i8 - IL_0034: ldloc.3 - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: add - IL_0038: stloc.3 - IL_0039: ldloc.2 + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.UInt64 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.3 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0044 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i8 + IL_0038: ldloc.s V_4 IL_003a: ldc.i4.1 IL_003b: conv.i8 IL_003c: add - IL_003d: stloc.2 - IL_003e: ldloc.2 - IL_003f: ldloc.0 - IL_0040: blt.un.s IL_002f + IL_003d: stloc.s V_4 + IL_003f: ldloc.3 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.3 + IL_0044: ldloc.3 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0032 - IL_0042: ldloc.1 - IL_0043: ret + IL_0048: ldloc.2 + IL_0049: ret } .method public static uint64[] f12(uint64 start, @@ -768,11 +744,10 @@ .maxstack 5 .locals init (uint64 V_0, - bool V_1, + uint64 V_1, uint64[] V_2, uint64 V_3, - uint64 V_4, - uint64 V_5) + uint64 V_4) IL_0000: nop IL_0001: ldarg.1 IL_0002: brtrue.s IL_0012 @@ -797,7 +772,7 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_0027 + IL_001c: br.s IL_002a IL_001e: ldc.i4.s 10 IL_0020: conv.i8 @@ -806,110 +781,52 @@ IL_0023: ldarg.1 IL_0024: conv.i8 IL_0025: div.un - IL_0026: nop - IL_0027: stloc.0 - IL_0028: ldloc.0 - IL_0029: ldc.i4.m1 - IL_002a: conv.i8 - IL_002b: ceq - IL_002d: stloc.1 - IL_002e: ldloc.0 - IL_002f: ldc.i4.1 - IL_0030: conv.i8 - IL_0031: add.ovf.un - IL_0032: ldc.i4.1 - IL_0033: conv.i8 - IL_0034: bge.un.s IL_003c + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add.ovf.un + IL_0029: nop + IL_002a: stloc.0 + IL_002b: ldloc.0 + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: bge.un.s IL_0038 - IL_0036: call !!0[] [runtime]System.Array::Empty() - IL_003b: ret + IL_0032: call !!0[] [runtime]System.Array::Empty() + IL_0037: ret - IL_003c: ldloc.0 - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add.ovf.un - IL_0040: conv.ovf.i.un - IL_0041: newarr [runtime]System.UInt64 - IL_0046: stloc.2 - IL_0047: ldloc.1 - IL_0048: brfalse.s IL_007c + IL_0038: ldloc.1 + IL_0039: conv.ovf.i.un + IL_003a: newarr [runtime]System.UInt64 + IL_003f: stloc.2 + IL_0040: ldc.i4.0 + IL_0041: conv.i8 + IL_0042: stloc.3 + IL_0043: ldarg.0 + IL_0044: stloc.s V_4 + IL_0046: br.s IL_0059 - IL_004a: ldc.i4.0 - IL_004b: conv.i8 - IL_004c: stloc.3 - IL_004d: ldarg.0 - IL_004e: stloc.s V_4 - IL_0050: ldloc.2 - IL_0051: ldloc.3 - IL_0052: conv.i - IL_0053: ldloc.s V_4 - IL_0055: stelem.i8 - IL_0056: ldloc.s V_4 - IL_0058: ldarg.1 - IL_0059: add - IL_005a: stloc.s V_4 - IL_005c: ldloc.3 - IL_005d: ldc.i4.1 - IL_005e: conv.i8 - IL_005f: add - IL_0060: stloc.3 - IL_0061: br.s IL_0074 - - IL_0063: ldloc.2 - IL_0064: ldloc.3 - IL_0065: conv.i - IL_0066: ldloc.s V_4 - IL_0068: stelem.i8 - IL_0069: ldloc.s V_4 - IL_006b: ldarg.1 - IL_006c: add - IL_006d: stloc.s V_4 - IL_006f: ldloc.3 - IL_0070: ldc.i4.1 - IL_0071: conv.i8 - IL_0072: add - IL_0073: stloc.3 - IL_0074: ldloc.3 - IL_0075: ldc.i4.0 - IL_0076: conv.i8 - IL_0077: bgt.un.s IL_0063 - - IL_0079: nop - IL_007a: br.s IL_00a4 - - IL_007c: ldloc.0 - IL_007d: ldc.i4.1 - IL_007e: conv.i8 - IL_007f: add.ovf.un - IL_0080: stloc.3 - IL_0081: ldc.i4.0 - IL_0082: conv.i8 - IL_0083: stloc.s V_4 - IL_0085: ldarg.0 - IL_0086: stloc.s V_5 - IL_0088: br.s IL_009e - - IL_008a: ldloc.2 - IL_008b: ldloc.s V_4 - IL_008d: conv.i - IL_008e: ldloc.s V_5 - IL_0090: stelem.i8 - IL_0091: ldloc.s V_5 - IL_0093: ldarg.1 - IL_0094: add - IL_0095: stloc.s V_5 - IL_0097: ldloc.s V_4 - IL_0099: ldc.i4.1 - IL_009a: conv.i8 - IL_009b: add - IL_009c: stloc.s V_4 - IL_009e: ldloc.s V_4 - IL_00a0: ldloc.3 - IL_00a1: blt.un.s IL_008a - - IL_00a3: nop - IL_00a4: ldloc.2 - IL_00a5: ret + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: conv.i + IL_004b: ldloc.s V_4 + IL_004d: stelem.i8 + IL_004e: ldloc.s V_4 + IL_0050: ldarg.1 + IL_0051: add + IL_0052: stloc.s V_4 + IL_0054: ldloc.3 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add + IL_0058: stloc.3 + IL_0059: ldloc.3 + IL_005a: ldloc.0 + IL_005b: blt.un.s IL_0048 + + IL_005d: ldloc.2 + IL_005e: ret } .method public static uint64[] f13(uint64 start, @@ -920,10 +837,11 @@ .maxstack 5 .locals init (uint64 V_0, bool V_1, - uint64[] V_2, - uint64 V_3, + uint64 V_2, + uint64[] V_3, uint64 V_4, - uint64 V_5) + uint64 V_5, + uint64 V_6) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -944,106 +862,129 @@ IL_0011: conv.i8 IL_0012: ceq IL_0014: stloc.1 - IL_0015: ldloc.0 - IL_0016: ldc.i4.1 - IL_0017: conv.i8 - IL_0018: add.ovf.un - IL_0019: ldc.i4.1 + IL_0015: ldarg.1 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 IL_001a: conv.i8 - IL_001b: bge.un.s IL_0023 + IL_001b: nop + IL_001c: br.s IL_0025 - IL_001d: call !!0[] [runtime]System.Array::Empty() - IL_0022: ret + IL_001e: ldarg.1 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add.ovf.un + IL_0024: nop + IL_0025: stloc.2 + IL_0026: ldloc.2 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: bge.un.s IL_0031 - IL_0023: ldloc.0 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: add.ovf.un - IL_0027: conv.ovf.i.un - IL_0028: newarr [runtime]System.UInt64 - IL_002d: stloc.2 - IL_002e: ldloc.1 - IL_002f: brfalse.s IL_0065 - - IL_0031: ldc.i4.0 - IL_0032: conv.i8 - IL_0033: stloc.3 - IL_0034: ldarg.0 - IL_0035: stloc.s V_4 - IL_0037: ldloc.2 - IL_0038: ldloc.3 - IL_0039: conv.i - IL_003a: ldloc.s V_4 - IL_003c: stelem.i8 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.3 - IL_0045: ldc.i4.1 - IL_0046: conv.i8 - IL_0047: add - IL_0048: stloc.3 - IL_0049: br.s IL_005d + IL_002b: call !!0[] [runtime]System.Array::Empty() + IL_0030: ret - IL_004b: ldloc.2 - IL_004c: ldloc.3 - IL_004d: conv.i - IL_004e: ldloc.s V_4 - IL_0050: stelem.i8 + IL_0031: ldloc.2 + IL_0032: conv.ovf.i.un + IL_0033: newarr [runtime]System.UInt64 + IL_0038: stloc.3 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_0078 + + IL_003c: ldc.i4.0 + IL_003d: conv.i8 + IL_003e: stloc.s V_4 + IL_0040: ldarg.0 + IL_0041: stloc.s V_5 + IL_0043: ldloc.3 + IL_0044: ldloc.s V_4 + IL_0046: conv.i + IL_0047: ldloc.s V_5 + IL_0049: stelem.i8 + IL_004a: ldloc.s V_5 + IL_004c: ldc.i4.1 + IL_004d: conv.i8 + IL_004e: add + IL_004f: stloc.s V_5 IL_0051: ldloc.s V_4 IL_0053: ldc.i4.1 IL_0054: conv.i8 IL_0055: add IL_0056: stloc.s V_4 - IL_0058: ldloc.3 - IL_0059: ldc.i4.1 - IL_005a: conv.i8 - IL_005b: add - IL_005c: stloc.3 - IL_005d: ldloc.3 - IL_005e: ldc.i4.0 - IL_005f: conv.i8 - IL_0060: bgt.un.s IL_004b + IL_0058: br.s IL_006f - IL_0062: nop - IL_0063: br.s IL_008e - - IL_0065: ldloc.0 - IL_0066: ldc.i4.1 - IL_0067: conv.i8 - IL_0068: add.ovf.un - IL_0069: stloc.3 - IL_006a: ldc.i4.0 + IL_005a: ldloc.3 + IL_005b: ldloc.s V_4 + IL_005d: conv.i + IL_005e: ldloc.s V_5 + IL_0060: stelem.i8 + IL_0061: ldloc.s V_5 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: add + IL_0066: stloc.s V_5 + IL_0068: ldloc.s V_4 + IL_006a: ldc.i4.1 IL_006b: conv.i8 - IL_006c: stloc.s V_4 - IL_006e: ldarg.0 - IL_006f: stloc.s V_5 - IL_0071: br.s IL_0088 - - IL_0073: ldloc.2 - IL_0074: ldloc.s V_4 - IL_0076: conv.i - IL_0077: ldloc.s V_5 - IL_0079: stelem.i8 - IL_007a: ldloc.s V_5 - IL_007c: ldc.i4.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.s V_4 + IL_0071: ldc.i4.0 + IL_0072: conv.i8 + IL_0073: bgt.un.s IL_005a + + IL_0075: nop + IL_0076: br.s IL_00af + + IL_0078: ldarg.1 + IL_0079: ldarg.0 + IL_007a: bge.un.s IL_0081 + + IL_007c: ldc.i4.0 IL_007d: conv.i8 - IL_007e: add - IL_007f: stloc.s V_5 - IL_0081: ldloc.s V_4 - IL_0083: ldc.i4.1 - IL_0084: conv.i8 - IL_0085: add - IL_0086: stloc.s V_4 - IL_0088: ldloc.s V_4 - IL_008a: ldloc.3 - IL_008b: blt.un.s IL_0073 - - IL_008d: nop - IL_008e: ldloc.2 - IL_008f: ret + IL_007e: nop + IL_007f: br.s IL_0088 + + IL_0081: ldarg.1 + IL_0082: ldarg.0 + IL_0083: sub + IL_0084: ldc.i4.1 + IL_0085: conv.i8 + IL_0086: add.ovf.un + IL_0087: nop + IL_0088: stloc.s V_4 + IL_008a: ldc.i4.0 + IL_008b: conv.i8 + IL_008c: stloc.s V_5 + IL_008e: ldarg.0 + IL_008f: stloc.s V_6 + IL_0091: br.s IL_00a8 + + IL_0093: ldloc.3 + IL_0094: ldloc.s V_5 + IL_0096: conv.i + IL_0097: ldloc.s V_6 + IL_0099: stelem.i8 + IL_009a: ldloc.s V_6 + IL_009c: ldc.i4.1 + IL_009d: conv.i8 + IL_009e: add + IL_009f: stloc.s V_6 + IL_00a1: ldloc.s V_5 + IL_00a3: ldc.i4.1 + IL_00a4: conv.i8 + IL_00a5: add + IL_00a6: stloc.s V_5 + IL_00a8: ldloc.s V_5 + IL_00aa: ldloc.s V_4 + IL_00ac: blt.un.s IL_0093 + + IL_00ae: nop + IL_00af: ldloc.3 + IL_00b0: ret } .method public static uint64[] f14(uint64 step, @@ -1053,11 +994,10 @@ .maxstack 5 .locals init (uint64 V_0, - bool V_1, + uint64 V_1, uint64[] V_2, uint64 V_3, - uint64 V_4, - uint64 V_5) + uint64 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: brtrue.s IL_0011 @@ -1082,7 +1022,7 @@ IL_0017: ldc.i4.0 IL_0018: conv.i8 IL_0019: nop - IL_001a: br.s IL_0024 + IL_001a: br.s IL_0027 IL_001c: ldarg.1 IL_001d: ldc.i4.1 @@ -1091,112 +1031,53 @@ IL_0020: ldarg.0 IL_0021: conv.i8 IL_0022: div.un - IL_0023: nop - IL_0024: stloc.0 - IL_0025: ldloc.0 - IL_0026: ldc.i4.m1 - IL_0027: conv.i8 - IL_0028: ceq - IL_002a: stloc.1 - IL_002b: ldloc.0 - IL_002c: ldc.i4.1 - IL_002d: conv.i8 - IL_002e: add.ovf.un - IL_002f: ldc.i4.1 - IL_0030: conv.i8 - IL_0031: bge.un.s IL_0039 - - IL_0033: call !!0[] [runtime]System.Array::Empty() - IL_0038: ret + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add.ovf.un + IL_0026: nop + IL_0027: stloc.0 + IL_0028: ldloc.0 + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: bge.un.s IL_0035 - IL_0039: ldloc.0 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 - IL_003c: add.ovf.un - IL_003d: conv.ovf.i.un - IL_003e: newarr [runtime]System.UInt64 - IL_0043: stloc.2 - IL_0044: ldloc.1 - IL_0045: brfalse.s IL_007a + IL_002f: call !!0[] [runtime]System.Array::Empty() + IL_0034: ret - IL_0047: ldc.i4.0 - IL_0048: conv.i8 - IL_0049: stloc.3 - IL_004a: ldc.i4.1 - IL_004b: conv.i8 - IL_004c: stloc.s V_4 - IL_004e: ldloc.2 - IL_004f: ldloc.3 - IL_0050: conv.i - IL_0051: ldloc.s V_4 - IL_0053: stelem.i8 - IL_0054: ldloc.s V_4 - IL_0056: ldarg.0 - IL_0057: add - IL_0058: stloc.s V_4 - IL_005a: ldloc.3 - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add - IL_005e: stloc.3 - IL_005f: br.s IL_0072 + IL_0035: ldloc.1 + IL_0036: conv.ovf.i.un + IL_0037: newarr [runtime]System.UInt64 + IL_003c: stloc.2 + IL_003d: ldc.i4.0 + IL_003e: conv.i8 + IL_003f: stloc.3 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: stloc.s V_4 + IL_0044: br.s IL_0057 + + IL_0046: ldloc.2 + IL_0047: ldloc.3 + IL_0048: conv.i + IL_0049: ldloc.s V_4 + IL_004b: stelem.i8 + IL_004c: ldloc.s V_4 + IL_004e: ldarg.0 + IL_004f: add + IL_0050: stloc.s V_4 + IL_0052: ldloc.3 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.3 + IL_0057: ldloc.3 + IL_0058: ldloc.0 + IL_0059: blt.un.s IL_0046 - IL_0061: ldloc.2 - IL_0062: ldloc.3 - IL_0063: conv.i - IL_0064: ldloc.s V_4 - IL_0066: stelem.i8 - IL_0067: ldloc.s V_4 - IL_0069: ldarg.0 - IL_006a: add - IL_006b: stloc.s V_4 - IL_006d: ldloc.3 - IL_006e: ldc.i4.1 - IL_006f: conv.i8 - IL_0070: add - IL_0071: stloc.3 - IL_0072: ldloc.3 - IL_0073: ldc.i4.0 - IL_0074: conv.i8 - IL_0075: bgt.un.s IL_0061 - - IL_0077: nop - IL_0078: br.s IL_00a3 - - IL_007a: ldloc.0 - IL_007b: ldc.i4.1 - IL_007c: conv.i8 - IL_007d: add.ovf.un - IL_007e: stloc.3 - IL_007f: ldc.i4.0 - IL_0080: conv.i8 - IL_0081: stloc.s V_4 - IL_0083: ldc.i4.1 - IL_0084: conv.i8 - IL_0085: stloc.s V_5 - IL_0087: br.s IL_009d - - IL_0089: ldloc.2 - IL_008a: ldloc.s V_4 - IL_008c: conv.i - IL_008d: ldloc.s V_5 - IL_008f: stelem.i8 - IL_0090: ldloc.s V_5 - IL_0092: ldarg.0 - IL_0093: add - IL_0094: stloc.s V_5 - IL_0096: ldloc.s V_4 - IL_0098: ldc.i4.1 - IL_0099: conv.i8 - IL_009a: add - IL_009b: stloc.s V_4 - IL_009d: ldloc.s V_4 - IL_009f: ldloc.3 - IL_00a0: blt.un.s IL_0089 - - IL_00a2: nop - IL_00a3: ldloc.2 - IL_00a4: ret + IL_005b: ldloc.2 + IL_005c: ret } .method public static uint64[] f15(uint64 start, @@ -1209,10 +1090,11 @@ .maxstack 5 .locals init (uint64 V_0, bool V_1, - uint64[] V_2, - uint64 V_3, + uint64 V_2, + uint64[] V_3, uint64 V_4, - uint64 V_5) + uint64 V_5, + uint64 V_6) IL_0000: nop IL_0001: ldarg.1 IL_0002: brtrue.s IL_0010 @@ -1250,103 +1132,160 @@ IL_0024: conv.i8 IL_0025: ceq IL_0027: stloc.1 - IL_0028: ldloc.0 - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add.ovf.un - IL_002c: ldc.i4.1 - IL_002d: conv.i8 - IL_002e: bge.un.s IL_0036 + IL_0028: ldarg.1 + IL_0029: brtrue.s IL_0037 - IL_0030: call !!0[] [runtime]System.Array::Empty() - IL_0035: ret + IL_002b: ldarg.0 + IL_002c: ldarg.1 + IL_002d: ldarg.2 + IL_002e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0033: pop + IL_0034: nop + IL_0035: br.s IL_0038 - IL_0036: ldloc.0 - IL_0037: ldc.i4.1 - IL_0038: conv.i8 - IL_0039: add.ovf.un - IL_003a: conv.ovf.i.un - IL_003b: newarr [runtime]System.UInt64 - IL_0040: stloc.2 - IL_0041: ldloc.1 - IL_0042: brfalse.s IL_0076 - - IL_0044: ldc.i4.0 + IL_0037: nop + IL_0038: ldarg.2 + IL_0039: ldarg.0 + IL_003a: bge.un.s IL_0041 + + IL_003c: ldc.i4.0 + IL_003d: conv.i8 + IL_003e: nop + IL_003f: br.s IL_004b + + IL_0041: ldarg.2 + IL_0042: ldarg.0 + IL_0043: sub + IL_0044: ldarg.1 IL_0045: conv.i8 - IL_0046: stloc.3 - IL_0047: ldarg.0 - IL_0048: stloc.s V_4 - IL_004a: ldloc.2 - IL_004b: ldloc.3 - IL_004c: conv.i - IL_004d: ldloc.s V_4 - IL_004f: stelem.i8 - IL_0050: ldloc.s V_4 - IL_0052: ldarg.1 - IL_0053: add - IL_0054: stloc.s V_4 - IL_0056: ldloc.3 - IL_0057: ldc.i4.1 - IL_0058: conv.i8 - IL_0059: add - IL_005a: stloc.3 - IL_005b: br.s IL_006e + IL_0046: div.un + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add.ovf.un + IL_004a: nop + IL_004b: stloc.2 + IL_004c: ldloc.2 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: bge.un.s IL_0057 - IL_005d: ldloc.2 - IL_005e: ldloc.3 - IL_005f: conv.i - IL_0060: ldloc.s V_4 - IL_0062: stelem.i8 - IL_0063: ldloc.s V_4 - IL_0065: ldarg.1 - IL_0066: add - IL_0067: stloc.s V_4 + IL_0051: call !!0[] [runtime]System.Array::Empty() + IL_0056: ret + + IL_0057: ldloc.2 + IL_0058: conv.ovf.i.un + IL_0059: newarr [runtime]System.UInt64 + IL_005e: stloc.3 + IL_005f: ldloc.1 + IL_0060: brfalse.s IL_009c + + IL_0062: ldc.i4.0 + IL_0063: conv.i8 + IL_0064: stloc.s V_4 + IL_0066: ldarg.0 + IL_0067: stloc.s V_5 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: ldc.i4.0 - IL_0070: conv.i8 - IL_0071: bgt.un.s IL_005d - - IL_0073: nop - IL_0074: br.s IL_009e - - IL_0076: ldloc.0 - IL_0077: ldc.i4.1 - IL_0078: conv.i8 - IL_0079: add.ovf.un - IL_007a: stloc.3 - IL_007b: ldc.i4.0 - IL_007c: conv.i8 - IL_007d: stloc.s V_4 - IL_007f: ldarg.0 - IL_0080: stloc.s V_5 - IL_0082: br.s IL_0098 - - IL_0084: ldloc.2 - IL_0085: ldloc.s V_4 - IL_0087: conv.i - IL_0088: ldloc.s V_5 - IL_008a: stelem.i8 - IL_008b: ldloc.s V_5 - IL_008d: ldarg.1 - IL_008e: add - IL_008f: stloc.s V_5 - IL_0091: ldloc.s V_4 - IL_0093: ldc.i4.1 - IL_0094: conv.i8 - IL_0095: add - IL_0096: stloc.s V_4 - IL_0098: ldloc.s V_4 - IL_009a: ldloc.3 - IL_009b: blt.un.s IL_0084 - - IL_009d: nop - IL_009e: ldloc.2 - IL_009f: ret + IL_006a: ldloc.s V_4 + IL_006c: conv.i + IL_006d: ldloc.s V_5 + IL_006f: stelem.i8 + IL_0070: ldloc.s V_5 + IL_0072: ldarg.1 + IL_0073: add + IL_0074: stloc.s V_5 + IL_0076: ldloc.s V_4 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.s V_4 + IL_007d: br.s IL_0093 + + IL_007f: ldloc.3 + IL_0080: ldloc.s V_4 + IL_0082: conv.i + IL_0083: ldloc.s V_5 + IL_0085: stelem.i8 + IL_0086: ldloc.s V_5 + IL_0088: ldarg.1 + IL_0089: add + IL_008a: stloc.s V_5 + IL_008c: ldloc.s V_4 + IL_008e: ldc.i4.1 + IL_008f: conv.i8 + IL_0090: add + IL_0091: stloc.s V_4 + IL_0093: ldloc.s V_4 + IL_0095: ldc.i4.0 + IL_0096: conv.i8 + IL_0097: bgt.un.s IL_007f + + IL_0099: nop + IL_009a: br.s IL_00e5 + + IL_009c: ldarg.1 + IL_009d: brtrue.s IL_00ab + + IL_009f: ldarg.0 + IL_00a0: ldarg.1 + IL_00a1: ldarg.2 + IL_00a2: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_00a7: pop + IL_00a8: nop + IL_00a9: br.s IL_00ac + + IL_00ab: nop + IL_00ac: ldarg.2 + IL_00ad: ldarg.0 + IL_00ae: bge.un.s IL_00b5 + + IL_00b0: ldc.i4.0 + IL_00b1: conv.i8 + IL_00b2: nop + IL_00b3: br.s IL_00bf + + IL_00b5: ldarg.2 + IL_00b6: ldarg.0 + IL_00b7: sub + IL_00b8: ldarg.1 + IL_00b9: conv.i8 + IL_00ba: div.un + IL_00bb: ldc.i4.1 + IL_00bc: conv.i8 + IL_00bd: add.ovf.un + IL_00be: nop + IL_00bf: stloc.s V_4 + IL_00c1: ldc.i4.0 + IL_00c2: conv.i8 + IL_00c3: stloc.s V_5 + IL_00c5: ldarg.0 + IL_00c6: stloc.s V_6 + IL_00c8: br.s IL_00de + + IL_00ca: ldloc.3 + IL_00cb: ldloc.s V_5 + IL_00cd: conv.i + IL_00ce: ldloc.s V_6 + IL_00d0: stelem.i8 + IL_00d1: ldloc.s V_6 + IL_00d3: ldarg.1 + IL_00d4: add + IL_00d5: stloc.s V_6 + IL_00d7: ldloc.s V_5 + IL_00d9: ldc.i4.1 + IL_00da: conv.i8 + IL_00db: add + IL_00dc: stloc.s V_5 + IL_00de: ldloc.s V_5 + IL_00e0: ldloc.s V_4 + IL_00e2: blt.un.s IL_00ca + + IL_00e4: nop + IL_00e5: ldloc.3 + IL_00e6: ret } .method public static uint64[] f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1355,9 +1294,10 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - uint64[] V_2, - uint64 V_3, - uint64 V_4) + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1382,45 +1322,47 @@ IL_001b: nop IL_001c: stloc.1 IL_001d: ldloc.1 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0028 + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: bge.un.s IL_002a - IL_0022: call !!0[] [runtime]System.Array::Empty() - IL_0027: ret + IL_0024: call !!0[] [runtime]System.Array::Empty() + IL_0029: ret - IL_0028: ldloc.1 - IL_0029: conv.ovf.i.un - IL_002a: newarr [runtime]System.UInt64 - IL_002f: stloc.2 - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: stloc.3 - IL_0033: ldloc.0 + IL_002a: ldloc.2 + IL_002b: conv.ovf.i.un + IL_002c: newarr [runtime]System.UInt64 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: conv.i8 IL_0034: stloc.s V_4 - IL_0036: br.s IL_004a - - IL_0038: ldloc.2 - IL_0039: ldloc.3 - IL_003a: conv.i - IL_003b: ldloc.s V_4 - IL_003d: stelem.i8 - IL_003e: ldloc.s V_4 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: add - IL_0043: stloc.s V_4 - IL_0045: ldloc.3 - IL_0046: ldc.i4.1 - IL_0047: conv.i8 - IL_0048: add - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: ldloc.1 - IL_004c: blt.un.s IL_0038 + IL_0036: ldloc.0 + IL_0037: stloc.s V_5 + IL_0039: br.s IL_0050 + + IL_003b: ldloc.3 + IL_003c: ldloc.s V_4 + IL_003e: conv.i + IL_003f: ldloc.s V_5 + IL_0041: stelem.i8 + IL_0042: ldloc.s V_5 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + 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_003b - IL_004e: ldloc.2 - IL_004f: ret + IL_0055: ldloc.3 + IL_0056: ret } .method public static uint64[] f17(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1429,9 +1371,10 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - uint64[] V_2, - uint64 V_3, - uint64 V_4) + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1456,46 +1399,48 @@ IL_0019: nop IL_001a: stloc.1 IL_001b: ldloc.1 - IL_001c: ldc.i4.1 - IL_001d: conv.i8 - IL_001e: bge.un.s IL_0026 - - IL_0020: call !!0[] [runtime]System.Array::Empty() - IL_0025: ret + IL_001c: stloc.2 + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 - IL_0026: ldloc.1 - IL_0027: conv.ovf.i.un - IL_0028: newarr [runtime]System.UInt64 - IL_002d: stloc.2 - IL_002e: ldc.i4.0 - IL_002f: conv.i8 - IL_0030: stloc.3 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: stloc.s V_4 - IL_0035: br.s IL_0049 + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret - IL_0037: ldloc.2 - IL_0038: ldloc.3 - IL_0039: conv.i - IL_003a: ldloc.s V_4 - IL_003c: stelem.i8 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.3 - IL_0045: ldc.i4.1 - IL_0046: conv.i8 - IL_0047: add - IL_0048: stloc.3 - IL_0049: ldloc.3 - IL_004a: ldloc.1 - IL_004b: blt.un.s IL_0037 + IL_0028: ldloc.2 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.UInt64 + IL_002f: stloc.3 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_004f - IL_004d: ldloc.2 - IL_004e: ret + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i8 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.s V_5 + IL_0048: ldloc.s V_4 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: add + IL_004d: stloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: ldloc.1 + IL_0052: blt.un.s IL_003a + + IL_0054: ldloc.3 + IL_0055: ret } .method public static uint64[] f18(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1508,10 +1453,11 @@ uint64 V_1, uint64 V_2, bool V_3, - uint64[] V_4, - uint64 V_5, + uint64 V_4, + uint64[] V_5, uint64 V_6, - uint64 V_7) + uint64 V_7, + uint64 V_8) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1539,106 +1485,129 @@ IL_0020: conv.i8 IL_0021: ceq IL_0023: stloc.3 - IL_0024: ldloc.2 - IL_0025: ldc.i4.1 - IL_0026: conv.i8 - IL_0027: add.ovf.un - IL_0028: ldc.i4.1 - IL_0029: conv.i8 - IL_002a: bge.un.s IL_0032 - - IL_002c: call !!0[] [runtime]System.Array::Empty() - IL_0031: ret + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: bge.un.s IL_002d - IL_0032: ldloc.2 - IL_0033: ldc.i4.1 - IL_0034: conv.i8 - IL_0035: add.ovf.un - IL_0036: conv.ovf.i.un - IL_0037: newarr [runtime]System.UInt64 - IL_003c: stloc.s V_4 - IL_003e: ldloc.3 - IL_003f: brfalse.s IL_007f + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: nop + IL_002b: br.s IL_0034 - IL_0041: ldc.i4.0 - IL_0042: conv.i8 - IL_0043: stloc.s V_5 - IL_0045: ldloc.0 - IL_0046: stloc.s V_6 - IL_0048: ldloc.s V_4 - IL_004a: ldloc.s V_5 - IL_004c: conv.i - IL_004d: ldloc.s V_6 - IL_004f: stelem.i8 - IL_0050: ldloc.s V_6 - IL_0052: ldc.i4.1 - IL_0053: conv.i8 - IL_0054: add - IL_0055: stloc.s V_6 - IL_0057: ldloc.s V_5 - IL_0059: ldc.i4.1 - IL_005a: conv.i8 - IL_005b: add - IL_005c: stloc.s V_5 - IL_005e: br.s IL_0076 + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: sub + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add.ovf.un + IL_0033: nop + IL_0034: stloc.s V_4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: bge.un.s IL_0042 + + IL_003c: call !!0[] [runtime]System.Array::Empty() + IL_0041: ret + + IL_0042: ldloc.s V_4 + IL_0044: conv.ovf.i.un + IL_0045: newarr [runtime]System.UInt64 + IL_004a: stloc.s V_5 + IL_004c: ldloc.3 + IL_004d: brfalse.s IL_008d - IL_0060: ldloc.s V_4 - IL_0062: ldloc.s V_5 - IL_0064: conv.i + IL_004f: ldc.i4.0 + IL_0050: conv.i8 + IL_0051: stloc.s V_6 + IL_0053: ldloc.0 + IL_0054: stloc.s V_7 + IL_0056: ldloc.s V_5 + IL_0058: ldloc.s V_6 + IL_005a: conv.i + IL_005b: ldloc.s V_7 + IL_005d: stelem.i8 + IL_005e: ldloc.s V_7 + IL_0060: ldc.i4.1 + IL_0061: conv.i8 + IL_0062: add + IL_0063: stloc.s V_7 IL_0065: ldloc.s V_6 - IL_0067: stelem.i8 - IL_0068: ldloc.s V_6 - IL_006a: ldc.i4.1 - IL_006b: conv.i8 - IL_006c: add - IL_006d: stloc.s V_6 - IL_006f: ldloc.s V_5 - IL_0071: ldc.i4.1 - IL_0072: conv.i8 - IL_0073: add - IL_0074: stloc.s V_5 - IL_0076: ldloc.s V_5 - IL_0078: ldc.i4.0 + IL_0067: ldc.i4.1 + IL_0068: conv.i8 + IL_0069: add + IL_006a: stloc.s V_6 + IL_006c: br.s IL_0084 + + IL_006e: ldloc.s V_5 + IL_0070: ldloc.s V_6 + IL_0072: conv.i + IL_0073: ldloc.s V_7 + IL_0075: stelem.i8 + IL_0076: ldloc.s V_7 + IL_0078: ldc.i4.1 IL_0079: conv.i8 - IL_007a: bgt.un.s IL_0060 - - IL_007c: nop - IL_007d: br.s IL_00ab - - IL_007f: ldloc.2 - IL_0080: ldc.i4.1 - IL_0081: conv.i8 - IL_0082: add.ovf.un - IL_0083: stloc.s V_5 - IL_0085: ldc.i4.0 - IL_0086: conv.i8 - IL_0087: stloc.s V_6 - IL_0089: ldloc.0 - IL_008a: stloc.s V_7 - IL_008c: br.s IL_00a4 - - IL_008e: ldloc.s V_4 - IL_0090: ldloc.s V_6 - IL_0092: conv.i - IL_0093: ldloc.s V_7 - IL_0095: stelem.i8 - IL_0096: ldloc.s V_7 - IL_0098: ldc.i4.1 - IL_0099: conv.i8 - IL_009a: add - IL_009b: stloc.s V_7 - IL_009d: ldloc.s V_6 - IL_009f: ldc.i4.1 + IL_007a: add + IL_007b: stloc.s V_7 + IL_007d: ldloc.s V_6 + IL_007f: ldc.i4.1 + IL_0080: conv.i8 + IL_0081: add + IL_0082: stloc.s V_6 + IL_0084: ldloc.s V_6 + IL_0086: ldc.i4.0 + IL_0087: conv.i8 + IL_0088: bgt.un.s IL_006e + + IL_008a: nop + IL_008b: br.s IL_00c5 + + IL_008d: ldloc.1 + IL_008e: ldloc.0 + IL_008f: bge.un.s IL_0096 + + IL_0091: ldc.i4.0 + IL_0092: conv.i8 + IL_0093: nop + IL_0094: br.s IL_009d + + IL_0096: ldloc.1 + IL_0097: ldloc.0 + IL_0098: sub + IL_0099: ldc.i4.1 + IL_009a: conv.i8 + IL_009b: add.ovf.un + IL_009c: nop + IL_009d: stloc.s V_6 + IL_009f: ldc.i4.0 IL_00a0: conv.i8 - IL_00a1: add - IL_00a2: stloc.s V_6 - IL_00a4: ldloc.s V_6 - IL_00a6: ldloc.s V_5 - IL_00a8: blt.un.s IL_008e - - IL_00aa: nop - IL_00ab: ldloc.s V_4 - IL_00ad: ret + IL_00a1: stloc.s V_7 + IL_00a3: ldloc.0 + IL_00a4: stloc.s V_8 + IL_00a6: br.s IL_00be + + IL_00a8: ldloc.s V_5 + IL_00aa: ldloc.s V_7 + IL_00ac: conv.i + IL_00ad: ldloc.s V_8 + IL_00af: stelem.i8 + IL_00b0: ldloc.s V_8 + IL_00b2: ldc.i4.1 + IL_00b3: conv.i8 + IL_00b4: add + IL_00b5: stloc.s V_8 + IL_00b7: ldloc.s V_7 + IL_00b9: ldc.i4.1 + IL_00ba: conv.i8 + IL_00bb: add + IL_00bc: stloc.s V_7 + IL_00be: ldloc.s V_7 + IL_00c0: ldloc.s V_6 + IL_00c2: blt.un.s IL_00a8 + + IL_00c4: nop + IL_00c5: ldloc.s V_5 + IL_00c7: ret } .method public static uint64[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1647,9 +1616,10 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - uint64[] V_2, - uint64 V_3, - uint64 V_4) + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1674,45 +1644,47 @@ IL_001b: nop IL_001c: stloc.1 IL_001d: ldloc.1 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0028 + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: bge.un.s IL_002a - IL_0022: call !!0[] [runtime]System.Array::Empty() - IL_0027: ret + IL_0024: call !!0[] [runtime]System.Array::Empty() + IL_0029: ret - IL_0028: ldloc.1 - IL_0029: conv.ovf.i.un - IL_002a: newarr [runtime]System.UInt64 - IL_002f: stloc.2 - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: stloc.3 - IL_0033: ldloc.0 + IL_002a: ldloc.2 + IL_002b: conv.ovf.i.un + IL_002c: newarr [runtime]System.UInt64 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: conv.i8 IL_0034: stloc.s V_4 - IL_0036: br.s IL_004a - - IL_0038: ldloc.2 - IL_0039: ldloc.3 - IL_003a: conv.i - IL_003b: ldloc.s V_4 - IL_003d: stelem.i8 - IL_003e: ldloc.s V_4 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: add - IL_0043: stloc.s V_4 - IL_0045: ldloc.3 - IL_0046: ldc.i4.1 - IL_0047: conv.i8 - IL_0048: add - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: ldloc.1 - IL_004c: blt.un.s IL_0038 + IL_0036: ldloc.0 + IL_0037: stloc.s V_5 + IL_0039: br.s IL_0050 + + IL_003b: ldloc.3 + IL_003c: ldloc.s V_4 + IL_003e: conv.i + IL_003f: ldloc.s V_5 + IL_0041: stelem.i8 + IL_0042: ldloc.s V_5 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + 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_003b - IL_004e: ldloc.2 - IL_004f: ret + IL_0055: ldloc.3 + IL_0056: ret } .method public static uint64[] f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1721,11 +1693,10 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - bool V_2, + uint64 V_2, uint64[] V_3, uint64 V_4, - uint64 V_5, - uint64 V_6) + uint64 V_5) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1755,7 +1726,7 @@ IL_0022: ldc.i4.0 IL_0023: conv.i8 IL_0024: nop - IL_0025: br.s IL_0031 + IL_0025: br.s IL_0034 IL_0027: ldc.i4.s 10 IL_0029: conv.i8 @@ -1765,112 +1736,53 @@ IL_002d: ldloc.0 IL_002e: conv.i8 IL_002f: div.un - IL_0030: nop - IL_0031: stloc.1 - IL_0032: ldloc.1 - IL_0033: ldc.i4.m1 - IL_0034: conv.i8 - IL_0035: ceq - IL_0037: stloc.2 - IL_0038: ldloc.1 - IL_0039: ldc.i4.1 - IL_003a: conv.i8 - IL_003b: add.ovf.un - IL_003c: ldc.i4.1 - IL_003d: conv.i8 - IL_003e: bge.un.s IL_0046 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add.ovf.un + IL_0033: nop + IL_0034: stloc.1 + IL_0035: ldloc.1 + IL_0036: stloc.2 + IL_0037: ldloc.2 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: bge.un.s IL_0042 - IL_0040: call !!0[] [runtime]System.Array::Empty() - IL_0045: ret + IL_003c: call !!0[] [runtime]System.Array::Empty() + IL_0041: ret - IL_0046: ldloc.1 - IL_0047: ldc.i4.1 - IL_0048: conv.i8 - IL_0049: add.ovf.un - IL_004a: conv.ovf.i.un - IL_004b: newarr [runtime]System.UInt64 - IL_0050: stloc.3 - IL_0051: ldloc.2 - IL_0052: brfalse.s IL_008f + IL_0042: ldloc.2 + IL_0043: conv.ovf.i.un + IL_0044: newarr [runtime]System.UInt64 + IL_0049: stloc.3 + IL_004a: ldc.i4.0 + IL_004b: conv.i8 + IL_004c: stloc.s V_4 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: stloc.s V_5 + IL_0052: br.s IL_0068 + + IL_0054: ldloc.3 + IL_0055: ldloc.s V_4 + IL_0057: conv.i + IL_0058: ldloc.s V_5 + IL_005a: stelem.i8 + IL_005b: ldloc.s V_5 + IL_005d: ldloc.0 + IL_005e: add + IL_005f: stloc.s V_5 + IL_0061: ldloc.s V_4 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: add + IL_0066: stloc.s V_4 + IL_0068: ldloc.s V_4 + IL_006a: ldloc.1 + IL_006b: blt.un.s IL_0054 - IL_0054: ldc.i4.0 - IL_0055: conv.i8 - IL_0056: stloc.s V_4 - IL_0058: ldc.i4.1 - IL_0059: conv.i8 - IL_005a: stloc.s V_5 - IL_005c: ldloc.3 - IL_005d: ldloc.s V_4 - IL_005f: conv.i - IL_0060: ldloc.s V_5 - IL_0062: stelem.i8 - IL_0063: ldloc.s V_5 - IL_0065: ldloc.0 - IL_0066: add - IL_0067: stloc.s V_5 - IL_0069: ldloc.s V_4 - IL_006b: ldc.i4.1 - IL_006c: conv.i8 - IL_006d: add - IL_006e: stloc.s V_4 - IL_0070: br.s IL_0086 - - IL_0072: ldloc.3 - IL_0073: ldloc.s V_4 - IL_0075: conv.i - IL_0076: ldloc.s V_5 - IL_0078: stelem.i8 - IL_0079: ldloc.s V_5 - IL_007b: ldloc.0 - IL_007c: add - IL_007d: stloc.s V_5 - IL_007f: ldloc.s V_4 - IL_0081: ldc.i4.1 - IL_0082: conv.i8 - IL_0083: add - IL_0084: stloc.s V_4 - IL_0086: ldloc.s V_4 - IL_0088: ldc.i4.0 - IL_0089: conv.i8 - IL_008a: bgt.un.s IL_0072 - - IL_008c: nop - IL_008d: br.s IL_00ba - - IL_008f: ldloc.1 - IL_0090: ldc.i4.1 - IL_0091: conv.i8 - IL_0092: add.ovf.un - IL_0093: stloc.s V_4 - IL_0095: ldc.i4.0 - IL_0096: conv.i8 - IL_0097: stloc.s V_5 - IL_0099: ldc.i4.1 - IL_009a: conv.i8 - IL_009b: stloc.s V_6 - IL_009d: br.s IL_00b3 - - IL_009f: ldloc.3 - IL_00a0: ldloc.s V_5 - IL_00a2: conv.i - IL_00a3: ldloc.s V_6 - IL_00a5: stelem.i8 - IL_00a6: ldloc.s V_6 - IL_00a8: ldloc.0 - IL_00a9: add - IL_00aa: stloc.s V_6 - IL_00ac: ldloc.s V_5 - IL_00ae: ldc.i4.1 - IL_00af: conv.i8 - IL_00b0: add - IL_00b1: stloc.s V_5 - IL_00b3: ldloc.s V_5 - IL_00b5: ldloc.s V_4 - IL_00b7: blt.un.s IL_009f - - IL_00b9: nop - IL_00ba: ldloc.3 - IL_00bb: ret + IL_006d: ldloc.3 + IL_006e: ret } .method public static uint64[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1879,9 +1791,10 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - uint64[] V_2, - uint64 V_3, - uint64 V_4) + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1906,46 +1819,48 @@ IL_0019: nop IL_001a: stloc.1 IL_001b: ldloc.1 - IL_001c: ldc.i4.1 - IL_001d: conv.i8 - IL_001e: bge.un.s IL_0026 - - IL_0020: call !!0[] [runtime]System.Array::Empty() - IL_0025: ret + IL_001c: stloc.2 + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 - IL_0026: ldloc.1 - IL_0027: conv.ovf.i.un - IL_0028: newarr [runtime]System.UInt64 - IL_002d: stloc.2 - IL_002e: ldc.i4.0 - IL_002f: conv.i8 - IL_0030: stloc.3 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: stloc.s V_4 - IL_0035: br.s IL_0049 + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret - IL_0037: ldloc.2 - IL_0038: ldloc.3 - IL_0039: conv.i - IL_003a: ldloc.s V_4 - IL_003c: stelem.i8 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.3 - IL_0045: ldc.i4.1 - IL_0046: conv.i8 - IL_0047: add - IL_0048: stloc.3 - IL_0049: ldloc.3 - IL_004a: ldloc.1 - IL_004b: blt.un.s IL_0037 + IL_0028: ldloc.2 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.UInt64 + IL_002f: stloc.3 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_004f - IL_004d: ldloc.2 - IL_004e: ret + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i8 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.s V_5 + IL_0048: ldloc.s V_4 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: add + IL_004d: stloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: ldloc.1 + IL_0052: blt.un.s IL_003a + + IL_0054: ldloc.3 + IL_0055: ret } .method public static uint64[] f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1961,10 +1876,11 @@ uint64 V_2, uint64 V_3, bool V_4, - uint64[] V_5, - uint64 V_6, + uint64 V_5, + uint64[] V_6, uint64 V_7, - uint64 V_8) + uint64 V_8, + uint64 V_9) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -2013,103 +1929,160 @@ IL_003b: conv.i8 IL_003c: ceq IL_003e: stloc.s V_4 - IL_0040: ldloc.3 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add.ovf.un - IL_0044: ldc.i4.1 - IL_0045: conv.i8 - IL_0046: bge.un.s IL_004e + IL_0040: ldloc.1 + IL_0041: brtrue.s IL_004f + + IL_0043: ldloc.0 + IL_0044: ldloc.1 + IL_0045: ldloc.2 + IL_0046: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_004b: pop + IL_004c: nop + IL_004d: br.s IL_0050 - IL_0048: call !!0[] [runtime]System.Array::Empty() - IL_004d: ret + IL_004f: nop + IL_0050: ldloc.2 + IL_0051: ldloc.0 + IL_0052: bge.un.s IL_0059 - IL_004e: ldloc.3 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: add.ovf.un - IL_0052: conv.ovf.i.un - IL_0053: newarr [runtime]System.UInt64 - IL_0058: stloc.s V_5 - IL_005a: ldloc.s V_4 - IL_005c: brfalse.s IL_009a - - IL_005e: ldc.i4.0 - IL_005f: conv.i8 - IL_0060: stloc.s V_6 - IL_0062: ldloc.0 - IL_0063: stloc.s V_7 + IL_0054: ldc.i4.0 + IL_0055: conv.i8 + IL_0056: nop + IL_0057: br.s IL_0063 + + IL_0059: ldloc.2 + IL_005a: ldloc.0 + IL_005b: sub + IL_005c: ldloc.1 + IL_005d: conv.i8 + IL_005e: div.un + IL_005f: ldc.i4.1 + IL_0060: conv.i8 + IL_0061: add.ovf.un + IL_0062: nop + IL_0063: stloc.s V_5 IL_0065: ldloc.s V_5 - IL_0067: ldloc.s V_6 - IL_0069: conv.i - IL_006a: ldloc.s V_7 - IL_006c: stelem.i8 - IL_006d: ldloc.s V_7 - IL_006f: ldloc.1 - IL_0070: add - IL_0071: stloc.s V_7 - IL_0073: ldloc.s V_6 - IL_0075: ldc.i4.1 - IL_0076: conv.i8 - IL_0077: add - IL_0078: stloc.s V_6 - IL_007a: br.s IL_0091 - - IL_007c: ldloc.s V_5 - IL_007e: ldloc.s V_6 - IL_0080: conv.i - IL_0081: ldloc.s V_7 - IL_0083: stelem.i8 - IL_0084: ldloc.s V_7 - IL_0086: ldloc.1 - IL_0087: add - IL_0088: stloc.s V_7 - IL_008a: ldloc.s V_6 - IL_008c: ldc.i4.1 - IL_008d: conv.i8 - IL_008e: add - IL_008f: stloc.s V_6 - IL_0091: ldloc.s V_6 - IL_0093: ldc.i4.0 - IL_0094: conv.i8 - IL_0095: bgt.un.s IL_007c - - IL_0097: nop - IL_0098: br.s IL_00c5 - - IL_009a: ldloc.3 - IL_009b: ldc.i4.1 - IL_009c: conv.i8 - IL_009d: add.ovf.un - IL_009e: stloc.s V_6 - IL_00a0: ldc.i4.0 - IL_00a1: conv.i8 - IL_00a2: stloc.s V_7 - IL_00a4: ldloc.0 - IL_00a5: stloc.s V_8 - IL_00a7: br.s IL_00be - - IL_00a9: ldloc.s V_5 - IL_00ab: ldloc.s V_7 - IL_00ad: conv.i - IL_00ae: ldloc.s V_8 - IL_00b0: stelem.i8 - IL_00b1: ldloc.s V_8 - IL_00b3: ldloc.1 - IL_00b4: add - IL_00b5: stloc.s V_8 - IL_00b7: ldloc.s V_7 - IL_00b9: ldc.i4.1 - IL_00ba: conv.i8 - IL_00bb: add - IL_00bc: stloc.s V_7 - IL_00be: ldloc.s V_7 - IL_00c0: ldloc.s V_6 - IL_00c2: blt.un.s IL_00a9 + IL_0067: ldc.i4.1 + IL_0068: conv.i8 + IL_0069: bge.un.s IL_0071 - IL_00c4: nop - IL_00c5: ldloc.s V_5 - IL_00c7: ret + IL_006b: call !!0[] [runtime]System.Array::Empty() + IL_0070: ret + + IL_0071: ldloc.s V_5 + IL_0073: conv.ovf.i.un + IL_0074: newarr [runtime]System.UInt64 + IL_0079: stloc.s V_6 + IL_007b: ldloc.s V_4 + IL_007d: brfalse.s IL_00bb + + IL_007f: ldc.i4.0 + IL_0080: conv.i8 + IL_0081: stloc.s V_7 + IL_0083: ldloc.0 + IL_0084: stloc.s V_8 + IL_0086: ldloc.s V_6 + IL_0088: ldloc.s V_7 + IL_008a: conv.i + IL_008b: ldloc.s V_8 + IL_008d: stelem.i8 + IL_008e: ldloc.s V_8 + IL_0090: ldloc.1 + IL_0091: add + IL_0092: stloc.s V_8 + IL_0094: ldloc.s V_7 + IL_0096: ldc.i4.1 + IL_0097: conv.i8 + IL_0098: add + IL_0099: stloc.s V_7 + IL_009b: br.s IL_00b2 + + IL_009d: ldloc.s V_6 + IL_009f: ldloc.s V_7 + IL_00a1: conv.i + IL_00a2: ldloc.s V_8 + IL_00a4: stelem.i8 + IL_00a5: ldloc.s V_8 + IL_00a7: ldloc.1 + IL_00a8: add + IL_00a9: stloc.s V_8 + IL_00ab: ldloc.s V_7 + IL_00ad: ldc.i4.1 + IL_00ae: conv.i8 + IL_00af: add + IL_00b0: stloc.s V_7 + IL_00b2: ldloc.s V_7 + IL_00b4: ldc.i4.0 + IL_00b5: conv.i8 + IL_00b6: bgt.un.s IL_009d + + IL_00b8: nop + IL_00b9: br.s IL_0105 + + IL_00bb: ldloc.1 + IL_00bc: brtrue.s IL_00ca + + IL_00be: ldloc.0 + IL_00bf: ldloc.1 + IL_00c0: ldloc.2 + IL_00c1: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_00c6: pop + IL_00c7: nop + IL_00c8: br.s IL_00cb + + IL_00ca: nop + IL_00cb: ldloc.2 + IL_00cc: ldloc.0 + IL_00cd: bge.un.s IL_00d4 + + IL_00cf: ldc.i4.0 + IL_00d0: conv.i8 + IL_00d1: nop + IL_00d2: br.s IL_00de + + IL_00d4: ldloc.2 + IL_00d5: ldloc.0 + IL_00d6: sub + IL_00d7: ldloc.1 + IL_00d8: conv.i8 + IL_00d9: div.un + IL_00da: ldc.i4.1 + IL_00db: conv.i8 + IL_00dc: add.ovf.un + IL_00dd: nop + IL_00de: stloc.s V_7 + IL_00e0: ldc.i4.0 + IL_00e1: conv.i8 + IL_00e2: stloc.s V_8 + IL_00e4: ldloc.0 + IL_00e5: stloc.s V_9 + IL_00e7: br.s IL_00fe + + IL_00e9: ldloc.s V_6 + IL_00eb: ldloc.s V_8 + IL_00ed: conv.i + IL_00ee: ldloc.s V_9 + IL_00f0: stelem.i8 + IL_00f1: ldloc.s V_9 + IL_00f3: ldloc.1 + IL_00f4: add + IL_00f5: stloc.s V_9 + IL_00f7: ldloc.s V_8 + IL_00f9: ldc.i4.1 + IL_00fa: conv.i8 + IL_00fb: add + IL_00fc: stloc.s V_8 + IL_00fe: ldloc.s V_8 + IL_0100: ldloc.s V_7 + IL_0102: blt.un.s IL_00e9 + + IL_0104: nop + IL_0105: ldloc.s V_6 + IL_0107: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs index 0b67ae93dee..b1236c04160 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs @@ -19,4 +19,4 @@ let f18 (f: unit -> uint64) g = [f ()..g()] let f19 f = [f ()..1UL..10UL] let f20 f = [1UL..f ()..10UL] let f21 f = [1UL..1UL..f ()] -let f22 (f: unit -> uint64) g h= [f ()..g ()..h ()] +let f22 (f: unit -> uint64) g h = [f ()..g ()..h ()] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl index 4d233c1912a..f9a07543892 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl @@ -370,42 +370,54 @@ IL_004f: bgt.un.s IL_0036 IL_0051: nop - IL_0052: br.s IL_0080 - - IL_0054: ldloc.0 - IL_0055: ldc.i4.1 - IL_0056: conv.i8 - IL_0057: add.ovf.un - IL_0058: stloc.3 - IL_0059: ldc.i4.0 - IL_005a: conv.i8 - IL_005b: stloc.s V_4 - IL_005d: ldarg.0 - IL_005e: stloc.s V_5 - IL_0060: br.s IL_007a - - IL_0062: ldloca.s V_2 - IL_0064: ldloc.s V_5 - IL_0066: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006b: nop - IL_006c: ldloc.s V_5 - IL_006e: ldc.i4.1 - IL_006f: conv.i8 - IL_0070: add - IL_0071: stloc.s V_5 - IL_0073: ldloc.s V_4 - IL_0075: ldc.i4.1 - IL_0076: conv.i8 - IL_0077: add - IL_0078: stloc.s V_4 - IL_007a: ldloc.s V_4 - IL_007c: ldloc.3 - IL_007d: blt.un.s IL_0062 - - IL_007f: nop - IL_0080: ldloca.s V_2 - IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0087: ret + IL_0052: br.s IL_008c + + IL_0054: ldarg.1 + IL_0055: ldarg.0 + IL_0056: bge.un.s IL_005d + + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: nop + IL_005b: br.s IL_0064 + + IL_005d: ldarg.1 + IL_005e: ldarg.0 + IL_005f: sub + IL_0060: ldc.i4.1 + IL_0061: conv.i8 + IL_0062: add.ovf.un + IL_0063: nop + IL_0064: stloc.3 + IL_0065: ldc.i4.0 + IL_0066: conv.i8 + IL_0067: stloc.s V_4 + IL_0069: ldarg.0 + IL_006a: stloc.s V_5 + IL_006c: br.s IL_0086 + + IL_006e: ldloca.s V_2 + IL_0070: ldloc.s V_5 + IL_0072: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0077: nop + IL_0078: ldloc.s V_5 + IL_007a: ldc.i4.1 + IL_007b: conv.i8 + IL_007c: add + IL_007d: stloc.s V_5 + IL_007f: ldloc.s V_4 + IL_0081: ldc.i4.1 + IL_0082: conv.i8 + IL_0083: add + IL_0084: stloc.s V_4 + IL_0086: ldloc.s V_4 + IL_0088: ldloc.3 + IL_0089: blt.un.s IL_006e + + IL_008b: nop + IL_008c: ldloca.s V_2 + IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0093: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f9(uint64 start) cil managed @@ -471,11 +483,9 @@ .maxstack 5 .locals init (uint64 V_0, - bool V_1, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, - uint64 V_4, - uint64 V_5) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) IL_0000: nop IL_0001: ldarg.0 IL_0002: brtrue.s IL_0013 @@ -502,7 +512,7 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_002a + IL_001e: br.s IL_002d IL_0020: ldc.i4.s 10 IL_0022: conv.i8 @@ -512,92 +522,39 @@ IL_0026: ldarg.0 IL_0027: conv.i8 IL_0028: div.un - IL_0029: nop - IL_002a: stloc.0 - IL_002b: ldloc.0 - IL_002c: ldc.i4.m1 - IL_002d: conv.i8 - IL_002e: ceq - IL_0030: stloc.1 - IL_0031: ldloc.1 - IL_0032: brfalse.s IL_006f - - IL_0034: ldc.i4.0 - IL_0035: conv.i8 - IL_0036: stloc.3 - IL_0037: ldc.i4.1 - IL_0038: conv.i8 - IL_0039: stloc.s V_4 - IL_003b: ldloca.s V_2 - IL_003d: ldloc.s V_4 - IL_003f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0044: nop - IL_0045: ldloc.s V_4 - IL_0047: ldarg.0 - IL_0048: add - IL_0049: stloc.s V_4 - IL_004b: ldloc.3 - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add - IL_004f: stloc.3 - IL_0050: br.s IL_0067 - - IL_0052: ldloca.s V_2 - IL_0054: ldloc.s V_4 - IL_0056: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_005b: nop - IL_005c: ldloc.s V_4 - IL_005e: ldarg.0 - IL_005f: add - IL_0060: stloc.s V_4 - IL_0062: ldloc.3 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: add - IL_0066: stloc.3 - IL_0067: ldloc.3 - IL_0068: ldc.i4.0 - IL_0069: conv.i8 - IL_006a: bgt.un.s IL_0052 - - IL_006c: nop - IL_006d: br.s IL_009b - - IL_006f: ldloc.0 - IL_0070: ldc.i4.1 - IL_0071: conv.i8 - IL_0072: add.ovf.un - IL_0073: stloc.3 - IL_0074: ldc.i4.0 - IL_0075: conv.i8 - IL_0076: stloc.s V_4 - IL_0078: ldc.i4.1 - IL_0079: conv.i8 - IL_007a: stloc.s V_5 - IL_007c: br.s IL_0095 - - IL_007e: ldloca.s V_2 - IL_0080: ldloc.s V_5 - IL_0082: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0087: nop - IL_0088: ldloc.s V_5 - IL_008a: ldarg.0 - IL_008b: add - IL_008c: stloc.s V_5 - IL_008e: ldloc.s V_4 - IL_0090: ldc.i4.1 - IL_0091: conv.i8 - IL_0092: add - IL_0093: stloc.s V_4 - IL_0095: ldloc.s V_4 - IL_0097: ldloc.3 - IL_0098: blt.un.s IL_007e + IL_0029: ldc.i4.1 + IL_002a: conv.i8 + IL_002b: add.ovf.un + IL_002c: nop + IL_002d: stloc.0 + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: stloc.2 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: stloc.3 + IL_0034: br.s IL_0048 - IL_009a: nop - IL_009b: ldloca.s V_2 - IL_009d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00a2: ret + IL_0036: ldloca.s V_1 + IL_0038: ldloc.3 + IL_0039: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003e: nop + IL_003f: ldloc.3 + IL_0040: ldarg.0 + IL_0041: add + IL_0042: stloc.3 + IL_0043: ldloc.2 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: add + IL_0047: stloc.2 + IL_0048: ldloc.2 + IL_0049: ldloc.0 + IL_004a: blt.un.s IL_0036 + + IL_004c: ldloca.s V_1 + IL_004e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0053: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f11(uint64 finish) cil managed @@ -667,11 +624,9 @@ .maxstack 5 .locals init (uint64 V_0, - bool V_1, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, - uint64 V_4, - uint64 V_5) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) IL_0000: nop IL_0001: ldarg.1 IL_0002: brtrue.s IL_0012 @@ -696,7 +651,7 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_0027 + IL_001c: br.s IL_002a IL_001e: ldc.i4.s 10 IL_0020: conv.i8 @@ -705,90 +660,38 @@ IL_0023: ldarg.1 IL_0024: conv.i8 IL_0025: div.un - IL_0026: nop - IL_0027: stloc.0 - IL_0028: ldloc.0 - IL_0029: ldc.i4.m1 - IL_002a: conv.i8 - IL_002b: ceq - IL_002d: stloc.1 - IL_002e: ldloc.1 - IL_002f: brfalse.s IL_006b + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add.ovf.un + IL_0029: nop + IL_002a: stloc.0 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: stloc.2 + IL_002e: ldarg.0 + IL_002f: stloc.3 + IL_0030: br.s IL_0044 - IL_0031: ldc.i4.0 - IL_0032: conv.i8 - IL_0033: stloc.3 - IL_0034: ldarg.0 - IL_0035: stloc.s V_4 - IL_0037: ldloca.s V_2 - IL_0039: ldloc.s V_4 - IL_003b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0040: nop - IL_0041: ldloc.s V_4 - IL_0043: ldarg.1 - IL_0044: add - IL_0045: stloc.s V_4 - IL_0047: ldloc.3 - IL_0048: ldc.i4.1 - IL_0049: conv.i8 - IL_004a: add - IL_004b: stloc.3 - IL_004c: br.s IL_0063 - - IL_004e: ldloca.s V_2 - IL_0050: ldloc.s V_4 - IL_0052: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0057: nop - IL_0058: ldloc.s V_4 - IL_005a: ldarg.1 - IL_005b: add - IL_005c: stloc.s V_4 - IL_005e: ldloc.3 - IL_005f: ldc.i4.1 - IL_0060: conv.i8 - IL_0061: add - IL_0062: stloc.3 - IL_0063: ldloc.3 - IL_0064: ldc.i4.0 - IL_0065: conv.i8 - IL_0066: bgt.un.s IL_004e - - IL_0068: nop - IL_0069: br.s IL_0096 - - IL_006b: ldloc.0 - IL_006c: ldc.i4.1 - IL_006d: conv.i8 - IL_006e: add.ovf.un - IL_006f: stloc.3 - IL_0070: ldc.i4.0 - IL_0071: conv.i8 - IL_0072: stloc.s V_4 - IL_0074: ldarg.0 - IL_0075: stloc.s V_5 - IL_0077: br.s IL_0090 - - IL_0079: ldloca.s V_2 - IL_007b: ldloc.s V_5 - IL_007d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0082: nop - IL_0083: ldloc.s V_5 - IL_0085: ldarg.1 - IL_0086: add - IL_0087: stloc.s V_5 - IL_0089: ldloc.s V_4 - IL_008b: ldc.i4.1 - IL_008c: conv.i8 - IL_008d: add - IL_008e: stloc.s V_4 - IL_0090: ldloc.s V_4 - IL_0092: ldloc.3 - IL_0093: blt.un.s IL_0079 - - IL_0095: nop - IL_0096: ldloca.s V_2 - IL_0098: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_009d: ret + IL_0032: ldloca.s V_1 + IL_0034: ldloc.3 + IL_0035: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003a: nop + IL_003b: ldloc.3 + IL_003c: ldarg.1 + IL_003d: add + IL_003e: stloc.3 + IL_003f: ldloc.2 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.2 + IL_0044: ldloc.2 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0032 + + IL_0048: ldloca.s V_1 + IL_004a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004f: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -868,42 +771,54 @@ IL_004f: bgt.un.s IL_0036 IL_0051: nop - IL_0052: br.s IL_0080 - - IL_0054: ldloc.0 - IL_0055: ldc.i4.1 - IL_0056: conv.i8 - IL_0057: add.ovf.un - IL_0058: stloc.3 - IL_0059: ldc.i4.0 - IL_005a: conv.i8 - IL_005b: stloc.s V_4 - IL_005d: ldarg.0 - IL_005e: stloc.s V_5 - IL_0060: br.s IL_007a - - IL_0062: ldloca.s V_2 - IL_0064: ldloc.s V_5 - IL_0066: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006b: nop - IL_006c: ldloc.s V_5 - IL_006e: ldc.i4.1 - IL_006f: conv.i8 - IL_0070: add - IL_0071: stloc.s V_5 - IL_0073: ldloc.s V_4 - IL_0075: ldc.i4.1 - IL_0076: conv.i8 - IL_0077: add - IL_0078: stloc.s V_4 - IL_007a: ldloc.s V_4 - IL_007c: ldloc.3 - IL_007d: blt.un.s IL_0062 - - IL_007f: nop - IL_0080: ldloca.s V_2 - IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0087: ret + IL_0052: br.s IL_008c + + IL_0054: ldarg.1 + IL_0055: ldarg.0 + IL_0056: bge.un.s IL_005d + + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: nop + IL_005b: br.s IL_0064 + + IL_005d: ldarg.1 + IL_005e: ldarg.0 + IL_005f: sub + IL_0060: ldc.i4.1 + IL_0061: conv.i8 + IL_0062: add.ovf.un + IL_0063: nop + IL_0064: stloc.3 + IL_0065: ldc.i4.0 + IL_0066: conv.i8 + IL_0067: stloc.s V_4 + IL_0069: ldarg.0 + IL_006a: stloc.s V_5 + IL_006c: br.s IL_0086 + + IL_006e: ldloca.s V_2 + IL_0070: ldloc.s V_5 + IL_0072: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0077: nop + IL_0078: ldloc.s V_5 + IL_007a: ldc.i4.1 + IL_007b: conv.i8 + IL_007c: add + IL_007d: stloc.s V_5 + IL_007f: ldloc.s V_4 + IL_0081: ldc.i4.1 + IL_0082: conv.i8 + IL_0083: add + IL_0084: stloc.s V_4 + IL_0086: ldloc.s V_4 + IL_0088: ldloc.3 + IL_0089: blt.un.s IL_006e + + IL_008b: nop + IL_008c: ldloca.s V_2 + IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0093: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -914,11 +829,9 @@ .maxstack 5 .locals init (uint64 V_0, - bool V_1, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, - uint64 V_4, - uint64 V_5) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) IL_0000: nop IL_0001: ldarg.0 IL_0002: brtrue.s IL_0011 @@ -943,7 +856,7 @@ IL_0017: ldc.i4.0 IL_0018: conv.i8 IL_0019: nop - IL_001a: br.s IL_0024 + IL_001a: br.s IL_0027 IL_001c: ldarg.1 IL_001d: ldc.i4.1 @@ -952,92 +865,39 @@ IL_0020: ldarg.0 IL_0021: conv.i8 IL_0022: div.un - IL_0023: nop - IL_0024: stloc.0 - IL_0025: ldloc.0 - IL_0026: ldc.i4.m1 - IL_0027: conv.i8 - IL_0028: ceq - IL_002a: stloc.1 - IL_002b: ldloc.1 - IL_002c: brfalse.s IL_0069 - - IL_002e: ldc.i4.0 - IL_002f: conv.i8 - IL_0030: stloc.3 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: stloc.s V_4 - IL_0035: ldloca.s V_2 - IL_0037: ldloc.s V_4 - IL_0039: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_003e: nop - IL_003f: ldloc.s V_4 - IL_0041: ldarg.0 - IL_0042: add - IL_0043: stloc.s V_4 - IL_0045: ldloc.3 - IL_0046: ldc.i4.1 - IL_0047: conv.i8 - IL_0048: add - IL_0049: stloc.3 - IL_004a: br.s IL_0061 - - IL_004c: ldloca.s V_2 - IL_004e: ldloc.s V_4 - IL_0050: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0055: nop - IL_0056: ldloc.s V_4 - IL_0058: ldarg.0 - IL_0059: add - IL_005a: stloc.s V_4 - IL_005c: ldloc.3 - IL_005d: ldc.i4.1 - IL_005e: conv.i8 - IL_005f: add - IL_0060: stloc.3 - IL_0061: ldloc.3 - IL_0062: ldc.i4.0 - IL_0063: conv.i8 - IL_0064: bgt.un.s IL_004c + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add.ovf.un + IL_0026: nop + IL_0027: stloc.0 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: stloc.3 + IL_002e: br.s IL_0042 - IL_0066: nop - IL_0067: br.s IL_0095 - - IL_0069: ldloc.0 - IL_006a: ldc.i4.1 - IL_006b: conv.i8 - IL_006c: add.ovf.un - IL_006d: stloc.3 - IL_006e: ldc.i4.0 - IL_006f: conv.i8 - IL_0070: stloc.s V_4 - IL_0072: ldc.i4.1 - IL_0073: conv.i8 - IL_0074: stloc.s V_5 - IL_0076: br.s IL_008f - - IL_0078: ldloca.s V_2 - IL_007a: ldloc.s V_5 - IL_007c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0081: nop - IL_0082: ldloc.s V_5 - IL_0084: ldarg.0 - IL_0085: add - IL_0086: stloc.s V_5 - IL_0088: ldloc.s V_4 - IL_008a: ldc.i4.1 - IL_008b: conv.i8 - IL_008c: add - IL_008d: stloc.s V_4 - IL_008f: ldloc.s V_4 - IL_0091: ldloc.3 - IL_0092: blt.un.s IL_0078 - - IL_0094: nop - IL_0095: ldloca.s V_2 - IL_0097: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_009c: ret + IL_0030: ldloca.s V_1 + IL_0032: ldloc.3 + IL_0033: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0038: nop + IL_0039: ldloc.3 + IL_003a: ldarg.0 + IL_003b: add + IL_003c: stloc.3 + IL_003d: ldloc.2 + IL_003e: ldc.i4.1 + IL_003f: conv.i8 + IL_0040: add + IL_0041: stloc.2 + IL_0042: ldloc.2 + IL_0043: ldloc.0 + IL_0044: blt.un.s IL_0030 + + IL_0046: ldloca.s V_1 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -1134,41 +994,70 @@ IL_0060: bgt.un.s IL_0048 IL_0062: nop - IL_0063: br.s IL_0090 - - IL_0065: ldloc.0 - IL_0066: ldc.i4.1 - IL_0067: conv.i8 - IL_0068: add.ovf.un - IL_0069: stloc.3 - IL_006a: ldc.i4.0 - IL_006b: conv.i8 - IL_006c: stloc.s V_4 - IL_006e: ldarg.0 - IL_006f: stloc.s V_5 - IL_0071: br.s IL_008a - - IL_0073: ldloca.s V_2 - IL_0075: ldloc.s V_5 - IL_0077: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_007c: nop - IL_007d: ldloc.s V_5 - IL_007f: ldarg.1 - IL_0080: add - IL_0081: stloc.s V_5 - IL_0083: ldloc.s V_4 - IL_0085: ldc.i4.1 - IL_0086: conv.i8 - IL_0087: add - IL_0088: stloc.s V_4 - IL_008a: ldloc.s V_4 - IL_008c: ldloc.3 - IL_008d: blt.un.s IL_0073 - - IL_008f: nop - IL_0090: ldloca.s V_2 - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0097: ret + IL_0063: br.s IL_00af + + IL_0065: ldarg.1 + IL_0066: brtrue.s IL_0074 + + IL_0068: ldarg.0 + IL_0069: ldarg.1 + IL_006a: ldarg.2 + IL_006b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0070: pop + IL_0071: nop + IL_0072: br.s IL_0075 + + IL_0074: nop + IL_0075: ldarg.2 + IL_0076: ldarg.0 + IL_0077: bge.un.s IL_007e + + IL_0079: ldc.i4.0 + IL_007a: conv.i8 + IL_007b: nop + IL_007c: br.s IL_0088 + + IL_007e: ldarg.2 + IL_007f: ldarg.0 + IL_0080: sub + IL_0081: ldarg.1 + IL_0082: conv.i8 + IL_0083: div.un + IL_0084: ldc.i4.1 + IL_0085: conv.i8 + IL_0086: add.ovf.un + IL_0087: nop + IL_0088: stloc.3 + IL_0089: ldc.i4.0 + IL_008a: conv.i8 + IL_008b: stloc.s V_4 + IL_008d: ldarg.0 + IL_008e: stloc.s V_5 + IL_0090: br.s IL_00a9 + + IL_0092: ldloca.s V_2 + IL_0094: ldloc.s V_5 + IL_0096: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_009b: nop + IL_009c: ldloc.s V_5 + IL_009e: ldarg.1 + IL_009f: add + IL_00a0: stloc.s V_5 + IL_00a2: ldloc.s V_4 + IL_00a4: ldc.i4.1 + IL_00a5: conv.i8 + IL_00a6: add + IL_00a7: stloc.s V_4 + IL_00a9: ldloc.s V_4 + IL_00ab: ldloc.3 + IL_00ac: blt.un.s IL_0092 + + IL_00ae: nop + IL_00af: ldloca.s V_2 + IL_00b1: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b6: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1382,42 +1271,54 @@ IL_0064: bgt.un.s IL_0048 IL_0066: nop - IL_0067: br.s IL_0097 - - IL_0069: ldloc.2 - IL_006a: ldc.i4.1 - IL_006b: conv.i8 - IL_006c: add.ovf.un - IL_006d: stloc.s V_5 - IL_006f: ldc.i4.0 - IL_0070: conv.i8 - IL_0071: stloc.s V_6 - IL_0073: ldloc.0 - IL_0074: stloc.s V_7 - IL_0076: br.s IL_0090 + IL_0067: br.s IL_00a3 - IL_0078: ldloca.s V_4 - IL_007a: ldloc.s V_7 - IL_007c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0081: nop - IL_0082: ldloc.s V_7 - IL_0084: ldc.i4.1 - IL_0085: conv.i8 - IL_0086: add - IL_0087: stloc.s V_7 - IL_0089: ldloc.s V_6 - IL_008b: ldc.i4.1 - IL_008c: conv.i8 - IL_008d: add - IL_008e: stloc.s V_6 - IL_0090: ldloc.s V_6 - IL_0092: ldloc.s V_5 - IL_0094: blt.un.s IL_0078 - - IL_0096: nop - IL_0097: ldloca.s V_4 - IL_0099: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_009e: ret + IL_0069: ldloc.1 + IL_006a: ldloc.0 + IL_006b: bge.un.s IL_0072 + + IL_006d: ldc.i4.0 + IL_006e: conv.i8 + IL_006f: nop + IL_0070: br.s IL_0079 + + IL_0072: ldloc.1 + IL_0073: ldloc.0 + IL_0074: sub + IL_0075: ldc.i4.1 + IL_0076: conv.i8 + IL_0077: add.ovf.un + IL_0078: nop + IL_0079: stloc.s V_5 + IL_007b: ldc.i4.0 + IL_007c: conv.i8 + IL_007d: stloc.s V_6 + IL_007f: ldloc.0 + IL_0080: stloc.s V_7 + IL_0082: br.s IL_009c + + IL_0084: ldloca.s V_4 + IL_0086: ldloc.s V_7 + IL_0088: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_008d: nop + IL_008e: ldloc.s V_7 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add + IL_0093: stloc.s V_7 + IL_0095: ldloc.s V_6 + IL_0097: ldc.i4.1 + IL_0098: conv.i8 + IL_0099: add + IL_009a: stloc.s V_6 + IL_009c: ldloc.s V_6 + IL_009e: ldloc.s V_5 + IL_00a0: blt.un.s IL_0084 + + IL_00a2: nop + IL_00a3: ldloca.s V_4 + IL_00a5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00aa: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1488,11 +1389,9 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - bool V_2, - valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, - uint64 V_4, - uint64 V_5, - uint64 V_6) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1522,7 +1421,7 @@ IL_0022: ldc.i4.0 IL_0023: conv.i8 IL_0024: nop - IL_0025: br.s IL_0031 + IL_0025: br.s IL_0034 IL_0027: ldc.i4.s 10 IL_0029: conv.i8 @@ -1532,92 +1431,39 @@ IL_002d: ldloc.0 IL_002e: conv.i8 IL_002f: div.un - IL_0030: nop - IL_0031: stloc.1 - IL_0032: ldloc.1 - IL_0033: ldc.i4.m1 - IL_0034: conv.i8 - IL_0035: ceq - IL_0037: stloc.2 - IL_0038: ldloc.2 - IL_0039: brfalse.s IL_007c - - IL_003b: ldc.i4.0 - IL_003c: conv.i8 - IL_003d: stloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: stloc.s V_5 - IL_0043: ldloca.s V_3 - IL_0045: ldloc.s V_5 - IL_0047: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_004c: nop - IL_004d: ldloc.s V_5 - IL_004f: ldloc.0 - IL_0050: add - IL_0051: stloc.s V_5 - IL_0053: ldloc.s V_4 - IL_0055: ldc.i4.1 - IL_0056: conv.i8 - IL_0057: add - IL_0058: stloc.s V_4 - IL_005a: br.s IL_0073 - - IL_005c: ldloca.s V_3 - IL_005e: ldloc.s V_5 - IL_0060: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0065: nop - IL_0066: ldloc.s V_5 - IL_0068: ldloc.0 - IL_0069: add - IL_006a: stloc.s V_5 - IL_006c: ldloc.s V_4 - IL_006e: ldc.i4.1 - IL_006f: conv.i8 - IL_0070: add - IL_0071: stloc.s V_4 - IL_0073: ldloc.s V_4 - IL_0075: ldc.i4.0 - IL_0076: conv.i8 - IL_0077: bgt.un.s IL_005c - - IL_0079: nop - IL_007a: br.s IL_00aa + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add.ovf.un + IL_0033: nop + IL_0034: stloc.1 + IL_0035: ldc.i4.0 + IL_0036: conv.i8 + IL_0037: stloc.3 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: stloc.s V_4 + IL_003c: br.s IL_0053 - IL_007c: ldloc.1 - IL_007d: ldc.i4.1 - IL_007e: conv.i8 - IL_007f: add.ovf.un - IL_0080: stloc.s V_4 - IL_0082: ldc.i4.0 - IL_0083: conv.i8 - IL_0084: stloc.s V_5 - IL_0086: ldc.i4.1 - IL_0087: conv.i8 - IL_0088: stloc.s V_6 - IL_008a: br.s IL_00a3 - - IL_008c: ldloca.s V_3 - IL_008e: ldloc.s V_6 - IL_0090: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0095: nop - IL_0096: ldloc.s V_6 - IL_0098: ldloc.0 - IL_0099: add - IL_009a: stloc.s V_6 - IL_009c: ldloc.s V_5 - IL_009e: ldc.i4.1 - IL_009f: conv.i8 - IL_00a0: add - IL_00a1: stloc.s V_5 - IL_00a3: ldloc.s V_5 - IL_00a5: ldloc.s V_4 - IL_00a7: blt.un.s IL_008c - - IL_00a9: nop - IL_00aa: ldloca.s V_3 - IL_00ac: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00b1: ret + IL_003e: ldloca.s V_2 + IL_0040: ldloc.s V_4 + IL_0042: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0047: nop + IL_0048: ldloc.s V_4 + IL_004a: ldloc.0 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.3 + IL_004f: ldc.i4.1 + IL_0050: conv.i8 + IL_0051: add + IL_0052: stloc.3 + IL_0053: ldloc.3 + IL_0054: ldloc.1 + IL_0055: blt.un.s IL_003e + + IL_0057: ldloca.s V_2 + IL_0059: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_005e: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1791,41 +1637,70 @@ IL_007f: bgt.un.s IL_0064 IL_0081: nop - IL_0082: br.s IL_00b1 - - IL_0084: ldloc.3 - IL_0085: ldc.i4.1 - IL_0086: conv.i8 - IL_0087: add.ovf.un - IL_0088: stloc.s V_6 - IL_008a: ldc.i4.0 - IL_008b: conv.i8 - IL_008c: stloc.s V_7 - IL_008e: ldloc.0 - IL_008f: stloc.s V_8 - IL_0091: br.s IL_00aa - - IL_0093: ldloca.s V_5 - IL_0095: ldloc.s V_8 - IL_0097: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_009c: nop - IL_009d: ldloc.s V_8 - IL_009f: ldloc.1 - IL_00a0: add - IL_00a1: stloc.s V_8 - IL_00a3: ldloc.s V_7 - IL_00a5: ldc.i4.1 - IL_00a6: conv.i8 - IL_00a7: add - IL_00a8: stloc.s V_7 - IL_00aa: ldloc.s V_7 - IL_00ac: ldloc.s V_6 - IL_00ae: blt.un.s IL_0093 - - IL_00b0: nop - IL_00b1: ldloca.s V_5 - IL_00b3: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00b8: ret + IL_0082: br.s IL_00d0 + + IL_0084: ldloc.1 + IL_0085: brtrue.s IL_0093 + + IL_0087: ldloc.0 + IL_0088: ldloc.1 + IL_0089: ldloc.2 + IL_008a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_008f: pop + IL_0090: nop + IL_0091: br.s IL_0094 + + IL_0093: nop + IL_0094: ldloc.2 + IL_0095: ldloc.0 + IL_0096: bge.un.s IL_009d + + IL_0098: ldc.i4.0 + IL_0099: conv.i8 + IL_009a: nop + IL_009b: br.s IL_00a7 + + IL_009d: ldloc.2 + IL_009e: ldloc.0 + IL_009f: sub + IL_00a0: ldloc.1 + IL_00a1: conv.i8 + IL_00a2: div.un + IL_00a3: ldc.i4.1 + IL_00a4: conv.i8 + IL_00a5: add.ovf.un + IL_00a6: nop + IL_00a7: stloc.s V_6 + IL_00a9: ldc.i4.0 + IL_00aa: conv.i8 + IL_00ab: stloc.s V_7 + IL_00ad: ldloc.0 + IL_00ae: stloc.s V_8 + IL_00b0: br.s IL_00c9 + + IL_00b2: ldloca.s V_5 + IL_00b4: ldloc.s V_8 + IL_00b6: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00bb: nop + IL_00bc: ldloc.s V_8 + IL_00be: ldloc.1 + IL_00bf: add + IL_00c0: stloc.s V_8 + IL_00c2: ldloc.s V_7 + IL_00c4: ldc.i4.1 + IL_00c5: conv.i8 + IL_00c6: add + IL_00c7: stloc.s V_7 + IL_00c9: ldloc.s V_7 + IL_00cb: ldloc.s V_6 + IL_00cd: blt.un.s IL_00b2 + + IL_00cf: nop + IL_00d0: ldloca.s V_5 + IL_00d2: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00d7: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs new file mode 100644 index 00000000000..49cff9ad490 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs @@ -0,0 +1,57 @@ +let mutable c = 0uy + +let f0 () = + for n in 10uy..1uy do + c <- n + +let f00 () = + for n in 10uy..1uy..1uy do + c <- n + +let f1 () = + for n in 1uy..10uy do + c <- n + +let f2uy start = + for n in start..10uy do + c <- n + +let f3uy finish = + for n in 1uy..finish do + c <- n + +let f4uy (start: byte) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1uy..1uy..10uy do + c <- n + +let f6 () = + for n in 1uy..2uy..10uy do + c <- n + +let f7uy start = + for n in start..2uy..10uy do + c <- n + +let f8uy step = + for n in 1uy..step..10uy do + c <- n + +let f9uy finish = + for n in 1uy..2uy..finish do + c <- n + +let f10uy (start: byte) step finish = + for n in finish..step..finish do + c <- n + +let f11uy start finish = + for n in start..0uy..finish do + c <- n + +let f12 () = + for n in 1uy..0uy..10uy do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl new file mode 100644 index 00000000000..561394e0e95 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl @@ -0,0 +1,677 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.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 specialname static uint8 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint8 ''.$assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint8 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint8 ''.$assembly::c@1 + IL_0006: ret + } + + .method public static void f0() cil managed + { + + .maxstack 4 + .locals init (uint8 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f00() cil managed + { + + .maxstack 4 + .locals init (uint8 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void f1() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f2uy(uint8 start) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0012 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i2 + IL_000c: ldarg.0 + IL_000d: conv.i2 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint8) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f3uy(uint8 finish) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.0 + IL_0009: conv.i2 + IL_000a: ldc.i4.1 + IL_000b: conv.i2 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(uint8) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f4uy(uint8 start, + uint8 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 (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0010 + + IL_0008: ldarg.1 + IL_0009: conv.i2 + IL_000a: ldarg.0 + IL_000b: conv.i2 + IL_000c: sub + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: nop + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(uint8) + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f5() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void f6() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.2 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7uy(uint8 start) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0014 + + IL_0009: ldc.i4.s 10 + IL_000b: conv.i2 + IL_000c: ldarg.0 + IL_000d: conv.i2 + IL_000e: sub + IL_000f: ldc.i4.2 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: stloc.1 + IL_0017: ldarg.0 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(uint8) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret + } + + .method public static void f8uy(uint8 step) cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 10 + IL_0013: conv.i2 + IL_0014: ldc.i4.1 + IL_0015: conv.i2 + IL_0016: sub + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stloc.0 + IL_001c: ldc.i4.0 + IL_001d: stloc.1 + IL_001e: ldc.i4.1 + IL_001f: stloc.2 + IL_0020: br.s IL_0030 + + IL_0022: ldloc.2 + IL_0023: call void assembly::set_c(uint8) + IL_0028: ldloc.2 + IL_0029: ldarg.0 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.1 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.1 + IL_0030: ldloc.1 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_0022 + + IL_0034: ret + } + + .method public static void f9uy(uint8 finish) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_0012 + + IL_0008: ldarg.0 + IL_0009: conv.i2 + IL_000a: ldc.i4.1 + IL_000b: conv.i2 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.1 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint8) + IL_001f: ldloc.2 + IL_0020: ldc.i4.2 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void f10uy(uint8 start, + uint8 step, + uint8 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 (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0018 + + IL_0014: ldc.i4.0 + IL_0015: nop + IL_0016: br.s IL_0022 + + IL_0018: ldarg.2 + IL_0019: conv.i2 + IL_001a: ldarg.2 + IL_001b: conv.i2 + IL_001c: sub + IL_001d: ldarg.1 + IL_001e: div.un + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: nop + IL_0022: stloc.0 + IL_0023: ldc.i4.0 + IL_0024: stloc.1 + IL_0025: ldarg.2 + IL_0026: stloc.2 + IL_0027: br.s IL_0037 + + IL_0029: ldloc.2 + IL_002a: call void assembly::set_c(uint8) + IL_002f: ldloc.2 + IL_0030: ldarg.1 + IL_0031: add + IL_0032: stloc.2 + IL_0033: ldloc.1 + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: stloc.1 + IL_0037: ldloc.1 + IL_0038: ldloc.0 + IL_0039: blt.un.s IL_0029 + + IL_003b: ret + } + + .method public static void f11uy(uint8 start, + uint8 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 6 + .locals init (int32 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldarg.0 + IL_0016: ldc.i4.0 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_001d: pop + IL_001e: ldc.i4.m1 + IL_001f: blt.un.s IL_0006 + + IL_0021: ret + } + + .method public static void f12() cil managed + { + + .maxstack 6 + .locals init (int32 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.s 10 + IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_001e: pop + IL_001f: ldc.i4.m1 + IL_0020: blt.un.s IL_0006 + + IL_0022: ret + } + + .property uint8 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint8) + .get uint8 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly uint8 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld uint8 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl index 0ad01b843fa..a4f0f4312d3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl @@ -739,36 +739,80 @@ .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 8 + .locals init (int32 V_0, + char V_1) IL_0000: ldc.i4.0 - IL_0001: ldsfld class assembly/f11@52 assembly/f11@52::@_instance - IL_0006: ldarg.0 - IL_0007: ldc.i4.0 - IL_0008: ldarg.1 - IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(char) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: ldsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_001b: ldarg.0 + IL_001c: ldc.i4.0 + IL_001d: ldarg.1 + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!1, !!0, !!1) - IL_000e: pop - IL_000f: ret + IL_0023: pop + IL_0024: ldc.i4.m1 + IL_0025: blt.un.s IL_0006 + + IL_0027: ret } .method public static void f12() cil managed { .maxstack 8 + .locals init (int32 V_0, + char V_1) IL_0000: ldc.i4.0 - IL_0001: ldsfld class assembly/f12@56 assembly/f12@56::@_instance - IL_0006: ldc.i4.s 97 - IL_0008: ldc.i4.0 - IL_0009: ldc.i4.s 122 - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + IL_0001: stloc.0 + IL_0002: ldc.i4.s 97 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.0 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: ldsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_001c: ldc.i4.s 97 + IL_001e: ldc.i4.0 + IL_001f: ldc.i4.s 122 + IL_0021: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!1, !!0, !!1) - IL_0010: pop - IL_0011: ret + IL_0026: pop + IL_0027: ldc.i4.m1 + IL_0028: blt.un.s IL_0007 + + IL_002a: ret } .property char c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl index ee794f80b20..15e79992e47 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl @@ -609,29 +609,73 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.0 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + .maxstack 6 + .locals init (int32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldarg.0 + IL_0016: ldc.i4.0 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, int16, int16) - IL_0008: pop - IL_0009: ret + IL_001d: pop + IL_001e: ldc.i4.m1 + IL_001f: blt.un.s IL_0006 + + IL_0021: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.s 10 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + .maxstack 6 + .locals init (int32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.s 10 + IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, int16, int16) - IL_0009: pop - IL_000a: ret + IL_001e: pop + IL_001f: ldc.i4.m1 + IL_0020: blt.un.s IL_0006 + + IL_0022: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl index 22f085d5e90..31eeb84e268 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl @@ -564,29 +564,73 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.0 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + .maxstack 6 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int32) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldarg.0 + IL_0016: ldc.i4.0 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_0008: pop - IL_0009: ret + IL_001d: pop + IL_001e: ldc.i4.m1 + IL_001f: blt.un.s IL_0006 + + IL_0021: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.s 10 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + .maxstack 6 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int32) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.s 10 + IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_0009: pop - IL_000a: ret + IL_001e: pop + IL_001f: ldc.i4.m1 + IL_0020: blt.un.s IL_0006 + + IL_0022: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl index b8fc20e98ec..14442fe9df0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl @@ -340,35 +340,49 @@ IL_0041: ret - IL_0042: ldloc.0 - IL_0043: ldc.i4.1 - IL_0044: conv.i8 - IL_0045: add.ovf.un - IL_0046: stloc.1 - IL_0047: ldc.i4.0 - IL_0048: conv.i8 - IL_0049: stloc.3 - IL_004a: ldarg.0 - IL_004b: stloc.2 - IL_004c: br.s IL_005e - - IL_004e: ldloc.2 - IL_004f: call void assembly::set_c(int64) - IL_0054: ldloc.2 - IL_0055: ldc.i4.1 + IL_0042: ldarg.1 + IL_0043: ldarg.0 + IL_0044: bge.s IL_004b + + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: nop + IL_0049: br.s IL_0054 + + IL_004b: ldarg.1 + IL_004c: conv.i8 + IL_004d: ldarg.0 + IL_004e: conv.i8 + IL_004f: sub + IL_0050: ldc.i4.1 + IL_0051: conv.i8 + IL_0052: add.ovf.un + IL_0053: nop + IL_0054: stloc.1 + IL_0055: ldc.i4.0 IL_0056: conv.i8 - IL_0057: add - IL_0058: stloc.2 - IL_0059: ldloc.3 - IL_005a: ldc.i4.1 - IL_005b: conv.i8 - IL_005c: add - IL_005d: stloc.3 - IL_005e: ldloc.3 - IL_005f: ldloc.1 - IL_0060: blt.un.s IL_004e - - IL_0062: ret + IL_0057: stloc.3 + IL_0058: ldarg.0 + IL_0059: stloc.2 + IL_005a: br.s IL_006c + + IL_005c: ldloc.2 + IL_005d: call void assembly::set_c(int64) + IL_0062: ldloc.2 + IL_0063: ldc.i4.1 + IL_0064: conv.i8 + IL_0065: add + IL_0066: stloc.2 + IL_0067: ldloc.3 + IL_0068: ldc.i4.1 + IL_0069: conv.i8 + IL_006a: add + IL_006b: stloc.3 + IL_006c: ldloc.3 + IL_006d: ldloc.1 + IL_006e: blt.un.s IL_005c + + IL_0070: ret } .method public static void f5() cil managed @@ -503,8 +517,7 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - int64 V_2, - uint64 V_3) + int64 V_2) IL_0000: ldarg.0 IL_0001: brtrue.s IL_0012 @@ -524,7 +537,7 @@ IL_0013: ldc.i4.0 IL_0014: conv.i8 IL_0015: ldarg.0 - IL_0016: bge.s IL_0026 + IL_0016: bge.s IL_0029 IL_0018: ldc.i4.s 10 IL_001a: conv.i8 @@ -536,24 +549,24 @@ IL_0020: ldarg.0 IL_0021: conv.i8 IL_0022: div.un - IL_0023: nop - IL_0024: br.s IL_0029 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add.ovf.un + IL_0026: nop + IL_0027: br.s IL_002c + + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: nop + IL_002c: stloc.0 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: stloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: stloc.2 + IL_0033: br.s IL_0044 - IL_0026: ldc.i4.0 - IL_0027: conv.i8 - IL_0028: nop - IL_0029: stloc.0 - IL_002a: ldloc.0 - IL_002b: ldc.i4.m1 - IL_002c: conv.i8 - IL_002d: bne.un.s IL_005b - - IL_002f: ldc.i4.0 - IL_0030: conv.i8 - IL_0031: stloc.1 - IL_0032: ldc.i4.1 - IL_0033: conv.i8 - IL_0034: stloc.2 IL_0035: ldloc.2 IL_0036: call void assembly::set_c(int64) IL_003b: ldloc.2 @@ -565,55 +578,11 @@ IL_0041: conv.i8 IL_0042: add IL_0043: stloc.1 - IL_0044: br.s IL_0055 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0035 - IL_0046: ldloc.2 - IL_0047: call void assembly::set_c(int64) - IL_004c: ldloc.2 - IL_004d: ldarg.0 - IL_004e: add - IL_004f: stloc.2 - IL_0050: ldloc.1 - IL_0051: ldc.i4.1 - IL_0052: conv.i8 - IL_0053: add - IL_0054: stloc.1 - IL_0055: ldloc.1 - IL_0056: ldc.i4.0 - IL_0057: conv.i8 - IL_0058: bgt.un.s IL_0046 - - IL_005a: ret - - IL_005b: ldloc.0 - IL_005c: ldc.i4.1 - IL_005d: conv.i8 - IL_005e: add.ovf.un - IL_005f: stloc.1 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: stloc.2 - IL_0066: br.s IL_0077 - - IL_0068: ldloc.2 - IL_0069: call void assembly::set_c(int64) - IL_006e: ldloc.2 - IL_006f: ldarg.0 - IL_0070: add - IL_0071: stloc.2 - 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.1 - IL_0079: blt.un.s IL_0068 - - IL_007b: ret + IL_0048: ret } .method public static void f9(int64 finish) cil managed @@ -791,34 +760,98 @@ IL_0070: ret - IL_0071: ldloc.0 - IL_0072: ldc.i4.1 - IL_0073: conv.i8 - IL_0074: add.ovf.un - IL_0075: stloc.1 - IL_0076: ldc.i4.0 - IL_0077: conv.i8 - IL_0078: stloc.3 - IL_0079: ldarg.2 - IL_007a: stloc.2 - IL_007b: br.s IL_008c - - IL_007d: ldloc.2 - IL_007e: call void assembly::set_c(int64) - IL_0083: ldloc.2 - IL_0084: ldarg.1 - IL_0085: add - IL_0086: stloc.2 - IL_0087: ldloc.3 - IL_0088: ldc.i4.1 - IL_0089: conv.i8 - IL_008a: add - IL_008b: stloc.3 - IL_008c: ldloc.3 - IL_008d: ldloc.1 - IL_008e: blt.un.s IL_007d - - IL_0090: ret + IL_0071: ldarg.1 + IL_0072: brtrue.s IL_0080 + + IL_0074: ldarg.2 + IL_0075: ldarg.1 + IL_0076: ldarg.2 + IL_0077: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_007c: pop + IL_007d: nop + IL_007e: br.s IL_0081 + + IL_0080: nop + IL_0081: ldc.i4.0 + IL_0082: conv.i8 + IL_0083: ldarg.1 + IL_0084: bge.s IL_009d + + IL_0086: ldarg.2 + IL_0087: ldarg.2 + IL_0088: bge.s IL_008f + + IL_008a: ldc.i4.0 + IL_008b: conv.i8 + IL_008c: nop + IL_008d: br.s IL_00b7 + + IL_008f: ldarg.2 + IL_0090: conv.i8 + IL_0091: ldarg.2 + IL_0092: conv.i8 + IL_0093: sub + IL_0094: ldarg.1 + IL_0095: conv.i8 + IL_0096: div.un + IL_0097: ldc.i4.1 + IL_0098: conv.i8 + IL_0099: add.ovf.un + IL_009a: nop + IL_009b: br.s IL_00b7 + + IL_009d: ldarg.2 + IL_009e: ldarg.2 + IL_009f: bge.s IL_00a6 + + IL_00a1: ldc.i4.0 + IL_00a2: conv.i8 + IL_00a3: nop + IL_00a4: br.s IL_00b7 + + IL_00a6: ldarg.2 + IL_00a7: conv.i8 + IL_00a8: ldarg.2 + IL_00a9: conv.i8 + IL_00aa: sub + IL_00ab: ldarg.1 + IL_00ac: not + IL_00ad: conv.i8 + IL_00ae: ldc.i4.1 + IL_00af: conv.i8 + IL_00b0: add + IL_00b1: conv.i8 + IL_00b2: div.un + IL_00b3: ldc.i4.1 + IL_00b4: conv.i8 + IL_00b5: add.ovf.un + IL_00b6: nop + IL_00b7: stloc.1 + IL_00b8: ldc.i4.0 + IL_00b9: conv.i8 + IL_00ba: stloc.3 + IL_00bb: ldarg.2 + IL_00bc: stloc.2 + IL_00bd: br.s IL_00ce + + IL_00bf: ldloc.2 + IL_00c0: call void assembly::set_c(int64) + IL_00c5: ldloc.2 + IL_00c6: ldarg.1 + IL_00c7: add + IL_00c8: stloc.2 + IL_00c9: ldloc.3 + IL_00ca: ldc.i4.1 + IL_00cb: conv.i8 + IL_00cc: add + IL_00cd: stloc.3 + IL_00ce: ldloc.3 + IL_00cf: ldloc.1 + IL_00d0: blt.un.s IL_00bf + + IL_00d2: ret } .method public static void f11(int64 start, @@ -826,33 +859,80 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.0 - IL_0002: conv.i8 - IL_0003: ldarg.1 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + .maxstack 6 + .locals init (int32 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0015 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int64) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldarg.0 + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: ldarg.1 + IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, int64, int64) - IL_0009: pop - IL_000a: ret + IL_001f: pop + IL_0020: ldc.i4.m1 + IL_0021: blt.un.s IL_0006 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: conv.i8 - IL_0002: ldc.i4.0 + .maxstack 6 + .locals init (int32 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 IL_0003: conv.i8 - IL_0004: ldc.i4.s 10 - IL_0006: conv.i8 - IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int64) + IL_000d: ldloc.1 + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, int64, int64) - IL_000c: pop - IL_000d: ret + IL_0023: pop + IL_0024: ldc.i4.m1 + IL_0025: blt.un.s IL_0007 + + IL_0027: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl index ecbe22d4fad..4b26ded8726 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -242,35 +242,49 @@ IL_00ad: ret - IL_00ae: ldloc.0 - IL_00af: ldc.i8 0x1 - IL_00b8: conv.i - IL_00b9: add.ovf.un - IL_00ba: stloc.1 + IL_00ae: ldc.i8 0xa + IL_00b7: conv.i + IL_00b8: ldarg.0 + IL_00b9: bge.s IL_00c8 + IL_00bb: ldc.i8 0x0 IL_00c4: conv.i - IL_00c5: stloc.2 - IL_00c6: ldarg.0 - IL_00c7: stloc.3 - IL_00c8: br.s IL_00ea - - IL_00ca: ldloc.3 - IL_00cb: call void assembly::set_c(native int) - IL_00d0: ldloc.3 - IL_00d1: ldc.i8 0x1 - IL_00da: conv.i - IL_00db: add - IL_00dc: stloc.3 - IL_00dd: ldloc.2 - IL_00de: ldc.i8 0x1 - IL_00e7: conv.i - IL_00e8: add - IL_00e9: stloc.2 - IL_00ea: ldloc.2 - IL_00eb: ldloc.1 - IL_00ec: blt.un.s IL_00ca - - IL_00ee: ret + IL_00c5: nop + IL_00c6: br.s IL_00e0 + + IL_00c8: ldc.i8 0xa + IL_00d1: conv.i + IL_00d2: ldarg.0 + IL_00d3: sub + IL_00d4: ldc.i8 0x1 + IL_00dd: conv.i + IL_00de: add.ovf.un + IL_00df: nop + IL_00e0: stloc.1 + IL_00e1: ldc.i8 0x0 + IL_00ea: conv.i + IL_00eb: stloc.2 + IL_00ec: ldarg.0 + IL_00ed: stloc.3 + IL_00ee: br.s IL_0110 + + IL_00f0: ldloc.3 + IL_00f1: call void assembly::set_c(native int) + IL_00f6: ldloc.3 + IL_00f7: ldc.i8 0x1 + IL_0100: conv.i + IL_0101: add + IL_0102: stloc.3 + IL_0103: ldloc.2 + IL_0104: ldc.i8 0x1 + IL_010d: conv.i + IL_010e: add + IL_010f: stloc.2 + IL_0110: ldloc.2 + IL_0111: ldloc.1 + IL_0112: blt.un.s IL_00f0 + + IL_0114: ret } .method public static void f3(native int finish) cil managed @@ -354,36 +368,50 @@ IL_00b6: ret - IL_00b7: ldloc.0 + IL_00b7: ldarg.0 IL_00b8: ldc.i8 0x1 IL_00c1: conv.i - IL_00c2: add.ovf.un - IL_00c3: stloc.1 + IL_00c2: bge.s IL_00d1 + IL_00c4: ldc.i8 0x0 IL_00cd: conv.i - IL_00ce: stloc.2 - IL_00cf: ldc.i8 0x1 - IL_00d8: conv.i - IL_00d9: stloc.3 - IL_00da: br.s IL_00fc - - IL_00dc: ldloc.3 - IL_00dd: call void assembly::set_c(native int) - IL_00e2: ldloc.3 - IL_00e3: ldc.i8 0x1 - IL_00ec: conv.i - IL_00ed: add - IL_00ee: stloc.3 - IL_00ef: ldloc.2 - IL_00f0: ldc.i8 0x1 - IL_00f9: conv.i - IL_00fa: add - IL_00fb: stloc.2 - IL_00fc: ldloc.2 - IL_00fd: ldloc.1 - IL_00fe: blt.un.s IL_00dc - - IL_0100: ret + IL_00ce: nop + IL_00cf: br.s IL_00e9 + + IL_00d1: ldarg.0 + IL_00d2: ldc.i8 0x1 + IL_00db: conv.i + IL_00dc: sub + IL_00dd: ldc.i8 0x1 + IL_00e6: conv.i + IL_00e7: add.ovf.un + IL_00e8: nop + IL_00e9: stloc.1 + IL_00ea: ldc.i8 0x0 + IL_00f3: conv.i + IL_00f4: stloc.2 + IL_00f5: ldc.i8 0x1 + IL_00fe: conv.i + IL_00ff: stloc.3 + IL_0100: br.s IL_0122 + + IL_0102: ldloc.3 + IL_0103: call void assembly::set_c(native int) + IL_0108: ldloc.3 + IL_0109: ldc.i8 0x1 + IL_0112: conv.i + IL_0113: add + IL_0114: stloc.3 + IL_0115: ldloc.2 + IL_0116: ldc.i8 0x1 + IL_011f: conv.i + IL_0120: add + IL_0121: stloc.2 + IL_0122: ldloc.2 + IL_0123: ldloc.1 + IL_0124: blt.un.s IL_0102 + + IL_0126: ret } .method public static void f4(native int start, @@ -466,35 +494,47 @@ IL_009b: ret - IL_009c: ldloc.0 - IL_009d: ldc.i8 0x1 - IL_00a6: conv.i - IL_00a7: add.ovf.un - IL_00a8: stloc.1 - IL_00a9: ldc.i8 0x0 - IL_00b2: conv.i - IL_00b3: stloc.2 - IL_00b4: ldarg.0 - IL_00b5: stloc.3 - IL_00b6: br.s IL_00d8 - - IL_00b8: ldloc.3 - IL_00b9: call void assembly::set_c(native int) - IL_00be: ldloc.3 - IL_00bf: ldc.i8 0x1 - IL_00c8: conv.i - IL_00c9: add - IL_00ca: stloc.3 - IL_00cb: ldloc.2 - IL_00cc: ldc.i8 0x1 - IL_00d5: conv.i - IL_00d6: add - IL_00d7: stloc.2 - IL_00d8: ldloc.2 - IL_00d9: ldloc.1 - IL_00da: blt.un.s IL_00b8 - - IL_00dc: ret + IL_009c: ldarg.1 + IL_009d: ldarg.0 + IL_009e: bge.s IL_00ad + + IL_00a0: ldc.i8 0x0 + IL_00a9: conv.i + IL_00aa: nop + IL_00ab: br.s IL_00bc + + IL_00ad: ldarg.1 + IL_00ae: ldarg.0 + IL_00af: sub + IL_00b0: ldc.i8 0x1 + IL_00b9: conv.i + IL_00ba: add.ovf.un + IL_00bb: nop + IL_00bc: stloc.1 + IL_00bd: ldc.i8 0x0 + IL_00c6: conv.i + IL_00c7: stloc.2 + IL_00c8: ldarg.0 + IL_00c9: stloc.3 + IL_00ca: br.s IL_00ec + + IL_00cc: ldloc.3 + IL_00cd: call void assembly::set_c(native int) + IL_00d2: ldloc.3 + IL_00d3: ldc.i8 0x1 + IL_00dc: conv.i + IL_00dd: add + IL_00de: stloc.3 + IL_00df: ldloc.2 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.i + IL_00ea: add + IL_00eb: stloc.2 + IL_00ec: ldloc.2 + IL_00ed: ldloc.1 + IL_00ee: blt.un.s IL_00cc + + IL_00f0: ret } .method public static void f5() cil managed @@ -751,35 +791,104 @@ IL_013a: ret - IL_013b: ldloc.0 - IL_013c: ldc.i8 0x1 + IL_013b: ldarg.0 + IL_013c: ldc.i8 0x0 IL_0145: conv.i - IL_0146: add.ovf.un - IL_0147: stloc.1 - IL_0148: ldc.i8 0x0 + IL_0146: bne.un.s IL_0166 + + IL_0148: ldc.i8 0x1 IL_0151: conv.i - IL_0152: stloc.2 - IL_0153: ldc.i8 0x1 + IL_0152: ldarg.0 + IL_0153: ldc.i8 0xa IL_015c: conv.i - IL_015d: stloc.3 - IL_015e: br.s IL_0177 - - IL_0160: ldloc.3 - IL_0161: call void assembly::set_c(native int) - IL_0166: ldloc.3 - IL_0167: ldarg.0 - IL_0168: add - IL_0169: stloc.3 - IL_016a: ldloc.2 - IL_016b: ldc.i8 0x1 - IL_0174: conv.i - IL_0175: add - IL_0176: stloc.2 - IL_0177: ldloc.2 - IL_0178: ldloc.1 - IL_0179: blt.un.s IL_0160 - - IL_017b: ret + IL_015d: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0162: pop + IL_0163: nop + IL_0164: br.s IL_0167 + + IL_0166: nop + IL_0167: ldc.i8 0x0 + IL_0170: conv.i + IL_0171: ldarg.0 + IL_0172: bge.s IL_01bf + + IL_0174: ldc.i8 0xa + IL_017d: conv.i + IL_017e: ldc.i8 0x1 + IL_0187: conv.i + IL_0188: bge.s IL_019a + + IL_018a: ldc.i8 0x0 + IL_0193: conv.i + IL_0194: nop + IL_0195: br IL_0211 + + IL_019a: ldc.i8 0xa + IL_01a3: conv.i + IL_01a4: ldc.i8 0x1 + IL_01ad: conv.i + IL_01ae: sub + IL_01af: ldarg.0 + IL_01b0: div.un + IL_01b1: ldc.i8 0x1 + IL_01ba: conv.i + IL_01bb: add.ovf.un + IL_01bc: nop + IL_01bd: br.s IL_0211 + + IL_01bf: ldc.i8 0x1 + IL_01c8: conv.i + IL_01c9: ldc.i8 0xa + IL_01d2: conv.i + IL_01d3: bge.s IL_01e2 + + IL_01d5: ldc.i8 0x0 + IL_01de: conv.i + IL_01df: nop + IL_01e0: br.s IL_0211 + + IL_01e2: ldc.i8 0x1 + IL_01eb: conv.i + IL_01ec: ldc.i8 0xa + IL_01f5: conv.i + IL_01f6: sub + IL_01f7: ldarg.0 + IL_01f8: not + IL_01f9: ldc.i8 0x1 + IL_0202: conv.i + IL_0203: add + IL_0204: div.un + IL_0205: ldc.i8 0x1 + IL_020e: conv.i + IL_020f: add.ovf.un + IL_0210: nop + IL_0211: stloc.1 + IL_0212: ldc.i8 0x0 + IL_021b: conv.i + IL_021c: stloc.2 + IL_021d: ldc.i8 0x1 + IL_0226: conv.i + IL_0227: stloc.3 + IL_0228: br.s IL_0241 + + IL_022a: ldloc.3 + IL_022b: call void assembly::set_c(native int) + IL_0230: ldloc.3 + IL_0231: ldarg.0 + IL_0232: add + IL_0233: stloc.3 + IL_0234: ldloc.2 + IL_0235: ldc.i8 0x1 + IL_023e: conv.i + IL_023f: add + IL_0240: stloc.2 + IL_0241: ldloc.2 + IL_0242: ldloc.1 + IL_0243: blt.un.s IL_022a + + IL_0245: ret } .method public static void f9(native int finish) cil managed @@ -962,34 +1071,93 @@ IL_00d7: ret - IL_00d8: ldloc.0 - IL_00d9: ldc.i8 0x1 + IL_00d8: ldarg.1 + IL_00d9: ldc.i8 0x0 IL_00e2: conv.i - IL_00e3: add.ovf.un - IL_00e4: stloc.1 - IL_00e5: ldc.i8 0x0 - IL_00ee: conv.i - IL_00ef: stloc.2 - IL_00f0: ldarg.2 - IL_00f1: stloc.3 - IL_00f2: br.s IL_010b - - IL_00f4: ldloc.3 - IL_00f5: call void assembly::set_c(native int) - IL_00fa: ldloc.3 - IL_00fb: ldarg.1 - IL_00fc: add - IL_00fd: stloc.3 - IL_00fe: ldloc.2 - IL_00ff: ldc.i8 0x1 - IL_0108: conv.i - IL_0109: add - IL_010a: stloc.2 - IL_010b: ldloc.2 - IL_010c: ldloc.1 - IL_010d: blt.un.s IL_00f4 - - IL_010f: ret + IL_00e3: bne.un.s IL_00f1 + + IL_00e5: ldarg.2 + IL_00e6: ldarg.1 + IL_00e7: ldarg.2 + IL_00e8: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_00ed: pop + IL_00ee: nop + IL_00ef: br.s IL_00f2 + + IL_00f1: nop + IL_00f2: ldc.i8 0x0 + IL_00fb: conv.i + IL_00fc: ldarg.1 + IL_00fd: bge.s IL_0123 + + IL_00ff: ldarg.2 + IL_0100: ldarg.2 + IL_0101: bge.s IL_0110 + + IL_0103: ldc.i8 0x0 + IL_010c: conv.i + IL_010d: nop + IL_010e: br.s IL_0151 + + IL_0110: ldarg.2 + IL_0111: ldarg.2 + IL_0112: sub + IL_0113: ldarg.1 + IL_0114: div.un + IL_0115: ldc.i8 0x1 + IL_011e: conv.i + IL_011f: add.ovf.un + IL_0120: nop + IL_0121: br.s IL_0151 + + IL_0123: ldarg.2 + IL_0124: ldarg.2 + IL_0125: bge.s IL_0134 + + IL_0127: ldc.i8 0x0 + IL_0130: conv.i + IL_0131: nop + IL_0132: br.s IL_0151 + + IL_0134: ldarg.2 + IL_0135: ldarg.2 + IL_0136: sub + IL_0137: ldarg.1 + IL_0138: not + IL_0139: ldc.i8 0x1 + IL_0142: conv.i + IL_0143: add + IL_0144: div.un + IL_0145: ldc.i8 0x1 + IL_014e: conv.i + IL_014f: add.ovf.un + IL_0150: nop + IL_0151: stloc.1 + IL_0152: ldc.i8 0x0 + IL_015b: conv.i + IL_015c: stloc.2 + IL_015d: ldarg.2 + IL_015e: stloc.3 + IL_015f: br.s IL_0178 + + IL_0161: ldloc.3 + IL_0162: call void assembly::set_c(native int) + IL_0167: ldloc.3 + IL_0168: ldarg.1 + IL_0169: add + IL_016a: stloc.3 + IL_016b: ldloc.2 + IL_016c: ldc.i8 0x1 + IL_0175: conv.i + IL_0176: add + IL_0177: stloc.2 + IL_0178: ldloc.2 + IL_0179: ldloc.1 + IL_017a: blt.un.s IL_0161 + + IL_017c: ret } .method public static void f11(native int start, @@ -997,33 +1165,80 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i8 0x0 - IL_000a: conv.i - IL_000b: ldarg.1 - IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + .maxstack 6 + .locals init (int32 V_0, + native int V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_001d + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(native int) + IL_000c: ldloc.1 + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.0 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: stloc.0 + IL_001d: ldloc.0 + IL_001e: ldarg.0 + IL_001f: ldc.i8 0x0 + IL_0028: conv.i + IL_0029: ldarg.1 + IL_002a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, native int, native int) - IL_0011: pop - IL_0012: ret + IL_002f: pop + IL_0030: ldc.i4.m1 + IL_0031: blt.un.s IL_0006 + + IL_0033: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i8 0x1 - IL_0009: conv.i - IL_000a: ldc.i8 0x0 - IL_0013: conv.i - IL_0014: ldc.i8 0xa - IL_001d: conv.i - IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + .maxstack 6 + .locals init (int32 V_0, + native int V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i8 0x1 + IL_000b: conv.i + IL_000c: stloc.1 + IL_000d: br.s IL_0026 + + IL_000f: ldloc.1 + IL_0010: call void assembly::set_c(native int) + IL_0015: ldloc.1 + IL_0016: ldc.i8 0x0 + IL_001f: conv.i + IL_0020: add + IL_0021: stloc.1 + IL_0022: ldloc.0 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.0 + IL_0026: ldloc.0 + IL_0027: ldc.i8 0x1 + IL_0030: conv.i + IL_0031: ldc.i8 0x0 + IL_003a: conv.i + IL_003b: ldc.i8 0xa + IL_0044: conv.i + IL_0045: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, native int, native int) - IL_0023: pop - IL_0024: ret + IL_004a: pop + IL_004b: ldc.i4.m1 + IL_004c: blt.un.s IL_000f + + IL_004e: ret } .method public static void f13() cil managed @@ -1109,36 +1324,52 @@ IL_00c8: ret - IL_00c9: ldloc.0 - IL_00ca: ldc.i8 0x1 - IL_00d3: conv.i - IL_00d4: add.ovf.un - IL_00d5: stloc.1 - IL_00d6: ldc.i8 0x0 - IL_00df: conv.i - IL_00e0: stloc.2 - IL_00e1: ldc.i8 0xa - IL_00ea: conv.i - IL_00eb: stloc.3 - IL_00ec: br.s IL_010e + IL_00c9: ldc.i8 0xa + IL_00d2: conv.i + IL_00d3: ldc.i8 0x1 + IL_00dc: conv.i + IL_00dd: bge.s IL_00ec - IL_00ee: ldloc.3 - IL_00ef: call void assembly::set_c(native int) - IL_00f4: ldloc.3 - IL_00f5: ldc.i8 0xffffffffffffffff - IL_00fe: conv.i - IL_00ff: add - IL_0100: stloc.3 - IL_0101: ldloc.2 - IL_0102: ldc.i8 0x1 - IL_010b: conv.i - IL_010c: add - IL_010d: stloc.2 - IL_010e: ldloc.2 - IL_010f: ldloc.1 - IL_0110: blt.un.s IL_00ee - - IL_0112: ret + IL_00df: ldc.i8 0x0 + IL_00e8: conv.i + IL_00e9: nop + IL_00ea: br.s IL_010d + + IL_00ec: ldc.i8 0xa + IL_00f5: conv.i + IL_00f6: ldc.i8 0x1 + IL_00ff: conv.i + IL_0100: sub + IL_0101: ldc.i8 0x1 + IL_010a: conv.i + IL_010b: add.ovf.un + IL_010c: nop + IL_010d: stloc.1 + IL_010e: ldc.i8 0x0 + IL_0117: conv.i + IL_0118: stloc.2 + IL_0119: ldc.i8 0xa + IL_0122: conv.i + IL_0123: stloc.3 + IL_0124: br.s IL_0146 + + IL_0126: ldloc.3 + IL_0127: call void assembly::set_c(native int) + IL_012c: ldloc.3 + IL_012d: ldc.i8 0xffffffffffffffff + IL_0136: conv.i + IL_0137: add + IL_0138: stloc.3 + IL_0139: ldloc.2 + IL_013a: ldc.i8 0x1 + IL_0143: conv.i + IL_0144: add + IL_0145: stloc.2 + IL_0146: ldloc.2 + IL_0147: ldloc.1 + IL_0148: blt.un.s IL_0126 + + IL_014a: ret } .method public static void f14() cil managed @@ -1279,36 +1510,110 @@ IL_0179: ret - IL_017a: ldloc.0 - IL_017b: ldc.i8 0x1 - IL_0184: conv.i - IL_0185: add.ovf.un - IL_0186: stloc.1 - IL_0187: ldc.i8 0x0 - IL_0190: conv.i - IL_0191: stloc.2 - IL_0192: ldc.i8 0xa - IL_019b: conv.i - IL_019c: stloc.3 - IL_019d: br.s IL_01bf - - IL_019f: ldloc.3 - IL_01a0: call void assembly::set_c(native int) - IL_01a5: ldloc.3 - IL_01a6: ldc.i8 0xfffffffffffffffe - IL_01af: conv.i - IL_01b0: add - IL_01b1: stloc.3 - IL_01b2: ldloc.2 - IL_01b3: ldc.i8 0x1 - IL_01bc: conv.i - IL_01bd: add - IL_01be: stloc.2 - IL_01bf: ldloc.2 - IL_01c0: ldloc.1 - IL_01c1: blt.un.s IL_019f - - IL_01c3: ret + IL_017a: ldc.i8 0xfffffffffffffffe + IL_0183: conv.i + IL_0184: ldc.i8 0x0 + IL_018d: conv.i + IL_018e: bne.un.s IL_01b7 + + IL_0190: ldc.i8 0xa + IL_0199: conv.i + IL_019a: ldc.i8 0xfffffffffffffffe + IL_01a3: conv.i + IL_01a4: ldc.i8 0x1 + IL_01ad: conv.i + IL_01ae: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_01b3: pop + IL_01b4: nop + IL_01b5: br.s IL_01b8 + + IL_01b7: nop + IL_01b8: ldc.i8 0x0 + IL_01c1: conv.i + IL_01c2: ldc.i8 0xfffffffffffffffe + IL_01cb: conv.i + IL_01cc: bge.s IL_0222 + + IL_01ce: ldc.i8 0x1 + IL_01d7: conv.i + IL_01d8: ldc.i8 0xa + IL_01e1: conv.i + IL_01e2: bge.s IL_01f4 + + IL_01e4: ldc.i8 0x0 + IL_01ed: conv.i + IL_01ee: nop + IL_01ef: br IL_027d + + IL_01f4: ldc.i8 0x1 + IL_01fd: conv.i + IL_01fe: ldc.i8 0xa + IL_0207: conv.i + IL_0208: sub + IL_0209: ldc.i8 0xfffffffffffffffe + IL_0212: conv.i + IL_0213: div.un + IL_0214: ldc.i8 0x1 + IL_021d: conv.i + IL_021e: add.ovf.un + IL_021f: nop + IL_0220: br.s IL_027d + + IL_0222: ldc.i8 0xa + IL_022b: conv.i + IL_022c: ldc.i8 0x1 + IL_0235: conv.i + IL_0236: bge.s IL_0245 + + IL_0238: ldc.i8 0x0 + IL_0241: conv.i + IL_0242: nop + IL_0243: br.s IL_027d + + IL_0245: ldc.i8 0xa + IL_024e: conv.i + IL_024f: ldc.i8 0x1 + IL_0258: conv.i + IL_0259: sub + IL_025a: ldc.i8 0xfffffffffffffffe + IL_0263: conv.i + IL_0264: not + IL_0265: ldc.i8 0x1 + IL_026e: conv.i + IL_026f: add + IL_0270: div.un + IL_0271: ldc.i8 0x1 + IL_027a: conv.i + IL_027b: add.ovf.un + IL_027c: nop + IL_027d: stloc.1 + IL_027e: ldc.i8 0x0 + IL_0287: conv.i + IL_0288: stloc.2 + IL_0289: ldc.i8 0xa + IL_0292: conv.i + IL_0293: stloc.3 + IL_0294: br.s IL_02b6 + + IL_0296: ldloc.3 + IL_0297: call void assembly::set_c(native int) + IL_029c: ldloc.3 + IL_029d: ldc.i8 0xfffffffffffffffe + IL_02a6: conv.i + IL_02a7: add + IL_02a8: stloc.3 + IL_02a9: ldloc.2 + IL_02aa: ldc.i8 0x1 + IL_02b3: conv.i + IL_02b4: add + IL_02b5: stloc.2 + IL_02b6: ldloc.2 + IL_02b7: ldloc.1 + IL_02b8: blt.un.s IL_0296 + + IL_02ba: ret } .property native int c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl index f9244515f3f..8786b4a004b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl @@ -609,29 +609,73 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.0 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + .maxstack 6 + .locals init (int32 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldarg.0 + IL_0016: ldc.i4.0 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, int8, int8) - IL_0008: pop - IL_0009: ret + IL_001d: pop + IL_001e: ldc.i4.m1 + IL_001f: blt.un.s IL_0006 + + IL_0021: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.s 10 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + .maxstack 6 + .locals init (int32 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.s 10 + IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, int8, int8) - IL_0009: pop - IL_000a: ret + IL_001e: pop + IL_001f: ldc.i4.m1 + IL_0020: blt.un.s IL_0006 + + IL_0022: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl index a3f877906b8..bdd7dc919cd 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl @@ -572,29 +572,73 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.0 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + .maxstack 6 + .locals init (int32 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldarg.0 + IL_0016: ldc.i4.0 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, uint16, uint16) - IL_0008: pop - IL_0009: ret + IL_001d: pop + IL_001e: ldc.i4.m1 + IL_001f: blt.un.s IL_0006 + + IL_0021: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.s 10 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + .maxstack 6 + .locals init (int32 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.s 10 + IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, uint16, uint16) - IL_0009: pop - IL_000a: ret + IL_001e: pop + IL_001f: ldc.i4.m1 + IL_0020: blt.un.s IL_0006 + + IL_0022: ret } .property uint16 c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl index e18c7784f63..5518b7b3d89 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl @@ -612,29 +612,73 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.0 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + .maxstack 6 + .locals init (int32 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint32) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldarg.0 + IL_0016: ldc.i4.0 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, uint32, uint32) - IL_0008: pop - IL_0009: ret + IL_001d: pop + IL_001e: ldc.i4.m1 + IL_001f: blt.un.s IL_0006 + + IL_0021: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.s 10 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + .maxstack 6 + .locals init (int32 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint32) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.s 10 + IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, uint32, uint32) - IL_0009: pop - IL_000a: ret + IL_001e: pop + IL_001f: ldc.i4.m1 + IL_0020: blt.un.s IL_0006 + + IL_0022: ret } .property uint32 c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl index ed358d884c4..637dfda4b75 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -334,35 +334,47 @@ IL_003f: ret - IL_0040: ldloc.0 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add.ovf.un - IL_0044: stloc.1 - IL_0045: ldc.i4.0 - IL_0046: conv.i8 - IL_0047: stloc.2 - IL_0048: ldarg.0 - IL_0049: stloc.3 - IL_004a: br.s IL_005c - - IL_004c: ldloc.3 - IL_004d: call void assembly::set_c(uint64) - IL_0052: ldloc.3 - IL_0053: ldc.i4.1 - IL_0054: conv.i8 - IL_0055: add - IL_0056: stloc.3 - IL_0057: ldloc.2 - IL_0058: ldc.i4.1 - IL_0059: conv.i8 - IL_005a: add - IL_005b: stloc.2 - IL_005c: ldloc.2 - IL_005d: ldloc.1 - IL_005e: blt.un.s IL_004c - - IL_0060: ret + IL_0040: ldarg.1 + IL_0041: ldarg.0 + IL_0042: bge.un.s IL_0049 + + IL_0044: ldc.i4.0 + IL_0045: conv.i8 + IL_0046: nop + IL_0047: br.s IL_0050 + + IL_0049: ldarg.1 + IL_004a: ldarg.0 + IL_004b: sub + IL_004c: ldc.i4.1 + IL_004d: conv.i8 + IL_004e: add.ovf.un + IL_004f: nop + IL_0050: stloc.1 + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: stloc.2 + IL_0054: ldarg.0 + IL_0055: stloc.3 + IL_0056: br.s IL_0068 + + IL_0058: ldloc.3 + IL_0059: call void assembly::set_c(uint64) + IL_005e: ldloc.3 + IL_005f: ldc.i4.1 + IL_0060: conv.i8 + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i4.1 + IL_0065: conv.i8 + IL_0066: add + IL_0067: stloc.2 + IL_0068: ldloc.2 + IL_0069: ldloc.1 + IL_006a: blt.un.s IL_0058 + + IL_006c: ret } .method public static void f5() cil managed @@ -495,8 +507,7 @@ .maxstack 5 .locals init (uint64 V_0, uint64 V_1, - uint64 V_2, - uint64 V_3) + uint64 V_2) IL_0000: ldarg.0 IL_0001: brtrue.s IL_0012 @@ -518,18 +529,18 @@ IL_0016: ldarg.0 IL_0017: conv.i8 IL_0018: div.un - IL_0019: stloc.0 - IL_001a: ldloc.0 - IL_001b: ldc.i4.m1 - IL_001c: conv.i8 - IL_001d: bne.un.s IL_004b + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: add.ovf.un + IL_001c: stloc.0 + IL_001d: ldc.i4.0 + IL_001e: conv.i8 + IL_001f: stloc.1 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: stloc.2 + IL_0023: br.s IL_0034 - IL_001f: ldc.i4.0 - IL_0020: conv.i8 - IL_0021: stloc.1 - IL_0022: ldc.i4.1 - IL_0023: conv.i8 - IL_0024: stloc.2 IL_0025: ldloc.2 IL_0026: call void assembly::set_c(uint64) IL_002b: ldloc.2 @@ -541,55 +552,11 @@ IL_0031: conv.i8 IL_0032: add IL_0033: stloc.1 - IL_0034: br.s IL_0045 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0025 - IL_0036: ldloc.2 - IL_0037: call void assembly::set_c(uint64) - IL_003c: ldloc.2 - IL_003d: ldarg.0 - IL_003e: add - IL_003f: stloc.2 - IL_0040: ldloc.1 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add - IL_0044: stloc.1 - IL_0045: ldloc.1 - IL_0046: ldc.i4.0 - IL_0047: conv.i8 - IL_0048: bgt.un.s IL_0036 - - IL_004a: ret - - IL_004b: ldloc.0 - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add.ovf.un - IL_004f: stloc.1 - IL_0050: ldc.i4.0 - IL_0051: conv.i8 - IL_0052: stloc.2 - IL_0053: ldc.i4.1 - IL_0054: conv.i8 - IL_0055: stloc.3 - IL_0056: br.s IL_0067 - - IL_0058: ldloc.3 - IL_0059: call void assembly::set_c(uint64) - IL_005e: ldloc.3 - IL_005f: ldarg.0 - IL_0060: add - IL_0061: stloc.3 - IL_0062: ldloc.2 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: add - IL_0066: stloc.2 - IL_0067: ldloc.2 - IL_0068: ldloc.1 - IL_0069: blt.un.s IL_0058 - - IL_006b: ret + IL_0038: ret } .method public static void f9(uint64 finish) cil managed @@ -733,34 +700,63 @@ IL_0050: ret - IL_0051: ldloc.0 - IL_0052: ldc.i4.1 - IL_0053: conv.i8 - IL_0054: add.ovf.un - IL_0055: stloc.1 - IL_0056: ldc.i4.0 - IL_0057: conv.i8 - IL_0058: stloc.2 - IL_0059: ldarg.2 - IL_005a: stloc.3 - IL_005b: br.s IL_006c - - IL_005d: ldloc.3 - IL_005e: call void assembly::set_c(uint64) - IL_0063: ldloc.3 - IL_0064: ldarg.1 - IL_0065: add - IL_0066: stloc.3 - IL_0067: ldloc.2 - IL_0068: ldc.i4.1 - IL_0069: conv.i8 - IL_006a: add - IL_006b: stloc.2 - IL_006c: ldloc.2 - IL_006d: ldloc.1 - IL_006e: blt.un.s IL_005d - - IL_0070: ret + IL_0051: ldarg.1 + IL_0052: brtrue.s IL_0060 + + IL_0054: ldarg.2 + IL_0055: ldarg.1 + IL_0056: ldarg.2 + IL_0057: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_005c: pop + IL_005d: nop + IL_005e: br.s IL_0061 + + IL_0060: nop + IL_0061: ldarg.2 + IL_0062: ldarg.2 + IL_0063: bge.un.s IL_006a + + IL_0065: ldc.i4.0 + IL_0066: conv.i8 + IL_0067: nop + IL_0068: br.s IL_0074 + + IL_006a: ldarg.2 + IL_006b: ldarg.2 + IL_006c: sub + IL_006d: ldarg.1 + IL_006e: conv.i8 + IL_006f: div.un + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add.ovf.un + IL_0073: nop + IL_0074: stloc.1 + IL_0075: ldc.i4.0 + IL_0076: conv.i8 + IL_0077: stloc.2 + IL_0078: ldarg.2 + IL_0079: stloc.3 + IL_007a: br.s IL_008b + + IL_007c: ldloc.3 + IL_007d: call void assembly::set_c(uint64) + IL_0082: ldloc.3 + IL_0083: ldarg.1 + IL_0084: add + IL_0085: stloc.3 + IL_0086: ldloc.2 + IL_0087: ldc.i4.1 + IL_0088: conv.i8 + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldloc.1 + IL_008d: blt.un.s IL_007c + + IL_008f: ret } .method public static void f11(uint64 start, @@ -768,33 +764,80 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.0 - IL_0002: conv.i8 - IL_0003: ldarg.1 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + .maxstack 6 + .locals init (int32 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_0015 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint64) + IL_000c: ldloc.1 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldarg.0 + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: ldarg.1 + IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_0009: pop - IL_000a: ret + IL_001f: pop + IL_0020: ldc.i4.m1 + IL_0021: blt.un.s IL_0006 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: conv.i8 - IL_0002: ldc.i4.0 + .maxstack 6 + .locals init (int32 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 IL_0003: conv.i8 - IL_0004: ldc.i4.s 10 - IL_0006: conv.i8 - IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint64) + IL_000d: ldloc.1 + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_000c: pop - IL_000d: ret + IL_0023: pop + IL_0024: ldc.i4.m1 + IL_0025: blt.un.s IL_0007 + + IL_0027: ret } .property uint64 c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl index c2314bb4cb7..6141b6212d7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -242,35 +242,49 @@ IL_00ad: ret - IL_00ae: ldloc.0 - IL_00af: ldc.i8 0x1 - IL_00b8: conv.u - IL_00b9: add.ovf.un - IL_00ba: stloc.1 + IL_00ae: ldc.i8 0xa + IL_00b7: conv.u + IL_00b8: ldarg.0 + IL_00b9: bge.un.s IL_00c8 + IL_00bb: ldc.i8 0x0 IL_00c4: conv.u - IL_00c5: stloc.2 - IL_00c6: ldarg.0 - IL_00c7: stloc.3 - IL_00c8: br.s IL_00ea - - IL_00ca: ldloc.3 - IL_00cb: call void assembly::set_c(native uint) - IL_00d0: ldloc.3 - IL_00d1: ldc.i8 0x1 - IL_00da: conv.u - IL_00db: add - IL_00dc: stloc.3 - IL_00dd: ldloc.2 - IL_00de: ldc.i8 0x1 - IL_00e7: conv.u - IL_00e8: add - IL_00e9: stloc.2 - IL_00ea: ldloc.2 - IL_00eb: ldloc.1 - IL_00ec: blt.un.s IL_00ca - - IL_00ee: ret + IL_00c5: nop + IL_00c6: br.s IL_00e0 + + IL_00c8: ldc.i8 0xa + IL_00d1: conv.u + IL_00d2: ldarg.0 + IL_00d3: sub + IL_00d4: ldc.i8 0x1 + IL_00dd: conv.u + IL_00de: add.ovf.un + IL_00df: nop + IL_00e0: stloc.1 + IL_00e1: ldc.i8 0x0 + IL_00ea: conv.u + IL_00eb: stloc.2 + IL_00ec: ldarg.0 + IL_00ed: stloc.3 + IL_00ee: br.s IL_0110 + + IL_00f0: ldloc.3 + IL_00f1: call void assembly::set_c(native uint) + IL_00f6: ldloc.3 + IL_00f7: ldc.i8 0x1 + IL_0100: conv.u + IL_0101: add + IL_0102: stloc.3 + IL_0103: ldloc.2 + IL_0104: ldc.i8 0x1 + IL_010d: conv.u + IL_010e: add + IL_010f: stloc.2 + IL_0110: ldloc.2 + IL_0111: ldloc.1 + IL_0112: blt.un.s IL_00f0 + + IL_0114: ret } .method public static void f3(native uint finish) cil managed @@ -354,36 +368,50 @@ IL_00b6: ret - IL_00b7: ldloc.0 + IL_00b7: ldarg.0 IL_00b8: ldc.i8 0x1 IL_00c1: conv.u - IL_00c2: add.ovf.un - IL_00c3: stloc.1 + IL_00c2: bge.un.s IL_00d1 + IL_00c4: ldc.i8 0x0 IL_00cd: conv.u - IL_00ce: stloc.2 - IL_00cf: ldc.i8 0x1 - IL_00d8: conv.u - IL_00d9: stloc.3 - IL_00da: br.s IL_00fc - - IL_00dc: ldloc.3 - IL_00dd: call void assembly::set_c(native uint) - IL_00e2: ldloc.3 - IL_00e3: ldc.i8 0x1 - IL_00ec: conv.u - IL_00ed: add - IL_00ee: stloc.3 - IL_00ef: ldloc.2 - IL_00f0: ldc.i8 0x1 - IL_00f9: conv.u - IL_00fa: add - IL_00fb: stloc.2 - IL_00fc: ldloc.2 - IL_00fd: ldloc.1 - IL_00fe: blt.un.s IL_00dc - - IL_0100: ret + IL_00ce: nop + IL_00cf: br.s IL_00e9 + + IL_00d1: ldarg.0 + IL_00d2: ldc.i8 0x1 + IL_00db: conv.u + IL_00dc: sub + IL_00dd: ldc.i8 0x1 + IL_00e6: conv.u + IL_00e7: add.ovf.un + IL_00e8: nop + IL_00e9: stloc.1 + IL_00ea: ldc.i8 0x0 + IL_00f3: conv.u + IL_00f4: stloc.2 + IL_00f5: ldc.i8 0x1 + IL_00fe: conv.u + IL_00ff: stloc.3 + IL_0100: br.s IL_0122 + + IL_0102: ldloc.3 + IL_0103: call void assembly::set_c(native uint) + IL_0108: ldloc.3 + IL_0109: ldc.i8 0x1 + IL_0112: conv.u + IL_0113: add + IL_0114: stloc.3 + IL_0115: ldloc.2 + IL_0116: ldc.i8 0x1 + IL_011f: conv.u + IL_0120: add + IL_0121: stloc.2 + IL_0122: ldloc.2 + IL_0123: ldloc.1 + IL_0124: blt.un.s IL_0102 + + IL_0126: ret } .method public static void f4(native uint start, @@ -466,35 +494,47 @@ IL_009b: ret - IL_009c: ldloc.0 - IL_009d: ldc.i8 0x1 - IL_00a6: conv.u - IL_00a7: add.ovf.un - IL_00a8: stloc.1 - IL_00a9: ldc.i8 0x0 - IL_00b2: conv.u - IL_00b3: stloc.2 - IL_00b4: ldarg.0 - IL_00b5: stloc.3 - IL_00b6: br.s IL_00d8 - - IL_00b8: ldloc.3 - IL_00b9: call void assembly::set_c(native uint) - IL_00be: ldloc.3 - IL_00bf: ldc.i8 0x1 - IL_00c8: conv.u - IL_00c9: add - IL_00ca: stloc.3 - IL_00cb: ldloc.2 - IL_00cc: ldc.i8 0x1 - IL_00d5: conv.u - IL_00d6: add - IL_00d7: stloc.2 - IL_00d8: ldloc.2 - IL_00d9: ldloc.1 - IL_00da: blt.un.s IL_00b8 - - IL_00dc: ret + IL_009c: ldarg.1 + IL_009d: ldarg.0 + IL_009e: bge.un.s IL_00ad + + IL_00a0: ldc.i8 0x0 + IL_00a9: conv.u + IL_00aa: nop + IL_00ab: br.s IL_00bc + + IL_00ad: ldarg.1 + IL_00ae: ldarg.0 + IL_00af: sub + IL_00b0: ldc.i8 0x1 + IL_00b9: conv.u + IL_00ba: add.ovf.un + IL_00bb: nop + IL_00bc: stloc.1 + IL_00bd: ldc.i8 0x0 + IL_00c6: conv.u + IL_00c7: stloc.2 + IL_00c8: ldarg.0 + IL_00c9: stloc.3 + IL_00ca: br.s IL_00ec + + IL_00cc: ldloc.3 + IL_00cd: call void assembly::set_c(native uint) + IL_00d2: ldloc.3 + IL_00d3: ldc.i8 0x1 + IL_00dc: conv.u + IL_00dd: add + IL_00de: stloc.3 + IL_00df: ldloc.2 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.u + IL_00ea: add + IL_00eb: stloc.2 + IL_00ec: ldloc.2 + IL_00ed: ldloc.1 + IL_00ee: blt.un.s IL_00cc + + IL_00f0: ret } .method public static void f5() cil managed @@ -721,35 +761,71 @@ IL_00e4: ret - IL_00e5: ldloc.0 - IL_00e6: ldc.i8 0x1 + IL_00e5: ldarg.0 + IL_00e6: ldc.i8 0x0 IL_00ef: conv.u - IL_00f0: add.ovf.un - IL_00f1: stloc.1 - IL_00f2: ldc.i8 0x0 + IL_00f0: bne.un.s IL_0110 + + IL_00f2: ldc.i8 0x1 IL_00fb: conv.u - IL_00fc: stloc.2 - IL_00fd: ldc.i8 0x1 + IL_00fc: ldarg.0 + IL_00fd: ldc.i8 0xa IL_0106: conv.u - IL_0107: stloc.3 - IL_0108: br.s IL_0121 - - IL_010a: ldloc.3 - IL_010b: call void assembly::set_c(native uint) - IL_0110: ldloc.3 - IL_0111: ldarg.0 - IL_0112: add - IL_0113: stloc.3 - IL_0114: ldloc.2 - IL_0115: ldc.i8 0x1 - IL_011e: conv.u - IL_011f: add - IL_0120: stloc.2 - IL_0121: ldloc.2 - IL_0122: ldloc.1 - IL_0123: blt.un.s IL_010a - - IL_0125: ret + IL_0107: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_010c: pop + IL_010d: nop + IL_010e: br.s IL_0111 + + IL_0110: nop + IL_0111: ldc.i8 0xa + IL_011a: conv.u + IL_011b: ldc.i8 0x1 + IL_0124: conv.u + IL_0125: bge.un.s IL_0134 + + IL_0127: ldc.i8 0x0 + IL_0130: conv.u + IL_0131: nop + IL_0132: br.s IL_0157 + + IL_0134: ldc.i8 0xa + IL_013d: conv.u + IL_013e: ldc.i8 0x1 + IL_0147: conv.u + IL_0148: sub + IL_0149: ldarg.0 + IL_014a: div.un + IL_014b: ldc.i8 0x1 + IL_0154: conv.u + IL_0155: add.ovf.un + IL_0156: nop + IL_0157: stloc.1 + IL_0158: ldc.i8 0x0 + IL_0161: conv.u + IL_0162: stloc.2 + IL_0163: ldc.i8 0x1 + IL_016c: conv.u + IL_016d: stloc.3 + IL_016e: br.s IL_0187 + + IL_0170: ldloc.3 + IL_0171: call void assembly::set_c(native uint) + IL_0176: ldloc.3 + IL_0177: ldarg.0 + IL_0178: add + IL_0179: stloc.3 + IL_017a: ldloc.2 + IL_017b: ldc.i8 0x1 + IL_0184: conv.u + IL_0185: add + IL_0186: stloc.2 + IL_0187: ldloc.2 + IL_0188: ldloc.1 + IL_0189: blt.un.s IL_0170 + + IL_018b: ret } .method public static void f9(native uint finish) cil managed @@ -906,34 +982,64 @@ IL_00a5: ret - IL_00a6: ldloc.0 - IL_00a7: ldc.i8 0x1 + IL_00a6: ldarg.1 + IL_00a7: ldc.i8 0x0 IL_00b0: conv.u - IL_00b1: add.ovf.un - IL_00b2: stloc.1 - IL_00b3: ldc.i8 0x0 - IL_00bc: conv.u - IL_00bd: stloc.2 - IL_00be: ldarg.2 - IL_00bf: stloc.3 - IL_00c0: br.s IL_00d9 - - IL_00c2: ldloc.3 - IL_00c3: call void assembly::set_c(native uint) - IL_00c8: ldloc.3 - IL_00c9: ldarg.1 - IL_00ca: add - IL_00cb: stloc.3 - IL_00cc: ldloc.2 - IL_00cd: ldc.i8 0x1 - IL_00d6: conv.u - IL_00d7: add - IL_00d8: stloc.2 - IL_00d9: ldloc.2 - IL_00da: ldloc.1 - IL_00db: blt.un.s IL_00c2 - - IL_00dd: ret + IL_00b1: bne.un.s IL_00bf + + IL_00b3: ldarg.2 + IL_00b4: ldarg.1 + IL_00b5: ldarg.2 + IL_00b6: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_00bb: pop + IL_00bc: nop + IL_00bd: br.s IL_00c0 + + IL_00bf: nop + IL_00c0: ldarg.2 + IL_00c1: ldarg.2 + IL_00c2: bge.un.s IL_00d1 + + IL_00c4: ldc.i8 0x0 + IL_00cd: conv.u + IL_00ce: nop + IL_00cf: br.s IL_00e2 + + IL_00d1: ldarg.2 + IL_00d2: ldarg.2 + IL_00d3: sub + IL_00d4: ldarg.1 + IL_00d5: div.un + IL_00d6: ldc.i8 0x1 + IL_00df: conv.u + IL_00e0: add.ovf.un + IL_00e1: nop + IL_00e2: stloc.1 + IL_00e3: ldc.i8 0x0 + IL_00ec: conv.u + IL_00ed: stloc.2 + IL_00ee: ldarg.2 + IL_00ef: stloc.3 + IL_00f0: br.s IL_0109 + + IL_00f2: ldloc.3 + IL_00f3: call void assembly::set_c(native uint) + IL_00f8: ldloc.3 + IL_00f9: ldarg.1 + IL_00fa: add + IL_00fb: stloc.3 + IL_00fc: ldloc.2 + IL_00fd: ldc.i8 0x1 + IL_0106: conv.u + IL_0107: add + IL_0108: stloc.2 + IL_0109: ldloc.2 + IL_010a: ldloc.1 + IL_010b: blt.un.s IL_00f2 + + IL_010d: ret } .method public static void f11(native uint start, @@ -941,33 +1047,80 @@ { .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 8 - IL_0000: ldarg.0 - IL_0001: ldc.i8 0x0 - IL_000a: conv.u - IL_000b: ldarg.1 - IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + .maxstack 6 + .locals init (int32 V_0, + native uint V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: stloc.1 + IL_0004: br.s IL_001d + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(native uint) + IL_000c: ldloc.1 + IL_000d: ldc.i8 0x0 + IL_0016: conv.u + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.0 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: stloc.0 + IL_001d: ldloc.0 + IL_001e: ldarg.0 + IL_001f: ldc.i8 0x0 + IL_0028: conv.u + IL_0029: ldarg.1 + IL_002a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, native uint, native uint) - IL_0011: pop - IL_0012: ret + IL_002f: pop + IL_0030: ldc.i4.m1 + IL_0031: blt.un.s IL_0006 + + IL_0033: ret } .method public static void f12() cil managed { - .maxstack 8 - IL_0000: ldc.i8 0x1 - IL_0009: conv.u - IL_000a: ldc.i8 0x0 - IL_0013: conv.u - IL_0014: ldc.i8 0xa - IL_001d: conv.u - IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + .maxstack 6 + .locals init (int32 V_0, + native uint V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i8 0x1 + IL_000b: conv.u + IL_000c: stloc.1 + IL_000d: br.s IL_0026 + + IL_000f: ldloc.1 + IL_0010: call void assembly::set_c(native uint) + IL_0015: ldloc.1 + IL_0016: ldc.i8 0x0 + IL_001f: conv.u + IL_0020: add + IL_0021: stloc.1 + IL_0022: ldloc.0 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.0 + IL_0026: ldloc.0 + IL_0027: ldc.i8 0x1 + IL_0030: conv.u + IL_0031: ldc.i8 0x0 + IL_003a: conv.u + IL_003b: ldc.i8 0xa + IL_0044: conv.u + IL_0045: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, native uint, native uint) - IL_0023: pop - IL_0024: ret + IL_004a: pop + IL_004b: ldc.i4.m1 + IL_004c: blt.un.s IL_000f + + IL_004e: ret } .property native uint c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl index da6effebb3b..77093cd4706 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl @@ -440,7 +440,7 @@ IL_000d: sub IL_000e: ldc.i4.1 IL_000f: conv.i8 - IL_0010: add + IL_0010: add.ovf.un IL_0011: nop IL_0012: stloc.0 IL_0013: ldc.i4.0 @@ -498,7 +498,7 @@ IL_000d: sub IL_000e: ldc.i4.1 IL_000f: conv.i8 - IL_0010: add + IL_0010: add.ovf.un IL_0011: nop IL_0012: stloc.0 IL_0013: ldc.i4.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl index fb1d75e8743..66d7070e89c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl @@ -441,7 +441,7 @@ IL_000d: sub IL_000e: ldc.i4.1 IL_000f: conv.i8 - IL_0010: add + IL_0010: add.ovf.un IL_0011: nop IL_0012: stloc.0 IL_0013: ldc.i4.0 @@ -499,7 +499,7 @@ IL_000d: sub IL_000e: ldc.i4.1 IL_000f: conv.i8 - IL_0010: add + IL_0010: add.ovf.un IL_0011: nop IL_0012: stloc.0 IL_0013: ldc.i4.0 diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index ec4fc441f29..a0abdc29298 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -145,6 +145,7 @@ + From 0acf40f1957101544484d8d2dd35dd5f13e93a8f Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 27 Feb 2024 13:38:40 -0500 Subject: [PATCH 53/66] Remove FSharpSuite tests * It's easier to update the baselines in the component tests when needed. --- ...putedCollectionRangeLoweringTests.Int32.fs | 1945 ----------------- tests/fsharp/FSharpSuite.Tests.fsproj | 1 - 2 files changed, 1946 deletions(-) delete mode 100644 tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs diff --git a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs b/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs deleted file mode 100644 index 3229d670b16..00000000000 --- a/tests/fsharp/Compiler/Language/ComputedCollectionRangeLoweringTests.Int32.fs +++ /dev/null @@ -1,1945 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace FSharp.Compiler.UnitTests.ComputedCollectionRangeLoweringTests - -open NUnit.Framework -open FSharp.Test - -// TODO https://github.com/dotnet/fsharp/issues/16739: Remove /langversion:preview from these tests when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. -[] -module Int32 = - /// [|…|] - module Array = - /// [|start..finish|] - module Range = - [] - let ``Lone RangeInt32 with const args when start > finish lowers to empty array`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test () = [|10..1|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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[] test() cil managed - { - - .maxstack 8 - IL_0000: call !!0[] [runtime]System.Array::Empty() - IL_0005: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test () = [|1..257|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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[] test() cil managed - { - - .maxstack 5 - .locals init (int32[] V_0, - uint64 V_1, - int32 V_2) - IL_0000: ldc.i4 0x101 - IL_0005: conv.i8 - IL_0006: conv.ovf.i.un - IL_0007: newarr [runtime]System.Int32 - IL_000c: stloc.0 - IL_000d: ldc.i4.0 - IL_000e: conv.i8 - IL_000f: stloc.1 - IL_0010: ldc.i4.1 - IL_0011: stloc.2 - IL_0012: br.s IL_0022 - - IL_0014: ldloc.0 - IL_0015: ldloc.1 - IL_0016: conv.i - IL_0017: ldloc.2 - IL_0018: stelem.i4 - IL_0019: ldloc.2 - IL_001a: ldc.i4.1 - 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 0x101 - IL_0028: conv.i8 - IL_0029: blt.un.s IL_0014 - - IL_002b: ldloc.0 - IL_002c: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test start finish = [|start..finish|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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[] test(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, - int32[] V_1, - uint64 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: ldarg.0 - IL_0002: bge.s IL_0008 - - IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: br.s IL_0010 - - IL_0008: ldarg.1 - IL_0009: conv.i8 - IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: conv.i8 - IL_000f: add - IL_0010: stloc.0 - IL_0011: ldloc.0 - IL_0012: ldc.i4.1 - IL_0013: conv.i8 - IL_0014: bge.un.s IL_001c - - IL_0016: call !!0[] [runtime]System.Array::Empty() - IL_001b: ret - - IL_001c: ldloc.0 - IL_001d: conv.ovf.i.un - IL_001e: newarr [runtime]System.Int32 - IL_0023: stloc.1 - IL_0024: ldc.i4.0 - IL_0025: conv.i8 - IL_0026: stloc.2 - IL_0027: ldarg.0 - IL_0028: stloc.3 - IL_0029: br.s IL_0039 - - IL_002b: ldloc.1 - IL_002c: ldloc.2 - IL_002d: conv.i - IL_002e: ldloc.3 - IL_002f: stelem.i4 - IL_0030: ldloc.3 - IL_0031: ldc.i4.1 - IL_0032: add - IL_0033: stloc.3 - IL_0034: ldloc.2 - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: add - IL_0038: stloc.2 - IL_0039: ldloc.2 - IL_003a: ldloc.0 - IL_003b: blt.un.s IL_002b - - IL_003d: ldloc.1 - IL_003e: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let a () = (Array.zeroCreate 10).Length - let b () = (Array.zeroCreate 20).Length - - let test () = [|a ()..b ()|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 a() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static int32 b() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 20 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static int32[] test() cil managed - { - - .maxstack 5 - .locals init (int32 V_0, - int32 V_1, - uint64 V_2, - int32[] V_3, - uint64 V_4, - int32 V_5) - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: stloc.0 - IL_000a: ldc.i4.s 20 - IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0011: ldlen - IL_0012: conv.i4 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: ldloc.0 - IL_0016: bge.s IL_001c - - IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: br.s IL_0024 - - IL_001c: ldloc.1 - IL_001d: conv.i8 - IL_001e: ldloc.0 - IL_001f: conv.i8 - IL_0020: sub - IL_0021: ldc.i4.1 - IL_0022: conv.i8 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.2 - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: bge.un.s IL_0030 - - IL_002a: call !!0[] [runtime]System.Array::Empty() - IL_002f: ret - - IL_0030: ldloc.2 - IL_0031: conv.ovf.i.un - IL_0032: newarr [runtime]System.Int32 - IL_0037: stloc.3 - IL_0038: ldc.i4.0 - IL_0039: conv.i8 - IL_003a: stloc.s V_4 - IL_003c: ldloc.0 - IL_003d: stloc.s V_5 - IL_003f: br.s IL_0055 - - IL_0041: ldloc.3 - IL_0042: ldloc.s V_4 - IL_0044: conv.i - IL_0045: ldloc.s V_5 - IL_0047: stelem.i4 - IL_0048: ldloc.s V_5 - IL_004a: ldc.i4.1 - IL_004b: add - IL_004c: stloc.s V_5 - IL_004e: ldloc.s V_4 - IL_0050: ldc.i4.1 - IL_0051: conv.i8 - IL_0052: add - IL_0053: stloc.s V_4 - IL_0055: ldloc.s V_4 - IL_0057: ldloc.2 - IL_0058: blt.un.s IL_0041 - - IL_005a: ldloc.3 - IL_005b: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - /// [|start..step..finish|] - module RangeStep = - [] - let ``Lone RangeInt32 with const args when (finish - start) / step + 1 ≤ 0 lowers to empty array`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test () = [|1..-1..5|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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[] test() cil managed - { - - .maxstack 8 - IL_0000: call !!0[] [runtime]System.Array::Empty() - IL_0005: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test () = [|1..2..257|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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[] test() cil managed - { - - .maxstack 5 - .locals init (int32[] V_0, - uint64 V_1, - int32 V_2) - IL_0000: ldc.i4 0x81 - IL_0005: conv.i8 - IL_0006: conv.ovf.i.un - IL_0007: newarr [runtime]System.Int32 - IL_000c: stloc.0 - IL_000d: ldc.i4.0 - IL_000e: conv.i8 - IL_000f: stloc.1 - IL_0010: ldc.i4.1 - IL_0011: stloc.2 - IL_0012: br.s IL_0022 - - IL_0014: ldloc.0 - IL_0015: ldloc.1 - IL_0016: conv.i - IL_0017: ldloc.2 - IL_0018: stelem.i4 - IL_0019: ldloc.2 - IL_001a: ldc.i4.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 0x81 - IL_0028: conv.i8 - IL_0029: blt.un.s IL_0014 - - IL_002b: ldloc.0 - IL_002c: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test start step finish = [|start..step..finish|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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[] test(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, - int32[] V_1, - uint64 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: brtrue.s IL_000e - - IL_0003: ldarg.0 - IL_0004: ldarg.1 - IL_0005: ldarg.2 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000b: pop - IL_000c: br.s IL_000e - - IL_000e: ldc.i4.0 - IL_000f: ldarg.1 - IL_0010: bge.s IL_0027 - - IL_0012: ldarg.2 - IL_0013: ldarg.0 - IL_0014: bge.s IL_001a - - IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: br.s IL_003f - - IL_001a: ldarg.2 - IL_001b: conv.i8 - IL_001c: ldarg.0 - IL_001d: conv.i8 - IL_001e: sub - IL_001f: ldarg.1 - IL_0020: conv.i8 - IL_0021: div.un - IL_0022: ldc.i4.1 - IL_0023: conv.i8 - IL_0024: add - IL_0025: br.s IL_003f - - IL_0027: ldarg.0 - IL_0028: ldarg.2 - IL_0029: bge.s IL_002f - - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: br.s IL_003f - - IL_002f: ldarg.0 - IL_0030: conv.i8 - IL_0031: ldarg.2 - IL_0032: conv.i8 - IL_0033: sub - IL_0034: ldarg.1 - IL_0035: not - IL_0036: conv.i8 - IL_0037: ldc.i4.1 - IL_0038: conv.i8 - IL_0039: add - IL_003a: conv.i8 - IL_003b: div.un - IL_003c: ldc.i4.1 - IL_003d: conv.i8 - IL_003e: add - IL_003f: stloc.0 - IL_0040: ldloc.0 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: bge.un.s IL_004b - - IL_0045: call !!0[] [runtime]System.Array::Empty() - IL_004a: ret - - IL_004b: ldloc.0 - IL_004c: conv.ovf.i.un - IL_004d: newarr [runtime]System.Int32 - IL_0052: stloc.1 - IL_0053: ldc.i4.0 - IL_0054: conv.i8 - IL_0055: stloc.2 - IL_0056: ldarg.0 - IL_0057: stloc.3 - IL_0058: br.s IL_0068 - - IL_005a: ldloc.1 - IL_005b: ldloc.2 - IL_005c: conv.i - IL_005d: ldloc.3 - IL_005e: stelem.i4 - IL_005f: ldloc.3 - IL_0060: ldarg.1 - IL_0061: add - IL_0062: stloc.3 - IL_0063: ldloc.2 - IL_0064: ldc.i4.1 - IL_0065: conv.i8 - IL_0066: add - IL_0067: stloc.2 - IL_0068: ldloc.2 - IL_0069: ldloc.0 - IL_006a: blt.un.s IL_005a - - IL_006c: ldloc.1 - IL_006d: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let a () = (Array.zeroCreate 10).Length - let b () = (Array.zeroCreate 20).Length - let c () = (Array.zeroCreate 300).Length - - let test () = [|a () .. b () .. c ()|] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 a() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static int32 b() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 20 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static int32 c() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4 0x12c - IL_0005: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_000a: ldlen - IL_000b: conv.i4 - IL_000c: ret - } - - .method public static int32[] test() cil managed - { - - .maxstack 5 - .locals init (int32 V_0, - int32 V_1, - int32 V_2, - uint64 V_3, - int32[] V_4, - uint64 V_5, - int32 V_6) - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: stloc.0 - IL_000a: ldc.i4.s 20 - IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0011: ldlen - IL_0012: conv.i4 - IL_0013: stloc.1 - IL_0014: ldc.i4 0x12c - IL_0019: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_001e: ldlen - IL_001f: conv.i4 - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: brtrue.s IL_002f - - IL_0024: ldloc.0 - IL_0025: ldloc.1 - IL_0026: ldloc.2 - IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_002c: pop - IL_002d: br.s IL_002f - - IL_002f: ldc.i4.0 - IL_0030: ldloc.1 - IL_0031: bge.s IL_0048 - - IL_0033: ldloc.2 - IL_0034: ldloc.0 - IL_0035: bge.s IL_003b - - IL_0037: ldc.i4.0 - IL_0038: conv.i8 - IL_0039: br.s IL_0060 - - IL_003b: ldloc.2 - IL_003c: conv.i8 - IL_003d: ldloc.0 - IL_003e: conv.i8 - IL_003f: sub - IL_0040: ldloc.1 - IL_0041: conv.i8 - IL_0042: div.un - IL_0043: ldc.i4.1 - IL_0044: conv.i8 - IL_0045: add - IL_0046: br.s IL_0060 - - IL_0048: ldloc.0 - IL_0049: ldloc.2 - IL_004a: bge.s IL_0050 - - IL_004c: ldc.i4.0 - IL_004d: conv.i8 - IL_004e: br.s IL_0060 - - IL_0050: ldloc.0 - IL_0051: conv.i8 - IL_0052: ldloc.2 - IL_0053: conv.i8 - IL_0054: sub - IL_0055: ldloc.1 - IL_0056: not - IL_0057: conv.i8 - IL_0058: ldc.i4.1 - IL_0059: conv.i8 - IL_005a: add - IL_005b: conv.i8 - IL_005c: div.un - IL_005d: ldc.i4.1 - IL_005e: conv.i8 - IL_005f: add - IL_0060: stloc.3 - IL_0061: ldloc.3 - IL_0062: ldc.i4.1 - IL_0063: conv.i8 - IL_0064: bge.un.s IL_006c - - IL_0066: call !!0[] [runtime]System.Array::Empty() - IL_006b: ret - - IL_006c: ldloc.3 - IL_006d: conv.ovf.i.un - IL_006e: newarr [runtime]System.Int32 - IL_0073: stloc.s V_4 - IL_0075: ldc.i4.0 - IL_0076: conv.i8 - IL_0077: stloc.s V_5 - IL_0079: ldloc.0 - IL_007a: stloc.s V_6 - IL_007c: br.s IL_0093 - - IL_007e: ldloc.s V_4 - IL_0080: ldloc.s V_5 - IL_0082: conv.i - IL_0083: ldloc.s V_6 - IL_0085: stelem.i4 - IL_0086: ldloc.s V_6 - IL_0088: ldloc.1 - IL_0089: add - IL_008a: stloc.s V_6 - IL_008c: ldloc.s V_5 - IL_008e: ldc.i4.1 - IL_008f: conv.i8 - IL_0090: add - IL_0091: stloc.s V_5 - IL_0093: ldloc.s V_5 - IL_0095: ldloc.3 - IL_0096: blt.un.s IL_007e - - IL_0098: ldloc.s V_4 - IL_009a: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - /// […] - module List = - /// [start..finish] - module Range = - [] - let ``Lone RangeInt32 with const args when start > finish lowers to empty list`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test () = [10..1] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 - test() 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 - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test () = [1..101] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 test() cil managed - { - - .maxstack 4 - .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - uint64 V_1, - int32 V_2) - 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_0018 - - IL_0007: ldloca.s V_0 - IL_0009: ldloc.2 - IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_000f: ldloc.2 - IL_0010: ldc.i4.1 - IL_0011: add - IL_0012: stloc.2 - IL_0013: ldloc.1 - IL_0014: ldc.i4.1 - IL_0015: conv.i8 - IL_0016: add - IL_0017: stloc.1 - IL_0018: ldloc.1 - IL_0019: ldc.i4.s 101 - IL_001b: conv.i8 - IL_001c: blt.un.s IL_0007 - - IL_001e: ldloca.s V_0 - IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0025: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args lowers to init loop``() = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let test start finish = [start..finish] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 - test(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) - IL_0000: ldarg.1 - IL_0001: ldarg.0 - IL_0002: bge.s IL_0008 - - IL_0004: ldc.i4.0 - IL_0005: conv.i8 - IL_0006: br.s IL_0010 - - IL_0008: ldarg.1 - IL_0009: conv.i8 - IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: conv.i8 - IL_000f: add - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: conv.i8 - IL_0013: stloc.2 - IL_0014: ldarg.0 - IL_0015: stloc.3 - IL_0016: br.s IL_0029 - - IL_0018: ldloca.s V_1 - IL_001a: ldloc.3 - IL_001b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0020: ldloc.3 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.3 - IL_0024: ldloc.2 - IL_0025: ldc.i4.1 - IL_0026: conv.i8 - IL_0027: add - IL_0028: stloc.2 - IL_0029: ldloc.2 - IL_002a: ldloc.0 - IL_002b: blt.un.s IL_0018 - - IL_002d: ldloca.s V_1 - IL_002f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0034: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize+"; "/langversion:preview"|], - """ - module Test - - let a () = (Array.zeroCreate 10).Length - let b () = (Array.zeroCreate 20).Length - - let test () = [a ()..b ()] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 a() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static int32 b() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 20 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 test() cil managed - { - - .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) - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: stloc.0 - IL_000a: ldc.i4.s 20 - IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0011: ldlen - IL_0012: conv.i4 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: ldloc.0 - IL_0016: bge.s IL_001c - - IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: br.s IL_0024 - - IL_001c: ldloc.1 - IL_001d: conv.i8 - IL_001e: ldloc.0 - IL_001f: conv.i8 - IL_0020: sub - IL_0021: ldc.i4.1 - IL_0022: conv.i8 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldc.i4.0 - IL_0026: conv.i8 - IL_0027: stloc.s V_4 - IL_0029: ldloc.0 - IL_002a: stloc.s V_5 - IL_002c: br.s IL_0044 - - IL_002e: ldloca.s V_3 - IL_0030: ldloc.s V_5 - IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0037: ldloc.s V_5 - IL_0039: ldc.i4.1 - IL_003a: add - IL_003b: stloc.s V_5 - IL_003d: ldloc.s V_4 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.s V_4 - IL_0046: ldloc.2 - IL_0047: blt.un.s IL_002e - - IL_0049: ldloca.s V_3 - IL_004b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0050: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - /// [start..step..finish] - module RangeStep = - [] - let ``Lone RangeInt32 with const args when (finish - start) / step + 1 ≤ 0 lowers to empty list`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], - """ - module Test - - let test () = [1..-1..5] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 - test() 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 - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with const args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], - """ - module Test - - let test () = [1..2..257] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 test() cil managed - { - - .maxstack 4 - .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, - uint64 V_1, - int32 V_2) - 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_0018 - - IL_0007: ldloca.s V_0 - IL_0009: ldloc.2 - IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_000f: ldloc.2 - IL_0010: ldc.i4.2 - IL_0011: add - IL_0012: stloc.2 - IL_0013: ldloc.1 - IL_0014: ldc.i4.1 - IL_0015: conv.i8 - IL_0016: add - IL_0017: stloc.1 - IL_0018: ldloc.1 - IL_0019: ldc.i4 0x81 - 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 - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args lowers to init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], - """ - module Test - - let test start step finish = [start..step..finish] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 - test(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) - IL_0000: ldarg.1 - IL_0001: brtrue.s IL_000e - - IL_0003: ldarg.0 - IL_0004: ldarg.1 - IL_0005: ldarg.2 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000b: pop - IL_000c: br.s IL_000e - - IL_000e: ldc.i4.0 - IL_000f: ldarg.1 - IL_0010: bge.s IL_0027 - - IL_0012: ldarg.2 - IL_0013: ldarg.0 - IL_0014: bge.s IL_001a - - IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: br.s IL_003f - - IL_001a: ldarg.2 - IL_001b: conv.i8 - IL_001c: ldarg.0 - IL_001d: conv.i8 - IL_001e: sub - IL_001f: ldarg.1 - IL_0020: conv.i8 - IL_0021: div.un - IL_0022: ldc.i4.1 - IL_0023: conv.i8 - IL_0024: add - IL_0025: br.s IL_003f - - IL_0027: ldarg.0 - IL_0028: ldarg.2 - IL_0029: bge.s IL_002f - - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: br.s IL_003f - - IL_002f: ldarg.0 - IL_0030: conv.i8 - IL_0031: ldarg.2 - IL_0032: conv.i8 - IL_0033: sub - IL_0034: ldarg.1 - IL_0035: not - IL_0036: conv.i8 - IL_0037: ldc.i4.1 - IL_0038: conv.i8 - IL_0039: add - IL_003a: conv.i8 - IL_003b: div.un - IL_003c: ldc.i4.1 - IL_003d: conv.i8 - IL_003e: add - IL_003f: stloc.0 - IL_0040: ldc.i4.0 - IL_0041: conv.i8 - IL_0042: stloc.2 - IL_0043: ldarg.0 - IL_0044: stloc.3 - IL_0045: br.s IL_0058 - - IL_0047: ldloca.s V_1 - IL_0049: ldloc.3 - IL_004a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_004f: ldloc.3 - IL_0050: ldarg.1 - IL_0051: add - IL_0052: stloc.3 - IL_0053: ldloc.2 - IL_0054: ldc.i4.1 - IL_0055: conv.i8 - IL_0056: add - IL_0057: stloc.2 - IL_0058: ldloc.2 - IL_0059: ldloc.0 - IL_005a: blt.un.s IL_0047 - - IL_005c: ldloca.s V_1 - IL_005e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0063: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) - - [] - let ``Lone RangeInt32 with dynamic args that are not consts or bound vals stores those in vars before init loop`` () = - CompilerAssert.CompileLibraryAndVerifyILWithOptions(["--optimize+"; "/langversion:preview"], - """ - module Test - - let a () = (Array.zeroCreate 10).Length - let b () = (Array.zeroCreate 20).Length - let c () = (Array.zeroCreate 300).Length - - let test () = [a () .. b () .. c ()] - """, - (fun verifier -> verifier.VerifyIL [ - """ - .assembly extern runtime { } - .assembly extern FSharp.Core { } - .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.dll - - .imagebase {value} - .file alignment 0x00000200 - .stackreserve 0x00100000 - .subsystem 0x0003 - .corflags 0x00000001 - - - - - - .class public abstract auto ansi sealed Test - 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 a() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static int32 b() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.s 20 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: ret - } - - .method public static int32 c() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4 0x12c - IL_0005: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_000a: ldlen - IL_000b: conv.i4 - IL_000c: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 test() cil managed - { - - .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) - IL_0000: ldc.i4.s 10 - IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0007: ldlen - IL_0008: conv.i4 - IL_0009: stloc.0 - IL_000a: ldc.i4.s 20 - IL_000c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_0011: ldlen - IL_0012: conv.i4 - IL_0013: stloc.1 - IL_0014: ldc.i4 0x12c - IL_0019: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::ZeroCreate(int32) - IL_001e: ldlen - IL_001f: conv.i4 - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: brtrue.s IL_002f - - IL_0024: ldloc.0 - IL_0025: ldloc.1 - IL_0026: ldloc.2 - IL_0027: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_002c: pop - IL_002d: br.s IL_002f - - IL_002f: ldc.i4.0 - IL_0030: ldloc.1 - IL_0031: bge.s IL_0048 - - IL_0033: ldloc.2 - IL_0034: ldloc.0 - IL_0035: bge.s IL_003b - - IL_0037: ldc.i4.0 - IL_0038: conv.i8 - IL_0039: br.s IL_0060 - - IL_003b: ldloc.2 - IL_003c: conv.i8 - IL_003d: ldloc.0 - IL_003e: conv.i8 - IL_003f: sub - IL_0040: ldloc.1 - IL_0041: conv.i8 - IL_0042: div.un - IL_0043: ldc.i4.1 - IL_0044: conv.i8 - IL_0045: add - IL_0046: br.s IL_0060 - - IL_0048: ldloc.0 - IL_0049: ldloc.2 - IL_004a: bge.s IL_0050 - - IL_004c: ldc.i4.0 - IL_004d: conv.i8 - IL_004e: br.s IL_0060 - - IL_0050: ldloc.0 - IL_0051: conv.i8 - IL_0052: ldloc.2 - IL_0053: conv.i8 - IL_0054: sub - IL_0055: ldloc.1 - IL_0056: not - IL_0057: conv.i8 - IL_0058: ldc.i4.1 - IL_0059: conv.i8 - IL_005a: add - IL_005b: conv.i8 - IL_005c: div.un - IL_005d: ldc.i4.1 - IL_005e: conv.i8 - IL_005f: add - IL_0060: stloc.3 - IL_0061: ldc.i4.0 - IL_0062: conv.i8 - IL_0063: stloc.s V_5 - IL_0065: ldloc.0 - IL_0066: stloc.s V_6 - IL_0068: br.s IL_0080 - - IL_006a: ldloca.s V_4 - IL_006c: ldloc.s V_6 - IL_006e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0073: ldloc.s V_6 - IL_0075: ldloc.1 - IL_0076: add - IL_0077: stloc.s V_6 - IL_0079: ldloc.s V_5 - IL_007b: ldc.i4.1 - IL_007c: conv.i8 - IL_007d: add - IL_007e: stloc.s V_5 - IL_0080: ldloc.s V_5 - IL_0082: ldloc.3 - IL_0083: blt.un.s IL_006a - - IL_0085: ldloca.s V_4 - IL_0087: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_008c: ret - } - - } - - .class private abstract auto ansi sealed ''.$Test - extends [runtime]System.Object - { - } - """ - ])) diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index f9a192bdee0..d052acd9a20 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -72,7 +72,6 @@ - From 602ca6d15ff555e56c86c794dd43d08ded9df434 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 27 Feb 2024 17:50:24 -0500 Subject: [PATCH 54/66] Fix types --- src/Compiler/TypedTree/TypedTreeOps.fs | 121 +++++++++++++------------ 1 file changed, 62 insertions(+), 59 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 6c163e00ab6..224bae7adbf 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10403,7 +10403,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // Type-specific range op (RangeInt32, etc.). | Expr.App (funcExpr, formalType, tyargs, [_start; _step; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) // Generic range–step op (RangeStepGeneric). - | Expr.App (funcExpr, formalType, tyargs, [zero; add; _start; _ste; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [zero; add; start; step; finish], m) + | Expr.App (funcExpr, formalType, tyargs, [zero; add; _start; _step; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [zero; add; start; step; finish], m) | _ -> error (InternalError ($"Unrecognized range function application '{rangeExpr}'.", m)) mkSequential @@ -10417,6 +10417,13 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = else mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) + let unsignedEquivalent ty = + if typeEquiv g ty g.int64_ty then g.uint64_ty + elif typeEquiv g ty g.int32_ty then g.uint32_ty + elif typeEquiv g ty g.int16_ty then g.uint16_ty + elif typeEquiv g ty g.sbyte_ty then g.byte_ty + else ty + /// Find the unsigned type with twice the width of the given type, if available. let nextWidestUnsignedTy ty = let ty = stripMeasuresFromTy g ty @@ -10433,33 +10440,28 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = /// Convert the value to the next-widest unsigned type. /// We do this so that adding one won't result in overflow. let mkWiden e = - let ty = stripMeasuresFromTy g (tyOfExpr g e) + let ty = stripMeasuresFromTy g rangeTy - if typeEquiv g ty g.int64_ty || typeEquiv g ty g.int32_ty || typeEquiv g ty g.uint32_ty then + if typeEquiv g ty g.int32_ty then mkAsmExpr ([AI_conv DT_I8], [], [e], [g.uint64_ty], m) - elif typeEquiv g ty g.int16_ty || typeEquiv g ty g.uint16_ty || typeEquiv g ty g.char_ty then + elif typeEquiv g ty g.uint32_ty then + mkAsmExpr ([AI_conv DT_U8], [], [e], [g.uint64_ty], m) + elif typeEquiv g ty g.int16_ty then mkAsmExpr ([AI_conv DT_I4], [], [e], [g.uint32_ty], m) - elif typeEquiv g ty g.sbyte_ty || typeEquiv g ty g.byte_ty then + elif typeEquiv g ty g.uint16_ty || typeEquiv g ty g.char_ty then + mkAsmExpr ([AI_conv DT_U4], [], [e], [g.uint32_ty], m) + elif typeEquiv g ty g.sbyte_ty then mkAsmExpr ([AI_conv DT_I2], [], [e], [g.uint16_ty], m) + elif typeEquiv g ty g.byte_ty then + mkAsmExpr ([AI_conv DT_U2], [], [e], [g.uint16_ty], m) else e - /// Unsigned, widened diff. /// Expects that |e1| ≥ |e2|. - let mkDiff e1 e2 = - let e1 = mkWiden e1 - let e2 = mkWiden e2 - mkAsmExpr ([AI_sub], [], [e1; e2], [tyOfExpr g e1], m) + let mkDiff e1 e2 = mkAsmExpr ([AI_sub], [], [e1; e2], [unsignedEquivalent (tyOfExpr g e1)], m) /// diff / step - let mkQuotient diff step = - let step = - if typeEquiv g (tyOfExpr g diff) g.uint64_ty then - mkAsmExpr ([AI_conv DT_I8], [], [step], [g.uint64_ty], m) - else - step - - mkAsmExpr ([AI_div_un], [], [diff; step], [tyOfExpr g diff], m) + let mkQuotient diff step = mkAsmExpr ([AI_div_un], [], [diff; step], [tyOfExpr g diff], m) /// Whether the total count might not fit in 64 bits. let couldBeTooBig ty = @@ -10472,9 +10474,10 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = /// pseudoCount + 1 let mkAddOne pseudoCount = + let pseudoCount = mkWiden pseudoCount let ty = tyOfExpr g pseudoCount - if couldBeTooBig ty then + if couldBeTooBig rangeTy then mkAsmExpr ([AI_add_ovf_un], [], [pseudoCount; mkTypedOne g m ty], [ty], m) else mkAsmExpr ([AI_add], [], [pseudoCount; mkTypedOne g m ty], [ty], m) @@ -10523,17 +10526,17 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // // if finish < start then 0 else finish - start + 1 | _, Expr.Const (value = IntegralConst.One), _ -> - let diff = mkDiff finish start - let diffTy = tyOfExpr g diff - let mkCount mkAddOne = + let count = mkAddOne (mkDiff finish start) + let countTy = tyOfExpr g count + mkCond DebugPointAtBinding.NoneAtInvisible m - diffTy + countTy (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m diffTy) - (mkAddOne diff) + (mkTypedZero g m countTy) + count match start, finish with // The total count could exceed 2⁶⁴. @@ -10554,17 +10557,17 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // // if start < finish then 0 else start - finish + 1 | _, Expr.Const (value = IntegralConst.MinusOne), _ -> - let diff = mkDiff start finish - let diffTy = tyOfExpr g diff - let mkCount mkAddOne = + let count = mkAddOne (mkDiff start finish) + let countTy = tyOfExpr g count + mkCond DebugPointAtBinding.NoneAtInvisible m - diffTy + countTy (mkSignednessAppropriateClt rangeTy start finish) - (mkTypedZero g m diffTy) - (mkAddOne diff) + (mkTypedZero g m countTy) + count match start, finish with // The total count could exceed 2⁶⁴. @@ -10581,17 +10584,17 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // // if finish < start then 0 else (finish - start) / step + 1 | _, Expr.Const (value = IntegralConst.Positive), _ -> - let diff = mkDiff finish start - let diffTy = tyOfExpr g diff - let count = + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count + mkCond DebugPointAtBinding.NoneAtInvisible m - diffTy + countTy (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff step)) + (mkTypedZero g m countTy) + count // We know that the magnitude of step is greater than one, // so we know that the total count won't overflow. @@ -10603,17 +10606,17 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // // if start < finish then 0 else (start - finish) / abs step + 1 | _, Expr.Const (value = IntegralConst.Negative as negativeStep), _ -> - let diff = mkDiff start finish - let diffTy = tyOfExpr g diff - let count = + let count = mkAddOne (mkQuotient (mkDiff start finish) (Expr.Const (IntegralConst.abs negativeStep, m, unsignedEquivalent rangeTy))) + let countTy = tyOfExpr g count + mkCond DebugPointAtBinding.NoneAtInvisible m - diffTy + countTy (mkSignednessAppropriateClt rangeTy start finish) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff (Expr.Const (IntegralConst.abs negativeStep, m, diffTy)))) + (mkTypedZero g m countTy) + count // We know that the magnitude of step is greater than one, // so we know that the total count won't overflow. @@ -10645,29 +10648,29 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let count = if isSignedIntegerTy g rangeTy then let positiveStep = - let diff = mkDiff finish start - let diffTy = tyOfExpr g diff + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count mkCond DebugPointAtBinding.NoneAtInvisible m - diffTy + countTy (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff step)) + (mkTypedZero g m countTy) + count let negativeStep = - let diff = mkDiff start finish - let diffTy = tyOfExpr g diff - let absStep = mkAsmExpr ([AI_add], [], [mkWiden (mkAsmExpr ([AI_not], [], [step], [rangeTy], m)); mkTypedOne g m diffTy], [diffTy], m) + let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [rangeTy], m); mkTypedOne g m rangeTy], [rangeTy], m) + let count = mkAddOne (mkQuotient (mkDiff start finish) absStep) + let countTy = tyOfExpr g count mkCond DebugPointAtBinding.NoneAtInvisible m - diffTy + countTy (mkSignednessAppropriateClt rangeTy start finish) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff absStep)) + (mkTypedZero g m countTy) + count mkCond DebugPointAtBinding.NoneAtInvisible @@ -10677,16 +10680,16 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = positiveStep negativeStep else // Unsigned. - let diff = mkDiff finish start - let diffTy = tyOfExpr g diff + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count mkCond DebugPointAtBinding.NoneAtInvisible m - diffTy + countTy (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m diffTy) - (mkAddOne (mkQuotient diff step)) + (mkTypedZero g m countTy) + count mkSequential m throwIfStepIsZero count From bd892f1bd8f0a8dad64166750700c3438d19cee3 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 27 Feb 2024 17:50:43 -0500 Subject: [PATCH 55/66] Update baselines --- .../Int32RangeArrays.fs.il.bsl | 1999 ++++++++--------- .../Int32RangeLists.fs.il.bsl | 1565 +++++++------ .../UInt64RangeArrays.fs.il.bsl | 990 ++++---- .../UInt64RangeLists.fs.il.bsl | 726 +++--- .../ForEachRangeStepByte.fs.opt.il.bsl | 421 ++-- .../ForEachRangeStepChar.fs.opt.il.bsl | 411 ++-- .../ForEachRangeStepInt16.fs.opt.il.bsl | 451 ++-- .../ForEachRangeStepInt32.fs.opt.il.bsl | 336 ++- .../ForEachRangeStepInt64.fs.opt.il.bsl | 836 ++++--- .../ForEachRangeStepSByte.fs.opt.il.bsl | 451 ++-- .../ForEachRangeStepUInt16.fs.opt.il.bsl | 421 ++-- .../ForEachRangeStepUInt32.fs.opt.il.bsl | 463 ++-- .../ForEachRangeStepUInt64.fs.opt.il.bsl | 373 ++- ...onTrivialBranchingBindingInEnd03.fs.il.bsl | 155 +- ...ivialBranchingBindingInEnd03.fs.opt.il.bsl | 155 +- ...onTrivialBranchingBindingInEnd04.fs.il.bsl | 155 +- ...ivialBranchingBindingInEnd04.fs.opt.il.bsl | 155 +- ...ionSteppingTest07.fs.il.net472.release.bsl | 148 +- ...onSteppingTest07.fs.il.netcore.release.bsl | 148 +- 19 files changed, 5063 insertions(+), 5296 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl index c3949d99dc9..36ec223fd78 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl @@ -294,59 +294,58 @@ IL_0006: ldc.i4.0 IL_0007: conv.i8 IL_0008: nop - IL_0009: br.s IL_0015 + IL_0009: br.s IL_0014 IL_000b: ldc.i4.s 10 - IL_000d: conv.i8 - IL_000e: ldarg.0 + IL_000d: ldarg.0 + IL_000e: sub IL_000f: conv.i8 - IL_0010: sub - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: stloc.1 - IL_0018: ldloc.1 - IL_0019: ldc.i4.1 - IL_001a: conv.i8 - IL_001b: bge.un.s IL_0023 - - IL_001d: call !!0[] [runtime]System.Array::Empty() - IL_0022: ret - - IL_0023: ldloc.1 - IL_0024: conv.ovf.i.un - IL_0025: newarr [runtime]System.Int32 - IL_002a: stloc.2 - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: stloc.3 - IL_002e: ldarg.0 - IL_002f: stloc.s V_4 - IL_0031: br.s IL_0044 - - IL_0033: ldloc.2 - IL_0034: ldloc.3 - IL_0035: conv.i - IL_0036: ldloc.s V_4 - IL_0038: stelem.i4 - IL_0039: ldloc.s V_4 - IL_003b: ldc.i4.1 - IL_003c: add - IL_003d: stloc.s V_4 - IL_003f: ldloc.3 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: add - IL_0043: stloc.3 - IL_0044: ldloc.3 - IL_0045: ldloc.0 - IL_0046: blt.un.s IL_0033 + 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_0048: ldloc.2 - IL_0049: 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_0043 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i4 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.s V_4 + IL_003e: ldloc.3 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.3 + IL_0043: ldloc.3 + IL_0044: ldloc.0 + IL_0045: blt.un.s IL_0032 + + IL_0047: ldloc.2 + IL_0048: ret } .method public static int32[] f10(int32 finish) cil managed @@ -366,59 +365,58 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: ldc.i4.1 + IL_000b: ldc.i4.1 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: stloc.1 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 - - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret - - IL_0021: ldloc.1 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.Int32 - IL_0028: stloc.2 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.3 - IL_002c: ldc.i4.1 - IL_002d: stloc.s V_4 - IL_002f: br.s IL_0042 - - IL_0031: ldloc.2 - IL_0032: ldloc.3 - IL_0033: conv.i - IL_0034: ldloc.s V_4 - IL_0036: stelem.i4 - IL_0037: ldloc.s V_4 - IL_0039: ldc.i4.1 - IL_003a: add - IL_003b: stloc.s V_4 - IL_003d: ldloc.3 - IL_003e: ldc.i4.1 - IL_003f: conv.i8 - IL_0040: add - IL_0041: stloc.3 - IL_0042: ldloc.3 - IL_0043: ldloc.0 - IL_0044: blt.un.s IL_0031 - - IL_0046: ldloc.2 - IL_0047: ret + 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_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret } .method public static int32[] f11(int32 start, @@ -440,59 +438,58 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.1 - IL_000b: conv.i8 - IL_000c: ldarg.0 + IL_000b: ldarg.0 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: stloc.1 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 - - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret - - IL_0021: ldloc.1 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.Int32 - IL_0028: stloc.2 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.3 - IL_002c: ldarg.0 - IL_002d: stloc.s V_4 - IL_002f: br.s IL_0042 - - IL_0031: ldloc.2 - IL_0032: ldloc.3 - IL_0033: conv.i - IL_0034: ldloc.s V_4 - IL_0036: stelem.i4 - IL_0037: ldloc.s V_4 - IL_0039: ldc.i4.1 - IL_003a: add - IL_003b: stloc.s V_4 - IL_003d: ldloc.3 - IL_003e: ldc.i4.1 - IL_003f: conv.i8 - IL_0040: add - IL_0041: stloc.3 - IL_0042: ldloc.3 - IL_0043: ldloc.0 - IL_0044: blt.un.s IL_0031 - - IL_0046: ldloc.2 - IL_0047: ret + 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_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret } .method public static int32[] f12(int32 start) cil managed @@ -512,59 +509,58 @@ IL_0006: ldc.i4.0 IL_0007: conv.i8 IL_0008: nop - IL_0009: br.s IL_0015 + IL_0009: br.s IL_0014 IL_000b: ldc.i4.s 10 - IL_000d: conv.i8 - IL_000e: ldarg.0 + IL_000d: ldarg.0 + IL_000e: sub IL_000f: conv.i8 - IL_0010: sub - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: stloc.1 - IL_0018: ldloc.1 - IL_0019: ldc.i4.1 - IL_001a: conv.i8 - IL_001b: bge.un.s IL_0023 - - IL_001d: call !!0[] [runtime]System.Array::Empty() - IL_0022: ret - - IL_0023: ldloc.1 - IL_0024: conv.ovf.i.un - IL_0025: newarr [runtime]System.Int32 - IL_002a: stloc.2 - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: stloc.3 - IL_002e: ldarg.0 - IL_002f: stloc.s V_4 - IL_0031: br.s IL_0044 - - IL_0033: ldloc.2 - IL_0034: ldloc.3 - IL_0035: conv.i - IL_0036: ldloc.s V_4 - IL_0038: stelem.i4 - IL_0039: ldloc.s V_4 - IL_003b: ldc.i4.1 - IL_003c: add - IL_003d: stloc.s V_4 - IL_003f: ldloc.3 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: add - IL_0043: stloc.3 - IL_0044: ldloc.3 - IL_0045: ldloc.0 - IL_0046: blt.un.s IL_0033 + 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_0048: ldloc.2 - IL_0049: ret + 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_0043 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i4 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.s V_4 + IL_003e: ldloc.3 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.3 + IL_0043: ldloc.3 + IL_0044: ldloc.0 + IL_0045: blt.un.s IL_0032 + + IL_0047: ldloc.2 + IL_0048: ret } .method public static int32[] f13(int32 step) cil managed @@ -593,7 +589,7 @@ IL_0011: nop IL_0012: ldc.i4.0 IL_0013: ldarg.0 - IL_0014: bge.s IL_002f + IL_0014: bge.s IL_002d IL_0016: ldc.i4.s 10 IL_0018: ldc.i4.1 @@ -602,90 +598,84 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_004b + IL_001e: br.s IL_0045 IL_0020: ldc.i4.s 10 - IL_0022: conv.i8 - IL_0023: ldc.i4.1 - IL_0024: conv.i8 - IL_0025: sub - IL_0026: ldarg.0 - IL_0027: conv.i8 - IL_0028: div.un - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add.ovf.un - IL_002c: nop - IL_002d: br.s IL_004b + 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_002f: ldc.i4.1 - IL_0030: ldc.i4.s 10 - IL_0032: bge.s IL_0039 + IL_002d: ldc.i4.1 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 - IL_0034: ldc.i4.0 - IL_0035: conv.i8 - IL_0036: nop - IL_0037: br.s IL_004b + 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_0039: ldc.i4.1 - IL_003a: conv.i8 - IL_003b: ldc.i4.s 10 - IL_003d: conv.i8 - IL_003e: sub - IL_003f: ldarg.0 - IL_0040: not - IL_0041: conv.i8 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: conv.i8 - IL_0046: div.un - IL_0047: ldc.i4.1 - IL_0048: conv.i8 - IL_0049: add.ovf.un - IL_004a: nop - IL_004b: stloc.0 - IL_004c: ldloc.0 - IL_004d: stloc.1 - IL_004e: ldloc.1 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: bge.un.s IL_0059 - - IL_0053: call !!0[] [runtime]System.Array::Empty() - IL_0058: ret - - IL_0059: ldloc.1 - IL_005a: conv.ovf.i.un - IL_005b: newarr [runtime]System.Int32 - IL_0060: stloc.2 - IL_0061: ldc.i4.0 - IL_0062: conv.i8 - IL_0063: stloc.3 - IL_0064: ldc.i4.1 - IL_0065: stloc.s V_4 - IL_0067: br.s IL_007a - - IL_0069: ldloc.2 - IL_006a: ldloc.3 - IL_006b: conv.i - IL_006c: ldloc.s V_4 - IL_006e: stelem.i4 - IL_006f: ldloc.s V_4 - IL_0071: ldarg.0 + 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_0074 + + IL_0063: ldloc.2 + IL_0064: ldloc.3 + IL_0065: conv.i + IL_0066: ldloc.s V_4 + IL_0068: stelem.i4 + IL_0069: ldloc.s V_4 + IL_006b: ldarg.0 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 IL_0072: add - IL_0073: stloc.s V_4 - IL_0075: ldloc.3 - IL_0076: ldc.i4.1 - IL_0077: conv.i8 - IL_0078: add - IL_0079: stloc.3 - IL_007a: ldloc.3 - IL_007b: ldloc.0 - IL_007c: blt.un.s IL_0069 - - IL_007e: ldloc.2 - IL_007f: ret + IL_0073: stloc.3 + IL_0074: ldloc.3 + IL_0075: ldloc.0 + IL_0076: blt.un.s IL_0063 + + IL_0078: ldloc.2 + IL_0079: ret } .method public static int32[] f14(int32 finish) cil managed @@ -705,59 +695,58 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: ldc.i4.1 + IL_000b: ldc.i4.1 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: stloc.1 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 - - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret - - IL_0021: ldloc.1 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.Int32 - IL_0028: stloc.2 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.3 - IL_002c: ldc.i4.1 - IL_002d: stloc.s V_4 - IL_002f: br.s IL_0042 - - IL_0031: ldloc.2 - IL_0032: ldloc.3 - IL_0033: conv.i - IL_0034: ldloc.s V_4 - IL_0036: stelem.i4 - IL_0037: ldloc.s V_4 - IL_0039: ldc.i4.1 - IL_003a: add - IL_003b: stloc.s V_4 - IL_003d: ldloc.3 - IL_003e: ldc.i4.1 - IL_003f: conv.i8 - IL_0040: add - IL_0041: stloc.3 - IL_0042: ldloc.3 - IL_0043: ldloc.0 - IL_0044: blt.un.s IL_0031 - - IL_0046: ldloc.2 - IL_0047: ret + 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_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret } .method public static int32[] f15(int32 start, @@ -788,7 +777,7 @@ IL_0011: nop IL_0012: ldc.i4.0 IL_0013: ldarg.1 - IL_0014: bge.s IL_002f + IL_0014: bge.s IL_002d IL_0016: ldc.i4.s 10 IL_0018: ldarg.0 @@ -797,90 +786,84 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_004b + IL_001e: br.s IL_0045 IL_0020: ldc.i4.s 10 - IL_0022: conv.i8 - IL_0023: ldarg.0 - IL_0024: conv.i8 - IL_0025: sub - IL_0026: ldarg.1 - IL_0027: conv.i8 - IL_0028: div.un - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add.ovf.un - IL_002c: nop - IL_002d: br.s IL_004b + 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_002f: ldarg.0 - IL_0030: ldc.i4.s 10 - IL_0032: bge.s IL_0039 + IL_002d: ldarg.0 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 - IL_0034: ldc.i4.0 - IL_0035: conv.i8 - IL_0036: nop - IL_0037: br.s IL_004b + 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_0039: ldarg.0 - IL_003a: conv.i8 - IL_003b: ldc.i4.s 10 - IL_003d: conv.i8 - IL_003e: sub - IL_003f: ldarg.1 - IL_0040: not - IL_0041: conv.i8 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: conv.i8 - IL_0046: div.un - IL_0047: ldc.i4.1 - IL_0048: conv.i8 - IL_0049: add.ovf.un - IL_004a: nop - IL_004b: stloc.0 - IL_004c: ldloc.0 - IL_004d: stloc.1 - IL_004e: ldloc.1 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: bge.un.s IL_0059 - - IL_0053: call !!0[] [runtime]System.Array::Empty() - IL_0058: ret - - IL_0059: ldloc.1 - IL_005a: conv.ovf.i.un - IL_005b: newarr [runtime]System.Int32 - IL_0060: stloc.2 - IL_0061: ldc.i4.0 - IL_0062: conv.i8 - IL_0063: stloc.3 - IL_0064: ldarg.0 - IL_0065: stloc.s V_4 - IL_0067: br.s IL_007a - - IL_0069: ldloc.2 - IL_006a: ldloc.3 - IL_006b: conv.i - IL_006c: ldloc.s V_4 - IL_006e: stelem.i4 - IL_006f: ldloc.s V_4 - IL_0071: ldarg.1 + 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_0074 + + IL_0063: ldloc.2 + IL_0064: ldloc.3 + IL_0065: conv.i + IL_0066: ldloc.s V_4 + IL_0068: stelem.i4 + IL_0069: ldloc.s V_4 + IL_006b: ldarg.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 IL_0072: add - IL_0073: stloc.s V_4 - IL_0075: ldloc.3 - IL_0076: ldc.i4.1 - IL_0077: conv.i8 - IL_0078: add - IL_0079: stloc.3 - IL_007a: ldloc.3 - IL_007b: ldloc.0 - IL_007c: blt.un.s IL_0069 - - IL_007e: ldloc.2 - IL_007f: ret + IL_0073: stloc.3 + IL_0074: ldloc.3 + IL_0075: ldloc.0 + IL_0076: blt.un.s IL_0063 + + IL_0078: ldloc.2 + IL_0079: ret } .method public static int32[] f16(int32 start, @@ -902,59 +885,58 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.1 - IL_000b: conv.i8 - IL_000c: ldarg.0 + IL_000b: ldarg.0 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: stloc.1 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0021 - - IL_001b: call !!0[] [runtime]System.Array::Empty() - IL_0020: ret - - IL_0021: ldloc.1 - IL_0022: conv.ovf.i.un - IL_0023: newarr [runtime]System.Int32 - IL_0028: stloc.2 - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: stloc.3 - IL_002c: ldarg.0 - IL_002d: stloc.s V_4 - IL_002f: br.s IL_0042 - - IL_0031: ldloc.2 - IL_0032: ldloc.3 - IL_0033: conv.i - IL_0034: ldloc.s V_4 - IL_0036: stelem.i4 - IL_0037: ldloc.s V_4 - IL_0039: ldc.i4.1 - IL_003a: add - IL_003b: stloc.s V_4 - IL_003d: ldloc.3 - IL_003e: ldc.i4.1 - IL_003f: conv.i8 - IL_0040: add - IL_0041: stloc.3 - IL_0042: ldloc.3 - IL_0043: ldloc.0 - IL_0044: blt.un.s IL_0031 - - IL_0046: ldloc.2 - IL_0047: ret + 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_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret } .method public static int32[] f17(int32 step, @@ -985,7 +967,7 @@ IL_0010: nop IL_0011: ldc.i4.0 IL_0012: ldarg.0 - IL_0013: bge.s IL_002c + IL_0013: bge.s IL_002a IL_0015: ldarg.1 IL_0016: ldc.i4.1 @@ -994,90 +976,84 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_0046 + IL_001c: br.s IL_0040 IL_001e: ldarg.1 - IL_001f: conv.i8 - IL_0020: ldc.i4.1 - IL_0021: conv.i8 - IL_0022: sub - IL_0023: ldarg.0 - IL_0024: conv.i8 - IL_0025: div.un - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: add.ovf.un - IL_0029: nop - IL_002a: br.s IL_0046 - - IL_002c: ldc.i4.1 - IL_002d: ldarg.1 - IL_002e: bge.s IL_0035 + 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_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: nop - IL_0033: br.s IL_0046 - - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: ldarg.1 - IL_0038: conv.i8 - IL_0039: sub - IL_003a: ldarg.0 - IL_003b: not - IL_003c: conv.i8 - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add - IL_0040: conv.i8 - IL_0041: div.un - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add.ovf.un - IL_0045: nop - IL_0046: stloc.0 - IL_0047: ldloc.0 - IL_0048: stloc.1 - IL_0049: ldloc.1 - IL_004a: ldc.i4.1 - IL_004b: conv.i8 - IL_004c: bge.un.s IL_0054 - - IL_004e: call !!0[] [runtime]System.Array::Empty() - IL_0053: ret - - IL_0054: ldloc.1 - IL_0055: conv.ovf.i.un - IL_0056: newarr [runtime]System.Int32 - IL_005b: stloc.2 - IL_005c: ldc.i4.0 - IL_005d: conv.i8 - IL_005e: stloc.3 - IL_005f: ldc.i4.1 - IL_0060: stloc.s V_4 - IL_0062: br.s IL_0075 - - IL_0064: ldloc.2 - IL_0065: ldloc.3 - IL_0066: conv.i - IL_0067: ldloc.s V_4 - IL_0069: stelem.i4 - IL_006a: ldloc.s V_4 - IL_006c: ldarg.0 + 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_006f + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stelem.i4 + IL_0064: ldloc.s V_4 + IL_0066: ldarg.0 + IL_0067: add + IL_0068: stloc.s V_4 + IL_006a: ldloc.3 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 IL_006d: add - IL_006e: stloc.s V_4 - IL_0070: ldloc.3 - IL_0071: ldc.i4.1 - IL_0072: conv.i8 - IL_0073: add - IL_0074: stloc.3 - IL_0075: ldloc.3 - IL_0076: ldloc.0 - IL_0077: blt.un.s IL_0064 - - IL_0079: ldloc.2 - IL_007a: ret + IL_006e: stloc.3 + IL_006f: ldloc.3 + IL_0070: ldloc.0 + IL_0071: blt.un.s IL_005e + + IL_0073: ldloc.2 + IL_0074: ret } .method public static int32[] f18(int32 start, @@ -1110,7 +1086,7 @@ IL_0010: nop IL_0011: ldc.i4.0 IL_0012: ldarg.1 - IL_0013: bge.s IL_002c + IL_0013: bge.s IL_002a IL_0015: ldarg.2 IL_0016: ldarg.0 @@ -1119,90 +1095,84 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_0046 + IL_001c: br.s IL_0040 IL_001e: ldarg.2 - IL_001f: conv.i8 - IL_0020: ldarg.0 - IL_0021: conv.i8 - IL_0022: sub - IL_0023: ldarg.1 - IL_0024: conv.i8 - IL_0025: div.un - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: add.ovf.un - IL_0029: nop - IL_002a: br.s IL_0046 - - IL_002c: ldarg.0 - IL_002d: ldarg.2 - IL_002e: bge.s IL_0035 + 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_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: nop - IL_0033: br.s IL_0046 - - IL_0035: ldarg.0 - IL_0036: conv.i8 - IL_0037: ldarg.2 - IL_0038: conv.i8 - IL_0039: sub - IL_003a: ldarg.1 - IL_003b: not - IL_003c: conv.i8 - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add - IL_0040: conv.i8 - IL_0041: div.un - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add.ovf.un - IL_0045: nop - IL_0046: stloc.0 - IL_0047: ldloc.0 - IL_0048: stloc.1 - IL_0049: ldloc.1 - IL_004a: ldc.i4.1 - IL_004b: conv.i8 - IL_004c: bge.un.s IL_0054 - - IL_004e: call !!0[] [runtime]System.Array::Empty() - IL_0053: ret - - IL_0054: ldloc.1 - IL_0055: conv.ovf.i.un - IL_0056: newarr [runtime]System.Int32 - IL_005b: stloc.2 - IL_005c: ldc.i4.0 - IL_005d: conv.i8 - IL_005e: stloc.3 - IL_005f: ldarg.0 - IL_0060: stloc.s V_4 - IL_0062: br.s IL_0075 - - IL_0064: ldloc.2 - IL_0065: ldloc.3 - IL_0066: conv.i - IL_0067: ldloc.s V_4 - IL_0069: stelem.i4 - IL_006a: ldloc.s V_4 - IL_006c: ldarg.1 + 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_006f + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stelem.i4 + IL_0064: ldloc.s V_4 + IL_0066: ldarg.1 + IL_0067: add + IL_0068: stloc.s V_4 + IL_006a: ldloc.3 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 IL_006d: add - IL_006e: stloc.s V_4 - IL_0070: ldloc.3 - IL_0071: ldc.i4.1 - IL_0072: conv.i8 - IL_0073: add - IL_0074: stloc.3 - IL_0075: ldloc.3 - IL_0076: ldloc.0 - IL_0077: blt.un.s IL_0064 - - IL_0079: ldloc.2 - IL_007a: ret + IL_006e: stloc.3 + IL_006f: ldloc.3 + IL_0070: ldloc.0 + IL_0071: blt.un.s IL_005e + + IL_0073: ldloc.2 + IL_0074: ret } .method public static int32[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1226,59 +1196,58 @@ IL_000d: ldc.i4.0 IL_000e: conv.i8 IL_000f: nop - IL_0010: br.s IL_001c + IL_0010: br.s IL_001b IL_0012: ldc.i4.s 10 - IL_0014: conv.i8 - IL_0015: ldloc.0 + IL_0014: ldloc.0 + IL_0015: sub IL_0016: conv.i8 - IL_0017: sub - IL_0018: ldc.i4.1 - IL_0019: conv.i8 - IL_001a: add.ovf.un - IL_001b: nop - IL_001c: stloc.1 - IL_001d: ldloc.1 - IL_001e: stloc.2 - IL_001f: ldloc.2 - IL_0020: ldc.i4.1 - IL_0021: conv.i8 - IL_0022: bge.un.s IL_002a - - IL_0024: call !!0[] [runtime]System.Array::Empty() - IL_0029: ret - - IL_002a: ldloc.2 - IL_002b: conv.ovf.i.un - IL_002c: newarr [runtime]System.Int32 - IL_0031: stloc.3 - IL_0032: ldc.i4.0 - IL_0033: conv.i8 - IL_0034: stloc.s V_4 - IL_0036: ldloc.0 - IL_0037: stloc.s V_5 - IL_0039: br.s IL_004f - - IL_003b: ldloc.3 - IL_003c: ldloc.s V_4 - IL_003e: conv.i - IL_003f: ldloc.s V_5 - IL_0041: stelem.i4 - IL_0042: ldloc.s V_5 - IL_0044: ldc.i4.1 - IL_0045: add - IL_0046: stloc.s V_5 - IL_0048: ldloc.s V_4 - IL_004a: ldc.i4.1 - IL_004b: conv.i8 - IL_004c: add - IL_004d: stloc.s V_4 - IL_004f: ldloc.s V_4 - IL_0051: ldloc.1 - IL_0052: blt.un.s IL_003b + 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_004e + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i4 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: add + IL_0045: stloc.s V_5 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.s V_4 + IL_0050: ldloc.1 + IL_0051: blt.un.s IL_003a - IL_0054: ldloc.3 - IL_0055: ret + IL_0053: ldloc.3 + IL_0054: ret } .method public static int32[] f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1302,59 +1271,58 @@ IL_000c: ldc.i4.0 IL_000d: conv.i8 IL_000e: nop - IL_000f: br.s IL_001a + IL_000f: br.s IL_0019 IL_0011: ldloc.0 - IL_0012: conv.i8 - IL_0013: ldc.i4.1 + IL_0012: ldc.i4.1 + IL_0013: sub IL_0014: conv.i8 - IL_0015: sub - IL_0016: ldc.i4.1 - IL_0017: conv.i8 - IL_0018: add.ovf.un - IL_0019: nop - IL_001a: stloc.1 - IL_001b: ldloc.1 - IL_001c: stloc.2 - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0028 + 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_0022: call !!0[] [runtime]System.Array::Empty() - IL_0027: ret + IL_0021: call !!0[] [runtime]System.Array::Empty() + IL_0026: ret - IL_0028: ldloc.2 - IL_0029: conv.ovf.i.un - IL_002a: newarr [runtime]System.Int32 - IL_002f: stloc.3 - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: stloc.s V_4 - IL_0034: ldc.i4.1 - IL_0035: stloc.s V_5 - IL_0037: br.s IL_004d - - IL_0039: ldloc.3 - IL_003a: ldloc.s V_4 - IL_003c: conv.i - IL_003d: ldloc.s V_5 - IL_003f: stelem.i4 - IL_0040: ldloc.s V_5 - IL_0042: ldc.i4.1 - IL_0043: add - IL_0044: stloc.s V_5 - IL_0046: ldloc.s V_4 - IL_0048: ldc.i4.1 - IL_0049: conv.i8 - IL_004a: add - IL_004b: stloc.s V_4 - IL_004d: ldloc.s V_4 - IL_004f: ldloc.1 - IL_0050: blt.un.s IL_0039 + 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_004c + + IL_0038: ldloc.3 + IL_0039: ldloc.s V_4 + IL_003b: conv.i + IL_003c: ldloc.s V_5 + IL_003e: stelem.i4 + IL_003f: ldloc.s V_5 + IL_0041: ldc.i4.1 + IL_0042: add + IL_0043: stloc.s V_5 + IL_0045: ldloc.s V_4 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.s V_4 + IL_004e: ldloc.1 + IL_004f: blt.un.s IL_0038 - IL_0052: ldloc.3 - IL_0053: ret + IL_0051: ldloc.3 + IL_0052: ret } .method public static int32[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1385,59 +1353,58 @@ IL_0014: ldc.i4.0 IL_0015: conv.i8 IL_0016: nop - IL_0017: br.s IL_0022 + IL_0017: br.s IL_0021 IL_0019: ldloc.1 - IL_001a: conv.i8 - IL_001b: ldloc.0 + IL_001a: ldloc.0 + IL_001b: sub IL_001c: conv.i8 - IL_001d: sub - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: add.ovf.un - IL_0021: nop - IL_0022: stloc.2 - IL_0023: ldloc.2 - IL_0024: stloc.3 - IL_0025: ldloc.3 - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: bge.un.s IL_0030 - - IL_002a: call !!0[] [runtime]System.Array::Empty() - IL_002f: ret - - IL_0030: ldloc.3 - IL_0031: conv.ovf.i.un - IL_0032: newarr [runtime]System.Int32 - IL_0037: stloc.s V_4 - IL_0039: ldc.i4.0 - IL_003a: conv.i8 - IL_003b: stloc.s V_5 - IL_003d: ldloc.0 - IL_003e: stloc.s V_6 - IL_0040: br.s IL_0057 - - IL_0042: ldloc.s V_4 - IL_0044: ldloc.s V_5 - IL_0046: conv.i - IL_0047: ldloc.s V_6 - IL_0049: stelem.i4 - IL_004a: ldloc.s V_6 - IL_004c: ldc.i4.1 - IL_004d: add - IL_004e: stloc.s V_6 - IL_0050: ldloc.s V_5 - IL_0052: ldc.i4.1 - IL_0053: conv.i8 - IL_0054: add - IL_0055: stloc.s V_5 - IL_0057: ldloc.s V_5 - IL_0059: ldloc.2 - IL_005a: blt.un.s IL_0042 - - IL_005c: ldloc.s V_4 - IL_005e: ret + 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_0056 + + IL_0041: ldloc.s V_4 + IL_0043: ldloc.s V_5 + IL_0045: conv.i + IL_0046: ldloc.s V_6 + IL_0048: stelem.i4 + IL_0049: ldloc.s V_6 + IL_004b: ldc.i4.1 + IL_004c: add + IL_004d: stloc.s V_6 + IL_004f: ldloc.s V_5 + IL_0051: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: add + IL_0054: stloc.s V_5 + IL_0056: ldloc.s V_5 + IL_0058: ldloc.2 + IL_0059: blt.un.s IL_0041 + + IL_005b: ldloc.s V_4 + IL_005d: ret } .method public static int32[] f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1461,59 +1428,58 @@ IL_000d: ldc.i4.0 IL_000e: conv.i8 IL_000f: nop - IL_0010: br.s IL_001c + IL_0010: br.s IL_001b IL_0012: ldc.i4.s 10 - IL_0014: conv.i8 - IL_0015: ldloc.0 + IL_0014: ldloc.0 + IL_0015: sub IL_0016: conv.i8 - IL_0017: sub - IL_0018: ldc.i4.1 - IL_0019: conv.i8 - IL_001a: add.ovf.un - IL_001b: nop - IL_001c: stloc.1 - IL_001d: ldloc.1 - IL_001e: stloc.2 - IL_001f: ldloc.2 - IL_0020: ldc.i4.1 - IL_0021: conv.i8 - IL_0022: bge.un.s IL_002a - - IL_0024: call !!0[] [runtime]System.Array::Empty() - IL_0029: ret - - IL_002a: ldloc.2 - IL_002b: conv.ovf.i.un - IL_002c: newarr [runtime]System.Int32 - IL_0031: stloc.3 - IL_0032: ldc.i4.0 - IL_0033: conv.i8 - IL_0034: stloc.s V_4 - IL_0036: ldloc.0 - IL_0037: stloc.s V_5 - IL_0039: br.s IL_004f - - IL_003b: ldloc.3 - IL_003c: ldloc.s V_4 - IL_003e: conv.i - IL_003f: ldloc.s V_5 - IL_0041: stelem.i4 - IL_0042: ldloc.s V_5 - IL_0044: ldc.i4.1 - IL_0045: add - IL_0046: stloc.s V_5 - IL_0048: ldloc.s V_4 - IL_004a: ldc.i4.1 - IL_004b: conv.i8 - IL_004c: add - IL_004d: stloc.s V_4 - IL_004f: ldloc.s V_4 - IL_0051: ldloc.1 - IL_0052: blt.un.s IL_003b + 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_004e + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i4 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: add + IL_0045: stloc.s V_5 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.s V_4 + IL_0050: ldloc.1 + IL_0051: blt.un.s IL_003a - IL_0054: ldloc.3 - IL_0055: ret + IL_0053: ldloc.3 + IL_0054: ret } .method public static int32[] f23(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1546,7 +1512,7 @@ IL_0018: nop IL_0019: ldc.i4.0 IL_001a: ldloc.0 - IL_001b: bge.s IL_0036 + IL_001b: bge.s IL_0034 IL_001d: ldc.i4.s 10 IL_001f: ldc.i4.1 @@ -1555,90 +1521,84 @@ IL_0022: ldc.i4.0 IL_0023: conv.i8 IL_0024: nop - IL_0025: br.s IL_0052 + IL_0025: br.s IL_004c IL_0027: ldc.i4.s 10 - IL_0029: conv.i8 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: sub - IL_002d: ldloc.0 - IL_002e: conv.i8 - IL_002f: div.un - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add.ovf.un - IL_0033: nop - IL_0034: br.s IL_0052 + 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_0036: ldc.i4.1 - IL_0037: ldc.i4.s 10 - IL_0039: bge.s IL_0040 + IL_0034: ldc.i4.1 + IL_0035: ldc.i4.s 10 + IL_0037: bge.s IL_003e - IL_003b: ldc.i4.0 - IL_003c: conv.i8 - IL_003d: nop - IL_003e: br.s IL_0052 - - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: ldc.i4.s 10 - IL_0044: conv.i8 - IL_0045: sub - IL_0046: ldloc.0 - IL_0047: not - IL_0048: conv.i8 - IL_0049: ldc.i4.1 - IL_004a: conv.i8 - IL_004b: add - IL_004c: conv.i8 - IL_004d: div.un - IL_004e: ldc.i4.1 - IL_004f: conv.i8 - IL_0050: add.ovf.un - IL_0051: nop - IL_0052: stloc.1 - IL_0053: ldloc.1 - IL_0054: stloc.2 - IL_0055: ldloc.2 - IL_0056: ldc.i4.1 - IL_0057: conv.i8 - IL_0058: bge.un.s IL_0060 - - IL_005a: call !!0[] [runtime]System.Array::Empty() - IL_005f: ret - - IL_0060: ldloc.2 - IL_0061: conv.ovf.i.un - IL_0062: newarr [runtime]System.Int32 - IL_0067: stloc.3 - IL_0068: ldc.i4.0 - IL_0069: conv.i8 - IL_006a: stloc.s V_4 - IL_006c: ldc.i4.1 - IL_006d: stloc.s V_5 - IL_006f: br.s IL_0085 - - IL_0071: ldloc.3 - IL_0072: ldloc.s V_4 - IL_0074: conv.i - IL_0075: ldloc.s V_5 - IL_0077: stelem.i4 - IL_0078: ldloc.s V_5 - IL_007a: ldloc.0 - IL_007b: add - IL_007c: stloc.s V_5 - IL_007e: ldloc.s V_4 - IL_0080: ldc.i4.1 - IL_0081: conv.i8 - IL_0082: add - IL_0083: stloc.s V_4 - IL_0085: ldloc.s V_4 - IL_0087: ldloc.1 - IL_0088: blt.un.s IL_0071 - - IL_008a: ldloc.3 - IL_008b: ret + 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_007f + + IL_006b: ldloc.3 + IL_006c: ldloc.s V_4 + IL_006e: conv.i + IL_006f: ldloc.s V_5 + IL_0071: stelem.i4 + IL_0072: ldloc.s V_5 + IL_0074: ldloc.0 + IL_0075: add + IL_0076: stloc.s V_5 + IL_0078: ldloc.s V_4 + IL_007a: ldc.i4.1 + IL_007b: conv.i8 + IL_007c: add + IL_007d: stloc.s V_4 + IL_007f: ldloc.s V_4 + IL_0081: ldloc.1 + IL_0082: blt.un.s IL_006b + + IL_0084: ldloc.3 + IL_0085: ret } .method public static int32[] f24(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1662,59 +1622,58 @@ IL_000c: ldc.i4.0 IL_000d: conv.i8 IL_000e: nop - IL_000f: br.s IL_001a + IL_000f: br.s IL_0019 IL_0011: ldloc.0 - IL_0012: conv.i8 - IL_0013: ldc.i4.1 + IL_0012: ldc.i4.1 + IL_0013: sub IL_0014: conv.i8 - IL_0015: sub - IL_0016: ldc.i4.1 - IL_0017: conv.i8 - IL_0018: add.ovf.un - IL_0019: nop - IL_001a: stloc.1 - IL_001b: ldloc.1 - IL_001c: stloc.2 - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0028 + 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_0022: call !!0[] [runtime]System.Array::Empty() - IL_0027: ret + IL_0021: call !!0[] [runtime]System.Array::Empty() + IL_0026: ret - IL_0028: ldloc.2 - IL_0029: conv.ovf.i.un - IL_002a: newarr [runtime]System.Int32 - IL_002f: stloc.3 - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: stloc.s V_4 - IL_0034: ldc.i4.1 - IL_0035: stloc.s V_5 - IL_0037: br.s IL_004d - - IL_0039: ldloc.3 - IL_003a: ldloc.s V_4 - IL_003c: conv.i - IL_003d: ldloc.s V_5 - IL_003f: stelem.i4 - IL_0040: ldloc.s V_5 - IL_0042: ldc.i4.1 - IL_0043: add - IL_0044: stloc.s V_5 - IL_0046: ldloc.s V_4 - IL_0048: ldc.i4.1 - IL_0049: conv.i8 - IL_004a: add - IL_004b: stloc.s V_4 - IL_004d: ldloc.s V_4 - IL_004f: ldloc.1 - IL_0050: blt.un.s IL_0039 + 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_004c + + IL_0038: ldloc.3 + IL_0039: ldloc.s V_4 + IL_003b: conv.i + IL_003c: ldloc.s V_5 + IL_003e: stelem.i4 + IL_003f: ldloc.s V_5 + IL_0041: ldc.i4.1 + IL_0042: add + IL_0043: stloc.s V_5 + IL_0045: ldloc.s V_4 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.s V_4 + IL_004e: ldloc.1 + IL_004f: blt.un.s IL_0038 - IL_0052: ldloc.3 - IL_0053: ret + IL_0051: ldloc.3 + IL_0052: ret } .method public static int32[] f25(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1761,7 +1720,7 @@ IL_0027: nop IL_0028: ldc.i4.0 IL_0029: ldloc.1 - IL_002a: bge.s IL_0043 + IL_002a: bge.s IL_0041 IL_002c: ldloc.2 IL_002d: ldloc.0 @@ -1770,90 +1729,84 @@ IL_0030: ldc.i4.0 IL_0031: conv.i8 IL_0032: nop - IL_0033: br.s IL_005d + IL_0033: br.s IL_0057 IL_0035: ldloc.2 - IL_0036: conv.i8 - IL_0037: ldloc.0 - IL_0038: conv.i8 - IL_0039: sub - IL_003a: ldloc.1 - IL_003b: conv.i8 - IL_003c: div.un - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add.ovf.un - IL_0040: nop - IL_0041: br.s IL_005d - - IL_0043: ldloc.0 - IL_0044: ldloc.2 - IL_0045: bge.s IL_004c + 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_0047: ldc.i4.0 - IL_0048: conv.i8 - IL_0049: nop - IL_004a: br.s IL_005d - - IL_004c: ldloc.0 - IL_004d: conv.i8 - IL_004e: ldloc.2 - IL_004f: conv.i8 - IL_0050: sub - IL_0051: ldloc.1 - IL_0052: not - IL_0053: conv.i8 - IL_0054: ldc.i4.1 - IL_0055: conv.i8 - IL_0056: add - IL_0057: conv.i8 - IL_0058: div.un - IL_0059: ldc.i4.1 - IL_005a: conv.i8 - IL_005b: add.ovf.un - IL_005c: nop - IL_005d: stloc.3 - IL_005e: ldloc.3 - IL_005f: stloc.s V_4 - IL_0061: ldloc.s V_4 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: bge.un.s IL_006d - - IL_0067: call !!0[] [runtime]System.Array::Empty() - IL_006c: ret - - IL_006d: ldloc.s V_4 - IL_006f: conv.ovf.i.un - IL_0070: newarr [runtime]System.Int32 - IL_0075: stloc.s V_5 - IL_0077: ldc.i4.0 - IL_0078: conv.i8 - IL_0079: stloc.s V_6 - IL_007b: ldloc.0 - IL_007c: stloc.s V_7 - IL_007e: br.s IL_0095 - - IL_0080: ldloc.s V_5 - IL_0082: ldloc.s V_6 - IL_0084: conv.i - IL_0085: ldloc.s V_7 - IL_0087: stelem.i4 - IL_0088: ldloc.s V_7 - IL_008a: ldloc.1 - IL_008b: add - IL_008c: stloc.s V_7 - IL_008e: ldloc.s V_6 - IL_0090: ldc.i4.1 - IL_0091: conv.i8 - IL_0092: add - IL_0093: stloc.s V_6 - IL_0095: ldloc.s V_6 - IL_0097: ldloc.3 - IL_0098: blt.un.s IL_0080 - - IL_009a: ldloc.s V_5 - IL_009c: 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_008f + + IL_007a: ldloc.s V_5 + IL_007c: ldloc.s V_6 + IL_007e: conv.i + IL_007f: ldloc.s V_7 + IL_0081: stelem.i4 + IL_0082: ldloc.s V_7 + IL_0084: ldloc.1 + IL_0085: add + IL_0086: stloc.s V_7 + IL_0088: ldloc.s V_6 + IL_008a: ldc.i4.1 + IL_008b: conv.i8 + IL_008c: add + IL_008d: stloc.s V_6 + IL_008f: ldloc.s V_6 + IL_0091: ldloc.3 + IL_0092: blt.un.s IL_007a + + IL_0094: ldloc.s V_5 + IL_0096: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl index 93cd75890ff..104102225b1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl @@ -268,45 +268,44 @@ IL_0006: ldc.i4.0 IL_0007: conv.i8 IL_0008: nop - IL_0009: br.s IL_0015 + IL_0009: br.s IL_0014 IL_000b: ldc.i4.s 10 - IL_000d: conv.i8 - IL_000e: ldarg.0 + IL_000d: ldarg.0 + IL_000e: sub IL_000f: conv.i8 - IL_0010: sub - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: stloc.2 - IL_0019: ldarg.0 - IL_001a: stloc.3 - IL_001b: br.s IL_002f - - IL_001d: ldloca.s V_1 - IL_001f: ldloc.3 - IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0025: nop - IL_0026: ldloc.3 - IL_0027: ldc.i4.1 - IL_0028: add - IL_0029: stloc.3 - IL_002a: ldloc.2 - IL_002b: ldc.i4.1 - IL_002c: conv.i8 - IL_002d: add - IL_002e: stloc.2 - IL_002f: ldloc.2 - IL_0030: ldloc.0 - IL_0031: blt.un.s IL_001d - - IL_0033: ldloca.s V_1 - IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_003a: ret + 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_002e + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.3 + IL_0029: ldloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.2 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001c + + IL_0032: ldloca.s V_1 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f10(int32 finish) cil managed @@ -325,45 +324,44 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: ldc.i4.1 + IL_000b: ldc.i4.1 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldc.i4.0 - IL_0015: conv.i8 - IL_0016: stloc.2 - IL_0017: ldc.i4.1 - IL_0018: stloc.3 - IL_0019: br.s IL_002d - - IL_001b: ldloca.s V_1 - IL_001d: ldloc.3 - IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.3 - IL_0025: ldc.i4.1 - IL_0026: add - IL_0027: stloc.3 - IL_0028: ldloc.2 - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.2 - IL_002e: ldloc.0 - IL_002f: blt.un.s IL_001b - - IL_0031: ldloca.s V_1 - IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0038: ret + 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_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + 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 public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -385,45 +383,44 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.1 - IL_000b: conv.i8 - IL_000c: ldarg.0 + IL_000b: ldarg.0 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldc.i4.0 - IL_0015: conv.i8 - IL_0016: stloc.2 - IL_0017: ldarg.0 - IL_0018: stloc.3 - IL_0019: br.s IL_002d - - IL_001b: ldloca.s V_1 - IL_001d: ldloc.3 - IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.3 - IL_0025: ldc.i4.1 - IL_0026: add - IL_0027: stloc.3 - IL_0028: ldloc.2 - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.2 - IL_002e: ldloc.0 - IL_002f: blt.un.s IL_001b - - IL_0031: ldloca.s V_1 - IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0038: ret + 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_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + 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 public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f12(int32 start) cil managed @@ -442,45 +439,44 @@ IL_0006: ldc.i4.0 IL_0007: conv.i8 IL_0008: nop - IL_0009: br.s IL_0015 + IL_0009: br.s IL_0014 IL_000b: ldc.i4.s 10 - IL_000d: conv.i8 - IL_000e: ldarg.0 + IL_000d: ldarg.0 + IL_000e: sub IL_000f: conv.i8 - IL_0010: sub - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: stloc.2 - IL_0019: ldarg.0 - IL_001a: stloc.3 - IL_001b: br.s IL_002f - - IL_001d: ldloca.s V_1 - IL_001f: ldloc.3 - IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0025: nop - IL_0026: ldloc.3 - IL_0027: ldc.i4.1 - IL_0028: add - IL_0029: stloc.3 - IL_002a: ldloc.2 - IL_002b: ldc.i4.1 - IL_002c: conv.i8 - IL_002d: add - IL_002e: stloc.2 - IL_002f: ldloc.2 - IL_0030: ldloc.0 - IL_0031: blt.un.s IL_001d - - IL_0033: ldloca.s V_1 - IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_003a: ret + 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_002e + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.3 + IL_0029: ldloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.2 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001c + + IL_0032: ldloca.s V_1 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f13(int32 step) cil managed @@ -508,7 +504,7 @@ IL_0011: nop IL_0012: ldc.i4.0 IL_0013: ldarg.0 - IL_0014: bge.s IL_002f + IL_0014: bge.s IL_002d IL_0016: ldc.i4.s 10 IL_0018: ldc.i4.1 @@ -517,76 +513,70 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_004b + IL_001e: br.s IL_0045 IL_0020: ldc.i4.s 10 - IL_0022: conv.i8 - IL_0023: ldc.i4.1 - IL_0024: conv.i8 - IL_0025: sub - IL_0026: ldarg.0 - IL_0027: conv.i8 - IL_0028: div.un - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add.ovf.un - IL_002c: nop - IL_002d: br.s IL_004b - - IL_002f: ldc.i4.1 - IL_0030: ldc.i4.s 10 - IL_0032: bge.s IL_0039 - - IL_0034: ldc.i4.0 - IL_0035: conv.i8 - IL_0036: nop - IL_0037: br.s IL_004b - - IL_0039: ldc.i4.1 - IL_003a: conv.i8 - IL_003b: ldc.i4.s 10 - IL_003d: conv.i8 - IL_003e: sub - IL_003f: ldarg.0 - IL_0040: not - IL_0041: conv.i8 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: conv.i8 - IL_0046: div.un - IL_0047: ldc.i4.1 - IL_0048: conv.i8 - IL_0049: add.ovf.un - IL_004a: nop - IL_004b: stloc.0 - IL_004c: ldc.i4.0 - IL_004d: conv.i8 - IL_004e: stloc.2 - IL_004f: ldc.i4.1 - IL_0050: stloc.3 - IL_0051: br.s IL_0065 - - IL_0053: ldloca.s V_1 - IL_0055: ldloc.3 - IL_0056: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_005b: nop - IL_005c: ldloc.3 - IL_005d: ldarg.0 - IL_005e: add - IL_005f: stloc.3 - IL_0060: ldloc.2 - IL_0061: ldc.i4.1 - IL_0062: conv.i8 - IL_0063: add - IL_0064: stloc.2 - IL_0065: ldloc.2 - IL_0066: ldloc.0 - IL_0067: blt.un.s IL_0053 - - IL_0069: ldloca.s V_1 - IL_006b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0070: ret + 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_005f + + IL_004d: ldloca.s V_1 + IL_004f: ldloc.3 + IL_0050: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0055: nop + IL_0056: ldloc.3 + IL_0057: ldarg.0 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.2 + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: stloc.2 + IL_005f: ldloc.2 + IL_0060: ldloc.0 + IL_0061: blt.un.s IL_004d + + IL_0063: ldloca.s V_1 + IL_0065: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006a: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f14(int32 finish) cil managed @@ -605,45 +595,44 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: ldc.i4.1 + IL_000b: ldc.i4.1 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldc.i4.0 - IL_0015: conv.i8 - IL_0016: stloc.2 - IL_0017: ldc.i4.1 - IL_0018: stloc.3 - IL_0019: br.s IL_002d - - IL_001b: ldloca.s V_1 - IL_001d: ldloc.3 - IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.3 - IL_0025: ldc.i4.1 - IL_0026: add - IL_0027: stloc.3 - IL_0028: ldloc.2 - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.2 - IL_002e: ldloc.0 - IL_002f: blt.un.s IL_001b - - IL_0031: ldloca.s V_1 - IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0038: ret + 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_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + 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 public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -674,7 +663,7 @@ IL_0011: nop IL_0012: ldc.i4.0 IL_0013: ldarg.1 - IL_0014: bge.s IL_002f + IL_0014: bge.s IL_002d IL_0016: ldc.i4.s 10 IL_0018: ldarg.0 @@ -683,76 +672,70 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_004b + IL_001e: br.s IL_0045 IL_0020: ldc.i4.s 10 - IL_0022: conv.i8 - IL_0023: ldarg.0 - IL_0024: conv.i8 - IL_0025: sub - IL_0026: ldarg.1 - IL_0027: conv.i8 - IL_0028: div.un - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add.ovf.un - IL_002c: nop - IL_002d: br.s IL_004b - - IL_002f: ldarg.0 - IL_0030: ldc.i4.s 10 - IL_0032: bge.s IL_0039 - - IL_0034: ldc.i4.0 - IL_0035: conv.i8 - IL_0036: nop - IL_0037: br.s IL_004b - - IL_0039: ldarg.0 - IL_003a: conv.i8 - IL_003b: ldc.i4.s 10 - IL_003d: conv.i8 - IL_003e: sub - IL_003f: ldarg.1 - IL_0040: not - IL_0041: conv.i8 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: conv.i8 - IL_0046: div.un - IL_0047: ldc.i4.1 - IL_0048: conv.i8 - IL_0049: add.ovf.un - IL_004a: nop - IL_004b: stloc.0 - IL_004c: ldc.i4.0 - IL_004d: conv.i8 - IL_004e: stloc.2 - IL_004f: ldarg.0 - IL_0050: stloc.3 - IL_0051: br.s IL_0065 - - IL_0053: ldloca.s V_1 - IL_0055: ldloc.3 - IL_0056: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_005b: nop - IL_005c: ldloc.3 - IL_005d: ldarg.1 - IL_005e: add - IL_005f: stloc.3 - IL_0060: ldloc.2 - IL_0061: ldc.i4.1 - IL_0062: conv.i8 - IL_0063: add - IL_0064: stloc.2 - IL_0065: ldloc.2 - IL_0066: ldloc.0 - IL_0067: blt.un.s IL_0053 - - IL_0069: ldloca.s V_1 - IL_006b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0070: ret + 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_005f + + IL_004d: ldloca.s V_1 + IL_004f: ldloc.3 + IL_0050: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0055: nop + IL_0056: ldloc.3 + IL_0057: ldarg.1 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.2 + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: stloc.2 + IL_005f: ldloc.2 + IL_0060: ldloc.0 + IL_0061: blt.un.s IL_004d + + IL_0063: ldloca.s V_1 + IL_0065: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006a: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -774,45 +757,44 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0013 + IL_0008: br.s IL_0012 IL_000a: ldarg.1 - IL_000b: conv.i8 - IL_000c: ldarg.0 + IL_000b: ldarg.0 + IL_000c: sub IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: conv.i8 - IL_0011: add.ovf.un - IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldc.i4.0 - IL_0015: conv.i8 - IL_0016: stloc.2 - IL_0017: ldarg.0 - IL_0018: stloc.3 - IL_0019: br.s IL_002d - - IL_001b: ldloca.s V_1 - IL_001d: ldloc.3 - IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.3 - IL_0025: ldc.i4.1 - IL_0026: add - IL_0027: stloc.3 - IL_0028: ldloc.2 - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.2 - IL_002e: ldloc.0 - IL_002f: blt.un.s IL_001b - - IL_0031: ldloca.s V_1 - IL_0033: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0038: ret + 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_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + 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 public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -843,7 +825,7 @@ IL_0010: nop IL_0011: ldc.i4.0 IL_0012: ldarg.0 - IL_0013: bge.s IL_002c + IL_0013: bge.s IL_002a IL_0015: ldarg.1 IL_0016: ldc.i4.1 @@ -852,76 +834,70 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_0046 + IL_001c: br.s IL_0040 IL_001e: ldarg.1 - IL_001f: conv.i8 - IL_0020: ldc.i4.1 - IL_0021: conv.i8 - IL_0022: sub - IL_0023: ldarg.0 - IL_0024: conv.i8 - IL_0025: div.un - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: add.ovf.un - IL_0029: nop - IL_002a: br.s IL_0046 - - IL_002c: ldc.i4.1 - IL_002d: ldarg.1 - IL_002e: bge.s IL_0035 - - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: nop - IL_0033: br.s IL_0046 - - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: ldarg.1 - IL_0038: conv.i8 - IL_0039: sub - IL_003a: ldarg.0 - IL_003b: not - IL_003c: conv.i8 - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add - IL_0040: conv.i8 - IL_0041: div.un - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add.ovf.un - IL_0045: nop - IL_0046: stloc.0 - IL_0047: ldc.i4.0 - IL_0048: conv.i8 - IL_0049: stloc.2 - IL_004a: ldc.i4.1 - IL_004b: stloc.3 - IL_004c: br.s IL_0060 - - IL_004e: ldloca.s V_1 - IL_0050: ldloc.3 - IL_0051: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0056: nop - IL_0057: ldloc.3 - IL_0058: ldarg.0 - IL_0059: add - IL_005a: stloc.3 - IL_005b: ldloc.2 - IL_005c: ldc.i4.1 - IL_005d: conv.i8 - IL_005e: add - IL_005f: stloc.2 - IL_0060: ldloc.2 - IL_0061: ldloc.0 - IL_0062: blt.un.s IL_004e + 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_0064: ldloca.s V_1 - IL_0066: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_006b: ret + 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_005a + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0050: nop + IL_0051: ldloc.3 + IL_0052: ldarg.0 + IL_0053: add + IL_0054: stloc.3 + IL_0055: ldloc.2 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.2 + IL_005b: ldloc.0 + IL_005c: blt.un.s IL_0048 + + IL_005e: ldloca.s V_1 + IL_0060: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0065: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -954,7 +930,7 @@ IL_0010: nop IL_0011: ldc.i4.0 IL_0012: ldarg.1 - IL_0013: bge.s IL_002c + IL_0013: bge.s IL_002a IL_0015: ldarg.2 IL_0016: ldarg.0 @@ -963,76 +939,70 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_0046 + IL_001c: br.s IL_0040 IL_001e: ldarg.2 - IL_001f: conv.i8 - IL_0020: ldarg.0 - IL_0021: conv.i8 - IL_0022: sub - IL_0023: ldarg.1 - IL_0024: conv.i8 - IL_0025: div.un - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: add.ovf.un - IL_0029: nop - IL_002a: br.s IL_0046 - - IL_002c: ldarg.0 - IL_002d: ldarg.2 - IL_002e: bge.s IL_0035 - - IL_0030: ldc.i4.0 - IL_0031: conv.i8 - IL_0032: nop - IL_0033: br.s IL_0046 - - IL_0035: ldarg.0 - IL_0036: conv.i8 - IL_0037: ldarg.2 - IL_0038: conv.i8 - IL_0039: sub - IL_003a: ldarg.1 - IL_003b: not - IL_003c: conv.i8 - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add - IL_0040: conv.i8 - IL_0041: div.un - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add.ovf.un - IL_0045: nop - IL_0046: stloc.0 - IL_0047: ldc.i4.0 - IL_0048: conv.i8 - IL_0049: stloc.2 - IL_004a: ldarg.0 - IL_004b: stloc.3 - IL_004c: br.s IL_0060 - - IL_004e: ldloca.s V_1 - IL_0050: ldloc.3 - IL_0051: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0056: nop - IL_0057: ldloc.3 - IL_0058: ldarg.1 - IL_0059: add - IL_005a: stloc.3 - IL_005b: ldloc.2 - IL_005c: ldc.i4.1 - IL_005d: conv.i8 - IL_005e: add - IL_005f: stloc.2 - IL_0060: ldloc.2 - IL_0061: ldloc.0 - IL_0062: blt.un.s IL_004e - - IL_0064: ldloca.s V_1 - IL_0066: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_006b: ret + 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_005a + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0050: nop + IL_0051: ldloc.3 + IL_0052: ldarg.1 + IL_0053: add + IL_0054: stloc.3 + IL_0055: ldloc.2 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.2 + IL_005b: ldloc.0 + IL_005c: blt.un.s IL_0048 + + IL_005e: ldloca.s V_1 + IL_0060: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0065: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1055,45 +1025,44 @@ IL_000d: ldc.i4.0 IL_000e: conv.i8 IL_000f: nop - IL_0010: br.s IL_001c + IL_0010: br.s IL_001b IL_0012: ldc.i4.s 10 - IL_0014: conv.i8 - IL_0015: ldloc.0 + IL_0014: ldloc.0 + IL_0015: sub IL_0016: conv.i8 - IL_0017: sub - IL_0018: ldc.i4.1 - IL_0019: conv.i8 - IL_001a: add.ovf.un - IL_001b: nop - IL_001c: stloc.1 - IL_001d: ldc.i4.0 - IL_001e: conv.i8 - IL_001f: stloc.3 - IL_0020: ldloc.0 - IL_0021: stloc.s V_4 - IL_0023: br.s IL_003a - - IL_0025: ldloca.s V_2 - IL_0027: ldloc.s V_4 - IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002e: nop - IL_002f: ldloc.s V_4 - IL_0031: ldc.i4.1 - IL_0032: add - IL_0033: stloc.s V_4 - IL_0035: ldloc.3 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldloc.1 - IL_003c: blt.un.s IL_0025 - - IL_003e: ldloca.s V_2 - IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0045: ret + 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_0039 + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.s V_4 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.3 + IL_003a: ldloc.1 + IL_003b: blt.un.s IL_0024 + + IL_003d: ldloca.s V_2 + IL_003f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0044: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1116,45 +1085,44 @@ IL_000c: ldc.i4.0 IL_000d: conv.i8 IL_000e: nop - IL_000f: br.s IL_001a + IL_000f: br.s IL_0019 IL_0011: ldloc.0 - IL_0012: conv.i8 - IL_0013: ldc.i4.1 + IL_0012: ldc.i4.1 + IL_0013: sub IL_0014: conv.i8 - IL_0015: sub - IL_0016: ldc.i4.1 - IL_0017: conv.i8 - IL_0018: add.ovf.un - IL_0019: nop - IL_001a: stloc.1 - IL_001b: ldc.i4.0 - IL_001c: conv.i8 - IL_001d: stloc.3 - IL_001e: ldc.i4.1 - IL_001f: stloc.s V_4 - IL_0021: br.s IL_0038 - - IL_0023: ldloca.s V_2 - IL_0025: ldloc.s V_4 - IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002c: nop - IL_002d: ldloc.s V_4 - IL_002f: ldc.i4.1 - IL_0030: add - IL_0031: stloc.s V_4 - IL_0033: ldloc.3 - IL_0034: ldc.i4.1 - IL_0035: conv.i8 - IL_0036: add - IL_0037: stloc.3 - IL_0038: ldloc.3 - IL_0039: ldloc.1 - IL_003a: blt.un.s IL_0023 - - IL_003c: ldloca.s V_2 - IL_003e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0043: ret + 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_0037 + + IL_0022: ldloca.s V_2 + IL_0024: ldloc.s V_4 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloc.s V_4 + IL_002e: ldc.i4.1 + IL_002f: add + IL_0030: stloc.s V_4 + IL_0032: ldloc.3 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.3 + IL_0038: ldloc.1 + IL_0039: blt.un.s IL_0022 + + IL_003b: ldloca.s V_2 + IL_003d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0042: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -1185,45 +1153,44 @@ IL_0014: ldc.i4.0 IL_0015: conv.i8 IL_0016: nop - IL_0017: br.s IL_0022 + IL_0017: br.s IL_0021 IL_0019: ldloc.1 - IL_001a: conv.i8 - IL_001b: ldloc.0 + IL_001a: ldloc.0 + IL_001b: sub IL_001c: conv.i8 - IL_001d: sub - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: add.ovf.un - IL_0021: nop - IL_0022: stloc.2 - IL_0023: ldc.i4.0 - IL_0024: conv.i8 - IL_0025: stloc.s V_4 - IL_0027: ldloc.0 - IL_0028: stloc.s V_5 - IL_002a: br.s IL_0043 - - IL_002c: ldloca.s V_3 - IL_002e: ldloc.s V_5 - IL_0030: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0035: nop - IL_0036: ldloc.s V_5 - IL_0038: ldc.i4.1 - IL_0039: add - IL_003a: stloc.s V_5 - IL_003c: ldloc.s V_4 - IL_003e: ldc.i4.1 - IL_003f: conv.i8 - IL_0040: add - IL_0041: stloc.s V_4 - IL_0043: ldloc.s V_4 - IL_0045: ldloc.2 - IL_0046: blt.un.s IL_002c - - IL_0048: ldloca.s V_3 - IL_004a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004f: ret + 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_0042 + + IL_002b: ldloca.s V_3 + IL_002d: ldloc.s V_5 + IL_002f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0034: nop + IL_0035: ldloc.s V_5 + IL_0037: ldc.i4.1 + IL_0038: add + IL_0039: stloc.s V_5 + IL_003b: ldloc.s V_4 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.s V_4 + IL_0042: ldloc.s V_4 + IL_0044: ldloc.2 + IL_0045: blt.un.s IL_002b + + IL_0047: ldloca.s V_3 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1246,45 +1213,44 @@ IL_000d: ldc.i4.0 IL_000e: conv.i8 IL_000f: nop - IL_0010: br.s IL_001c + IL_0010: br.s IL_001b IL_0012: ldc.i4.s 10 - IL_0014: conv.i8 - IL_0015: ldloc.0 + IL_0014: ldloc.0 + IL_0015: sub IL_0016: conv.i8 - IL_0017: sub - IL_0018: ldc.i4.1 - IL_0019: conv.i8 - IL_001a: add.ovf.un - IL_001b: nop - IL_001c: stloc.1 - IL_001d: ldc.i4.0 - IL_001e: conv.i8 - IL_001f: stloc.3 - IL_0020: ldloc.0 - IL_0021: stloc.s V_4 - IL_0023: br.s IL_003a - - IL_0025: ldloca.s V_2 - IL_0027: ldloc.s V_4 - IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002e: nop - IL_002f: ldloc.s V_4 - IL_0031: ldc.i4.1 - IL_0032: add - IL_0033: stloc.s V_4 - IL_0035: ldloc.3 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldloc.1 - IL_003c: blt.un.s IL_0025 - - IL_003e: ldloca.s V_2 - IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0045: ret + 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_0039 + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.s V_4 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.3 + IL_003a: ldloc.1 + IL_003b: blt.un.s IL_0024 + + IL_003d: ldloca.s V_2 + IL_003f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0044: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f23(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1316,7 +1282,7 @@ IL_0018: nop IL_0019: ldc.i4.0 IL_001a: ldloc.0 - IL_001b: bge.s IL_0036 + IL_001b: bge.s IL_0034 IL_001d: ldc.i4.s 10 IL_001f: ldc.i4.1 @@ -1325,76 +1291,70 @@ IL_0022: ldc.i4.0 IL_0023: conv.i8 IL_0024: nop - IL_0025: br.s IL_0052 + IL_0025: br.s IL_004c IL_0027: ldc.i4.s 10 - IL_0029: conv.i8 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: sub - IL_002d: ldloc.0 - IL_002e: conv.i8 - IL_002f: div.un - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add.ovf.un - IL_0033: nop - IL_0034: br.s IL_0052 + 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_0036: ldc.i4.1 - IL_0037: ldc.i4.s 10 - IL_0039: bge.s IL_0040 + IL_0034: ldc.i4.1 + IL_0035: ldc.i4.s 10 + IL_0037: bge.s IL_003e - IL_003b: ldc.i4.0 - IL_003c: conv.i8 - IL_003d: nop - IL_003e: br.s IL_0052 - - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: ldc.i4.s 10 - IL_0044: conv.i8 - IL_0045: sub - IL_0046: ldloc.0 - IL_0047: not - IL_0048: conv.i8 - IL_0049: ldc.i4.1 - IL_004a: conv.i8 - IL_004b: add - IL_004c: conv.i8 - IL_004d: div.un - IL_004e: ldc.i4.1 - IL_004f: conv.i8 - IL_0050: add.ovf.un - IL_0051: nop - IL_0052: stloc.1 - IL_0053: ldc.i4.0 - IL_0054: conv.i8 - IL_0055: stloc.3 - IL_0056: ldc.i4.1 - IL_0057: stloc.s V_4 - IL_0059: br.s IL_0070 - - IL_005b: ldloca.s V_2 - IL_005d: ldloc.s V_4 - IL_005f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0064: nop - IL_0065: ldloc.s V_4 - IL_0067: ldloc.0 + 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_006a + + IL_0055: ldloca.s V_2 + IL_0057: ldloc.s V_4 + IL_0059: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_005e: nop + IL_005f: ldloc.s V_4 + IL_0061: ldloc.0 + IL_0062: add + IL_0063: stloc.s V_4 + IL_0065: ldloc.3 + IL_0066: ldc.i4.1 + IL_0067: conv.i8 IL_0068: add - IL_0069: stloc.s V_4 - IL_006b: ldloc.3 - IL_006c: ldc.i4.1 - IL_006d: conv.i8 - IL_006e: add - IL_006f: stloc.3 - IL_0070: ldloc.3 - IL_0071: ldloc.1 - IL_0072: blt.un.s IL_005b - - IL_0074: ldloca.s V_2 - IL_0076: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_007b: ret + IL_0069: stloc.3 + IL_006a: ldloc.3 + IL_006b: ldloc.1 + IL_006c: blt.un.s IL_0055 + + IL_006e: ldloca.s V_2 + IL_0070: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0075: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f24(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1417,45 +1377,44 @@ IL_000c: ldc.i4.0 IL_000d: conv.i8 IL_000e: nop - IL_000f: br.s IL_001a + IL_000f: br.s IL_0019 IL_0011: ldloc.0 - IL_0012: conv.i8 - IL_0013: ldc.i4.1 + IL_0012: ldc.i4.1 + IL_0013: sub IL_0014: conv.i8 - IL_0015: sub - IL_0016: ldc.i4.1 - IL_0017: conv.i8 - IL_0018: add.ovf.un - IL_0019: nop - IL_001a: stloc.1 - IL_001b: ldc.i4.0 - IL_001c: conv.i8 - IL_001d: stloc.3 - IL_001e: ldc.i4.1 - IL_001f: stloc.s V_4 - IL_0021: br.s IL_0038 - - IL_0023: ldloca.s V_2 - IL_0025: ldloc.s V_4 - IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002c: nop - IL_002d: ldloc.s V_4 - IL_002f: ldc.i4.1 - IL_0030: add - IL_0031: stloc.s V_4 - IL_0033: ldloc.3 - IL_0034: ldc.i4.1 - IL_0035: conv.i8 - IL_0036: add - IL_0037: stloc.3 - IL_0038: ldloc.3 - IL_0039: ldloc.1 - IL_003a: blt.un.s IL_0023 - - IL_003c: ldloca.s V_2 - IL_003e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0043: ret + 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_0037 + + IL_0022: ldloca.s V_2 + IL_0024: ldloc.s V_4 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloc.s V_4 + IL_002e: ldc.i4.1 + IL_002f: add + IL_0030: stloc.s V_4 + IL_0032: ldloc.3 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.3 + IL_0038: ldloc.1 + IL_0039: blt.un.s IL_0022 + + IL_003b: ldloca.s V_2 + IL_003d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0042: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -1502,7 +1461,7 @@ IL_0027: nop IL_0028: ldc.i4.0 IL_0029: ldloc.1 - IL_002a: bge.s IL_0043 + IL_002a: bge.s IL_0041 IL_002c: ldloc.2 IL_002d: ldloc.0 @@ -1511,76 +1470,70 @@ IL_0030: ldc.i4.0 IL_0031: conv.i8 IL_0032: nop - IL_0033: br.s IL_005d + IL_0033: br.s IL_0057 IL_0035: ldloc.2 - IL_0036: conv.i8 - IL_0037: ldloc.0 - IL_0038: conv.i8 - IL_0039: sub - IL_003a: ldloc.1 - IL_003b: conv.i8 - IL_003c: div.un - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add.ovf.un - IL_0040: nop - IL_0041: br.s IL_005d - - IL_0043: ldloc.0 - IL_0044: ldloc.2 - IL_0045: bge.s IL_004c - - IL_0047: ldc.i4.0 - IL_0048: conv.i8 - IL_0049: nop - IL_004a: br.s IL_005d - - IL_004c: ldloc.0 - IL_004d: conv.i8 - IL_004e: ldloc.2 - IL_004f: conv.i8 - IL_0050: sub - IL_0051: ldloc.1 - IL_0052: not - IL_0053: conv.i8 - IL_0054: ldc.i4.1 - IL_0055: conv.i8 - IL_0056: add - IL_0057: conv.i8 - IL_0058: div.un - IL_0059: ldc.i4.1 - IL_005a: conv.i8 - IL_005b: add.ovf.un - IL_005c: nop - IL_005d: stloc.3 - IL_005e: ldc.i4.0 - IL_005f: conv.i8 - IL_0060: stloc.s V_5 - IL_0062: ldloc.0 - IL_0063: stloc.s V_6 - IL_0065: br.s IL_007e - - IL_0067: ldloca.s V_4 - IL_0069: ldloc.s V_6 - IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0070: nop - IL_0071: ldloc.s V_6 - IL_0073: ldloc.1 - IL_0074: add - IL_0075: stloc.s V_6 - IL_0077: ldloc.s V_5 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.s V_5 - IL_007e: ldloc.s V_5 - IL_0080: ldloc.3 - IL_0081: blt.un.s IL_0067 - - IL_0083: ldloca.s V_4 - IL_0085: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_008a: ret + 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_0078 + + IL_0061: ldloca.s V_4 + IL_0063: ldloc.s V_6 + IL_0065: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006a: nop + IL_006b: ldloc.s V_6 + IL_006d: ldloc.1 + IL_006e: add + IL_006f: stloc.s V_6 + IL_0071: ldloc.s V_5 + IL_0073: ldc.i4.1 + IL_0074: conv.i8 + IL_0075: add + IL_0076: stloc.s V_5 + IL_0078: ldloc.s V_5 + IL_007a: ldloc.3 + IL_007b: blt.un.s IL_0061 + + IL_007d: ldloca.s V_4 + IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0084: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl index fb3e440b1aa..d4f5597088c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl @@ -604,7 +604,7 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_002d + IL_001e: br.s IL_002c IL_0020: ldc.i4.s 10 IL_0022: conv.i8 @@ -612,55 +612,54 @@ IL_0024: conv.i8 IL_0025: sub IL_0026: ldarg.0 - IL_0027: conv.i8 - IL_0028: div.un - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add.ovf.un - IL_002c: nop - IL_002d: stloc.0 - IL_002e: ldloc.0 - IL_002f: stloc.1 - IL_0030: ldloc.1 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: bge.un.s IL_003b - - IL_0035: call !!0[] [runtime]System.Array::Empty() - IL_003a: ret - - IL_003b: ldloc.1 - IL_003c: conv.ovf.i.un - IL_003d: newarr [runtime]System.UInt64 - IL_0042: stloc.2 - IL_0043: ldc.i4.0 - IL_0044: conv.i8 - IL_0045: stloc.3 - IL_0046: ldc.i4.1 - IL_0047: conv.i8 - IL_0048: stloc.s V_4 - IL_004a: br.s IL_005d - - IL_004c: ldloc.2 - IL_004d: ldloc.3 - IL_004e: conv.i - IL_004f: ldloc.s V_4 - IL_0051: stelem.i8 - IL_0052: ldloc.s V_4 - IL_0054: ldarg.0 - IL_0055: add - IL_0056: stloc.s V_4 - IL_0058: ldloc.3 - IL_0059: ldc.i4.1 - IL_005a: conv.i8 - IL_005b: add - IL_005c: stloc.3 - IL_005d: ldloc.3 - IL_005e: ldloc.0 - IL_005f: blt.un.s IL_004c + IL_0027: div.un + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add.ovf.un + IL_002b: nop + IL_002c: stloc.0 + IL_002d: ldloc.0 + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: bge.un.s IL_003a + + IL_0034: call !!0[] [runtime]System.Array::Empty() + IL_0039: ret + + IL_003a: ldloc.1 + IL_003b: conv.ovf.i.un + IL_003c: newarr [runtime]System.UInt64 + IL_0041: stloc.2 + IL_0042: ldc.i4.0 + IL_0043: conv.i8 + IL_0044: stloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: stloc.s V_4 + IL_0049: br.s IL_005c - IL_0061: ldloc.2 - IL_0062: ret + IL_004b: ldloc.2 + IL_004c: ldloc.3 + IL_004d: conv.i + IL_004e: ldloc.s V_4 + IL_0050: stelem.i8 + IL_0051: ldloc.s V_4 + IL_0053: ldarg.0 + IL_0054: add + IL_0055: stloc.s V_4 + IL_0057: ldloc.3 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.3 + IL_005c: ldloc.3 + IL_005d: ldloc.0 + IL_005e: blt.un.s IL_004b + + IL_0060: ldloc.2 + IL_0061: ret } .method public static uint64[] f11(uint64 finish) cil managed @@ -772,61 +771,60 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_002a + IL_001c: br.s IL_0029 IL_001e: ldc.i4.s 10 IL_0020: conv.i8 IL_0021: ldarg.0 IL_0022: sub IL_0023: ldarg.1 - IL_0024: conv.i8 - IL_0025: div.un - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: add.ovf.un - IL_0029: nop - IL_002a: stloc.0 - IL_002b: ldloc.0 - IL_002c: stloc.1 - IL_002d: ldloc.1 - IL_002e: ldc.i4.1 - IL_002f: conv.i8 - IL_0030: bge.un.s IL_0038 - - IL_0032: call !!0[] [runtime]System.Array::Empty() - IL_0037: ret - - IL_0038: ldloc.1 - IL_0039: conv.ovf.i.un - IL_003a: newarr [runtime]System.UInt64 - IL_003f: stloc.2 - IL_0040: ldc.i4.0 - IL_0041: conv.i8 - IL_0042: stloc.3 - IL_0043: ldarg.0 - IL_0044: stloc.s V_4 - IL_0046: br.s IL_0059 + IL_0024: div.un + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldloc.0 + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldc.i4.1 + IL_002e: conv.i8 + IL_002f: bge.un.s IL_0037 + + IL_0031: call !!0[] [runtime]System.Array::Empty() + IL_0036: ret + + IL_0037: ldloc.1 + IL_0038: conv.ovf.i.un + IL_0039: newarr [runtime]System.UInt64 + IL_003e: stloc.2 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 + IL_0041: stloc.3 + IL_0042: ldarg.0 + IL_0043: stloc.s V_4 + IL_0045: br.s IL_0058 + + IL_0047: ldloc.2 + IL_0048: ldloc.3 + IL_0049: conv.i + IL_004a: ldloc.s V_4 + IL_004c: stelem.i8 + IL_004d: ldloc.s V_4 + IL_004f: ldarg.1 + IL_0050: add + IL_0051: stloc.s V_4 + IL_0053: ldloc.3 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add + IL_0057: stloc.3 + IL_0058: ldloc.3 + IL_0059: ldloc.0 + IL_005a: blt.un.s IL_0047 - IL_0048: ldloc.2 - IL_0049: ldloc.3 - IL_004a: conv.i - IL_004b: ldloc.s V_4 - IL_004d: stelem.i8 - IL_004e: ldloc.s V_4 - IL_0050: ldarg.1 - IL_0051: add - IL_0052: stloc.s V_4 - IL_0054: ldloc.3 - IL_0055: ldc.i4.1 - IL_0056: conv.i8 - IL_0057: add - IL_0058: stloc.3 - IL_0059: ldloc.3 - IL_005a: ldloc.0 - IL_005b: blt.un.s IL_0048 - - IL_005d: ldloc.2 - IL_005e: ret + IL_005c: ldloc.2 + IL_005d: ret } .method public static uint64[] f13(uint64 start, @@ -1022,62 +1020,61 @@ IL_0017: ldc.i4.0 IL_0018: conv.i8 IL_0019: nop - IL_001a: br.s IL_0027 + IL_001a: br.s IL_0026 IL_001c: ldarg.1 IL_001d: ldc.i4.1 IL_001e: conv.i8 IL_001f: sub IL_0020: ldarg.0 - IL_0021: conv.i8 - IL_0022: div.un - IL_0023: ldc.i4.1 - IL_0024: conv.i8 - IL_0025: add.ovf.un - IL_0026: nop - IL_0027: stloc.0 - IL_0028: ldloc.0 - IL_0029: stloc.1 - IL_002a: ldloc.1 - IL_002b: ldc.i4.1 - IL_002c: conv.i8 - IL_002d: bge.un.s IL_0035 - - IL_002f: call !!0[] [runtime]System.Array::Empty() - IL_0034: ret - - IL_0035: ldloc.1 - IL_0036: conv.ovf.i.un - IL_0037: newarr [runtime]System.UInt64 - IL_003c: stloc.2 - IL_003d: ldc.i4.0 - IL_003e: conv.i8 - IL_003f: stloc.3 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: stloc.s V_4 - IL_0044: br.s IL_0057 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add.ovf.un + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldloc.0 + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: bge.un.s IL_0034 - IL_0046: ldloc.2 - IL_0047: ldloc.3 - IL_0048: conv.i - IL_0049: ldloc.s V_4 - IL_004b: stelem.i8 - IL_004c: ldloc.s V_4 - IL_004e: ldarg.0 - IL_004f: add - IL_0050: stloc.s V_4 - IL_0052: ldloc.3 - IL_0053: ldc.i4.1 - IL_0054: conv.i8 - IL_0055: add - IL_0056: stloc.3 - IL_0057: ldloc.3 - IL_0058: ldloc.0 - IL_0059: blt.un.s IL_0046 + IL_002e: call !!0[] [runtime]System.Array::Empty() + IL_0033: ret + + IL_0034: ldloc.1 + IL_0035: conv.ovf.i.un + IL_0036: newarr [runtime]System.UInt64 + IL_003b: stloc.2 + IL_003c: ldc.i4.0 + IL_003d: conv.i8 + IL_003e: stloc.3 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: stloc.s V_4 + IL_0043: br.s IL_0056 - IL_005b: ldloc.2 - IL_005c: ret + IL_0045: ldloc.2 + IL_0046: ldloc.3 + IL_0047: conv.i + IL_0048: ldloc.s V_4 + IL_004a: stelem.i8 + IL_004b: ldloc.s V_4 + IL_004d: ldarg.0 + IL_004e: add + IL_004f: stloc.s V_4 + IL_0051: ldloc.3 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.3 + IL_0056: ldloc.3 + IL_0057: ldloc.0 + IL_0058: blt.un.s IL_0045 + + IL_005a: ldloc.2 + IL_005b: ret } .method public static uint64[] f15(uint64 start, @@ -1117,175 +1114,172 @@ IL_0015: ldc.i4.0 IL_0016: conv.i8 IL_0017: nop - IL_0018: br.s IL_0021 + IL_0018: br.s IL_0020 IL_001a: ldarg.2 IL_001b: ldarg.0 IL_001c: sub IL_001d: ldarg.1 - IL_001e: conv.i8 - IL_001f: div.un - IL_0020: nop - IL_0021: stloc.0 - IL_0022: ldloc.0 - IL_0023: ldc.i4.m1 - IL_0024: conv.i8 - IL_0025: ceq - IL_0027: stloc.1 - IL_0028: ldarg.1 - IL_0029: brtrue.s IL_0037 - - IL_002b: ldarg.0 - IL_002c: ldarg.1 - IL_002d: ldarg.2 - IL_002e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_001e: div.un + IL_001f: nop + IL_0020: stloc.0 + IL_0021: ldloc.0 + IL_0022: ldc.i4.m1 + IL_0023: conv.i8 + IL_0024: ceq + IL_0026: stloc.1 + IL_0027: ldarg.1 + IL_0028: brtrue.s IL_0036 + + IL_002a: ldarg.0 + IL_002b: ldarg.1 + IL_002c: ldarg.2 + IL_002d: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_0033: pop - IL_0034: nop - IL_0035: br.s IL_0038 - - IL_0037: nop - IL_0038: ldarg.2 - IL_0039: ldarg.0 - IL_003a: bge.un.s IL_0041 + IL_0032: pop + IL_0033: nop + IL_0034: br.s IL_0037 - IL_003c: ldc.i4.0 - IL_003d: conv.i8 - IL_003e: nop - IL_003f: br.s IL_004b + IL_0036: nop + IL_0037: ldarg.2 + IL_0038: ldarg.0 + IL_0039: bge.un.s IL_0040 - IL_0041: ldarg.2 - IL_0042: ldarg.0 - IL_0043: sub - IL_0044: ldarg.1 - IL_0045: conv.i8 - IL_0046: div.un - IL_0047: ldc.i4.1 - IL_0048: conv.i8 - IL_0049: add.ovf.un - IL_004a: nop - IL_004b: stloc.2 - IL_004c: ldloc.2 - IL_004d: ldc.i4.1 - IL_004e: conv.i8 - IL_004f: bge.un.s IL_0057 + IL_003b: ldc.i4.0 + IL_003c: conv.i8 + IL_003d: nop + IL_003e: br.s IL_0049 + + IL_0040: ldarg.2 + IL_0041: ldarg.0 + IL_0042: sub + IL_0043: ldarg.1 + IL_0044: div.un + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: add.ovf.un + IL_0048: nop + IL_0049: stloc.2 + IL_004a: ldloc.2 + IL_004b: ldc.i4.1 + IL_004c: conv.i8 + IL_004d: bge.un.s IL_0055 - IL_0051: call !!0[] [runtime]System.Array::Empty() - IL_0056: ret + IL_004f: call !!0[] [runtime]System.Array::Empty() + IL_0054: ret - IL_0057: ldloc.2 - IL_0058: conv.ovf.i.un - IL_0059: newarr [runtime]System.UInt64 - IL_005e: stloc.3 - IL_005f: ldloc.1 - IL_0060: brfalse.s IL_009c + IL_0055: ldloc.2 + IL_0056: conv.ovf.i.un + IL_0057: newarr [runtime]System.UInt64 + IL_005c: stloc.3 + IL_005d: ldloc.1 + IL_005e: brfalse.s IL_009a - IL_0062: ldc.i4.0 - IL_0063: conv.i8 - IL_0064: stloc.s V_4 - IL_0066: ldarg.0 - IL_0067: stloc.s V_5 - IL_0069: ldloc.3 - IL_006a: ldloc.s V_4 - IL_006c: conv.i - IL_006d: ldloc.s V_5 - IL_006f: stelem.i8 - IL_0070: ldloc.s V_5 - IL_0072: ldarg.1 - IL_0073: add - IL_0074: stloc.s V_5 - IL_0076: ldloc.s V_4 - IL_0078: ldc.i4.1 - IL_0079: conv.i8 - IL_007a: add - IL_007b: stloc.s V_4 - IL_007d: br.s IL_0093 - - IL_007f: ldloc.3 - IL_0080: ldloc.s V_4 - IL_0082: conv.i - IL_0083: ldloc.s V_5 - IL_0085: stelem.i8 - IL_0086: ldloc.s V_5 - IL_0088: ldarg.1 - IL_0089: add - IL_008a: stloc.s V_5 - IL_008c: ldloc.s V_4 - IL_008e: ldc.i4.1 - IL_008f: conv.i8 - IL_0090: add - IL_0091: stloc.s V_4 - IL_0093: ldloc.s V_4 - IL_0095: ldc.i4.0 - IL_0096: conv.i8 - IL_0097: bgt.un.s IL_007f - - IL_0099: nop - IL_009a: br.s IL_00e5 - - IL_009c: ldarg.1 - IL_009d: brtrue.s IL_00ab - - IL_009f: ldarg.0 - IL_00a0: ldarg.1 - IL_00a1: ldarg.2 - IL_00a2: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_0060: ldc.i4.0 + IL_0061: conv.i8 + IL_0062: stloc.s V_4 + IL_0064: ldarg.0 + IL_0065: stloc.s V_5 + IL_0067: ldloc.3 + IL_0068: ldloc.s V_4 + IL_006a: conv.i + IL_006b: ldloc.s V_5 + IL_006d: stelem.i8 + IL_006e: ldloc.s V_5 + IL_0070: ldarg.1 + IL_0071: add + IL_0072: stloc.s V_5 + IL_0074: ldloc.s V_4 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.s V_4 + IL_007b: br.s IL_0091 + + IL_007d: ldloc.3 + IL_007e: ldloc.s V_4 + IL_0080: conv.i + IL_0081: ldloc.s V_5 + IL_0083: stelem.i8 + IL_0084: ldloc.s V_5 + IL_0086: ldarg.1 + IL_0087: add + IL_0088: stloc.s V_5 + IL_008a: ldloc.s V_4 + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add + IL_008f: stloc.s V_4 + IL_0091: ldloc.s V_4 + IL_0093: ldc.i4.0 + IL_0094: conv.i8 + IL_0095: bgt.un.s IL_007d + + IL_0097: nop + IL_0098: br.s IL_00e2 + + IL_009a: ldarg.1 + IL_009b: brtrue.s IL_00a9 + + IL_009d: ldarg.0 + IL_009e: ldarg.1 + IL_009f: ldarg.2 + IL_00a0: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_00a7: pop - IL_00a8: nop - IL_00a9: br.s IL_00ac - - IL_00ab: nop - IL_00ac: ldarg.2 - IL_00ad: ldarg.0 - IL_00ae: bge.un.s IL_00b5 - - IL_00b0: ldc.i4.0 - IL_00b1: conv.i8 - IL_00b2: nop - IL_00b3: br.s IL_00bf - - IL_00b5: ldarg.2 - IL_00b6: ldarg.0 - IL_00b7: sub - IL_00b8: ldarg.1 + IL_00a5: pop + IL_00a6: nop + IL_00a7: br.s IL_00aa + + IL_00a9: nop + IL_00aa: ldarg.2 + IL_00ab: ldarg.0 + IL_00ac: bge.un.s IL_00b3 + + IL_00ae: ldc.i4.0 + IL_00af: conv.i8 + IL_00b0: nop + IL_00b1: br.s IL_00bc + + IL_00b3: ldarg.2 + IL_00b4: ldarg.0 + IL_00b5: sub + IL_00b6: ldarg.1 + IL_00b7: div.un + IL_00b8: ldc.i4.1 IL_00b9: conv.i8 - IL_00ba: div.un - IL_00bb: ldc.i4.1 - IL_00bc: conv.i8 - IL_00bd: add.ovf.un - IL_00be: nop - IL_00bf: stloc.s V_4 - IL_00c1: ldc.i4.0 - IL_00c2: conv.i8 - IL_00c3: stloc.s V_5 - IL_00c5: ldarg.0 - IL_00c6: stloc.s V_6 - IL_00c8: br.s IL_00de - - IL_00ca: ldloc.3 - IL_00cb: ldloc.s V_5 - IL_00cd: conv.i + IL_00ba: add.ovf.un + IL_00bb: nop + IL_00bc: stloc.s V_4 + IL_00be: ldc.i4.0 + IL_00bf: conv.i8 + IL_00c0: stloc.s V_5 + IL_00c2: ldarg.0 + IL_00c3: stloc.s V_6 + IL_00c5: br.s IL_00db + + IL_00c7: ldloc.3 + IL_00c8: ldloc.s V_5 + IL_00ca: conv.i + IL_00cb: ldloc.s V_6 + IL_00cd: stelem.i8 IL_00ce: ldloc.s V_6 - IL_00d0: stelem.i8 - IL_00d1: ldloc.s V_6 - IL_00d3: ldarg.1 - IL_00d4: add - IL_00d5: stloc.s V_6 - IL_00d7: ldloc.s V_5 - IL_00d9: ldc.i4.1 - IL_00da: conv.i8 - IL_00db: add - IL_00dc: stloc.s V_5 - IL_00de: ldloc.s V_5 - IL_00e0: ldloc.s V_4 - IL_00e2: blt.un.s IL_00ca - - IL_00e4: nop - IL_00e5: ldloc.3 - IL_00e6: ret + IL_00d0: ldarg.1 + IL_00d1: add + IL_00d2: stloc.s V_6 + IL_00d4: ldloc.s V_5 + IL_00d6: ldc.i4.1 + IL_00d7: conv.i8 + IL_00d8: add + IL_00d9: stloc.s V_5 + IL_00db: ldloc.s V_5 + IL_00dd: ldloc.s V_4 + IL_00df: blt.un.s IL_00c7 + + IL_00e1: nop + IL_00e2: ldloc.3 + IL_00e3: ret } .method public static uint64[] f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1726,7 +1720,7 @@ IL_0022: ldc.i4.0 IL_0023: conv.i8 IL_0024: nop - IL_0025: br.s IL_0034 + IL_0025: br.s IL_0033 IL_0027: ldc.i4.s 10 IL_0029: conv.i8 @@ -1734,55 +1728,54 @@ IL_002b: conv.i8 IL_002c: sub IL_002d: ldloc.0 - IL_002e: conv.i8 - IL_002f: div.un - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add.ovf.un - IL_0033: nop - IL_0034: stloc.1 - IL_0035: ldloc.1 - IL_0036: stloc.2 - IL_0037: ldloc.2 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 - IL_003a: bge.un.s IL_0042 - - IL_003c: call !!0[] [runtime]System.Array::Empty() - IL_0041: ret - - IL_0042: ldloc.2 - IL_0043: conv.ovf.i.un - IL_0044: newarr [runtime]System.UInt64 - IL_0049: stloc.3 - IL_004a: ldc.i4.0 - IL_004b: conv.i8 - IL_004c: stloc.s V_4 - IL_004e: ldc.i4.1 - IL_004f: conv.i8 - IL_0050: stloc.s V_5 - IL_0052: br.s IL_0068 - - IL_0054: ldloc.3 - IL_0055: ldloc.s V_4 - IL_0057: conv.i - IL_0058: ldloc.s V_5 - IL_005a: stelem.i8 - IL_005b: ldloc.s V_5 - IL_005d: ldloc.0 - IL_005e: add - IL_005f: stloc.s V_5 - IL_0061: ldloc.s V_4 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: add - IL_0066: stloc.s V_4 - IL_0068: ldloc.s V_4 - IL_006a: ldloc.1 - IL_006b: blt.un.s IL_0054 - - IL_006d: ldloc.3 - IL_006e: ret + IL_002e: div.un + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add.ovf.un + IL_0032: nop + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: stloc.2 + IL_0036: ldloc.2 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: bge.un.s IL_0041 + + IL_003b: call !!0[] [runtime]System.Array::Empty() + IL_0040: ret + + IL_0041: ldloc.2 + IL_0042: conv.ovf.i.un + IL_0043: newarr [runtime]System.UInt64 + IL_0048: stloc.3 + IL_0049: ldc.i4.0 + IL_004a: conv.i8 + IL_004b: stloc.s V_4 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: stloc.s V_5 + IL_0051: br.s IL_0067 + + IL_0053: ldloc.3 + IL_0054: ldloc.s V_4 + IL_0056: conv.i + IL_0057: ldloc.s V_5 + IL_0059: stelem.i8 + IL_005a: ldloc.s V_5 + IL_005c: ldloc.0 + IL_005d: add + IL_005e: stloc.s V_5 + IL_0060: ldloc.s V_4 + IL_0062: ldc.i4.1 + IL_0063: conv.i8 + IL_0064: add + IL_0065: stloc.s V_4 + IL_0067: ldloc.s V_4 + IL_0069: ldloc.1 + IL_006a: blt.un.s IL_0053 + + IL_006c: ldloc.3 + IL_006d: ret } .method public static uint64[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1914,175 +1907,172 @@ IL_002c: ldc.i4.0 IL_002d: conv.i8 IL_002e: nop - IL_002f: br.s IL_0038 + IL_002f: br.s IL_0037 IL_0031: ldloc.2 IL_0032: ldloc.0 IL_0033: sub IL_0034: ldloc.1 - IL_0035: conv.i8 - IL_0036: div.un - IL_0037: nop - IL_0038: stloc.3 - IL_0039: ldloc.3 - IL_003a: ldc.i4.m1 - IL_003b: conv.i8 - IL_003c: ceq - IL_003e: stloc.s V_4 - IL_0040: ldloc.1 - IL_0041: brtrue.s IL_004f + IL_0035: div.un + IL_0036: nop + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldc.i4.m1 + IL_003a: conv.i8 + IL_003b: ceq + IL_003d: stloc.s V_4 + IL_003f: ldloc.1 + IL_0040: brtrue.s IL_004e - IL_0043: ldloc.0 - IL_0044: ldloc.1 - IL_0045: ldloc.2 - IL_0046: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_0042: ldloc.0 + IL_0043: ldloc.1 + IL_0044: ldloc.2 + IL_0045: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_004b: pop - IL_004c: nop - IL_004d: br.s IL_0050 + IL_004a: pop + IL_004b: nop + IL_004c: br.s IL_004f - IL_004f: nop - IL_0050: ldloc.2 - IL_0051: ldloc.0 - IL_0052: bge.un.s IL_0059 + IL_004e: nop + IL_004f: ldloc.2 + IL_0050: ldloc.0 + IL_0051: bge.un.s IL_0058 - IL_0054: ldc.i4.0 - IL_0055: conv.i8 - IL_0056: nop - IL_0057: br.s IL_0063 - - IL_0059: ldloc.2 - IL_005a: ldloc.0 - IL_005b: sub - IL_005c: ldloc.1 - IL_005d: conv.i8 - IL_005e: div.un - IL_005f: ldc.i4.1 - IL_0060: conv.i8 - IL_0061: add.ovf.un - IL_0062: nop - IL_0063: stloc.s V_5 - IL_0065: ldloc.s V_5 - IL_0067: ldc.i4.1 - IL_0068: conv.i8 - IL_0069: bge.un.s IL_0071 + IL_0053: ldc.i4.0 + IL_0054: conv.i8 + IL_0055: nop + IL_0056: br.s IL_0061 + + IL_0058: ldloc.2 + IL_0059: ldloc.0 + IL_005a: sub + IL_005b: ldloc.1 + IL_005c: div.un + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: add.ovf.un + IL_0060: nop + IL_0061: stloc.s V_5 + IL_0063: ldloc.s V_5 + IL_0065: ldc.i4.1 + IL_0066: conv.i8 + IL_0067: bge.un.s IL_006f + + IL_0069: call !!0[] [runtime]System.Array::Empty() + IL_006e: ret - IL_006b: call !!0[] [runtime]System.Array::Empty() - IL_0070: ret + IL_006f: ldloc.s V_5 + IL_0071: conv.ovf.i.un + IL_0072: newarr [runtime]System.UInt64 + IL_0077: stloc.s V_6 + IL_0079: ldloc.s V_4 + IL_007b: brfalse.s IL_00b9 + + IL_007d: ldc.i4.0 + IL_007e: conv.i8 + IL_007f: stloc.s V_7 + IL_0081: ldloc.0 + IL_0082: stloc.s V_8 + IL_0084: ldloc.s V_6 + IL_0086: ldloc.s V_7 + IL_0088: conv.i + IL_0089: ldloc.s V_8 + IL_008b: stelem.i8 + IL_008c: ldloc.s V_8 + IL_008e: ldloc.1 + IL_008f: add + IL_0090: stloc.s V_8 + IL_0092: ldloc.s V_7 + IL_0094: ldc.i4.1 + IL_0095: conv.i8 + IL_0096: add + IL_0097: stloc.s V_7 + IL_0099: br.s IL_00b0 + + IL_009b: ldloc.s V_6 + IL_009d: ldloc.s V_7 + IL_009f: conv.i + IL_00a0: ldloc.s V_8 + IL_00a2: stelem.i8 + IL_00a3: ldloc.s V_8 + IL_00a5: ldloc.1 + IL_00a6: add + IL_00a7: stloc.s V_8 + IL_00a9: ldloc.s V_7 + IL_00ab: ldc.i4.1 + IL_00ac: conv.i8 + IL_00ad: add + IL_00ae: stloc.s V_7 + IL_00b0: ldloc.s V_7 + IL_00b2: ldc.i4.0 + IL_00b3: conv.i8 + IL_00b4: bgt.un.s IL_009b - IL_0071: ldloc.s V_5 - IL_0073: conv.ovf.i.un - IL_0074: newarr [runtime]System.UInt64 - IL_0079: stloc.s V_6 - IL_007b: ldloc.s V_4 - IL_007d: brfalse.s IL_00bb + IL_00b6: nop + IL_00b7: br.s IL_0102 - IL_007f: ldc.i4.0 - IL_0080: conv.i8 - IL_0081: stloc.s V_7 - IL_0083: ldloc.0 - IL_0084: stloc.s V_8 - IL_0086: ldloc.s V_6 - IL_0088: ldloc.s V_7 - IL_008a: conv.i - IL_008b: ldloc.s V_8 - IL_008d: stelem.i8 - IL_008e: ldloc.s V_8 - IL_0090: ldloc.1 - IL_0091: add - IL_0092: stloc.s V_8 - IL_0094: ldloc.s V_7 - IL_0096: ldc.i4.1 - IL_0097: conv.i8 - IL_0098: add - IL_0099: stloc.s V_7 - IL_009b: br.s IL_00b2 - - IL_009d: ldloc.s V_6 - IL_009f: ldloc.s V_7 - IL_00a1: conv.i - IL_00a2: ldloc.s V_8 - IL_00a4: stelem.i8 - IL_00a5: ldloc.s V_8 - IL_00a7: ldloc.1 - IL_00a8: add - IL_00a9: stloc.s V_8 - IL_00ab: ldloc.s V_7 - IL_00ad: ldc.i4.1 - IL_00ae: conv.i8 - IL_00af: add - IL_00b0: stloc.s V_7 - IL_00b2: ldloc.s V_7 - IL_00b4: ldc.i4.0 - IL_00b5: conv.i8 - IL_00b6: bgt.un.s IL_009d - - IL_00b8: nop - IL_00b9: br.s IL_0105 - - IL_00bb: ldloc.1 - IL_00bc: brtrue.s IL_00ca - - IL_00be: ldloc.0 - IL_00bf: ldloc.1 - IL_00c0: ldloc.2 - IL_00c1: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_00b9: ldloc.1 + IL_00ba: brtrue.s IL_00c8 + + IL_00bc: ldloc.0 + IL_00bd: ldloc.1 + IL_00be: ldloc.2 + IL_00bf: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_00c6: pop - IL_00c7: nop - IL_00c8: br.s IL_00cb - - IL_00ca: nop - IL_00cb: ldloc.2 - IL_00cc: ldloc.0 - IL_00cd: bge.un.s IL_00d4 - - IL_00cf: ldc.i4.0 - IL_00d0: conv.i8 - IL_00d1: nop - IL_00d2: br.s IL_00de - - IL_00d4: ldloc.2 - IL_00d5: ldloc.0 - IL_00d6: sub - IL_00d7: ldloc.1 + IL_00c4: pop + IL_00c5: nop + IL_00c6: br.s IL_00c9 + + IL_00c8: nop + IL_00c9: ldloc.2 + IL_00ca: ldloc.0 + IL_00cb: bge.un.s IL_00d2 + + IL_00cd: ldc.i4.0 + IL_00ce: conv.i8 + IL_00cf: nop + IL_00d0: br.s IL_00db + + IL_00d2: ldloc.2 + IL_00d3: ldloc.0 + IL_00d4: sub + IL_00d5: ldloc.1 + IL_00d6: div.un + IL_00d7: ldc.i4.1 IL_00d8: conv.i8 - IL_00d9: div.un - IL_00da: ldc.i4.1 - IL_00db: conv.i8 - IL_00dc: add.ovf.un - IL_00dd: nop - IL_00de: stloc.s V_7 - IL_00e0: ldc.i4.0 - IL_00e1: conv.i8 - IL_00e2: stloc.s V_8 - IL_00e4: ldloc.0 - IL_00e5: stloc.s V_9 - IL_00e7: br.s IL_00fe - - IL_00e9: ldloc.s V_6 - IL_00eb: ldloc.s V_8 - IL_00ed: conv.i + IL_00d9: add.ovf.un + IL_00da: nop + IL_00db: stloc.s V_7 + IL_00dd: ldc.i4.0 + IL_00de: conv.i8 + IL_00df: stloc.s V_8 + IL_00e1: ldloc.0 + IL_00e2: stloc.s V_9 + IL_00e4: br.s IL_00fb + + IL_00e6: ldloc.s V_6 + IL_00e8: ldloc.s V_8 + IL_00ea: conv.i + IL_00eb: ldloc.s V_9 + IL_00ed: stelem.i8 IL_00ee: ldloc.s V_9 - IL_00f0: stelem.i8 - IL_00f1: ldloc.s V_9 - IL_00f3: ldloc.1 - IL_00f4: add - IL_00f5: stloc.s V_9 - IL_00f7: ldloc.s V_8 - IL_00f9: ldc.i4.1 - IL_00fa: conv.i8 - IL_00fb: add - IL_00fc: stloc.s V_8 - IL_00fe: ldloc.s V_8 - IL_0100: ldloc.s V_7 - IL_0102: blt.un.s IL_00e9 - - IL_0104: nop - IL_0105: ldloc.s V_6 - IL_0107: ret + IL_00f0: ldloc.1 + IL_00f1: add + IL_00f2: stloc.s V_9 + IL_00f4: ldloc.s V_8 + IL_00f6: ldc.i4.1 + IL_00f7: conv.i8 + IL_00f8: add + IL_00f9: stloc.s V_8 + IL_00fb: ldloc.s V_8 + IL_00fd: ldloc.s V_7 + IL_00ff: blt.un.s IL_00e6 + + IL_0101: nop + IL_0102: ldloc.s V_6 + IL_0104: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl index f9a07543892..8a1fa66c6f0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl @@ -512,7 +512,7 @@ IL_001b: ldc.i4.0 IL_001c: conv.i8 IL_001d: nop - IL_001e: br.s IL_002d + IL_001e: br.s IL_002c IL_0020: ldc.i4.s 10 IL_0022: conv.i8 @@ -520,41 +520,40 @@ IL_0024: conv.i8 IL_0025: sub IL_0026: ldarg.0 - IL_0027: conv.i8 - IL_0028: div.un - IL_0029: ldc.i4.1 - IL_002a: conv.i8 - IL_002b: add.ovf.un - IL_002c: nop - IL_002d: stloc.0 - IL_002e: ldc.i4.0 - IL_002f: conv.i8 - IL_0030: stloc.2 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: stloc.3 - IL_0034: br.s IL_0048 - - IL_0036: ldloca.s V_1 - IL_0038: ldloc.3 - IL_0039: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_003e: nop - IL_003f: ldloc.3 - IL_0040: ldarg.0 - IL_0041: add - IL_0042: stloc.3 - IL_0043: ldloc.2 - IL_0044: ldc.i4.1 - IL_0045: conv.i8 - IL_0046: add - IL_0047: stloc.2 - IL_0048: ldloc.2 - IL_0049: ldloc.0 - IL_004a: blt.un.s IL_0036 + IL_0027: div.un + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add.ovf.un + IL_002b: nop + IL_002c: stloc.0 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: stloc.2 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: stloc.3 + IL_0033: br.s IL_0047 + + IL_0035: ldloca.s V_1 + IL_0037: ldloc.3 + IL_0038: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003d: nop + IL_003e: ldloc.3 + IL_003f: ldarg.0 + IL_0040: add + IL_0041: stloc.3 + IL_0042: ldloc.2 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.2 + IL_0047: ldloc.2 + IL_0048: ldloc.0 + IL_0049: blt.un.s IL_0035 - IL_004c: ldloca.s V_1 - IL_004e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0053: ret + IL_004b: ldloca.s V_1 + 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 f11(uint64 finish) cil managed @@ -651,47 +650,46 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_002a + IL_001c: br.s IL_0029 IL_001e: ldc.i4.s 10 IL_0020: conv.i8 IL_0021: ldarg.0 IL_0022: sub IL_0023: ldarg.1 - IL_0024: conv.i8 - IL_0025: div.un - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: add.ovf.un - IL_0029: nop - IL_002a: stloc.0 - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: stloc.2 - IL_002e: ldarg.0 - IL_002f: stloc.3 - IL_0030: br.s IL_0044 - - IL_0032: ldloca.s V_1 - IL_0034: ldloc.3 - IL_0035: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_003a: nop - IL_003b: ldloc.3 - IL_003c: ldarg.1 - IL_003d: add - IL_003e: stloc.3 - IL_003f: ldloc.2 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: add - IL_0043: stloc.2 - IL_0044: ldloc.2 - IL_0045: ldloc.0 - IL_0046: blt.un.s IL_0032 - - IL_0048: ldloca.s V_1 - IL_004a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004f: ret + IL_0024: div.un + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.2 + IL_002d: ldarg.0 + IL_002e: stloc.3 + IL_002f: br.s IL_0043 + + IL_0031: ldloca.s V_1 + IL_0033: ldloc.3 + IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0039: nop + IL_003a: ldloc.3 + IL_003b: ldarg.1 + IL_003c: add + IL_003d: stloc.3 + IL_003e: ldloc.2 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.2 + IL_0043: ldloc.2 + IL_0044: ldloc.0 + IL_0045: blt.un.s IL_0031 + + IL_0047: ldloca.s V_1 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -856,48 +854,47 @@ IL_0017: ldc.i4.0 IL_0018: conv.i8 IL_0019: nop - IL_001a: br.s IL_0027 + IL_001a: br.s IL_0026 IL_001c: ldarg.1 IL_001d: ldc.i4.1 IL_001e: conv.i8 IL_001f: sub IL_0020: ldarg.0 - IL_0021: conv.i8 - IL_0022: div.un - IL_0023: ldc.i4.1 - IL_0024: conv.i8 - IL_0025: add.ovf.un - IL_0026: nop - IL_0027: stloc.0 - IL_0028: ldc.i4.0 - IL_0029: conv.i8 - IL_002a: stloc.2 - IL_002b: ldc.i4.1 - IL_002c: conv.i8 - IL_002d: stloc.3 - IL_002e: br.s IL_0042 - - IL_0030: ldloca.s V_1 - IL_0032: ldloc.3 - IL_0033: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0038: nop - IL_0039: ldloc.3 - IL_003a: ldarg.0 - IL_003b: add - IL_003c: stloc.3 - IL_003d: ldloc.2 - IL_003e: ldc.i4.1 - IL_003f: conv.i8 - IL_0040: add - IL_0041: stloc.2 - IL_0042: ldloc.2 - IL_0043: ldloc.0 - IL_0044: blt.un.s IL_0030 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add.ovf.un + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: br.s IL_0041 - IL_0046: ldloca.s V_1 - 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 + IL_002f: ldloca.s V_1 + IL_0031: ldloc.3 + IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0037: nop + IL_0038: ldloc.3 + IL_0039: ldarg.0 + IL_003a: add + IL_003b: stloc.3 + IL_003c: ldloc.2 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.2 + IL_0041: ldloc.2 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_002f + + IL_0045: ldloca.s V_1 + IL_0047: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004c: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -937,127 +934,125 @@ IL_0015: ldc.i4.0 IL_0016: conv.i8 IL_0017: nop - IL_0018: br.s IL_0021 + IL_0018: br.s IL_0020 IL_001a: ldarg.2 IL_001b: ldarg.0 IL_001c: sub IL_001d: ldarg.1 - IL_001e: conv.i8 - IL_001f: div.un - IL_0020: nop - IL_0021: stloc.0 - IL_0022: ldloc.0 - IL_0023: ldc.i4.m1 - IL_0024: conv.i8 - IL_0025: ceq - IL_0027: stloc.1 - IL_0028: ldloc.1 - IL_0029: brfalse.s IL_0065 + IL_001e: div.un + IL_001f: nop + IL_0020: stloc.0 + IL_0021: ldloc.0 + IL_0022: ldc.i4.m1 + IL_0023: conv.i8 + IL_0024: ceq + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: brfalse.s IL_0064 - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: stloc.3 - IL_002e: ldarg.0 - IL_002f: stloc.s V_4 - IL_0031: ldloca.s V_2 - IL_0033: ldloc.s V_4 - IL_0035: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_003a: nop - IL_003b: ldloc.s V_4 - IL_003d: ldarg.1 - IL_003e: add - IL_003f: stloc.s V_4 - IL_0041: ldloc.3 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: stloc.3 - IL_0046: br.s IL_005d + 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: ldloca.s V_2 + IL_0032: ldloc.s V_4 + IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0039: nop + IL_003a: ldloc.s V_4 + IL_003c: ldarg.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: br.s IL_005c + + IL_0047: ldloca.s V_2 + IL_0049: ldloc.s V_4 + IL_004b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0050: nop + IL_0051: ldloc.s V_4 + IL_0053: ldarg.1 + IL_0054: add + IL_0055: stloc.s V_4 + IL_0057: ldloc.3 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.3 + IL_005c: ldloc.3 + IL_005d: ldc.i4.0 + IL_005e: conv.i8 + IL_005f: bgt.un.s IL_0047 - IL_0048: ldloca.s V_2 - IL_004a: ldloc.s V_4 - IL_004c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0051: nop - IL_0052: ldloc.s V_4 - IL_0054: ldarg.1 - IL_0055: add - IL_0056: stloc.s V_4 - IL_0058: ldloc.3 - IL_0059: ldc.i4.1 - IL_005a: conv.i8 - IL_005b: add - IL_005c: stloc.3 - IL_005d: ldloc.3 - IL_005e: ldc.i4.0 - IL_005f: conv.i8 - IL_0060: bgt.un.s IL_0048 - - IL_0062: nop - IL_0063: br.s IL_00af - - IL_0065: ldarg.1 - IL_0066: brtrue.s IL_0074 - - IL_0068: ldarg.0 - IL_0069: ldarg.1 - IL_006a: ldarg.2 - IL_006b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_0061: nop + IL_0062: br.s IL_00ad + + IL_0064: ldarg.1 + IL_0065: brtrue.s IL_0073 + + IL_0067: ldarg.0 + IL_0068: ldarg.1 + IL_0069: ldarg.2 + IL_006a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_0070: pop - IL_0071: nop - IL_0072: br.s IL_0075 - - IL_0074: nop - IL_0075: ldarg.2 - IL_0076: ldarg.0 - IL_0077: bge.un.s IL_007e - - IL_0079: ldc.i4.0 - IL_007a: conv.i8 - IL_007b: nop - IL_007c: br.s IL_0088 - - IL_007e: ldarg.2 - IL_007f: ldarg.0 - IL_0080: sub - IL_0081: ldarg.1 - IL_0082: conv.i8 - IL_0083: div.un - IL_0084: ldc.i4.1 - IL_0085: conv.i8 - IL_0086: add.ovf.un - IL_0087: nop - IL_0088: stloc.3 - IL_0089: ldc.i4.0 - IL_008a: conv.i8 - IL_008b: stloc.s V_4 - IL_008d: ldarg.0 - IL_008e: stloc.s V_5 - IL_0090: br.s IL_00a9 - - IL_0092: ldloca.s V_2 - IL_0094: ldloc.s V_5 - IL_0096: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_009b: nop - IL_009c: ldloc.s V_5 - IL_009e: ldarg.1 - IL_009f: add - IL_00a0: stloc.s V_5 - IL_00a2: ldloc.s V_4 - IL_00a4: ldc.i4.1 - IL_00a5: conv.i8 - IL_00a6: add - IL_00a7: stloc.s V_4 - IL_00a9: ldloc.s V_4 - IL_00ab: ldloc.3 - IL_00ac: blt.un.s IL_0092 - - IL_00ae: nop - IL_00af: ldloca.s V_2 - IL_00b1: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00b6: ret + IL_006f: pop + IL_0070: nop + IL_0071: br.s IL_0074 + + IL_0073: nop + IL_0074: ldarg.2 + IL_0075: ldarg.0 + IL_0076: bge.un.s IL_007d + + IL_0078: ldc.i4.0 + IL_0079: conv.i8 + IL_007a: nop + IL_007b: br.s IL_0086 + + IL_007d: ldarg.2 + IL_007e: ldarg.0 + IL_007f: sub + IL_0080: ldarg.1 + IL_0081: div.un + IL_0082: ldc.i4.1 + IL_0083: conv.i8 + IL_0084: add.ovf.un + IL_0085: nop + IL_0086: stloc.3 + IL_0087: ldc.i4.0 + IL_0088: conv.i8 + IL_0089: stloc.s V_4 + IL_008b: ldarg.0 + IL_008c: stloc.s V_5 + IL_008e: br.s IL_00a7 + + IL_0090: ldloca.s V_2 + IL_0092: ldloc.s V_5 + IL_0094: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0099: nop + IL_009a: ldloc.s V_5 + IL_009c: ldarg.1 + IL_009d: add + IL_009e: stloc.s V_5 + IL_00a0: ldloc.s V_4 + IL_00a2: ldc.i4.1 + IL_00a3: conv.i8 + IL_00a4: add + IL_00a5: stloc.s V_4 + IL_00a7: ldloc.s V_4 + IL_00a9: ldloc.3 + IL_00aa: blt.un.s IL_0090 + + IL_00ac: nop + IL_00ad: ldloca.s V_2 + IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b4: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1421,7 +1416,7 @@ IL_0022: ldc.i4.0 IL_0023: conv.i8 IL_0024: nop - IL_0025: br.s IL_0034 + IL_0025: br.s IL_0033 IL_0027: ldc.i4.s 10 IL_0029: conv.i8 @@ -1429,41 +1424,40 @@ IL_002b: conv.i8 IL_002c: sub IL_002d: ldloc.0 - IL_002e: conv.i8 - IL_002f: div.un - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add.ovf.un - IL_0033: nop - IL_0034: stloc.1 - IL_0035: ldc.i4.0 - IL_0036: conv.i8 - IL_0037: stloc.3 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 - IL_003a: stloc.s V_4 - IL_003c: br.s IL_0053 - - IL_003e: ldloca.s V_2 - IL_0040: ldloc.s V_4 - IL_0042: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0047: nop - IL_0048: ldloc.s V_4 - IL_004a: ldloc.0 - IL_004b: add - IL_004c: stloc.s V_4 - IL_004e: ldloc.3 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: add - IL_0052: stloc.3 - IL_0053: ldloc.3 - IL_0054: ldloc.1 - IL_0055: blt.un.s IL_003e - - IL_0057: ldloca.s V_2 - IL_0059: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_005e: ret + IL_002e: div.un + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add.ovf.un + IL_0032: nop + IL_0033: stloc.1 + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: stloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: stloc.s V_4 + IL_003b: br.s IL_0052 + + IL_003d: ldloca.s V_2 + IL_003f: ldloc.s V_4 + IL_0041: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0046: nop + IL_0047: ldloc.s V_4 + IL_0049: ldloc.0 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.3 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.3 + IL_0053: ldloc.1 + IL_0054: blt.un.s IL_003d + + IL_0056: ldloca.s V_2 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1580,127 +1574,125 @@ IL_002c: ldc.i4.0 IL_002d: conv.i8 IL_002e: nop - IL_002f: br.s IL_0038 + IL_002f: br.s IL_0037 IL_0031: ldloc.2 IL_0032: ldloc.0 IL_0033: sub IL_0034: ldloc.1 - IL_0035: conv.i8 - IL_0036: div.un - IL_0037: nop - IL_0038: stloc.3 - IL_0039: ldloc.3 - IL_003a: ldc.i4.m1 - IL_003b: conv.i8 - IL_003c: ceq - IL_003e: stloc.s V_4 - IL_0040: ldloc.s V_4 - IL_0042: brfalse.s IL_0084 - - IL_0044: ldc.i4.0 - IL_0045: conv.i8 - IL_0046: stloc.s V_6 - IL_0048: ldloc.0 - IL_0049: stloc.s V_7 - IL_004b: ldloca.s V_5 - IL_004d: ldloc.s V_7 - IL_004f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0054: nop - IL_0055: ldloc.s V_7 - IL_0057: ldloc.1 - IL_0058: add - IL_0059: stloc.s V_7 - IL_005b: ldloc.s V_6 - IL_005d: ldc.i4.1 - IL_005e: conv.i8 - IL_005f: add - IL_0060: stloc.s V_6 - IL_0062: br.s IL_007b - - IL_0064: ldloca.s V_5 - IL_0066: ldloc.s V_7 - IL_0068: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006d: nop - IL_006e: ldloc.s V_7 - IL_0070: ldloc.1 - IL_0071: add - IL_0072: stloc.s V_7 - IL_0074: ldloc.s V_6 - IL_0076: ldc.i4.1 - IL_0077: conv.i8 - IL_0078: add - IL_0079: stloc.s V_6 - IL_007b: ldloc.s V_6 - IL_007d: ldc.i4.0 - IL_007e: conv.i8 - IL_007f: bgt.un.s IL_0064 - - IL_0081: nop - IL_0082: br.s IL_00d0 - - IL_0084: ldloc.1 - IL_0085: brtrue.s IL_0093 - - IL_0087: ldloc.0 - IL_0088: ldloc.1 - IL_0089: ldloc.2 - IL_008a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_0035: div.un + IL_0036: nop + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldc.i4.m1 + IL_003a: conv.i8 + IL_003b: ceq + IL_003d: stloc.s V_4 + IL_003f: ldloc.s V_4 + IL_0041: brfalse.s IL_0083 + + IL_0043: ldc.i4.0 + IL_0044: conv.i8 + IL_0045: stloc.s V_6 + IL_0047: ldloc.0 + IL_0048: stloc.s V_7 + IL_004a: ldloca.s V_5 + IL_004c: ldloc.s V_7 + IL_004e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0053: nop + IL_0054: ldloc.s V_7 + IL_0056: ldloc.1 + IL_0057: add + IL_0058: stloc.s V_7 + IL_005a: ldloc.s V_6 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_6 + IL_0061: br.s IL_007a + + IL_0063: ldloca.s V_5 + IL_0065: ldloc.s V_7 + IL_0067: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006c: nop + IL_006d: ldloc.s V_7 + IL_006f: ldloc.1 + IL_0070: add + IL_0071: stloc.s V_7 + IL_0073: ldloc.s V_6 + IL_0075: ldc.i4.1 + IL_0076: conv.i8 + IL_0077: add + IL_0078: stloc.s V_6 + IL_007a: ldloc.s V_6 + IL_007c: ldc.i4.0 + IL_007d: conv.i8 + IL_007e: bgt.un.s IL_0063 + + IL_0080: nop + IL_0081: br.s IL_00ce + + IL_0083: ldloc.1 + IL_0084: brtrue.s IL_0092 + + IL_0086: ldloc.0 + IL_0087: ldloc.1 + IL_0088: ldloc.2 + IL_0089: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_008f: pop - IL_0090: nop - IL_0091: br.s IL_0094 - - IL_0093: nop - IL_0094: ldloc.2 - IL_0095: ldloc.0 - IL_0096: bge.un.s IL_009d - - IL_0098: ldc.i4.0 - IL_0099: conv.i8 - IL_009a: nop - IL_009b: br.s IL_00a7 - - IL_009d: ldloc.2 - IL_009e: ldloc.0 - IL_009f: sub - IL_00a0: ldloc.1 - IL_00a1: conv.i8 - IL_00a2: div.un - IL_00a3: ldc.i4.1 - IL_00a4: conv.i8 - IL_00a5: add.ovf.un - IL_00a6: nop - IL_00a7: stloc.s V_6 - IL_00a9: ldc.i4.0 - IL_00aa: conv.i8 - IL_00ab: stloc.s V_7 - IL_00ad: ldloc.0 - IL_00ae: stloc.s V_8 - IL_00b0: br.s IL_00c9 - - IL_00b2: ldloca.s V_5 - IL_00b4: ldloc.s V_8 - IL_00b6: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_00bb: nop - IL_00bc: ldloc.s V_8 - IL_00be: ldloc.1 - IL_00bf: add - IL_00c0: stloc.s V_8 - IL_00c2: ldloc.s V_7 - IL_00c4: ldc.i4.1 - IL_00c5: conv.i8 - IL_00c6: add - IL_00c7: stloc.s V_7 - IL_00c9: ldloc.s V_7 - IL_00cb: ldloc.s V_6 - IL_00cd: blt.un.s IL_00b2 - - IL_00cf: nop - IL_00d0: ldloca.s V_5 - IL_00d2: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00d7: ret + IL_008e: pop + IL_008f: nop + IL_0090: br.s IL_0093 + + IL_0092: nop + IL_0093: ldloc.2 + IL_0094: ldloc.0 + IL_0095: bge.un.s IL_009c + + IL_0097: ldc.i4.0 + IL_0098: conv.i8 + IL_0099: nop + IL_009a: br.s IL_00a5 + + IL_009c: ldloc.2 + IL_009d: ldloc.0 + IL_009e: sub + IL_009f: ldloc.1 + IL_00a0: div.un + IL_00a1: ldc.i4.1 + IL_00a2: conv.i8 + IL_00a3: add.ovf.un + IL_00a4: nop + IL_00a5: stloc.s V_6 + IL_00a7: ldc.i4.0 + IL_00a8: conv.i8 + IL_00a9: stloc.s V_7 + IL_00ab: ldloc.0 + IL_00ac: stloc.s V_8 + IL_00ae: br.s IL_00c7 + + IL_00b0: ldloca.s V_5 + IL_00b2: ldloc.s V_8 + IL_00b4: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00b9: nop + IL_00ba: ldloc.s V_8 + IL_00bc: ldloc.1 + IL_00bd: add + IL_00be: stloc.s V_8 + IL_00c0: ldloc.s V_7 + IL_00c2: ldc.i4.1 + IL_00c3: conv.i8 + IL_00c4: add + IL_00c5: stloc.s V_7 + IL_00c7: ldloc.s V_7 + IL_00c9: ldloc.s V_6 + IL_00cb: blt.un.s IL_00b0 + + IL_00cd: nop + IL_00ce: ldloca.s V_5 + IL_00d0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00d5: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl index 561394e0e95..f04ebbda32a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl @@ -160,38 +160,37 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldc.i4.s 10 - IL_000b: conv.i2 - IL_000c: ldarg.0 - IL_000d: conv.i2 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldarg.0 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 - - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(uint8) - IL_001f: ldloc.2 - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 - - IL_002b: ret + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.u2 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint8) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret } .method public static void f3uy(uint8 finish) cil managed @@ -207,38 +206,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.0 - IL_0009: conv.i2 - IL_000a: ldc.i4.1 - IL_000b: conv.i2 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldc.i4.1 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(uint8) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 - - IL_0029: ret + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.u2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f4uy(uint8 start, @@ -256,38 +254,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.1 - IL_0009: conv.i2 - IL_000a: ldarg.0 - IL_000b: conv.i2 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(uint8) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 - - IL_0029: ret + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f5() cil managed @@ -361,40 +358,39 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0014 + IL_0007: br.s IL_0013 IL_0009: ldc.i4.s 10 - IL_000b: conv.i2 - IL_000c: ldarg.0 - IL_000d: conv.i2 - IL_000e: sub - IL_000f: ldc.i4.2 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: ldarg.0 - IL_0018: stloc.2 - IL_0019: br.s IL_0029 - - IL_001b: ldloc.2 - IL_001c: call void assembly::set_c(uint8) - IL_0021: ldloc.2 - IL_0022: ldc.i4.2 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.1 - IL_0026: ldc.i4.1 - IL_0027: add - IL_0028: stloc.1 - IL_0029: ldloc.1 - IL_002a: ldloc.0 - IL_002b: blt.un.s IL_001b - - IL_002d: ret + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint8) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret } .method public static void f8uy(uint8 step) cil managed @@ -418,37 +414,34 @@ IL_000e: br.s IL_0011 IL_0010: nop - IL_0011: ldc.i4.s 10 - IL_0013: conv.i2 - IL_0014: ldc.i4.1 - IL_0015: conv.i2 - IL_0016: sub - IL_0017: ldarg.0 - IL_0018: div.un - IL_0019: ldc.i4.1 - IL_001a: add - IL_001b: stloc.0 - IL_001c: ldc.i4.0 - IL_001d: stloc.1 - IL_001e: ldc.i4.1 - IL_001f: stloc.2 - IL_0020: br.s IL_0030 + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u2 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: stloc.1 + IL_001b: ldc.i4.1 + IL_001c: stloc.2 + IL_001d: br.s IL_002d - IL_0022: ldloc.2 - IL_0023: call void assembly::set_c(uint8) - IL_0028: ldloc.2 - IL_0029: ldarg.0 - IL_002a: add - IL_002b: stloc.2 - IL_002c: ldloc.1 - IL_002d: ldc.i4.1 - IL_002e: add - IL_002f: stloc.1 - IL_0030: ldloc.1 - IL_0031: ldloc.0 - IL_0032: blt.un.s IL_0022 - - IL_0034: ret + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint8) + IL_0025: ldloc.2 + IL_0026: ldarg.0 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001f + + IL_0031: ret } .method public static void f9uy(uint8 finish) cil managed @@ -464,40 +457,39 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0012 + IL_0006: br.s IL_0011 IL_0008: ldarg.0 - IL_0009: conv.i2 - IL_000a: ldc.i4.1 - IL_000b: conv.i2 - IL_000c: sub - IL_000d: ldc.i4.2 - IL_000e: div.un - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldc.i4.1 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + IL_000d: conv.u2 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.1 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(uint8) - IL_001f: ldloc.2 - IL_0020: ldc.i4.2 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 - - IL_002b: ret + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint8) + IL_001e: ldloc.2 + IL_001f: ldc.i4.2 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret } .method public static void f10uy(uint8 start, @@ -531,40 +523,39 @@ IL_0014: ldc.i4.0 IL_0015: nop - IL_0016: br.s IL_0022 + IL_0016: br.s IL_0021 IL_0018: ldarg.2 - IL_0019: conv.i2 - IL_001a: ldarg.2 - IL_001b: conv.i2 - IL_001c: sub - IL_001d: ldarg.1 - IL_001e: div.un - IL_001f: ldc.i4.1 - IL_0020: add - IL_0021: nop - IL_0022: stloc.0 - IL_0023: ldc.i4.0 - IL_0024: stloc.1 - IL_0025: ldarg.2 - IL_0026: stloc.2 - IL_0027: br.s IL_0037 - - IL_0029: ldloc.2 - IL_002a: call void assembly::set_c(uint8) - IL_002f: ldloc.2 - IL_0030: ldarg.1 - IL_0031: add - IL_0032: stloc.2 - IL_0033: ldloc.1 - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.1 - IL_0037: ldloc.1 - IL_0038: ldloc.0 - IL_0039: blt.un.s IL_0029 - - IL_003b: ret + IL_0019: ldarg.2 + IL_001a: sub + IL_001b: ldarg.1 + IL_001c: div.un + IL_001d: conv.u2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldarg.2 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(uint8) + IL_002e: ldloc.2 + IL_002f: ldarg.1 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret } .method public static void f11uy(uint8 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl index a4f0f4312d3..099499cd1e5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl @@ -316,38 +316,37 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldc.i4.s 122 - IL_000b: conv.i4 - IL_000c: ldarg.0 - IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldarg.0 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 - - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(char) - IL_001f: ldloc.2 - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.u4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(char) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 - IL_002b: ret + IL_002a: ret } .method public static void f3(char finish) cil managed @@ -363,38 +362,37 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldarg.0 - IL_000a: conv.i4 - IL_000b: ldc.i4.s 97 - IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldc.i4.s 97 - IL_0017: stloc.2 - IL_0018: br.s IL_0028 + IL_000a: ldc.i4.s 97 + IL_000c: sub + IL_000d: conv.u4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.s 97 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 - IL_001a: ldloc.2 - IL_001b: call void assembly::set_c(char) - 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: add - IL_0027: stloc.1 - IL_0028: ldloc.1 - IL_0029: ldloc.0 - IL_002a: blt.un.s IL_001a + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(char) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 - IL_002c: ret + IL_002b: ret } .method public static void f4(char start, @@ -412,38 +410,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.1 - IL_0009: conv.i4 - IL_000a: ldarg.0 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(char) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(char) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 - IL_0029: ret + IL_0028: ret } .method public static void f5() cil managed @@ -517,40 +514,39 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0014 + IL_0007: br.s IL_0013 IL_0009: ldc.i4.s 122 - IL_000b: conv.i4 - IL_000c: ldarg.0 - IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.2 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: ldarg.0 - IL_0018: stloc.2 - IL_0019: br.s IL_0029 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 - IL_001b: ldloc.2 - IL_001c: call void assembly::set_c(char) - IL_0021: ldloc.2 - IL_0022: ldc.i4.2 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.1 - IL_0026: ldc.i4.1 - IL_0027: add - IL_0028: stloc.1 - IL_0029: ldloc.1 - IL_002a: ldloc.0 - IL_002b: blt.un.s IL_001b + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(char) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a - IL_002d: ret + IL_002c: ret } .method public static void f8(char step) cil managed @@ -580,36 +576,35 @@ IL_0018: nop IL_0019: ldc.i4.s 122 - IL_001b: conv.i4 - IL_001c: ldc.i4.s 97 - IL_001e: conv.i4 - IL_001f: sub - IL_0020: ldarg.0 - IL_0021: div.un - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.0 - IL_0025: ldc.i4.0 - IL_0026: stloc.1 - IL_0027: ldc.i4.s 97 - IL_0029: stloc.2 - IL_002a: br.s IL_003a - - IL_002c: ldloc.2 - IL_002d: call void assembly::set_c(char) - IL_0032: ldloc.2 - IL_0033: ldarg.0 - IL_0034: add - IL_0035: stloc.2 - IL_0036: ldloc.1 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.1 - IL_003a: ldloc.1 - IL_003b: ldloc.0 - IL_003c: blt.un.s IL_002c - - IL_003e: ret + IL_001b: ldc.i4.s 97 + IL_001d: sub + IL_001e: ldarg.0 + IL_001f: div.un + IL_0020: conv.u4 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: stloc.1 + IL_0026: ldc.i4.s 97 + IL_0028: stloc.2 + IL_0029: br.s IL_0039 + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(char) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: ldloc.0 + IL_003b: blt.un.s IL_002b + + IL_003d: ret } .method public static void f9(char finish) cil managed @@ -625,40 +620,39 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0014 + IL_0007: br.s IL_0013 IL_0009: ldarg.0 - IL_000a: conv.i4 - IL_000b: ldc.i4.s 97 - IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.2 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: ldc.i4.s 97 - IL_0019: stloc.2 - IL_001a: br.s IL_002a + IL_000a: ldc.i4.s 97 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldc.i4.s 97 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 - IL_001c: ldloc.2 - IL_001d: call void assembly::set_c(char) - IL_0022: ldloc.2 - IL_0023: ldc.i4.2 - IL_0024: add - IL_0025: stloc.2 - IL_0026: ldloc.1 - IL_0027: ldc.i4.1 - IL_0028: add - IL_0029: stloc.1 - IL_002a: ldloc.1 - IL_002b: ldloc.0 - IL_002c: blt.un.s IL_001c - - IL_002e: ret + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(char) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret } .method public static void f10(char start, @@ -697,40 +691,39 @@ IL_001b: ldc.i4.0 IL_001c: nop - IL_001d: br.s IL_0029 + IL_001d: br.s IL_0028 IL_001f: ldarg.2 - IL_0020: conv.i4 - IL_0021: ldarg.2 - IL_0022: conv.i4 - IL_0023: sub - IL_0024: ldarg.1 - IL_0025: div.un - IL_0026: ldc.i4.1 - IL_0027: add - IL_0028: nop - IL_0029: stloc.0 - IL_002a: ldc.i4.0 - IL_002b: stloc.1 - IL_002c: ldarg.2 - IL_002d: stloc.2 - IL_002e: br.s IL_003e - - IL_0030: ldloc.2 - IL_0031: call void assembly::set_c(char) - IL_0036: ldloc.2 - IL_0037: ldarg.1 - IL_0038: add - IL_0039: stloc.2 - IL_003a: ldloc.1 - IL_003b: ldc.i4.1 - IL_003c: add - IL_003d: stloc.1 - IL_003e: ldloc.1 - IL_003f: ldloc.0 - IL_0040: blt.un.s IL_0030 - - IL_0042: ret + IL_0020: ldarg.2 + IL_0021: sub + IL_0022: ldarg.1 + IL_0023: div.un + IL_0024: conv.u4 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: nop + IL_0028: stloc.0 + IL_0029: ldc.i4.0 + IL_002a: stloc.1 + IL_002b: ldarg.2 + IL_002c: stloc.2 + IL_002d: br.s IL_003d + + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(char) + IL_0035: ldloc.2 + IL_0036: ldarg.1 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.1 + IL_003d: ldloc.1 + IL_003e: ldloc.0 + IL_003f: blt.un.s IL_002f + + IL_0041: ret } .method public static void f11(char start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl index 15e79992e47..b2e1bce18e3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl @@ -160,38 +160,37 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldc.i4.s 10 - IL_000b: conv.i4 - IL_000c: ldarg.0 + IL_000b: ldarg.0 + IL_000c: sub IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldarg.0 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 - - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(int16) - IL_001f: ldloc.2 - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int16) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 - IL_002b: ret + IL_002a: ret } .method public static void f3s(int16 finish) cil managed @@ -207,38 +206,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldc.i4.1 + IL_0009: ldc.i4.1 + IL_000a: sub IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldc.i4.1 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(int16) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 - IL_0029: ret + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f4s(int16 start, @@ -256,38 +254,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.1 - IL_0009: conv.i4 - IL_000a: ldarg.0 + IL_0009: ldarg.0 + IL_000a: sub IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(int16) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 - IL_0029: ret + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f5() cil managed @@ -361,40 +358,39 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0014 + IL_0007: br.s IL_0013 IL_0009: ldc.i4.s 10 - IL_000b: conv.i4 - IL_000c: ldarg.0 - IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.2 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: ldarg.0 - IL_0018: stloc.2 - IL_0019: br.s IL_0029 - - IL_001b: ldloc.2 - IL_001c: call void assembly::set_c(int16) - IL_0021: ldloc.2 - IL_0022: ldc.i4.2 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.1 - IL_0026: ldc.i4.1 - IL_0027: add - IL_0028: stloc.1 - IL_0029: ldloc.1 - IL_002a: ldloc.0 - IL_002b: blt.un.s IL_001b - - IL_002d: ret + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.i4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int16) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret } .method public static void f8s(int16 step) cil managed @@ -420,44 +416,41 @@ IL_0010: nop IL_0011: ldc.i4.0 IL_0012: ldarg.0 - IL_0013: bge.s IL_0022 + IL_0013: bge.s IL_001f - IL_0015: ldc.i4.s 10 - IL_0017: conv.i4 - IL_0018: ldc.i4.1 + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un IL_0019: conv.i4 - IL_001a: sub - IL_001b: ldarg.0 - IL_001c: div.un - IL_001d: ldc.i4.1 - IL_001e: add - IL_001f: nop - IL_0020: br.s IL_0024 - + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: ldc.i4.0 + IL_0020: nop + IL_0021: stloc.0 IL_0022: ldc.i4.0 - IL_0023: nop - IL_0024: stloc.0 - IL_0025: ldc.i4.0 - IL_0026: stloc.1 - IL_0027: ldc.i4.1 - IL_0028: stloc.2 - IL_0029: br.s IL_0039 - - IL_002b: ldloc.2 - IL_002c: call void assembly::set_c(int16) - IL_0031: ldloc.2 - IL_0032: ldarg.0 - IL_0033: add - IL_0034: stloc.2 - IL_0035: ldloc.1 - IL_0036: ldc.i4.1 - IL_0037: add - IL_0038: stloc.1 - IL_0039: ldloc.1 - IL_003a: ldloc.0 - IL_003b: blt.un.s IL_002b - - IL_003d: ret + IL_0023: stloc.1 + IL_0024: ldc.i4.1 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(int16) + IL_002e: ldloc.2 + IL_002f: ldarg.0 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret } .method public static void f9s(int16 finish) cil managed @@ -473,40 +466,39 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0012 + IL_0006: br.s IL_0011 IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldc.i4.1 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.2 - IL_000e: div.un - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldc.i4.1 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 - - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(int16) - IL_001f: ldloc.2 - IL_0020: ldc.i4.2 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + IL_000d: conv.i4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.1 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int16) + IL_001e: ldloc.2 + IL_001f: ldc.i4.2 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 - IL_002b: ret + IL_002a: ret } .method public static void f10s(int16 start, @@ -536,7 +528,7 @@ IL_000f: nop IL_0010: ldc.i4.0 IL_0011: ldarg.1 - IL_0012: bge.s IL_0028 + IL_0012: bge.s IL_0027 IL_0014: ldarg.2 IL_0015: ldarg.2 @@ -544,64 +536,61 @@ IL_0018: ldc.i4.0 IL_0019: nop - IL_001a: br.s IL_003e + IL_001a: br.s IL_003b IL_001c: ldarg.2 - IL_001d: conv.i4 - IL_001e: ldarg.2 - IL_001f: conv.i4 - IL_0020: sub - IL_0021: ldarg.1 - IL_0022: div.un - IL_0023: ldc.i4.1 - IL_0024: add - IL_0025: nop - IL_0026: br.s IL_003e + IL_001d: ldarg.2 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: div.un + IL_0021: conv.i4 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: nop + IL_0025: br.s IL_003b + IL_0027: ldarg.2 IL_0028: ldarg.2 - IL_0029: ldarg.2 - IL_002a: bge.s IL_0030 + IL_0029: bge.s IL_002f - IL_002c: ldc.i4.0 - IL_002d: nop - IL_002e: br.s IL_003e + IL_002b: ldc.i4.0 + IL_002c: nop + IL_002d: br.s IL_003b + IL_002f: ldarg.2 IL_0030: ldarg.2 - IL_0031: conv.i4 - IL_0032: ldarg.2 - IL_0033: conv.i4 - IL_0034: sub - IL_0035: ldarg.1 - IL_0036: not + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: div.un IL_0037: conv.i4 IL_0038: ldc.i4.1 IL_0039: add - IL_003a: div.un - IL_003b: ldc.i4.1 - IL_003c: add - IL_003d: nop - IL_003e: stloc.0 - IL_003f: ldc.i4.0 - IL_0040: stloc.1 - IL_0041: ldarg.2 - IL_0042: stloc.2 - IL_0043: br.s IL_0053 - - IL_0045: ldloc.2 - IL_0046: call void assembly::set_c(int16) - IL_004b: ldloc.2 - IL_004c: ldarg.1 - IL_004d: add - IL_004e: stloc.2 - IL_004f: ldloc.1 - IL_0050: ldc.i4.1 - IL_0051: add - IL_0052: stloc.1 - IL_0053: ldloc.1 - IL_0054: ldloc.0 - IL_0055: blt.un.s IL_0045 - - IL_0057: ret + IL_003a: nop + IL_003b: stloc.0 + IL_003c: ldc.i4.0 + IL_003d: stloc.1 + IL_003e: ldarg.2 + IL_003f: stloc.2 + IL_0040: br.s IL_0050 + + IL_0042: ldloc.2 + IL_0043: call void assembly::set_c(int16) + IL_0048: ldloc.2 + IL_0049: ldarg.1 + IL_004a: add + IL_004b: stloc.2 + IL_004c: ldloc.1 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.1 + IL_0050: ldloc.1 + IL_0051: ldloc.0 + IL_0052: blt.un.s IL_0042 + + IL_0054: ret } .method public static void f11s(int16 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl index 31eeb84e268..56e4ba548ca 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl @@ -293,44 +293,42 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0017 + IL_0008: br.s IL_0015 IL_000a: ldc.i4.s 10 - IL_000c: conv.i8 - IL_000d: ldarg.0 - IL_000e: conv.i8 - IL_000f: sub - IL_0010: ldc.i4.2 - IL_0011: conv.i8 - IL_0012: div.un - IL_0013: ldc.i4.1 - IL_0014: conv.i8 - IL_0015: add.ovf.un - IL_0016: nop - IL_0017: stloc.0 - IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: stloc.1 - IL_001b: ldarg.0 - IL_001c: stloc.2 - IL_001d: br.s IL_002e - - IL_001f: ldloc.2 - IL_0020: call void assembly::set_c(int32) - IL_0025: ldloc.2 - IL_0026: ldc.i4.2 - IL_0027: add - IL_0028: stloc.2 - IL_0029: ldloc.1 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: add - IL_002d: stloc.1 - IL_002e: ldloc.1 - IL_002f: ldloc.0 - IL_0030: blt.un.s IL_001f - - IL_0032: ret + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: div.un + IL_0010: conv.i8 + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldarg.0 + IL_001a: stloc.2 + IL_001b: br.s IL_002c + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(int32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001d + + IL_0030: ret } .method public static void f8(int32 step) cil managed @@ -356,49 +354,45 @@ IL_0010: nop IL_0011: ldc.i4.0 IL_0012: ldarg.0 - IL_0013: bge.s IL_0024 + IL_0013: bge.s IL_0020 - IL_0015: ldc.i4.s 10 - IL_0017: conv.i8 - IL_0018: ldc.i4.1 + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un IL_0019: conv.i8 - IL_001a: sub - IL_001b: ldarg.0 - IL_001c: conv.i8 - IL_001d: div.un - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: add.ovf.un - IL_0021: nop - IL_0022: br.s IL_0027 - + IL_001a: ldc.i4.1 + IL_001b: conv.i8 + IL_001c: add + IL_001d: nop + IL_001e: br.s IL_0023 + + IL_0020: ldc.i4.0 + IL_0021: conv.i8 + IL_0022: nop + IL_0023: stloc.0 IL_0024: ldc.i4.0 IL_0025: conv.i8 - IL_0026: nop - IL_0027: stloc.0 - IL_0028: ldc.i4.0 - IL_0029: conv.i8 - IL_002a: stloc.1 - IL_002b: ldc.i4.1 - IL_002c: stloc.2 - IL_002d: br.s IL_003e - - IL_002f: ldloc.2 - IL_0030: call void assembly::set_c(int32) - IL_0035: ldloc.2 - IL_0036: ldarg.0 - IL_0037: add - IL_0038: stloc.2 - IL_0039: ldloc.1 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 - IL_003c: add - IL_003d: stloc.1 - IL_003e: ldloc.1 - IL_003f: ldloc.0 - IL_0040: blt.un.s IL_002f - - IL_0042: ret + IL_0026: stloc.1 + IL_0027: ldc.i4.1 + IL_0028: stloc.2 + IL_0029: br.s IL_003a + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(int32) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldloc.0 + IL_003c: blt.un.s IL_002b + + IL_003e: ret } .method public static void f9(int32 finish) cil managed @@ -415,44 +409,42 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0015 + IL_0007: br.s IL_0013 IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldc.i4.1 - IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.2 - IL_000f: conv.i8 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: stloc.1 - IL_0019: ldc.i4.1 - IL_001a: stloc.2 - IL_001b: br.s IL_002c - - IL_001d: ldloc.2 - IL_001e: call void assembly::set_c(int32) - IL_0023: ldloc.2 - IL_0024: ldc.i4.2 - IL_0025: add - IL_0026: stloc.2 - IL_0027: ldloc.1 - IL_0028: ldc.i4.1 - IL_0029: conv.i8 - IL_002a: add - IL_002b: stloc.1 - IL_002c: ldloc.1 - IL_002d: ldloc.0 - IL_002e: blt.un.s IL_001d - - IL_0030: ret + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: ldc.i4.2 + IL_000d: div.un + IL_000e: conv.i8 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.1 + IL_0017: ldc.i4.1 + IL_0018: stloc.2 + IL_0019: br.s IL_002a + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(int32) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldloc.0 + IL_002c: blt.un.s IL_001b + + IL_002e: ret } .method public static void f10(!!a start, @@ -482,7 +474,7 @@ IL_000f: nop IL_0010: ldc.i4.0 IL_0011: ldarg.1 - IL_0012: bge.s IL_002b + IL_0012: bge.s IL_0029 IL_0014: ldarg.2 IL_0015: ldarg.2 @@ -491,72 +483,66 @@ IL_0018: ldc.i4.0 IL_0019: conv.i8 IL_001a: nop - IL_001b: br.s IL_0045 + IL_001b: br.s IL_003f IL_001d: ldarg.2 - IL_001e: conv.i8 - IL_001f: ldarg.2 - IL_0020: conv.i8 - IL_0021: sub - IL_0022: ldarg.1 - IL_0023: conv.i8 - IL_0024: div.un - IL_0025: ldc.i4.1 - IL_0026: conv.i8 - IL_0027: add.ovf.un - IL_0028: nop - IL_0029: br.s IL_0045 - - IL_002b: ldarg.2 - IL_002c: ldarg.2 - IL_002d: bge.s IL_0034 - - IL_002f: ldc.i4.0 - IL_0030: conv.i8 - IL_0031: nop - IL_0032: br.s IL_0045 - - IL_0034: ldarg.2 - IL_0035: conv.i8 - IL_0036: ldarg.2 - IL_0037: conv.i8 - IL_0038: sub - IL_0039: ldarg.1 - IL_003a: not - IL_003b: conv.i8 - IL_003c: ldc.i4.1 - IL_003d: conv.i8 - IL_003e: add - IL_003f: conv.i8 - IL_0040: div.un - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add.ovf.un - IL_0044: nop - IL_0045: stloc.0 - IL_0046: ldc.i4.0 - IL_0047: conv.i8 - IL_0048: stloc.1 - IL_0049: ldarg.2 - IL_004a: stloc.2 - IL_004b: br.s IL_005c - + IL_001e: ldarg.2 + IL_001f: sub + IL_0020: ldarg.1 + IL_0021: div.un + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: nop + IL_0027: br.s IL_003f + + IL_0029: ldarg.2 + IL_002a: ldarg.2 + IL_002b: bge.s IL_0032 + + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: nop + IL_0030: br.s IL_003f + + IL_0032: ldarg.2 + IL_0033: ldarg.2 + IL_0034: sub + IL_0035: ldarg.1 + IL_0036: not + IL_0037: ldc.i4.1 + IL_0038: add + 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: stloc.0 + IL_0040: ldc.i4.0 + IL_0041: conv.i8 + IL_0042: stloc.1 + IL_0043: ldarg.2 + IL_0044: stloc.2 + IL_0045: br.s IL_0056 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(int32) IL_004d: ldloc.2 - IL_004e: call void assembly::set_c(int32) - IL_0053: ldloc.2 - IL_0054: ldarg.1 - IL_0055: add - IL_0056: stloc.2 - IL_0057: ldloc.1 - IL_0058: ldc.i4.1 - IL_0059: conv.i8 - IL_005a: add - IL_005b: stloc.1 - IL_005c: ldloc.1 - IL_005d: ldloc.0 - IL_005e: blt.un.s IL_004d - - IL_0060: ret + IL_004e: ldarg.1 + IL_004f: add + IL_0050: stloc.2 + IL_0051: ldloc.1 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.1 + IL_0056: ldloc.1 + IL_0057: ldloc.0 + IL_0058: blt.un.s IL_0047 + + IL_005a: ret } .method public static void f11(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl index 14442fe9df0..c58338e5ec4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl @@ -177,43 +177,41 @@ IL_0006: ldc.i4.0 IL_0007: conv.i8 IL_0008: nop - IL_0009: br.s IL_0016 + IL_0009: br.s IL_0014 IL_000b: ldc.i4.s 10 IL_000d: conv.i8 - IL_000e: conv.i8 - IL_000f: ldarg.0 - IL_0010: conv.i8 - IL_0011: sub - IL_0012: ldc.i4.1 - IL_0013: conv.i8 - IL_0014: add.ovf.un - IL_0015: nop - IL_0016: stloc.0 - IL_0017: ldc.i4.0 - IL_0018: conv.i8 - IL_0019: stloc.1 - IL_001a: ldarg.0 - IL_001b: stloc.2 - IL_001c: br.s IL_002e + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add.ovf.un + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldarg.0 + IL_0019: stloc.2 + IL_001a: br.s IL_002c - IL_001e: ldloc.2 - IL_001f: call void assembly::set_c(int64) - IL_0024: ldloc.2 - IL_0025: ldc.i4.1 - IL_0026: conv.i8 - IL_0027: add - IL_0028: stloc.2 - IL_0029: ldloc.1 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: add - IL_002d: stloc.1 - IL_002e: ldloc.1 - IL_002f: ldloc.0 - IL_0030: blt.un.s IL_001e + IL_001c: ldloc.2 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001c - IL_0032: ret + IL_0030: ret } .method public static void f3(int64 finish) cil managed @@ -231,44 +229,42 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0014 + IL_0008: br.s IL_0012 IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: ldc.i4.1 - IL_000d: conv.i8 - IL_000e: conv.i8 - IL_000f: sub - IL_0010: ldc.i4.1 - IL_0011: conv.i8 - IL_0012: add.ovf.un - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: conv.i8 - IL_0017: stloc.1 - IL_0018: ldc.i4.1 - IL_0019: conv.i8 - IL_001a: stloc.2 - IL_001b: br.s IL_002d + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add.ovf.un + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: br.s IL_002b - IL_001d: ldloc.2 - IL_001e: call void assembly::set_c(int64) - IL_0023: ldloc.2 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - 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: ldloc.0 - IL_002f: blt.un.s IL_001d - - IL_0031: ret + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(int64) + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + 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: ldloc.0 + IL_002d: blt.un.s IL_001b + + IL_002f: ret } .method public static void f4(int64 start, @@ -288,101 +284,97 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_000f + IL_0007: br.s IL_000d IL_0009: ldarg.1 - IL_000a: conv.i8 - IL_000b: ldarg.0 - IL_000c: conv.i8 - IL_000d: sub - IL_000e: nop - IL_000f: stloc.0 - IL_0010: ldloc.0 - IL_0011: ldc.i4.m1 - IL_0012: conv.i8 - IL_0013: bne.un.s IL_0042 - - IL_0015: ldc.i4.0 - IL_0016: conv.i8 - IL_0017: stloc.1 - IL_0018: ldarg.0 - IL_0019: stloc.2 - IL_001a: ldloc.2 - IL_001b: call void assembly::set_c(int64) - IL_0020: ldloc.2 - IL_0021: ldc.i4.1 - IL_0022: conv.i8 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.1 - IL_0026: ldc.i4.1 - IL_0027: conv.i8 - IL_0028: add - IL_0029: stloc.1 - IL_002a: br.s IL_003c - - IL_002c: ldloc.2 - IL_002d: call void assembly::set_c(int64) - IL_0032: ldloc.2 - IL_0033: ldc.i4.1 - IL_0034: conv.i8 - IL_0035: add - IL_0036: stloc.2 - IL_0037: ldloc.1 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 - IL_003a: add - IL_003b: stloc.1 - IL_003c: ldloc.1 - IL_003d: ldc.i4.0 - IL_003e: conv.i8 - IL_003f: bgt.un.s IL_002c - - IL_0041: ret - - IL_0042: ldarg.1 - IL_0043: ldarg.0 - IL_0044: bge.s IL_004b - - IL_0046: ldc.i4.0 - IL_0047: conv.i8 - IL_0048: nop - IL_0049: br.s IL_0054 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0040 - IL_004b: ldarg.1 - IL_004c: conv.i8 - IL_004d: ldarg.0 - IL_004e: conv.i8 - IL_004f: sub - IL_0050: ldc.i4.1 - IL_0051: conv.i8 - IL_0052: add.ovf.un - IL_0053: nop - IL_0054: stloc.1 - IL_0055: ldc.i4.0 - IL_0056: conv.i8 - IL_0057: stloc.3 - IL_0058: ldarg.0 - IL_0059: stloc.2 - IL_005a: br.s IL_006c - - IL_005c: ldloc.2 - IL_005d: call void assembly::set_c(int64) - IL_0062: ldloc.2 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: add - IL_0066: stloc.2 - IL_0067: ldloc.3 - IL_0068: ldc.i4.1 - IL_0069: conv.i8 - IL_006a: add - IL_006b: stloc.3 - IL_006c: ldloc.3 - IL_006d: ldloc.1 - IL_006e: blt.un.s IL_005c - - IL_0070: ret + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: br.s IL_003a + + IL_002a: ldloc.2 + IL_002b: call void assembly::set_c(int64) + IL_0030: ldloc.2 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldc.i4.0 + IL_003c: conv.i8 + IL_003d: bgt.un.s IL_002a + + IL_003f: ret + + IL_0040: ldarg.1 + IL_0041: ldarg.0 + IL_0042: bge.s IL_0049 + + IL_0044: ldc.i4.0 + IL_0045: conv.i8 + IL_0046: nop + IL_0047: br.s IL_0050 + + IL_0049: ldarg.1 + IL_004a: ldarg.0 + IL_004b: sub + IL_004c: ldc.i4.1 + IL_004d: conv.i8 + IL_004e: add.ovf.un + IL_004f: nop + IL_0050: stloc.1 + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: stloc.3 + IL_0054: ldarg.0 + IL_0055: stloc.2 + IL_0056: br.s IL_0068 + + IL_0058: ldloc.2 + IL_0059: call void assembly::set_c(int64) + IL_005e: ldloc.2 + IL_005f: ldc.i4.1 + IL_0060: conv.i8 + IL_0061: add + IL_0062: stloc.2 + IL_0063: ldloc.3 + IL_0064: ldc.i4.1 + IL_0065: conv.i8 + IL_0066: add + IL_0067: stloc.3 + IL_0068: ldloc.3 + IL_0069: ldloc.1 + IL_006a: blt.un.s IL_0058 + + IL_006c: ret } .method public static void f5() cil managed @@ -468,47 +460,44 @@ IL_0006: ldc.i4.0 IL_0007: conv.i8 IL_0008: nop - IL_0009: br.s IL_001a + IL_0009: br.s IL_0017 IL_000b: ldc.i4.s 10 IL_000d: conv.i8 - IL_000e: conv.i8 - IL_000f: ldarg.0 - IL_0010: conv.i8 - IL_0011: sub - IL_0012: ldc.i4.2 - IL_0013: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: div.un + IL_0013: ldc.i4.1 IL_0014: conv.i8 - IL_0015: div.un - IL_0016: ldc.i4.1 - IL_0017: conv.i8 - IL_0018: add.ovf.un - IL_0019: nop - IL_001a: stloc.0 - IL_001b: ldc.i4.0 - IL_001c: conv.i8 - IL_001d: stloc.1 - IL_001e: ldarg.0 - IL_001f: stloc.2 - IL_0020: br.s IL_0032 - - IL_0022: ldloc.2 - IL_0023: call void assembly::set_c(int64) - IL_0028: ldloc.2 - IL_0029: ldc.i4.2 - IL_002a: conv.i8 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.1 - IL_002e: ldc.i4.1 - IL_002f: conv.i8 - IL_0030: add - IL_0031: stloc.1 - IL_0032: ldloc.1 - IL_0033: ldloc.0 - IL_0034: blt.un.s IL_0022 - - IL_0036: ret + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002f + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(int64) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.2 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001f + + IL_0033: ret } .method public static void f8(int64 step) cil managed @@ -537,52 +526,46 @@ IL_0013: ldc.i4.0 IL_0014: conv.i8 IL_0015: ldarg.0 - IL_0016: bge.s IL_0029 + IL_0016: bge.s IL_0023 - IL_0018: ldc.i4.s 10 + IL_0018: ldc.i4.s 9 IL_001a: conv.i8 - IL_001b: conv.i8 - IL_001c: ldc.i4.1 - IL_001d: conv.i8 + IL_001b: ldarg.0 + IL_001c: div.un + IL_001d: ldc.i4.1 IL_001e: conv.i8 - IL_001f: sub - IL_0020: ldarg.0 - IL_0021: conv.i8 - IL_0022: div.un - IL_0023: ldc.i4.1 + IL_001f: add.ovf.un + IL_0020: nop + IL_0021: br.s IL_0026 + + IL_0023: ldc.i4.0 IL_0024: conv.i8 - IL_0025: add.ovf.un - IL_0026: nop - IL_0027: br.s IL_002c - - IL_0029: ldc.i4.0 - IL_002a: conv.i8 - IL_002b: nop - IL_002c: stloc.0 - IL_002d: ldc.i4.0 - IL_002e: conv.i8 - IL_002f: stloc.1 - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: stloc.2 - IL_0033: br.s IL_0044 + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.2 + IL_002d: br.s IL_003e + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(int64) IL_0035: ldloc.2 - IL_0036: call void assembly::set_c(int64) - IL_003b: ldloc.2 - IL_003c: ldarg.0 - IL_003d: add - IL_003e: stloc.2 - IL_003f: ldloc.1 - IL_0040: ldc.i4.1 - IL_0041: conv.i8 - IL_0042: add - IL_0043: stloc.1 - IL_0044: ldloc.1 - IL_0045: ldloc.0 - IL_0046: blt.un.s IL_0035 - - IL_0048: ret + IL_0036: ldarg.0 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.1 + IL_003e: ldloc.1 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_002f + + IL_0042: ret } .method public static void f9(int64 finish) cil managed @@ -600,48 +583,45 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0018 + IL_0008: br.s IL_0015 IL_000a: ldarg.0 - IL_000b: conv.i8 - IL_000c: ldc.i4.1 - IL_000d: conv.i8 - IL_000e: conv.i8 - IL_000f: sub - IL_0010: ldc.i4.2 - IL_0011: conv.i8 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: div.un + IL_0011: ldc.i4.1 IL_0012: conv.i8 - IL_0013: div.un - IL_0014: ldc.i4.1 - IL_0015: conv.i8 - IL_0016: add.ovf.un - IL_0017: nop - IL_0018: stloc.0 - IL_0019: ldc.i4.0 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 IL_001a: conv.i8 - IL_001b: stloc.1 - IL_001c: ldc.i4.1 - IL_001d: conv.i8 - IL_001e: stloc.2 - IL_001f: br.s IL_0031 + IL_001b: stloc.2 + IL_001c: br.s IL_002e - IL_0021: ldloc.2 - IL_0022: call void assembly::set_c(int64) - IL_0027: ldloc.2 - IL_0028: ldc.i4.2 - IL_0029: conv.i8 - 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: ldloc.0 - IL_0033: blt.un.s IL_0021 - - IL_0035: ret + IL_001e: ldloc.2 + IL_001f: call void assembly::set_c(int64) + IL_0024: ldloc.2 + IL_0025: ldc.i4.2 + IL_0026: conv.i8 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ldloc.1 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001e + + IL_0032: ret } .method public static void f10(int64 start, @@ -673,7 +653,7 @@ IL_0010: ldc.i4.0 IL_0011: conv.i8 IL_0012: ldarg.1 - IL_0013: bge.s IL_0029 + IL_0013: bge.s IL_0026 IL_0015: ldarg.2 IL_0016: ldarg.2 @@ -682,176 +662,162 @@ IL_0019: ldc.i4.0 IL_001a: conv.i8 IL_001b: nop - IL_001c: br.s IL_0040 + IL_001c: br.s IL_0039 IL_001e: ldarg.2 - IL_001f: conv.i8 - IL_0020: ldarg.2 - IL_0021: conv.i8 - IL_0022: sub - IL_0023: ldarg.1 - IL_0024: conv.i8 - IL_0025: div.un - IL_0026: nop - IL_0027: br.s IL_0040 - - IL_0029: ldarg.2 - IL_002a: ldarg.2 - IL_002b: bge.s IL_0032 - - IL_002d: ldc.i4.0 - IL_002e: conv.i8 - IL_002f: nop - IL_0030: br.s IL_0040 - - IL_0032: ldarg.2 - IL_0033: conv.i8 - IL_0034: ldarg.2 + IL_001f: ldarg.2 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: nop + IL_0024: br.s IL_0039 + + IL_0026: ldarg.2 + IL_0027: ldarg.2 + IL_0028: bge.s IL_002f + + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: nop + IL_002d: br.s IL_0039 + + IL_002f: ldarg.2 + IL_0030: ldarg.2 + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 IL_0035: conv.i8 - IL_0036: sub - IL_0037: ldarg.1 - IL_0038: not - IL_0039: conv.i8 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 - IL_003c: add - IL_003d: conv.i8 - IL_003e: div.un - IL_003f: nop - IL_0040: stloc.0 - IL_0041: ldloc.0 - IL_0042: ldc.i4.m1 - IL_0043: conv.i8 - IL_0044: bne.un.s IL_0071 - - IL_0046: ldc.i4.0 - IL_0047: conv.i8 - IL_0048: stloc.1 - IL_0049: ldarg.2 - IL_004a: stloc.2 - IL_004b: ldloc.2 - IL_004c: call void assembly::set_c(int64) - IL_0051: ldloc.2 - IL_0052: ldarg.1 - IL_0053: add - IL_0054: stloc.2 - IL_0055: ldloc.1 - IL_0056: ldc.i4.1 - IL_0057: conv.i8 - IL_0058: add - IL_0059: stloc.1 - IL_005a: br.s IL_006b - - IL_005c: ldloc.2 - IL_005d: call void assembly::set_c(int64) - IL_0062: ldloc.2 - IL_0063: ldarg.1 - IL_0064: add - IL_0065: stloc.2 - IL_0066: ldloc.1 - IL_0067: ldc.i4.1 - IL_0068: conv.i8 - IL_0069: add - IL_006a: stloc.1 - IL_006b: ldloc.1 - IL_006c: ldc.i4.0 - IL_006d: conv.i8 - IL_006e: bgt.un.s IL_005c - - IL_0070: ret - - IL_0071: ldarg.1 - IL_0072: brtrue.s IL_0080 - - IL_0074: ldarg.2 - IL_0075: ldarg.1 - IL_0076: ldarg.2 - IL_0077: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + IL_0036: add + IL_0037: div.un + IL_0038: nop + IL_0039: stloc.0 + IL_003a: ldloc.0 + IL_003b: ldc.i4.m1 + IL_003c: conv.i8 + IL_003d: bne.un.s IL_006a + + IL_003f: ldc.i4.0 + IL_0040: conv.i8 + IL_0041: stloc.1 + IL_0042: ldarg.2 + IL_0043: stloc.2 + IL_0044: ldloc.2 + IL_0045: call void assembly::set_c(int64) + IL_004a: ldloc.2 + IL_004b: ldarg.1 + IL_004c: add + IL_004d: stloc.2 + IL_004e: ldloc.1 + IL_004f: ldc.i4.1 + IL_0050: conv.i8 + IL_0051: add + IL_0052: stloc.1 + IL_0053: br.s IL_0064 + + IL_0055: ldloc.2 + IL_0056: call void assembly::set_c(int64) + IL_005b: ldloc.2 + IL_005c: ldarg.1 + IL_005d: add + IL_005e: stloc.2 + IL_005f: ldloc.1 + IL_0060: ldc.i4.1 + IL_0061: conv.i8 + IL_0062: add + IL_0063: stloc.1 + IL_0064: ldloc.1 + IL_0065: ldc.i4.0 + IL_0066: conv.i8 + IL_0067: bgt.un.s IL_0055 + + IL_0069: ret + + IL_006a: ldarg.1 + IL_006b: brtrue.s IL_0079 + + IL_006d: ldarg.2 + IL_006e: ldarg.1 + IL_006f: ldarg.2 + IL_0070: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, int64, int64) - IL_007c: pop - IL_007d: nop - IL_007e: br.s IL_0081 - - IL_0080: nop - IL_0081: ldc.i4.0 - IL_0082: conv.i8 - IL_0083: ldarg.1 - IL_0084: bge.s IL_009d - - IL_0086: ldarg.2 - IL_0087: ldarg.2 - IL_0088: bge.s IL_008f - - IL_008a: ldc.i4.0 - IL_008b: conv.i8 - IL_008c: nop - IL_008d: br.s IL_00b7 - - IL_008f: ldarg.2 - IL_0090: conv.i8 - IL_0091: ldarg.2 - IL_0092: conv.i8 - IL_0093: sub - IL_0094: ldarg.1 - IL_0095: conv.i8 - IL_0096: div.un - IL_0097: ldc.i4.1 + IL_0075: pop + IL_0076: nop + IL_0077: br.s IL_007a + + IL_0079: nop + IL_007a: ldc.i4.0 + IL_007b: conv.i8 + IL_007c: ldarg.1 + IL_007d: bge.s IL_0093 + + IL_007f: ldarg.2 + IL_0080: ldarg.2 + IL_0081: bge.s IL_0088 + + IL_0083: ldc.i4.0 + IL_0084: conv.i8 + IL_0085: nop + IL_0086: br.s IL_00a9 + + IL_0088: ldarg.2 + IL_0089: ldarg.2 + IL_008a: sub + IL_008b: ldarg.1 + IL_008c: div.un + IL_008d: ldc.i4.1 + IL_008e: conv.i8 + IL_008f: add.ovf.un + IL_0090: nop + IL_0091: br.s IL_00a9 + + IL_0093: ldarg.2 + IL_0094: ldarg.2 + IL_0095: bge.s IL_009c + + IL_0097: ldc.i4.0 IL_0098: conv.i8 - IL_0099: add.ovf.un - IL_009a: nop - IL_009b: br.s IL_00b7 + IL_0099: nop + IL_009a: br.s IL_00a9 + IL_009c: ldarg.2 IL_009d: ldarg.2 - IL_009e: ldarg.2 - IL_009f: bge.s IL_00a6 - - IL_00a1: ldc.i4.0 + IL_009e: sub + IL_009f: ldarg.1 + IL_00a0: not + IL_00a1: ldc.i4.1 IL_00a2: conv.i8 - IL_00a3: nop - IL_00a4: br.s IL_00b7 - - IL_00a6: ldarg.2 - IL_00a7: conv.i8 - IL_00a8: ldarg.2 - IL_00a9: conv.i8 - IL_00aa: sub - IL_00ab: ldarg.1 - IL_00ac: not - IL_00ad: conv.i8 - IL_00ae: ldc.i4.1 - IL_00af: conv.i8 - IL_00b0: add - IL_00b1: conv.i8 - IL_00b2: div.un - IL_00b3: ldc.i4.1 - IL_00b4: conv.i8 - IL_00b5: add.ovf.un - IL_00b6: nop - IL_00b7: stloc.1 - IL_00b8: ldc.i4.0 - IL_00b9: conv.i8 - IL_00ba: stloc.3 - IL_00bb: ldarg.2 - IL_00bc: stloc.2 - IL_00bd: br.s IL_00ce - - IL_00bf: ldloc.2 - IL_00c0: call void assembly::set_c(int64) - IL_00c5: ldloc.2 - IL_00c6: ldarg.1 - IL_00c7: add - IL_00c8: stloc.2 - IL_00c9: ldloc.3 - IL_00ca: ldc.i4.1 - IL_00cb: conv.i8 - IL_00cc: add - IL_00cd: stloc.3 - IL_00ce: ldloc.3 - IL_00cf: ldloc.1 - IL_00d0: blt.un.s IL_00bf - - IL_00d2: ret + IL_00a3: add + IL_00a4: div.un + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add.ovf.un + IL_00a8: nop + IL_00a9: stloc.1 + IL_00aa: ldc.i4.0 + IL_00ab: conv.i8 + IL_00ac: stloc.3 + IL_00ad: ldarg.2 + IL_00ae: stloc.2 + IL_00af: br.s IL_00c0 + + IL_00b1: ldloc.2 + IL_00b2: call void assembly::set_c(int64) + IL_00b7: ldloc.2 + IL_00b8: ldarg.1 + IL_00b9: add + IL_00ba: stloc.2 + IL_00bb: ldloc.3 + IL_00bc: ldc.i4.1 + IL_00bd: conv.i8 + IL_00be: add + IL_00bf: stloc.3 + IL_00c0: ldloc.3 + IL_00c1: ldloc.1 + IL_00c2: blt.un.s IL_00b1 + + IL_00c4: ret } .method public static void f11(int64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl index 8786b4a004b..df59be1787d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl @@ -160,38 +160,37 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldc.i4.s 10 - IL_000b: conv.i2 - IL_000c: ldarg.0 + IL_000b: ldarg.0 + IL_000c: sub IL_000d: conv.i2 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldarg.0 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 - - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(int8) - IL_001f: ldloc.2 - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int8) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 - IL_002b: ret + IL_002a: ret } .method public static void f3y(int8 finish) cil managed @@ -207,38 +206,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.0 - IL_0009: conv.i2 - IL_000a: ldc.i4.1 + IL_0009: ldc.i4.1 + IL_000a: sub IL_000b: conv.i2 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldc.i4.1 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(int8) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 - IL_0029: ret + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f4y(int8 start, @@ -256,38 +254,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.1 - IL_0009: conv.i2 - IL_000a: ldarg.0 + IL_0009: ldarg.0 + IL_000a: sub IL_000b: conv.i2 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(int8) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 - IL_0029: ret + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f5() cil managed @@ -361,40 +358,39 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0014 + IL_0007: br.s IL_0013 IL_0009: ldc.i4.s 10 - IL_000b: conv.i2 - IL_000c: ldarg.0 - IL_000d: conv.i2 - IL_000e: sub - IL_000f: ldc.i4.2 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: ldarg.0 - IL_0018: stloc.2 - IL_0019: br.s IL_0029 - - IL_001b: ldloc.2 - IL_001c: call void assembly::set_c(int8) - IL_0021: ldloc.2 - IL_0022: ldc.i4.2 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.1 - IL_0026: ldc.i4.1 - IL_0027: add - IL_0028: stloc.1 - IL_0029: ldloc.1 - IL_002a: ldloc.0 - IL_002b: blt.un.s IL_001b - - IL_002d: ret + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.i2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int8) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret } .method public static void f8y(int8 step) cil managed @@ -420,44 +416,41 @@ IL_0010: nop IL_0011: ldc.i4.0 IL_0012: ldarg.0 - IL_0013: bge.s IL_0022 + IL_0013: bge.s IL_001f - IL_0015: ldc.i4.s 10 - IL_0017: conv.i2 - IL_0018: ldc.i4.1 + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un IL_0019: conv.i2 - IL_001a: sub - IL_001b: ldarg.0 - IL_001c: div.un - IL_001d: ldc.i4.1 - IL_001e: add - IL_001f: nop - IL_0020: br.s IL_0024 - + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: ldc.i4.0 + IL_0020: nop + IL_0021: stloc.0 IL_0022: ldc.i4.0 - IL_0023: nop - IL_0024: stloc.0 - IL_0025: ldc.i4.0 - IL_0026: stloc.1 - IL_0027: ldc.i4.1 - IL_0028: stloc.2 - IL_0029: br.s IL_0039 - - IL_002b: ldloc.2 - IL_002c: call void assembly::set_c(int8) - IL_0031: ldloc.2 - IL_0032: ldarg.0 - IL_0033: add - IL_0034: stloc.2 - IL_0035: ldloc.1 - IL_0036: ldc.i4.1 - IL_0037: add - IL_0038: stloc.1 - IL_0039: ldloc.1 - IL_003a: ldloc.0 - IL_003b: blt.un.s IL_002b - - IL_003d: ret + IL_0023: stloc.1 + IL_0024: ldc.i4.1 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(int8) + IL_002e: ldloc.2 + IL_002f: ldarg.0 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret } .method public static void f9y(int8 finish) cil managed @@ -473,40 +466,39 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0012 + IL_0006: br.s IL_0011 IL_0008: ldarg.0 - IL_0009: conv.i2 - IL_000a: ldc.i4.1 - IL_000b: conv.i2 - IL_000c: sub - IL_000d: ldc.i4.2 - IL_000e: div.un - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldc.i4.1 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 - - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(int8) - IL_001f: ldloc.2 - IL_0020: ldc.i4.2 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + IL_000d: conv.i2 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.1 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int8) + IL_001e: ldloc.2 + IL_001f: ldc.i4.2 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 - IL_002b: ret + IL_002a: ret } .method public static void f10y(int8 start, @@ -536,7 +528,7 @@ IL_000f: nop IL_0010: ldc.i4.0 IL_0011: ldarg.1 - IL_0012: bge.s IL_0028 + IL_0012: bge.s IL_0027 IL_0014: ldarg.2 IL_0015: ldarg.2 @@ -544,64 +536,61 @@ IL_0018: ldc.i4.0 IL_0019: nop - IL_001a: br.s IL_003e + IL_001a: br.s IL_003b IL_001c: ldarg.2 - IL_001d: conv.i2 - IL_001e: ldarg.2 - IL_001f: conv.i2 - IL_0020: sub - IL_0021: ldarg.1 - IL_0022: div.un - IL_0023: ldc.i4.1 - IL_0024: add - IL_0025: nop - IL_0026: br.s IL_003e + IL_001d: ldarg.2 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: div.un + IL_0021: conv.i2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: nop + IL_0025: br.s IL_003b + IL_0027: ldarg.2 IL_0028: ldarg.2 - IL_0029: ldarg.2 - IL_002a: bge.s IL_0030 + IL_0029: bge.s IL_002f - IL_002c: ldc.i4.0 - IL_002d: nop - IL_002e: br.s IL_003e + IL_002b: ldc.i4.0 + IL_002c: nop + IL_002d: br.s IL_003b + IL_002f: ldarg.2 IL_0030: ldarg.2 - IL_0031: conv.i2 - IL_0032: ldarg.2 - IL_0033: conv.i2 - IL_0034: sub - IL_0035: ldarg.1 - IL_0036: not + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: div.un IL_0037: conv.i2 IL_0038: ldc.i4.1 IL_0039: add - IL_003a: div.un - IL_003b: ldc.i4.1 - IL_003c: add - IL_003d: nop - IL_003e: stloc.0 - IL_003f: ldc.i4.0 - IL_0040: stloc.1 - IL_0041: ldarg.2 - IL_0042: stloc.2 - IL_0043: br.s IL_0053 - - IL_0045: ldloc.2 - IL_0046: call void assembly::set_c(int8) - IL_004b: ldloc.2 - IL_004c: ldarg.1 - IL_004d: add - IL_004e: stloc.2 - IL_004f: ldloc.1 - IL_0050: ldc.i4.1 - IL_0051: add - IL_0052: stloc.1 - IL_0053: ldloc.1 - IL_0054: ldloc.0 - IL_0055: blt.un.s IL_0045 - - IL_0057: ret + IL_003a: nop + IL_003b: stloc.0 + IL_003c: ldc.i4.0 + IL_003d: stloc.1 + IL_003e: ldarg.2 + IL_003f: stloc.2 + IL_0040: br.s IL_0050 + + IL_0042: ldloc.2 + IL_0043: call void assembly::set_c(int8) + IL_0048: ldloc.2 + IL_0049: ldarg.1 + IL_004a: add + IL_004b: stloc.2 + IL_004c: ldloc.1 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.1 + IL_0050: ldloc.1 + IL_0051: ldloc.0 + IL_0052: blt.un.s IL_0042 + + IL_0054: ret } .method public static void f11y(int8 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl index bdd7dc919cd..5f37d40ef41 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl @@ -160,38 +160,37 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldc.i4.s 10 - IL_000b: conv.i4 - IL_000c: ldarg.0 - IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldarg.0 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 - - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(uint16) - IL_001f: ldloc.2 - IL_0020: ldc.i4.1 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 - - IL_002b: ret + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.u4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint16) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret } .method public static void f3(uint16 finish) cil managed @@ -207,38 +206,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldc.i4.1 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldc.i4.1 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(uint16) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 - - IL_0029: ret + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f4(uint16 start, @@ -256,38 +254,37 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0010 + IL_0006: br.s IL_000f IL_0008: ldarg.1 - IL_0009: conv.i4 - IL_000a: ldarg.0 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.1 - IL_000e: add - IL_000f: nop - IL_0010: stloc.0 - IL_0011: ldc.i4.0 - IL_0012: stloc.1 - IL_0013: ldarg.0 - IL_0014: stloc.2 - IL_0015: br.s IL_0025 - - IL_0017: ldloc.2 - IL_0018: call void assembly::set_c(uint16) - IL_001d: ldloc.2 - IL_001e: ldc.i4.1 - IL_001f: add - IL_0020: stloc.2 - IL_0021: ldloc.1 - IL_0022: ldc.i4.1 - IL_0023: add - IL_0024: stloc.1 - IL_0025: ldloc.1 - IL_0026: ldloc.0 - IL_0027: blt.un.s IL_0017 - - IL_0029: ret + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret } .method public static void f5() cil managed @@ -361,40 +358,39 @@ IL_0005: ldc.i4.0 IL_0006: nop - IL_0007: br.s IL_0014 + IL_0007: br.s IL_0013 IL_0009: ldc.i4.s 10 - IL_000b: conv.i4 - IL_000c: ldarg.0 - IL_000d: conv.i4 - IL_000e: sub - IL_000f: ldc.i4.2 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: ldarg.0 - IL_0018: stloc.2 - IL_0019: br.s IL_0029 - - IL_001b: ldloc.2 - IL_001c: call void assembly::set_c(uint16) - IL_0021: ldloc.2 - IL_0022: ldc.i4.2 - IL_0023: add - IL_0024: stloc.2 - IL_0025: ldloc.1 - IL_0026: ldc.i4.1 - IL_0027: add - IL_0028: stloc.1 - IL_0029: ldloc.1 - IL_002a: ldloc.0 - IL_002b: blt.un.s IL_001b - - IL_002d: ret + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint16) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret } .method public static void f8(uint16 step) cil managed @@ -418,37 +414,34 @@ IL_000e: br.s IL_0011 IL_0010: nop - IL_0011: ldc.i4.s 10 - IL_0013: conv.i4 - IL_0014: ldc.i4.1 - IL_0015: conv.i4 - IL_0016: sub - IL_0017: ldarg.0 - IL_0018: div.un - IL_0019: ldc.i4.1 - IL_001a: add - IL_001b: stloc.0 - IL_001c: ldc.i4.0 - IL_001d: stloc.1 - IL_001e: ldc.i4.1 - IL_001f: stloc.2 - IL_0020: br.s IL_0030 + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u4 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: stloc.1 + IL_001b: ldc.i4.1 + IL_001c: stloc.2 + IL_001d: br.s IL_002d - IL_0022: ldloc.2 - IL_0023: call void assembly::set_c(uint16) - IL_0028: ldloc.2 - IL_0029: ldarg.0 - IL_002a: add - IL_002b: stloc.2 - IL_002c: ldloc.1 - IL_002d: ldc.i4.1 - IL_002e: add - IL_002f: stloc.1 - IL_0030: ldloc.1 - IL_0031: ldloc.0 - IL_0032: blt.un.s IL_0022 - - IL_0034: ret + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint16) + IL_0025: ldloc.2 + IL_0026: ldarg.0 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001f + + IL_0031: ret } .method public static void f9(uint16 finish) cil managed @@ -464,40 +457,39 @@ IL_0004: ldc.i4.0 IL_0005: nop - IL_0006: br.s IL_0012 + IL_0006: br.s IL_0011 IL_0008: ldarg.0 - IL_0009: conv.i4 - IL_000a: ldc.i4.1 - IL_000b: conv.i4 - IL_000c: sub - IL_000d: ldc.i4.2 - IL_000e: div.un - IL_000f: ldc.i4.1 - IL_0010: add - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: stloc.1 - IL_0015: ldc.i4.1 - IL_0016: stloc.2 - IL_0017: br.s IL_0027 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + IL_000d: conv.u4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.1 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 - IL_0019: ldloc.2 - IL_001a: call void assembly::set_c(uint16) - IL_001f: ldloc.2 - IL_0020: ldc.i4.2 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.1 - IL_0027: ldloc.1 - IL_0028: ldloc.0 - IL_0029: blt.un.s IL_0019 - - IL_002b: ret + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint16) + IL_001e: ldloc.2 + IL_001f: ldc.i4.2 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret } .method public static void f10(uint16 start, @@ -531,40 +523,39 @@ IL_0014: ldc.i4.0 IL_0015: nop - IL_0016: br.s IL_0022 + IL_0016: br.s IL_0021 IL_0018: ldarg.2 - IL_0019: conv.i4 - IL_001a: ldarg.2 - IL_001b: conv.i4 - IL_001c: sub - IL_001d: ldarg.1 - IL_001e: div.un - IL_001f: ldc.i4.1 - IL_0020: add - IL_0021: nop - IL_0022: stloc.0 - IL_0023: ldc.i4.0 - IL_0024: stloc.1 - IL_0025: ldarg.2 - IL_0026: stloc.2 - IL_0027: br.s IL_0037 - - IL_0029: ldloc.2 - IL_002a: call void assembly::set_c(uint16) - IL_002f: ldloc.2 - IL_0030: ldarg.1 - IL_0031: add - IL_0032: stloc.2 - IL_0033: ldloc.1 - IL_0034: ldc.i4.1 - IL_0035: add - IL_0036: stloc.1 - IL_0037: ldloc.1 - IL_0038: ldloc.0 - IL_0039: blt.un.s IL_0029 - - IL_003b: ret + IL_0019: ldarg.2 + IL_001a: sub + IL_001b: ldarg.1 + IL_001c: div.un + IL_001d: conv.u4 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldarg.2 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(uint16) + IL_002e: ldloc.2 + IL_002f: ldarg.1 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret } .method public static void f11(uint16 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl index 5518b7b3d89..628b30311ba 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl @@ -164,41 +164,40 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0014 + IL_0008: br.s IL_0013 IL_000a: ldc.i4.s 10 - IL_000c: conv.i8 - IL_000d: ldarg.0 - IL_000e: conv.i8 - IL_000f: sub - IL_0010: ldc.i4.1 - IL_0011: conv.i8 - IL_0012: add.ovf.un - IL_0013: nop - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: conv.i8 - IL_0017: stloc.1 - IL_0018: ldarg.0 - IL_0019: stloc.2 - IL_001a: br.s IL_002b - - IL_001c: ldloc.2 - IL_001d: call void assembly::set_c(uint32) - 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: ldloc.0 - IL_002d: blt.un.s IL_001c + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: conv.u8 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.1 + IL_0017: ldarg.0 + IL_0018: stloc.2 + IL_0019: br.s IL_002a + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(uint32) + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldloc.0 + IL_002c: blt.un.s IL_001b - IL_002f: ret + IL_002e: ret } .method public static void f3(uint32 finish) cil managed @@ -215,41 +214,40 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldc.i4.1 - IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.1 - IL_000f: conv.i8 - IL_0010: add.ovf.un - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldc.i4.1 - IL_0017: stloc.2 - IL_0018: br.s IL_0029 - - IL_001a: ldloc.2 - IL_001b: call void assembly::set_c(uint32) - 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: ldloc.0 - IL_002b: blt.un.s IL_001a - - IL_002d: ret + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: conv.u8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldc.i4.1 + IL_0016: stloc.2 + IL_0017: br.s IL_0028 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint32) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0019 + + IL_002c: ret } .method public static void f4(uint32 start, @@ -268,41 +266,40 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldarg.1 - IL_000a: conv.i8 - IL_000b: ldarg.0 - IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.1 - IL_000f: conv.i8 - IL_0010: add.ovf.un - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0029 - - IL_001a: ldloc.2 - IL_001b: call void assembly::set_c(uint32) - 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: ldloc.0 - IL_002b: blt.un.s IL_001a - - IL_002d: ret + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: conv.u8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0028 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint32) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0019 + + IL_002c: ret } .method public static void f5() cil managed @@ -383,44 +380,42 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0017 + IL_0008: br.s IL_0015 IL_000a: ldc.i4.s 10 - IL_000c: conv.i8 - IL_000d: ldarg.0 - IL_000e: conv.i8 - IL_000f: sub - IL_0010: ldc.i4.2 - IL_0011: conv.i8 - IL_0012: div.un - IL_0013: ldc.i4.1 - IL_0014: conv.i8 - IL_0015: add.ovf.un - IL_0016: nop - IL_0017: stloc.0 - IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: stloc.1 - IL_001b: ldarg.0 - IL_001c: stloc.2 - IL_001d: br.s IL_002e + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: div.un + IL_0010: conv.u8 + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldarg.0 + IL_001a: stloc.2 + IL_001b: br.s IL_002c - IL_001f: ldloc.2 - IL_0020: call void assembly::set_c(uint32) - IL_0025: ldloc.2 - IL_0026: ldc.i4.2 - IL_0027: add - IL_0028: stloc.2 - IL_0029: ldloc.1 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: add - IL_002d: stloc.1 - IL_002e: ldloc.1 - IL_002f: ldloc.0 - IL_0030: blt.un.s IL_001f - - IL_0032: ret + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(uint32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001d + + IL_0030: ret } .method public static void f8(uint32 step) cil managed @@ -444,41 +439,37 @@ IL_000e: br.s IL_0011 IL_0010: nop - IL_0011: ldc.i4.s 10 - IL_0013: conv.i8 - IL_0014: ldc.i4.1 - IL_0015: conv.i8 - IL_0016: sub - IL_0017: ldarg.0 - IL_0018: conv.i8 - IL_0019: div.un - IL_001a: ldc.i4.1 + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u8 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4.0 IL_001b: conv.i8 - IL_001c: add.ovf.un - IL_001d: stloc.0 - IL_001e: ldc.i4.0 - IL_001f: conv.i8 - IL_0020: stloc.1 - IL_0021: ldc.i4.1 - IL_0022: stloc.2 - IL_0023: br.s IL_0034 - - IL_0025: ldloc.2 - IL_0026: call void assembly::set_c(uint32) - IL_002b: ldloc.2 - IL_002c: ldarg.0 - IL_002d: add - IL_002e: stloc.2 - IL_002f: ldloc.1 - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add - IL_0033: stloc.1 - IL_0034: ldloc.1 - IL_0035: ldloc.0 - IL_0036: blt.un.s IL_0025 - - IL_0038: ret + IL_001c: stloc.1 + IL_001d: ldc.i4.1 + IL_001e: stloc.2 + IL_001f: br.s IL_0030 + + IL_0021: ldloc.2 + IL_0022: call void assembly::set_c(uint32) + IL_0027: ldloc.2 + IL_0028: ldarg.0 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.1 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.1 + IL_0030: ldloc.1 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_0021 + + IL_0034: ret } .method public static void f9(uint32 finish) cil managed @@ -495,44 +486,42 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0015 + IL_0007: br.s IL_0013 IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldc.i4.1 - IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.2 - IL_000f: conv.i8 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: stloc.1 - IL_0019: ldc.i4.1 - IL_001a: stloc.2 - IL_001b: br.s IL_002c - - IL_001d: ldloc.2 - IL_001e: call void assembly::set_c(uint32) - IL_0023: ldloc.2 - IL_0024: ldc.i4.2 - IL_0025: add - IL_0026: stloc.2 - IL_0027: ldloc.1 - IL_0028: ldc.i4.1 - IL_0029: conv.i8 - IL_002a: add - IL_002b: stloc.1 - IL_002c: ldloc.1 - IL_002d: ldloc.0 - IL_002e: blt.un.s IL_001d + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: ldc.i4.2 + IL_000d: div.un + IL_000e: conv.u8 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.1 + IL_0017: ldc.i4.1 + IL_0018: stloc.2 + IL_0019: br.s IL_002a + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(uint32) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldloc.0 + IL_002c: blt.un.s IL_001b - IL_0030: ret + IL_002e: ret } .method public static void f10(uint32 start, @@ -567,44 +556,42 @@ IL_0014: ldc.i4.0 IL_0015: conv.i8 IL_0016: nop - IL_0017: br.s IL_0025 + IL_0017: br.s IL_0023 IL_0019: ldarg.2 - IL_001a: conv.i8 - IL_001b: ldarg.2 - IL_001c: conv.i8 - IL_001d: sub - IL_001e: ldarg.1 - IL_001f: conv.i8 - IL_0020: div.un - IL_0021: ldc.i4.1 - IL_0022: conv.i8 - IL_0023: add.ovf.un - IL_0024: nop - IL_0025: stloc.0 - IL_0026: ldc.i4.0 - IL_0027: conv.i8 - IL_0028: stloc.1 - IL_0029: ldarg.2 - IL_002a: stloc.2 - IL_002b: br.s IL_003c - - IL_002d: ldloc.2 - IL_002e: call void assembly::set_c(uint32) - IL_0033: ldloc.2 - IL_0034: ldarg.1 - IL_0035: add - IL_0036: stloc.2 - IL_0037: ldloc.1 - IL_0038: ldc.i4.1 - IL_0039: conv.i8 - IL_003a: add - IL_003b: stloc.1 - IL_003c: ldloc.1 - IL_003d: ldloc.0 - IL_003e: blt.un.s IL_002d - - IL_0040: ret + IL_001a: ldarg.2 + IL_001b: sub + IL_001c: ldarg.1 + IL_001d: div.un + IL_001e: conv.u8 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: add + IL_0022: nop + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: conv.i8 + IL_0026: stloc.1 + IL_0027: ldarg.2 + IL_0028: stloc.2 + IL_0029: br.s IL_003a + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(uint32) + IL_0031: ldloc.2 + IL_0032: ldarg.1 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldloc.0 + IL_003c: blt.un.s IL_002b + + IL_003e: ret } .method public static void f11(uint32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl index 637dfda4b75..1adc5ce3df6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -460,7 +460,7 @@ IL_0006: ldc.i4.0 IL_0007: conv.i8 IL_0008: nop - IL_0009: br.s IL_0018 + IL_0009: br.s IL_0017 IL_000b: ldc.i4.s 10 IL_000d: conv.i8 @@ -468,37 +468,36 @@ IL_000f: sub IL_0010: ldc.i4.2 IL_0011: conv.i8 - IL_0012: conv.i8 - IL_0013: div.un - IL_0014: ldc.i4.1 - IL_0015: conv.i8 - IL_0016: add.ovf.un - IL_0017: nop - IL_0018: stloc.0 - IL_0019: ldc.i4.0 - IL_001a: conv.i8 - IL_001b: stloc.1 - IL_001c: ldarg.0 - IL_001d: stloc.2 - IL_001e: br.s IL_0030 - - IL_0020: ldloc.2 - IL_0021: call void assembly::set_c(uint64) - IL_0026: ldloc.2 - IL_0027: ldc.i4.2 - IL_0028: conv.i8 - IL_0029: add - IL_002a: stloc.2 - IL_002b: ldloc.1 - IL_002c: ldc.i4.1 - IL_002d: conv.i8 - IL_002e: add - IL_002f: stloc.1 - IL_0030: ldloc.1 - IL_0031: ldloc.0 - IL_0032: blt.un.s IL_0020 - - IL_0034: ret + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002f + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint64) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.2 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001f + + IL_0033: ret } .method public static void f8(uint64 step) cil managed @@ -527,36 +526,35 @@ IL_0013: ldc.i4.s 9 IL_0015: conv.i8 IL_0016: ldarg.0 - IL_0017: conv.i8 - IL_0018: div.un - IL_0019: ldc.i4.1 - IL_001a: conv.i8 - IL_001b: add.ovf.un - IL_001c: stloc.0 - IL_001d: ldc.i4.0 - IL_001e: conv.i8 - IL_001f: stloc.1 - IL_0020: ldc.i4.1 - IL_0021: conv.i8 - IL_0022: stloc.2 - IL_0023: br.s IL_0034 - - IL_0025: ldloc.2 - IL_0026: call void assembly::set_c(uint64) - IL_002b: ldloc.2 - IL_002c: ldarg.0 - IL_002d: add - IL_002e: stloc.2 - IL_002f: ldloc.1 - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add - IL_0033: stloc.1 - IL_0034: ldloc.1 - IL_0035: ldloc.0 - IL_0036: blt.un.s IL_0025 + IL_0017: div.un + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: stloc.0 + IL_001c: ldc.i4.0 + IL_001d: conv.i8 + IL_001e: stloc.1 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: stloc.2 + IL_0022: br.s IL_0033 - IL_0038: ret + IL_0024: ldloc.2 + IL_0025: call void assembly::set_c(uint64) + IL_002a: ldloc.2 + IL_002b: ldarg.0 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.1 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.1 + IL_0033: ldloc.1 + IL_0034: ldloc.0 + IL_0035: blt.un.s IL_0024 + + IL_0037: ret } .method public static void f9(uint64 finish) cil managed @@ -574,7 +572,7 @@ IL_0005: ldc.i4.0 IL_0006: conv.i8 IL_0007: nop - IL_0008: br.s IL_0016 + IL_0008: br.s IL_0015 IL_000a: ldarg.0 IL_000b: ldc.i4.1 @@ -582,38 +580,37 @@ IL_000d: sub IL_000e: ldc.i4.2 IL_000f: conv.i8 - IL_0010: conv.i8 - IL_0011: div.un - IL_0012: ldc.i4.1 - IL_0013: conv.i8 - IL_0014: add.ovf.un - IL_0015: nop - IL_0016: stloc.0 - IL_0017: ldc.i4.0 - IL_0018: conv.i8 - IL_0019: stloc.1 - IL_001a: ldc.i4.1 - IL_001b: conv.i8 - IL_001c: stloc.2 - IL_001d: br.s IL_002f - - IL_001f: ldloc.2 - IL_0020: call void assembly::set_c(uint64) - IL_0025: ldloc.2 - IL_0026: ldc.i4.2 - IL_0027: conv.i8 - IL_0028: add - IL_0029: stloc.2 - IL_002a: ldloc.1 - IL_002b: ldc.i4.1 - IL_002c: conv.i8 - IL_002d: add - IL_002e: stloc.1 - IL_002f: ldloc.1 - IL_0030: ldloc.0 - IL_0031: blt.un.s IL_001f + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: stloc.2 + IL_001c: br.s IL_002e - IL_0033: ret + IL_001e: ldloc.2 + IL_001f: call void assembly::set_c(uint64) + IL_0024: ldloc.2 + IL_0025: ldc.i4.2 + IL_0026: conv.i8 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ldloc.1 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001e + + IL_0032: ret } .method public static void f10(uint64 start, @@ -649,114 +646,112 @@ IL_0014: ldc.i4.0 IL_0015: conv.i8 IL_0016: nop - IL_0017: br.s IL_0020 + IL_0017: br.s IL_001f IL_0019: ldarg.2 IL_001a: ldarg.2 IL_001b: sub IL_001c: ldarg.1 - IL_001d: conv.i8 - IL_001e: div.un - IL_001f: nop - IL_0020: stloc.0 - IL_0021: ldloc.0 - IL_0022: ldc.i4.m1 - IL_0023: conv.i8 - IL_0024: bne.un.s IL_0051 - - IL_0026: ldc.i4.0 - IL_0027: conv.i8 - IL_0028: stloc.1 - IL_0029: ldarg.2 - IL_002a: stloc.2 - IL_002b: ldloc.2 - IL_002c: call void assembly::set_c(uint64) - IL_0031: ldloc.2 - IL_0032: ldarg.1 - IL_0033: add - IL_0034: stloc.2 - IL_0035: ldloc.1 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.1 - IL_003a: br.s IL_004b - - IL_003c: ldloc.2 - IL_003d: call void assembly::set_c(uint64) - IL_0042: ldloc.2 - IL_0043: ldarg.1 - IL_0044: add - IL_0045: stloc.2 - IL_0046: ldloc.1 - IL_0047: ldc.i4.1 - IL_0048: conv.i8 - IL_0049: add - IL_004a: stloc.1 - IL_004b: ldloc.1 - IL_004c: ldc.i4.0 - IL_004d: conv.i8 - IL_004e: bgt.un.s IL_003c - - IL_0050: ret - - IL_0051: ldarg.1 - IL_0052: brtrue.s IL_0060 - - IL_0054: ldarg.2 - IL_0055: ldarg.1 - IL_0056: ldarg.2 - IL_0057: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_001d: div.un + IL_001e: nop + IL_001f: stloc.0 + IL_0020: ldloc.0 + IL_0021: ldc.i4.m1 + IL_0022: conv.i8 + IL_0023: bne.un.s IL_0050 + + IL_0025: ldc.i4.0 + IL_0026: conv.i8 + IL_0027: stloc.1 + IL_0028: ldarg.2 + IL_0029: stloc.2 + IL_002a: ldloc.2 + IL_002b: call void assembly::set_c(uint64) + IL_0030: ldloc.2 + IL_0031: ldarg.1 + IL_0032: add + IL_0033: stloc.2 + IL_0034: ldloc.1 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.1 + IL_0039: br.s IL_004a + + IL_003b: ldloc.2 + IL_003c: call void assembly::set_c(uint64) + IL_0041: ldloc.2 + IL_0042: ldarg.1 + IL_0043: add + IL_0044: stloc.2 + IL_0045: ldloc.1 + IL_0046: ldc.i4.1 + IL_0047: conv.i8 + IL_0048: add + IL_0049: stloc.1 + IL_004a: ldloc.1 + IL_004b: ldc.i4.0 + IL_004c: conv.i8 + IL_004d: bgt.un.s IL_003b + + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: brtrue.s IL_005f + + IL_0053: ldarg.2 + IL_0054: ldarg.1 + IL_0055: ldarg.2 + IL_0056: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_005c: pop - IL_005d: nop - IL_005e: br.s IL_0061 + IL_005b: pop + IL_005c: nop + IL_005d: br.s IL_0060 - IL_0060: nop + IL_005f: nop + IL_0060: ldarg.2 IL_0061: ldarg.2 - IL_0062: ldarg.2 - IL_0063: bge.un.s IL_006a + IL_0062: bge.un.s IL_0069 - IL_0065: ldc.i4.0 - IL_0066: conv.i8 - IL_0067: nop - IL_0068: br.s IL_0074 + IL_0064: ldc.i4.0 + IL_0065: conv.i8 + IL_0066: nop + IL_0067: br.s IL_0072 + IL_0069: ldarg.2 IL_006a: ldarg.2 - IL_006b: ldarg.2 - IL_006c: sub - IL_006d: ldarg.1 - IL_006e: conv.i8 - IL_006f: div.un - IL_0070: ldc.i4.1 - IL_0071: conv.i8 - IL_0072: add.ovf.un - IL_0073: nop - IL_0074: stloc.1 - IL_0075: ldc.i4.0 - IL_0076: conv.i8 - IL_0077: stloc.2 - IL_0078: ldarg.2 - IL_0079: stloc.3 - IL_007a: br.s IL_008b - - IL_007c: ldloc.3 - IL_007d: call void assembly::set_c(uint64) - IL_0082: ldloc.3 - IL_0083: ldarg.1 - IL_0084: add - IL_0085: stloc.3 - IL_0086: ldloc.2 - IL_0087: ldc.i4.1 - IL_0088: conv.i8 - IL_0089: add - IL_008a: stloc.2 - IL_008b: ldloc.2 - IL_008c: ldloc.1 - IL_008d: blt.un.s IL_007c - - IL_008f: ret + IL_006b: sub + IL_006c: ldarg.1 + IL_006d: div.un + IL_006e: ldc.i4.1 + IL_006f: conv.i8 + IL_0070: add.ovf.un + IL_0071: nop + IL_0072: stloc.1 + IL_0073: ldc.i4.0 + IL_0074: conv.i8 + IL_0075: stloc.2 + IL_0076: ldarg.2 + IL_0077: stloc.3 + IL_0078: br.s IL_0089 + + IL_007a: ldloc.3 + IL_007b: call void assembly::set_c(uint64) + IL_0080: ldloc.3 + IL_0081: ldarg.1 + IL_0082: add + IL_0083: stloc.3 + IL_0084: ldloc.2 + IL_0085: ldc.i4.1 + IL_0086: conv.i8 + IL_0087: add + IL_0088: stloc.2 + IL_0089: ldloc.2 + IL_008a: ldloc.1 + IL_008b: blt.un.s IL_007a + + IL_008d: ret } .method public static void f11(uint64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl index 00b93f1edd6..f51b28f7d87 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -212,88 +212,87 @@ IL_0051: ldc.i4.0 IL_0052: conv.i8 IL_0053: nop - IL_0054: br.s IL_005f + IL_0054: br.s IL_005e IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 + IL_0057: ldc.i4.0 + IL_0058: sub IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add.ovf.un - IL_005e: nop - IL_005f: stloc.1 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldc.i4.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldc.i4.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 - IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index 00b93f1edd6..f51b28f7d87 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -212,88 +212,87 @@ IL_0051: ldc.i4.0 IL_0052: conv.i8 IL_0053: nop - IL_0054: br.s IL_005f + IL_0054: br.s IL_005e IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 + IL_0057: ldc.i4.0 + IL_0058: sub IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add.ovf.un - IL_005e: nop - IL_005f: stloc.1 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldc.i4.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldc.i4.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 - IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl index 11d0b805ea1..df03b5ff533 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -212,88 +212,87 @@ IL_0051: ldc.i4.0 IL_0052: conv.i8 IL_0053: nop - IL_0054: br.s IL_005f + IL_0054: br.s IL_005e IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 + IL_0057: ldc.i4.0 + IL_0058: sub IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add.ovf.un - IL_005e: nop - IL_005f: stloc.1 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldloc.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.m1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldloc.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.m1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 - IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index 11d0b805ea1..df03b5ff533 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -212,88 +212,87 @@ IL_0051: ldc.i4.0 IL_0052: conv.i8 IL_0053: nop - IL_0054: br.s IL_005f + IL_0054: br.s IL_005e IL_0056: ldloc.0 - IL_0057: conv.i8 - IL_0058: ldc.i4.0 + IL_0057: ldc.i4.0 + IL_0058: sub IL_0059: conv.i8 - IL_005a: sub - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add.ovf.un - IL_005e: nop - IL_005f: stloc.1 - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.3 - IL_0063: ldloc.0 - IL_0064: stloc.s V_4 - IL_0066: br.s IL_007d - - IL_0068: ldloca.s V_2 - IL_006a: ldloc.s V_4 - IL_006c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0071: nop - IL_0072: ldloc.s V_4 - IL_0074: ldc.i4.m1 - IL_0075: add - IL_0076: stloc.s V_4 - IL_0078: ldloc.3 - IL_0079: ldc.i4.1 - IL_007a: conv.i8 - IL_007b: add - IL_007c: stloc.3 - IL_007d: ldloc.3 - IL_007e: ldloc.1 - IL_007f: blt.un.s IL_0068 - - IL_0081: ldloca.s V_2 - IL_0083: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0088: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 - IL_008d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0092: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0097: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 - IL_009c: br.s IL_00e4 - - IL_009e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00a3: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_00a8: stloc.0 - IL_00a9: call int32[] assembly::get_r() - IL_00ae: ldloc.0 - IL_00af: call int32[] assembly::get_r() - IL_00b4: ldloc.0 - IL_00b5: ldelem [runtime]System.Int32 - IL_00ba: call int32[] assembly::get_w() - IL_00bf: ldloc.0 - IL_00c0: ldelem [runtime]System.Int32 - IL_00c5: add - IL_00c6: stelem [runtime]System.Int32 - IL_00cb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00d0: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00d5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00df: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00e9: brtrue.s IL_009e - + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldloc.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.m1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop IL_00eb: nop - IL_00ec: nop - IL_00ed: call int32[] assembly::get_r() - IL_00f2: ldc.i4.0 - IL_00f3: ldelem [runtime]System.Int32 - IL_00f8: ldc.i4.3 - IL_00f9: bne.un.s IL_00ff - - IL_00fb: ldc.i4.0 - IL_00fc: nop - IL_00fd: br.s IL_0101 - - IL_00ff: ldc.i4.1 - IL_0100: nop - IL_0101: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_0106: pop - IL_0107: ret + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl index 77093cd4706..155ad0265cc 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl @@ -431,46 +431,45 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 + IL_000a: ldarg.1 + IL_000b: sub IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.1 - IL_000f: conv.i8 - IL_0010: add.ovf.un - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0035 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldloc.2 - IL_002d: ldc.i4.m1 - IL_002e: add - IL_002f: stloc.2 - IL_0030: ldloc.1 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.1 - IL_0035: ldloc.1 - IL_0036: ldloc.0 - IL_0037: blt.un.s IL_001a + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - IL_0039: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, @@ -489,51 +488,50 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 + IL_000a: ldarg.1 + IL_000b: sub IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.1 - IL_000f: conv.i8 - IL_0010: add.ovf.un - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0045 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldstr "{0}" - IL_0031: ldloc.3 - IL_0032: box [runtime]System.Int32 - IL_0037: call void [runtime]System.Console::WriteLine(string, + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, object) - IL_003c: ldloc.2 - IL_003d: ldc.i4.m1 - IL_003e: add - IL_003f: stloc.2 - IL_0040: ldloc.1 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add - IL_0044: stloc.1 - IL_0045: ldloc.1 - IL_0046: ldloc.0 - IL_0047: blt.un.s IL_001a - - IL_0049: ret + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl index 66d7070e89c..3d78a971d68 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl @@ -432,46 +432,45 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 + IL_000a: ldarg.1 + IL_000b: sub IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.1 - IL_000f: conv.i8 - IL_0010: add.ovf.un - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0035 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldloc.2 - IL_002d: ldc.i4.m1 - IL_002e: add - IL_002f: stloc.2 - IL_0030: ldloc.1 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.1 - IL_0035: ldloc.1 - IL_0036: ldloc.0 - IL_0037: blt.un.s IL_001a + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - IL_0039: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, @@ -490,51 +489,50 @@ IL_0004: ldc.i4.0 IL_0005: conv.i8 IL_0006: nop - IL_0007: br.s IL_0012 + IL_0007: br.s IL_0011 IL_0009: ldarg.0 - IL_000a: conv.i8 - IL_000b: ldarg.1 + IL_000a: ldarg.1 + IL_000b: sub IL_000c: conv.i8 - IL_000d: sub - IL_000e: ldc.i4.1 - IL_000f: conv.i8 - IL_0010: add.ovf.un - IL_0011: nop - IL_0012: stloc.0 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 - IL_0017: stloc.2 - IL_0018: br.s IL_0045 - - IL_001a: ldloc.2 - IL_001b: stloc.3 - IL_001c: ldstr "{0}" - IL_0021: ldloc.3 - IL_0022: box [runtime]System.Int32 - IL_0027: call void [runtime]System.Console::WriteLine(string, + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, object) - IL_002c: ldstr "{0}" - IL_0031: ldloc.3 - IL_0032: box [runtime]System.Int32 - IL_0037: call void [runtime]System.Console::WriteLine(string, + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, object) - IL_003c: ldloc.2 - IL_003d: ldc.i4.m1 - IL_003e: add - IL_003f: stloc.2 - IL_0040: ldloc.1 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add - IL_0044: stloc.1 - IL_0045: ldloc.1 - IL_0046: ldloc.0 - IL_0047: blt.un.s IL_001a - - IL_0049: ret + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, From 3064807d268b9ad5300d44aca6bdd8953eaf3679 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 27 Feb 2024 22:21:47 -0500 Subject: [PATCH 56/66] More sensible * This does not change behavior, but the IL doesn't look as weird. --- src/Compiler/TypedTree/TypedTreeOps.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 224bae7adbf..f59675d83f7 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10510,7 +10510,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = match start, step, finish with // start..0..finish - | _, Expr.Const (value = IntegralConst.Zero), _ -> RangeCount.ConstantZeroStep (mkSequential m (mkCallAndIgnoreRangeExpr start step finish) (mkMinusOne g m)) + | _, Expr.Const (value = IntegralConst.Zero), _ -> RangeCount.ConstantZeroStep (mkSequential m (mkCallAndIgnoreRangeExpr start step finish) (mkTypedZero g m rangeTy)) // 5..1 // 1..-1..5 @@ -10841,7 +10841,8 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count) | RangeCount.ConstantZeroStep count -> - buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count) + mkCompGenLetIn mIn (nameof count) (tyOfExpr g count) count (fun (_, count) -> + buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count)) | RangeCount.Safe count -> mkCompGenLetIn mIn (nameof count) (tyOfExpr g count) count (fun (_, count) -> From 71318dc01fcbe6656b5814f2f53c18e0f4613be3 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 27 Feb 2024 22:22:40 -0500 Subject: [PATCH 57/66] Update baselines --- .../ForEachRangeStepByte.fs.opt.il.bsl | 120 ++++++++------- .../ForEachRangeStepChar.fs.opt.il.bsl | 122 ++++++++------- .../ForEachRangeStepInt16.fs.opt.il.bsl | 120 ++++++++------- .../ForEachRangeStepInt32.fs.opt.il.bsl | 118 ++++++++------- .../ForEachRangeStepInt64.fs.opt.il.bsl | 138 +++++++++-------- .../ForEachRangeStepIntPtr.fs.opt.il.bsl | 142 ++++++++++-------- .../ForEachRangeStepSByte.fs.opt.il.bsl | 120 ++++++++------- .../ForEachRangeStepUInt16.fs.opt.il.bsl | 120 ++++++++------- .../ForEachRangeStepUInt32.fs.opt.il.bsl | 120 ++++++++------- .../ForEachRangeStepUInt64.fs.opt.il.bsl | 138 +++++++++-------- .../ForEachRangeStepUIntPtr.fs.opt.il.bsl | 140 +++++++++-------- 11 files changed, 744 insertions(+), 654 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl index f04ebbda32a..36d2502994c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl @@ -563,73 +563,79 @@ { .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, - uint8 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(uint8) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldarg.0 - IL_0016: ldc.i4.0 - IL_0017: ldarg.1 - IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + .maxstack 5 + .locals init (uint8 V_0, + uint8 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, uint8, uint8) - IL_001d: pop - IL_001e: ldc.i4.m1 - IL_001f: blt.un.s IL_0006 - - IL_0021: ret + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint8) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - uint8 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(uint8) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.s 10 - IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + .maxstack 5 + .locals init (uint8 V_0, + uint8 V_1, + uint8 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, uint8, uint8) - IL_001e: pop - IL_001f: ldc.i4.m1 - IL_0020: blt.un.s IL_0006 + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint8) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 - IL_0022: ret + IL_0024: ret } .property uint8 c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl index 099499cd1e5..bb440972d85 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepChar.fs.opt.il.bsl @@ -731,81 +731,87 @@ { .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 8 - .locals init (int32 V_0, - char V_1) + .maxstack 7 + .locals init (char V_0, + char V_1, + char V_2) IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(char) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldc.i4.0 - IL_0016: ldsfld class assembly/f11@52 assembly/f11@52::@_instance - IL_001b: ldarg.0 - IL_001c: ldc.i4.0 - IL_001d: ldarg.1 - IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + IL_0001: ldsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_0006: ldarg.0 + IL_0007: ldc.i4.0 + IL_0008: ldarg.1 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!1, !!0, !!1) - IL_0023: pop - IL_0024: ldc.i4.m1 - IL_0025: blt.un.s IL_0006 + IL_000e: pop + IL_000f: ldc.i4.0 + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(char) + IL_001d: ldloc.2 + IL_001e: ldc.i4.0 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 - IL_0027: ret + IL_0029: ret } .method public static void f12() cil managed { - .maxstack 8 - .locals init (int32 V_0, - char V_1) + .maxstack 7 + .locals init (char V_0, + char V_1, + char V_2) IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.s 97 - IL_0004: stloc.1 - IL_0005: br.s IL_0015 - - IL_0007: ldloc.1 - IL_0008: call void assembly::set_c(char) - IL_000d: ldloc.1 - IL_000e: ldc.i4.0 - IL_000f: add - IL_0010: stloc.1 - IL_0011: ldloc.0 - IL_0012: ldc.i4.1 - IL_0013: add - IL_0014: stloc.0 - IL_0015: ldloc.0 - IL_0016: ldc.i4.0 - IL_0017: ldsfld class assembly/f12@56 assembly/f12@56::@_instance - IL_001c: ldc.i4.s 97 - IL_001e: ldc.i4.0 - IL_001f: ldc.i4.s 122 - IL_0021: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + IL_0001: ldsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_0006: ldc.i4.s 97 + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.s 122 + IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!1, !!0, !!1) - IL_0026: pop - IL_0027: ldc.i4.m1 - IL_0028: blt.un.s IL_0007 + IL_0010: pop + IL_0011: ldc.i4.0 + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.s 97 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 - IL_002a: ret + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(char) + IL_0020: ldloc.2 + IL_0021: ldc.i4.0 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret } .property char c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl index b2e1bce18e3..fc0c0bd8d53 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl @@ -598,73 +598,79 @@ { .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, - int16 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(int16) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldarg.0 - IL_0016: ldc.i4.0 - IL_0017: ldarg.1 - IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + .maxstack 5 + .locals init (int16 V_0, + int16 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, int16, int16) - IL_001d: pop - IL_001e: ldc.i4.m1 - IL_001f: blt.un.s IL_0006 - - IL_0021: ret + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int16) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - int16 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(int16) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.s 10 - IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + .maxstack 5 + .locals init (int16 V_0, + int16 V_1, + int16 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, int16, int16) - IL_001e: pop - IL_001f: ldc.i4.m1 - IL_0020: blt.un.s IL_0006 + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int16) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 - IL_0022: ret + IL_0024: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl index 56e4ba548ca..e511f90098b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt32.fs.opt.il.bsl @@ -550,73 +550,79 @@ { .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 + .maxstack 5 .locals init (int32 V_0, - int32 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(int32) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldarg.0 - IL_0016: ldc.i4.0 - IL_0017: ldarg.1 - IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32 V_1, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_001d: pop - IL_001e: ldc.i4.m1 - IL_001f: blt.un.s IL_0006 - - IL_0021: ret + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int32) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 6 + .maxstack 5 .locals init (int32 V_0, - int32 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(int32) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.s 10 - IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32 V_1, + int32 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, int32, int32) - IL_001e: pop - IL_001f: ldc.i4.m1 - IL_0020: blt.un.s IL_0006 - - IL_0022: ret + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int32) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl index c58338e5ec4..27ef261d4ee 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl @@ -825,80 +825,92 @@ { .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, - int64 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0015 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(int64) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: conv.i8 - IL_000f: add - IL_0010: stloc.1 - IL_0011: ldloc.0 - IL_0012: ldc.i4.1 - IL_0013: add - IL_0014: stloc.0 - IL_0015: ldloc.0 - IL_0016: ldarg.0 - IL_0017: ldc.i4.0 - IL_0018: conv.i8 - IL_0019: ldarg.1 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + .maxstack 5 + .locals init (int64 V_0, + int64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, int64, int64) - IL_001f: pop - IL_0020: ldc.i4.m1 - IL_0021: blt.un.s IL_0006 - - IL_0023: ret + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldarg.0 + IL_0011: stloc.2 + IL_0012: br.s IL_0024 + + IL_0014: ldloc.2 + IL_0015: call void assembly::set_c(int64) + IL_001a: ldloc.2 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.2 + IL_001f: ldloc.1 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0014 + + IL_0028: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - int64 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 + .maxstack 5 + .locals init (int64 V_0, + int64 V_1, + int64 V_2) + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 IL_0003: conv.i8 - IL_0004: stloc.1 - IL_0005: br.s IL_0016 - - IL_0007: ldloc.1 - IL_0008: call void assembly::set_c(int64) - IL_000d: ldloc.1 - IL_000e: ldc.i4.0 - IL_000f: conv.i8 - IL_0010: add - IL_0011: stloc.1 - IL_0012: ldloc.0 - IL_0013: ldc.i4.1 - IL_0014: add - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: ldc.i4.0 - IL_001a: conv.i8 - IL_001b: ldc.i4.s 10 - IL_001d: conv.i8 - IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, int64, int64) - IL_0023: pop - IL_0024: ldc.i4.m1 - IL_0025: blt.un.s IL_0007 + IL_000c: pop + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: br.s IL_0028 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: conv.i8 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0018 - IL_0027: ret + IL_002c: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl index 4b26ded8726..e453b765e2b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -1165,80 +1165,92 @@ { .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, - native int V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_001d - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(native int) - IL_000c: ldloc.1 - IL_000d: ldc.i8 0x0 - IL_0016: conv.i - IL_0017: add - IL_0018: stloc.1 - IL_0019: ldloc.0 - IL_001a: ldc.i4.1 - IL_001b: add - IL_001c: stloc.0 - IL_001d: ldloc.0 - IL_001e: ldarg.0 - IL_001f: ldc.i8 0x0 - IL_0028: conv.i - IL_0029: ldarg.1 - IL_002a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + .maxstack 5 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, native int, native int) - IL_002f: pop - IL_0030: ldc.i4.m1 - IL_0031: blt.un.s IL_0006 - - IL_0033: ret + IL_0011: pop + IL_0012: ldc.i8 0x0 + IL_001b: conv.i + IL_001c: stloc.0 + IL_001d: ldc.i8 0x0 + IL_0026: conv.i + IL_0027: stloc.1 + IL_0028: ldarg.0 + IL_0029: stloc.2 + IL_002a: br.s IL_004c + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(native int) + IL_0032: ldloc.2 + IL_0033: ldc.i8 0x0 + IL_003c: conv.i + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i8 0x1 + IL_0049: conv.i + IL_004a: add + IL_004b: stloc.1 + IL_004c: ldloc.1 + IL_004d: ldloc.0 + IL_004e: blt.un.s IL_002c + + IL_0050: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - native int V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i8 0x1 - IL_000b: conv.i - IL_000c: stloc.1 - IL_000d: br.s IL_0026 - - IL_000f: ldloc.1 - IL_0010: call void assembly::set_c(native int) - IL_0015: ldloc.1 - IL_0016: ldc.i8 0x0 - IL_001f: conv.i - IL_0020: add - IL_0021: stloc.1 - IL_0022: ldloc.0 - IL_0023: ldc.i4.1 - IL_0024: add - IL_0025: stloc.0 - IL_0026: ldloc.0 - IL_0027: ldc.i8 0x1 - IL_0030: conv.i - IL_0031: ldc.i8 0x0 - IL_003a: conv.i - IL_003b: ldc.i8 0xa - IL_0044: conv.i - IL_0045: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + .maxstack 5 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldc.i8 0x1 + IL_0009: conv.i + IL_000a: ldc.i8 0x0 + IL_0013: conv.i + IL_0014: ldc.i8 0xa + IL_001d: conv.i + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, native int, native int) - IL_004a: pop - IL_004b: ldc.i4.m1 - IL_004c: blt.un.s IL_000f - - IL_004e: ret + IL_0023: pop + IL_0024: ldc.i8 0x0 + IL_002d: conv.i + IL_002e: stloc.0 + IL_002f: ldc.i8 0x0 + IL_0038: conv.i + IL_0039: stloc.1 + IL_003a: ldc.i8 0x1 + IL_0043: conv.i + IL_0044: stloc.2 + IL_0045: br.s IL_0067 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(native int) + IL_004d: ldloc.2 + IL_004e: ldc.i8 0x0 + IL_0057: conv.i + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.1 + IL_005b: ldc.i8 0x1 + IL_0064: conv.i + IL_0065: add + IL_0066: stloc.1 + IL_0067: ldloc.1 + IL_0068: ldloc.0 + IL_0069: blt.un.s IL_0047 + + IL_006b: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl index df59be1787d..381218e2300 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl @@ -598,73 +598,79 @@ { .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, - int8 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(int8) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldarg.0 - IL_0016: ldc.i4.0 - IL_0017: ldarg.1 - IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + .maxstack 5 + .locals init (int8 V_0, + int8 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, int8, int8) - IL_001d: pop - IL_001e: ldc.i4.m1 - IL_001f: blt.un.s IL_0006 - - IL_0021: ret + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int8) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - int8 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(int8) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.s 10 - IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + .maxstack 5 + .locals init (int8 V_0, + int8 V_1, + int8 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, int8, int8) - IL_001e: pop - IL_001f: ldc.i4.m1 - IL_0020: blt.un.s IL_0006 + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int8) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 - IL_0022: ret + IL_0024: ret } .method public static void f13() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl index 5f37d40ef41..2b059e5df41 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt16.fs.opt.il.bsl @@ -563,73 +563,79 @@ { .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, - uint16 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(uint16) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldarg.0 - IL_0016: ldc.i4.0 - IL_0017: ldarg.1 - IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, uint16, uint16) - IL_001d: pop - IL_001e: ldc.i4.m1 - IL_001f: blt.un.s IL_0006 - - IL_0021: ret + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint16) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - uint16 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(uint16) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.s 10 - IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint16 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, uint16, uint16) - IL_001e: pop - IL_001f: ldc.i4.m1 - IL_0020: blt.un.s IL_0006 + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint16) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 - IL_0022: ret + IL_0024: ret } .property uint16 c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl index 628b30311ba..8bf808cab23 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt32.fs.opt.il.bsl @@ -599,73 +599,79 @@ { .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, - uint32 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(uint32) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldarg.0 - IL_0016: ldc.i4.0 - IL_0017: ldarg.1 - IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, uint32, uint32) - IL_001d: pop - IL_001e: ldc.i4.m1 - IL_001f: blt.un.s IL_0006 - - IL_0021: ret + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint32) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - uint32 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: stloc.1 - IL_0004: br.s IL_0014 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(uint32) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: add - IL_000f: stloc.1 - IL_0010: ldloc.0 - IL_0011: ldc.i4.1 - IL_0012: add - IL_0013: stloc.0 - IL_0014: ldloc.0 - IL_0015: ldc.i4.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.s 10 - IL_0019: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint32 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, uint32, uint32) - IL_001e: pop - IL_001f: ldc.i4.m1 - IL_0020: blt.un.s IL_0006 + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint32) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 - IL_0022: ret + IL_0024: ret } .property uint32 c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl index 1adc5ce3df6..adbb809bf26 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -759,80 +759,92 @@ { .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) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_0015 - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(uint64) - IL_000c: ldloc.1 - IL_000d: ldc.i4.0 - IL_000e: conv.i8 - IL_000f: add - IL_0010: stloc.1 - IL_0011: ldloc.0 - IL_0012: ldc.i4.1 - IL_0013: add - IL_0014: stloc.0 - IL_0015: ldloc.0 - IL_0016: ldarg.0 - IL_0017: ldc.i4.0 - IL_0018: conv.i8 - IL_0019: ldarg.1 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_001f: pop - IL_0020: ldc.i4.m1 - IL_0021: blt.un.s IL_0006 - - IL_0023: ret + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldarg.0 + IL_0011: stloc.2 + IL_0012: br.s IL_0024 + + IL_0014: ldloc.2 + IL_0015: call void assembly::set_c(uint64) + IL_001a: ldloc.2 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.2 + IL_001f: ldloc.1 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0014 + + IL_0028: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - uint64 V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 IL_0003: conv.i8 - IL_0004: stloc.1 - IL_0005: br.s IL_0016 - - IL_0007: ldloc.1 - IL_0008: call void assembly::set_c(uint64) - IL_000d: ldloc.1 - IL_000e: ldc.i4.0 - IL_000f: conv.i8 - IL_0010: add - IL_0011: stloc.1 - IL_0012: ldloc.0 - IL_0013: ldc.i4.1 - IL_0014: add - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: ldc.i4.0 - IL_001a: conv.i8 - IL_001b: ldc.i4.s 10 - IL_001d: conv.i8 - IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, uint64, uint64) - IL_0023: pop - IL_0024: ldc.i4.m1 - IL_0025: blt.un.s IL_0007 + IL_000c: pop + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: br.s IL_0028 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: conv.i8 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0018 - IL_0027: ret + IL_002c: ret } .property uint64 c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl index 6141b6212d7..ef87d0f42b8 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -1047,80 +1047,92 @@ { .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, - native uint V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: stloc.1 - IL_0004: br.s IL_001d - - IL_0006: ldloc.1 - IL_0007: call void assembly::set_c(native uint) - IL_000c: ldloc.1 - IL_000d: ldc.i8 0x0 - IL_0016: conv.u - IL_0017: add - IL_0018: stloc.1 - IL_0019: ldloc.0 - IL_001a: ldc.i4.1 - IL_001b: add - IL_001c: stloc.0 - IL_001d: ldloc.0 - IL_001e: ldarg.0 - IL_001f: ldc.i8 0x0 - IL_0028: conv.u - IL_0029: ldarg.1 - IL_002a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + .maxstack 5 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, native uint, native uint) - IL_002f: pop - IL_0030: ldc.i4.m1 - IL_0031: blt.un.s IL_0006 - - IL_0033: ret + IL_0011: pop + IL_0012: ldc.i8 0x0 + IL_001b: conv.u + IL_001c: stloc.0 + IL_001d: ldc.i8 0x0 + IL_0026: conv.u + IL_0027: stloc.1 + IL_0028: ldarg.0 + IL_0029: stloc.2 + IL_002a: br.s IL_004c + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(native uint) + IL_0032: ldloc.2 + IL_0033: ldc.i8 0x0 + IL_003c: conv.u + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i8 0x1 + IL_0049: conv.u + IL_004a: add + IL_004b: stloc.1 + IL_004c: ldloc.1 + IL_004d: ldloc.0 + IL_004e: blt.un.s IL_002c + + IL_0050: ret } .method public static void f12() cil managed { - .maxstack 6 - .locals init (int32 V_0, - native uint V_1) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i8 0x1 - IL_000b: conv.u - IL_000c: stloc.1 - IL_000d: br.s IL_0026 - - IL_000f: ldloc.1 - IL_0010: call void assembly::set_c(native uint) - IL_0015: ldloc.1 - IL_0016: ldc.i8 0x0 - IL_001f: conv.u - IL_0020: add - IL_0021: stloc.1 - IL_0022: ldloc.0 - IL_0023: ldc.i4.1 - IL_0024: add - IL_0025: stloc.0 - IL_0026: ldloc.0 - IL_0027: ldc.i8 0x1 - IL_0030: conv.u - IL_0031: ldc.i8 0x0 - IL_003a: conv.u - IL_003b: ldc.i8 0xa - IL_0044: conv.u - IL_0045: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + .maxstack 5 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldc.i8 0x1 + IL_0009: conv.u + IL_000a: ldc.i8 0x0 + IL_0013: conv.u + IL_0014: ldc.i8 0xa + IL_001d: conv.u + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, native uint, native uint) - IL_004a: pop - IL_004b: ldc.i4.m1 - IL_004c: blt.un.s IL_000f + IL_0023: pop + IL_0024: ldc.i8 0x0 + IL_002d: conv.u + IL_002e: stloc.0 + IL_002f: ldc.i8 0x0 + IL_0038: conv.u + IL_0039: stloc.1 + IL_003a: ldc.i8 0x1 + IL_0043: conv.u + IL_0044: stloc.2 + IL_0045: br.s IL_0067 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(native uint) + IL_004d: ldloc.2 + IL_004e: ldc.i8 0x0 + IL_0057: conv.u + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.1 + IL_005b: ldc.i8 0x1 + IL_0064: conv.u + IL_0065: add + IL_0066: stloc.1 + IL_0067: ldloc.1 + IL_0068: ldloc.0 + IL_0069: blt.un.s IL_0047 - IL_004e: ret + IL_006b: ret } .property native uint c() From 404905f9598f8c0230735a7a6208c1672f2a069b Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 28 Feb 2024 09:17:51 -0500 Subject: [PATCH 58/66] Minor cleanup & clarification --- .../Optimize/LowerComputedCollections.fs | 1 + src/Compiler/TypedTree/TypedTreeOps.fs | 25 ++++++++++--------- .../EmittedIL/ForLoop/ForEachRangeStepByte.fs | 14 +++++------ .../ForEachRangeStepByte.fs.opt.il.bsl | 22 ++++++++-------- .../ForLoop/ForEachRangeStepInt16.fs | 16 ++++++------ .../ForEachRangeStepInt16.fs.opt.il.bsl | 24 +++++++++--------- .../ForLoop/ForEachRangeStepSByte.fs | 16 ++++++------ .../ForEachRangeStepSByte.fs.opt.il.bsl | 24 +++++++++--------- .../TheBigFileOfDebugStepping.fsx | 4 +-- 9 files changed, 74 insertions(+), 72 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index e6a06559ed8..7ceff0a676c 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -291,6 +291,7 @@ module List = module Array = /// Whether to check for overflow when converting a value to a native int. + [] type Ovf = /// Check for overflow. We need this when passing the count into newarr. | CheckOvf diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index f59675d83f7..a9e461903b8 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10307,7 +10307,7 @@ let (|EmptyRange|_|) (start, step, finish) = [] let (|ConstCount|_|) (start, step, finish) = match start, step, finish with - // The count for these ranges is 2⁶⁴ + 1. Let the count calculation raise an overflow exception at runtime. + // The count for these ranges is 2⁶⁴ + 1. We must handle such ranges at runtime. | Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 1L), Expr.Const (value = Const.Int64 Int64.MaxValue) | Expr.Const (value = Const.Int64 Int64.MaxValue), Expr.Const (value = Const.Int64 -1L), Expr.Const (value = Const.Int64 Int64.MinValue) | Expr.Const (value = Const.UInt64 UInt64.MinValue), Expr.Const (value = Const.UInt64 1UL), Expr.Const (value = Const.UInt64 UInt64.MaxValue) @@ -10318,7 +10318,7 @@ let (|ConstCount|_|) (start, step, finish) = // We must special-case a step of Int64.MinValue, since we cannot call abs on it. | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / (uint64 Int64.MaxValue + 1UL) + 1UL)) | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) - | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) when start<= finish -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) when start <= finish -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) @@ -10379,19 +10379,20 @@ type WouldOvf = Expr [] type RangeCount = - /// A count known at compile time. + /// An expression representing a count known at compile time. | Constant of Count - /// A "count" whose step is known to be zero at compile time. + /// An expression representing a "count" whose step is known to be zero at compile time. /// Evaluating this expression at runtime will raise an exception. | ConstantZeroStep of Expr - /// A count that will be computed at runtime but will definitely fit in 64 bits without overflow. + /// An expression to compute a count at runtime that will definitely fit in 64 bits without overflow. | Safe of Count - /// A count that, when one is added to it, might not fit in 64 bits without overflow, - /// in which case evaluating the expression would raise an overflow exception at runtime. - | PossiblyOversize of ((Count -> WouldOvf -> Count) -> Count) + /// A function for building a loop given an expression that may produce a count that + /// would not fit in 64 bits without overflow, and an expression indicating whether + /// evaluating the first expression directly would in fact overflow. + | PossiblyOversize of ((Count -> WouldOvf -> Expr) -> Expr) /// Makes an expression to compute the iteration count for the given integral range. let mkRangeCount g m rangeTy rangeExpr start step finish = @@ -10486,13 +10487,13 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = let underlying = stripMeasuresFromTy g rangeTy if typeEquiv g underlying g.int64_ty || typeEquiv g underlying g.uint64_ty then - RangeCount.PossiblyOversize (fun f -> + RangeCount.PossiblyOversize (fun mkLoopExpr -> mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> let wouldOvf = mkILAsmCeq g m pseudoCount (Expr.Const (Const.UInt64 UInt64.MaxValue, m, g.uint64_ty)) mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> - f count wouldOvf))) + mkLoopExpr count wouldOvf))) elif typeEquiv g underlying g.nativeint_ty || typeEquiv g underlying g.unativeint_ty then // We have a nativeint ty whose size we won't know till runtime. - RangeCount.PossiblyOversize (fun f -> + RangeCount.PossiblyOversize (fun mkLoopExpr -> mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> let wouldOvf = mkCond @@ -10504,7 +10505,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr UInt64.MaxValue, m, g.unativeint_ty))) mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> - f count wouldOvf))) + mkLoopExpr count wouldOvf))) else RangeCount.Safe count diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs index 49cff9ad490..f4e047fb3d5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs @@ -12,15 +12,15 @@ let f1 () = for n in 1uy..10uy do c <- n -let f2uy start = +let f2 start = for n in start..10uy do c <- n -let f3uy finish = +let f3 finish = for n in 1uy..finish do c <- n -let f4uy (start: byte) finish = +let f4 (start: byte) finish = for n in start..finish do c <- n @@ -36,19 +36,19 @@ let f7uy start = for n in start..2uy..10uy do c <- n -let f8uy step = +let f8 step = for n in 1uy..step..10uy do c <- n -let f9uy finish = +let f9 finish = for n in 1uy..2uy..finish do c <- n -let f10uy (start: byte) step finish = +let f10 (start: byte) step finish = for n in finish..step..finish do c <- n -let f11uy start finish = +let f11 start finish = for n in start..0uy..finish do c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl index 36d2502994c..681c6e38186 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepByte.fs.opt.il.bsl @@ -147,7 +147,7 @@ IL_0019: ret } - .method public static void f2uy(uint8 start) cil managed + .method public static void f2(uint8 start) cil managed { .maxstack 4 @@ -193,7 +193,7 @@ IL_002a: ret } - .method public static void f3uy(uint8 finish) cil managed + .method public static void f3(uint8 finish) cil managed { .maxstack 4 @@ -239,8 +239,8 @@ IL_0028: ret } - .method public static void f4uy(uint8 start, - uint8 finish) cil managed + .method public static void f4(uint8 start, + uint8 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 ) @@ -393,7 +393,7 @@ IL_002c: ret } - .method public static void f8uy(uint8 step) cil managed + .method public static void f8(uint8 step) cil managed { .maxstack 5 @@ -444,7 +444,7 @@ IL_0031: ret } - .method public static void f9uy(uint8 finish) cil managed + .method public static void f9(uint8 finish) cil managed { .maxstack 4 @@ -492,9 +492,9 @@ IL_002a: ret } - .method public static void f10uy(uint8 start, - uint8 step, - uint8 finish) cil managed + .method public static void f10(uint8 start, + uint8 step, + uint8 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 ) @@ -558,8 +558,8 @@ IL_003a: ret } - .method public static void f11uy(uint8 start, - uint8 finish) cil managed + .method public static void f11(uint8 start, + uint8 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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs index 2b51677e9f8..f664f0ad2de 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs @@ -12,15 +12,15 @@ let f1 () = for n in 1s..10s do c <- n -let f2s start = +let f2 start = for n in start..10s do c <- n -let f3s finish = +let f3 finish = for n in 1s..finish do c <- n -let f4s (start: int16) finish = +let f4 (start: int16) finish = for n in start..finish do c <- n @@ -32,23 +32,23 @@ let f6 () = for n in 1s..2s..10s do c <- n -let f7s start = +let f7 start = for n in start..2s..10s do c <- n -let f8s step = +let f8 step = for n in 1s..step..10s do c <- n -let f9s finish = +let f9 finish = for n in 1s..2s..finish do c <- n -let f10s (start: int16) step finish = +let f10 (start: int16) step finish = for n in finish..step..finish do c <- n -let f11s start finish = +let f11 start finish = for n in start..0s..finish do c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl index fc0c0bd8d53..79646c5f401 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt16.fs.opt.il.bsl @@ -147,7 +147,7 @@ IL_0019: ret } - .method public static void f2s(int16 start) cil managed + .method public static void f2(int16 start) cil managed { .maxstack 4 @@ -193,7 +193,7 @@ IL_002a: ret } - .method public static void f3s(int16 finish) cil managed + .method public static void f3(int16 finish) cil managed { .maxstack 4 @@ -239,8 +239,8 @@ IL_0028: ret } - .method public static void f4s(int16 start, - int16 finish) cil managed + .method public static void f4(int16 start, + int16 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 ) @@ -345,7 +345,7 @@ IL_0018: ret } - .method public static void f7s(int16 start) cil managed + .method public static void f7(int16 start) cil managed { .maxstack 4 @@ -393,7 +393,7 @@ IL_002c: ret } - .method public static void f8s(int16 step) cil managed + .method public static void f8(int16 step) cil managed { .maxstack 5 @@ -453,7 +453,7 @@ IL_003a: ret } - .method public static void f9s(int16 finish) cil managed + .method public static void f9(int16 finish) cil managed { .maxstack 4 @@ -501,9 +501,9 @@ IL_002a: ret } - .method public static void f10s(int16 start, - int16 step, - int16 finish) cil managed + .method public static void f10(int16 start, + int16 step, + int16 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 ) @@ -593,8 +593,8 @@ IL_0054: ret } - .method public static void f11s(int16 start, - int16 finish) cil managed + .method public static void f11(int16 start, + int16 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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs index e351abab66a..ee96ee45237 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs @@ -12,15 +12,15 @@ let f1 () = for n in 1y..10y do c <- n -let f2y start = +let f2 start = for n in start..10y do c <- n -let f3y finish = +let f3 finish = for n in 1y..finish do c <- n -let f4y (start: sbyte) finish = +let f4 (start: sbyte) finish = for n in start..finish do c <- n @@ -32,23 +32,23 @@ let f6 () = for n in 1y..2y..10y do c <- n -let f7y start = +let f7 start = for n in start..2y..10y do c <- n -let f8y step = +let f8 step = for n in 1y..step..10y do c <- n -let f9y finish = +let f9 finish = for n in 1y..2y..finish do c <- n -let f10y (start: sbyte) step finish = +let f10 (start: sbyte) step finish = for n in finish..step..finish do c <- n -let f11y start finish = +let f11 start finish = for n in start..0y..finish do c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl index 381218e2300..f49d7ac9c52 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepSByte.fs.opt.il.bsl @@ -147,7 +147,7 @@ IL_0019: ret } - .method public static void f2y(int8 start) cil managed + .method public static void f2(int8 start) cil managed { .maxstack 4 @@ -193,7 +193,7 @@ IL_002a: ret } - .method public static void f3y(int8 finish) cil managed + .method public static void f3(int8 finish) cil managed { .maxstack 4 @@ -239,8 +239,8 @@ IL_0028: ret } - .method public static void f4y(int8 start, - int8 finish) cil managed + .method public static void f4(int8 start, + int8 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 ) @@ -345,7 +345,7 @@ IL_0018: ret } - .method public static void f7y(int8 start) cil managed + .method public static void f7(int8 start) cil managed { .maxstack 4 @@ -393,7 +393,7 @@ IL_002c: ret } - .method public static void f8y(int8 step) cil managed + .method public static void f8(int8 step) cil managed { .maxstack 5 @@ -453,7 +453,7 @@ IL_003a: ret } - .method public static void f9y(int8 finish) cil managed + .method public static void f9(int8 finish) cil managed { .maxstack 4 @@ -501,9 +501,9 @@ IL_002a: ret } - .method public static void f10y(int8 start, - int8 step, - int8 finish) cil managed + .method public static void f10(int8 start, + int8 step, + int8 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 ) @@ -593,8 +593,8 @@ IL_0054: ret } - .method public static void f11y(int8 start, - int8 finish) cil managed + .method public static void f11(int8 start, + int8 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 ) diff --git a/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx b/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx index a9ae82e956b..b72489a9358 100644 --- a/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx +++ b/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx @@ -1091,11 +1091,11 @@ module ForLoopRegularCode = printfn $"hello, x = {x}" let testSimpleForEachInt64RangeLoopDownWithOneStatement (start: int64, stop) = - for x in stop .. -1L .. start do + for x in start .. -1L .. stop do printfn $"hello, x = {x}" let testSimpleForEachInt64RangeLoopDownWithTwoStatements (start: int64, stop) = - for x in stop .. -1L .. start do + for x in start .. -1L .. stop do printfn $"hello, x = {x}" printfn $"hello, x = {x}" From d91b092f2b8709fecf1ca67fe5261759ce3223d0 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 28 Feb 2024 09:45:31 -0500 Subject: [PATCH 59/66] Only emit runtime check for zero step once --- src/Compiler/TypedTree/TypedTreeOps.fs | 134 +-- .../UInt64RangeArrays.fs.il.bsl | 1046 ++++++++--------- .../UInt64RangeLists.fs.il.bsl | 642 +++++----- .../ForEachRangeStepInt64.fs.opt.il.bsl | 244 ++-- .../ForEachRangeStepIntPtr.fs.opt.il.bsl | 500 ++++---- .../ForEachRangeStepUInt64.fs.opt.il.bsl | 174 ++- .../ForEachRangeStepUIntPtr.fs.opt.il.bsl | 208 ++-- 7 files changed, 1297 insertions(+), 1651 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index a9e461903b8..72965290a5f 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10483,31 +10483,33 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = else mkAsmExpr ([AI_add], [], [pseudoCount; mkTypedOne g m ty], [ty], m) - let mkRuntimeCalc pseudoCount count = + let mkRuntimeCalc mkThrowIfStepIsZero pseudoCount count = let underlying = stripMeasuresFromTy g rangeTy if typeEquiv g underlying g.int64_ty || typeEquiv g underlying g.uint64_ty then RangeCount.PossiblyOversize (fun mkLoopExpr -> - mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> - let wouldOvf = mkILAsmCeq g m pseudoCount (Expr.Const (Const.UInt64 UInt64.MaxValue, m, g.uint64_ty)) - mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> - mkLoopExpr count wouldOvf))) + mkThrowIfStepIsZero + (mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> + let wouldOvf = mkILAsmCeq g m pseudoCount (Expr.Const (Const.UInt64 UInt64.MaxValue, m, g.uint64_ty)) + mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> + mkLoopExpr count wouldOvf)))) elif typeEquiv g underlying g.nativeint_ty || typeEquiv g underlying g.unativeint_ty then // We have a nativeint ty whose size we won't know till runtime. RangeCount.PossiblyOversize (fun mkLoopExpr -> - mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> - let wouldOvf = - mkCond - DebugPointAtBinding.NoneAtInvisible - m - g.bool_ty - (mkILAsmCeq g m (mkAsmExpr ([I_sizeof g.ilg.typ_IntPtr], [], [], [g.uint32_ty], m)) (Expr.Const (Const.UInt32 4u, m, g.uint32_ty))) - (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr (uint64 UInt32.MaxValue), m, g.unativeint_ty))) - (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr UInt64.MaxValue, m, g.unativeint_ty))) - - mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> - mkLoopExpr count wouldOvf))) + mkThrowIfStepIsZero + (mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> + let wouldOvf = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + g.bool_ty + (mkILAsmCeq g m (mkAsmExpr ([I_sizeof g.ilg.typ_IntPtr], [], [], [g.uint32_ty], m)) (Expr.Const (Const.UInt32 4u, m, g.uint32_ty))) + (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr (uint64 UInt32.MaxValue), m, g.unativeint_ty))) + (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr UInt64.MaxValue, m, g.unativeint_ty))) + + mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> + mkLoopExpr count wouldOvf)))) else - RangeCount.Safe count + RangeCount.Safe (mkThrowIfStepIsZero count) match start, step, finish with // start..0..finish @@ -10543,14 +10545,14 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // The total count could exceed 2⁶⁴. | Expr.Const (value = Const.Int64 Int64.MinValue), _ | _, Expr.Const (value = Const.Int64 Int64.MaxValue) | Expr.Const (value = Const.UInt64 UInt64.MinValue), _ | _, Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> - mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) // The total count could not exceed 2⁶⁴. | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) | Expr.Const (value = Const.UInt64 _), _ | _, Expr.Const (value = Const.UInt64 _) -> RangeCount.Safe (mkCount mkAddOne) - | _ -> mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + | _ -> mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) // (Only possible for signed types.) // @@ -10573,13 +10575,13 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = match start, finish with // The total count could exceed 2⁶⁴. | Expr.Const (value = Const.Int64 Int64.MaxValue), _ | _, Expr.Const (value = Const.Int64 Int64.MinValue) -> - mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) // The total count could not exceed 2⁶⁴. | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) -> RangeCount.Safe (mkCount mkAddOne) - | _ -> mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + | _ -> mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) // start..2..finish // @@ -10636,77 +10638,77 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // exception at runtime if step is zero: // // if step = 0 then ignore ((.. ..) start step finish) - let throwIfStepIsZero = - mkCond - DebugPointAtBinding.NoneAtInvisible - m - g.unit_ty - (mkILAsmCeq g m step (mkTypedZero g m rangeTy)) - (mkCallAndIgnoreRangeExpr start step finish) - (mkUnit g m) + let mkThrowIfStepIsZero count = + let throwIfStepIsZero = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + g.unit_ty + (mkILAsmCeq g m step (mkTypedZero g m rangeTy)) + (mkCallAndIgnoreRangeExpr start step finish) + (mkUnit g m) + + mkSequential m throwIfStepIsZero count let mkCount mkAddOne = - let count = - if isSignedIntegerTy g rangeTy then - let positiveStep = - let count = mkAddOne (mkQuotient (mkDiff finish start) step) - let countTy = tyOfExpr g count - - mkCond - DebugPointAtBinding.NoneAtInvisible - m - countTy - (mkSignednessAppropriateClt rangeTy finish start) - (mkTypedZero g m countTy) - count - - let negativeStep = - let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [rangeTy], m); mkTypedOne g m rangeTy], [rangeTy], m) - let count = mkAddOne (mkQuotient (mkDiff start finish) absStep) - let countTy = tyOfExpr g count - - mkCond - DebugPointAtBinding.NoneAtInvisible - m - countTy - (mkSignednessAppropriateClt rangeTy start finish) - (mkTypedZero g m countTy) - count + if isSignedIntegerTy g rangeTy then + let positiveStep = + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count mkCond DebugPointAtBinding.NoneAtInvisible m - (tyOfExpr g positiveStep) - (mkSignednessAppropriateClt rangeTy (mkTypedZero g m rangeTy) step) - positiveStep - negativeStep - else // Unsigned. - let count = mkAddOne (mkQuotient (mkDiff finish start) step) + countTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m countTy) + count + + let negativeStep = + let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [rangeTy], m); mkTypedOne g m rangeTy], [rangeTy], m) + let count = mkAddOne (mkQuotient (mkDiff start finish) absStep) let countTy = tyOfExpr g count mkCond DebugPointAtBinding.NoneAtInvisible m countTy - (mkSignednessAppropriateClt rangeTy finish start) + (mkSignednessAppropriateClt rangeTy start finish) (mkTypedZero g m countTy) count - mkSequential m throwIfStepIsZero count + mkCond + DebugPointAtBinding.NoneAtInvisible + m + (tyOfExpr g positiveStep) + (mkSignednessAppropriateClt rangeTy (mkTypedZero g m rangeTy) step) + positiveStep + negativeStep + else // Unsigned. + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m countTy) + count match start, finish with // The total count could exceed 2⁶⁴. | Expr.Const (value = Const.Int64 Int64.MinValue), _ | _, Expr.Const (value = Const.Int64 Int64.MaxValue) | Expr.Const (value = Const.Int64 Int64.MaxValue), _ | _, Expr.Const (value = Const.Int64 Int64.MinValue) | Expr.Const (value = Const.UInt64 UInt64.MinValue), _ | _, Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> - mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + mkRuntimeCalc mkThrowIfStepIsZero (mkCount id) (mkCount mkAddOne) // The total count could not exceed 2⁶⁴. | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) | Expr.Const (value = Const.UInt64 _), _ | _, Expr.Const (value = Const.UInt64 _) -> RangeCount.Safe (mkCount mkAddOne) - | _ -> mkRuntimeCalc (mkCount id) (mkCount mkAddOne) + | _ -> mkRuntimeCalc mkThrowIfStepIsZero (mkCount id) (mkCount mkAddOne) let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr)) = let inline mkLetBindingsIfNeeded f = diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl index d4f5597088c..ea6769af1e5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl @@ -579,87 +579,71 @@ uint64 V_3, uint64 V_4) IL_0000: nop - IL_0001: ldarg.0 - IL_0002: brtrue.s IL_0013 - + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 IL_0004: ldc.i4.1 IL_0005: conv.i8 - IL_0006: ldarg.0 - IL_0007: ldc.i4.s 10 + IL_0006: bge.un.s IL_000d + + IL_0008: ldc.i4.0 IL_0009: conv.i8 - IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_000f: pop - IL_0010: nop - IL_0011: br.s IL_0014 + IL_000a: nop + IL_000b: br.s IL_0019 - IL_0013: nop - IL_0014: ldc.i4.s 10 + IL_000d: ldc.i4.s 10 + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: sub + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: ldc.i4.1 IL_0016: conv.i8 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0020 - - IL_001b: ldc.i4.0 - IL_001c: conv.i8 - IL_001d: nop - IL_001e: br.s IL_002c + IL_0017: add.ovf.un + IL_0018: nop + IL_0019: stloc.0 + IL_001a: ldloc.0 + IL_001b: stloc.1 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: bge.un.s IL_0027 - IL_0020: ldc.i4.s 10 - IL_0022: conv.i8 - IL_0023: ldc.i4.1 - IL_0024: conv.i8 - IL_0025: sub - IL_0026: ldarg.0 - IL_0027: div.un - IL_0028: ldc.i4.1 - IL_0029: conv.i8 - IL_002a: add.ovf.un - IL_002b: nop - IL_002c: stloc.0 - IL_002d: ldloc.0 - IL_002e: stloc.1 - IL_002f: ldloc.1 - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: bge.un.s IL_003a + IL_0021: call !!0[] [runtime]System.Array::Empty() + IL_0026: ret - IL_0034: call !!0[] [runtime]System.Array::Empty() - IL_0039: ret + IL_0027: ldloc.1 + IL_0028: conv.ovf.i.un + IL_0029: newarr [runtime]System.UInt64 + IL_002e: stloc.2 + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: stloc.3 + IL_0032: ldc.i4.1 + IL_0033: conv.i8 + IL_0034: stloc.s V_4 + IL_0036: br.s IL_0049 - IL_003a: ldloc.1 - IL_003b: conv.ovf.i.un - IL_003c: newarr [runtime]System.UInt64 - IL_0041: stloc.2 - IL_0042: ldc.i4.0 - IL_0043: conv.i8 - IL_0044: stloc.3 + IL_0038: ldloc.2 + IL_0039: ldloc.3 + IL_003a: conv.i + IL_003b: ldloc.s V_4 + IL_003d: stelem.i8 + IL_003e: ldloc.s V_4 + IL_0040: ldarg.0 + IL_0041: add + IL_0042: stloc.s V_4 + IL_0044: ldloc.3 IL_0045: ldc.i4.1 IL_0046: conv.i8 - IL_0047: stloc.s V_4 - IL_0049: br.s IL_005c + IL_0047: add + IL_0048: stloc.3 + IL_0049: ldloc.3 + IL_004a: ldloc.0 + IL_004b: blt.un.s IL_0038 - IL_004b: ldloc.2 - IL_004c: ldloc.3 - IL_004d: conv.i - IL_004e: ldloc.s V_4 - IL_0050: stelem.i8 - IL_0051: ldloc.s V_4 - IL_0053: ldarg.0 - IL_0054: add - IL_0055: stloc.s V_4 - IL_0057: ldloc.3 - IL_0058: ldc.i4.1 - IL_0059: conv.i8 - IL_005a: add - IL_005b: stloc.3 - IL_005c: ldloc.3 - IL_005d: ldloc.0 - IL_005e: blt.un.s IL_004b - - IL_0060: ldloc.2 - IL_0061: ret + IL_004d: ldloc.2 + IL_004e: ret } .method public static uint64[] f11(uint64 finish) cil managed @@ -748,83 +732,68 @@ uint64 V_3, uint64 V_4) IL_0000: nop - IL_0001: ldarg.1 - IL_0002: brtrue.s IL_0012 - + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 IL_0004: ldarg.0 - IL_0005: ldarg.1 - IL_0006: ldc.i4.s 10 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 IL_0008: conv.i8 - IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_000e: pop - IL_000f: nop - IL_0010: br.s IL_0013 + IL_0009: nop + IL_000a: br.s IL_0017 - IL_0012: nop - IL_0013: ldc.i4.s 10 - IL_0015: conv.i8 - IL_0016: ldarg.0 - IL_0017: bge.un.s IL_001e + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldarg.1 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: ldc.i4.1 + IL_001c: conv.i8 + IL_001d: bge.un.s IL_0025 - IL_0019: ldc.i4.0 - IL_001a: conv.i8 - IL_001b: nop - IL_001c: br.s IL_0029 + IL_001f: call !!0[] [runtime]System.Array::Empty() + IL_0024: ret - IL_001e: ldc.i4.s 10 - IL_0020: conv.i8 - IL_0021: ldarg.0 - IL_0022: sub - IL_0023: ldarg.1 - IL_0024: div.un - IL_0025: ldc.i4.1 - IL_0026: conv.i8 - IL_0027: add.ovf.un - IL_0028: nop - IL_0029: stloc.0 - IL_002a: ldloc.0 - IL_002b: stloc.1 - IL_002c: ldloc.1 - IL_002d: ldc.i4.1 + IL_0025: ldloc.1 + IL_0026: conv.ovf.i.un + IL_0027: newarr [runtime]System.UInt64 + IL_002c: stloc.2 + IL_002d: ldc.i4.0 IL_002e: conv.i8 - IL_002f: bge.un.s IL_0037 - - IL_0031: call !!0[] [runtime]System.Array::Empty() - IL_0036: ret - - IL_0037: ldloc.1 - IL_0038: conv.ovf.i.un - IL_0039: newarr [runtime]System.UInt64 - IL_003e: stloc.2 - IL_003f: ldc.i4.0 - IL_0040: conv.i8 - IL_0041: stloc.3 - IL_0042: ldarg.0 - IL_0043: stloc.s V_4 - IL_0045: br.s IL_0058 - - IL_0047: ldloc.2 - IL_0048: ldloc.3 - IL_0049: conv.i - IL_004a: ldloc.s V_4 - IL_004c: stelem.i8 - IL_004d: ldloc.s V_4 - IL_004f: ldarg.1 - IL_0050: add - IL_0051: stloc.s V_4 - IL_0053: ldloc.3 - IL_0054: ldc.i4.1 - IL_0055: conv.i8 - IL_0056: add - IL_0057: stloc.3 - IL_0058: ldloc.3 - IL_0059: ldloc.0 - IL_005a: blt.un.s IL_0047 - - IL_005c: ldloc.2 - IL_005d: ret + IL_002f: stloc.3 + IL_0030: ldarg.0 + IL_0031: stloc.s V_4 + IL_0033: br.s IL_0046 + + IL_0035: ldloc.2 + IL_0036: ldloc.3 + IL_0037: conv.i + IL_0038: ldloc.s V_4 + IL_003a: stelem.i8 + IL_003b: ldloc.s V_4 + IL_003d: ldarg.1 + IL_003e: add + IL_003f: stloc.s V_4 + IL_0041: ldloc.3 + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add + IL_0045: stloc.3 + IL_0046: ldloc.3 + IL_0047: ldloc.0 + IL_0048: blt.un.s IL_0035 + + IL_004a: ldloc.2 + IL_004b: ret } .method public static uint64[] f13(uint64 start, @@ -997,84 +966,69 @@ uint64 V_3, uint64 V_4) IL_0000: nop - IL_0001: ldarg.0 - IL_0002: brtrue.s IL_0011 - - IL_0004: ldc.i4.1 - IL_0005: conv.i8 - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_000d: pop - IL_000e: nop - IL_000f: br.s IL_0012 - - IL_0011: nop - IL_0012: ldarg.1 - IL_0013: ldc.i4.1 - IL_0014: conv.i8 - IL_0015: bge.un.s IL_001c + IL_0001: ldarg.1 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b - IL_0017: ldc.i4.0 - IL_0018: conv.i8 - IL_0019: nop - IL_001a: br.s IL_0026 + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0015 - IL_001c: ldarg.1 - IL_001d: ldc.i4.1 - IL_001e: conv.i8 - IL_001f: sub - IL_0020: ldarg.0 - IL_0021: div.un - IL_0022: ldc.i4.1 - IL_0023: conv.i8 - IL_0024: add.ovf.un - IL_0025: nop - IL_0026: stloc.0 - IL_0027: ldloc.0 - IL_0028: stloc.1 - IL_0029: ldloc.1 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: bge.un.s IL_0034 + IL_000b: ldarg.1 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldarg.0 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 - IL_002e: call !!0[] [runtime]System.Array::Empty() - IL_0033: ret + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret - IL_0034: ldloc.1 - IL_0035: conv.ovf.i.un - IL_0036: newarr [runtime]System.UInt64 - IL_003b: stloc.2 - IL_003c: ldc.i4.0 - IL_003d: conv.i8 - IL_003e: stloc.3 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: stloc.s V_4 - IL_0043: br.s IL_0056 + IL_0023: ldloc.1 + IL_0024: conv.ovf.i.un + IL_0025: newarr [runtime]System.UInt64 + IL_002a: stloc.2 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: stloc.3 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: stloc.s V_4 + IL_0032: br.s IL_0045 + + IL_0034: ldloc.2 + IL_0035: ldloc.3 + IL_0036: conv.i + IL_0037: ldloc.s V_4 + IL_0039: stelem.i8 + IL_003a: ldloc.s V_4 + IL_003c: ldarg.0 + 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_0034 - IL_0045: ldloc.2 - IL_0046: ldloc.3 - IL_0047: conv.i - IL_0048: ldloc.s V_4 - IL_004a: stelem.i8 - IL_004b: ldloc.s V_4 - IL_004d: ldarg.0 - IL_004e: add - IL_004f: stloc.s V_4 - IL_0051: ldloc.3 - IL_0052: ldc.i4.1 - IL_0053: conv.i8 - IL_0054: add - IL_0055: stloc.3 - IL_0056: ldloc.3 - IL_0057: ldloc.0 - IL_0058: blt.un.s IL_0045 - - IL_005a: ldloc.2 - IL_005b: ret + IL_0049: ldloc.2 + IL_004a: ret } .method public static uint64[] f15(uint64 start, @@ -1128,158 +1082,130 @@ IL_0023: conv.i8 IL_0024: ceq IL_0026: stloc.1 - IL_0027: ldarg.1 - IL_0028: brtrue.s IL_0036 + IL_0027: ldarg.2 + IL_0028: ldarg.0 + IL_0029: bge.un.s IL_0030 - IL_002a: ldarg.0 - IL_002b: ldarg.1 - IL_002c: ldarg.2 - IL_002d: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_0032: pop - IL_0033: nop - IL_0034: br.s IL_0037 - - IL_0036: nop - IL_0037: ldarg.2 - IL_0038: ldarg.0 - IL_0039: bge.un.s IL_0040 - - IL_003b: ldc.i4.0 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: nop + IL_002e: br.s IL_0039 + + IL_0030: ldarg.2 + IL_0031: ldarg.0 + IL_0032: sub + IL_0033: ldarg.1 + IL_0034: div.un + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add.ovf.un + IL_0038: nop + IL_0039: stloc.2 + IL_003a: ldloc.2 + IL_003b: ldc.i4.1 IL_003c: conv.i8 - IL_003d: nop - IL_003e: br.s IL_0049 - - IL_0040: ldarg.2 - IL_0041: ldarg.0 - IL_0042: sub - IL_0043: ldarg.1 - IL_0044: div.un - IL_0045: ldc.i4.1 - IL_0046: conv.i8 - IL_0047: add.ovf.un - IL_0048: nop - IL_0049: stloc.2 - IL_004a: ldloc.2 - IL_004b: ldc.i4.1 - IL_004c: conv.i8 - IL_004d: bge.un.s IL_0055 - - IL_004f: call !!0[] [runtime]System.Array::Empty() - IL_0054: ret + IL_003d: bge.un.s IL_0045 - IL_0055: ldloc.2 - IL_0056: conv.ovf.i.un - IL_0057: newarr [runtime]System.UInt64 - IL_005c: stloc.3 - IL_005d: ldloc.1 - IL_005e: brfalse.s IL_009a + IL_003f: call !!0[] [runtime]System.Array::Empty() + IL_0044: ret - IL_0060: ldc.i4.0 - IL_0061: conv.i8 - IL_0062: stloc.s V_4 - IL_0064: ldarg.0 - IL_0065: stloc.s V_5 - IL_0067: ldloc.3 - IL_0068: ldloc.s V_4 - IL_006a: conv.i - IL_006b: ldloc.s V_5 - IL_006d: stelem.i8 - IL_006e: ldloc.s V_5 - IL_0070: ldarg.1 - IL_0071: add - IL_0072: stloc.s V_5 - IL_0074: ldloc.s V_4 - IL_0076: ldc.i4.1 - IL_0077: conv.i8 - IL_0078: add - IL_0079: stloc.s V_4 - IL_007b: br.s IL_0091 - - IL_007d: ldloc.3 - IL_007e: ldloc.s V_4 - IL_0080: conv.i - IL_0081: ldloc.s V_5 - IL_0083: stelem.i8 - IL_0084: ldloc.s V_5 - IL_0086: ldarg.1 - IL_0087: add - IL_0088: stloc.s V_5 - IL_008a: ldloc.s V_4 - IL_008c: ldc.i4.1 - IL_008d: conv.i8 - IL_008e: add - IL_008f: stloc.s V_4 - IL_0091: ldloc.s V_4 - IL_0093: ldc.i4.0 - IL_0094: conv.i8 - IL_0095: bgt.un.s IL_007d - - IL_0097: nop - IL_0098: br.s IL_00e2 - - IL_009a: ldarg.1 - IL_009b: brtrue.s IL_00a9 - - IL_009d: ldarg.0 - IL_009e: ldarg.1 - IL_009f: ldarg.2 - IL_00a0: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_00a5: pop - IL_00a6: nop - IL_00a7: br.s IL_00aa - - IL_00a9: nop - IL_00aa: ldarg.2 - IL_00ab: ldarg.0 - IL_00ac: bge.un.s IL_00b3 - - IL_00ae: ldc.i4.0 - IL_00af: conv.i8 - IL_00b0: nop - IL_00b1: br.s IL_00bc - - IL_00b3: ldarg.2 - IL_00b4: ldarg.0 - IL_00b5: sub - IL_00b6: ldarg.1 - IL_00b7: div.un - IL_00b8: ldc.i4.1 - IL_00b9: conv.i8 - IL_00ba: add.ovf.un - IL_00bb: nop - IL_00bc: stloc.s V_4 - IL_00be: ldc.i4.0 - IL_00bf: conv.i8 - IL_00c0: stloc.s V_5 - IL_00c2: ldarg.0 - IL_00c3: stloc.s V_6 - IL_00c5: br.s IL_00db - - IL_00c7: ldloc.3 - IL_00c8: ldloc.s V_5 - IL_00ca: conv.i - IL_00cb: ldloc.s V_6 - IL_00cd: stelem.i8 - IL_00ce: ldloc.s V_6 - IL_00d0: ldarg.1 - IL_00d1: add - IL_00d2: stloc.s V_6 - IL_00d4: ldloc.s V_5 - IL_00d6: ldc.i4.1 - IL_00d7: conv.i8 - IL_00d8: add - IL_00d9: stloc.s V_5 - IL_00db: ldloc.s V_5 - IL_00dd: ldloc.s V_4 - IL_00df: blt.un.s IL_00c7 + IL_0045: ldloc.2 + IL_0046: conv.ovf.i.un + IL_0047: newarr [runtime]System.UInt64 + IL_004c: stloc.3 + IL_004d: ldloc.1 + IL_004e: brfalse.s IL_008a + + IL_0050: ldc.i4.0 + IL_0051: conv.i8 + IL_0052: stloc.s V_4 + IL_0054: ldarg.0 + IL_0055: stloc.s V_5 + IL_0057: ldloc.3 + IL_0058: ldloc.s V_4 + IL_005a: conv.i + IL_005b: ldloc.s V_5 + IL_005d: stelem.i8 + IL_005e: ldloc.s V_5 + IL_0060: ldarg.1 + IL_0061: add + IL_0062: stloc.s V_5 + IL_0064: ldloc.s V_4 + IL_0066: ldc.i4.1 + IL_0067: conv.i8 + IL_0068: add + IL_0069: stloc.s V_4 + IL_006b: br.s IL_0081 + + IL_006d: ldloc.3 + IL_006e: ldloc.s V_4 + IL_0070: conv.i + IL_0071: ldloc.s V_5 + IL_0073: stelem.i8 + IL_0074: ldloc.s V_5 + IL_0076: ldarg.1 + IL_0077: add + IL_0078: stloc.s V_5 + IL_007a: ldloc.s V_4 + IL_007c: ldc.i4.1 + IL_007d: conv.i8 + IL_007e: add + IL_007f: stloc.s V_4 + IL_0081: ldloc.s V_4 + IL_0083: ldc.i4.0 + IL_0084: conv.i8 + IL_0085: bgt.un.s IL_006d - IL_00e1: nop - IL_00e2: ldloc.3 - IL_00e3: ret + IL_0087: nop + IL_0088: br.s IL_00c2 + + IL_008a: ldarg.2 + IL_008b: ldarg.0 + IL_008c: bge.un.s IL_0093 + + IL_008e: ldc.i4.0 + IL_008f: conv.i8 + IL_0090: nop + IL_0091: br.s IL_009c + + IL_0093: ldarg.2 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldarg.1 + IL_0097: div.un + IL_0098: ldc.i4.1 + IL_0099: conv.i8 + IL_009a: add.ovf.un + IL_009b: nop + IL_009c: stloc.s V_4 + IL_009e: ldc.i4.0 + IL_009f: conv.i8 + IL_00a0: stloc.s V_5 + IL_00a2: ldarg.0 + IL_00a3: stloc.s V_6 + IL_00a5: br.s IL_00bb + + IL_00a7: ldloc.3 + IL_00a8: ldloc.s V_5 + IL_00aa: conv.i + IL_00ab: ldloc.s V_6 + IL_00ad: stelem.i8 + IL_00ae: ldloc.s V_6 + IL_00b0: ldarg.1 + IL_00b1: add + IL_00b2: stloc.s V_6 + IL_00b4: ldloc.s V_5 + IL_00b6: ldc.i4.1 + IL_00b7: conv.i8 + IL_00b8: add + IL_00b9: stloc.s V_5 + IL_00bb: ldloc.s V_5 + IL_00bd: ldloc.s V_4 + IL_00bf: blt.un.s IL_00a7 + + IL_00c1: nop + IL_00c2: ldloc.3 + IL_00c3: ret } .method public static uint64[] f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1695,87 +1621,71 @@ 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_001a - + IL_0008: ldc.i4.s 10 + IL_000a: conv.i8 IL_000b: ldc.i4.1 IL_000c: conv.i8 - IL_000d: ldloc.0 - IL_000e: ldc.i4.s 10 + IL_000d: bge.un.s IL_0014 + + IL_000f: ldc.i4.0 IL_0010: conv.i8 - IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_0016: pop - IL_0017: nop - IL_0018: br.s IL_001b + IL_0011: nop + IL_0012: br.s IL_0020 - IL_001a: nop - IL_001b: ldc.i4.s 10 + IL_0014: ldc.i4.s 10 + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: sub + IL_001a: ldloc.0 + IL_001b: div.un + IL_001c: ldc.i4.1 IL_001d: conv.i8 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0027 - - IL_0022: ldc.i4.0 - IL_0023: conv.i8 - IL_0024: nop - IL_0025: br.s IL_0033 - - IL_0027: ldc.i4.s 10 - IL_0029: conv.i8 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: sub - IL_002d: ldloc.0 - IL_002e: div.un - IL_002f: ldc.i4.1 - IL_0030: conv.i8 - IL_0031: add.ovf.un - IL_0032: nop - IL_0033: stloc.1 - IL_0034: ldloc.1 - IL_0035: stloc.2 - IL_0036: ldloc.2 - IL_0037: ldc.i4.1 - IL_0038: conv.i8 - IL_0039: bge.un.s IL_0041 - - IL_003b: call !!0[] [runtime]System.Array::Empty() - IL_0040: ret - - IL_0041: ldloc.2 - IL_0042: conv.ovf.i.un - IL_0043: newarr [runtime]System.UInt64 - IL_0048: stloc.3 - IL_0049: ldc.i4.0 - IL_004a: conv.i8 - IL_004b: stloc.s V_4 - IL_004d: ldc.i4.1 - IL_004e: conv.i8 - IL_004f: stloc.s V_5 - IL_0051: br.s IL_0067 + IL_001e: add.ovf.un + IL_001f: nop + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: stloc.2 + IL_0023: ldloc.2 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: bge.un.s IL_002e + + IL_0028: call !!0[] [runtime]System.Array::Empty() + IL_002d: ret + + IL_002e: ldloc.2 + IL_002f: conv.ovf.i.un + IL_0030: newarr [runtime]System.UInt64 + IL_0035: stloc.3 + IL_0036: ldc.i4.0 + IL_0037: conv.i8 + IL_0038: stloc.s V_4 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: stloc.s V_5 + IL_003e: br.s IL_0054 - IL_0053: ldloc.3 + IL_0040: ldloc.3 + IL_0041: ldloc.s V_4 + IL_0043: conv.i + IL_0044: ldloc.s V_5 + IL_0046: stelem.i8 + IL_0047: ldloc.s V_5 + IL_0049: ldloc.0 + IL_004a: add + IL_004b: stloc.s V_5 + IL_004d: ldloc.s V_4 + IL_004f: ldc.i4.1 + IL_0050: conv.i8 + IL_0051: add + IL_0052: stloc.s V_4 IL_0054: ldloc.s V_4 - IL_0056: conv.i - IL_0057: ldloc.s V_5 - IL_0059: stelem.i8 - IL_005a: ldloc.s V_5 - IL_005c: ldloc.0 - IL_005d: add - IL_005e: stloc.s V_5 - IL_0060: ldloc.s V_4 - IL_0062: ldc.i4.1 - IL_0063: conv.i8 - IL_0064: add - IL_0065: stloc.s V_4 - IL_0067: ldloc.s V_4 - IL_0069: ldloc.1 - IL_006a: blt.un.s IL_0053 - - IL_006c: ldloc.3 - IL_006d: ret + IL_0056: ldloc.1 + IL_0057: blt.un.s IL_0040 + + IL_0059: ldloc.3 + IL_005a: ret } .method public static uint64[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1921,158 +1831,130 @@ IL_003a: conv.i8 IL_003b: ceq IL_003d: stloc.s V_4 - IL_003f: ldloc.1 - IL_0040: brtrue.s IL_004e - - IL_0042: ldloc.0 - IL_0043: ldloc.1 - IL_0044: ldloc.2 - IL_0045: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_004a: pop - IL_004b: nop - IL_004c: br.s IL_004f + IL_003f: ldloc.2 + IL_0040: ldloc.0 + IL_0041: bge.un.s IL_0048 - IL_004e: nop - IL_004f: ldloc.2 - IL_0050: ldloc.0 - IL_0051: bge.un.s IL_0058 + IL_0043: ldc.i4.0 + IL_0044: conv.i8 + IL_0045: nop + IL_0046: br.s IL_0051 - IL_0053: ldc.i4.0 - IL_0054: conv.i8 - IL_0055: nop - IL_0056: br.s IL_0061 - - IL_0058: ldloc.2 - IL_0059: ldloc.0 - IL_005a: sub - IL_005b: ldloc.1 - IL_005c: div.un - IL_005d: ldc.i4.1 - IL_005e: conv.i8 - IL_005f: add.ovf.un - IL_0060: nop - IL_0061: stloc.s V_5 - IL_0063: ldloc.s V_5 - IL_0065: ldc.i4.1 - IL_0066: conv.i8 - IL_0067: bge.un.s IL_006f - - IL_0069: call !!0[] [runtime]System.Array::Empty() - IL_006e: ret - - IL_006f: ldloc.s V_5 - IL_0071: conv.ovf.i.un - IL_0072: newarr [runtime]System.UInt64 - IL_0077: stloc.s V_6 - IL_0079: ldloc.s V_4 - IL_007b: brfalse.s IL_00b9 - - IL_007d: ldc.i4.0 - IL_007e: conv.i8 - IL_007f: stloc.s V_7 - IL_0081: ldloc.0 - IL_0082: stloc.s V_8 - IL_0084: ldloc.s V_6 - IL_0086: ldloc.s V_7 - IL_0088: conv.i - IL_0089: ldloc.s V_8 - IL_008b: stelem.i8 - IL_008c: ldloc.s V_8 - IL_008e: ldloc.1 - IL_008f: add - IL_0090: stloc.s V_8 - IL_0092: ldloc.s V_7 - IL_0094: ldc.i4.1 - IL_0095: conv.i8 + IL_0048: ldloc.2 + IL_0049: ldloc.0 + IL_004a: sub + IL_004b: ldloc.1 + IL_004c: div.un + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: add.ovf.un + IL_0050: nop + IL_0051: stloc.s V_5 + IL_0053: ldloc.s V_5 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: bge.un.s IL_005f + + IL_0059: call !!0[] [runtime]System.Array::Empty() + IL_005e: ret + + IL_005f: ldloc.s V_5 + IL_0061: conv.ovf.i.un + IL_0062: newarr [runtime]System.UInt64 + IL_0067: stloc.s V_6 + IL_0069: ldloc.s V_4 + IL_006b: brfalse.s IL_00a9 + + IL_006d: ldc.i4.0 + IL_006e: conv.i8 + IL_006f: stloc.s V_7 + IL_0071: ldloc.0 + IL_0072: stloc.s V_8 + IL_0074: ldloc.s V_6 + IL_0076: ldloc.s V_7 + IL_0078: conv.i + IL_0079: ldloc.s V_8 + IL_007b: stelem.i8 + IL_007c: ldloc.s V_8 + IL_007e: ldloc.1 + IL_007f: add + IL_0080: stloc.s V_8 + IL_0082: ldloc.s V_7 + IL_0084: ldc.i4.1 + IL_0085: conv.i8 + IL_0086: add + IL_0087: stloc.s V_7 + IL_0089: br.s IL_00a0 + + IL_008b: ldloc.s V_6 + IL_008d: ldloc.s V_7 + IL_008f: conv.i + IL_0090: ldloc.s V_8 + IL_0092: stelem.i8 + IL_0093: ldloc.s V_8 + IL_0095: ldloc.1 IL_0096: add - IL_0097: stloc.s V_7 - IL_0099: br.s IL_00b0 - - IL_009b: ldloc.s V_6 - IL_009d: ldloc.s V_7 - IL_009f: conv.i - IL_00a0: ldloc.s V_8 - IL_00a2: stelem.i8 - IL_00a3: ldloc.s V_8 - IL_00a5: ldloc.1 - IL_00a6: add - IL_00a7: stloc.s V_8 - IL_00a9: ldloc.s V_7 - IL_00ab: ldc.i4.1 - IL_00ac: conv.i8 - IL_00ad: add - IL_00ae: stloc.s V_7 - IL_00b0: ldloc.s V_7 - IL_00b2: ldc.i4.0 - IL_00b3: conv.i8 - IL_00b4: bgt.un.s IL_009b - - IL_00b6: nop - IL_00b7: br.s IL_0102 + IL_0097: stloc.s V_8 + IL_0099: ldloc.s V_7 + IL_009b: ldc.i4.1 + IL_009c: conv.i8 + IL_009d: add + IL_009e: stloc.s V_7 + IL_00a0: ldloc.s V_7 + IL_00a2: ldc.i4.0 + IL_00a3: conv.i8 + IL_00a4: bgt.un.s IL_008b - IL_00b9: ldloc.1 - IL_00ba: brtrue.s IL_00c8 + IL_00a6: nop + IL_00a7: br.s IL_00e2 + + IL_00a9: ldloc.2 + IL_00aa: ldloc.0 + IL_00ab: bge.un.s IL_00b2 + + IL_00ad: ldc.i4.0 + IL_00ae: conv.i8 + IL_00af: nop + IL_00b0: br.s IL_00bb + + IL_00b2: ldloc.2 + IL_00b3: ldloc.0 + IL_00b4: sub + IL_00b5: ldloc.1 + IL_00b6: div.un + IL_00b7: ldc.i4.1 + IL_00b8: conv.i8 + IL_00b9: add.ovf.un + IL_00ba: nop + IL_00bb: stloc.s V_7 + IL_00bd: ldc.i4.0 + IL_00be: conv.i8 + IL_00bf: stloc.s V_8 + IL_00c1: ldloc.0 + IL_00c2: stloc.s V_9 + IL_00c4: br.s IL_00db + + IL_00c6: ldloc.s V_6 + IL_00c8: ldloc.s V_8 + IL_00ca: conv.i + IL_00cb: ldloc.s V_9 + IL_00cd: stelem.i8 + IL_00ce: ldloc.s V_9 + IL_00d0: ldloc.1 + IL_00d1: add + IL_00d2: stloc.s V_9 + IL_00d4: ldloc.s V_8 + IL_00d6: ldc.i4.1 + IL_00d7: conv.i8 + IL_00d8: add + IL_00d9: stloc.s V_8 + IL_00db: ldloc.s V_8 + IL_00dd: ldloc.s V_7 + IL_00df: blt.un.s IL_00c6 - IL_00bc: ldloc.0 - IL_00bd: ldloc.1 - IL_00be: ldloc.2 - IL_00bf: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_00c4: pop - IL_00c5: nop - IL_00c6: br.s IL_00c9 - - IL_00c8: nop - IL_00c9: ldloc.2 - IL_00ca: ldloc.0 - IL_00cb: bge.un.s IL_00d2 - - IL_00cd: ldc.i4.0 - IL_00ce: conv.i8 - IL_00cf: nop - IL_00d0: br.s IL_00db - - IL_00d2: ldloc.2 - IL_00d3: ldloc.0 - IL_00d4: sub - IL_00d5: ldloc.1 - IL_00d6: div.un - IL_00d7: ldc.i4.1 - IL_00d8: conv.i8 - IL_00d9: add.ovf.un - IL_00da: nop - IL_00db: stloc.s V_7 - IL_00dd: ldc.i4.0 - IL_00de: conv.i8 - IL_00df: stloc.s V_8 - IL_00e1: ldloc.0 - IL_00e2: stloc.s V_9 - IL_00e4: br.s IL_00fb - - IL_00e6: ldloc.s V_6 - IL_00e8: ldloc.s V_8 - IL_00ea: conv.i - IL_00eb: ldloc.s V_9 - IL_00ed: stelem.i8 - IL_00ee: ldloc.s V_9 - IL_00f0: ldloc.1 - IL_00f1: add - IL_00f2: stloc.s V_9 - IL_00f4: ldloc.s V_8 - IL_00f6: ldc.i4.1 - IL_00f7: conv.i8 - IL_00f8: add - IL_00f9: stloc.s V_8 - IL_00fb: ldloc.s V_8 - IL_00fd: ldloc.s V_7 - IL_00ff: blt.un.s IL_00e6 - - IL_0101: nop - IL_0102: ldloc.s V_6 - IL_0104: ret + IL_00e1: nop + IL_00e2: ldloc.s V_6 + IL_00e4: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl index 8a1fa66c6f0..5edd2a8810d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl @@ -481,79 +481,63 @@ .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f10(uint64 step) cil managed { - .maxstack 5 + .maxstack 4 .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, uint64 V_2, uint64 V_3) IL_0000: nop - IL_0001: ldarg.0 - IL_0002: brtrue.s IL_0013 - + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 IL_0004: ldc.i4.1 IL_0005: conv.i8 - IL_0006: ldarg.0 - IL_0007: ldc.i4.s 10 + IL_0006: bge.un.s IL_000d + + IL_0008: ldc.i4.0 IL_0009: conv.i8 - IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_000f: pop - IL_0010: nop - IL_0011: br.s IL_0014 + IL_000a: nop + IL_000b: br.s IL_0019 - IL_0013: nop - IL_0014: ldc.i4.s 10 + IL_000d: ldc.i4.s 10 + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: sub + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: ldc.i4.1 IL_0016: conv.i8 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: bge.un.s IL_0020 - - IL_001b: ldc.i4.0 - IL_001c: conv.i8 - IL_001d: nop - IL_001e: br.s IL_002c + IL_0017: add.ovf.un + IL_0018: nop + IL_0019: stloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.2 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: stloc.3 + IL_0020: br.s IL_0034 - IL_0020: ldc.i4.s 10 - IL_0022: conv.i8 - IL_0023: ldc.i4.1 - IL_0024: conv.i8 - IL_0025: sub - IL_0026: ldarg.0 - IL_0027: div.un - IL_0028: ldc.i4.1 - IL_0029: conv.i8 - IL_002a: add.ovf.un - IL_002b: nop - IL_002c: stloc.0 - IL_002d: ldc.i4.0 - IL_002e: conv.i8 - IL_002f: stloc.2 + IL_0022: ldloca.s V_1 + IL_0024: ldloc.3 + IL_0025: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002a: nop + IL_002b: ldloc.3 + IL_002c: ldarg.0 + IL_002d: add + IL_002e: stloc.3 + IL_002f: ldloc.2 IL_0030: ldc.i4.1 IL_0031: conv.i8 - IL_0032: stloc.3 - IL_0033: br.s IL_0047 - - IL_0035: ldloca.s V_1 - IL_0037: ldloc.3 - IL_0038: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_003d: nop - IL_003e: ldloc.3 - IL_003f: ldarg.0 - IL_0040: add - IL_0041: stloc.3 - IL_0042: ldloc.2 - IL_0043: ldc.i4.1 - IL_0044: conv.i8 - IL_0045: add - IL_0046: stloc.2 - IL_0047: ldloc.2 - IL_0048: ldloc.0 - IL_0049: blt.un.s IL_0035 - - IL_004b: ldloca.s V_1 - 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 + IL_0032: add + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0022 + + IL_0038: ldloca.s V_1 + IL_003a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003f: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f11(uint64 finish) cil managed @@ -621,75 +605,60 @@ { .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 + .maxstack 4 .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, uint64 V_2, uint64 V_3) IL_0000: nop - IL_0001: ldarg.1 - IL_0002: brtrue.s IL_0012 - + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 IL_0004: ldarg.0 - IL_0005: ldarg.1 - IL_0006: ldc.i4.s 10 - IL_0008: conv.i8 - IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_000e: pop - IL_000f: nop - IL_0010: br.s IL_0013 + IL_0005: bge.un.s IL_000c - IL_0012: nop - IL_0013: ldc.i4.s 10 - IL_0015: conv.i8 - IL_0016: ldarg.0 - IL_0017: bge.un.s IL_001e + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0017 - IL_0019: ldc.i4.0 - IL_001a: conv.i8 - IL_001b: nop - IL_001c: br.s IL_0029 + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldarg.1 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.2 + IL_001b: ldarg.0 + IL_001c: stloc.3 + IL_001d: br.s IL_0031 - IL_001e: ldc.i4.s 10 - IL_0020: conv.i8 - IL_0021: ldarg.0 - IL_0022: sub - IL_0023: ldarg.1 - IL_0024: div.un - IL_0025: ldc.i4.1 - IL_0026: conv.i8 - IL_0027: add.ovf.un - IL_0028: nop - IL_0029: stloc.0 - IL_002a: ldc.i4.0 - IL_002b: conv.i8 - IL_002c: stloc.2 - IL_002d: ldarg.0 - IL_002e: stloc.3 - IL_002f: br.s IL_0043 + IL_001f: ldloca.s V_1 + IL_0021: ldloc.3 + IL_0022: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0027: nop + IL_0028: ldloc.3 + IL_0029: ldarg.1 + IL_002a: add + IL_002b: stloc.3 + IL_002c: ldloc.2 + IL_002d: ldc.i4.1 + IL_002e: conv.i8 + IL_002f: add + IL_0030: stloc.2 + IL_0031: ldloc.2 + IL_0032: ldloc.0 + IL_0033: blt.un.s IL_001f - IL_0031: ldloca.s V_1 - IL_0033: ldloc.3 - IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0039: nop - IL_003a: ldloc.3 - IL_003b: ldarg.1 - IL_003c: add - IL_003d: stloc.3 - IL_003e: ldloc.2 - IL_003f: ldc.i4.1 - IL_0040: conv.i8 - IL_0041: add - IL_0042: stloc.2 - IL_0043: ldloc.2 - IL_0044: ldloc.0 - IL_0045: blt.un.s IL_0031 - - IL_0047: ldloca.s V_1 - 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 + IL_0035: ldloca.s V_1 + IL_0037: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003c: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -825,76 +794,61 @@ { .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 + .maxstack 4 .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, uint64 V_2, uint64 V_3) IL_0000: nop - IL_0001: ldarg.0 - IL_0002: brtrue.s IL_0011 - - IL_0004: ldc.i4.1 - IL_0005: conv.i8 - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_000d: pop - IL_000e: nop - IL_000f: br.s IL_0012 - - IL_0011: nop - IL_0012: ldarg.1 - IL_0013: ldc.i4.1 - IL_0014: conv.i8 - IL_0015: bge.un.s IL_001c + IL_0001: ldarg.1 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b - IL_0017: ldc.i4.0 - IL_0018: conv.i8 - IL_0019: nop - IL_001a: br.s IL_0026 + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0015 - IL_001c: ldarg.1 - IL_001d: ldc.i4.1 - IL_001e: conv.i8 - IL_001f: sub - IL_0020: ldarg.0 - IL_0021: div.un - IL_0022: ldc.i4.1 - IL_0023: conv.i8 - IL_0024: add.ovf.un - IL_0025: nop - IL_0026: stloc.0 - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.2 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: stloc.3 - IL_002d: br.s IL_0041 + IL_000b: ldarg.1 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldarg.0 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: stloc.3 + IL_001c: br.s IL_0030 + + IL_001e: ldloca.s V_1 + IL_0020: ldloc.3 + 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: ldarg.0 + 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_001e - IL_002f: ldloca.s V_1 - IL_0031: ldloc.3 - IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0037: nop - IL_0038: ldloc.3 - IL_0039: ldarg.0 - IL_003a: add - IL_003b: stloc.3 - IL_003c: ldloc.2 - IL_003d: ldc.i4.1 - IL_003e: conv.i8 - IL_003f: add - IL_0040: stloc.2 - IL_0041: ldloc.2 - IL_0042: ldloc.0 - IL_0043: blt.un.s IL_002f - - IL_0045: ldloca.s V_1 - IL_0047: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004c: ret + 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 @@ -990,69 +944,55 @@ IL_005f: bgt.un.s IL_0047 IL_0061: nop - IL_0062: br.s IL_00ad - - IL_0064: ldarg.1 - IL_0065: brtrue.s IL_0073 - - IL_0067: ldarg.0 - IL_0068: ldarg.1 - IL_0069: ldarg.2 - IL_006a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_006f: pop - IL_0070: nop - IL_0071: br.s IL_0074 - - IL_0073: nop - IL_0074: ldarg.2 - IL_0075: ldarg.0 - IL_0076: bge.un.s IL_007d - - IL_0078: ldc.i4.0 - IL_0079: conv.i8 - IL_007a: nop - IL_007b: br.s IL_0086 - - IL_007d: ldarg.2 - IL_007e: ldarg.0 - IL_007f: sub - IL_0080: ldarg.1 - IL_0081: div.un - IL_0082: ldc.i4.1 - IL_0083: conv.i8 - IL_0084: add.ovf.un - IL_0085: nop - IL_0086: stloc.3 - IL_0087: ldc.i4.0 - IL_0088: conv.i8 - IL_0089: stloc.s V_4 - IL_008b: ldarg.0 - IL_008c: stloc.s V_5 - IL_008e: br.s IL_00a7 - - IL_0090: ldloca.s V_2 - IL_0092: ldloc.s V_5 - IL_0094: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0099: nop - IL_009a: ldloc.s V_5 - IL_009c: ldarg.1 - IL_009d: add - IL_009e: stloc.s V_5 - IL_00a0: ldloc.s V_4 - IL_00a2: ldc.i4.1 - IL_00a3: conv.i8 - IL_00a4: add - IL_00a5: stloc.s V_4 - IL_00a7: ldloc.s V_4 - IL_00a9: ldloc.3 - IL_00aa: blt.un.s IL_0090 - - IL_00ac: nop - IL_00ad: ldloca.s V_2 - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00b4: ret + IL_0062: br.s IL_009d + + IL_0064: ldarg.2 + IL_0065: ldarg.0 + IL_0066: bge.un.s IL_006d + + IL_0068: ldc.i4.0 + IL_0069: conv.i8 + IL_006a: nop + IL_006b: br.s IL_0076 + + IL_006d: ldarg.2 + IL_006e: ldarg.0 + IL_006f: sub + IL_0070: ldarg.1 + IL_0071: div.un + IL_0072: ldc.i4.1 + IL_0073: conv.i8 + IL_0074: add.ovf.un + IL_0075: nop + IL_0076: stloc.3 + IL_0077: ldc.i4.0 + IL_0078: conv.i8 + IL_0079: stloc.s V_4 + IL_007b: ldarg.0 + IL_007c: stloc.s V_5 + IL_007e: br.s IL_0097 + + IL_0080: ldloca.s V_2 + IL_0082: ldloc.s V_5 + IL_0084: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0089: nop + IL_008a: ldloc.s V_5 + IL_008c: ldarg.1 + IL_008d: add + IL_008e: stloc.s V_5 + IL_0090: ldloc.s V_4 + IL_0092: ldc.i4.1 + IL_0093: conv.i8 + IL_0094: add + IL_0095: stloc.s V_4 + IL_0097: ldloc.s V_4 + IL_0099: ldloc.3 + IL_009a: blt.un.s IL_0080 + + IL_009c: nop + IL_009d: ldloca.s V_2 + IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00a4: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1381,7 +1321,7 @@ .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed { - .maxstack 5 + .maxstack 4 .locals init (uint64 V_0, uint64 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, @@ -1391,73 +1331,57 @@ 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_001a - + IL_0008: ldc.i4.s 10 + IL_000a: conv.i8 IL_000b: ldc.i4.1 IL_000c: conv.i8 - IL_000d: ldloc.0 - IL_000e: ldc.i4.s 10 + IL_000d: bge.un.s IL_0014 + + IL_000f: ldc.i4.0 IL_0010: conv.i8 - IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_0016: pop - IL_0017: nop - IL_0018: br.s IL_001b + IL_0011: nop + IL_0012: br.s IL_0020 - IL_001a: nop - IL_001b: ldc.i4.s 10 + IL_0014: ldc.i4.s 10 + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: sub + IL_001a: ldloc.0 + IL_001b: div.un + IL_001c: ldc.i4.1 IL_001d: conv.i8 - IL_001e: ldc.i4.1 - IL_001f: conv.i8 - IL_0020: bge.un.s IL_0027 - - IL_0022: ldc.i4.0 - IL_0023: conv.i8 - IL_0024: nop - IL_0025: br.s IL_0033 - - IL_0027: ldc.i4.s 10 - IL_0029: conv.i8 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: sub - IL_002d: ldloc.0 - IL_002e: div.un - IL_002f: ldc.i4.1 - IL_0030: conv.i8 - IL_0031: add.ovf.un - IL_0032: nop - IL_0033: stloc.1 - IL_0034: ldc.i4.0 - IL_0035: conv.i8 - IL_0036: stloc.3 - IL_0037: ldc.i4.1 - IL_0038: conv.i8 - IL_0039: stloc.s V_4 - IL_003b: br.s IL_0052 - - IL_003d: ldloca.s V_2 - IL_003f: ldloc.s V_4 - IL_0041: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0046: nop - IL_0047: ldloc.s V_4 - IL_0049: ldloc.0 - IL_004a: add - IL_004b: stloc.s V_4 - IL_004d: ldloc.3 - IL_004e: ldc.i4.1 - IL_004f: conv.i8 - IL_0050: add - IL_0051: stloc.3 - IL_0052: ldloc.3 - IL_0053: ldloc.1 - IL_0054: blt.un.s IL_003d - - IL_0056: ldloca.s V_2 - 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 + IL_001e: add.ovf.un + IL_001f: nop + IL_0020: stloc.1 + IL_0021: ldc.i4.0 + IL_0022: conv.i8 + IL_0023: stloc.3 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: stloc.s V_4 + IL_0028: br.s IL_003f + + IL_002a: ldloca.s V_2 + IL_002c: ldloc.s V_4 + IL_002e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0033: nop + IL_0034: ldloc.s V_4 + IL_0036: ldloc.0 + IL_0037: add + IL_0038: stloc.s V_4 + IL_003a: ldloc.3 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: stloc.3 + IL_003f: ldloc.3 + IL_0040: ldloc.1 + IL_0041: blt.un.s IL_002a + + IL_0043: ldloca.s V_2 + IL_0045: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004a: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1630,69 +1554,55 @@ IL_007e: bgt.un.s IL_0063 IL_0080: nop - IL_0081: br.s IL_00ce + IL_0081: br.s IL_00be - IL_0083: ldloc.1 - IL_0084: brtrue.s IL_0092 - - IL_0086: ldloc.0 - IL_0087: ldloc.1 - IL_0088: ldloc.2 - IL_0089: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_008e: pop - IL_008f: nop - IL_0090: br.s IL_0093 - - IL_0092: nop - IL_0093: ldloc.2 - IL_0094: ldloc.0 - IL_0095: bge.un.s IL_009c + IL_0083: ldloc.2 + IL_0084: ldloc.0 + IL_0085: bge.un.s IL_008c + IL_0087: ldc.i4.0 + IL_0088: conv.i8 + IL_0089: nop + IL_008a: br.s IL_0095 + + IL_008c: ldloc.2 + IL_008d: ldloc.0 + IL_008e: sub + IL_008f: ldloc.1 + IL_0090: div.un + IL_0091: ldc.i4.1 + IL_0092: conv.i8 + IL_0093: add.ovf.un + IL_0094: nop + IL_0095: stloc.s V_6 IL_0097: ldc.i4.0 IL_0098: conv.i8 - IL_0099: nop - IL_009a: br.s IL_00a5 - - IL_009c: ldloc.2 - IL_009d: ldloc.0 - IL_009e: sub - IL_009f: ldloc.1 - IL_00a0: div.un - IL_00a1: ldc.i4.1 - IL_00a2: conv.i8 - IL_00a3: add.ovf.un - IL_00a4: nop - IL_00a5: stloc.s V_6 - IL_00a7: ldc.i4.0 - IL_00a8: conv.i8 - IL_00a9: stloc.s V_7 - IL_00ab: ldloc.0 - IL_00ac: stloc.s V_8 - IL_00ae: br.s IL_00c7 - - IL_00b0: ldloca.s V_5 - IL_00b2: ldloc.s V_8 - IL_00b4: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_00b9: nop - IL_00ba: ldloc.s V_8 - IL_00bc: ldloc.1 - IL_00bd: add - IL_00be: stloc.s V_8 - IL_00c0: ldloc.s V_7 - IL_00c2: ldc.i4.1 - IL_00c3: conv.i8 - IL_00c4: add - IL_00c5: stloc.s V_7 - IL_00c7: ldloc.s V_7 - IL_00c9: ldloc.s V_6 - IL_00cb: blt.un.s IL_00b0 - - IL_00cd: nop - IL_00ce: ldloca.s V_5 - IL_00d0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00d5: ret + IL_0099: stloc.s V_7 + IL_009b: ldloc.0 + IL_009c: stloc.s V_8 + IL_009e: br.s IL_00b7 + + IL_00a0: ldloca.s V_5 + IL_00a2: ldloc.s V_8 + IL_00a4: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00a9: nop + IL_00aa: ldloc.s V_8 + IL_00ac: ldloc.1 + IL_00ad: add + IL_00ae: stloc.s V_8 + IL_00b0: ldloc.s V_7 + IL_00b2: ldc.i4.1 + IL_00b3: conv.i8 + IL_00b4: add + IL_00b5: stloc.s V_7 + IL_00b7: ldloc.s V_7 + IL_00b9: ldloc.s V_6 + IL_00bb: blt.un.s IL_00a0 + + IL_00bd: nop + IL_00be: ldloca.s V_5 + IL_00c0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00c5: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl index 27ef261d4ee..0c9ef13dbb4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl @@ -503,69 +503,53 @@ .method public static void f8(int64 step) cil managed { - .maxstack 5 + .maxstack 4 .locals init (uint64 V_0, uint64 V_1, int64 V_2) - IL_0000: ldarg.0 - IL_0001: brtrue.s IL_0012 + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0010 - IL_0003: ldc.i4.1 - IL_0004: conv.i8 - IL_0005: ldarg.0 - IL_0006: ldc.i4.s 10 - IL_0008: conv.i8 - IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, - int64, - int64) - IL_000e: pop - IL_000f: nop - IL_0010: br.s IL_0013 + IL_0005: ldc.i4.s 9 + IL_0007: conv.i8 + IL_0008: ldarg.0 + IL_0009: div.un + IL_000a: ldc.i4.1 + IL_000b: conv.i8 + IL_000c: add.ovf.un + IL_000d: nop + IL_000e: br.s IL_0013 + IL_0010: ldc.i4.0 + IL_0011: conv.i8 IL_0012: nop - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: ldarg.0 - IL_0016: bge.s IL_0023 + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: stloc.2 + IL_001a: br.s IL_002b - IL_0018: ldc.i4.s 9 - IL_001a: conv.i8 - IL_001b: ldarg.0 - IL_001c: div.un - IL_001d: ldc.i4.1 - IL_001e: conv.i8 - IL_001f: add.ovf.un - IL_0020: nop - IL_0021: br.s IL_0026 - - IL_0023: ldc.i4.0 - IL_0024: conv.i8 - IL_0025: nop - IL_0026: stloc.0 - IL_0027: ldc.i4.0 + IL_001c: ldloc.2 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.2 + IL_0023: ldarg.0 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 IL_0028: conv.i8 - IL_0029: stloc.1 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: stloc.2 - IL_002d: br.s IL_003e - - IL_002f: ldloc.2 - IL_0030: call void assembly::set_c(int64) - IL_0035: ldloc.2 - IL_0036: ldarg.0 - IL_0037: add - IL_0038: stloc.2 - IL_0039: ldloc.1 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 - IL_003c: add - IL_003d: stloc.1 - IL_003e: ldloc.1 - IL_003f: ldloc.0 - IL_0040: blt.un.s IL_002f - - IL_0042: ret + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldloc.0 + IL_002d: blt.un.s IL_001c + + IL_002f: ret } .method public static void f9(int64 finish) cil managed @@ -733,91 +717,77 @@ IL_0069: ret - IL_006a: ldarg.1 - IL_006b: brtrue.s IL_0079 + IL_006a: ldc.i4.0 + IL_006b: conv.i8 + IL_006c: ldarg.1 + IL_006d: bge.s IL_0083 - IL_006d: ldarg.2 - IL_006e: ldarg.1 IL_006f: ldarg.2 - IL_0070: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, - int64, - int64) - IL_0075: pop - IL_0076: nop - IL_0077: br.s IL_007a - - IL_0079: nop - IL_007a: ldc.i4.0 - IL_007b: conv.i8 - IL_007c: ldarg.1 - IL_007d: bge.s IL_0093 - - IL_007f: ldarg.2 - IL_0080: ldarg.2 - IL_0081: bge.s IL_0088 - - IL_0083: ldc.i4.0 - IL_0084: conv.i8 - IL_0085: nop - IL_0086: br.s IL_00a9 - - IL_0088: ldarg.2 - IL_0089: ldarg.2 - IL_008a: sub - IL_008b: ldarg.1 - IL_008c: div.un - IL_008d: ldc.i4.1 - IL_008e: conv.i8 - IL_008f: add.ovf.un - IL_0090: nop - IL_0091: br.s IL_00a9 - - IL_0093: ldarg.2 - IL_0094: ldarg.2 - IL_0095: bge.s IL_009c - - IL_0097: ldc.i4.0 - IL_0098: conv.i8 - IL_0099: nop - IL_009a: br.s IL_00a9 - - IL_009c: ldarg.2 + IL_0070: ldarg.2 + IL_0071: bge.s IL_0078 + + IL_0073: ldc.i4.0 + IL_0074: conv.i8 + IL_0075: nop + IL_0076: br.s IL_0099 + + IL_0078: ldarg.2 + IL_0079: ldarg.2 + IL_007a: sub + IL_007b: ldarg.1 + IL_007c: div.un + IL_007d: ldc.i4.1 + IL_007e: conv.i8 + IL_007f: add.ovf.un + IL_0080: nop + IL_0081: br.s IL_0099 + + IL_0083: ldarg.2 + IL_0084: ldarg.2 + IL_0085: bge.s IL_008c + + IL_0087: ldc.i4.0 + IL_0088: conv.i8 + IL_0089: nop + IL_008a: br.s IL_0099 + + IL_008c: ldarg.2 + IL_008d: ldarg.2 + IL_008e: sub + IL_008f: ldarg.1 + IL_0090: not + IL_0091: ldc.i4.1 + IL_0092: conv.i8 + IL_0093: add + IL_0094: div.un + IL_0095: ldc.i4.1 + IL_0096: conv.i8 + IL_0097: add.ovf.un + IL_0098: nop + IL_0099: stloc.1 + IL_009a: ldc.i4.0 + IL_009b: conv.i8 + IL_009c: stloc.3 IL_009d: ldarg.2 - IL_009e: sub - IL_009f: ldarg.1 - IL_00a0: not - IL_00a1: ldc.i4.1 - IL_00a2: conv.i8 - IL_00a3: add - IL_00a4: div.un - IL_00a5: ldc.i4.1 - IL_00a6: conv.i8 - IL_00a7: add.ovf.un - IL_00a8: nop - IL_00a9: stloc.1 - IL_00aa: ldc.i4.0 - IL_00ab: conv.i8 - IL_00ac: stloc.3 - IL_00ad: ldarg.2 - IL_00ae: stloc.2 - IL_00af: br.s IL_00c0 - - IL_00b1: ldloc.2 - IL_00b2: call void assembly::set_c(int64) - IL_00b7: ldloc.2 - IL_00b8: ldarg.1 - IL_00b9: add - IL_00ba: stloc.2 - IL_00bb: ldloc.3 - IL_00bc: ldc.i4.1 - IL_00bd: conv.i8 - IL_00be: add - IL_00bf: stloc.3 - IL_00c0: ldloc.3 - IL_00c1: ldloc.1 - IL_00c2: blt.un.s IL_00b1 - - IL_00c4: ret + IL_009e: stloc.2 + IL_009f: br.s IL_00b0 + + IL_00a1: ldloc.2 + IL_00a2: call void assembly::set_c(int64) + IL_00a7: ldloc.2 + IL_00a8: ldarg.1 + IL_00a9: add + IL_00aa: stloc.2 + IL_00ab: ldloc.3 + IL_00ac: ldc.i4.1 + IL_00ad: conv.i8 + IL_00ae: add + IL_00af: stloc.3 + IL_00b0: ldloc.3 + IL_00b1: ldloc.1 + IL_00b2: blt.un.s IL_00a1 + + IL_00b4: ret } .method public static void f11(int64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl index e453b765e2b..c64f77e725e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -791,104 +791,86 @@ IL_013a: ret - IL_013b: ldarg.0 - IL_013c: ldc.i8 0x0 - IL_0145: conv.i - IL_0146: bne.un.s IL_0166 + IL_013b: ldc.i8 0x0 + IL_0144: conv.i + IL_0145: ldarg.0 + IL_0146: bge.s IL_0193 - IL_0148: ldc.i8 0x1 + IL_0148: ldc.i8 0xa IL_0151: conv.i - IL_0152: ldarg.0 - IL_0153: ldc.i8 0xa - IL_015c: conv.i - IL_015d: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, - native int, - native int) - IL_0162: pop - IL_0163: nop - IL_0164: br.s IL_0167 - - IL_0166: nop - IL_0167: ldc.i8 0x0 - IL_0170: conv.i - IL_0171: ldarg.0 - IL_0172: bge.s IL_01bf - - IL_0174: ldc.i8 0xa - IL_017d: conv.i - IL_017e: ldc.i8 0x1 - IL_0187: conv.i - IL_0188: bge.s IL_019a - - IL_018a: ldc.i8 0x0 - IL_0193: conv.i - IL_0194: nop - IL_0195: br IL_0211 + IL_0152: ldc.i8 0x1 + IL_015b: conv.i + IL_015c: bge.s IL_016e + + IL_015e: ldc.i8 0x0 + IL_0167: conv.i + IL_0168: nop + IL_0169: br IL_01e5 + + IL_016e: ldc.i8 0xa + IL_0177: conv.i + IL_0178: ldc.i8 0x1 + IL_0181: conv.i + IL_0182: sub + IL_0183: ldarg.0 + IL_0184: div.un + IL_0185: ldc.i8 0x1 + IL_018e: conv.i + IL_018f: add.ovf.un + IL_0190: nop + IL_0191: br.s IL_01e5 + + IL_0193: ldc.i8 0x1 + IL_019c: conv.i + IL_019d: ldc.i8 0xa + IL_01a6: conv.i + IL_01a7: bge.s IL_01b6 + + IL_01a9: ldc.i8 0x0 + IL_01b2: conv.i + IL_01b3: nop + IL_01b4: br.s IL_01e5 + + IL_01b6: ldc.i8 0x1 + IL_01bf: conv.i + IL_01c0: ldc.i8 0xa + IL_01c9: conv.i + IL_01ca: sub + IL_01cb: ldarg.0 + IL_01cc: not + IL_01cd: ldc.i8 0x1 + IL_01d6: conv.i + IL_01d7: add + IL_01d8: div.un + IL_01d9: ldc.i8 0x1 + IL_01e2: conv.i + IL_01e3: add.ovf.un + IL_01e4: nop + IL_01e5: stloc.1 + IL_01e6: ldc.i8 0x0 + IL_01ef: conv.i + IL_01f0: stloc.2 + IL_01f1: ldc.i8 0x1 + IL_01fa: conv.i + IL_01fb: stloc.3 + IL_01fc: br.s IL_0215 + + IL_01fe: ldloc.3 + IL_01ff: call void assembly::set_c(native int) + IL_0204: ldloc.3 + IL_0205: ldarg.0 + IL_0206: add + IL_0207: stloc.3 + IL_0208: ldloc.2 + IL_0209: ldc.i8 0x1 + IL_0212: conv.i + IL_0213: add + IL_0214: stloc.2 + IL_0215: ldloc.2 + IL_0216: ldloc.1 + IL_0217: blt.un.s IL_01fe - IL_019a: ldc.i8 0xa - IL_01a3: conv.i - IL_01a4: ldc.i8 0x1 - IL_01ad: conv.i - IL_01ae: sub - IL_01af: ldarg.0 - IL_01b0: div.un - IL_01b1: ldc.i8 0x1 - IL_01ba: conv.i - IL_01bb: add.ovf.un - IL_01bc: nop - IL_01bd: br.s IL_0211 - - IL_01bf: ldc.i8 0x1 - IL_01c8: conv.i - IL_01c9: ldc.i8 0xa - IL_01d2: conv.i - IL_01d3: bge.s IL_01e2 - - IL_01d5: ldc.i8 0x0 - IL_01de: conv.i - IL_01df: nop - IL_01e0: br.s IL_0211 - - IL_01e2: ldc.i8 0x1 - IL_01eb: conv.i - IL_01ec: ldc.i8 0xa - IL_01f5: conv.i - IL_01f6: sub - IL_01f7: ldarg.0 - IL_01f8: not - IL_01f9: ldc.i8 0x1 - IL_0202: conv.i - IL_0203: add - IL_0204: div.un - IL_0205: ldc.i8 0x1 - IL_020e: conv.i - IL_020f: add.ovf.un - IL_0210: nop - IL_0211: stloc.1 - IL_0212: ldc.i8 0x0 - IL_021b: conv.i - IL_021c: stloc.2 - IL_021d: ldc.i8 0x1 - IL_0226: conv.i - IL_0227: stloc.3 - IL_0228: br.s IL_0241 - - IL_022a: ldloc.3 - IL_022b: call void assembly::set_c(native int) - IL_0230: ldloc.3 - IL_0231: ldarg.0 - IL_0232: add - IL_0233: stloc.3 - IL_0234: ldloc.2 - IL_0235: ldc.i8 0x1 - IL_023e: conv.i - IL_023f: add - IL_0240: stloc.2 - IL_0241: ldloc.2 - IL_0242: ldloc.1 - IL_0243: blt.un.s IL_022a - - IL_0245: ret + IL_0219: ret } .method public static void f9(native int finish) cil managed @@ -1071,93 +1053,77 @@ IL_00d7: ret - IL_00d8: ldarg.1 - IL_00d9: ldc.i8 0x0 - IL_00e2: conv.i - IL_00e3: bne.un.s IL_00f1 + IL_00d8: ldc.i8 0x0 + IL_00e1: conv.i + IL_00e2: ldarg.1 + IL_00e3: bge.s IL_0109 IL_00e5: ldarg.2 - IL_00e6: ldarg.1 - IL_00e7: ldarg.2 - IL_00e8: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, - native int, - native int) - IL_00ed: pop - IL_00ee: nop - IL_00ef: br.s IL_00f2 - - IL_00f1: nop - IL_00f2: ldc.i8 0x0 - IL_00fb: conv.i - IL_00fc: ldarg.1 - IL_00fd: bge.s IL_0123 - - IL_00ff: ldarg.2 - IL_0100: ldarg.2 - IL_0101: bge.s IL_0110 - - IL_0103: ldc.i8 0x0 - IL_010c: conv.i - IL_010d: nop - IL_010e: br.s IL_0151 - - IL_0110: ldarg.2 - IL_0111: ldarg.2 - IL_0112: sub - IL_0113: ldarg.1 - IL_0114: div.un - IL_0115: ldc.i8 0x1 - IL_011e: conv.i - IL_011f: add.ovf.un - IL_0120: nop - IL_0121: br.s IL_0151 - - IL_0123: ldarg.2 - IL_0124: ldarg.2 - IL_0125: bge.s IL_0134 - - IL_0127: ldc.i8 0x0 - IL_0130: conv.i - IL_0131: nop - IL_0132: br.s IL_0151 - - IL_0134: ldarg.2 - IL_0135: ldarg.2 - IL_0136: sub - IL_0137: ldarg.1 - IL_0138: not - IL_0139: ldc.i8 0x1 - IL_0142: conv.i - IL_0143: add - IL_0144: div.un - IL_0145: ldc.i8 0x1 - IL_014e: conv.i - IL_014f: add.ovf.un - IL_0150: nop - IL_0151: stloc.1 - IL_0152: ldc.i8 0x0 + IL_00e6: ldarg.2 + IL_00e7: bge.s IL_00f6 + + IL_00e9: ldc.i8 0x0 + IL_00f2: conv.i + IL_00f3: nop + IL_00f4: br.s IL_0137 + + IL_00f6: ldarg.2 + IL_00f7: ldarg.2 + IL_00f8: sub + IL_00f9: ldarg.1 + IL_00fa: div.un + IL_00fb: ldc.i8 0x1 + IL_0104: conv.i + IL_0105: add.ovf.un + IL_0106: nop + IL_0107: br.s IL_0137 + + IL_0109: ldarg.2 + IL_010a: ldarg.2 + IL_010b: bge.s IL_011a + + IL_010d: ldc.i8 0x0 + IL_0116: conv.i + IL_0117: nop + IL_0118: br.s IL_0137 + + IL_011a: ldarg.2 + IL_011b: ldarg.2 + IL_011c: sub + IL_011d: ldarg.1 + IL_011e: not + IL_011f: ldc.i8 0x1 + IL_0128: conv.i + IL_0129: add + IL_012a: div.un + IL_012b: ldc.i8 0x1 + IL_0134: conv.i + IL_0135: add.ovf.un + IL_0136: nop + IL_0137: stloc.1 + IL_0138: ldc.i8 0x0 + IL_0141: conv.i + IL_0142: stloc.2 + IL_0143: ldarg.2 + IL_0144: stloc.3 + IL_0145: br.s IL_015e + + IL_0147: ldloc.3 + IL_0148: call void assembly::set_c(native int) + IL_014d: ldloc.3 + IL_014e: ldarg.1 + IL_014f: add + IL_0150: stloc.3 + IL_0151: ldloc.2 + IL_0152: ldc.i8 0x1 IL_015b: conv.i - IL_015c: stloc.2 - IL_015d: ldarg.2 - IL_015e: stloc.3 - IL_015f: br.s IL_0178 - - IL_0161: ldloc.3 - IL_0162: call void assembly::set_c(native int) - IL_0167: ldloc.3 - IL_0168: ldarg.1 - IL_0169: add - IL_016a: stloc.3 - IL_016b: ldloc.2 - IL_016c: ldc.i8 0x1 - IL_0175: conv.i - IL_0176: add - IL_0177: stloc.2 - IL_0178: ldloc.2 - IL_0179: ldloc.1 - IL_017a: blt.un.s IL_0161 - - IL_017c: ret + IL_015c: add + IL_015d: stloc.2 + IL_015e: ldloc.2 + IL_015f: ldloc.1 + IL_0160: blt.un.s IL_0147 + + IL_0162: ret } .method public static void f11(native int start, @@ -1522,110 +1488,90 @@ IL_0179: ret - IL_017a: ldc.i8 0xfffffffffffffffe + IL_017a: ldc.i8 0x0 IL_0183: conv.i - IL_0184: ldc.i8 0x0 + IL_0184: ldc.i8 0xfffffffffffffffe IL_018d: conv.i - IL_018e: bne.un.s IL_01b7 + IL_018e: bge.s IL_01e4 - IL_0190: ldc.i8 0xa + IL_0190: ldc.i8 0x1 IL_0199: conv.i - IL_019a: ldc.i8 0xfffffffffffffffe + IL_019a: ldc.i8 0xa IL_01a3: conv.i - IL_01a4: ldc.i8 0x1 - IL_01ad: conv.i - IL_01ae: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, - native int, - native int) - IL_01b3: pop - IL_01b4: nop - IL_01b5: br.s IL_01b8 - - IL_01b7: nop - IL_01b8: ldc.i8 0x0 - IL_01c1: conv.i - IL_01c2: ldc.i8 0xfffffffffffffffe - IL_01cb: conv.i - IL_01cc: bge.s IL_0222 - - IL_01ce: ldc.i8 0x1 - IL_01d7: conv.i - IL_01d8: ldc.i8 0xa - IL_01e1: conv.i - IL_01e2: bge.s IL_01f4 - - IL_01e4: ldc.i8 0x0 + IL_01a4: bge.s IL_01b6 + + IL_01a6: ldc.i8 0x0 + IL_01af: conv.i + IL_01b0: nop + IL_01b1: br IL_023f + + IL_01b6: ldc.i8 0x1 + IL_01bf: conv.i + IL_01c0: ldc.i8 0xa + IL_01c9: conv.i + IL_01ca: sub + IL_01cb: ldc.i8 0xfffffffffffffffe + IL_01d4: conv.i + IL_01d5: div.un + IL_01d6: ldc.i8 0x1 + IL_01df: conv.i + IL_01e0: add.ovf.un + IL_01e1: nop + IL_01e2: br.s IL_023f + + IL_01e4: ldc.i8 0xa IL_01ed: conv.i - IL_01ee: nop - IL_01ef: br IL_027d - - IL_01f4: ldc.i8 0x1 - IL_01fd: conv.i - IL_01fe: ldc.i8 0xa - IL_0207: conv.i - IL_0208: sub - IL_0209: ldc.i8 0xfffffffffffffffe - IL_0212: conv.i - IL_0213: div.un - IL_0214: ldc.i8 0x1 - IL_021d: conv.i - IL_021e: add.ovf.un - IL_021f: nop - IL_0220: br.s IL_027d - - IL_0222: ldc.i8 0xa - IL_022b: conv.i - IL_022c: ldc.i8 0x1 - IL_0235: conv.i - IL_0236: bge.s IL_0245 - - IL_0238: ldc.i8 0x0 - IL_0241: conv.i - IL_0242: nop - IL_0243: br.s IL_027d - - IL_0245: ldc.i8 0xa - IL_024e: conv.i - IL_024f: ldc.i8 0x1 - IL_0258: conv.i - IL_0259: sub - IL_025a: ldc.i8 0xfffffffffffffffe - IL_0263: conv.i - IL_0264: not - IL_0265: ldc.i8 0x1 - IL_026e: conv.i - IL_026f: add - IL_0270: div.un - IL_0271: ldc.i8 0x1 - IL_027a: conv.i - IL_027b: add.ovf.un - IL_027c: nop - IL_027d: stloc.1 - IL_027e: ldc.i8 0x0 - IL_0287: conv.i - IL_0288: stloc.2 - IL_0289: ldc.i8 0xa - IL_0292: conv.i - IL_0293: stloc.3 - IL_0294: br.s IL_02b6 - - IL_0296: ldloc.3 - IL_0297: call void assembly::set_c(native int) - IL_029c: ldloc.3 - IL_029d: ldc.i8 0xfffffffffffffffe - IL_02a6: conv.i - IL_02a7: add - IL_02a8: stloc.3 - IL_02a9: ldloc.2 - IL_02aa: ldc.i8 0x1 - IL_02b3: conv.i - IL_02b4: add - IL_02b5: stloc.2 - IL_02b6: ldloc.2 - IL_02b7: ldloc.1 - IL_02b8: blt.un.s IL_0296 - - IL_02ba: ret + IL_01ee: ldc.i8 0x1 + IL_01f7: conv.i + IL_01f8: bge.s IL_0207 + + IL_01fa: ldc.i8 0x0 + IL_0203: conv.i + IL_0204: nop + IL_0205: br.s IL_023f + + IL_0207: ldc.i8 0xa + IL_0210: conv.i + IL_0211: ldc.i8 0x1 + IL_021a: conv.i + IL_021b: sub + IL_021c: ldc.i8 0xfffffffffffffffe + IL_0225: conv.i + IL_0226: not + IL_0227: ldc.i8 0x1 + IL_0230: conv.i + IL_0231: add + IL_0232: div.un + IL_0233: ldc.i8 0x1 + IL_023c: conv.i + IL_023d: add.ovf.un + IL_023e: nop + IL_023f: stloc.1 + IL_0240: ldc.i8 0x0 + IL_0249: conv.i + IL_024a: stloc.2 + IL_024b: ldc.i8 0xa + IL_0254: conv.i + IL_0255: stloc.3 + IL_0256: br.s IL_0278 + + IL_0258: ldloc.3 + IL_0259: call void assembly::set_c(native int) + IL_025e: ldloc.3 + IL_025f: ldc.i8 0xfffffffffffffffe + IL_0268: conv.i + IL_0269: add + IL_026a: stloc.3 + IL_026b: ldloc.2 + IL_026c: ldc.i8 0x1 + IL_0275: conv.i + IL_0276: add + IL_0277: stloc.2 + IL_0278: ldloc.2 + IL_0279: ldloc.1 + IL_027a: blt.un.s IL_0258 + + IL_027c: ret } .property native int c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl index adbb809bf26..1caa60e932e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -503,58 +503,42 @@ .method public static void f8(uint64 step) cil managed { - .maxstack 5 + .maxstack 4 .locals init (uint64 V_0, uint64 V_1, uint64 V_2) - IL_0000: ldarg.0 - IL_0001: brtrue.s IL_0012 - - IL_0003: ldc.i4.1 - IL_0004: conv.i8 - IL_0005: ldarg.0 - IL_0006: ldc.i4.s 10 - IL_0008: conv.i8 - IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_000e: pop - IL_000f: nop - IL_0010: br.s IL_0013 + IL_0000: ldc.i4.s 9 + IL_0002: conv.i8 + IL_0003: ldarg.0 + IL_0004: div.un + IL_0005: ldc.i4.1 + IL_0006: conv.i8 + IL_0007: add.ovf.un + IL_0008: stloc.0 + IL_0009: ldc.i4.0 + IL_000a: conv.i8 + IL_000b: stloc.1 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: stloc.2 + IL_000f: br.s IL_0020 - IL_0012: nop - IL_0013: ldc.i4.s 9 - IL_0015: conv.i8 - IL_0016: ldarg.0 - IL_0017: div.un - IL_0018: ldc.i4.1 - IL_0019: conv.i8 - IL_001a: add.ovf.un - IL_001b: stloc.0 - IL_001c: ldc.i4.0 + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint64) + IL_0017: ldloc.2 + IL_0018: ldarg.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 IL_001d: conv.i8 - IL_001e: stloc.1 - IL_001f: ldc.i4.1 - IL_0020: conv.i8 - IL_0021: stloc.2 - IL_0022: br.s IL_0033 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0011 - IL_0024: ldloc.2 - IL_0025: call void assembly::set_c(uint64) - IL_002a: ldloc.2 - IL_002b: ldarg.0 - IL_002c: add - IL_002d: stloc.2 - IL_002e: ldloc.1 - IL_002f: ldc.i4.1 - IL_0030: conv.i8 - IL_0031: add - IL_0032: stloc.1 - IL_0033: ldloc.1 - IL_0034: ldloc.0 - IL_0035: blt.un.s IL_0024 - - IL_0037: ret + IL_0024: ret } .method public static void f9(uint64 finish) cil managed @@ -696,62 +680,48 @@ IL_004f: ret - IL_0050: ldarg.1 - IL_0051: brtrue.s IL_005f - - IL_0053: ldarg.2 - IL_0054: ldarg.1 - IL_0055: ldarg.2 - IL_0056: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, - uint64, - uint64) - IL_005b: pop - IL_005c: nop - IL_005d: br.s IL_0060 - - IL_005f: nop - IL_0060: ldarg.2 - IL_0061: ldarg.2 - IL_0062: bge.un.s IL_0069 - - IL_0064: ldc.i4.0 - IL_0065: conv.i8 - IL_0066: nop - IL_0067: br.s IL_0072 - - IL_0069: ldarg.2 - IL_006a: ldarg.2 - IL_006b: sub - IL_006c: ldarg.1 - IL_006d: div.un - IL_006e: ldc.i4.1 - IL_006f: conv.i8 - IL_0070: add.ovf.un - IL_0071: nop - IL_0072: stloc.1 - IL_0073: ldc.i4.0 - IL_0074: conv.i8 - IL_0075: stloc.2 - IL_0076: ldarg.2 - IL_0077: stloc.3 - IL_0078: br.s IL_0089 - - IL_007a: ldloc.3 - IL_007b: call void assembly::set_c(uint64) - IL_0080: ldloc.3 - IL_0081: ldarg.1 - IL_0082: add - IL_0083: stloc.3 - IL_0084: ldloc.2 - IL_0085: ldc.i4.1 - IL_0086: conv.i8 - IL_0087: add - IL_0088: stloc.2 - IL_0089: ldloc.2 - IL_008a: ldloc.1 - IL_008b: blt.un.s IL_007a - - IL_008d: ret + IL_0050: ldarg.2 + IL_0051: ldarg.2 + IL_0052: bge.un.s IL_0059 + + IL_0054: ldc.i4.0 + IL_0055: conv.i8 + IL_0056: nop + IL_0057: br.s IL_0062 + + IL_0059: ldarg.2 + IL_005a: ldarg.2 + IL_005b: sub + IL_005c: ldarg.1 + IL_005d: div.un + IL_005e: ldc.i4.1 + IL_005f: conv.i8 + IL_0060: add.ovf.un + IL_0061: nop + IL_0062: stloc.1 + IL_0063: ldc.i4.0 + IL_0064: conv.i8 + IL_0065: stloc.2 + IL_0066: ldarg.2 + IL_0067: stloc.3 + IL_0068: br.s IL_0079 + + IL_006a: ldloc.3 + IL_006b: call void assembly::set_c(uint64) + IL_0070: ldloc.3 + IL_0071: ldarg.1 + IL_0072: add + IL_0073: stloc.3 + IL_0074: ldloc.2 + IL_0075: ldc.i4.1 + IL_0076: conv.i8 + IL_0077: add + IL_0078: stloc.2 + IL_0079: ldloc.2 + IL_007a: ldloc.1 + IL_007b: blt.un.s IL_006a + + IL_007d: ret } .method public static void f11(uint64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl index ef87d0f42b8..6046c8843ba 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -761,71 +761,53 @@ IL_00e4: ret - IL_00e5: ldarg.0 - IL_00e6: ldc.i8 0x0 - IL_00ef: conv.u - IL_00f0: bne.un.s IL_0110 - - IL_00f2: ldc.i8 0x1 - IL_00fb: conv.u - IL_00fc: ldarg.0 - IL_00fd: ldc.i8 0xa - IL_0106: conv.u - IL_0107: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, - native uint, - native uint) - IL_010c: pop - IL_010d: nop - IL_010e: br.s IL_0111 - - IL_0110: nop - IL_0111: ldc.i8 0xa - IL_011a: conv.u - IL_011b: ldc.i8 0x1 - IL_0124: conv.u - IL_0125: bge.un.s IL_0134 - - IL_0127: ldc.i8 0x0 - IL_0130: conv.u - IL_0131: nop - IL_0132: br.s IL_0157 - - IL_0134: ldc.i8 0xa - IL_013d: conv.u - IL_013e: ldc.i8 0x1 - IL_0147: conv.u - IL_0148: sub - IL_0149: ldarg.0 - IL_014a: div.un - IL_014b: ldc.i8 0x1 - IL_0154: conv.u - IL_0155: add.ovf.un - IL_0156: nop - IL_0157: stloc.1 - IL_0158: ldc.i8 0x0 - IL_0161: conv.u - IL_0162: stloc.2 - IL_0163: ldc.i8 0x1 - IL_016c: conv.u - IL_016d: stloc.3 - IL_016e: br.s IL_0187 - - IL_0170: ldloc.3 - IL_0171: call void assembly::set_c(native uint) - IL_0176: ldloc.3 - IL_0177: ldarg.0 - IL_0178: add - IL_0179: stloc.3 - IL_017a: ldloc.2 - IL_017b: ldc.i8 0x1 - IL_0184: conv.u - IL_0185: add - IL_0186: stloc.2 - IL_0187: ldloc.2 - IL_0188: ldloc.1 - IL_0189: blt.un.s IL_0170 - - IL_018b: ret + IL_00e5: ldc.i8 0xa + IL_00ee: conv.u + IL_00ef: ldc.i8 0x1 + IL_00f8: conv.u + IL_00f9: bge.un.s IL_0108 + + IL_00fb: ldc.i8 0x0 + IL_0104: conv.u + IL_0105: nop + IL_0106: br.s IL_012b + + IL_0108: ldc.i8 0xa + IL_0111: conv.u + IL_0112: ldc.i8 0x1 + IL_011b: conv.u + IL_011c: sub + IL_011d: ldarg.0 + IL_011e: div.un + IL_011f: ldc.i8 0x1 + IL_0128: conv.u + IL_0129: add.ovf.un + IL_012a: nop + IL_012b: stloc.1 + IL_012c: ldc.i8 0x0 + IL_0135: conv.u + IL_0136: stloc.2 + IL_0137: ldc.i8 0x1 + IL_0140: conv.u + IL_0141: stloc.3 + IL_0142: br.s IL_015b + + IL_0144: ldloc.3 + IL_0145: call void assembly::set_c(native uint) + IL_014a: ldloc.3 + IL_014b: ldarg.0 + IL_014c: add + IL_014d: stloc.3 + IL_014e: ldloc.2 + IL_014f: ldc.i8 0x1 + IL_0158: conv.u + IL_0159: add + IL_015a: stloc.2 + IL_015b: ldloc.2 + IL_015c: ldloc.1 + IL_015d: blt.un.s IL_0144 + + IL_015f: ret } .method public static void f9(native uint finish) cil managed @@ -982,64 +964,48 @@ IL_00a5: ret - IL_00a6: ldarg.1 - IL_00a7: ldc.i8 0x0 - IL_00b0: conv.u - IL_00b1: bne.un.s IL_00bf - - IL_00b3: ldarg.2 - IL_00b4: ldarg.1 - IL_00b5: ldarg.2 - IL_00b6: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, - native uint, - native uint) - IL_00bb: pop - IL_00bc: nop - IL_00bd: br.s IL_00c0 - - IL_00bf: nop - IL_00c0: ldarg.2 - IL_00c1: ldarg.2 - IL_00c2: bge.un.s IL_00d1 + IL_00a6: ldarg.2 + IL_00a7: ldarg.2 + IL_00a8: bge.un.s IL_00b7 - IL_00c4: ldc.i8 0x0 - IL_00cd: conv.u - IL_00ce: nop - IL_00cf: br.s IL_00e2 - - IL_00d1: ldarg.2 - IL_00d2: ldarg.2 - IL_00d3: sub - IL_00d4: ldarg.1 - IL_00d5: div.un - IL_00d6: ldc.i8 0x1 - IL_00df: conv.u - IL_00e0: add.ovf.un - IL_00e1: nop - IL_00e2: stloc.1 - IL_00e3: ldc.i8 0x0 + IL_00aa: ldc.i8 0x0 + IL_00b3: conv.u + IL_00b4: nop + IL_00b5: br.s IL_00c8 + + IL_00b7: ldarg.2 + IL_00b8: ldarg.2 + IL_00b9: sub + IL_00ba: ldarg.1 + IL_00bb: div.un + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.u + IL_00c6: add.ovf.un + IL_00c7: nop + IL_00c8: stloc.1 + IL_00c9: ldc.i8 0x0 + IL_00d2: conv.u + IL_00d3: stloc.2 + IL_00d4: ldarg.2 + IL_00d5: stloc.3 + IL_00d6: br.s IL_00ef + + IL_00d8: ldloc.3 + IL_00d9: call void assembly::set_c(native uint) + IL_00de: ldloc.3 + IL_00df: ldarg.1 + IL_00e0: add + IL_00e1: stloc.3 + IL_00e2: ldloc.2 + IL_00e3: ldc.i8 0x1 IL_00ec: conv.u - IL_00ed: stloc.2 - IL_00ee: ldarg.2 - IL_00ef: stloc.3 - IL_00f0: br.s IL_0109 - - IL_00f2: ldloc.3 - IL_00f3: call void assembly::set_c(native uint) - IL_00f8: ldloc.3 - IL_00f9: ldarg.1 - IL_00fa: add - IL_00fb: stloc.3 - IL_00fc: ldloc.2 - IL_00fd: ldc.i8 0x1 - IL_0106: conv.u - IL_0107: add - IL_0108: stloc.2 - IL_0109: ldloc.2 - IL_010a: ldloc.1 - IL_010b: blt.un.s IL_00f2 - - IL_010d: ret + IL_00ed: add + IL_00ee: stloc.2 + IL_00ef: ldloc.2 + IL_00f0: ldloc.1 + IL_00f1: blt.un.s IL_00d8 + + IL_00f3: ret } .method public static void f11(native uint start, From ae9624a07e9bec5e9cd939ca22fc39677ff77ece Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Wed, 28 Feb 2024 10:04:16 -0500 Subject: [PATCH 60/66] Need that --- src/Compiler/TypedTree/TypedTreeOps.fs | 2 +- .../UInt64RangeArrays.fs.il.bsl | 514 ++++++++++-------- .../UInt64RangeLists.fs.il.bsl | 426 ++++++++------- .../ForEachRangeStepInt64.fs.opt.il.bsl | 94 ++-- .../ForEachRangeStepUInt64.fs.opt.il.bsl | 76 ++- 5 files changed, 634 insertions(+), 478 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 72965290a5f..ffa23e150f4 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10706,7 +10706,7 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = // The total count could not exceed 2⁶⁴. | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) | Expr.Const (value = Const.UInt64 _), _ | _, Expr.Const (value = Const.UInt64 _) -> - RangeCount.Safe (mkCount mkAddOne) + RangeCount.Safe (mkThrowIfStepIsZero (mkCount mkAddOne)) | _ -> mkRuntimeCalc mkThrowIfStepIsZero (mkCount id) (mkCount mkAddOne) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl index ea6769af1e5..2a5b52af33d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl @@ -579,71 +579,87 @@ uint64 V_3, uint64 V_4) IL_0000: nop - IL_0001: ldc.i4.s 10 - IL_0003: conv.i8 + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0013 + IL_0004: ldc.i4.1 IL_0005: conv.i8 - IL_0006: bge.un.s IL_000d - - IL_0008: ldc.i4.0 + IL_0006: ldarg.0 + IL_0007: ldc.i4.s 10 IL_0009: conv.i8 - IL_000a: nop - IL_000b: br.s IL_0019 + IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000f: pop + IL_0010: nop + IL_0011: br.s IL_0014 - IL_000d: ldc.i4.s 10 - IL_000f: conv.i8 - IL_0010: ldc.i4.1 - IL_0011: conv.i8 - IL_0012: sub - IL_0013: ldarg.0 - IL_0014: div.un - IL_0015: ldc.i4.1 + IL_0013: nop + IL_0014: ldc.i4.s 10 IL_0016: conv.i8 - IL_0017: add.ovf.un - IL_0018: nop - IL_0019: stloc.0 - IL_001a: ldloc.0 - IL_001b: stloc.1 - IL_001c: ldloc.1 - IL_001d: ldc.i4.1 - IL_001e: conv.i8 - IL_001f: bge.un.s IL_0027 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0020 - IL_0021: call !!0[] [runtime]System.Array::Empty() - IL_0026: ret + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_002c - IL_0027: ldloc.1 - IL_0028: conv.ovf.i.un - IL_0029: newarr [runtime]System.UInt64 - IL_002e: stloc.2 - IL_002f: ldc.i4.0 - IL_0030: conv.i8 - IL_0031: stloc.3 - IL_0032: ldc.i4.1 - IL_0033: conv.i8 - IL_0034: stloc.s V_4 - IL_0036: br.s IL_0049 + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: div.un + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add.ovf.un + IL_002b: nop + IL_002c: stloc.0 + IL_002d: ldloc.0 + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: bge.un.s IL_003a - IL_0038: ldloc.2 - IL_0039: ldloc.3 - IL_003a: conv.i - IL_003b: ldloc.s V_4 - IL_003d: stelem.i8 - IL_003e: ldloc.s V_4 - IL_0040: ldarg.0 - IL_0041: add - IL_0042: stloc.s V_4 - IL_0044: ldloc.3 + IL_0034: call !!0[] [runtime]System.Array::Empty() + IL_0039: ret + + IL_003a: ldloc.1 + IL_003b: conv.ovf.i.un + IL_003c: newarr [runtime]System.UInt64 + IL_0041: stloc.2 + IL_0042: ldc.i4.0 + IL_0043: conv.i8 + IL_0044: stloc.3 IL_0045: ldc.i4.1 IL_0046: conv.i8 - IL_0047: add - IL_0048: stloc.3 - IL_0049: ldloc.3 - IL_004a: ldloc.0 - IL_004b: blt.un.s IL_0038 + IL_0047: stloc.s V_4 + IL_0049: br.s IL_005c - IL_004d: ldloc.2 - IL_004e: ret + IL_004b: ldloc.2 + IL_004c: ldloc.3 + IL_004d: conv.i + IL_004e: ldloc.s V_4 + IL_0050: stelem.i8 + IL_0051: ldloc.s V_4 + IL_0053: ldarg.0 + IL_0054: add + IL_0055: stloc.s V_4 + IL_0057: ldloc.3 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.3 + IL_005c: ldloc.3 + IL_005d: ldloc.0 + IL_005e: blt.un.s IL_004b + + IL_0060: ldloc.2 + IL_0061: ret } .method public static uint64[] f11(uint64 finish) cil managed @@ -732,68 +748,83 @@ uint64 V_3, uint64 V_4) IL_0000: nop - IL_0001: ldc.i4.s 10 - IL_0003: conv.i8 - IL_0004: ldarg.0 - IL_0005: bge.un.s IL_000c + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0012 - IL_0007: ldc.i4.0 + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 IL_0008: conv.i8 - IL_0009: nop - IL_000a: br.s IL_0017 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 - IL_000c: ldc.i4.s 10 - IL_000e: conv.i8 - IL_000f: ldarg.0 - IL_0010: sub - IL_0011: ldarg.1 - IL_0012: div.un - IL_0013: ldc.i4.1 - IL_0014: conv.i8 - IL_0015: add.ovf.un - IL_0016: nop - IL_0017: stloc.0 - IL_0018: ldloc.0 - IL_0019: stloc.1 - IL_001a: ldloc.1 - IL_001b: ldc.i4.1 - IL_001c: conv.i8 - IL_001d: bge.un.s IL_0025 + IL_0012: nop + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e - IL_001f: call !!0[] [runtime]System.Array::Empty() - IL_0024: ret + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0029 - IL_0025: ldloc.1 - IL_0026: conv.ovf.i.un - IL_0027: newarr [runtime]System.UInt64 - IL_002c: stloc.2 - IL_002d: ldc.i4.0 + IL_001e: ldc.i4.s 10 + IL_0020: conv.i8 + IL_0021: ldarg.0 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: div.un + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldloc.0 + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldc.i4.1 IL_002e: conv.i8 - IL_002f: stloc.3 - IL_0030: ldarg.0 - IL_0031: stloc.s V_4 - IL_0033: br.s IL_0046 - - IL_0035: ldloc.2 - IL_0036: ldloc.3 - IL_0037: conv.i - IL_0038: ldloc.s V_4 - IL_003a: stelem.i8 - IL_003b: ldloc.s V_4 - IL_003d: ldarg.1 - IL_003e: add - IL_003f: stloc.s V_4 - IL_0041: ldloc.3 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: stloc.3 - IL_0046: ldloc.3 - IL_0047: ldloc.0 - IL_0048: blt.un.s IL_0035 - - IL_004a: ldloc.2 - IL_004b: ret + IL_002f: bge.un.s IL_0037 + + IL_0031: call !!0[] [runtime]System.Array::Empty() + IL_0036: ret + + IL_0037: ldloc.1 + IL_0038: conv.ovf.i.un + IL_0039: newarr [runtime]System.UInt64 + IL_003e: stloc.2 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 + IL_0041: stloc.3 + IL_0042: ldarg.0 + IL_0043: stloc.s V_4 + IL_0045: br.s IL_0058 + + IL_0047: ldloc.2 + IL_0048: ldloc.3 + IL_0049: conv.i + IL_004a: ldloc.s V_4 + IL_004c: stelem.i8 + IL_004d: ldloc.s V_4 + IL_004f: ldarg.1 + IL_0050: add + IL_0051: stloc.s V_4 + IL_0053: ldloc.3 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add + IL_0057: stloc.3 + IL_0058: ldloc.3 + IL_0059: ldloc.0 + IL_005a: blt.un.s IL_0047 + + IL_005c: ldloc.2 + IL_005d: ret } .method public static uint64[] f13(uint64 start, @@ -966,69 +997,84 @@ uint64 V_3, uint64 V_4) IL_0000: nop - IL_0001: ldarg.1 - IL_0002: ldc.i4.1 - IL_0003: conv.i8 - IL_0004: bge.un.s IL_000b + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 - IL_0006: ldc.i4.0 - IL_0007: conv.i8 - IL_0008: nop - IL_0009: br.s IL_0015 + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 - IL_000b: ldarg.1 - IL_000c: ldc.i4.1 - IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldarg.0 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: stloc.1 - IL_0018: ldloc.1 - IL_0019: ldc.i4.1 - IL_001a: conv.i8 - IL_001b: bge.un.s IL_0023 + IL_0011: nop + IL_0012: ldarg.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: bge.un.s IL_001c - IL_001d: call !!0[] [runtime]System.Array::Empty() - IL_0022: ret + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: nop + IL_001a: br.s IL_0026 - IL_0023: ldloc.1 - IL_0024: conv.ovf.i.un - IL_0025: newarr [runtime]System.UInt64 - IL_002a: stloc.2 - IL_002b: ldc.i4.0 - IL_002c: conv.i8 - IL_002d: stloc.3 - IL_002e: ldc.i4.1 - IL_002f: conv.i8 - IL_0030: stloc.s V_4 - IL_0032: br.s IL_0045 - - IL_0034: ldloc.2 - IL_0035: ldloc.3 - IL_0036: conv.i - IL_0037: ldloc.s V_4 - IL_0039: stelem.i8 - IL_003a: ldloc.s V_4 - IL_003c: ldarg.0 - 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_0034 + IL_001c: ldarg.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add.ovf.un + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldloc.0 + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: bge.un.s IL_0034 - IL_0049: ldloc.2 - IL_004a: ret + IL_002e: call !!0[] [runtime]System.Array::Empty() + IL_0033: ret + + IL_0034: ldloc.1 + IL_0035: conv.ovf.i.un + IL_0036: newarr [runtime]System.UInt64 + IL_003b: stloc.2 + IL_003c: ldc.i4.0 + IL_003d: conv.i8 + IL_003e: stloc.3 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: stloc.s V_4 + IL_0043: br.s IL_0056 + + IL_0045: ldloc.2 + IL_0046: ldloc.3 + IL_0047: conv.i + IL_0048: ldloc.s V_4 + IL_004a: stelem.i8 + IL_004b: ldloc.s V_4 + IL_004d: ldarg.0 + IL_004e: add + IL_004f: stloc.s V_4 + IL_0051: ldloc.3 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.3 + IL_0056: ldloc.3 + IL_0057: ldloc.0 + IL_0058: blt.un.s IL_0045 + + IL_005a: ldloc.2 + IL_005b: ret } .method public static uint64[] f15(uint64 start, @@ -1621,71 +1667,87 @@ 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: conv.i8 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_001a + IL_000b: ldc.i4.1 IL_000c: conv.i8 - IL_000d: bge.un.s IL_0014 - - IL_000f: ldc.i4.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.s 10 IL_0010: conv.i8 - IL_0011: nop - IL_0012: br.s IL_0020 + IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0016: pop + IL_0017: nop + IL_0018: br.s IL_001b - IL_0014: ldc.i4.s 10 - IL_0016: conv.i8 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: sub - IL_001a: ldloc.0 - IL_001b: div.un - IL_001c: ldc.i4.1 + IL_001a: nop + IL_001b: ldc.i4.s 10 IL_001d: conv.i8 - IL_001e: add.ovf.un - IL_001f: nop - IL_0020: stloc.1 - IL_0021: ldloc.1 - IL_0022: stloc.2 - IL_0023: ldloc.2 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: bge.un.s IL_002e - - IL_0028: call !!0[] [runtime]System.Array::Empty() - IL_002d: ret - - IL_002e: ldloc.2 - IL_002f: conv.ovf.i.un - IL_0030: newarr [runtime]System.UInt64 - IL_0035: stloc.3 - IL_0036: ldc.i4.0 - IL_0037: conv.i8 - IL_0038: stloc.s V_4 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 - IL_003c: stloc.s V_5 - IL_003e: br.s IL_0054 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0027 - IL_0040: ldloc.3 - IL_0041: ldloc.s V_4 - IL_0043: conv.i - IL_0044: ldloc.s V_5 - IL_0046: stelem.i8 - IL_0047: ldloc.s V_5 - IL_0049: ldloc.0 - IL_004a: add - IL_004b: stloc.s V_5 - IL_004d: ldloc.s V_4 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: add - IL_0052: stloc.s V_4 - IL_0054: ldloc.s V_4 - IL_0056: ldloc.1 - IL_0057: blt.un.s IL_0040 + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_0033 - IL_0059: ldloc.3 - IL_005a: ret + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: div.un + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add.ovf.un + IL_0032: nop + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: stloc.2 + IL_0036: ldloc.2 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: bge.un.s IL_0041 + + IL_003b: call !!0[] [runtime]System.Array::Empty() + IL_0040: ret + + IL_0041: ldloc.2 + IL_0042: conv.ovf.i.un + IL_0043: newarr [runtime]System.UInt64 + IL_0048: stloc.3 + IL_0049: ldc.i4.0 + IL_004a: conv.i8 + IL_004b: stloc.s V_4 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: stloc.s V_5 + IL_0051: br.s IL_0067 + + IL_0053: ldloc.3 + IL_0054: ldloc.s V_4 + IL_0056: conv.i + IL_0057: ldloc.s V_5 + IL_0059: stelem.i8 + IL_005a: ldloc.s V_5 + IL_005c: ldloc.0 + IL_005d: add + IL_005e: stloc.s V_5 + IL_0060: ldloc.s V_4 + IL_0062: ldc.i4.1 + IL_0063: conv.i8 + IL_0064: add + IL_0065: stloc.s V_4 + IL_0067: ldloc.s V_4 + IL_0069: ldloc.1 + IL_006a: blt.un.s IL_0053 + + IL_006c: ldloc.3 + IL_006d: ret } .method public static uint64[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl index 5edd2a8810d..80965d37a52 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl @@ -481,63 +481,79 @@ .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f10(uint64 step) cil managed { - .maxstack 4 + .maxstack 5 .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, uint64 V_2, uint64 V_3) IL_0000: nop - IL_0001: ldc.i4.s 10 - IL_0003: conv.i8 + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0013 + IL_0004: ldc.i4.1 IL_0005: conv.i8 - IL_0006: bge.un.s IL_000d - - IL_0008: ldc.i4.0 + IL_0006: ldarg.0 + IL_0007: ldc.i4.s 10 IL_0009: conv.i8 - IL_000a: nop - IL_000b: br.s IL_0019 + IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000f: pop + IL_0010: nop + IL_0011: br.s IL_0014 - IL_000d: ldc.i4.s 10 - IL_000f: conv.i8 - IL_0010: ldc.i4.1 - IL_0011: conv.i8 - IL_0012: sub - IL_0013: ldarg.0 - IL_0014: div.un - IL_0015: ldc.i4.1 + IL_0013: nop + IL_0014: ldc.i4.s 10 IL_0016: conv.i8 - IL_0017: add.ovf.un - IL_0018: nop - IL_0019: stloc.0 - IL_001a: ldc.i4.0 - IL_001b: conv.i8 - IL_001c: stloc.2 - IL_001d: ldc.i4.1 - IL_001e: conv.i8 - IL_001f: stloc.3 - IL_0020: br.s IL_0034 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0020 - IL_0022: ldloca.s V_1 - IL_0024: ldloc.3 - IL_0025: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_002a: nop - IL_002b: ldloc.3 - IL_002c: ldarg.0 - IL_002d: add - IL_002e: stloc.3 - IL_002f: ldloc.2 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_002c + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: div.un + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add.ovf.un + IL_002b: nop + IL_002c: stloc.0 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: stloc.2 IL_0030: ldc.i4.1 IL_0031: conv.i8 - IL_0032: add - IL_0033: stloc.2 - IL_0034: ldloc.2 - IL_0035: ldloc.0 - IL_0036: blt.un.s IL_0022 - - IL_0038: ldloca.s V_1 - IL_003a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_003f: ret + IL_0032: stloc.3 + IL_0033: br.s IL_0047 + + IL_0035: ldloca.s V_1 + IL_0037: ldloc.3 + IL_0038: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003d: nop + IL_003e: ldloc.3 + IL_003f: ldarg.0 + IL_0040: add + IL_0041: stloc.3 + IL_0042: ldloc.2 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.2 + IL_0047: ldloc.2 + IL_0048: ldloc.0 + IL_0049: blt.un.s IL_0035 + + IL_004b: ldloca.s V_1 + 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 f11(uint64 finish) cil managed @@ -605,60 +621,75 @@ { .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 + .maxstack 5 .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, uint64 V_2, uint64 V_3) IL_0000: nop - IL_0001: ldc.i4.s 10 - IL_0003: conv.i8 - IL_0004: ldarg.0 - IL_0005: bge.un.s IL_000c + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0012 - IL_0007: ldc.i4.0 + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 IL_0008: conv.i8 - IL_0009: nop - IL_000a: br.s IL_0017 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 - IL_000c: ldc.i4.s 10 - IL_000e: conv.i8 - IL_000f: ldarg.0 - IL_0010: sub - IL_0011: ldarg.1 - IL_0012: div.un - IL_0013: ldc.i4.1 - IL_0014: conv.i8 - IL_0015: add.ovf.un - IL_0016: nop - IL_0017: stloc.0 - IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: stloc.2 - IL_001b: ldarg.0 - IL_001c: stloc.3 - IL_001d: br.s IL_0031 + IL_0012: nop + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e - IL_001f: ldloca.s V_1 - IL_0021: ldloc.3 - IL_0022: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0027: nop - IL_0028: ldloc.3 - IL_0029: ldarg.1 - IL_002a: add - IL_002b: stloc.3 - IL_002c: ldloc.2 - IL_002d: ldc.i4.1 - IL_002e: conv.i8 - IL_002f: add - IL_0030: stloc.2 - IL_0031: ldloc.2 - IL_0032: ldloc.0 - IL_0033: blt.un.s IL_001f + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0029 - IL_0035: ldloca.s V_1 - IL_0037: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_003c: ret + IL_001e: ldc.i4.s 10 + IL_0020: conv.i8 + IL_0021: ldarg.0 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: div.un + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.2 + IL_002d: ldarg.0 + IL_002e: stloc.3 + IL_002f: br.s IL_0043 + + IL_0031: ldloca.s V_1 + IL_0033: ldloc.3 + IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0039: nop + IL_003a: ldloc.3 + IL_003b: ldarg.1 + IL_003c: add + IL_003d: stloc.3 + IL_003e: ldloc.2 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.2 + IL_0043: ldloc.2 + IL_0044: ldloc.0 + IL_0045: blt.un.s IL_0031 + + IL_0047: ldloca.s V_1 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -794,61 +825,76 @@ { .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 + .maxstack 5 .locals init (uint64 V_0, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, uint64 V_2, uint64 V_3) IL_0000: nop - IL_0001: ldarg.1 - IL_0002: ldc.i4.1 - IL_0003: conv.i8 - IL_0004: bge.un.s IL_000b + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 - IL_0006: ldc.i4.0 - IL_0007: conv.i8 - IL_0008: nop - IL_0009: br.s IL_0015 + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 - IL_000b: ldarg.1 - IL_000c: ldc.i4.1 - IL_000d: conv.i8 - IL_000e: sub - IL_000f: ldarg.0 - IL_0010: div.un - IL_0011: ldc.i4.1 - IL_0012: conv.i8 - IL_0013: add.ovf.un - IL_0014: nop - IL_0015: stloc.0 - IL_0016: ldc.i4.0 - IL_0017: conv.i8 - IL_0018: stloc.2 - IL_0019: ldc.i4.1 - IL_001a: conv.i8 - IL_001b: stloc.3 - IL_001c: br.s IL_0030 - - IL_001e: ldloca.s V_1 - IL_0020: ldloc.3 - 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: ldarg.0 - 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_001e + IL_0011: nop + IL_0012: ldarg.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: bge.un.s IL_001c - 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 + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: nop + IL_001a: br.s IL_0026 + + IL_001c: ldarg.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add.ovf.un + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: br.s IL_0041 + + IL_002f: ldloca.s V_1 + IL_0031: ldloc.3 + IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0037: nop + IL_0038: ldloc.3 + IL_0039: ldarg.0 + IL_003a: add + IL_003b: stloc.3 + IL_003c: ldloc.2 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.2 + IL_0041: ldloc.2 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_002f + + IL_0045: ldloca.s V_1 + IL_0047: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004c: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -1321,7 +1367,7 @@ .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 + .maxstack 5 .locals init (uint64 V_0, uint64 V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, @@ -1331,57 +1377,73 @@ 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: conv.i8 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_001a + IL_000b: ldc.i4.1 IL_000c: conv.i8 - IL_000d: bge.un.s IL_0014 - - IL_000f: ldc.i4.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.s 10 IL_0010: conv.i8 - IL_0011: nop - IL_0012: br.s IL_0020 + IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0016: pop + IL_0017: nop + IL_0018: br.s IL_001b - IL_0014: ldc.i4.s 10 - IL_0016: conv.i8 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: sub - IL_001a: ldloc.0 - IL_001b: div.un - IL_001c: ldc.i4.1 + IL_001a: nop + IL_001b: ldc.i4.s 10 IL_001d: conv.i8 - IL_001e: add.ovf.un - IL_001f: nop - IL_0020: stloc.1 - IL_0021: ldc.i4.0 - IL_0022: conv.i8 - IL_0023: stloc.3 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: stloc.s V_4 - IL_0028: br.s IL_003f - - IL_002a: ldloca.s V_2 - IL_002c: ldloc.s V_4 - IL_002e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0033: nop - IL_0034: ldloc.s V_4 - IL_0036: ldloc.0 - IL_0037: add - IL_0038: stloc.s V_4 - IL_003a: ldloc.3 - IL_003b: ldc.i4.1 - IL_003c: conv.i8 - IL_003d: add - IL_003e: stloc.3 - IL_003f: ldloc.3 - IL_0040: ldloc.1 - IL_0041: blt.un.s IL_002a - - IL_0043: ldloca.s V_2 - IL_0045: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_004a: ret + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_0033 + + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: div.un + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add.ovf.un + IL_0032: nop + IL_0033: stloc.1 + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: stloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: stloc.s V_4 + IL_003b: br.s IL_0052 + + IL_003d: ldloca.s V_2 + IL_003f: ldloc.s V_4 + IL_0041: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0046: nop + IL_0047: ldloc.s V_4 + IL_0049: ldloc.0 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.3 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.3 + IL_0053: ldloc.1 + IL_0054: blt.un.s IL_003d + + IL_0056: ldloca.s V_2 + 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 } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl index 0c9ef13dbb4..6ff23e775ec 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepInt64.fs.opt.il.bsl @@ -503,53 +503,69 @@ .method public static void f8(int64 step) cil managed { - .maxstack 4 + .maxstack 5 .locals init (uint64 V_0, uint64 V_1, int64 V_2) - IL_0000: ldc.i4.0 - IL_0001: conv.i8 - IL_0002: ldarg.0 - IL_0003: bge.s IL_0010 + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 - IL_0005: ldc.i4.s 9 - IL_0007: conv.i8 - IL_0008: ldarg.0 - IL_0009: div.un - IL_000a: ldc.i4.1 - IL_000b: conv.i8 - IL_000c: add.ovf.un - IL_000d: nop - IL_000e: br.s IL_0013 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 - IL_0010: ldc.i4.0 - IL_0011: conv.i8 IL_0012: nop - IL_0013: stloc.0 - IL_0014: ldc.i4.0 - IL_0015: conv.i8 - IL_0016: stloc.1 - IL_0017: ldc.i4.1 - IL_0018: conv.i8 - IL_0019: stloc.2 - IL_001a: br.s IL_002b + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: ldarg.0 + IL_0016: bge.s IL_0023 - IL_001c: ldloc.2 - IL_001d: call void assembly::set_c(int64) - IL_0022: ldloc.2 - IL_0023: ldarg.0 - IL_0024: add - IL_0025: stloc.2 - IL_0026: ldloc.1 - IL_0027: ldc.i4.1 + IL_0018: ldc.i4.s 9 + IL_001a: conv.i8 + IL_001b: ldarg.0 + IL_001c: div.un + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add.ovf.un + IL_0020: nop + IL_0021: br.s IL_0026 + + IL_0023: ldc.i4.0 + IL_0024: conv.i8 + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldc.i4.0 IL_0028: conv.i8 - IL_0029: add - IL_002a: stloc.1 - IL_002b: ldloc.1 - IL_002c: ldloc.0 - IL_002d: blt.un.s IL_001c - - IL_002f: ret + IL_0029: stloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.2 + IL_002d: br.s IL_003e + + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(int64) + IL_0035: ldloc.2 + IL_0036: ldarg.0 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.1 + IL_003e: ldloc.1 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_002f + + IL_0042: ret } .method public static void f9(int64 finish) cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl index 1caa60e932e..f676754bcbb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -503,42 +503,58 @@ .method public static void f8(uint64 step) cil managed { - .maxstack 4 + .maxstack 5 .locals init (uint64 V_0, uint64 V_1, uint64 V_2) - IL_0000: ldc.i4.s 9 - IL_0002: conv.i8 - IL_0003: ldarg.0 - IL_0004: div.un - IL_0005: ldc.i4.1 - IL_0006: conv.i8 - IL_0007: add.ovf.un - IL_0008: stloc.0 - IL_0009: ldc.i4.0 - IL_000a: conv.i8 - IL_000b: stloc.1 - IL_000c: ldc.i4.1 - IL_000d: conv.i8 - IL_000e: stloc.2 - IL_000f: br.s IL_0020 + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 - IL_0011: ldloc.2 - IL_0012: call void assembly::set_c(uint64) - IL_0017: ldloc.2 - IL_0018: ldarg.0 - IL_0019: add - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: ldc.i4.1 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 9 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: div.un + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: stloc.0 + IL_001c: ldc.i4.0 IL_001d: conv.i8 - IL_001e: add - IL_001f: stloc.1 - IL_0020: ldloc.1 - IL_0021: ldloc.0 - IL_0022: blt.un.s IL_0011 + IL_001e: stloc.1 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: stloc.2 + IL_0022: br.s IL_0033 - IL_0024: ret + IL_0024: ldloc.2 + IL_0025: call void assembly::set_c(uint64) + IL_002a: ldloc.2 + IL_002b: ldarg.0 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.1 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.1 + IL_0033: ldloc.1 + IL_0034: ldloc.0 + IL_0035: blt.un.s IL_0024 + + IL_0037: ret } .method public static void f9(uint64 finish) cil managed From 07185d5d05f854941ac874ea8733f0c76ffc1e7a Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 1 Mar 2024 09:53:21 -0500 Subject: [PATCH 61/66] Update baseline --- ...onSteppingTest07.fs.il.netcore.release.bsl | 198 +++++++++--------- 1 file changed, 102 insertions(+), 96 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl index e3eea368d57..9be862b2fd6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.netcore.release.bsl @@ -422,113 +422,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, From 7dd79e5a97f18c99884755705862a47c39f37929 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 1 Mar 2024 11:45:54 -0500 Subject: [PATCH 62/66] Missed in merge --- .../EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs index 0bdb0f6a6f5..6ab522e2271 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs @@ -107,6 +107,7 @@ module SeqExpressionStepping = let ``SeqExpressionSteppingTest07_RealInternalSignatureOn_fs`` compilation = compilation |> withRealInternalSignatureOn + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=SeqExpressionSteppingTest07.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd SeqExpressionSteppingTest7.exe" # SeqExpressionSteppingTest7.fs - From d355c8d00fe9f769b7fd57431c9773610b510666 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 1 Mar 2024 12:52:49 -0500 Subject: [PATCH 63/66] Update baseline --- ...ionSteppingTest07.fs.il.net472.release.bsl | 198 +++++++++--------- 1 file changed, 102 insertions(+), 96 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl index f0812837c64..66a9fd3e0d5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.il.net472.release.bsl @@ -421,113 +421,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, From eb2b4e1007a1b6f285a5379017234ef0d895556a Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 1 Mar 2024 19:53:57 -0500 Subject: [PATCH 64/66] Update baselines --- ...InternalSignatureOff.il.net472.release.bsl | 255 ++++++++++-------- ...nternalSignatureOff.il.netcore.release.bsl | 198 +++++++------- 2 files changed, 242 insertions(+), 211 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 86cc7e04485..66a9fd3e0d5 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 @@ -43,11 +43,13 @@ 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 ) + .field static assembly int32 r@4 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public specialname static int32 get_r() cil managed { .maxstack 8 - IL_0000: ldsfld int32 ''.$SeqExpressionSteppingTest7::r@4 + IL_0000: ldsfld int32 SeqExpressionSteppingTest7::r@4 IL_0005: ret } @@ -56,7 +58,7 @@ .maxstack 8 IL_0000: ldarg.0 - IL_0001: stsfld int32 ''.$SeqExpressionSteppingTest7::r@4 + IL_0001: stsfld int32 SeqExpressionSteppingTest7::r@4 IL_0006: ret } @@ -419,113 +421,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, @@ -732,26 +740,19 @@ IL_005b: ret } - .property int32 r() + .method private specialname rtspecialname static void .cctor() cil managed { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .set void SeqExpressionSteppingTest7::set_r(int32) - .get int32 SeqExpressionSteppingTest7::get_r() + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$SeqExpressionSteppingTest7::init@ + IL_0006: ldsfld int32 ''.$SeqExpressionSteppingTest7::init@ + IL_000b: pop + IL_000c: ret } -} -.class private abstract auto ansi sealed ''.$SeqExpressionSteppingTest7 - extends [runtime]System.Object -{ - .field static assembly int32 r@4 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly int32 init@ - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public static void main@() cil managed + .method assembly specialname static void staticInitialization@() cil managed { - .entrypoint .maxstack 4 .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_0, @@ -759,7 +760,7 @@ class [runtime]System.Exception V_2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_3) IL_0000: ldc.i4.0 - IL_0001: stsfld int32 ''.$SeqExpressionSteppingTest7::r@4 + IL_0001: stsfld int32 SeqExpressionSteppingTest7::r@4 IL_0006: ldstr "res = %A" IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) IL_0010: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) @@ -802,6 +803,30 @@ IL_0053: ret } + .property int32 r() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void SeqExpressionSteppingTest7::set_r(int32) + .get int32 SeqExpressionSteppingTest7::get_r() + } +} + +.class private abstract auto ansi sealed ''.$SeqExpressionSteppingTest7 + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void SeqExpressionSteppingTest7::staticInitialization@() + IL_0005: ret + } + } 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 bb5909fc008..3d78a971d68 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 @@ -420,113 +420,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - 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_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, From 3fd075e618295883fedc48fb5d19733d9b36e168 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Fri, 1 Mar 2024 21:27:26 -0500 Subject: [PATCH 65/66] One more --- ...InternalSignatureOff.il.net472.release.bsl | 57 +++++++------------ 1 file changed, 19 insertions(+), 38 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 66a9fd3e0d5..155ad0265cc 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 @@ -43,13 +43,11 @@ 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 ) - .field static assembly int32 r@4 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public specialname static int32 get_r() cil managed { .maxstack 8 - IL_0000: ldsfld int32 SeqExpressionSteppingTest7::r@4 + IL_0000: ldsfld int32 ''.$SeqExpressionSteppingTest7::r@4 IL_0005: ret } @@ -58,7 +56,7 @@ .maxstack 8 IL_0000: ldarg.0 - IL_0001: stsfld int32 SeqExpressionSteppingTest7::r@4 + IL_0001: stsfld int32 ''.$SeqExpressionSteppingTest7::r@4 IL_0006: ret } @@ -740,19 +738,26 @@ IL_005b: ret } - .method private specialname rtspecialname static void .cctor() cil managed + .property int32 r() { - - .maxstack 8 - IL_0000: ldc.i4.0 - IL_0001: stsfld int32 ''.$SeqExpressionSteppingTest7::init@ - IL_0006: ldsfld int32 ''.$SeqExpressionSteppingTest7::init@ - IL_000b: pop - IL_000c: ret + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void SeqExpressionSteppingTest7::set_r(int32) + .get int32 SeqExpressionSteppingTest7::get_r() } +} - .method assembly specialname static void staticInitialization@() cil managed +.class private abstract auto ansi sealed ''.$SeqExpressionSteppingTest7 + extends [runtime]System.Object +{ + .field static assembly int32 r@4 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed { + .entrypoint .maxstack 4 .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_0, @@ -760,7 +765,7 @@ class [runtime]System.Exception V_2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_3) IL_0000: ldc.i4.0 - IL_0001: stsfld int32 SeqExpressionSteppingTest7::r@4 + IL_0001: stsfld int32 ''.$SeqExpressionSteppingTest7::r@4 IL_0006: ldstr "res = %A" IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) IL_0010: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) @@ -803,30 +808,6 @@ IL_0053: ret } - .property int32 r() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .set void SeqExpressionSteppingTest7::set_r(int32) - .get int32 SeqExpressionSteppingTest7::get_r() - } -} - -.class private abstract auto ansi sealed ''.$SeqExpressionSteppingTest7 - extends [runtime]System.Object -{ - .field static assembly int32 init@ - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: call void SeqExpressionSteppingTest7::staticInitialization@() - IL_0005: ret - } - } From e79ac5082c0dde3ce1593d1f561d027192ce6ec9 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Tue, 5 Mar 2024 10:47:34 -0500 Subject: [PATCH 66/66] Emit a ~better approximation of a do-while loop --- src/Compiler/TypedTree/TypedTreeOps.fs | 65 +- .../UInt64RangeArrays.fs.il.bsl | 873 ++++++----- .../UInt64RangeLists.fs.il.bsl | 832 +++++------ .../ForEachRangeStepInt64.fs.opt.il.bsl | 351 +++-- .../ForEachRangeStepIntPtr.fs.opt.il.bsl | 1274 ++++++++--------- .../ForEachRangeStepUInt64.fs.opt.il.bsl | 291 ++-- .../ForEachRangeStepUIntPtr.fs.opt.il.bsl | 756 +++++----- .../ForEachRangeStepInt64.fs.opt.il.bsl | 351 +++-- .../ForEachRangeStepIntPtr.fs.opt.il.bsl | 1274 ++++++++--------- .../ForEachRangeStepUInt64.fs.opt.il.bsl | 291 ++-- .../ForEachRangeStepUIntPtr.fs.opt.il.bsl | 756 +++++----- 11 files changed, 3426 insertions(+), 3688 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 3b78e179797..8001c049ece 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10804,51 +10804,50 @@ let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, ) /// Start at 0 and count up till we have wrapped around. + /// We only emit this if the type is or may be 64-bit and step is not constant, + /// and we only execute it if step = 1 and |finish - step| = 2⁶⁴ + 1. /// - ///  - /// while i > 0 do + /// Logically equivalent to (pseudo-code): + /// + /// while true do /// + /// loopVar <- loopVar + step /// i <- i + 1 + /// if i = 0 then break let mkCountUpInclusive mkBody countTy = - mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> - mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> - // loopVar <- loopVar + step - let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) - - // i <- i + 1 - let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) - - // - // loopVar <- loopVar + step - // i <- i + 1 - let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI] - - // i > 0 - let guard = mkAsmExpr ([AI_cgt_un], [], [idxVar; mkTypedZero g mFor countTy], [g.bool_ty], mFor) - - // while i > 0 do - // - // loopVar <- loopVar + step - // i <- i + 1 - let loop = + mkCompGenLetMutableIn mFor "guard" g.bool_ty (mkTrue g mFor) (fun (guardVal, guardVar) -> + mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> + mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> + // loopVar <- loopVar + step + let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) + + // i <- i + 1 + let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) + + // guard <- i <> 0 + let breakIfZero = mkValSet mFor (mkLocalValRef guardVal) (mkAsmExpr ([ILInstr.AI_cgt_un], [], [idxVar; mkTypedZero g mFor countTy], [g.bool_ty], mFor)) + + // + // loopVar <- loopVar + step + // i <- i + 1 + // guard <- i <> 0 + let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI; breakIfZero] + + // while guard do + // + // loopVar <- loopVar + step + // i <- i + 1 + // guard <- i <> 0 mkWhile g ( spInWhile, WhileLoopForCompiledForEachExprMarker, - guard, + guardVar, body, mBody ) - - // - // loopVar <- loopVar + step - // i <- i + 1 - // while i > 0 do - // - // loopVar <- loopVar + step - // i <- i + 1 - mkSequential mBody body loop + ) ) ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl index 2a5b52af33d..d35ebad1148 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl @@ -348,9 +348,10 @@ bool V_1, uint64 V_2, uint64[] V_3, - uint64 V_4, + bool V_4, uint64 V_5, - uint64 V_6) + uint64 V_6, + uint64 V_7) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -401,99 +402,89 @@ IL_0033: newarr [runtime]System.UInt64 IL_0038: stloc.3 IL_0039: ldloc.1 - IL_003a: brfalse.s IL_0078 + IL_003a: brfalse.s IL_006c - IL_003c: ldc.i4.0 - IL_003d: conv.i8 - IL_003e: stloc.s V_4 - IL_0040: ldarg.0 + IL_003c: ldc.i4.1 + IL_003d: stloc.s V_4 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 IL_0041: stloc.s V_5 - IL_0043: ldloc.3 - IL_0044: ldloc.s V_4 - IL_0046: conv.i - IL_0047: ldloc.s V_5 - IL_0049: stelem.i8 - IL_004a: ldloc.s V_5 - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add - IL_004f: stloc.s V_5 - IL_0051: ldloc.s V_4 - IL_0053: ldc.i4.1 - IL_0054: conv.i8 - IL_0055: add - IL_0056: stloc.s V_4 - IL_0058: br.s IL_006f - - IL_005a: ldloc.3 - IL_005b: ldloc.s V_4 - IL_005d: conv.i - IL_005e: ldloc.s V_5 - IL_0060: stelem.i8 - IL_0061: ldloc.s V_5 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: add - IL_0066: stloc.s V_5 - IL_0068: ldloc.s V_4 - IL_006a: ldc.i4.1 - IL_006b: conv.i8 - IL_006c: add - IL_006d: stloc.s V_4 - IL_006f: ldloc.s V_4 - IL_0071: ldc.i4.0 - IL_0072: conv.i8 - IL_0073: bgt.un.s IL_005a - - IL_0075: nop - IL_0076: br.s IL_00af - - IL_0078: ldarg.1 - IL_0079: ldarg.0 - IL_007a: bge.un.s IL_0081 - - IL_007c: ldc.i4.0 - IL_007d: conv.i8 - IL_007e: nop - IL_007f: br.s IL_0088 - - IL_0081: ldarg.1 - IL_0082: ldarg.0 - IL_0083: sub - IL_0084: ldc.i4.1 - IL_0085: conv.i8 - IL_0086: add.ovf.un - IL_0087: nop - IL_0088: stloc.s V_4 - IL_008a: ldc.i4.0 - IL_008b: conv.i8 - IL_008c: stloc.s V_5 - IL_008e: ldarg.0 - IL_008f: stloc.s V_6 - IL_0091: br.s IL_00a8 - - IL_0093: ldloc.3 - IL_0094: ldloc.s V_5 - IL_0096: conv.i - IL_0097: ldloc.s V_6 - IL_0099: stelem.i8 - IL_009a: ldloc.s V_6 - IL_009c: ldc.i4.1 - IL_009d: conv.i8 - IL_009e: add - IL_009f: stloc.s V_6 - IL_00a1: ldloc.s V_5 - IL_00a3: ldc.i4.1 - IL_00a4: conv.i8 - IL_00a5: add - IL_00a6: stloc.s V_5 - IL_00a8: ldloc.s V_5 - IL_00aa: ldloc.s V_4 - IL_00ac: blt.un.s IL_0093 + IL_0043: ldarg.0 + IL_0044: stloc.s V_6 + IL_0046: br.s IL_0065 - IL_00ae: nop - IL_00af: ldloc.3 - IL_00b0: ret + IL_0048: ldloc.3 + IL_0049: ldloc.s V_5 + IL_004b: conv.i + IL_004c: ldloc.s V_6 + IL_004e: stelem.i8 + IL_004f: ldloc.s V_6 + IL_0051: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: add + IL_0054: stloc.s V_6 + IL_0056: ldloc.s V_5 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_5 + IL_005d: ldloc.s V_5 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: cgt.un + IL_0063: stloc.s V_4 + IL_0065: ldloc.s V_4 + IL_0067: brtrue.s IL_0048 + + IL_0069: nop + IL_006a: br.s IL_00a3 + + IL_006c: ldarg.1 + IL_006d: ldarg.0 + IL_006e: bge.un.s IL_0075 + + IL_0070: ldc.i4.0 + IL_0071: conv.i8 + IL_0072: nop + IL_0073: br.s IL_007c + + IL_0075: ldarg.1 + IL_0076: ldarg.0 + IL_0077: sub + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add.ovf.un + IL_007b: nop + IL_007c: stloc.s V_5 + IL_007e: ldc.i4.0 + IL_007f: conv.i8 + IL_0080: stloc.s V_6 + IL_0082: ldarg.0 + IL_0083: stloc.s V_7 + IL_0085: br.s IL_009c + + IL_0087: ldloc.3 + IL_0088: ldloc.s V_6 + IL_008a: conv.i + IL_008b: ldloc.s V_7 + IL_008d: stelem.i8 + IL_008e: ldloc.s V_7 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add + IL_0093: stloc.s V_7 + IL_0095: ldloc.s V_6 + IL_0097: ldc.i4.1 + IL_0098: conv.i8 + IL_0099: add + IL_009a: stloc.s V_6 + IL_009c: ldloc.s V_6 + IL_009e: ldloc.s V_5 + IL_00a0: blt.un.s IL_0087 + + IL_00a2: nop + IL_00a3: ldloc.3 + IL_00a4: ret } .method public static uint64[] f9(uint64 start) cil managed @@ -837,9 +828,10 @@ bool V_1, uint64 V_2, uint64[] V_3, - uint64 V_4, + bool V_4, uint64 V_5, - uint64 V_6) + uint64 V_6, + uint64 V_7) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -890,99 +882,89 @@ IL_0033: newarr [runtime]System.UInt64 IL_0038: stloc.3 IL_0039: ldloc.1 - IL_003a: brfalse.s IL_0078 + IL_003a: brfalse.s IL_006c - IL_003c: ldc.i4.0 - IL_003d: conv.i8 - IL_003e: stloc.s V_4 - IL_0040: ldarg.0 + IL_003c: ldc.i4.1 + IL_003d: stloc.s V_4 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 IL_0041: stloc.s V_5 - IL_0043: ldloc.3 - IL_0044: ldloc.s V_4 - IL_0046: conv.i - IL_0047: ldloc.s V_5 - IL_0049: stelem.i8 - IL_004a: ldloc.s V_5 - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add - IL_004f: stloc.s V_5 - IL_0051: ldloc.s V_4 - IL_0053: ldc.i4.1 - IL_0054: conv.i8 - IL_0055: add - IL_0056: stloc.s V_4 - IL_0058: br.s IL_006f - - IL_005a: ldloc.3 - IL_005b: ldloc.s V_4 - IL_005d: conv.i - IL_005e: ldloc.s V_5 - IL_0060: stelem.i8 - IL_0061: ldloc.s V_5 - IL_0063: ldc.i4.1 - IL_0064: conv.i8 - IL_0065: add - IL_0066: stloc.s V_5 - IL_0068: ldloc.s V_4 - IL_006a: ldc.i4.1 - IL_006b: conv.i8 - IL_006c: add - IL_006d: stloc.s V_4 - IL_006f: ldloc.s V_4 - IL_0071: ldc.i4.0 - IL_0072: conv.i8 - IL_0073: bgt.un.s IL_005a - - IL_0075: nop - IL_0076: br.s IL_00af - - IL_0078: ldarg.1 - IL_0079: ldarg.0 - IL_007a: bge.un.s IL_0081 - - IL_007c: ldc.i4.0 - IL_007d: conv.i8 - IL_007e: nop - IL_007f: br.s IL_0088 - - IL_0081: ldarg.1 - IL_0082: ldarg.0 - IL_0083: sub - IL_0084: ldc.i4.1 - IL_0085: conv.i8 - IL_0086: add.ovf.un - IL_0087: nop - IL_0088: stloc.s V_4 - IL_008a: ldc.i4.0 - IL_008b: conv.i8 - IL_008c: stloc.s V_5 - IL_008e: ldarg.0 - IL_008f: stloc.s V_6 - IL_0091: br.s IL_00a8 - - IL_0093: ldloc.3 - IL_0094: ldloc.s V_5 - IL_0096: conv.i - IL_0097: ldloc.s V_6 - IL_0099: stelem.i8 - IL_009a: ldloc.s V_6 - IL_009c: ldc.i4.1 - IL_009d: conv.i8 - IL_009e: add - IL_009f: stloc.s V_6 - IL_00a1: ldloc.s V_5 - IL_00a3: ldc.i4.1 - IL_00a4: conv.i8 - IL_00a5: add - IL_00a6: stloc.s V_5 - IL_00a8: ldloc.s V_5 - IL_00aa: ldloc.s V_4 - IL_00ac: blt.un.s IL_0093 + IL_0043: ldarg.0 + IL_0044: stloc.s V_6 + IL_0046: br.s IL_0065 - IL_00ae: nop - IL_00af: ldloc.3 - IL_00b0: ret + IL_0048: ldloc.3 + IL_0049: ldloc.s V_5 + IL_004b: conv.i + IL_004c: ldloc.s V_6 + IL_004e: stelem.i8 + IL_004f: ldloc.s V_6 + IL_0051: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: add + IL_0054: stloc.s V_6 + IL_0056: ldloc.s V_5 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_5 + IL_005d: ldloc.s V_5 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: cgt.un + IL_0063: stloc.s V_4 + IL_0065: ldloc.s V_4 + IL_0067: brtrue.s IL_0048 + + IL_0069: nop + IL_006a: br.s IL_00a3 + + IL_006c: ldarg.1 + IL_006d: ldarg.0 + IL_006e: bge.un.s IL_0075 + + IL_0070: ldc.i4.0 + IL_0071: conv.i8 + IL_0072: nop + IL_0073: br.s IL_007c + + IL_0075: ldarg.1 + IL_0076: ldarg.0 + IL_0077: sub + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add.ovf.un + IL_007b: nop + IL_007c: stloc.s V_5 + IL_007e: ldc.i4.0 + IL_007f: conv.i8 + IL_0080: stloc.s V_6 + IL_0082: ldarg.0 + IL_0083: stloc.s V_7 + IL_0085: br.s IL_009c + + IL_0087: ldloc.3 + IL_0088: ldloc.s V_6 + IL_008a: conv.i + IL_008b: ldloc.s V_7 + IL_008d: stelem.i8 + IL_008e: ldloc.s V_7 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add + IL_0093: stloc.s V_7 + IL_0095: ldloc.s V_6 + IL_0097: ldc.i4.1 + IL_0098: conv.i8 + IL_0099: add + IL_009a: stloc.s V_6 + IL_009c: ldloc.s V_6 + IL_009e: ldloc.s V_5 + IL_00a0: blt.un.s IL_0087 + + IL_00a2: nop + IL_00a3: ldloc.3 + IL_00a4: ret } .method public static uint64[] f14(uint64 step, @@ -1089,9 +1071,10 @@ bool V_1, uint64 V_2, uint64[] V_3, - uint64 V_4, + bool V_4, uint64 V_5, - uint64 V_6) + uint64 V_6, + uint64 V_7) IL_0000: nop IL_0001: ldarg.1 IL_0002: brtrue.s IL_0010 @@ -1160,98 +1143,89 @@ IL_0047: newarr [runtime]System.UInt64 IL_004c: stloc.3 IL_004d: ldloc.1 - IL_004e: brfalse.s IL_008a + IL_004e: brfalse.s IL_007f - IL_0050: ldc.i4.0 - IL_0051: conv.i8 - IL_0052: stloc.s V_4 - IL_0054: ldarg.0 + IL_0050: ldc.i4.1 + IL_0051: stloc.s V_4 + IL_0053: ldc.i4.0 + IL_0054: conv.i8 IL_0055: stloc.s V_5 - IL_0057: ldloc.3 - IL_0058: ldloc.s V_4 - IL_005a: conv.i - IL_005b: ldloc.s V_5 - IL_005d: stelem.i8 - IL_005e: ldloc.s V_5 - IL_0060: ldarg.1 - IL_0061: add - IL_0062: stloc.s V_5 - IL_0064: ldloc.s V_4 - IL_0066: ldc.i4.1 - IL_0067: conv.i8 - IL_0068: add - IL_0069: stloc.s V_4 - IL_006b: br.s IL_0081 - - IL_006d: ldloc.3 - IL_006e: ldloc.s V_4 - IL_0070: conv.i - IL_0071: ldloc.s V_5 - IL_0073: stelem.i8 - IL_0074: ldloc.s V_5 - IL_0076: ldarg.1 - IL_0077: add - IL_0078: stloc.s V_5 - IL_007a: ldloc.s V_4 - IL_007c: ldc.i4.1 - IL_007d: conv.i8 - IL_007e: add - IL_007f: stloc.s V_4 - IL_0081: ldloc.s V_4 - IL_0083: ldc.i4.0 - IL_0084: conv.i8 - IL_0085: bgt.un.s IL_006d - - IL_0087: nop - IL_0088: br.s IL_00c2 + IL_0057: ldarg.0 + IL_0058: stloc.s V_6 + IL_005a: br.s IL_0078 - IL_008a: ldarg.2 - IL_008b: ldarg.0 - IL_008c: bge.un.s IL_0093 + IL_005c: ldloc.3 + IL_005d: ldloc.s V_5 + IL_005f: conv.i + IL_0060: ldloc.s V_6 + IL_0062: stelem.i8 + IL_0063: ldloc.s V_6 + IL_0065: ldarg.1 + IL_0066: add + IL_0067: stloc.s V_6 + IL_0069: ldloc.s V_5 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.s V_5 + IL_0070: ldloc.s V_5 + IL_0072: ldc.i4.0 + IL_0073: conv.i8 + IL_0074: cgt.un + IL_0076: stloc.s V_4 + IL_0078: ldloc.s V_4 + IL_007a: brtrue.s IL_005c + + IL_007c: nop + IL_007d: br.s IL_00b7 + + IL_007f: ldarg.2 + IL_0080: ldarg.0 + IL_0081: bge.un.s IL_0088 - IL_008e: ldc.i4.0 - IL_008f: conv.i8 + IL_0083: ldc.i4.0 + IL_0084: conv.i8 + IL_0085: nop + IL_0086: br.s IL_0091 + + IL_0088: ldarg.2 + IL_0089: ldarg.0 + IL_008a: sub + IL_008b: ldarg.1 + IL_008c: div.un + IL_008d: ldc.i4.1 + IL_008e: conv.i8 + IL_008f: add.ovf.un IL_0090: nop - IL_0091: br.s IL_009c - - IL_0093: ldarg.2 - IL_0094: ldarg.0 - IL_0095: sub - IL_0096: ldarg.1 - IL_0097: div.un - IL_0098: ldc.i4.1 - IL_0099: conv.i8 - IL_009a: add.ovf.un - IL_009b: nop - IL_009c: stloc.s V_4 - IL_009e: ldc.i4.0 - IL_009f: conv.i8 - IL_00a0: stloc.s V_5 - IL_00a2: ldarg.0 - IL_00a3: stloc.s V_6 - IL_00a5: br.s IL_00bb - - IL_00a7: ldloc.3 - IL_00a8: ldloc.s V_5 - IL_00aa: conv.i - IL_00ab: ldloc.s V_6 - IL_00ad: stelem.i8 - IL_00ae: ldloc.s V_6 - IL_00b0: ldarg.1 - IL_00b1: add - IL_00b2: stloc.s V_6 - IL_00b4: ldloc.s V_5 - IL_00b6: ldc.i4.1 - IL_00b7: conv.i8 - IL_00b8: add - IL_00b9: stloc.s V_5 - IL_00bb: ldloc.s V_5 - IL_00bd: ldloc.s V_4 - IL_00bf: blt.un.s IL_00a7 - - IL_00c1: nop - IL_00c2: ldloc.3 - IL_00c3: ret + IL_0091: stloc.s V_5 + IL_0093: ldc.i4.0 + IL_0094: conv.i8 + IL_0095: stloc.s V_6 + IL_0097: ldarg.0 + IL_0098: stloc.s V_7 + IL_009a: br.s IL_00b0 + + IL_009c: ldloc.3 + IL_009d: ldloc.s V_6 + IL_009f: conv.i + IL_00a0: ldloc.s V_7 + IL_00a2: stelem.i8 + IL_00a3: ldloc.s V_7 + IL_00a5: ldarg.1 + IL_00a6: add + IL_00a7: stloc.s V_7 + IL_00a9: ldloc.s V_6 + IL_00ab: ldc.i4.1 + IL_00ac: conv.i8 + IL_00ad: add + IL_00ae: stloc.s V_6 + IL_00b0: ldloc.s V_6 + IL_00b2: ldloc.s V_5 + IL_00b4: blt.un.s IL_009c + + IL_00b6: nop + IL_00b7: ldloc.3 + IL_00b8: ret } .method public static uint64[] f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1421,9 +1395,10 @@ bool V_3, uint64 V_4, uint64[] V_5, - uint64 V_6, + bool V_6, uint64 V_7, - uint64 V_8) + uint64 V_8, + uint64 V_9) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1481,99 +1456,89 @@ IL_0045: newarr [runtime]System.UInt64 IL_004a: stloc.s V_5 IL_004c: ldloc.3 - IL_004d: brfalse.s IL_008d + IL_004d: brfalse.s IL_0080 - IL_004f: ldc.i4.0 - IL_0050: conv.i8 - IL_0051: stloc.s V_6 - IL_0053: ldloc.0 + IL_004f: ldc.i4.1 + IL_0050: stloc.s V_6 + IL_0052: ldc.i4.0 + IL_0053: conv.i8 IL_0054: stloc.s V_7 - IL_0056: ldloc.s V_5 - IL_0058: ldloc.s V_6 - IL_005a: conv.i - IL_005b: ldloc.s V_7 - IL_005d: stelem.i8 - IL_005e: ldloc.s V_7 - IL_0060: ldc.i4.1 - IL_0061: conv.i8 - IL_0062: add - IL_0063: stloc.s V_7 - IL_0065: ldloc.s V_6 - IL_0067: ldc.i4.1 - IL_0068: conv.i8 - IL_0069: add - IL_006a: stloc.s V_6 - IL_006c: br.s IL_0084 - - IL_006e: ldloc.s V_5 - IL_0070: ldloc.s V_6 - IL_0072: conv.i - IL_0073: ldloc.s V_7 - IL_0075: stelem.i8 - IL_0076: ldloc.s V_7 - IL_0078: ldc.i4.1 - IL_0079: conv.i8 - IL_007a: add - IL_007b: stloc.s V_7 - IL_007d: ldloc.s V_6 - IL_007f: ldc.i4.1 - IL_0080: conv.i8 - IL_0081: add - IL_0082: stloc.s V_6 - IL_0084: ldloc.s V_6 - IL_0086: ldc.i4.0 - IL_0087: conv.i8 - IL_0088: bgt.un.s IL_006e - - IL_008a: nop - IL_008b: br.s IL_00c5 - - IL_008d: ldloc.1 - IL_008e: ldloc.0 - IL_008f: bge.un.s IL_0096 - - IL_0091: ldc.i4.0 - IL_0092: conv.i8 - IL_0093: nop - IL_0094: br.s IL_009d - - IL_0096: ldloc.1 - IL_0097: ldloc.0 - IL_0098: sub - IL_0099: ldc.i4.1 - IL_009a: conv.i8 - IL_009b: add.ovf.un - IL_009c: nop - IL_009d: stloc.s V_6 - IL_009f: ldc.i4.0 - IL_00a0: conv.i8 - IL_00a1: stloc.s V_7 - IL_00a3: ldloc.0 - IL_00a4: stloc.s V_8 - IL_00a6: br.s IL_00be - - IL_00a8: ldloc.s V_5 - IL_00aa: ldloc.s V_7 - IL_00ac: conv.i - IL_00ad: ldloc.s V_8 - IL_00af: stelem.i8 - IL_00b0: ldloc.s V_8 - IL_00b2: ldc.i4.1 - IL_00b3: conv.i8 - IL_00b4: add - IL_00b5: stloc.s V_8 - IL_00b7: ldloc.s V_7 - IL_00b9: ldc.i4.1 - IL_00ba: conv.i8 - IL_00bb: add - IL_00bc: stloc.s V_7 - IL_00be: ldloc.s V_7 - IL_00c0: ldloc.s V_6 - IL_00c2: blt.un.s IL_00a8 - - IL_00c4: nop - IL_00c5: ldloc.s V_5 - IL_00c7: ret + IL_0056: ldloc.0 + IL_0057: stloc.s V_8 + IL_0059: br.s IL_0079 + + IL_005b: ldloc.s V_5 + IL_005d: ldloc.s V_7 + IL_005f: conv.i + IL_0060: ldloc.s V_8 + IL_0062: stelem.i8 + IL_0063: ldloc.s V_8 + IL_0065: ldc.i4.1 + IL_0066: conv.i8 + IL_0067: add + IL_0068: stloc.s V_8 + IL_006a: ldloc.s V_7 + IL_006c: ldc.i4.1 + IL_006d: conv.i8 + IL_006e: add + IL_006f: stloc.s V_7 + IL_0071: ldloc.s V_7 + IL_0073: ldc.i4.0 + IL_0074: conv.i8 + IL_0075: cgt.un + IL_0077: stloc.s V_6 + IL_0079: ldloc.s V_6 + IL_007b: brtrue.s IL_005b + + IL_007d: nop + IL_007e: br.s IL_00b8 + + IL_0080: ldloc.1 + IL_0081: ldloc.0 + IL_0082: bge.un.s IL_0089 + + IL_0084: ldc.i4.0 + IL_0085: conv.i8 + IL_0086: nop + IL_0087: br.s IL_0090 + + IL_0089: ldloc.1 + IL_008a: ldloc.0 + IL_008b: sub + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add.ovf.un + IL_008f: nop + IL_0090: stloc.s V_7 + IL_0092: ldc.i4.0 + IL_0093: conv.i8 + IL_0094: stloc.s V_8 + IL_0096: ldloc.0 + IL_0097: stloc.s V_9 + IL_0099: br.s IL_00b1 + + IL_009b: ldloc.s V_5 + IL_009d: ldloc.s V_8 + IL_009f: conv.i + IL_00a0: ldloc.s V_9 + IL_00a2: stelem.i8 + IL_00a3: ldloc.s V_9 + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add + IL_00a8: stloc.s V_9 + IL_00aa: ldloc.s V_8 + IL_00ac: ldc.i4.1 + IL_00ad: conv.i8 + IL_00ae: add + IL_00af: stloc.s V_8 + IL_00b1: ldloc.s V_8 + IL_00b3: ldloc.s V_7 + IL_00b5: blt.un.s IL_009b + + IL_00b7: nop + IL_00b8: ldloc.s V_5 + IL_00ba: ret } .method public static uint64[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1843,9 +1808,10 @@ bool V_4, uint64 V_5, uint64[] V_6, - uint64 V_7, + bool V_7, uint64 V_8, - uint64 V_9) + uint64 V_9, + uint64 V_10) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1925,98 +1891,89 @@ IL_0062: newarr [runtime]System.UInt64 IL_0067: stloc.s V_6 IL_0069: ldloc.s V_4 - IL_006b: brfalse.s IL_00a9 + IL_006b: brfalse.s IL_009d - IL_006d: ldc.i4.0 - IL_006e: conv.i8 - IL_006f: stloc.s V_7 - IL_0071: ldloc.0 + IL_006d: ldc.i4.1 + IL_006e: stloc.s V_7 + IL_0070: ldc.i4.0 + IL_0071: conv.i8 IL_0072: stloc.s V_8 - IL_0074: ldloc.s V_6 - IL_0076: ldloc.s V_7 - IL_0078: conv.i - IL_0079: ldloc.s V_8 - IL_007b: stelem.i8 - IL_007c: ldloc.s V_8 - IL_007e: ldloc.1 - IL_007f: add - IL_0080: stloc.s V_8 - IL_0082: ldloc.s V_7 - IL_0084: ldc.i4.1 - IL_0085: conv.i8 - IL_0086: add - IL_0087: stloc.s V_7 - IL_0089: br.s IL_00a0 - - IL_008b: ldloc.s V_6 - IL_008d: ldloc.s V_7 - IL_008f: conv.i - IL_0090: ldloc.s V_8 - IL_0092: stelem.i8 - IL_0093: ldloc.s V_8 - IL_0095: ldloc.1 - IL_0096: add - IL_0097: stloc.s V_8 - IL_0099: ldloc.s V_7 - IL_009b: ldc.i4.1 - IL_009c: conv.i8 - IL_009d: add - IL_009e: stloc.s V_7 - IL_00a0: ldloc.s V_7 - IL_00a2: ldc.i4.0 - IL_00a3: conv.i8 - IL_00a4: bgt.un.s IL_008b - - IL_00a6: nop - IL_00a7: br.s IL_00e2 - - IL_00a9: ldloc.2 - IL_00aa: ldloc.0 - IL_00ab: bge.un.s IL_00b2 - - IL_00ad: ldc.i4.0 - IL_00ae: conv.i8 - IL_00af: nop - IL_00b0: br.s IL_00bb - - IL_00b2: ldloc.2 - IL_00b3: ldloc.0 - IL_00b4: sub - IL_00b5: ldloc.1 - IL_00b6: div.un - IL_00b7: ldc.i4.1 - IL_00b8: conv.i8 - IL_00b9: add.ovf.un - IL_00ba: nop - IL_00bb: stloc.s V_7 - IL_00bd: ldc.i4.0 - IL_00be: conv.i8 - IL_00bf: stloc.s V_8 - IL_00c1: ldloc.0 - IL_00c2: stloc.s V_9 - IL_00c4: br.s IL_00db - - IL_00c6: ldloc.s V_6 - IL_00c8: ldloc.s V_8 - IL_00ca: conv.i - IL_00cb: ldloc.s V_9 - IL_00cd: stelem.i8 - IL_00ce: ldloc.s V_9 - IL_00d0: ldloc.1 - IL_00d1: add - IL_00d2: stloc.s V_9 - IL_00d4: ldloc.s V_8 - IL_00d6: ldc.i4.1 - IL_00d7: conv.i8 - IL_00d8: add - IL_00d9: stloc.s V_8 - IL_00db: ldloc.s V_8 - IL_00dd: ldloc.s V_7 - IL_00df: blt.un.s IL_00c6 - - IL_00e1: nop - IL_00e2: ldloc.s V_6 - IL_00e4: ret + IL_0074: ldloc.0 + IL_0075: stloc.s V_9 + IL_0077: br.s IL_0096 + + IL_0079: ldloc.s V_6 + IL_007b: ldloc.s V_8 + IL_007d: conv.i + IL_007e: ldloc.s V_9 + IL_0080: stelem.i8 + IL_0081: ldloc.s V_9 + IL_0083: ldloc.1 + IL_0084: add + IL_0085: stloc.s V_9 + IL_0087: ldloc.s V_8 + IL_0089: ldc.i4.1 + IL_008a: conv.i8 + IL_008b: add + IL_008c: stloc.s V_8 + IL_008e: ldloc.s V_8 + IL_0090: ldc.i4.0 + IL_0091: conv.i8 + IL_0092: cgt.un + IL_0094: stloc.s V_7 + IL_0096: ldloc.s V_7 + IL_0098: brtrue.s IL_0079 + + IL_009a: nop + IL_009b: br.s IL_00d6 + + IL_009d: ldloc.2 + IL_009e: ldloc.0 + IL_009f: bge.un.s IL_00a6 + + IL_00a1: ldc.i4.0 + IL_00a2: conv.i8 + IL_00a3: nop + IL_00a4: br.s IL_00af + + IL_00a6: ldloc.2 + IL_00a7: ldloc.0 + IL_00a8: sub + IL_00a9: ldloc.1 + IL_00aa: div.un + IL_00ab: ldc.i4.1 + IL_00ac: conv.i8 + IL_00ad: add.ovf.un + IL_00ae: nop + IL_00af: stloc.s V_8 + IL_00b1: ldc.i4.0 + IL_00b2: conv.i8 + IL_00b3: stloc.s V_9 + IL_00b5: ldloc.0 + IL_00b6: stloc.s V_10 + IL_00b8: br.s IL_00cf + + IL_00ba: ldloc.s V_6 + IL_00bc: ldloc.s V_9 + IL_00be: conv.i + IL_00bf: ldloc.s V_10 + IL_00c1: stelem.i8 + IL_00c2: ldloc.s V_10 + IL_00c4: ldloc.1 + IL_00c5: add + IL_00c6: stloc.s V_10 + IL_00c8: ldloc.s V_9 + IL_00ca: ldc.i4.1 + IL_00cb: conv.i8 + IL_00cc: add + IL_00cd: stloc.s V_9 + IL_00cf: ldloc.s V_9 + IL_00d1: ldloc.s V_8 + IL_00d3: blt.un.s IL_00ba + + IL_00d5: nop + IL_00d6: ldloc.s V_6 + IL_00d8: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl index 80965d37a52..acf670b4144 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl @@ -303,9 +303,10 @@ .locals init (uint64 V_0, bool V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, + bool V_3, uint64 V_4, - uint64 V_5) + uint64 V_5, + uint64 V_6) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -327,97 +328,88 @@ IL_0012: ceq IL_0014: stloc.1 IL_0015: ldloc.1 - IL_0016: brfalse.s IL_0054 + IL_0016: brfalse.s IL_0048 - IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: stloc.3 - IL_001b: ldarg.0 + IL_0018: ldc.i4.1 + IL_0019: stloc.3 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 IL_001c: stloc.s V_4 - IL_001e: ldloca.s V_2 - IL_0020: ldloc.s V_4 - IL_0022: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0027: nop - IL_0028: ldloc.s V_4 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: add - IL_002d: stloc.s V_4 - IL_002f: ldloc.3 - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add - IL_0033: stloc.3 - IL_0034: br.s IL_004c - - IL_0036: ldloca.s V_2 - IL_0038: ldloc.s V_4 - IL_003a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_003f: nop - IL_0040: ldloc.s V_4 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: stloc.s V_4 - IL_0047: ldloc.3 - IL_0048: ldc.i4.1 - IL_0049: conv.i8 - IL_004a: add - IL_004b: stloc.3 - IL_004c: ldloc.3 - IL_004d: ldc.i4.0 - IL_004e: conv.i8 - IL_004f: bgt.un.s IL_0036 + IL_001e: ldarg.0 + IL_001f: stloc.s V_5 + IL_0021: br.s IL_0042 + + IL_0023: ldloca.s V_2 + IL_0025: ldloc.s V_5 + IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002c: nop + IL_002d: ldloc.s V_5 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.s V_5 + IL_0034: ldloc.s V_4 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.s V_4 + IL_003b: ldloc.s V_4 + IL_003d: ldc.i4.0 + IL_003e: conv.i8 + IL_003f: cgt.un + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: brtrue.s IL_0023 - IL_0051: nop - IL_0052: br.s IL_008c + IL_0045: nop + IL_0046: br.s IL_0082 - IL_0054: ldarg.1 - IL_0055: ldarg.0 - IL_0056: bge.un.s IL_005d + IL_0048: ldarg.1 + IL_0049: ldarg.0 + IL_004a: bge.un.s IL_0051 - IL_0058: ldc.i4.0 - IL_0059: conv.i8 - IL_005a: nop - IL_005b: br.s IL_0064 + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: nop + IL_004f: br.s IL_0058 - IL_005d: ldarg.1 + IL_0051: ldarg.1 + IL_0052: ldarg.0 + IL_0053: sub + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add.ovf.un + IL_0057: nop + IL_0058: stloc.s V_4 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.s V_5 IL_005e: ldarg.0 - IL_005f: sub - IL_0060: ldc.i4.1 - IL_0061: conv.i8 - IL_0062: add.ovf.un - IL_0063: nop - IL_0064: stloc.3 - IL_0065: ldc.i4.0 - IL_0066: conv.i8 - IL_0067: stloc.s V_4 - IL_0069: ldarg.0 - IL_006a: stloc.s V_5 - IL_006c: br.s IL_0086 - - IL_006e: ldloca.s V_2 - IL_0070: ldloc.s V_5 - IL_0072: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0077: nop - IL_0078: ldloc.s V_5 - IL_007a: ldc.i4.1 - IL_007b: conv.i8 - IL_007c: add - IL_007d: stloc.s V_5 - IL_007f: ldloc.s V_4 - IL_0081: ldc.i4.1 - IL_0082: conv.i8 - IL_0083: add - IL_0084: stloc.s V_4 - IL_0086: ldloc.s V_4 - IL_0088: ldloc.3 - IL_0089: blt.un.s IL_006e - - IL_008b: nop - IL_008c: ldloca.s V_2 - IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0093: ret + IL_005f: stloc.s V_6 + IL_0061: br.s IL_007b + + IL_0063: ldloca.s V_2 + IL_0065: ldloc.s V_6 + IL_0067: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006c: nop + IL_006d: ldloc.s V_6 + IL_006f: ldc.i4.1 + IL_0070: conv.i8 + IL_0071: add + IL_0072: stloc.s V_6 + IL_0074: ldloc.s V_5 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.s V_5 + IL_007b: ldloc.s V_5 + IL_007d: ldloc.s V_4 + IL_007f: blt.un.s IL_0063 + + IL_0081: nop + IL_0082: ldloca.s V_2 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f9(uint64 start) cil managed @@ -702,9 +694,10 @@ .locals init (uint64 V_0, bool V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, + bool V_3, uint64 V_4, - uint64 V_5) + uint64 V_5, + uint64 V_6) IL_0000: nop IL_0001: ldarg.1 IL_0002: ldarg.0 @@ -726,97 +719,88 @@ IL_0012: ceq IL_0014: stloc.1 IL_0015: ldloc.1 - IL_0016: brfalse.s IL_0054 + IL_0016: brfalse.s IL_0048 - IL_0018: ldc.i4.0 - IL_0019: conv.i8 - IL_001a: stloc.3 - IL_001b: ldarg.0 + IL_0018: ldc.i4.1 + IL_0019: stloc.3 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 IL_001c: stloc.s V_4 - IL_001e: ldloca.s V_2 - IL_0020: ldloc.s V_4 - IL_0022: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0027: nop - IL_0028: ldloc.s V_4 - IL_002a: ldc.i4.1 - IL_002b: conv.i8 - IL_002c: add - IL_002d: stloc.s V_4 - IL_002f: ldloc.3 - IL_0030: ldc.i4.1 - IL_0031: conv.i8 - IL_0032: add - IL_0033: stloc.3 - IL_0034: br.s IL_004c - - IL_0036: ldloca.s V_2 - IL_0038: ldloc.s V_4 - IL_003a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_003f: nop - IL_0040: ldloc.s V_4 - IL_0042: ldc.i4.1 - IL_0043: conv.i8 - IL_0044: add - IL_0045: stloc.s V_4 - IL_0047: ldloc.3 - IL_0048: ldc.i4.1 - IL_0049: conv.i8 - IL_004a: add - IL_004b: stloc.3 - IL_004c: ldloc.3 - IL_004d: ldc.i4.0 - IL_004e: conv.i8 - IL_004f: bgt.un.s IL_0036 + IL_001e: ldarg.0 + IL_001f: stloc.s V_5 + IL_0021: br.s IL_0042 + + IL_0023: ldloca.s V_2 + IL_0025: ldloc.s V_5 + IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002c: nop + IL_002d: ldloc.s V_5 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.s V_5 + IL_0034: ldloc.s V_4 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.s V_4 + IL_003b: ldloc.s V_4 + IL_003d: ldc.i4.0 + IL_003e: conv.i8 + IL_003f: cgt.un + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: brtrue.s IL_0023 - IL_0051: nop - IL_0052: br.s IL_008c + IL_0045: nop + IL_0046: br.s IL_0082 - IL_0054: ldarg.1 - IL_0055: ldarg.0 - IL_0056: bge.un.s IL_005d + IL_0048: ldarg.1 + IL_0049: ldarg.0 + IL_004a: bge.un.s IL_0051 - IL_0058: ldc.i4.0 - IL_0059: conv.i8 - IL_005a: nop - IL_005b: br.s IL_0064 + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: nop + IL_004f: br.s IL_0058 - IL_005d: ldarg.1 + IL_0051: ldarg.1 + IL_0052: ldarg.0 + IL_0053: sub + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add.ovf.un + IL_0057: nop + IL_0058: stloc.s V_4 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.s V_5 IL_005e: ldarg.0 - IL_005f: sub - IL_0060: ldc.i4.1 - IL_0061: conv.i8 - IL_0062: add.ovf.un - IL_0063: nop - IL_0064: stloc.3 - IL_0065: ldc.i4.0 - IL_0066: conv.i8 - IL_0067: stloc.s V_4 - IL_0069: ldarg.0 - IL_006a: stloc.s V_5 - IL_006c: br.s IL_0086 - - IL_006e: ldloca.s V_2 - IL_0070: ldloc.s V_5 - IL_0072: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0077: nop - IL_0078: ldloc.s V_5 - IL_007a: ldc.i4.1 - IL_007b: conv.i8 - IL_007c: add - IL_007d: stloc.s V_5 - IL_007f: ldloc.s V_4 - IL_0081: ldc.i4.1 - IL_0082: conv.i8 - IL_0083: add - IL_0084: stloc.s V_4 - IL_0086: ldloc.s V_4 - IL_0088: ldloc.3 - IL_0089: blt.un.s IL_006e - - IL_008b: nop - IL_008c: ldloca.s V_2 - IL_008e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_0093: ret + IL_005f: stloc.s V_6 + IL_0061: br.s IL_007b + + IL_0063: ldloca.s V_2 + IL_0065: ldloc.s V_6 + IL_0067: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006c: nop + IL_006d: ldloc.s V_6 + IL_006f: ldc.i4.1 + IL_0070: conv.i8 + IL_0071: add + IL_0072: stloc.s V_6 + IL_0074: ldloc.s V_5 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.s V_5 + IL_007b: ldloc.s V_5 + IL_007d: ldloc.s V_4 + IL_007f: blt.un.s IL_0063 + + IL_0081: nop + IL_0082: ldloca.s V_2 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 @@ -909,9 +893,10 @@ .locals init (uint64 V_0, bool V_1, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, - uint64 V_3, + bool V_3, uint64 V_4, - uint64 V_5) + uint64 V_5, + uint64 V_6) IL_0000: nop IL_0001: ldarg.1 IL_0002: brtrue.s IL_0010 @@ -949,96 +934,88 @@ IL_0024: ceq IL_0026: stloc.1 IL_0027: ldloc.1 - IL_0028: brfalse.s IL_0064 + IL_0028: brfalse.s IL_0059 - IL_002a: ldc.i4.0 - IL_002b: conv.i8 - IL_002c: stloc.3 - IL_002d: ldarg.0 + IL_002a: ldc.i4.1 + IL_002b: stloc.3 + IL_002c: ldc.i4.0 + IL_002d: conv.i8 IL_002e: stloc.s V_4 - IL_0030: ldloca.s V_2 - IL_0032: ldloc.s V_4 - IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0039: nop - IL_003a: ldloc.s V_4 - IL_003c: ldarg.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: br.s IL_005c - - IL_0047: ldloca.s V_2 - IL_0049: ldloc.s V_4 - IL_004b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0050: nop - IL_0051: ldloc.s V_4 - IL_0053: ldarg.1 - IL_0054: add - IL_0055: stloc.s V_4 - IL_0057: ldloc.3 - IL_0058: ldc.i4.1 - IL_0059: conv.i8 - IL_005a: add - IL_005b: stloc.3 - IL_005c: ldloc.3 - IL_005d: ldc.i4.0 - IL_005e: conv.i8 - IL_005f: bgt.un.s IL_0047 + IL_0030: ldarg.0 + IL_0031: stloc.s V_5 + IL_0033: br.s IL_0053 + + IL_0035: ldloca.s V_2 + IL_0037: ldloc.s V_5 + IL_0039: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003e: nop + IL_003f: ldloc.s V_5 + IL_0041: ldarg.1 + IL_0042: add + IL_0043: stloc.s V_5 + IL_0045: ldloc.s V_4 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.s V_4 + IL_004e: ldc.i4.0 + IL_004f: conv.i8 + IL_0050: cgt.un + IL_0052: stloc.3 + IL_0053: ldloc.3 + IL_0054: brtrue.s IL_0035 - IL_0061: nop - IL_0062: br.s IL_009d + IL_0056: nop + IL_0057: br.s IL_0094 - IL_0064: ldarg.2 - IL_0065: ldarg.0 - IL_0066: bge.un.s IL_006d + IL_0059: ldarg.2 + IL_005a: ldarg.0 + IL_005b: bge.un.s IL_0062 - IL_0068: ldc.i4.0 - IL_0069: conv.i8 + IL_005d: ldc.i4.0 + IL_005e: conv.i8 + IL_005f: nop + IL_0060: br.s IL_006b + + IL_0062: ldarg.2 + IL_0063: ldarg.0 + IL_0064: sub + IL_0065: ldarg.1 + IL_0066: div.un + IL_0067: ldc.i4.1 + IL_0068: conv.i8 + IL_0069: add.ovf.un IL_006a: nop - IL_006b: br.s IL_0076 - - IL_006d: ldarg.2 - IL_006e: ldarg.0 - IL_006f: sub - IL_0070: ldarg.1 - IL_0071: div.un - IL_0072: ldc.i4.1 - IL_0073: conv.i8 - IL_0074: add.ovf.un - IL_0075: nop - IL_0076: stloc.3 - IL_0077: ldc.i4.0 - IL_0078: conv.i8 - IL_0079: stloc.s V_4 - IL_007b: ldarg.0 - IL_007c: stloc.s V_5 - IL_007e: br.s IL_0097 - - IL_0080: ldloca.s V_2 - IL_0082: ldloc.s V_5 - IL_0084: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0089: nop - IL_008a: ldloc.s V_5 - IL_008c: ldarg.1 - IL_008d: add - IL_008e: stloc.s V_5 - IL_0090: ldloc.s V_4 - IL_0092: ldc.i4.1 - IL_0093: conv.i8 - IL_0094: add - IL_0095: stloc.s V_4 - IL_0097: ldloc.s V_4 - IL_0099: ldloc.3 - IL_009a: blt.un.s IL_0080 - - IL_009c: nop - IL_009d: ldloca.s V_2 - IL_009f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00a4: ret + IL_006b: stloc.s V_4 + IL_006d: ldc.i4.0 + IL_006e: conv.i8 + IL_006f: stloc.s V_5 + IL_0071: ldarg.0 + IL_0072: stloc.s V_6 + IL_0074: br.s IL_008d + + IL_0076: ldloca.s V_2 + IL_0078: ldloc.s V_6 + IL_007a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007f: nop + IL_0080: ldloc.s V_6 + IL_0082: ldarg.1 + IL_0083: add + IL_0084: stloc.s V_6 + IL_0086: ldloc.s V_5 + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: stloc.s V_5 + IL_008d: ldloc.s V_5 + IL_008f: ldloc.s V_4 + IL_0091: blt.un.s IL_0076 + + IL_0093: nop + IL_0094: ldloca.s V_2 + IL_0096: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009b: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1178,9 +1155,10 @@ uint64 V_2, bool V_3, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, - uint64 V_5, + bool V_5, uint64 V_6, - uint64 V_7) + uint64 V_7, + uint64 V_8) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1209,97 +1187,88 @@ IL_0021: ceq IL_0023: stloc.3 IL_0024: ldloc.3 - IL_0025: brfalse.s IL_0069 + IL_0025: brfalse.s IL_005a - IL_0027: ldc.i4.0 - IL_0028: conv.i8 - IL_0029: stloc.s V_5 - IL_002b: ldloc.0 + IL_0027: ldc.i4.1 + IL_0028: stloc.s V_5 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 IL_002c: stloc.s V_6 - IL_002e: ldloca.s V_4 - IL_0030: ldloc.s V_6 - IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0037: nop - IL_0038: ldloc.s V_6 - IL_003a: ldc.i4.1 - IL_003b: conv.i8 - IL_003c: add - IL_003d: stloc.s V_6 - IL_003f: ldloc.s V_5 - IL_0041: ldc.i4.1 - IL_0042: conv.i8 - IL_0043: add - IL_0044: stloc.s V_5 - IL_0046: br.s IL_0060 - - IL_0048: ldloca.s V_4 - IL_004a: ldloc.s V_6 - IL_004c: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0051: nop - IL_0052: ldloc.s V_6 - IL_0054: ldc.i4.1 - IL_0055: conv.i8 - IL_0056: add - IL_0057: stloc.s V_6 - IL_0059: ldloc.s V_5 - IL_005b: ldc.i4.1 - IL_005c: conv.i8 - IL_005d: add - IL_005e: stloc.s V_5 - IL_0060: ldloc.s V_5 - IL_0062: ldc.i4.0 - IL_0063: conv.i8 - IL_0064: bgt.un.s IL_0048 - - IL_0066: nop - IL_0067: br.s IL_00a3 - - IL_0069: ldloc.1 - IL_006a: ldloc.0 - IL_006b: bge.un.s IL_0072 - - IL_006d: ldc.i4.0 - IL_006e: conv.i8 - IL_006f: nop - IL_0070: br.s IL_0079 - - IL_0072: ldloc.1 - IL_0073: ldloc.0 - IL_0074: sub - IL_0075: ldc.i4.1 - IL_0076: conv.i8 - IL_0077: add.ovf.un - IL_0078: nop - IL_0079: stloc.s V_5 - IL_007b: ldc.i4.0 - IL_007c: conv.i8 - IL_007d: stloc.s V_6 - IL_007f: ldloc.0 - IL_0080: stloc.s V_7 - IL_0082: br.s IL_009c - - IL_0084: ldloca.s V_4 + IL_002e: ldloc.0 + IL_002f: stloc.s V_7 + IL_0031: br.s IL_0053 + + IL_0033: ldloca.s V_4 + IL_0035: ldloc.s V_7 + IL_0037: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003c: nop + IL_003d: ldloc.s V_7 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_7 + IL_0044: ldloc.s V_6 + IL_0046: ldc.i4.1 + IL_0047: conv.i8 + IL_0048: add + IL_0049: stloc.s V_6 + IL_004b: ldloc.s V_6 + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: cgt.un + IL_0051: stloc.s V_5 + IL_0053: ldloc.s V_5 + IL_0055: brtrue.s IL_0033 + + IL_0057: nop + IL_0058: br.s IL_0094 + + IL_005a: ldloc.1 + IL_005b: ldloc.0 + IL_005c: bge.un.s IL_0063 + + IL_005e: ldc.i4.0 + IL_005f: conv.i8 + IL_0060: nop + IL_0061: br.s IL_006a + + IL_0063: ldloc.1 + IL_0064: ldloc.0 + IL_0065: sub + IL_0066: ldc.i4.1 + IL_0067: conv.i8 + IL_0068: add.ovf.un + IL_0069: nop + IL_006a: stloc.s V_6 + IL_006c: ldc.i4.0 + IL_006d: conv.i8 + IL_006e: stloc.s V_7 + IL_0070: ldloc.0 + IL_0071: stloc.s V_8 + IL_0073: br.s IL_008d + + IL_0075: ldloca.s V_4 + IL_0077: ldloc.s V_8 + IL_0079: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007e: nop + IL_007f: ldloc.s V_8 + IL_0081: ldc.i4.1 + IL_0082: conv.i8 + IL_0083: add + IL_0084: stloc.s V_8 IL_0086: ldloc.s V_7 - IL_0088: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_008d: nop - IL_008e: ldloc.s V_7 - IL_0090: ldc.i4.1 - IL_0091: conv.i8 - IL_0092: add - IL_0093: stloc.s V_7 - IL_0095: ldloc.s V_6 - IL_0097: ldc.i4.1 - IL_0098: conv.i8 - IL_0099: add - IL_009a: stloc.s V_6 - IL_009c: ldloc.s V_6 - IL_009e: ldloc.s V_5 - IL_00a0: blt.un.s IL_0084 - - IL_00a2: nop - IL_00a3: ldloca.s V_4 - IL_00a5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00aa: ret + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: stloc.s V_7 + IL_008d: ldloc.s V_7 + IL_008f: ldloc.s V_6 + IL_0091: blt.un.s IL_0075 + + IL_0093: nop + IL_0094: ldloca.s V_4 + IL_0096: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009b: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed @@ -1524,9 +1493,10 @@ uint64 V_3, bool V_4, valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_5, - uint64 V_6, + bool V_6, uint64 V_7, - uint64 V_8) + uint64 V_8, + uint64 V_9) IL_0000: ldarg.0 IL_0001: ldnull IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) @@ -1575,96 +1545,88 @@ IL_003b: ceq IL_003d: stloc.s V_4 IL_003f: ldloc.s V_4 - IL_0041: brfalse.s IL_0083 + IL_0041: brfalse.s IL_0075 - IL_0043: ldc.i4.0 - IL_0044: conv.i8 - IL_0045: stloc.s V_6 - IL_0047: ldloc.0 + IL_0043: ldc.i4.1 + IL_0044: stloc.s V_6 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 IL_0048: stloc.s V_7 - IL_004a: ldloca.s V_5 - IL_004c: ldloc.s V_7 - IL_004e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_0053: nop - IL_0054: ldloc.s V_7 - IL_0056: ldloc.1 - IL_0057: add - IL_0058: stloc.s V_7 - IL_005a: ldloc.s V_6 - IL_005c: ldc.i4.1 - IL_005d: conv.i8 - IL_005e: add - IL_005f: stloc.s V_6 - IL_0061: br.s IL_007a + IL_004a: ldloc.0 + IL_004b: stloc.s V_8 + IL_004d: br.s IL_006e + + IL_004f: ldloca.s V_5 + IL_0051: ldloc.s V_8 + IL_0053: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0058: nop + IL_0059: ldloc.s V_8 + IL_005b: ldloc.1 + IL_005c: add + IL_005d: stloc.s V_8 + IL_005f: ldloc.s V_7 + IL_0061: ldc.i4.1 + IL_0062: conv.i8 + IL_0063: add + IL_0064: stloc.s V_7 + IL_0066: ldloc.s V_7 + IL_0068: ldc.i4.0 + IL_0069: conv.i8 + IL_006a: cgt.un + IL_006c: stloc.s V_6 + IL_006e: ldloc.s V_6 + IL_0070: brtrue.s IL_004f - IL_0063: ldloca.s V_5 - IL_0065: ldloc.s V_7 - IL_0067: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_006c: nop - IL_006d: ldloc.s V_7 - IL_006f: ldloc.1 - IL_0070: add - IL_0071: stloc.s V_7 - IL_0073: ldloc.s V_6 - IL_0075: ldc.i4.1 - IL_0076: conv.i8 - IL_0077: add - IL_0078: stloc.s V_6 - IL_007a: ldloc.s V_6 - IL_007c: ldc.i4.0 - IL_007d: conv.i8 - IL_007e: bgt.un.s IL_0063 - - IL_0080: nop - IL_0081: br.s IL_00be - - IL_0083: ldloc.2 - IL_0084: ldloc.0 - IL_0085: bge.un.s IL_008c - - IL_0087: ldc.i4.0 - IL_0088: conv.i8 - IL_0089: nop - IL_008a: br.s IL_0095 - - IL_008c: ldloc.2 + IL_0072: nop + IL_0073: br.s IL_00b0 + + IL_0075: ldloc.2 + IL_0076: ldloc.0 + IL_0077: bge.un.s IL_007e + + IL_0079: ldc.i4.0 + IL_007a: conv.i8 + IL_007b: nop + IL_007c: br.s IL_0087 + + IL_007e: ldloc.2 + IL_007f: ldloc.0 + IL_0080: sub + IL_0081: ldloc.1 + IL_0082: div.un + IL_0083: ldc.i4.1 + IL_0084: conv.i8 + IL_0085: add.ovf.un + IL_0086: nop + IL_0087: stloc.s V_7 + IL_0089: ldc.i4.0 + IL_008a: conv.i8 + IL_008b: stloc.s V_8 IL_008d: ldloc.0 - IL_008e: sub - IL_008f: ldloc.1 - IL_0090: div.un - IL_0091: ldc.i4.1 - IL_0092: conv.i8 - IL_0093: add.ovf.un - IL_0094: nop - IL_0095: stloc.s V_6 - IL_0097: ldc.i4.0 - IL_0098: conv.i8 - IL_0099: stloc.s V_7 - IL_009b: ldloc.0 - IL_009c: stloc.s V_8 - IL_009e: br.s IL_00b7 - - IL_00a0: ldloca.s V_5 + IL_008e: stloc.s V_9 + IL_0090: br.s IL_00a9 + + IL_0092: ldloca.s V_5 + IL_0094: ldloc.s V_9 + IL_0096: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_009b: nop + IL_009c: ldloc.s V_9 + IL_009e: ldloc.1 + IL_009f: add + IL_00a0: stloc.s V_9 IL_00a2: ldloc.s V_8 - IL_00a4: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) - IL_00a9: nop - IL_00aa: ldloc.s V_8 - IL_00ac: ldloc.1 - IL_00ad: add - IL_00ae: stloc.s V_8 - IL_00b0: ldloc.s V_7 - IL_00b2: ldc.i4.1 - IL_00b3: conv.i8 - IL_00b4: add - IL_00b5: stloc.s V_7 - IL_00b7: ldloc.s V_7 - IL_00b9: ldloc.s V_6 - IL_00bb: blt.un.s IL_00a0 - - IL_00bd: nop - IL_00be: ldloca.s V_5 - IL_00c0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() - IL_00c5: ret + IL_00a4: ldc.i4.1 + IL_00a5: conv.i8 + IL_00a6: add + IL_00a7: stloc.s V_8 + IL_00a9: ldloc.s V_8 + IL_00ab: ldloc.s V_7 + IL_00ad: blt.un.s IL_0092 + + IL_00af: nop + IL_00b0: ldloca.s V_5 + IL_00b2: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b7: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs.opt.il.bsl index 6ff23e775ec..0f20def3e61 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs.opt.il.bsl @@ -274,9 +274,10 @@ .maxstack 4 .locals init (uint64 V_0, - uint64 V_1, - int64 V_2, - uint64 V_3) + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.s IL_0009 @@ -294,87 +295,80 @@ IL_000e: ldloc.0 IL_000f: ldc.i4.m1 IL_0010: conv.i8 - IL_0011: bne.un.s IL_0040 + IL_0011: bne.un.s IL_0036 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 IL_0017: stloc.2 - IL_0018: ldloc.2 - IL_0019: call void assembly::set_c(int64) - IL_001e: ldloc.2 - IL_001f: ldc.i4.1 - IL_0020: conv.i8 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: add - IL_0027: stloc.1 - IL_0028: br.s IL_003a - - IL_002a: ldloc.2 - IL_002b: call void assembly::set_c(int64) - IL_0030: ldloc.2 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.2 - IL_0035: ldloc.1 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.1 - IL_003a: ldloc.1 - IL_003b: ldc.i4.0 - IL_003c: conv.i8 - IL_003d: bgt.un.s IL_002a - - IL_003f: ret - - IL_0040: ldarg.1 - IL_0041: ldarg.0 - IL_0042: bge.s IL_0049 - - IL_0044: ldc.i4.0 - IL_0045: conv.i8 - IL_0046: nop - IL_0047: br.s IL_0050 - - IL_0049: ldarg.1 - IL_004a: ldarg.0 - IL_004b: sub - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add.ovf.un - IL_004f: nop - IL_0050: stloc.1 - IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: stloc.3 - IL_0054: ldarg.0 - IL_0055: stloc.2 - IL_0056: br.s IL_0068 - - IL_0058: ldloc.2 - IL_0059: call void assembly::set_c(int64) - IL_005e: ldloc.2 - IL_005f: ldc.i4.1 - IL_0060: conv.i8 - IL_0061: add - IL_0062: stloc.2 - IL_0063: ldloc.3 - IL_0064: ldc.i4.1 - IL_0065: conv.i8 - IL_0066: add - IL_0067: stloc.3 - IL_0068: ldloc.3 - IL_0069: ldloc.1 - IL_006a: blt.un.s IL_0058 - - IL_006c: ret + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret } .method public static void f5() cil managed @@ -633,9 +627,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64 V_1, - int64 V_2, - uint64 V_3) + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000f @@ -695,115 +690,109 @@ IL_003a: ldloc.0 IL_003b: ldc.i4.m1 IL_003c: conv.i8 - IL_003d: bne.un.s IL_006a + IL_003d: bne.un.s IL_0061 - IL_003f: ldc.i4.0 - IL_0040: conv.i8 - IL_0041: stloc.1 - IL_0042: ldarg.2 + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 IL_0043: stloc.2 - IL_0044: ldloc.2 - IL_0045: call void assembly::set_c(int64) - IL_004a: ldloc.2 - IL_004b: ldarg.1 - IL_004c: add - IL_004d: stloc.2 - IL_004e: ldloc.1 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: add - IL_0052: stloc.1 - IL_0053: br.s IL_0064 - - IL_0055: ldloc.2 - IL_0056: call void assembly::set_c(int64) - IL_005b: ldloc.2 - IL_005c: ldarg.1 - IL_005d: add - IL_005e: stloc.2 - IL_005f: ldloc.1 - IL_0060: ldc.i4.1 - IL_0061: conv.i8 - IL_0062: add - IL_0063: stloc.1 - IL_0064: ldloc.1 - IL_0065: ldc.i4.0 - IL_0066: conv.i8 - IL_0067: bgt.un.s IL_0055 - - IL_0069: ret + IL_0044: ldarg.2 + IL_0045: stloc.3 + IL_0046: br.s IL_005d + + IL_0048: ldloc.3 + IL_0049: call void assembly::set_c(int64) + IL_004e: ldloc.3 + IL_004f: ldarg.1 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.2 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.2 + IL_0057: ldloc.2 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: cgt.un + IL_005c: stloc.1 + IL_005d: ldloc.1 + IL_005e: brtrue.s IL_0048 + + IL_0060: ret + + IL_0061: ldc.i4.0 + IL_0062: conv.i8 + IL_0063: ldarg.1 + IL_0064: bge.s IL_007a + + IL_0066: ldarg.2 + IL_0067: ldarg.2 + IL_0068: bge.s IL_006f IL_006a: ldc.i4.0 IL_006b: conv.i8 - IL_006c: ldarg.1 - IL_006d: bge.s IL_0083 + IL_006c: nop + IL_006d: br.s IL_0090 IL_006f: ldarg.2 IL_0070: ldarg.2 - IL_0071: bge.s IL_0078 - - IL_0073: ldc.i4.0 - IL_0074: conv.i8 - IL_0075: nop - IL_0076: br.s IL_0099 - - IL_0078: ldarg.2 - IL_0079: ldarg.2 - IL_007a: sub - IL_007b: ldarg.1 - IL_007c: div.un - IL_007d: ldc.i4.1 - IL_007e: conv.i8 - IL_007f: add.ovf.un + IL_0071: sub + IL_0072: ldarg.1 + IL_0073: div.un + IL_0074: ldc.i4.1 + IL_0075: conv.i8 + IL_0076: add.ovf.un + IL_0077: nop + IL_0078: br.s IL_0090 + + IL_007a: ldarg.2 + IL_007b: ldarg.2 + IL_007c: bge.s IL_0083 + + IL_007e: ldc.i4.0 + IL_007f: conv.i8 IL_0080: nop - IL_0081: br.s IL_0099 + IL_0081: br.s IL_0090 IL_0083: ldarg.2 IL_0084: ldarg.2 - IL_0085: bge.s IL_008c - - IL_0087: ldc.i4.0 - IL_0088: conv.i8 - IL_0089: nop - IL_008a: br.s IL_0099 - - IL_008c: ldarg.2 - IL_008d: ldarg.2 - IL_008e: sub - IL_008f: ldarg.1 - IL_0090: not - IL_0091: ldc.i4.1 + IL_0085: sub + IL_0086: ldarg.1 + IL_0087: not + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: div.un + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add.ovf.un + IL_008f: nop + IL_0090: stloc.2 + IL_0091: ldc.i4.0 IL_0092: conv.i8 - IL_0093: add - IL_0094: div.un - IL_0095: ldc.i4.1 - IL_0096: conv.i8 - IL_0097: add.ovf.un - IL_0098: nop - IL_0099: stloc.1 - IL_009a: ldc.i4.0 - IL_009b: conv.i8 - IL_009c: stloc.3 - IL_009d: ldarg.2 - IL_009e: stloc.2 - IL_009f: br.s IL_00b0 - - IL_00a1: ldloc.2 - IL_00a2: call void assembly::set_c(int64) - IL_00a7: ldloc.2 - IL_00a8: ldarg.1 - IL_00a9: add - IL_00aa: stloc.2 - IL_00ab: ldloc.3 - IL_00ac: ldc.i4.1 - IL_00ad: conv.i8 - IL_00ae: add - IL_00af: stloc.3 - IL_00b0: ldloc.3 - IL_00b1: ldloc.1 - IL_00b2: blt.un.s IL_00a1 - - IL_00b4: ret + IL_0093: stloc.s V_4 + IL_0095: ldarg.2 + IL_0096: stloc.3 + IL_0097: br.s IL_00aa + + IL_0099: ldloc.3 + IL_009a: call void assembly::set_c(int64) + IL_009f: ldloc.3 + IL_00a0: ldarg.1 + IL_00a1: add + IL_00a2: stloc.3 + IL_00a3: ldloc.s V_4 + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add + IL_00a8: stloc.s V_4 + IL_00aa: ldloc.s V_4 + IL_00ac: ldloc.2 + IL_00ad: blt.un.s IL_0099 + + IL_00af: ret } .method public static void f11(int64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs.opt.il.bsl index c64f77e725e..330c21deb58 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -167,9 +167,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldc.i8 0xa IL_0009: conv.i IL_000a: ldarg.0 @@ -202,89 +203,82 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00ae + IL_004f: brfalse.s IL_0094 - IL_0051: ldc.i8 0x0 - IL_005a: conv.i - IL_005b: stloc.1 - IL_005c: ldarg.0 + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i IL_005d: stloc.2 - IL_005e: ldloc.2 - IL_005f: call void assembly::set_c(native int) - IL_0064: ldloc.2 - IL_0065: ldc.i8 0x1 - IL_006e: conv.i - IL_006f: add - IL_0070: stloc.2 - IL_0071: ldloc.1 - IL_0072: ldc.i8 0x1 - IL_007b: conv.i - IL_007c: add - IL_007d: stloc.1 - IL_007e: br.s IL_00a0 - - IL_0080: ldloc.2 - IL_0081: call void assembly::set_c(native int) - IL_0086: ldloc.2 - IL_0087: ldc.i8 0x1 - IL_0090: conv.i - IL_0091: add - IL_0092: stloc.2 - IL_0093: ldloc.1 - IL_0094: ldc.i8 0x1 + IL_005e: ldarg.0 + IL_005f: stloc.3 + IL_0060: br.s IL_0090 + + IL_0062: ldloc.3 + IL_0063: call void assembly::set_c(native int) + IL_0068: ldloc.3 + IL_0069: ldc.i8 0x1 + IL_0072: conv.i + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.2 + IL_0076: ldc.i8 0x1 + IL_007f: conv.i + IL_0080: add + IL_0081: stloc.2 + IL_0082: ldloc.2 + IL_0083: ldc.i8 0x0 + IL_008c: conv.i + IL_008d: cgt.un + IL_008f: stloc.1 + IL_0090: ldloc.1 + IL_0091: brtrue.s IL_0062 + + IL_0093: ret + + IL_0094: ldc.i8 0xa IL_009d: conv.i - IL_009e: add - IL_009f: stloc.1 - IL_00a0: ldloc.1 + IL_009e: ldarg.0 + IL_009f: bge.s IL_00ae + IL_00a1: ldc.i8 0x0 IL_00aa: conv.i - IL_00ab: bgt.un.s IL_0080 - - IL_00ad: ret + IL_00ab: nop + IL_00ac: br.s IL_00c6 IL_00ae: ldc.i8 0xa IL_00b7: conv.i IL_00b8: ldarg.0 - IL_00b9: bge.s IL_00c8 - - IL_00bb: ldc.i8 0x0 - IL_00c4: conv.i + IL_00b9: sub + IL_00ba: ldc.i8 0x1 + IL_00c3: conv.i + IL_00c4: add.ovf.un IL_00c5: nop - IL_00c6: br.s IL_00e0 - - IL_00c8: ldc.i8 0xa - IL_00d1: conv.i + IL_00c6: stloc.2 + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: stloc.3 IL_00d2: ldarg.0 - IL_00d3: sub - IL_00d4: ldc.i8 0x1 - IL_00dd: conv.i - IL_00de: add.ovf.un - IL_00df: nop - IL_00e0: stloc.1 - IL_00e1: ldc.i8 0x0 - IL_00ea: conv.i - IL_00eb: stloc.2 - IL_00ec: ldarg.0 - IL_00ed: stloc.3 - IL_00ee: br.s IL_0110 - - IL_00f0: ldloc.3 - IL_00f1: call void assembly::set_c(native int) - IL_00f6: ldloc.3 - IL_00f7: ldc.i8 0x1 - IL_0100: conv.i - IL_0101: add - IL_0102: stloc.3 - IL_0103: ldloc.2 - IL_0104: ldc.i8 0x1 - IL_010d: conv.i - IL_010e: add - IL_010f: stloc.2 - IL_0110: ldloc.2 - IL_0111: ldloc.1 - IL_0112: blt.un.s IL_00f0 - - IL_0114: ret + IL_00d3: stloc.s V_4 + IL_00d5: br.s IL_00fa + + IL_00d7: ldloc.s V_4 + IL_00d9: call void assembly::set_c(native int) + IL_00de: ldloc.s V_4 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.i + IL_00ea: add + IL_00eb: stloc.s V_4 + IL_00ed: ldloc.3 + IL_00ee: ldc.i8 0x1 + IL_00f7: conv.i + IL_00f8: add + IL_00f9: stloc.3 + IL_00fa: ldloc.3 + IL_00fb: ldloc.2 + IL_00fc: blt.un.s IL_00d7 + + IL_00fe: ret } .method public static void f3(native int finish) cil managed @@ -292,9 +286,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x1 IL_000a: conv.i @@ -327,91 +322,84 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00b7 + IL_004f: brfalse.s IL_009d + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i + IL_005d: stloc.2 + IL_005e: ldc.i8 0x1 + IL_0067: conv.i + IL_0068: stloc.3 + IL_0069: br.s IL_0099 + + IL_006b: ldloc.3 + IL_006c: call void assembly::set_c(native int) + IL_0071: ldloc.3 + IL_0072: ldc.i8 0x1 + IL_007b: conv.i + IL_007c: add + IL_007d: stloc.3 + IL_007e: ldloc.2 + IL_007f: ldc.i8 0x1 + IL_0088: conv.i + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldc.i8 0x0 + IL_0095: conv.i + IL_0096: cgt.un + IL_0098: stloc.1 + IL_0099: ldloc.1 + IL_009a: brtrue.s IL_006b + + IL_009c: ret + + IL_009d: ldarg.0 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.i + IL_00a8: bge.s IL_00b7 - IL_0051: ldc.i8 0x0 - IL_005a: conv.i - IL_005b: stloc.1 - IL_005c: ldc.i8 0x1 - IL_0065: conv.i - IL_0066: stloc.2 - IL_0067: ldloc.2 - IL_0068: call void assembly::set_c(native int) - IL_006d: ldloc.2 - IL_006e: ldc.i8 0x1 - IL_0077: conv.i - IL_0078: add - IL_0079: stloc.2 - IL_007a: ldloc.1 - IL_007b: ldc.i8 0x1 - IL_0084: conv.i - IL_0085: add - IL_0086: stloc.1 - IL_0087: br.s IL_00a9 - - IL_0089: ldloc.2 - IL_008a: call void assembly::set_c(native int) - IL_008f: ldloc.2 - IL_0090: ldc.i8 0x1 - IL_0099: conv.i - IL_009a: add - IL_009b: stloc.2 - IL_009c: ldloc.1 - IL_009d: ldc.i8 0x1 - IL_00a6: conv.i - IL_00a7: add - IL_00a8: stloc.1 - IL_00a9: ldloc.1 IL_00aa: ldc.i8 0x0 IL_00b3: conv.i - IL_00b4: bgt.un.s IL_0089 - - IL_00b6: ret + IL_00b4: nop + IL_00b5: br.s IL_00cf IL_00b7: ldarg.0 IL_00b8: ldc.i8 0x1 IL_00c1: conv.i - IL_00c2: bge.s IL_00d1 - - IL_00c4: ldc.i8 0x0 - IL_00cd: conv.i + IL_00c2: sub + IL_00c3: ldc.i8 0x1 + IL_00cc: conv.i + IL_00cd: add.ovf.un IL_00ce: nop - IL_00cf: br.s IL_00e9 - - IL_00d1: ldarg.0 - IL_00d2: ldc.i8 0x1 - IL_00db: conv.i - IL_00dc: sub - IL_00dd: ldc.i8 0x1 - IL_00e6: conv.i - IL_00e7: add.ovf.un - IL_00e8: nop - IL_00e9: stloc.1 - IL_00ea: ldc.i8 0x0 - IL_00f3: conv.i - IL_00f4: stloc.2 - IL_00f5: ldc.i8 0x1 - IL_00fe: conv.i - IL_00ff: stloc.3 - IL_0100: br.s IL_0122 - - IL_0102: ldloc.3 - IL_0103: call void assembly::set_c(native int) - IL_0108: ldloc.3 - IL_0109: ldc.i8 0x1 - IL_0112: conv.i - IL_0113: add - IL_0114: stloc.3 - IL_0115: ldloc.2 - IL_0116: ldc.i8 0x1 - IL_011f: conv.i - IL_0120: add - IL_0121: stloc.2 - IL_0122: ldloc.2 - IL_0123: ldloc.1 - IL_0124: blt.un.s IL_0102 - - IL_0126: ret + IL_00cf: stloc.2 + IL_00d0: ldc.i8 0x0 + IL_00d9: conv.i + IL_00da: stloc.3 + IL_00db: ldc.i8 0x1 + IL_00e4: conv.i + IL_00e5: stloc.s V_4 + IL_00e7: br.s IL_010c + + IL_00e9: ldloc.s V_4 + IL_00eb: call void assembly::set_c(native int) + IL_00f0: ldloc.s V_4 + IL_00f2: ldc.i8 0x1 + IL_00fb: conv.i + IL_00fc: add + IL_00fd: stloc.s V_4 + IL_00ff: ldloc.3 + IL_0100: ldc.i8 0x1 + IL_0109: conv.i + IL_010a: add + IL_010b: stloc.3 + IL_010c: ldloc.3 + IL_010d: ldloc.2 + IL_010e: blt.un.s IL_00e9 + + IL_0110: ret } .method public static void f4(native int start, @@ -421,9 +409,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.s IL_0011 @@ -454,87 +443,80 @@ IL_0039: conv.u IL_003a: ceq IL_003c: nop - IL_003d: brfalse.s IL_009c + IL_003d: brfalse.s IL_0082 - IL_003f: ldc.i8 0x0 - IL_0048: conv.i - IL_0049: stloc.1 - IL_004a: ldarg.0 + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i IL_004b: stloc.2 - IL_004c: ldloc.2 - IL_004d: call void assembly::set_c(native int) - IL_0052: ldloc.2 - IL_0053: ldc.i8 0x1 - IL_005c: conv.i - IL_005d: add - IL_005e: stloc.2 - IL_005f: ldloc.1 - IL_0060: ldc.i8 0x1 - IL_0069: conv.i - IL_006a: add - IL_006b: stloc.1 - IL_006c: br.s IL_008e - - IL_006e: ldloc.2 - IL_006f: call void assembly::set_c(native int) - IL_0074: ldloc.2 - IL_0075: ldc.i8 0x1 - IL_007e: conv.i - IL_007f: add - IL_0080: stloc.2 - IL_0081: ldloc.1 - IL_0082: ldc.i8 0x1 - IL_008b: conv.i - IL_008c: add - IL_008d: stloc.1 - IL_008e: ldloc.1 - IL_008f: ldc.i8 0x0 - IL_0098: conv.i - IL_0099: bgt.un.s IL_006e - - IL_009b: ret - - IL_009c: ldarg.1 - IL_009d: ldarg.0 - IL_009e: bge.s IL_00ad - - IL_00a0: ldc.i8 0x0 - IL_00a9: conv.i - IL_00aa: nop - IL_00ab: br.s IL_00bc - - IL_00ad: ldarg.1 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 IL_00ae: ldarg.0 - IL_00af: sub - IL_00b0: ldc.i8 0x1 - IL_00b9: conv.i - IL_00ba: add.ovf.un - IL_00bb: nop - IL_00bc: stloc.1 - IL_00bd: ldc.i8 0x0 - IL_00c6: conv.i - IL_00c7: stloc.2 - IL_00c8: ldarg.0 - IL_00c9: stloc.3 - IL_00ca: br.s IL_00ec - - IL_00cc: ldloc.3 - IL_00cd: call void assembly::set_c(native int) - IL_00d2: ldloc.3 - IL_00d3: ldc.i8 0x1 - IL_00dc: conv.i - IL_00dd: add - IL_00de: stloc.3 - IL_00df: ldloc.2 - IL_00e0: ldc.i8 0x1 - IL_00e9: conv.i - IL_00ea: add - IL_00eb: stloc.2 - IL_00ec: ldloc.2 - IL_00ed: ldloc.1 - IL_00ee: blt.un.s IL_00cc + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 - IL_00f0: ret + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret } .method public static void f5() cil managed @@ -665,9 +647,10 @@ .maxstack 5 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x0 IL_000a: conv.i @@ -752,125 +735,119 @@ IL_00e1: conv.u IL_00e2: ceq IL_00e4: nop - IL_00e5: brfalse.s IL_013b + IL_00e5: brfalse.s IL_012a - IL_00e7: ldc.i8 0x0 - IL_00f0: conv.i - IL_00f1: stloc.1 - IL_00f2: ldc.i8 0x1 - IL_00fb: conv.i - IL_00fc: stloc.2 - IL_00fd: ldloc.2 - IL_00fe: call void assembly::set_c(native int) - IL_0103: ldloc.2 - IL_0104: ldarg.0 - IL_0105: add - IL_0106: stloc.2 - IL_0107: ldloc.1 - IL_0108: ldc.i8 0x1 - IL_0111: conv.i - IL_0112: add - IL_0113: stloc.1 - IL_0114: br.s IL_012d - - IL_0116: ldloc.2 - IL_0117: call void assembly::set_c(native int) - IL_011c: ldloc.2 - IL_011d: ldarg.0 - IL_011e: add - IL_011f: stloc.2 - IL_0120: ldloc.1 - IL_0121: ldc.i8 0x1 - IL_012a: conv.i - IL_012b: add - IL_012c: stloc.1 - IL_012d: ldloc.1 - IL_012e: ldc.i8 0x0 - IL_0137: conv.i - IL_0138: bgt.un.s IL_0116 - - IL_013a: ret - - IL_013b: ldc.i8 0x0 - IL_0144: conv.i - IL_0145: ldarg.0 - IL_0146: bge.s IL_0193 - - IL_0148: ldc.i8 0xa - IL_0151: conv.i - IL_0152: ldc.i8 0x1 - IL_015b: conv.i - IL_015c: bge.s IL_016e - - IL_015e: ldc.i8 0x0 - IL_0167: conv.i - IL_0168: nop - IL_0169: br IL_01e5 - - IL_016e: ldc.i8 0xa - IL_0177: conv.i - IL_0178: ldc.i8 0x1 - IL_0181: conv.i - IL_0182: sub - IL_0183: ldarg.0 - IL_0184: div.un - IL_0185: ldc.i8 0x1 - IL_018e: conv.i - IL_018f: add.ovf.un - IL_0190: nop - IL_0191: br.s IL_01e5 - - IL_0193: ldc.i8 0x1 - IL_019c: conv.i - IL_019d: ldc.i8 0xa - IL_01a6: conv.i - IL_01a7: bge.s IL_01b6 - - IL_01a9: ldc.i8 0x0 - IL_01b2: conv.i - IL_01b3: nop - IL_01b4: br.s IL_01e5 - - IL_01b6: ldc.i8 0x1 - IL_01bf: conv.i - IL_01c0: ldc.i8 0xa - IL_01c9: conv.i - IL_01ca: sub - IL_01cb: ldarg.0 - IL_01cc: not - IL_01cd: ldc.i8 0x1 - IL_01d6: conv.i - IL_01d7: add - IL_01d8: div.un - IL_01d9: ldc.i8 0x1 - IL_01e2: conv.i - IL_01e3: add.ovf.un - IL_01e4: nop - IL_01e5: stloc.1 - IL_01e6: ldc.i8 0x0 - IL_01ef: conv.i - IL_01f0: stloc.2 - IL_01f1: ldc.i8 0x1 - IL_01fa: conv.i - IL_01fb: stloc.3 - IL_01fc: br.s IL_0215 - - IL_01fe: ldloc.3 - IL_01ff: call void assembly::set_c(native int) - IL_0204: ldloc.3 - IL_0205: ldarg.0 + IL_00e7: ldc.i4.1 + IL_00e8: stloc.1 + IL_00e9: ldc.i8 0x0 + IL_00f2: conv.i + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x1 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: br.s IL_0126 + + IL_0101: ldloc.3 + IL_0102: call void assembly::set_c(native int) + IL_0107: ldloc.3 + IL_0108: ldarg.0 + IL_0109: add + IL_010a: stloc.3 + IL_010b: ldloc.2 + IL_010c: ldc.i8 0x1 + IL_0115: conv.i + IL_0116: add + IL_0117: stloc.2 + IL_0118: ldloc.2 + IL_0119: ldc.i8 0x0 + IL_0122: conv.i + IL_0123: cgt.un + IL_0125: stloc.1 + IL_0126: ldloc.1 + IL_0127: brtrue.s IL_0101 + + IL_0129: ret + + IL_012a: ldc.i8 0x0 + IL_0133: conv.i + IL_0134: ldarg.0 + IL_0135: bge.s IL_0182 + + IL_0137: ldc.i8 0xa + IL_0140: conv.i + IL_0141: ldc.i8 0x1 + IL_014a: conv.i + IL_014b: bge.s IL_015d + + IL_014d: ldc.i8 0x0 + IL_0156: conv.i + IL_0157: nop + IL_0158: br IL_01d4 + + IL_015d: ldc.i8 0xa + IL_0166: conv.i + IL_0167: ldc.i8 0x1 + IL_0170: conv.i + IL_0171: sub + IL_0172: ldarg.0 + IL_0173: div.un + IL_0174: ldc.i8 0x1 + IL_017d: conv.i + IL_017e: add.ovf.un + IL_017f: nop + IL_0180: br.s IL_01d4 + + IL_0182: ldc.i8 0x1 + IL_018b: conv.i + IL_018c: ldc.i8 0xa + IL_0195: conv.i + IL_0196: bge.s IL_01a5 + + IL_0198: ldc.i8 0x0 + IL_01a1: conv.i + IL_01a2: nop + IL_01a3: br.s IL_01d4 + + IL_01a5: ldc.i8 0x1 + IL_01ae: conv.i + IL_01af: ldc.i8 0xa + IL_01b8: conv.i + IL_01b9: sub + IL_01ba: ldarg.0 + IL_01bb: not + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add + IL_01c7: div.un + IL_01c8: ldc.i8 0x1 + IL_01d1: conv.i + IL_01d2: add.ovf.un + IL_01d3: nop + IL_01d4: stloc.2 + IL_01d5: ldc.i8 0x0 + IL_01de: conv.i + IL_01df: stloc.3 + IL_01e0: ldc.i8 0x1 + IL_01e9: conv.i + IL_01ea: stloc.s V_4 + IL_01ec: br.s IL_0208 + + IL_01ee: ldloc.s V_4 + IL_01f0: call void assembly::set_c(native int) + IL_01f5: ldloc.s V_4 + IL_01f7: ldarg.0 + IL_01f8: add + IL_01f9: stloc.s V_4 + IL_01fb: ldloc.3 + IL_01fc: ldc.i8 0x1 + IL_0205: conv.i IL_0206: add IL_0207: stloc.3 - IL_0208: ldloc.2 - IL_0209: ldc.i8 0x1 - IL_0212: conv.i - IL_0213: add - IL_0214: stloc.2 - IL_0215: ldloc.2 - IL_0216: ldloc.1 - IL_0217: blt.un.s IL_01fe - - IL_0219: ret + IL_0208: ldloc.3 + IL_0209: ldloc.2 + IL_020a: blt.un.s IL_01ee + + IL_020c: ret } .method public static void f9(native int finish) cil managed @@ -938,9 +915,10 @@ .maxstack 5 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.1 IL_0001: ldc.i8 0x0 IL_000a: conv.i @@ -1015,115 +993,109 @@ IL_0087: conv.u IL_0088: ceq IL_008a: nop - IL_008b: brfalse.s IL_00d8 + IL_008b: brfalse.s IL_00c7 - IL_008d: ldc.i8 0x0 - IL_0096: conv.i - IL_0097: stloc.1 - IL_0098: ldarg.2 + IL_008d: ldc.i4.1 + IL_008e: stloc.1 + IL_008f: ldc.i8 0x0 + IL_0098: conv.i IL_0099: stloc.2 - IL_009a: ldloc.2 - IL_009b: call void assembly::set_c(native int) - IL_00a0: ldloc.2 - IL_00a1: ldarg.1 - IL_00a2: add - IL_00a3: stloc.2 - IL_00a4: ldloc.1 - IL_00a5: ldc.i8 0x1 - IL_00ae: conv.i - IL_00af: add - IL_00b0: stloc.1 - IL_00b1: br.s IL_00ca - - IL_00b3: ldloc.2 - IL_00b4: call void assembly::set_c(native int) - IL_00b9: ldloc.2 - IL_00ba: ldarg.1 - IL_00bb: add - IL_00bc: stloc.2 - IL_00bd: ldloc.1 - IL_00be: ldc.i8 0x1 - IL_00c7: conv.i - IL_00c8: add - IL_00c9: stloc.1 - IL_00ca: ldloc.1 - IL_00cb: ldc.i8 0x0 - IL_00d4: conv.i - IL_00d5: bgt.un.s IL_00b3 - - IL_00d7: ret + IL_009a: ldarg.2 + IL_009b: stloc.3 + IL_009c: br.s IL_00c3 + + IL_009e: ldloc.3 + IL_009f: call void assembly::set_c(native int) + IL_00a4: ldloc.3 + IL_00a5: ldarg.1 + IL_00a6: add + IL_00a7: stloc.3 + IL_00a8: ldloc.2 + IL_00a9: ldc.i8 0x1 + IL_00b2: conv.i + IL_00b3: add + IL_00b4: stloc.2 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x0 + IL_00bf: conv.i + IL_00c0: cgt.un + IL_00c2: stloc.1 + IL_00c3: ldloc.1 + IL_00c4: brtrue.s IL_009e + + IL_00c6: ret + + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: ldarg.1 + IL_00d2: bge.s IL_00f8 + + IL_00d4: ldarg.2 + IL_00d5: ldarg.2 + IL_00d6: bge.s IL_00e5 IL_00d8: ldc.i8 0x0 IL_00e1: conv.i - IL_00e2: ldarg.1 - IL_00e3: bge.s IL_0109 + IL_00e2: nop + IL_00e3: br.s IL_0126 IL_00e5: ldarg.2 IL_00e6: ldarg.2 - IL_00e7: bge.s IL_00f6 + IL_00e7: sub + IL_00e8: ldarg.1 + IL_00e9: div.un + IL_00ea: ldc.i8 0x1 + IL_00f3: conv.i + IL_00f4: add.ovf.un + IL_00f5: nop + IL_00f6: br.s IL_0126 - IL_00e9: ldc.i8 0x0 - IL_00f2: conv.i - IL_00f3: nop - IL_00f4: br.s IL_0137 - - IL_00f6: ldarg.2 - IL_00f7: ldarg.2 - IL_00f8: sub - IL_00f9: ldarg.1 - IL_00fa: div.un - IL_00fb: ldc.i8 0x1 - IL_0104: conv.i - IL_0105: add.ovf.un + IL_00f8: ldarg.2 + IL_00f9: ldarg.2 + IL_00fa: bge.s IL_0109 + + IL_00fc: ldc.i8 0x0 + IL_0105: conv.i IL_0106: nop - IL_0107: br.s IL_0137 + IL_0107: br.s IL_0126 IL_0109: ldarg.2 IL_010a: ldarg.2 - IL_010b: bge.s IL_011a - - IL_010d: ldc.i8 0x0 - IL_0116: conv.i - IL_0117: nop - IL_0118: br.s IL_0137 - - IL_011a: ldarg.2 - IL_011b: ldarg.2 - IL_011c: sub - IL_011d: ldarg.1 - IL_011e: not - IL_011f: ldc.i8 0x1 - IL_0128: conv.i - IL_0129: add - IL_012a: div.un - IL_012b: ldc.i8 0x1 - IL_0134: conv.i - IL_0135: add.ovf.un - IL_0136: nop - IL_0137: stloc.1 - IL_0138: ldc.i8 0x0 - IL_0141: conv.i - IL_0142: stloc.2 - IL_0143: ldarg.2 - IL_0144: stloc.3 - IL_0145: br.s IL_015e - - IL_0147: ldloc.3 - IL_0148: call void assembly::set_c(native int) - IL_014d: ldloc.3 - IL_014e: ldarg.1 + IL_010b: sub + IL_010c: ldarg.1 + IL_010d: not + IL_010e: ldc.i8 0x1 + IL_0117: conv.i + IL_0118: add + IL_0119: div.un + IL_011a: ldc.i8 0x1 + IL_0123: conv.i + IL_0124: add.ovf.un + IL_0125: nop + IL_0126: stloc.2 + IL_0127: ldc.i8 0x0 + IL_0130: conv.i + IL_0131: stloc.3 + IL_0132: ldarg.2 + IL_0133: stloc.s V_4 + IL_0135: br.s IL_0151 + + IL_0137: ldloc.s V_4 + IL_0139: call void assembly::set_c(native int) + IL_013e: ldloc.s V_4 + IL_0140: ldarg.1 + IL_0141: add + IL_0142: stloc.s V_4 + IL_0144: ldloc.3 + IL_0145: ldc.i8 0x1 + IL_014e: conv.i IL_014f: add IL_0150: stloc.3 - IL_0151: ldloc.2 - IL_0152: ldc.i8 0x1 - IL_015b: conv.i - IL_015c: add - IL_015d: stloc.2 - IL_015e: ldloc.2 - IL_015f: ldloc.1 - IL_0160: blt.un.s IL_0147 - - IL_0162: ret + IL_0151: ldloc.3 + IL_0152: ldloc.2 + IL_0153: blt.un.s IL_0137 + + IL_0155: ret } .method public static void f11(native int start, @@ -1224,9 +1196,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldc.i8 0xa IL_0009: conv.i IL_000a: ldc.i8 0x1 @@ -1261,93 +1234,86 @@ IL_005d: conv.u IL_005e: ceq IL_0060: nop - IL_0061: brfalse.s IL_00c9 - - IL_0063: ldc.i8 0x0 - IL_006c: conv.i - IL_006d: stloc.1 - IL_006e: ldc.i8 0xa - IL_0077: conv.i - IL_0078: stloc.2 - IL_0079: ldloc.2 - IL_007a: call void assembly::set_c(native int) - IL_007f: ldloc.2 - IL_0080: ldc.i8 0xffffffffffffffff - IL_0089: conv.i - IL_008a: add - IL_008b: stloc.2 - IL_008c: ldloc.1 - IL_008d: ldc.i8 0x1 - IL_0096: conv.i - IL_0097: add - IL_0098: stloc.1 - IL_0099: br.s IL_00bb - - IL_009b: ldloc.2 - IL_009c: call void assembly::set_c(native int) - IL_00a1: ldloc.2 - IL_00a2: ldc.i8 0xffffffffffffffff - IL_00ab: conv.i - IL_00ac: add - IL_00ad: stloc.2 - IL_00ae: ldloc.1 - IL_00af: ldc.i8 0x1 - IL_00b8: conv.i - IL_00b9: add - IL_00ba: stloc.1 - IL_00bb: ldloc.1 - IL_00bc: ldc.i8 0x0 - IL_00c5: conv.i - IL_00c6: bgt.un.s IL_009b + IL_0061: brfalse.s IL_00af - IL_00c8: ret + IL_0063: ldc.i4.1 + IL_0064: stloc.1 + IL_0065: ldc.i8 0x0 + IL_006e: conv.i + IL_006f: stloc.2 + IL_0070: ldc.i8 0xa + IL_0079: conv.i + IL_007a: stloc.3 + IL_007b: br.s IL_00ab + + IL_007d: ldloc.3 + IL_007e: call void assembly::set_c(native int) + IL_0083: ldloc.3 + IL_0084: ldc.i8 0xffffffffffffffff + IL_008d: conv.i + IL_008e: add + IL_008f: stloc.3 + IL_0090: ldloc.2 + IL_0091: ldc.i8 0x1 + IL_009a: conv.i + IL_009b: add + IL_009c: stloc.2 + IL_009d: ldloc.2 + IL_009e: ldc.i8 0x0 + IL_00a7: conv.i + IL_00a8: cgt.un + IL_00aa: stloc.1 + IL_00ab: ldloc.1 + IL_00ac: brtrue.s IL_007d + + IL_00ae: ret + + IL_00af: ldc.i8 0xa + IL_00b8: conv.i + IL_00b9: ldc.i8 0x1 + IL_00c2: conv.i + IL_00c3: bge.s IL_00d2 - IL_00c9: ldc.i8 0xa - IL_00d2: conv.i - IL_00d3: ldc.i8 0x1 - IL_00dc: conv.i - IL_00dd: bge.s IL_00ec + IL_00c5: ldc.i8 0x0 + IL_00ce: conv.i + IL_00cf: nop + IL_00d0: br.s IL_00f3 - IL_00df: ldc.i8 0x0 - IL_00e8: conv.i - IL_00e9: nop - IL_00ea: br.s IL_010d - - IL_00ec: ldc.i8 0xa - IL_00f5: conv.i - IL_00f6: ldc.i8 0x1 - IL_00ff: conv.i - IL_0100: sub - IL_0101: ldc.i8 0x1 - IL_010a: conv.i - IL_010b: add.ovf.un - IL_010c: nop - IL_010d: stloc.1 - IL_010e: ldc.i8 0x0 - IL_0117: conv.i - IL_0118: stloc.2 - IL_0119: ldc.i8 0xa - IL_0122: conv.i - IL_0123: stloc.3 - IL_0124: br.s IL_0146 - - IL_0126: ldloc.3 - IL_0127: call void assembly::set_c(native int) - IL_012c: ldloc.3 - IL_012d: ldc.i8 0xffffffffffffffff - IL_0136: conv.i - IL_0137: add - IL_0138: stloc.3 - IL_0139: ldloc.2 - IL_013a: ldc.i8 0x1 - IL_0143: conv.i - IL_0144: add - IL_0145: stloc.2 - IL_0146: ldloc.2 - IL_0147: ldloc.1 - IL_0148: blt.un.s IL_0126 - - IL_014a: ret + IL_00d2: ldc.i8 0xa + IL_00db: conv.i + IL_00dc: ldc.i8 0x1 + IL_00e5: conv.i + IL_00e6: sub + IL_00e7: ldc.i8 0x1 + IL_00f0: conv.i + IL_00f1: add.ovf.un + IL_00f2: nop + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x0 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: ldc.i8 0xa + IL_0108: conv.i + IL_0109: stloc.s V_4 + IL_010b: br.s IL_0130 + + IL_010d: ldloc.s V_4 + IL_010f: call void assembly::set_c(native int) + IL_0114: ldloc.s V_4 + IL_0116: ldc.i8 0xffffffffffffffff + IL_011f: conv.i + IL_0120: add + IL_0121: stloc.s V_4 + IL_0123: ldloc.3 + IL_0124: ldc.i8 0x1 + IL_012d: conv.i + IL_012e: add + IL_012f: stloc.3 + IL_0130: ldloc.3 + IL_0131: ldloc.2 + IL_0132: blt.un.s IL_010d + + IL_0134: ret } .method public static void f14() cil managed @@ -1355,9 +1321,10 @@ .maxstack 5 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldc.i8 0xfffffffffffffffe IL_0009: conv.i IL_000a: ldc.i8 0x0 @@ -1447,131 +1414,124 @@ IL_010e: conv.u IL_010f: ceq IL_0111: nop - IL_0112: brfalse.s IL_017a - - IL_0114: ldc.i8 0x0 - IL_011d: conv.i - IL_011e: stloc.1 - IL_011f: ldc.i8 0xa - IL_0128: conv.i - IL_0129: stloc.2 - IL_012a: ldloc.2 - IL_012b: call void assembly::set_c(native int) - IL_0130: ldloc.2 - IL_0131: ldc.i8 0xfffffffffffffffe - IL_013a: conv.i - IL_013b: add - IL_013c: stloc.2 - IL_013d: ldloc.1 - IL_013e: ldc.i8 0x1 - IL_0147: conv.i - IL_0148: add - IL_0149: stloc.1 - IL_014a: br.s IL_016c - - IL_014c: ldloc.2 - IL_014d: call void assembly::set_c(native int) - IL_0152: ldloc.2 - IL_0153: ldc.i8 0xfffffffffffffffe - IL_015c: conv.i - IL_015d: add - IL_015e: stloc.2 - IL_015f: ldloc.1 - IL_0160: ldc.i8 0x1 + IL_0112: brfalse.s IL_0160 + + IL_0114: ldc.i4.1 + IL_0115: stloc.1 + IL_0116: ldc.i8 0x0 + IL_011f: conv.i + IL_0120: stloc.2 + IL_0121: ldc.i8 0xa + IL_012a: conv.i + IL_012b: stloc.3 + IL_012c: br.s IL_015c + + IL_012e: ldloc.3 + IL_012f: call void assembly::set_c(native int) + IL_0134: ldloc.3 + IL_0135: ldc.i8 0xfffffffffffffffe + IL_013e: conv.i + IL_013f: add + IL_0140: stloc.3 + IL_0141: ldloc.2 + IL_0142: ldc.i8 0x1 + IL_014b: conv.i + IL_014c: add + IL_014d: stloc.2 + IL_014e: ldloc.2 + IL_014f: ldc.i8 0x0 + IL_0158: conv.i + IL_0159: cgt.un + IL_015b: stloc.1 + IL_015c: ldloc.1 + IL_015d: brtrue.s IL_012e + + IL_015f: ret + + IL_0160: ldc.i8 0x0 IL_0169: conv.i - IL_016a: add - IL_016b: stloc.1 - IL_016c: ldloc.1 - IL_016d: ldc.i8 0x0 - IL_0176: conv.i - IL_0177: bgt.un.s IL_014c - - IL_0179: ret - - IL_017a: ldc.i8 0x0 - IL_0183: conv.i - IL_0184: ldc.i8 0xfffffffffffffffe - IL_018d: conv.i - IL_018e: bge.s IL_01e4 - - IL_0190: ldc.i8 0x1 - IL_0199: conv.i - IL_019a: ldc.i8 0xa - IL_01a3: conv.i - IL_01a4: bge.s IL_01b6 - - IL_01a6: ldc.i8 0x0 + IL_016a: ldc.i8 0xfffffffffffffffe + IL_0173: conv.i + IL_0174: bge.s IL_01ca + + IL_0176: ldc.i8 0x1 + IL_017f: conv.i + IL_0180: ldc.i8 0xa + IL_0189: conv.i + IL_018a: bge.s IL_019c + + IL_018c: ldc.i8 0x0 + IL_0195: conv.i + IL_0196: nop + IL_0197: br IL_0225 + + IL_019c: ldc.i8 0x1 + IL_01a5: conv.i + IL_01a6: ldc.i8 0xa IL_01af: conv.i - IL_01b0: nop - IL_01b1: br IL_023f - - IL_01b6: ldc.i8 0x1 - IL_01bf: conv.i - IL_01c0: ldc.i8 0xa - IL_01c9: conv.i - IL_01ca: sub - IL_01cb: ldc.i8 0xfffffffffffffffe - IL_01d4: conv.i - IL_01d5: div.un - IL_01d6: ldc.i8 0x1 - IL_01df: conv.i - IL_01e0: add.ovf.un - IL_01e1: nop - IL_01e2: br.s IL_023f - - IL_01e4: ldc.i8 0xa - IL_01ed: conv.i - IL_01ee: ldc.i8 0x1 - IL_01f7: conv.i - IL_01f8: bge.s IL_0207 - - IL_01fa: ldc.i8 0x0 - IL_0203: conv.i - IL_0204: nop - IL_0205: br.s IL_023f - - IL_0207: ldc.i8 0xa - IL_0210: conv.i - IL_0211: ldc.i8 0x1 - IL_021a: conv.i - IL_021b: sub - IL_021c: ldc.i8 0xfffffffffffffffe - IL_0225: conv.i - IL_0226: not - IL_0227: ldc.i8 0x1 - IL_0230: conv.i - IL_0231: add - IL_0232: div.un - IL_0233: ldc.i8 0x1 - IL_023c: conv.i - IL_023d: add.ovf.un - IL_023e: nop - IL_023f: stloc.1 - IL_0240: ldc.i8 0x0 - IL_0249: conv.i - IL_024a: stloc.2 - IL_024b: ldc.i8 0xa - IL_0254: conv.i - IL_0255: stloc.3 - IL_0256: br.s IL_0278 - - IL_0258: ldloc.3 - IL_0259: call void assembly::set_c(native int) - IL_025e: ldloc.3 - IL_025f: ldc.i8 0xfffffffffffffffe - IL_0268: conv.i - IL_0269: add - IL_026a: stloc.3 - IL_026b: ldloc.2 - IL_026c: ldc.i8 0x1 - IL_0275: conv.i - IL_0276: add - IL_0277: stloc.2 - IL_0278: ldloc.2 - IL_0279: ldloc.1 - IL_027a: blt.un.s IL_0258 - - IL_027c: ret + IL_01b0: sub + IL_01b1: ldc.i8 0xfffffffffffffffe + IL_01ba: conv.i + IL_01bb: div.un + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add.ovf.un + IL_01c7: nop + IL_01c8: br.s IL_0225 + + IL_01ca: ldc.i8 0xa + IL_01d3: conv.i + IL_01d4: ldc.i8 0x1 + IL_01dd: conv.i + IL_01de: bge.s IL_01ed + + IL_01e0: ldc.i8 0x0 + IL_01e9: conv.i + IL_01ea: nop + IL_01eb: br.s IL_0225 + + IL_01ed: ldc.i8 0xa + IL_01f6: conv.i + IL_01f7: ldc.i8 0x1 + IL_0200: conv.i + IL_0201: sub + IL_0202: ldc.i8 0xfffffffffffffffe + IL_020b: conv.i + IL_020c: not + IL_020d: ldc.i8 0x1 + IL_0216: conv.i + IL_0217: add + IL_0218: div.un + IL_0219: ldc.i8 0x1 + IL_0222: conv.i + IL_0223: add.ovf.un + IL_0224: nop + IL_0225: stloc.2 + IL_0226: ldc.i8 0x0 + IL_022f: conv.i + IL_0230: stloc.3 + IL_0231: ldc.i8 0xa + IL_023a: conv.i + IL_023b: stloc.s V_4 + IL_023d: br.s IL_0262 + + IL_023f: ldloc.s V_4 + IL_0241: call void assembly::set_c(native int) + IL_0246: ldloc.s V_4 + IL_0248: ldc.i8 0xfffffffffffffffe + IL_0251: conv.i + IL_0252: add + IL_0253: stloc.s V_4 + IL_0255: ldloc.3 + IL_0256: ldc.i8 0x1 + IL_025f: conv.i + IL_0260: add + IL_0261: stloc.3 + IL_0262: ldloc.3 + IL_0263: ldloc.2 + IL_0264: blt.un.s IL_023f + + IL_0266: ret } .property native int c() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs.opt.il.bsl index f676754bcbb..8076772e763 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -274,9 +274,10 @@ .maxstack 4 .locals init (uint64 V_0, - uint64 V_1, + bool V_1, uint64 V_2, - uint64 V_3) + uint64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.un.s IL_0009 @@ -294,87 +295,80 @@ IL_000e: ldloc.0 IL_000f: ldc.i4.m1 IL_0010: conv.i8 - IL_0011: bne.un.s IL_0040 + IL_0011: bne.un.s IL_0036 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 IL_0017: stloc.2 - IL_0018: ldloc.2 - IL_0019: call void assembly::set_c(uint64) - IL_001e: ldloc.2 - IL_001f: ldc.i4.1 - IL_0020: conv.i8 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: add - IL_0027: stloc.1 - IL_0028: br.s IL_003a + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 - IL_002a: ldloc.2 - IL_002b: call void assembly::set_c(uint64) - IL_0030: ldloc.2 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.2 - IL_0035: ldloc.1 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.1 - IL_003a: ldloc.1 - IL_003b: ldc.i4.0 - IL_003c: conv.i8 - IL_003d: bgt.un.s IL_002a - - IL_003f: ret - - IL_0040: ldarg.1 - IL_0041: ldarg.0 - IL_0042: bge.un.s IL_0049 - - IL_0044: ldc.i4.0 - IL_0045: conv.i8 - IL_0046: nop - IL_0047: br.s IL_0050 - - IL_0049: ldarg.1 + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(uint64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.un.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.3 IL_004a: ldarg.0 - IL_004b: sub - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add.ovf.un - IL_004f: nop - IL_0050: stloc.1 - IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: stloc.2 - IL_0054: ldarg.0 - IL_0055: stloc.3 - IL_0056: br.s IL_0068 - - IL_0058: ldloc.3 - IL_0059: call void assembly::set_c(uint64) - IL_005e: ldloc.3 - IL_005f: ldc.i4.1 - IL_0060: conv.i8 - IL_0061: add - IL_0062: stloc.3 + IL_004b: stloc.s V_4 + IL_004d: br.s IL_0062 + + IL_004f: ldloc.s V_4 + IL_0051: call void assembly::set_c(uint64) + IL_0056: ldloc.s V_4 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_4 + IL_005d: ldloc.3 + IL_005e: ldc.i4.1 + IL_005f: conv.i8 + IL_0060: add + IL_0061: stloc.3 + IL_0062: ldloc.3 IL_0063: ldloc.2 - IL_0064: ldc.i4.1 - IL_0065: conv.i8 - IL_0066: add - IL_0067: stloc.2 - IL_0068: ldloc.2 - IL_0069: ldloc.1 - IL_006a: blt.un.s IL_0058 - - IL_006c: ret + IL_0064: blt.un.s IL_004f + + IL_0066: ret } .method public static void f5() cil managed @@ -622,9 +616,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64 V_1, + bool V_1, uint64 V_2, - uint64 V_3) + uint64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000f @@ -658,86 +653,80 @@ IL_0020: ldloc.0 IL_0021: ldc.i4.m1 IL_0022: conv.i8 - IL_0023: bne.un.s IL_0050 + IL_0023: bne.un.s IL_0047 - IL_0025: ldc.i4.0 - IL_0026: conv.i8 - IL_0027: stloc.1 - IL_0028: ldarg.2 + IL_0025: ldc.i4.1 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 IL_0029: stloc.2 - IL_002a: ldloc.2 - IL_002b: call void assembly::set_c(uint64) - IL_0030: ldloc.2 - IL_0031: ldarg.1 - IL_0032: add - IL_0033: stloc.2 - IL_0034: ldloc.1 - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: add - IL_0038: stloc.1 - IL_0039: br.s IL_004a - - IL_003b: ldloc.2 - IL_003c: call void assembly::set_c(uint64) - IL_0041: ldloc.2 - IL_0042: ldarg.1 - IL_0043: add - IL_0044: stloc.2 - IL_0045: ldloc.1 - IL_0046: ldc.i4.1 - IL_0047: conv.i8 - IL_0048: add - IL_0049: stloc.1 - IL_004a: ldloc.1 + IL_002a: ldarg.2 + IL_002b: stloc.3 + IL_002c: br.s IL_0043 + + IL_002e: ldloc.3 + IL_002f: call void assembly::set_c(uint64) + IL_0034: ldloc.3 + IL_0035: ldarg.1 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.2 + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: add + IL_003c: stloc.2 + IL_003d: ldloc.2 + IL_003e: ldc.i4.0 + IL_003f: conv.i8 + IL_0040: cgt.un + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: brtrue.s IL_002e + + IL_0046: ret + + IL_0047: ldarg.2 + IL_0048: ldarg.2 + IL_0049: bge.un.s IL_0050 + IL_004b: ldc.i4.0 IL_004c: conv.i8 - IL_004d: bgt.un.s IL_003b - - IL_004f: ret + IL_004d: nop + IL_004e: br.s IL_0059 IL_0050: ldarg.2 IL_0051: ldarg.2 - IL_0052: bge.un.s IL_0059 - - IL_0054: ldc.i4.0 - IL_0055: conv.i8 - IL_0056: nop - IL_0057: br.s IL_0062 - - IL_0059: ldarg.2 - IL_005a: ldarg.2 - IL_005b: sub - IL_005c: ldarg.1 - IL_005d: div.un - IL_005e: ldc.i4.1 - IL_005f: conv.i8 - IL_0060: add.ovf.un - IL_0061: nop - IL_0062: stloc.1 - IL_0063: ldc.i4.0 - IL_0064: conv.i8 - IL_0065: stloc.2 - IL_0066: ldarg.2 - IL_0067: stloc.3 - IL_0068: br.s IL_0079 - - IL_006a: ldloc.3 - IL_006b: call void assembly::set_c(uint64) - IL_0070: ldloc.3 - IL_0071: ldarg.1 + IL_0052: sub + IL_0053: ldarg.1 + IL_0054: div.un + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add.ovf.un + IL_0058: nop + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.3 + IL_005d: ldarg.2 + IL_005e: stloc.s V_4 + IL_0060: br.s IL_0074 + + IL_0062: ldloc.s V_4 + IL_0064: call void assembly::set_c(uint64) + IL_0069: ldloc.s V_4 + IL_006b: ldarg.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 IL_0072: add IL_0073: stloc.3 - IL_0074: ldloc.2 - IL_0075: ldc.i4.1 - IL_0076: conv.i8 - IL_0077: add - IL_0078: stloc.2 - IL_0079: ldloc.2 - IL_007a: ldloc.1 - IL_007b: blt.un.s IL_006a - - IL_007d: ret + IL_0074: ldloc.3 + IL_0075: ldloc.2 + IL_0076: blt.un.s IL_0062 + + IL_0078: ret } .method public static void f11(uint64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs.opt.il.bsl index 6046c8843ba..9af9230923b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -167,9 +167,10 @@ .maxstack 4 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldc.i8 0xa IL_0009: conv.u IL_000a: ldarg.0 @@ -202,89 +203,82 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00ae + IL_004f: brfalse.s IL_0094 - IL_0051: ldc.i8 0x0 - IL_005a: conv.u - IL_005b: stloc.1 - IL_005c: ldarg.0 + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.u IL_005d: stloc.2 - IL_005e: ldloc.2 - IL_005f: call void assembly::set_c(native uint) - IL_0064: ldloc.2 - IL_0065: ldc.i8 0x1 - IL_006e: conv.u - IL_006f: add - IL_0070: stloc.2 - IL_0071: ldloc.1 - IL_0072: ldc.i8 0x1 - IL_007b: conv.u - IL_007c: add - IL_007d: stloc.1 - IL_007e: br.s IL_00a0 - - IL_0080: ldloc.2 - IL_0081: call void assembly::set_c(native uint) - IL_0086: ldloc.2 - IL_0087: ldc.i8 0x1 - IL_0090: conv.u - IL_0091: add - IL_0092: stloc.2 - IL_0093: ldloc.1 - IL_0094: ldc.i8 0x1 + IL_005e: ldarg.0 + IL_005f: stloc.3 + IL_0060: br.s IL_0090 + + IL_0062: ldloc.3 + IL_0063: call void assembly::set_c(native uint) + IL_0068: ldloc.3 + IL_0069: ldc.i8 0x1 + IL_0072: conv.u + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.2 + IL_0076: ldc.i8 0x1 + IL_007f: conv.u + IL_0080: add + IL_0081: stloc.2 + IL_0082: ldloc.2 + IL_0083: ldc.i8 0x0 + IL_008c: conv.u + IL_008d: cgt.un + IL_008f: stloc.1 + IL_0090: ldloc.1 + IL_0091: brtrue.s IL_0062 + + IL_0093: ret + + IL_0094: ldc.i8 0xa IL_009d: conv.u - IL_009e: add - IL_009f: stloc.1 - IL_00a0: ldloc.1 + IL_009e: ldarg.0 + IL_009f: bge.un.s IL_00ae + IL_00a1: ldc.i8 0x0 IL_00aa: conv.u - IL_00ab: bgt.un.s IL_0080 - - IL_00ad: ret + IL_00ab: nop + IL_00ac: br.s IL_00c6 IL_00ae: ldc.i8 0xa IL_00b7: conv.u IL_00b8: ldarg.0 - IL_00b9: bge.un.s IL_00c8 - - IL_00bb: ldc.i8 0x0 - IL_00c4: conv.u + IL_00b9: sub + IL_00ba: ldc.i8 0x1 + IL_00c3: conv.u + IL_00c4: add.ovf.un IL_00c5: nop - IL_00c6: br.s IL_00e0 - - IL_00c8: ldc.i8 0xa - IL_00d1: conv.u + IL_00c6: stloc.2 + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.u + IL_00d1: stloc.3 IL_00d2: ldarg.0 - IL_00d3: sub - IL_00d4: ldc.i8 0x1 - IL_00dd: conv.u - IL_00de: add.ovf.un - IL_00df: nop - IL_00e0: stloc.1 - IL_00e1: ldc.i8 0x0 - IL_00ea: conv.u - IL_00eb: stloc.2 - IL_00ec: ldarg.0 - IL_00ed: stloc.3 - IL_00ee: br.s IL_0110 - - IL_00f0: ldloc.3 - IL_00f1: call void assembly::set_c(native uint) - IL_00f6: ldloc.3 - IL_00f7: ldc.i8 0x1 - IL_0100: conv.u - IL_0101: add - IL_0102: stloc.3 - IL_0103: ldloc.2 - IL_0104: ldc.i8 0x1 - IL_010d: conv.u - IL_010e: add - IL_010f: stloc.2 - IL_0110: ldloc.2 - IL_0111: ldloc.1 - IL_0112: blt.un.s IL_00f0 - - IL_0114: ret + IL_00d3: stloc.s V_4 + IL_00d5: br.s IL_00fa + + IL_00d7: ldloc.s V_4 + IL_00d9: call void assembly::set_c(native uint) + IL_00de: ldloc.s V_4 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.u + IL_00ea: add + IL_00eb: stloc.s V_4 + IL_00ed: ldloc.3 + IL_00ee: ldc.i8 0x1 + IL_00f7: conv.u + IL_00f8: add + IL_00f9: stloc.3 + IL_00fa: ldloc.3 + IL_00fb: ldloc.2 + IL_00fc: blt.un.s IL_00d7 + + IL_00fe: ret } .method public static void f3(native uint finish) cil managed @@ -292,9 +286,10 @@ .maxstack 4 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x1 IL_000a: conv.u @@ -327,91 +322,84 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00b7 - - IL_0051: ldc.i8 0x0 - IL_005a: conv.u - IL_005b: stloc.1 - IL_005c: ldc.i8 0x1 - IL_0065: conv.u - IL_0066: stloc.2 - IL_0067: ldloc.2 - IL_0068: call void assembly::set_c(native uint) - IL_006d: ldloc.2 - IL_006e: ldc.i8 0x1 - IL_0077: conv.u - IL_0078: add - IL_0079: stloc.2 - IL_007a: ldloc.1 - IL_007b: ldc.i8 0x1 - IL_0084: conv.u - IL_0085: add - IL_0086: stloc.1 - IL_0087: br.s IL_00a9 - - IL_0089: ldloc.2 - IL_008a: call void assembly::set_c(native uint) - IL_008f: ldloc.2 - IL_0090: ldc.i8 0x1 - IL_0099: conv.u - IL_009a: add - IL_009b: stloc.2 - IL_009c: ldloc.1 - IL_009d: ldc.i8 0x1 - IL_00a6: conv.u - IL_00a7: add - IL_00a8: stloc.1 - IL_00a9: ldloc.1 + IL_004f: brfalse.s IL_009d + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.u + IL_005d: stloc.2 + IL_005e: ldc.i8 0x1 + IL_0067: conv.u + IL_0068: stloc.3 + IL_0069: br.s IL_0099 + + IL_006b: ldloc.3 + IL_006c: call void assembly::set_c(native uint) + IL_0071: ldloc.3 + IL_0072: ldc.i8 0x1 + IL_007b: conv.u + IL_007c: add + IL_007d: stloc.3 + IL_007e: ldloc.2 + IL_007f: ldc.i8 0x1 + IL_0088: conv.u + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldc.i8 0x0 + IL_0095: conv.u + IL_0096: cgt.un + IL_0098: stloc.1 + IL_0099: ldloc.1 + IL_009a: brtrue.s IL_006b + + IL_009c: ret + + IL_009d: ldarg.0 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.u + IL_00a8: bge.un.s IL_00b7 + IL_00aa: ldc.i8 0x0 IL_00b3: conv.u - IL_00b4: bgt.un.s IL_0089 - - IL_00b6: ret + IL_00b4: nop + IL_00b5: br.s IL_00cf IL_00b7: ldarg.0 IL_00b8: ldc.i8 0x1 IL_00c1: conv.u - IL_00c2: bge.un.s IL_00d1 - - IL_00c4: ldc.i8 0x0 - IL_00cd: conv.u + IL_00c2: sub + IL_00c3: ldc.i8 0x1 + IL_00cc: conv.u + IL_00cd: add.ovf.un IL_00ce: nop - IL_00cf: br.s IL_00e9 - - IL_00d1: ldarg.0 - IL_00d2: ldc.i8 0x1 - IL_00db: conv.u - IL_00dc: sub - IL_00dd: ldc.i8 0x1 - IL_00e6: conv.u - IL_00e7: add.ovf.un - IL_00e8: nop - IL_00e9: stloc.1 - IL_00ea: ldc.i8 0x0 - IL_00f3: conv.u - IL_00f4: stloc.2 - IL_00f5: ldc.i8 0x1 - IL_00fe: conv.u - IL_00ff: stloc.3 - IL_0100: br.s IL_0122 - - IL_0102: ldloc.3 - IL_0103: call void assembly::set_c(native uint) - IL_0108: ldloc.3 - IL_0109: ldc.i8 0x1 - IL_0112: conv.u - IL_0113: add - IL_0114: stloc.3 - IL_0115: ldloc.2 - IL_0116: ldc.i8 0x1 - IL_011f: conv.u - IL_0120: add - IL_0121: stloc.2 - IL_0122: ldloc.2 - IL_0123: ldloc.1 - IL_0124: blt.un.s IL_0102 - - IL_0126: ret + IL_00cf: stloc.2 + IL_00d0: ldc.i8 0x0 + IL_00d9: conv.u + IL_00da: stloc.3 + IL_00db: ldc.i8 0x1 + IL_00e4: conv.u + IL_00e5: stloc.s V_4 + IL_00e7: br.s IL_010c + + IL_00e9: ldloc.s V_4 + IL_00eb: call void assembly::set_c(native uint) + IL_00f0: ldloc.s V_4 + IL_00f2: ldc.i8 0x1 + IL_00fb: conv.u + IL_00fc: add + IL_00fd: stloc.s V_4 + IL_00ff: ldloc.3 + IL_0100: ldc.i8 0x1 + IL_0109: conv.u + IL_010a: add + IL_010b: stloc.3 + IL_010c: ldloc.3 + IL_010d: ldloc.2 + IL_010e: blt.un.s IL_00e9 + + IL_0110: ret } .method public static void f4(native uint start, @@ -421,9 +409,10 @@ .maxstack 4 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.un.s IL_0011 @@ -454,87 +443,80 @@ IL_0039: conv.u IL_003a: ceq IL_003c: nop - IL_003d: brfalse.s IL_009c + IL_003d: brfalse.s IL_0082 - IL_003f: ldc.i8 0x0 - IL_0048: conv.u - IL_0049: stloc.1 - IL_004a: ldarg.0 + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.u IL_004b: stloc.2 - IL_004c: ldloc.2 - IL_004d: call void assembly::set_c(native uint) - IL_0052: ldloc.2 - IL_0053: ldc.i8 0x1 - IL_005c: conv.u - IL_005d: add - IL_005e: stloc.2 - IL_005f: ldloc.1 - IL_0060: ldc.i8 0x1 - IL_0069: conv.u - IL_006a: add - IL_006b: stloc.1 - IL_006c: br.s IL_008e - - IL_006e: ldloc.2 - IL_006f: call void assembly::set_c(native uint) - IL_0074: ldloc.2 - IL_0075: ldc.i8 0x1 - IL_007e: conv.u - IL_007f: add - IL_0080: stloc.2 - IL_0081: ldloc.1 - IL_0082: ldc.i8 0x1 - IL_008b: conv.u - IL_008c: add - IL_008d: stloc.1 - IL_008e: ldloc.1 - IL_008f: ldc.i8 0x0 - IL_0098: conv.u - IL_0099: bgt.un.s IL_006e - - IL_009b: ret - - IL_009c: ldarg.1 - IL_009d: ldarg.0 - IL_009e: bge.un.s IL_00ad - - IL_00a0: ldc.i8 0x0 - IL_00a9: conv.u - IL_00aa: nop - IL_00ab: br.s IL_00bc - - IL_00ad: ldarg.1 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native uint) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.u + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.u + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.u + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.un.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.u + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.u + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.u + IL_00ad: stloc.3 IL_00ae: ldarg.0 - IL_00af: sub - IL_00b0: ldc.i8 0x1 - IL_00b9: conv.u - IL_00ba: add.ovf.un - IL_00bb: nop - IL_00bc: stloc.1 - IL_00bd: ldc.i8 0x0 - IL_00c6: conv.u - IL_00c7: stloc.2 - IL_00c8: ldarg.0 - IL_00c9: stloc.3 - IL_00ca: br.s IL_00ec - - IL_00cc: ldloc.3 - IL_00cd: call void assembly::set_c(native uint) - IL_00d2: ldloc.3 - IL_00d3: ldc.i8 0x1 - IL_00dc: conv.u - IL_00dd: add - IL_00de: stloc.3 - IL_00df: ldloc.2 - IL_00e0: ldc.i8 0x1 - IL_00e9: conv.u - IL_00ea: add - IL_00eb: stloc.2 - IL_00ec: ldloc.2 - IL_00ed: ldloc.1 - IL_00ee: blt.un.s IL_00cc + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native uint) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.u + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.u + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 - IL_00f0: ret + IL_00da: ret } .method public static void f5() cil managed @@ -665,9 +647,10 @@ .maxstack 5 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x0 IL_000a: conv.u @@ -722,92 +705,86 @@ IL_008b: conv.u IL_008c: ceq IL_008e: nop - IL_008f: brfalse.s IL_00e5 - - IL_0091: ldc.i8 0x0 - IL_009a: conv.u - IL_009b: stloc.1 - IL_009c: ldc.i8 0x1 - IL_00a5: conv.u - IL_00a6: stloc.2 - IL_00a7: ldloc.2 - IL_00a8: call void assembly::set_c(native uint) - IL_00ad: ldloc.2 - IL_00ae: ldarg.0 - IL_00af: add - IL_00b0: stloc.2 - IL_00b1: ldloc.1 - IL_00b2: ldc.i8 0x1 - IL_00bb: conv.u - IL_00bc: add - IL_00bd: stloc.1 - IL_00be: br.s IL_00d7 - - IL_00c0: ldloc.2 - IL_00c1: call void assembly::set_c(native uint) - IL_00c6: ldloc.2 - IL_00c7: ldarg.0 - IL_00c8: add - IL_00c9: stloc.2 - IL_00ca: ldloc.1 - IL_00cb: ldc.i8 0x1 - IL_00d4: conv.u - IL_00d5: add - IL_00d6: stloc.1 - IL_00d7: ldloc.1 - IL_00d8: ldc.i8 0x0 - IL_00e1: conv.u - IL_00e2: bgt.un.s IL_00c0 - - IL_00e4: ret - - IL_00e5: ldc.i8 0xa - IL_00ee: conv.u - IL_00ef: ldc.i8 0x1 - IL_00f8: conv.u - IL_00f9: bge.un.s IL_0108 - - IL_00fb: ldc.i8 0x0 - IL_0104: conv.u - IL_0105: nop - IL_0106: br.s IL_012b - - IL_0108: ldc.i8 0xa - IL_0111: conv.u - IL_0112: ldc.i8 0x1 - IL_011b: conv.u - IL_011c: sub - IL_011d: ldarg.0 - IL_011e: div.un - IL_011f: ldc.i8 0x1 - IL_0128: conv.u - IL_0129: add.ovf.un - IL_012a: nop - IL_012b: stloc.1 - IL_012c: ldc.i8 0x0 - IL_0135: conv.u - IL_0136: stloc.2 - IL_0137: ldc.i8 0x1 - IL_0140: conv.u - IL_0141: stloc.3 - IL_0142: br.s IL_015b - - IL_0144: ldloc.3 - IL_0145: call void assembly::set_c(native uint) - IL_014a: ldloc.3 - IL_014b: ldarg.0 + IL_008f: brfalse.s IL_00d4 + + IL_0091: ldc.i4.1 + IL_0092: stloc.1 + IL_0093: ldc.i8 0x0 + IL_009c: conv.u + IL_009d: stloc.2 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.u + IL_00a8: stloc.3 + IL_00a9: br.s IL_00d0 + + IL_00ab: ldloc.3 + IL_00ac: call void assembly::set_c(native uint) + IL_00b1: ldloc.3 + IL_00b2: ldarg.0 + IL_00b3: add + IL_00b4: stloc.3 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x1 + IL_00bf: conv.u + IL_00c0: add + IL_00c1: stloc.2 + IL_00c2: ldloc.2 + IL_00c3: ldc.i8 0x0 + IL_00cc: conv.u + IL_00cd: cgt.un + IL_00cf: stloc.1 + IL_00d0: ldloc.1 + IL_00d1: brtrue.s IL_00ab + + IL_00d3: ret + + IL_00d4: ldc.i8 0xa + IL_00dd: conv.u + IL_00de: ldc.i8 0x1 + IL_00e7: conv.u + IL_00e8: bge.un.s IL_00f7 + + IL_00ea: ldc.i8 0x0 + IL_00f3: conv.u + IL_00f4: nop + IL_00f5: br.s IL_011a + + IL_00f7: ldc.i8 0xa + IL_0100: conv.u + IL_0101: ldc.i8 0x1 + IL_010a: conv.u + IL_010b: sub + IL_010c: ldarg.0 + IL_010d: div.un + IL_010e: ldc.i8 0x1 + IL_0117: conv.u + IL_0118: add.ovf.un + IL_0119: nop + IL_011a: stloc.2 + IL_011b: ldc.i8 0x0 + IL_0124: conv.u + IL_0125: stloc.3 + IL_0126: ldc.i8 0x1 + IL_012f: conv.u + IL_0130: stloc.s V_4 + IL_0132: br.s IL_014e + + IL_0134: ldloc.s V_4 + IL_0136: call void assembly::set_c(native uint) + IL_013b: ldloc.s V_4 + IL_013d: ldarg.0 + IL_013e: add + IL_013f: stloc.s V_4 + IL_0141: ldloc.3 + IL_0142: ldc.i8 0x1 + IL_014b: conv.u IL_014c: add IL_014d: stloc.3 - IL_014e: ldloc.2 - IL_014f: ldc.i8 0x1 - IL_0158: conv.u - IL_0159: add - IL_015a: stloc.2 - IL_015b: ldloc.2 - IL_015c: ldloc.1 - IL_015d: blt.un.s IL_0144 - - IL_015f: ret + IL_014e: ldloc.3 + IL_014f: ldloc.2 + IL_0150: blt.un.s IL_0134 + + IL_0152: ret } .method public static void f9(native uint finish) cil managed @@ -875,9 +852,10 @@ .maxstack 5 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.1 IL_0001: ldc.i8 0x0 IL_000a: conv.u @@ -926,86 +904,80 @@ IL_0055: conv.u IL_0056: ceq IL_0058: nop - IL_0059: brfalse.s IL_00a6 + IL_0059: brfalse.s IL_0095 - IL_005b: ldc.i8 0x0 - IL_0064: conv.u - IL_0065: stloc.1 - IL_0066: ldarg.2 + IL_005b: ldc.i4.1 + IL_005c: stloc.1 + IL_005d: ldc.i8 0x0 + IL_0066: conv.u IL_0067: stloc.2 - IL_0068: ldloc.2 - IL_0069: call void assembly::set_c(native uint) - IL_006e: ldloc.2 - IL_006f: ldarg.1 - IL_0070: add - IL_0071: stloc.2 - IL_0072: ldloc.1 - IL_0073: ldc.i8 0x1 - IL_007c: conv.u - IL_007d: add - IL_007e: stloc.1 - IL_007f: br.s IL_0098 - - IL_0081: ldloc.2 - IL_0082: call void assembly::set_c(native uint) - IL_0087: ldloc.2 - IL_0088: ldarg.1 - IL_0089: add - IL_008a: stloc.2 - IL_008b: ldloc.1 - IL_008c: ldc.i8 0x1 - IL_0095: conv.u - IL_0096: add - IL_0097: stloc.1 - IL_0098: ldloc.1 + IL_0068: ldarg.2 + IL_0069: stloc.3 + IL_006a: br.s IL_0091 + + IL_006c: ldloc.3 + IL_006d: call void assembly::set_c(native uint) + IL_0072: ldloc.3 + IL_0073: ldarg.1 + IL_0074: add + IL_0075: stloc.3 + IL_0076: ldloc.2 + IL_0077: ldc.i8 0x1 + IL_0080: conv.u + IL_0081: add + IL_0082: stloc.2 + IL_0083: ldloc.2 + IL_0084: ldc.i8 0x0 + IL_008d: conv.u + IL_008e: cgt.un + IL_0090: stloc.1 + IL_0091: ldloc.1 + IL_0092: brtrue.s IL_006c + + IL_0094: ret + + IL_0095: ldarg.2 + IL_0096: ldarg.2 + IL_0097: bge.un.s IL_00a6 + IL_0099: ldc.i8 0x0 IL_00a2: conv.u - IL_00a3: bgt.un.s IL_0081 - - IL_00a5: ret + IL_00a3: nop + IL_00a4: br.s IL_00b7 IL_00a6: ldarg.2 IL_00a7: ldarg.2 - IL_00a8: bge.un.s IL_00b7 - - IL_00aa: ldc.i8 0x0 - IL_00b3: conv.u - IL_00b4: nop - IL_00b5: br.s IL_00c8 - - IL_00b7: ldarg.2 - IL_00b8: ldarg.2 - IL_00b9: sub - IL_00ba: ldarg.1 - IL_00bb: div.un - IL_00bc: ldc.i8 0x1 - IL_00c5: conv.u - IL_00c6: add.ovf.un - IL_00c7: nop - IL_00c8: stloc.1 - IL_00c9: ldc.i8 0x0 - IL_00d2: conv.u - IL_00d3: stloc.2 - IL_00d4: ldarg.2 - IL_00d5: stloc.3 - IL_00d6: br.s IL_00ef - - IL_00d8: ldloc.3 - IL_00d9: call void assembly::set_c(native uint) - IL_00de: ldloc.3 - IL_00df: ldarg.1 + IL_00a8: sub + IL_00a9: ldarg.1 + IL_00aa: div.un + IL_00ab: ldc.i8 0x1 + IL_00b4: conv.u + IL_00b5: add.ovf.un + IL_00b6: nop + IL_00b7: stloc.2 + IL_00b8: ldc.i8 0x0 + IL_00c1: conv.u + IL_00c2: stloc.3 + IL_00c3: ldarg.2 + IL_00c4: stloc.s V_4 + IL_00c6: br.s IL_00e2 + + IL_00c8: ldloc.s V_4 + IL_00ca: call void assembly::set_c(native uint) + IL_00cf: ldloc.s V_4 + IL_00d1: ldarg.1 + IL_00d2: add + IL_00d3: stloc.s V_4 + IL_00d5: ldloc.3 + IL_00d6: ldc.i8 0x1 + IL_00df: conv.u IL_00e0: add IL_00e1: stloc.3 - IL_00e2: ldloc.2 - IL_00e3: ldc.i8 0x1 - IL_00ec: conv.u - IL_00ed: add - IL_00ee: stloc.2 - IL_00ef: ldloc.2 - IL_00f0: ldloc.1 - IL_00f1: blt.un.s IL_00d8 - - IL_00f3: ret + IL_00e2: ldloc.3 + IL_00e3: ldloc.2 + IL_00e4: blt.un.s IL_00c8 + + IL_00e6: ret } .method public static void f11(native uint start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs.opt.il.bsl index e870cb8b56d..3c567634da6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs.opt.il.bsl @@ -276,9 +276,10 @@ .maxstack 4 .locals init (uint64 V_0, - uint64 V_1, - int64 V_2, - uint64 V_3) + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.s IL_0009 @@ -296,87 +297,80 @@ IL_000e: ldloc.0 IL_000f: ldc.i4.m1 IL_0010: conv.i8 - IL_0011: bne.un.s IL_0040 + IL_0011: bne.un.s IL_0036 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 IL_0017: stloc.2 - IL_0018: ldloc.2 - IL_0019: call void assembly::set_c(int64) - IL_001e: ldloc.2 - IL_001f: ldc.i4.1 - IL_0020: conv.i8 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: add - IL_0027: stloc.1 - IL_0028: br.s IL_003a - - IL_002a: ldloc.2 - IL_002b: call void assembly::set_c(int64) - IL_0030: ldloc.2 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.2 - IL_0035: ldloc.1 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.1 - IL_003a: ldloc.1 - IL_003b: ldc.i4.0 - IL_003c: conv.i8 - IL_003d: bgt.un.s IL_002a - - IL_003f: ret - - IL_0040: ldarg.1 - IL_0041: ldarg.0 - IL_0042: bge.s IL_0049 - - IL_0044: ldc.i4.0 - IL_0045: conv.i8 - IL_0046: nop - IL_0047: br.s IL_0050 - - IL_0049: ldarg.1 - IL_004a: ldarg.0 - IL_004b: sub - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add.ovf.un - IL_004f: nop - IL_0050: stloc.1 - IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: stloc.3 - IL_0054: ldarg.0 - IL_0055: stloc.2 - IL_0056: br.s IL_0068 - - IL_0058: ldloc.2 - IL_0059: call void assembly::set_c(int64) - IL_005e: ldloc.2 - IL_005f: ldc.i4.1 - IL_0060: conv.i8 - IL_0061: add - IL_0062: stloc.2 - IL_0063: ldloc.3 - IL_0064: ldc.i4.1 - IL_0065: conv.i8 - IL_0066: add - IL_0067: stloc.3 - IL_0068: ldloc.3 - IL_0069: ldloc.1 - IL_006a: blt.un.s IL_0058 - - IL_006c: ret + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret } .method public static void f5() cil managed @@ -635,9 +629,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64 V_1, - int64 V_2, - uint64 V_3) + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000f @@ -697,115 +692,109 @@ IL_003a: ldloc.0 IL_003b: ldc.i4.m1 IL_003c: conv.i8 - IL_003d: bne.un.s IL_006a + IL_003d: bne.un.s IL_0061 - IL_003f: ldc.i4.0 - IL_0040: conv.i8 - IL_0041: stloc.1 - IL_0042: ldarg.2 + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 IL_0043: stloc.2 - IL_0044: ldloc.2 - IL_0045: call void assembly::set_c(int64) - IL_004a: ldloc.2 - IL_004b: ldarg.1 - IL_004c: add - IL_004d: stloc.2 - IL_004e: ldloc.1 - IL_004f: ldc.i4.1 - IL_0050: conv.i8 - IL_0051: add - IL_0052: stloc.1 - IL_0053: br.s IL_0064 - - IL_0055: ldloc.2 - IL_0056: call void assembly::set_c(int64) - IL_005b: ldloc.2 - IL_005c: ldarg.1 - IL_005d: add - IL_005e: stloc.2 - IL_005f: ldloc.1 - IL_0060: ldc.i4.1 - IL_0061: conv.i8 - IL_0062: add - IL_0063: stloc.1 - IL_0064: ldloc.1 - IL_0065: ldc.i4.0 - IL_0066: conv.i8 - IL_0067: bgt.un.s IL_0055 - - IL_0069: ret + IL_0044: ldarg.2 + IL_0045: stloc.3 + IL_0046: br.s IL_005d + + IL_0048: ldloc.3 + IL_0049: call void assembly::set_c(int64) + IL_004e: ldloc.3 + IL_004f: ldarg.1 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.2 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.2 + IL_0057: ldloc.2 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: cgt.un + IL_005c: stloc.1 + IL_005d: ldloc.1 + IL_005e: brtrue.s IL_0048 + + IL_0060: ret + + IL_0061: ldc.i4.0 + IL_0062: conv.i8 + IL_0063: ldarg.1 + IL_0064: bge.s IL_007a + + IL_0066: ldarg.2 + IL_0067: ldarg.2 + IL_0068: bge.s IL_006f IL_006a: ldc.i4.0 IL_006b: conv.i8 - IL_006c: ldarg.1 - IL_006d: bge.s IL_0083 + IL_006c: nop + IL_006d: br.s IL_0090 IL_006f: ldarg.2 IL_0070: ldarg.2 - IL_0071: bge.s IL_0078 - - IL_0073: ldc.i4.0 - IL_0074: conv.i8 - IL_0075: nop - IL_0076: br.s IL_0099 - - IL_0078: ldarg.2 - IL_0079: ldarg.2 - IL_007a: sub - IL_007b: ldarg.1 - IL_007c: div.un - IL_007d: ldc.i4.1 - IL_007e: conv.i8 - IL_007f: add.ovf.un + IL_0071: sub + IL_0072: ldarg.1 + IL_0073: div.un + IL_0074: ldc.i4.1 + IL_0075: conv.i8 + IL_0076: add.ovf.un + IL_0077: nop + IL_0078: br.s IL_0090 + + IL_007a: ldarg.2 + IL_007b: ldarg.2 + IL_007c: bge.s IL_0083 + + IL_007e: ldc.i4.0 + IL_007f: conv.i8 IL_0080: nop - IL_0081: br.s IL_0099 + IL_0081: br.s IL_0090 IL_0083: ldarg.2 IL_0084: ldarg.2 - IL_0085: bge.s IL_008c - - IL_0087: ldc.i4.0 - IL_0088: conv.i8 - IL_0089: nop - IL_008a: br.s IL_0099 - - IL_008c: ldarg.2 - IL_008d: ldarg.2 - IL_008e: sub - IL_008f: ldarg.1 - IL_0090: not - IL_0091: ldc.i4.1 + IL_0085: sub + IL_0086: ldarg.1 + IL_0087: not + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: div.un + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add.ovf.un + IL_008f: nop + IL_0090: stloc.2 + IL_0091: ldc.i4.0 IL_0092: conv.i8 - IL_0093: add - IL_0094: div.un - IL_0095: ldc.i4.1 - IL_0096: conv.i8 - IL_0097: add.ovf.un - IL_0098: nop - IL_0099: stloc.1 - IL_009a: ldc.i4.0 - IL_009b: conv.i8 - IL_009c: stloc.3 - IL_009d: ldarg.2 - IL_009e: stloc.2 - IL_009f: br.s IL_00b0 - - IL_00a1: ldloc.2 - IL_00a2: call void assembly::set_c(int64) - IL_00a7: ldloc.2 - IL_00a8: ldarg.1 - IL_00a9: add - IL_00aa: stloc.2 - IL_00ab: ldloc.3 - IL_00ac: ldc.i4.1 - IL_00ad: conv.i8 - IL_00ae: add - IL_00af: stloc.3 - IL_00b0: ldloc.3 - IL_00b1: ldloc.1 - IL_00b2: blt.un.s IL_00a1 - - IL_00b4: ret + IL_0093: stloc.s V_4 + IL_0095: ldarg.2 + IL_0096: stloc.3 + IL_0097: br.s IL_00aa + + IL_0099: ldloc.3 + IL_009a: call void assembly::set_c(int64) + IL_009f: ldloc.3 + IL_00a0: ldarg.1 + IL_00a1: add + IL_00a2: stloc.3 + IL_00a3: ldloc.s V_4 + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add + IL_00a8: stloc.s V_4 + IL_00aa: ldloc.s V_4 + IL_00ac: ldloc.2 + IL_00ad: blt.un.s IL_0099 + + IL_00af: ret } .method public static void f11(int64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs.opt.il.bsl index 4cc4a76df4c..ebfc4b43fb1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -169,9 +169,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldc.i8 0xa IL_0009: conv.i IL_000a: ldarg.0 @@ -204,89 +205,82 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00ae + IL_004f: brfalse.s IL_0094 - IL_0051: ldc.i8 0x0 - IL_005a: conv.i - IL_005b: stloc.1 - IL_005c: ldarg.0 + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i IL_005d: stloc.2 - IL_005e: ldloc.2 - IL_005f: call void assembly::set_c(native int) - IL_0064: ldloc.2 - IL_0065: ldc.i8 0x1 - IL_006e: conv.i - IL_006f: add - IL_0070: stloc.2 - IL_0071: ldloc.1 - IL_0072: ldc.i8 0x1 - IL_007b: conv.i - IL_007c: add - IL_007d: stloc.1 - IL_007e: br.s IL_00a0 - - IL_0080: ldloc.2 - IL_0081: call void assembly::set_c(native int) - IL_0086: ldloc.2 - IL_0087: ldc.i8 0x1 - IL_0090: conv.i - IL_0091: add - IL_0092: stloc.2 - IL_0093: ldloc.1 - IL_0094: ldc.i8 0x1 + IL_005e: ldarg.0 + IL_005f: stloc.3 + IL_0060: br.s IL_0090 + + IL_0062: ldloc.3 + IL_0063: call void assembly::set_c(native int) + IL_0068: ldloc.3 + IL_0069: ldc.i8 0x1 + IL_0072: conv.i + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.2 + IL_0076: ldc.i8 0x1 + IL_007f: conv.i + IL_0080: add + IL_0081: stloc.2 + IL_0082: ldloc.2 + IL_0083: ldc.i8 0x0 + IL_008c: conv.i + IL_008d: cgt.un + IL_008f: stloc.1 + IL_0090: ldloc.1 + IL_0091: brtrue.s IL_0062 + + IL_0093: ret + + IL_0094: ldc.i8 0xa IL_009d: conv.i - IL_009e: add - IL_009f: stloc.1 - IL_00a0: ldloc.1 + IL_009e: ldarg.0 + IL_009f: bge.s IL_00ae + IL_00a1: ldc.i8 0x0 IL_00aa: conv.i - IL_00ab: bgt.un.s IL_0080 - - IL_00ad: ret + IL_00ab: nop + IL_00ac: br.s IL_00c6 IL_00ae: ldc.i8 0xa IL_00b7: conv.i IL_00b8: ldarg.0 - IL_00b9: bge.s IL_00c8 - - IL_00bb: ldc.i8 0x0 - IL_00c4: conv.i + IL_00b9: sub + IL_00ba: ldc.i8 0x1 + IL_00c3: conv.i + IL_00c4: add.ovf.un IL_00c5: nop - IL_00c6: br.s IL_00e0 - - IL_00c8: ldc.i8 0xa - IL_00d1: conv.i + IL_00c6: stloc.2 + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: stloc.3 IL_00d2: ldarg.0 - IL_00d3: sub - IL_00d4: ldc.i8 0x1 - IL_00dd: conv.i - IL_00de: add.ovf.un - IL_00df: nop - IL_00e0: stloc.1 - IL_00e1: ldc.i8 0x0 - IL_00ea: conv.i - IL_00eb: stloc.2 - IL_00ec: ldarg.0 - IL_00ed: stloc.3 - IL_00ee: br.s IL_0110 - - IL_00f0: ldloc.3 - IL_00f1: call void assembly::set_c(native int) - IL_00f6: ldloc.3 - IL_00f7: ldc.i8 0x1 - IL_0100: conv.i - IL_0101: add - IL_0102: stloc.3 - IL_0103: ldloc.2 - IL_0104: ldc.i8 0x1 - IL_010d: conv.i - IL_010e: add - IL_010f: stloc.2 - IL_0110: ldloc.2 - IL_0111: ldloc.1 - IL_0112: blt.un.s IL_00f0 - - IL_0114: ret + IL_00d3: stloc.s V_4 + IL_00d5: br.s IL_00fa + + IL_00d7: ldloc.s V_4 + IL_00d9: call void assembly::set_c(native int) + IL_00de: ldloc.s V_4 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.i + IL_00ea: add + IL_00eb: stloc.s V_4 + IL_00ed: ldloc.3 + IL_00ee: ldc.i8 0x1 + IL_00f7: conv.i + IL_00f8: add + IL_00f9: stloc.3 + IL_00fa: ldloc.3 + IL_00fb: ldloc.2 + IL_00fc: blt.un.s IL_00d7 + + IL_00fe: ret } .method public static void f3(native int finish) cil managed @@ -294,9 +288,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x1 IL_000a: conv.i @@ -329,91 +324,84 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00b7 + IL_004f: brfalse.s IL_009d + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i + IL_005d: stloc.2 + IL_005e: ldc.i8 0x1 + IL_0067: conv.i + IL_0068: stloc.3 + IL_0069: br.s IL_0099 + + IL_006b: ldloc.3 + IL_006c: call void assembly::set_c(native int) + IL_0071: ldloc.3 + IL_0072: ldc.i8 0x1 + IL_007b: conv.i + IL_007c: add + IL_007d: stloc.3 + IL_007e: ldloc.2 + IL_007f: ldc.i8 0x1 + IL_0088: conv.i + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldc.i8 0x0 + IL_0095: conv.i + IL_0096: cgt.un + IL_0098: stloc.1 + IL_0099: ldloc.1 + IL_009a: brtrue.s IL_006b + + IL_009c: ret + + IL_009d: ldarg.0 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.i + IL_00a8: bge.s IL_00b7 - IL_0051: ldc.i8 0x0 - IL_005a: conv.i - IL_005b: stloc.1 - IL_005c: ldc.i8 0x1 - IL_0065: conv.i - IL_0066: stloc.2 - IL_0067: ldloc.2 - IL_0068: call void assembly::set_c(native int) - IL_006d: ldloc.2 - IL_006e: ldc.i8 0x1 - IL_0077: conv.i - IL_0078: add - IL_0079: stloc.2 - IL_007a: ldloc.1 - IL_007b: ldc.i8 0x1 - IL_0084: conv.i - IL_0085: add - IL_0086: stloc.1 - IL_0087: br.s IL_00a9 - - IL_0089: ldloc.2 - IL_008a: call void assembly::set_c(native int) - IL_008f: ldloc.2 - IL_0090: ldc.i8 0x1 - IL_0099: conv.i - IL_009a: add - IL_009b: stloc.2 - IL_009c: ldloc.1 - IL_009d: ldc.i8 0x1 - IL_00a6: conv.i - IL_00a7: add - IL_00a8: stloc.1 - IL_00a9: ldloc.1 IL_00aa: ldc.i8 0x0 IL_00b3: conv.i - IL_00b4: bgt.un.s IL_0089 - - IL_00b6: ret + IL_00b4: nop + IL_00b5: br.s IL_00cf IL_00b7: ldarg.0 IL_00b8: ldc.i8 0x1 IL_00c1: conv.i - IL_00c2: bge.s IL_00d1 - - IL_00c4: ldc.i8 0x0 - IL_00cd: conv.i + IL_00c2: sub + IL_00c3: ldc.i8 0x1 + IL_00cc: conv.i + IL_00cd: add.ovf.un IL_00ce: nop - IL_00cf: br.s IL_00e9 - - IL_00d1: ldarg.0 - IL_00d2: ldc.i8 0x1 - IL_00db: conv.i - IL_00dc: sub - IL_00dd: ldc.i8 0x1 - IL_00e6: conv.i - IL_00e7: add.ovf.un - IL_00e8: nop - IL_00e9: stloc.1 - IL_00ea: ldc.i8 0x0 - IL_00f3: conv.i - IL_00f4: stloc.2 - IL_00f5: ldc.i8 0x1 - IL_00fe: conv.i - IL_00ff: stloc.3 - IL_0100: br.s IL_0122 - - IL_0102: ldloc.3 - IL_0103: call void assembly::set_c(native int) - IL_0108: ldloc.3 - IL_0109: ldc.i8 0x1 - IL_0112: conv.i - IL_0113: add - IL_0114: stloc.3 - IL_0115: ldloc.2 - IL_0116: ldc.i8 0x1 - IL_011f: conv.i - IL_0120: add - IL_0121: stloc.2 - IL_0122: ldloc.2 - IL_0123: ldloc.1 - IL_0124: blt.un.s IL_0102 - - IL_0126: ret + IL_00cf: stloc.2 + IL_00d0: ldc.i8 0x0 + IL_00d9: conv.i + IL_00da: stloc.3 + IL_00db: ldc.i8 0x1 + IL_00e4: conv.i + IL_00e5: stloc.s V_4 + IL_00e7: br.s IL_010c + + IL_00e9: ldloc.s V_4 + IL_00eb: call void assembly::set_c(native int) + IL_00f0: ldloc.s V_4 + IL_00f2: ldc.i8 0x1 + IL_00fb: conv.i + IL_00fc: add + IL_00fd: stloc.s V_4 + IL_00ff: ldloc.3 + IL_0100: ldc.i8 0x1 + IL_0109: conv.i + IL_010a: add + IL_010b: stloc.3 + IL_010c: ldloc.3 + IL_010d: ldloc.2 + IL_010e: blt.un.s IL_00e9 + + IL_0110: ret } .method public static void f4(native int start, @@ -423,9 +411,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.s IL_0011 @@ -456,87 +445,80 @@ IL_0039: conv.u IL_003a: ceq IL_003c: nop - IL_003d: brfalse.s IL_009c + IL_003d: brfalse.s IL_0082 - IL_003f: ldc.i8 0x0 - IL_0048: conv.i - IL_0049: stloc.1 - IL_004a: ldarg.0 + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i IL_004b: stloc.2 - IL_004c: ldloc.2 - IL_004d: call void assembly::set_c(native int) - IL_0052: ldloc.2 - IL_0053: ldc.i8 0x1 - IL_005c: conv.i - IL_005d: add - IL_005e: stloc.2 - IL_005f: ldloc.1 - IL_0060: ldc.i8 0x1 - IL_0069: conv.i - IL_006a: add - IL_006b: stloc.1 - IL_006c: br.s IL_008e - - IL_006e: ldloc.2 - IL_006f: call void assembly::set_c(native int) - IL_0074: ldloc.2 - IL_0075: ldc.i8 0x1 - IL_007e: conv.i - IL_007f: add - IL_0080: stloc.2 - IL_0081: ldloc.1 - IL_0082: ldc.i8 0x1 - IL_008b: conv.i - IL_008c: add - IL_008d: stloc.1 - IL_008e: ldloc.1 - IL_008f: ldc.i8 0x0 - IL_0098: conv.i - IL_0099: bgt.un.s IL_006e - - IL_009b: ret - - IL_009c: ldarg.1 - IL_009d: ldarg.0 - IL_009e: bge.s IL_00ad - - IL_00a0: ldc.i8 0x0 - IL_00a9: conv.i - IL_00aa: nop - IL_00ab: br.s IL_00bc - - IL_00ad: ldarg.1 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 IL_00ae: ldarg.0 - IL_00af: sub - IL_00b0: ldc.i8 0x1 - IL_00b9: conv.i - IL_00ba: add.ovf.un - IL_00bb: nop - IL_00bc: stloc.1 - IL_00bd: ldc.i8 0x0 - IL_00c6: conv.i - IL_00c7: stloc.2 - IL_00c8: ldarg.0 - IL_00c9: stloc.3 - IL_00ca: br.s IL_00ec - - IL_00cc: ldloc.3 - IL_00cd: call void assembly::set_c(native int) - IL_00d2: ldloc.3 - IL_00d3: ldc.i8 0x1 - IL_00dc: conv.i - IL_00dd: add - IL_00de: stloc.3 - IL_00df: ldloc.2 - IL_00e0: ldc.i8 0x1 - IL_00e9: conv.i - IL_00ea: add - IL_00eb: stloc.2 - IL_00ec: ldloc.2 - IL_00ed: ldloc.1 - IL_00ee: blt.un.s IL_00cc + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 - IL_00f0: ret + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret } .method public static void f5() cil managed @@ -667,9 +649,10 @@ .maxstack 5 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x0 IL_000a: conv.i @@ -754,125 +737,119 @@ IL_00e1: conv.u IL_00e2: ceq IL_00e4: nop - IL_00e5: brfalse.s IL_013b + IL_00e5: brfalse.s IL_012a - IL_00e7: ldc.i8 0x0 - IL_00f0: conv.i - IL_00f1: stloc.1 - IL_00f2: ldc.i8 0x1 - IL_00fb: conv.i - IL_00fc: stloc.2 - IL_00fd: ldloc.2 - IL_00fe: call void assembly::set_c(native int) - IL_0103: ldloc.2 - IL_0104: ldarg.0 - IL_0105: add - IL_0106: stloc.2 - IL_0107: ldloc.1 - IL_0108: ldc.i8 0x1 - IL_0111: conv.i - IL_0112: add - IL_0113: stloc.1 - IL_0114: br.s IL_012d - - IL_0116: ldloc.2 - IL_0117: call void assembly::set_c(native int) - IL_011c: ldloc.2 - IL_011d: ldarg.0 - IL_011e: add - IL_011f: stloc.2 - IL_0120: ldloc.1 - IL_0121: ldc.i8 0x1 - IL_012a: conv.i - IL_012b: add - IL_012c: stloc.1 - IL_012d: ldloc.1 - IL_012e: ldc.i8 0x0 - IL_0137: conv.i - IL_0138: bgt.un.s IL_0116 - - IL_013a: ret - - IL_013b: ldc.i8 0x0 - IL_0144: conv.i - IL_0145: ldarg.0 - IL_0146: bge.s IL_0193 - - IL_0148: ldc.i8 0xa - IL_0151: conv.i - IL_0152: ldc.i8 0x1 - IL_015b: conv.i - IL_015c: bge.s IL_016e - - IL_015e: ldc.i8 0x0 - IL_0167: conv.i - IL_0168: nop - IL_0169: br IL_01e5 - - IL_016e: ldc.i8 0xa - IL_0177: conv.i - IL_0178: ldc.i8 0x1 - IL_0181: conv.i - IL_0182: sub - IL_0183: ldarg.0 - IL_0184: div.un - IL_0185: ldc.i8 0x1 - IL_018e: conv.i - IL_018f: add.ovf.un - IL_0190: nop - IL_0191: br.s IL_01e5 - - IL_0193: ldc.i8 0x1 - IL_019c: conv.i - IL_019d: ldc.i8 0xa - IL_01a6: conv.i - IL_01a7: bge.s IL_01b6 - - IL_01a9: ldc.i8 0x0 - IL_01b2: conv.i - IL_01b3: nop - IL_01b4: br.s IL_01e5 - - IL_01b6: ldc.i8 0x1 - IL_01bf: conv.i - IL_01c0: ldc.i8 0xa - IL_01c9: conv.i - IL_01ca: sub - IL_01cb: ldarg.0 - IL_01cc: not - IL_01cd: ldc.i8 0x1 - IL_01d6: conv.i - IL_01d7: add - IL_01d8: div.un - IL_01d9: ldc.i8 0x1 - IL_01e2: conv.i - IL_01e3: add.ovf.un - IL_01e4: nop - IL_01e5: stloc.1 - IL_01e6: ldc.i8 0x0 - IL_01ef: conv.i - IL_01f0: stloc.2 - IL_01f1: ldc.i8 0x1 - IL_01fa: conv.i - IL_01fb: stloc.3 - IL_01fc: br.s IL_0215 - - IL_01fe: ldloc.3 - IL_01ff: call void assembly::set_c(native int) - IL_0204: ldloc.3 - IL_0205: ldarg.0 + IL_00e7: ldc.i4.1 + IL_00e8: stloc.1 + IL_00e9: ldc.i8 0x0 + IL_00f2: conv.i + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x1 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: br.s IL_0126 + + IL_0101: ldloc.3 + IL_0102: call void assembly::set_c(native int) + IL_0107: ldloc.3 + IL_0108: ldarg.0 + IL_0109: add + IL_010a: stloc.3 + IL_010b: ldloc.2 + IL_010c: ldc.i8 0x1 + IL_0115: conv.i + IL_0116: add + IL_0117: stloc.2 + IL_0118: ldloc.2 + IL_0119: ldc.i8 0x0 + IL_0122: conv.i + IL_0123: cgt.un + IL_0125: stloc.1 + IL_0126: ldloc.1 + IL_0127: brtrue.s IL_0101 + + IL_0129: ret + + IL_012a: ldc.i8 0x0 + IL_0133: conv.i + IL_0134: ldarg.0 + IL_0135: bge.s IL_0182 + + IL_0137: ldc.i8 0xa + IL_0140: conv.i + IL_0141: ldc.i8 0x1 + IL_014a: conv.i + IL_014b: bge.s IL_015d + + IL_014d: ldc.i8 0x0 + IL_0156: conv.i + IL_0157: nop + IL_0158: br IL_01d4 + + IL_015d: ldc.i8 0xa + IL_0166: conv.i + IL_0167: ldc.i8 0x1 + IL_0170: conv.i + IL_0171: sub + IL_0172: ldarg.0 + IL_0173: div.un + IL_0174: ldc.i8 0x1 + IL_017d: conv.i + IL_017e: add.ovf.un + IL_017f: nop + IL_0180: br.s IL_01d4 + + IL_0182: ldc.i8 0x1 + IL_018b: conv.i + IL_018c: ldc.i8 0xa + IL_0195: conv.i + IL_0196: bge.s IL_01a5 + + IL_0198: ldc.i8 0x0 + IL_01a1: conv.i + IL_01a2: nop + IL_01a3: br.s IL_01d4 + + IL_01a5: ldc.i8 0x1 + IL_01ae: conv.i + IL_01af: ldc.i8 0xa + IL_01b8: conv.i + IL_01b9: sub + IL_01ba: ldarg.0 + IL_01bb: not + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add + IL_01c7: div.un + IL_01c8: ldc.i8 0x1 + IL_01d1: conv.i + IL_01d2: add.ovf.un + IL_01d3: nop + IL_01d4: stloc.2 + IL_01d5: ldc.i8 0x0 + IL_01de: conv.i + IL_01df: stloc.3 + IL_01e0: ldc.i8 0x1 + IL_01e9: conv.i + IL_01ea: stloc.s V_4 + IL_01ec: br.s IL_0208 + + IL_01ee: ldloc.s V_4 + IL_01f0: call void assembly::set_c(native int) + IL_01f5: ldloc.s V_4 + IL_01f7: ldarg.0 + IL_01f8: add + IL_01f9: stloc.s V_4 + IL_01fb: ldloc.3 + IL_01fc: ldc.i8 0x1 + IL_0205: conv.i IL_0206: add IL_0207: stloc.3 - IL_0208: ldloc.2 - IL_0209: ldc.i8 0x1 - IL_0212: conv.i - IL_0213: add - IL_0214: stloc.2 - IL_0215: ldloc.2 - IL_0216: ldloc.1 - IL_0217: blt.un.s IL_01fe - - IL_0219: ret + IL_0208: ldloc.3 + IL_0209: ldloc.2 + IL_020a: blt.un.s IL_01ee + + IL_020c: ret } .method public static void f9(native int finish) cil managed @@ -940,9 +917,10 @@ .maxstack 5 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldarg.1 IL_0001: ldc.i8 0x0 IL_000a: conv.i @@ -1017,115 +995,109 @@ IL_0087: conv.u IL_0088: ceq IL_008a: nop - IL_008b: brfalse.s IL_00d8 + IL_008b: brfalse.s IL_00c7 - IL_008d: ldc.i8 0x0 - IL_0096: conv.i - IL_0097: stloc.1 - IL_0098: ldarg.2 + IL_008d: ldc.i4.1 + IL_008e: stloc.1 + IL_008f: ldc.i8 0x0 + IL_0098: conv.i IL_0099: stloc.2 - IL_009a: ldloc.2 - IL_009b: call void assembly::set_c(native int) - IL_00a0: ldloc.2 - IL_00a1: ldarg.1 - IL_00a2: add - IL_00a3: stloc.2 - IL_00a4: ldloc.1 - IL_00a5: ldc.i8 0x1 - IL_00ae: conv.i - IL_00af: add - IL_00b0: stloc.1 - IL_00b1: br.s IL_00ca - - IL_00b3: ldloc.2 - IL_00b4: call void assembly::set_c(native int) - IL_00b9: ldloc.2 - IL_00ba: ldarg.1 - IL_00bb: add - IL_00bc: stloc.2 - IL_00bd: ldloc.1 - IL_00be: ldc.i8 0x1 - IL_00c7: conv.i - IL_00c8: add - IL_00c9: stloc.1 - IL_00ca: ldloc.1 - IL_00cb: ldc.i8 0x0 - IL_00d4: conv.i - IL_00d5: bgt.un.s IL_00b3 - - IL_00d7: ret + IL_009a: ldarg.2 + IL_009b: stloc.3 + IL_009c: br.s IL_00c3 + + IL_009e: ldloc.3 + IL_009f: call void assembly::set_c(native int) + IL_00a4: ldloc.3 + IL_00a5: ldarg.1 + IL_00a6: add + IL_00a7: stloc.3 + IL_00a8: ldloc.2 + IL_00a9: ldc.i8 0x1 + IL_00b2: conv.i + IL_00b3: add + IL_00b4: stloc.2 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x0 + IL_00bf: conv.i + IL_00c0: cgt.un + IL_00c2: stloc.1 + IL_00c3: ldloc.1 + IL_00c4: brtrue.s IL_009e + + IL_00c6: ret + + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: ldarg.1 + IL_00d2: bge.s IL_00f8 + + IL_00d4: ldarg.2 + IL_00d5: ldarg.2 + IL_00d6: bge.s IL_00e5 IL_00d8: ldc.i8 0x0 IL_00e1: conv.i - IL_00e2: ldarg.1 - IL_00e3: bge.s IL_0109 + IL_00e2: nop + IL_00e3: br.s IL_0126 IL_00e5: ldarg.2 IL_00e6: ldarg.2 - IL_00e7: bge.s IL_00f6 + IL_00e7: sub + IL_00e8: ldarg.1 + IL_00e9: div.un + IL_00ea: ldc.i8 0x1 + IL_00f3: conv.i + IL_00f4: add.ovf.un + IL_00f5: nop + IL_00f6: br.s IL_0126 - IL_00e9: ldc.i8 0x0 - IL_00f2: conv.i - IL_00f3: nop - IL_00f4: br.s IL_0137 - - IL_00f6: ldarg.2 - IL_00f7: ldarg.2 - IL_00f8: sub - IL_00f9: ldarg.1 - IL_00fa: div.un - IL_00fb: ldc.i8 0x1 - IL_0104: conv.i - IL_0105: add.ovf.un + IL_00f8: ldarg.2 + IL_00f9: ldarg.2 + IL_00fa: bge.s IL_0109 + + IL_00fc: ldc.i8 0x0 + IL_0105: conv.i IL_0106: nop - IL_0107: br.s IL_0137 + IL_0107: br.s IL_0126 IL_0109: ldarg.2 IL_010a: ldarg.2 - IL_010b: bge.s IL_011a - - IL_010d: ldc.i8 0x0 - IL_0116: conv.i - IL_0117: nop - IL_0118: br.s IL_0137 - - IL_011a: ldarg.2 - IL_011b: ldarg.2 - IL_011c: sub - IL_011d: ldarg.1 - IL_011e: not - IL_011f: ldc.i8 0x1 - IL_0128: conv.i - IL_0129: add - IL_012a: div.un - IL_012b: ldc.i8 0x1 - IL_0134: conv.i - IL_0135: add.ovf.un - IL_0136: nop - IL_0137: stloc.1 - IL_0138: ldc.i8 0x0 - IL_0141: conv.i - IL_0142: stloc.2 - IL_0143: ldarg.2 - IL_0144: stloc.3 - IL_0145: br.s IL_015e - - IL_0147: ldloc.3 - IL_0148: call void assembly::set_c(native int) - IL_014d: ldloc.3 - IL_014e: ldarg.1 + IL_010b: sub + IL_010c: ldarg.1 + IL_010d: not + IL_010e: ldc.i8 0x1 + IL_0117: conv.i + IL_0118: add + IL_0119: div.un + IL_011a: ldc.i8 0x1 + IL_0123: conv.i + IL_0124: add.ovf.un + IL_0125: nop + IL_0126: stloc.2 + IL_0127: ldc.i8 0x0 + IL_0130: conv.i + IL_0131: stloc.3 + IL_0132: ldarg.2 + IL_0133: stloc.s V_4 + IL_0135: br.s IL_0151 + + IL_0137: ldloc.s V_4 + IL_0139: call void assembly::set_c(native int) + IL_013e: ldloc.s V_4 + IL_0140: ldarg.1 + IL_0141: add + IL_0142: stloc.s V_4 + IL_0144: ldloc.3 + IL_0145: ldc.i8 0x1 + IL_014e: conv.i IL_014f: add IL_0150: stloc.3 - IL_0151: ldloc.2 - IL_0152: ldc.i8 0x1 - IL_015b: conv.i - IL_015c: add - IL_015d: stloc.2 - IL_015e: ldloc.2 - IL_015f: ldloc.1 - IL_0160: blt.un.s IL_0147 - - IL_0162: ret + IL_0151: ldloc.3 + IL_0152: ldloc.2 + IL_0153: blt.un.s IL_0137 + + IL_0155: ret } .method public static void f11(native int start, @@ -1226,9 +1198,10 @@ .maxstack 4 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldc.i8 0xa IL_0009: conv.i IL_000a: ldc.i8 0x1 @@ -1263,93 +1236,86 @@ IL_005d: conv.u IL_005e: ceq IL_0060: nop - IL_0061: brfalse.s IL_00c9 - - IL_0063: ldc.i8 0x0 - IL_006c: conv.i - IL_006d: stloc.1 - IL_006e: ldc.i8 0xa - IL_0077: conv.i - IL_0078: stloc.2 - IL_0079: ldloc.2 - IL_007a: call void assembly::set_c(native int) - IL_007f: ldloc.2 - IL_0080: ldc.i8 0xffffffffffffffff - IL_0089: conv.i - IL_008a: add - IL_008b: stloc.2 - IL_008c: ldloc.1 - IL_008d: ldc.i8 0x1 - IL_0096: conv.i - IL_0097: add - IL_0098: stloc.1 - IL_0099: br.s IL_00bb - - IL_009b: ldloc.2 - IL_009c: call void assembly::set_c(native int) - IL_00a1: ldloc.2 - IL_00a2: ldc.i8 0xffffffffffffffff - IL_00ab: conv.i - IL_00ac: add - IL_00ad: stloc.2 - IL_00ae: ldloc.1 - IL_00af: ldc.i8 0x1 - IL_00b8: conv.i - IL_00b9: add - IL_00ba: stloc.1 - IL_00bb: ldloc.1 - IL_00bc: ldc.i8 0x0 - IL_00c5: conv.i - IL_00c6: bgt.un.s IL_009b + IL_0061: brfalse.s IL_00af - IL_00c8: ret + IL_0063: ldc.i4.1 + IL_0064: stloc.1 + IL_0065: ldc.i8 0x0 + IL_006e: conv.i + IL_006f: stloc.2 + IL_0070: ldc.i8 0xa + IL_0079: conv.i + IL_007a: stloc.3 + IL_007b: br.s IL_00ab + + IL_007d: ldloc.3 + IL_007e: call void assembly::set_c(native int) + IL_0083: ldloc.3 + IL_0084: ldc.i8 0xffffffffffffffff + IL_008d: conv.i + IL_008e: add + IL_008f: stloc.3 + IL_0090: ldloc.2 + IL_0091: ldc.i8 0x1 + IL_009a: conv.i + IL_009b: add + IL_009c: stloc.2 + IL_009d: ldloc.2 + IL_009e: ldc.i8 0x0 + IL_00a7: conv.i + IL_00a8: cgt.un + IL_00aa: stloc.1 + IL_00ab: ldloc.1 + IL_00ac: brtrue.s IL_007d + + IL_00ae: ret + + IL_00af: ldc.i8 0xa + IL_00b8: conv.i + IL_00b9: ldc.i8 0x1 + IL_00c2: conv.i + IL_00c3: bge.s IL_00d2 - IL_00c9: ldc.i8 0xa - IL_00d2: conv.i - IL_00d3: ldc.i8 0x1 - IL_00dc: conv.i - IL_00dd: bge.s IL_00ec + IL_00c5: ldc.i8 0x0 + IL_00ce: conv.i + IL_00cf: nop + IL_00d0: br.s IL_00f3 - IL_00df: ldc.i8 0x0 - IL_00e8: conv.i - IL_00e9: nop - IL_00ea: br.s IL_010d - - IL_00ec: ldc.i8 0xa - IL_00f5: conv.i - IL_00f6: ldc.i8 0x1 - IL_00ff: conv.i - IL_0100: sub - IL_0101: ldc.i8 0x1 - IL_010a: conv.i - IL_010b: add.ovf.un - IL_010c: nop - IL_010d: stloc.1 - IL_010e: ldc.i8 0x0 - IL_0117: conv.i - IL_0118: stloc.2 - IL_0119: ldc.i8 0xa - IL_0122: conv.i - IL_0123: stloc.3 - IL_0124: br.s IL_0146 - - IL_0126: ldloc.3 - IL_0127: call void assembly::set_c(native int) - IL_012c: ldloc.3 - IL_012d: ldc.i8 0xffffffffffffffff - IL_0136: conv.i - IL_0137: add - IL_0138: stloc.3 - IL_0139: ldloc.2 - IL_013a: ldc.i8 0x1 - IL_0143: conv.i - IL_0144: add - IL_0145: stloc.2 - IL_0146: ldloc.2 - IL_0147: ldloc.1 - IL_0148: blt.un.s IL_0126 - - IL_014a: ret + IL_00d2: ldc.i8 0xa + IL_00db: conv.i + IL_00dc: ldc.i8 0x1 + IL_00e5: conv.i + IL_00e6: sub + IL_00e7: ldc.i8 0x1 + IL_00f0: conv.i + IL_00f1: add.ovf.un + IL_00f2: nop + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x0 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: ldc.i8 0xa + IL_0108: conv.i + IL_0109: stloc.s V_4 + IL_010b: br.s IL_0130 + + IL_010d: ldloc.s V_4 + IL_010f: call void assembly::set_c(native int) + IL_0114: ldloc.s V_4 + IL_0116: ldc.i8 0xffffffffffffffff + IL_011f: conv.i + IL_0120: add + IL_0121: stloc.s V_4 + IL_0123: ldloc.3 + IL_0124: ldc.i8 0x1 + IL_012d: conv.i + IL_012e: add + IL_012f: stloc.3 + IL_0130: ldloc.3 + IL_0131: ldloc.2 + IL_0132: blt.un.s IL_010d + + IL_0134: ret } .method public static void f14() cil managed @@ -1357,9 +1323,10 @@ .maxstack 5 .locals init (native int V_0, - native int V_1, + bool V_1, native int V_2, - native int V_3) + native int V_3, + native int V_4) IL_0000: ldc.i8 0xfffffffffffffffe IL_0009: conv.i IL_000a: ldc.i8 0x0 @@ -1449,131 +1416,124 @@ IL_010e: conv.u IL_010f: ceq IL_0111: nop - IL_0112: brfalse.s IL_017a - - IL_0114: ldc.i8 0x0 - IL_011d: conv.i - IL_011e: stloc.1 - IL_011f: ldc.i8 0xa - IL_0128: conv.i - IL_0129: stloc.2 - IL_012a: ldloc.2 - IL_012b: call void assembly::set_c(native int) - IL_0130: ldloc.2 - IL_0131: ldc.i8 0xfffffffffffffffe - IL_013a: conv.i - IL_013b: add - IL_013c: stloc.2 - IL_013d: ldloc.1 - IL_013e: ldc.i8 0x1 - IL_0147: conv.i - IL_0148: add - IL_0149: stloc.1 - IL_014a: br.s IL_016c - - IL_014c: ldloc.2 - IL_014d: call void assembly::set_c(native int) - IL_0152: ldloc.2 - IL_0153: ldc.i8 0xfffffffffffffffe - IL_015c: conv.i - IL_015d: add - IL_015e: stloc.2 - IL_015f: ldloc.1 - IL_0160: ldc.i8 0x1 + IL_0112: brfalse.s IL_0160 + + IL_0114: ldc.i4.1 + IL_0115: stloc.1 + IL_0116: ldc.i8 0x0 + IL_011f: conv.i + IL_0120: stloc.2 + IL_0121: ldc.i8 0xa + IL_012a: conv.i + IL_012b: stloc.3 + IL_012c: br.s IL_015c + + IL_012e: ldloc.3 + IL_012f: call void assembly::set_c(native int) + IL_0134: ldloc.3 + IL_0135: ldc.i8 0xfffffffffffffffe + IL_013e: conv.i + IL_013f: add + IL_0140: stloc.3 + IL_0141: ldloc.2 + IL_0142: ldc.i8 0x1 + IL_014b: conv.i + IL_014c: add + IL_014d: stloc.2 + IL_014e: ldloc.2 + IL_014f: ldc.i8 0x0 + IL_0158: conv.i + IL_0159: cgt.un + IL_015b: stloc.1 + IL_015c: ldloc.1 + IL_015d: brtrue.s IL_012e + + IL_015f: ret + + IL_0160: ldc.i8 0x0 IL_0169: conv.i - IL_016a: add - IL_016b: stloc.1 - IL_016c: ldloc.1 - IL_016d: ldc.i8 0x0 - IL_0176: conv.i - IL_0177: bgt.un.s IL_014c - - IL_0179: ret - - IL_017a: ldc.i8 0x0 - IL_0183: conv.i - IL_0184: ldc.i8 0xfffffffffffffffe - IL_018d: conv.i - IL_018e: bge.s IL_01e4 - - IL_0190: ldc.i8 0x1 - IL_0199: conv.i - IL_019a: ldc.i8 0xa - IL_01a3: conv.i - IL_01a4: bge.s IL_01b6 - - IL_01a6: ldc.i8 0x0 + IL_016a: ldc.i8 0xfffffffffffffffe + IL_0173: conv.i + IL_0174: bge.s IL_01ca + + IL_0176: ldc.i8 0x1 + IL_017f: conv.i + IL_0180: ldc.i8 0xa + IL_0189: conv.i + IL_018a: bge.s IL_019c + + IL_018c: ldc.i8 0x0 + IL_0195: conv.i + IL_0196: nop + IL_0197: br IL_0225 + + IL_019c: ldc.i8 0x1 + IL_01a5: conv.i + IL_01a6: ldc.i8 0xa IL_01af: conv.i - IL_01b0: nop - IL_01b1: br IL_023f - - IL_01b6: ldc.i8 0x1 - IL_01bf: conv.i - IL_01c0: ldc.i8 0xa - IL_01c9: conv.i - IL_01ca: sub - IL_01cb: ldc.i8 0xfffffffffffffffe - IL_01d4: conv.i - IL_01d5: div.un - IL_01d6: ldc.i8 0x1 - IL_01df: conv.i - IL_01e0: add.ovf.un - IL_01e1: nop - IL_01e2: br.s IL_023f - - IL_01e4: ldc.i8 0xa - IL_01ed: conv.i - IL_01ee: ldc.i8 0x1 - IL_01f7: conv.i - IL_01f8: bge.s IL_0207 - - IL_01fa: ldc.i8 0x0 - IL_0203: conv.i - IL_0204: nop - IL_0205: br.s IL_023f - - IL_0207: ldc.i8 0xa - IL_0210: conv.i - IL_0211: ldc.i8 0x1 - IL_021a: conv.i - IL_021b: sub - IL_021c: ldc.i8 0xfffffffffffffffe - IL_0225: conv.i - IL_0226: not - IL_0227: ldc.i8 0x1 - IL_0230: conv.i - IL_0231: add - IL_0232: div.un - IL_0233: ldc.i8 0x1 - IL_023c: conv.i - IL_023d: add.ovf.un - IL_023e: nop - IL_023f: stloc.1 - IL_0240: ldc.i8 0x0 - IL_0249: conv.i - IL_024a: stloc.2 - IL_024b: ldc.i8 0xa - IL_0254: conv.i - IL_0255: stloc.3 - IL_0256: br.s IL_0278 - - IL_0258: ldloc.3 - IL_0259: call void assembly::set_c(native int) - IL_025e: ldloc.3 - IL_025f: ldc.i8 0xfffffffffffffffe - IL_0268: conv.i - IL_0269: add - IL_026a: stloc.3 - IL_026b: ldloc.2 - IL_026c: ldc.i8 0x1 - IL_0275: conv.i - IL_0276: add - IL_0277: stloc.2 - IL_0278: ldloc.2 - IL_0279: ldloc.1 - IL_027a: blt.un.s IL_0258 - - IL_027c: ret + IL_01b0: sub + IL_01b1: ldc.i8 0xfffffffffffffffe + IL_01ba: conv.i + IL_01bb: div.un + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add.ovf.un + IL_01c7: nop + IL_01c8: br.s IL_0225 + + IL_01ca: ldc.i8 0xa + IL_01d3: conv.i + IL_01d4: ldc.i8 0x1 + IL_01dd: conv.i + IL_01de: bge.s IL_01ed + + IL_01e0: ldc.i8 0x0 + IL_01e9: conv.i + IL_01ea: nop + IL_01eb: br.s IL_0225 + + IL_01ed: ldc.i8 0xa + IL_01f6: conv.i + IL_01f7: ldc.i8 0x1 + IL_0200: conv.i + IL_0201: sub + IL_0202: ldc.i8 0xfffffffffffffffe + IL_020b: conv.i + IL_020c: not + IL_020d: ldc.i8 0x1 + IL_0216: conv.i + IL_0217: add + IL_0218: div.un + IL_0219: ldc.i8 0x1 + IL_0222: conv.i + IL_0223: add.ovf.un + IL_0224: nop + IL_0225: stloc.2 + IL_0226: ldc.i8 0x0 + IL_022f: conv.i + IL_0230: stloc.3 + IL_0231: ldc.i8 0xa + IL_023a: conv.i + IL_023b: stloc.s V_4 + IL_023d: br.s IL_0262 + + IL_023f: ldloc.s V_4 + IL_0241: call void assembly::set_c(native int) + IL_0246: ldloc.s V_4 + IL_0248: ldc.i8 0xfffffffffffffffe + IL_0251: conv.i + IL_0252: add + IL_0253: stloc.s V_4 + IL_0255: ldloc.3 + IL_0256: ldc.i8 0x1 + IL_025f: conv.i + IL_0260: add + IL_0261: stloc.3 + IL_0262: ldloc.3 + IL_0263: ldloc.2 + IL_0264: blt.un.s IL_023f + + IL_0266: ret } .method private specialname rtspecialname static void .cctor() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs.opt.il.bsl index b30d6270080..96c418afb00 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -276,9 +276,10 @@ .maxstack 4 .locals init (uint64 V_0, - uint64 V_1, + bool V_1, uint64 V_2, - uint64 V_3) + uint64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.un.s IL_0009 @@ -296,87 +297,80 @@ IL_000e: ldloc.0 IL_000f: ldc.i4.m1 IL_0010: conv.i8 - IL_0011: bne.un.s IL_0040 + IL_0011: bne.un.s IL_0036 - IL_0013: ldc.i4.0 - IL_0014: conv.i8 - IL_0015: stloc.1 - IL_0016: ldarg.0 + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 IL_0017: stloc.2 - IL_0018: ldloc.2 - IL_0019: call void assembly::set_c(uint64) - IL_001e: ldloc.2 - IL_001f: ldc.i4.1 - IL_0020: conv.i8 - IL_0021: add - IL_0022: stloc.2 - IL_0023: ldloc.1 - IL_0024: ldc.i4.1 - IL_0025: conv.i8 - IL_0026: add - IL_0027: stloc.1 - IL_0028: br.s IL_003a + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 - IL_002a: ldloc.2 - IL_002b: call void assembly::set_c(uint64) - IL_0030: ldloc.2 - IL_0031: ldc.i4.1 - IL_0032: conv.i8 - IL_0033: add - IL_0034: stloc.2 - IL_0035: ldloc.1 - IL_0036: ldc.i4.1 - IL_0037: conv.i8 - IL_0038: add - IL_0039: stloc.1 - IL_003a: ldloc.1 - IL_003b: ldc.i4.0 - IL_003c: conv.i8 - IL_003d: bgt.un.s IL_002a - - IL_003f: ret - - IL_0040: ldarg.1 - IL_0041: ldarg.0 - IL_0042: bge.un.s IL_0049 - - IL_0044: ldc.i4.0 - IL_0045: conv.i8 - IL_0046: nop - IL_0047: br.s IL_0050 - - IL_0049: ldarg.1 + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(uint64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.un.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.3 IL_004a: ldarg.0 - IL_004b: sub - IL_004c: ldc.i4.1 - IL_004d: conv.i8 - IL_004e: add.ovf.un - IL_004f: nop - IL_0050: stloc.1 - IL_0051: ldc.i4.0 - IL_0052: conv.i8 - IL_0053: stloc.2 - IL_0054: ldarg.0 - IL_0055: stloc.3 - IL_0056: br.s IL_0068 - - IL_0058: ldloc.3 - IL_0059: call void assembly::set_c(uint64) - IL_005e: ldloc.3 - IL_005f: ldc.i4.1 - IL_0060: conv.i8 - IL_0061: add - IL_0062: stloc.3 + IL_004b: stloc.s V_4 + IL_004d: br.s IL_0062 + + IL_004f: ldloc.s V_4 + IL_0051: call void assembly::set_c(uint64) + IL_0056: ldloc.s V_4 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_4 + IL_005d: ldloc.3 + IL_005e: ldc.i4.1 + IL_005f: conv.i8 + IL_0060: add + IL_0061: stloc.3 + IL_0062: ldloc.3 IL_0063: ldloc.2 - IL_0064: ldc.i4.1 - IL_0065: conv.i8 - IL_0066: add - IL_0067: stloc.2 - IL_0068: ldloc.2 - IL_0069: ldloc.1 - IL_006a: blt.un.s IL_0058 - - IL_006c: ret + IL_0064: blt.un.s IL_004f + + IL_0066: ret } .method public static void f5() cil managed @@ -624,9 +618,10 @@ .maxstack 5 .locals init (uint64 V_0, - uint64 V_1, + bool V_1, uint64 V_2, - uint64 V_3) + uint64 V_3, + uint64 V_4) IL_0000: ldarg.1 IL_0001: brtrue.s IL_000f @@ -660,86 +655,80 @@ IL_0020: ldloc.0 IL_0021: ldc.i4.m1 IL_0022: conv.i8 - IL_0023: bne.un.s IL_0050 + IL_0023: bne.un.s IL_0047 - IL_0025: ldc.i4.0 - IL_0026: conv.i8 - IL_0027: stloc.1 - IL_0028: ldarg.2 + IL_0025: ldc.i4.1 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 IL_0029: stloc.2 - IL_002a: ldloc.2 - IL_002b: call void assembly::set_c(uint64) - IL_0030: ldloc.2 - IL_0031: ldarg.1 - IL_0032: add - IL_0033: stloc.2 - IL_0034: ldloc.1 - IL_0035: ldc.i4.1 - IL_0036: conv.i8 - IL_0037: add - IL_0038: stloc.1 - IL_0039: br.s IL_004a - - IL_003b: ldloc.2 - IL_003c: call void assembly::set_c(uint64) - IL_0041: ldloc.2 - IL_0042: ldarg.1 - IL_0043: add - IL_0044: stloc.2 - IL_0045: ldloc.1 - IL_0046: ldc.i4.1 - IL_0047: conv.i8 - IL_0048: add - IL_0049: stloc.1 - IL_004a: ldloc.1 + IL_002a: ldarg.2 + IL_002b: stloc.3 + IL_002c: br.s IL_0043 + + IL_002e: ldloc.3 + IL_002f: call void assembly::set_c(uint64) + IL_0034: ldloc.3 + IL_0035: ldarg.1 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.2 + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: add + IL_003c: stloc.2 + IL_003d: ldloc.2 + IL_003e: ldc.i4.0 + IL_003f: conv.i8 + IL_0040: cgt.un + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: brtrue.s IL_002e + + IL_0046: ret + + IL_0047: ldarg.2 + IL_0048: ldarg.2 + IL_0049: bge.un.s IL_0050 + IL_004b: ldc.i4.0 IL_004c: conv.i8 - IL_004d: bgt.un.s IL_003b - - IL_004f: ret + IL_004d: nop + IL_004e: br.s IL_0059 IL_0050: ldarg.2 IL_0051: ldarg.2 - IL_0052: bge.un.s IL_0059 - - IL_0054: ldc.i4.0 - IL_0055: conv.i8 - IL_0056: nop - IL_0057: br.s IL_0062 - - IL_0059: ldarg.2 - IL_005a: ldarg.2 - IL_005b: sub - IL_005c: ldarg.1 - IL_005d: div.un - IL_005e: ldc.i4.1 - IL_005f: conv.i8 - IL_0060: add.ovf.un - IL_0061: nop - IL_0062: stloc.1 - IL_0063: ldc.i4.0 - IL_0064: conv.i8 - IL_0065: stloc.2 - IL_0066: ldarg.2 - IL_0067: stloc.3 - IL_0068: br.s IL_0079 - - IL_006a: ldloc.3 - IL_006b: call void assembly::set_c(uint64) - IL_0070: ldloc.3 - IL_0071: ldarg.1 + IL_0052: sub + IL_0053: ldarg.1 + IL_0054: div.un + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add.ovf.un + IL_0058: nop + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.3 + IL_005d: ldarg.2 + IL_005e: stloc.s V_4 + IL_0060: br.s IL_0074 + + IL_0062: ldloc.s V_4 + IL_0064: call void assembly::set_c(uint64) + IL_0069: ldloc.s V_4 + IL_006b: ldarg.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 IL_0072: add IL_0073: stloc.3 - IL_0074: ldloc.2 - IL_0075: ldc.i4.1 - IL_0076: conv.i8 - IL_0077: add - IL_0078: stloc.2 - IL_0079: ldloc.2 - IL_007a: ldloc.1 - IL_007b: blt.un.s IL_006a - - IL_007d: ret + IL_0074: ldloc.3 + IL_0075: ldloc.2 + IL_0076: blt.un.s IL_0062 + + IL_0078: ret } .method public static void f11(uint64 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs.opt.il.bsl index 9f610fb7519..394330583c9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -169,9 +169,10 @@ .maxstack 4 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldc.i8 0xa IL_0009: conv.u IL_000a: ldarg.0 @@ -204,89 +205,82 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00ae + IL_004f: brfalse.s IL_0094 - IL_0051: ldc.i8 0x0 - IL_005a: conv.u - IL_005b: stloc.1 - IL_005c: ldarg.0 + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.u IL_005d: stloc.2 - IL_005e: ldloc.2 - IL_005f: call void assembly::set_c(native uint) - IL_0064: ldloc.2 - IL_0065: ldc.i8 0x1 - IL_006e: conv.u - IL_006f: add - IL_0070: stloc.2 - IL_0071: ldloc.1 - IL_0072: ldc.i8 0x1 - IL_007b: conv.u - IL_007c: add - IL_007d: stloc.1 - IL_007e: br.s IL_00a0 - - IL_0080: ldloc.2 - IL_0081: call void assembly::set_c(native uint) - IL_0086: ldloc.2 - IL_0087: ldc.i8 0x1 - IL_0090: conv.u - IL_0091: add - IL_0092: stloc.2 - IL_0093: ldloc.1 - IL_0094: ldc.i8 0x1 + IL_005e: ldarg.0 + IL_005f: stloc.3 + IL_0060: br.s IL_0090 + + IL_0062: ldloc.3 + IL_0063: call void assembly::set_c(native uint) + IL_0068: ldloc.3 + IL_0069: ldc.i8 0x1 + IL_0072: conv.u + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.2 + IL_0076: ldc.i8 0x1 + IL_007f: conv.u + IL_0080: add + IL_0081: stloc.2 + IL_0082: ldloc.2 + IL_0083: ldc.i8 0x0 + IL_008c: conv.u + IL_008d: cgt.un + IL_008f: stloc.1 + IL_0090: ldloc.1 + IL_0091: brtrue.s IL_0062 + + IL_0093: ret + + IL_0094: ldc.i8 0xa IL_009d: conv.u - IL_009e: add - IL_009f: stloc.1 - IL_00a0: ldloc.1 + IL_009e: ldarg.0 + IL_009f: bge.un.s IL_00ae + IL_00a1: ldc.i8 0x0 IL_00aa: conv.u - IL_00ab: bgt.un.s IL_0080 - - IL_00ad: ret + IL_00ab: nop + IL_00ac: br.s IL_00c6 IL_00ae: ldc.i8 0xa IL_00b7: conv.u IL_00b8: ldarg.0 - IL_00b9: bge.un.s IL_00c8 - - IL_00bb: ldc.i8 0x0 - IL_00c4: conv.u + IL_00b9: sub + IL_00ba: ldc.i8 0x1 + IL_00c3: conv.u + IL_00c4: add.ovf.un IL_00c5: nop - IL_00c6: br.s IL_00e0 - - IL_00c8: ldc.i8 0xa - IL_00d1: conv.u + IL_00c6: stloc.2 + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.u + IL_00d1: stloc.3 IL_00d2: ldarg.0 - IL_00d3: sub - IL_00d4: ldc.i8 0x1 - IL_00dd: conv.u - IL_00de: add.ovf.un - IL_00df: nop - IL_00e0: stloc.1 - IL_00e1: ldc.i8 0x0 - IL_00ea: conv.u - IL_00eb: stloc.2 - IL_00ec: ldarg.0 - IL_00ed: stloc.3 - IL_00ee: br.s IL_0110 - - IL_00f0: ldloc.3 - IL_00f1: call void assembly::set_c(native uint) - IL_00f6: ldloc.3 - IL_00f7: ldc.i8 0x1 - IL_0100: conv.u - IL_0101: add - IL_0102: stloc.3 - IL_0103: ldloc.2 - IL_0104: ldc.i8 0x1 - IL_010d: conv.u - IL_010e: add - IL_010f: stloc.2 - IL_0110: ldloc.2 - IL_0111: ldloc.1 - IL_0112: blt.un.s IL_00f0 - - IL_0114: ret + IL_00d3: stloc.s V_4 + IL_00d5: br.s IL_00fa + + IL_00d7: ldloc.s V_4 + IL_00d9: call void assembly::set_c(native uint) + IL_00de: ldloc.s V_4 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.u + IL_00ea: add + IL_00eb: stloc.s V_4 + IL_00ed: ldloc.3 + IL_00ee: ldc.i8 0x1 + IL_00f7: conv.u + IL_00f8: add + IL_00f9: stloc.3 + IL_00fa: ldloc.3 + IL_00fb: ldloc.2 + IL_00fc: blt.un.s IL_00d7 + + IL_00fe: ret } .method public static void f3(native uint finish) cil managed @@ -294,9 +288,10 @@ .maxstack 4 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x1 IL_000a: conv.u @@ -329,91 +324,84 @@ IL_004b: conv.u IL_004c: ceq IL_004e: nop - IL_004f: brfalse.s IL_00b7 - - IL_0051: ldc.i8 0x0 - IL_005a: conv.u - IL_005b: stloc.1 - IL_005c: ldc.i8 0x1 - IL_0065: conv.u - IL_0066: stloc.2 - IL_0067: ldloc.2 - IL_0068: call void assembly::set_c(native uint) - IL_006d: ldloc.2 - IL_006e: ldc.i8 0x1 - IL_0077: conv.u - IL_0078: add - IL_0079: stloc.2 - IL_007a: ldloc.1 - IL_007b: ldc.i8 0x1 - IL_0084: conv.u - IL_0085: add - IL_0086: stloc.1 - IL_0087: br.s IL_00a9 - - IL_0089: ldloc.2 - IL_008a: call void assembly::set_c(native uint) - IL_008f: ldloc.2 - IL_0090: ldc.i8 0x1 - IL_0099: conv.u - IL_009a: add - IL_009b: stloc.2 - IL_009c: ldloc.1 - IL_009d: ldc.i8 0x1 - IL_00a6: conv.u - IL_00a7: add - IL_00a8: stloc.1 - IL_00a9: ldloc.1 + IL_004f: brfalse.s IL_009d + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.u + IL_005d: stloc.2 + IL_005e: ldc.i8 0x1 + IL_0067: conv.u + IL_0068: stloc.3 + IL_0069: br.s IL_0099 + + IL_006b: ldloc.3 + IL_006c: call void assembly::set_c(native uint) + IL_0071: ldloc.3 + IL_0072: ldc.i8 0x1 + IL_007b: conv.u + IL_007c: add + IL_007d: stloc.3 + IL_007e: ldloc.2 + IL_007f: ldc.i8 0x1 + IL_0088: conv.u + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldc.i8 0x0 + IL_0095: conv.u + IL_0096: cgt.un + IL_0098: stloc.1 + IL_0099: ldloc.1 + IL_009a: brtrue.s IL_006b + + IL_009c: ret + + IL_009d: ldarg.0 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.u + IL_00a8: bge.un.s IL_00b7 + IL_00aa: ldc.i8 0x0 IL_00b3: conv.u - IL_00b4: bgt.un.s IL_0089 - - IL_00b6: ret + IL_00b4: nop + IL_00b5: br.s IL_00cf IL_00b7: ldarg.0 IL_00b8: ldc.i8 0x1 IL_00c1: conv.u - IL_00c2: bge.un.s IL_00d1 - - IL_00c4: ldc.i8 0x0 - IL_00cd: conv.u + IL_00c2: sub + IL_00c3: ldc.i8 0x1 + IL_00cc: conv.u + IL_00cd: add.ovf.un IL_00ce: nop - IL_00cf: br.s IL_00e9 - - IL_00d1: ldarg.0 - IL_00d2: ldc.i8 0x1 - IL_00db: conv.u - IL_00dc: sub - IL_00dd: ldc.i8 0x1 - IL_00e6: conv.u - IL_00e7: add.ovf.un - IL_00e8: nop - IL_00e9: stloc.1 - IL_00ea: ldc.i8 0x0 - IL_00f3: conv.u - IL_00f4: stloc.2 - IL_00f5: ldc.i8 0x1 - IL_00fe: conv.u - IL_00ff: stloc.3 - IL_0100: br.s IL_0122 - - IL_0102: ldloc.3 - IL_0103: call void assembly::set_c(native uint) - IL_0108: ldloc.3 - IL_0109: ldc.i8 0x1 - IL_0112: conv.u - IL_0113: add - IL_0114: stloc.3 - IL_0115: ldloc.2 - IL_0116: ldc.i8 0x1 - IL_011f: conv.u - IL_0120: add - IL_0121: stloc.2 - IL_0122: ldloc.2 - IL_0123: ldloc.1 - IL_0124: blt.un.s IL_0102 - - IL_0126: ret + IL_00cf: stloc.2 + IL_00d0: ldc.i8 0x0 + IL_00d9: conv.u + IL_00da: stloc.3 + IL_00db: ldc.i8 0x1 + IL_00e4: conv.u + IL_00e5: stloc.s V_4 + IL_00e7: br.s IL_010c + + IL_00e9: ldloc.s V_4 + IL_00eb: call void assembly::set_c(native uint) + IL_00f0: ldloc.s V_4 + IL_00f2: ldc.i8 0x1 + IL_00fb: conv.u + IL_00fc: add + IL_00fd: stloc.s V_4 + IL_00ff: ldloc.3 + IL_0100: ldc.i8 0x1 + IL_0109: conv.u + IL_010a: add + IL_010b: stloc.3 + IL_010c: ldloc.3 + IL_010d: ldloc.2 + IL_010e: blt.un.s IL_00e9 + + IL_0110: ret } .method public static void f4(native uint start, @@ -423,9 +411,10 @@ .maxstack 4 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.1 IL_0001: ldarg.0 IL_0002: bge.un.s IL_0011 @@ -456,87 +445,80 @@ IL_0039: conv.u IL_003a: ceq IL_003c: nop - IL_003d: brfalse.s IL_009c + IL_003d: brfalse.s IL_0082 - IL_003f: ldc.i8 0x0 - IL_0048: conv.u - IL_0049: stloc.1 - IL_004a: ldarg.0 + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.u IL_004b: stloc.2 - IL_004c: ldloc.2 - IL_004d: call void assembly::set_c(native uint) - IL_0052: ldloc.2 - IL_0053: ldc.i8 0x1 - IL_005c: conv.u - IL_005d: add - IL_005e: stloc.2 - IL_005f: ldloc.1 - IL_0060: ldc.i8 0x1 - IL_0069: conv.u - IL_006a: add - IL_006b: stloc.1 - IL_006c: br.s IL_008e - - IL_006e: ldloc.2 - IL_006f: call void assembly::set_c(native uint) - IL_0074: ldloc.2 - IL_0075: ldc.i8 0x1 - IL_007e: conv.u - IL_007f: add - IL_0080: stloc.2 - IL_0081: ldloc.1 - IL_0082: ldc.i8 0x1 - IL_008b: conv.u - IL_008c: add - IL_008d: stloc.1 - IL_008e: ldloc.1 - IL_008f: ldc.i8 0x0 - IL_0098: conv.u - IL_0099: bgt.un.s IL_006e - - IL_009b: ret - - IL_009c: ldarg.1 - IL_009d: ldarg.0 - IL_009e: bge.un.s IL_00ad - - IL_00a0: ldc.i8 0x0 - IL_00a9: conv.u - IL_00aa: nop - IL_00ab: br.s IL_00bc - - IL_00ad: ldarg.1 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native uint) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.u + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.u + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.u + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.un.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.u + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.u + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.u + IL_00ad: stloc.3 IL_00ae: ldarg.0 - IL_00af: sub - IL_00b0: ldc.i8 0x1 - IL_00b9: conv.u - IL_00ba: add.ovf.un - IL_00bb: nop - IL_00bc: stloc.1 - IL_00bd: ldc.i8 0x0 - IL_00c6: conv.u - IL_00c7: stloc.2 - IL_00c8: ldarg.0 - IL_00c9: stloc.3 - IL_00ca: br.s IL_00ec - - IL_00cc: ldloc.3 - IL_00cd: call void assembly::set_c(native uint) - IL_00d2: ldloc.3 - IL_00d3: ldc.i8 0x1 - IL_00dc: conv.u - IL_00dd: add - IL_00de: stloc.3 - IL_00df: ldloc.2 - IL_00e0: ldc.i8 0x1 - IL_00e9: conv.u - IL_00ea: add - IL_00eb: stloc.2 - IL_00ec: ldloc.2 - IL_00ed: ldloc.1 - IL_00ee: blt.un.s IL_00cc + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native uint) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.u + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.u + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 - IL_00f0: ret + IL_00da: ret } .method public static void f5() cil managed @@ -667,9 +649,10 @@ .maxstack 5 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.0 IL_0001: ldc.i8 0x0 IL_000a: conv.u @@ -724,92 +707,86 @@ IL_008b: conv.u IL_008c: ceq IL_008e: nop - IL_008f: brfalse.s IL_00e5 - - IL_0091: ldc.i8 0x0 - IL_009a: conv.u - IL_009b: stloc.1 - IL_009c: ldc.i8 0x1 - IL_00a5: conv.u - IL_00a6: stloc.2 - IL_00a7: ldloc.2 - IL_00a8: call void assembly::set_c(native uint) - IL_00ad: ldloc.2 - IL_00ae: ldarg.0 - IL_00af: add - IL_00b0: stloc.2 - IL_00b1: ldloc.1 - IL_00b2: ldc.i8 0x1 - IL_00bb: conv.u - IL_00bc: add - IL_00bd: stloc.1 - IL_00be: br.s IL_00d7 - - IL_00c0: ldloc.2 - IL_00c1: call void assembly::set_c(native uint) - IL_00c6: ldloc.2 - IL_00c7: ldarg.0 - IL_00c8: add - IL_00c9: stloc.2 - IL_00ca: ldloc.1 - IL_00cb: ldc.i8 0x1 - IL_00d4: conv.u - IL_00d5: add - IL_00d6: stloc.1 - IL_00d7: ldloc.1 - IL_00d8: ldc.i8 0x0 - IL_00e1: conv.u - IL_00e2: bgt.un.s IL_00c0 - - IL_00e4: ret - - IL_00e5: ldc.i8 0xa - IL_00ee: conv.u - IL_00ef: ldc.i8 0x1 - IL_00f8: conv.u - IL_00f9: bge.un.s IL_0108 - - IL_00fb: ldc.i8 0x0 - IL_0104: conv.u - IL_0105: nop - IL_0106: br.s IL_012b - - IL_0108: ldc.i8 0xa - IL_0111: conv.u - IL_0112: ldc.i8 0x1 - IL_011b: conv.u - IL_011c: sub - IL_011d: ldarg.0 - IL_011e: div.un - IL_011f: ldc.i8 0x1 - IL_0128: conv.u - IL_0129: add.ovf.un - IL_012a: nop - IL_012b: stloc.1 - IL_012c: ldc.i8 0x0 - IL_0135: conv.u - IL_0136: stloc.2 - IL_0137: ldc.i8 0x1 - IL_0140: conv.u - IL_0141: stloc.3 - IL_0142: br.s IL_015b - - IL_0144: ldloc.3 - IL_0145: call void assembly::set_c(native uint) - IL_014a: ldloc.3 - IL_014b: ldarg.0 + IL_008f: brfalse.s IL_00d4 + + IL_0091: ldc.i4.1 + IL_0092: stloc.1 + IL_0093: ldc.i8 0x0 + IL_009c: conv.u + IL_009d: stloc.2 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.u + IL_00a8: stloc.3 + IL_00a9: br.s IL_00d0 + + IL_00ab: ldloc.3 + IL_00ac: call void assembly::set_c(native uint) + IL_00b1: ldloc.3 + IL_00b2: ldarg.0 + IL_00b3: add + IL_00b4: stloc.3 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x1 + IL_00bf: conv.u + IL_00c0: add + IL_00c1: stloc.2 + IL_00c2: ldloc.2 + IL_00c3: ldc.i8 0x0 + IL_00cc: conv.u + IL_00cd: cgt.un + IL_00cf: stloc.1 + IL_00d0: ldloc.1 + IL_00d1: brtrue.s IL_00ab + + IL_00d3: ret + + IL_00d4: ldc.i8 0xa + IL_00dd: conv.u + IL_00de: ldc.i8 0x1 + IL_00e7: conv.u + IL_00e8: bge.un.s IL_00f7 + + IL_00ea: ldc.i8 0x0 + IL_00f3: conv.u + IL_00f4: nop + IL_00f5: br.s IL_011a + + IL_00f7: ldc.i8 0xa + IL_0100: conv.u + IL_0101: ldc.i8 0x1 + IL_010a: conv.u + IL_010b: sub + IL_010c: ldarg.0 + IL_010d: div.un + IL_010e: ldc.i8 0x1 + IL_0117: conv.u + IL_0118: add.ovf.un + IL_0119: nop + IL_011a: stloc.2 + IL_011b: ldc.i8 0x0 + IL_0124: conv.u + IL_0125: stloc.3 + IL_0126: ldc.i8 0x1 + IL_012f: conv.u + IL_0130: stloc.s V_4 + IL_0132: br.s IL_014e + + IL_0134: ldloc.s V_4 + IL_0136: call void assembly::set_c(native uint) + IL_013b: ldloc.s V_4 + IL_013d: ldarg.0 + IL_013e: add + IL_013f: stloc.s V_4 + IL_0141: ldloc.3 + IL_0142: ldc.i8 0x1 + IL_014b: conv.u IL_014c: add IL_014d: stloc.3 - IL_014e: ldloc.2 - IL_014f: ldc.i8 0x1 - IL_0158: conv.u - IL_0159: add - IL_015a: stloc.2 - IL_015b: ldloc.2 - IL_015c: ldloc.1 - IL_015d: blt.un.s IL_0144 - - IL_015f: ret + IL_014e: ldloc.3 + IL_014f: ldloc.2 + IL_0150: blt.un.s IL_0134 + + IL_0152: ret } .method public static void f9(native uint finish) cil managed @@ -877,9 +854,10 @@ .maxstack 5 .locals init (native uint V_0, - native uint V_1, + bool V_1, native uint V_2, - native uint V_3) + native uint V_3, + native uint V_4) IL_0000: ldarg.1 IL_0001: ldc.i8 0x0 IL_000a: conv.u @@ -928,86 +906,80 @@ IL_0055: conv.u IL_0056: ceq IL_0058: nop - IL_0059: brfalse.s IL_00a6 + IL_0059: brfalse.s IL_0095 - IL_005b: ldc.i8 0x0 - IL_0064: conv.u - IL_0065: stloc.1 - IL_0066: ldarg.2 + IL_005b: ldc.i4.1 + IL_005c: stloc.1 + IL_005d: ldc.i8 0x0 + IL_0066: conv.u IL_0067: stloc.2 - IL_0068: ldloc.2 - IL_0069: call void assembly::set_c(native uint) - IL_006e: ldloc.2 - IL_006f: ldarg.1 - IL_0070: add - IL_0071: stloc.2 - IL_0072: ldloc.1 - IL_0073: ldc.i8 0x1 - IL_007c: conv.u - IL_007d: add - IL_007e: stloc.1 - IL_007f: br.s IL_0098 - - IL_0081: ldloc.2 - IL_0082: call void assembly::set_c(native uint) - IL_0087: ldloc.2 - IL_0088: ldarg.1 - IL_0089: add - IL_008a: stloc.2 - IL_008b: ldloc.1 - IL_008c: ldc.i8 0x1 - IL_0095: conv.u - IL_0096: add - IL_0097: stloc.1 - IL_0098: ldloc.1 + IL_0068: ldarg.2 + IL_0069: stloc.3 + IL_006a: br.s IL_0091 + + IL_006c: ldloc.3 + IL_006d: call void assembly::set_c(native uint) + IL_0072: ldloc.3 + IL_0073: ldarg.1 + IL_0074: add + IL_0075: stloc.3 + IL_0076: ldloc.2 + IL_0077: ldc.i8 0x1 + IL_0080: conv.u + IL_0081: add + IL_0082: stloc.2 + IL_0083: ldloc.2 + IL_0084: ldc.i8 0x0 + IL_008d: conv.u + IL_008e: cgt.un + IL_0090: stloc.1 + IL_0091: ldloc.1 + IL_0092: brtrue.s IL_006c + + IL_0094: ret + + IL_0095: ldarg.2 + IL_0096: ldarg.2 + IL_0097: bge.un.s IL_00a6 + IL_0099: ldc.i8 0x0 IL_00a2: conv.u - IL_00a3: bgt.un.s IL_0081 - - IL_00a5: ret + IL_00a3: nop + IL_00a4: br.s IL_00b7 IL_00a6: ldarg.2 IL_00a7: ldarg.2 - IL_00a8: bge.un.s IL_00b7 - - IL_00aa: ldc.i8 0x0 - IL_00b3: conv.u - IL_00b4: nop - IL_00b5: br.s IL_00c8 - - IL_00b7: ldarg.2 - IL_00b8: ldarg.2 - IL_00b9: sub - IL_00ba: ldarg.1 - IL_00bb: div.un - IL_00bc: ldc.i8 0x1 - IL_00c5: conv.u - IL_00c6: add.ovf.un - IL_00c7: nop - IL_00c8: stloc.1 - IL_00c9: ldc.i8 0x0 - IL_00d2: conv.u - IL_00d3: stloc.2 - IL_00d4: ldarg.2 - IL_00d5: stloc.3 - IL_00d6: br.s IL_00ef - - IL_00d8: ldloc.3 - IL_00d9: call void assembly::set_c(native uint) - IL_00de: ldloc.3 - IL_00df: ldarg.1 + IL_00a8: sub + IL_00a9: ldarg.1 + IL_00aa: div.un + IL_00ab: ldc.i8 0x1 + IL_00b4: conv.u + IL_00b5: add.ovf.un + IL_00b6: nop + IL_00b7: stloc.2 + IL_00b8: ldc.i8 0x0 + IL_00c1: conv.u + IL_00c2: stloc.3 + IL_00c3: ldarg.2 + IL_00c4: stloc.s V_4 + IL_00c6: br.s IL_00e2 + + IL_00c8: ldloc.s V_4 + IL_00ca: call void assembly::set_c(native uint) + IL_00cf: ldloc.s V_4 + IL_00d1: ldarg.1 + IL_00d2: add + IL_00d3: stloc.s V_4 + IL_00d5: ldloc.3 + IL_00d6: ldc.i8 0x1 + IL_00df: conv.u IL_00e0: add IL_00e1: stloc.3 - IL_00e2: ldloc.2 - IL_00e3: ldc.i8 0x1 - IL_00ec: conv.u - IL_00ed: add - IL_00ee: stloc.2 - IL_00ef: ldloc.2 - IL_00f0: ldloc.1 - IL_00f1: blt.un.s IL_00d8 - - IL_00f3: ret + IL_00e2: ldloc.3 + IL_00e3: ldloc.2 + IL_00e4: blt.un.s IL_00c8 + + IL_00e6: ret } .method public static void f11(native uint start,