Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@

.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public FSharpSignatureCompressedData.assembly
{


}
.mresource public FSharpOptimizationCompressedData.assembly
{


}
.module assembly.exe

Expand Down Expand Up @@ -130,9 +120,7 @@
IL_000c: ret
}

.method public hidebysig virtual final
instance int32 CompareTo(object obj,
class [runtime]System.Collections.IComparer comp) cil managed
.method public hidebysig virtual final instance int32 CompareTo(object obj, class [runtime]System.Collections.IComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -228,9 +216,7 @@
IL_000b: ret
}

.method public hidebysig instance bool
Equals(valuetype floatsanddoubles/Float obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig instance bool Equals(valuetype floatsanddoubles/Float obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand All @@ -249,9 +235,7 @@
IL_0013: ret
}

.method public hidebysig virtual final
instance bool Equals(object obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig virtual final instance bool Equals(object obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -451,9 +435,7 @@
IL_000c: ret
}

.method public hidebysig virtual final
instance int32 CompareTo(object obj,
class [runtime]System.Collections.IComparer comp) cil managed
.method public hidebysig virtual final instance int32 CompareTo(object obj, class [runtime]System.Collections.IComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -549,9 +531,7 @@
IL_000b: ret
}

.method public hidebysig instance bool
Equals(valuetype floatsanddoubles/Double obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig instance bool Equals(valuetype floatsanddoubles/Double obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand All @@ -570,9 +550,7 @@
IL_0013: ret
}

.method public hidebysig virtual final
instance bool Equals(object obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig virtual final instance bool Equals(object obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -1400,4 +1378,3 @@




Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@

.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public FSharpSignatureCompressedData.assembly
{


}
.mresource public FSharpOptimizationCompressedData.assembly
{


}
.module assembly.exe

Expand Down Expand Up @@ -130,9 +120,7 @@
IL_000c: ret
}

.method public hidebysig virtual final
instance int32 CompareTo(object obj,
class [runtime]System.Collections.IComparer comp) cil managed
.method public hidebysig virtual final instance int32 CompareTo(object obj, class [runtime]System.Collections.IComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -228,9 +216,7 @@
IL_000b: ret
}

.method public hidebysig instance bool
Equals(valuetype floatsanddoubles/Float obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig instance bool Equals(valuetype floatsanddoubles/Float obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand All @@ -249,9 +235,7 @@
IL_0013: ret
}

.method public hidebysig virtual final
instance bool Equals(object obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig virtual final instance bool Equals(object obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -451,9 +435,7 @@
IL_000c: ret
}

.method public hidebysig virtual final
instance int32 CompareTo(object obj,
class [runtime]System.Collections.IComparer comp) cil managed
.method public hidebysig virtual final instance int32 CompareTo(object obj, class [runtime]System.Collections.IComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -549,9 +531,7 @@
IL_000b: ret
}

.method public hidebysig instance bool
Equals(valuetype floatsanddoubles/Double obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig instance bool Equals(valuetype floatsanddoubles/Double obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand All @@ -570,9 +550,7 @@
IL_0013: ret
}

.method public hidebysig virtual final
instance bool Equals(object obj,
class [runtime]System.Collections.IEqualityComparer comp) cil managed
.method public hidebysig virtual final instance bool Equals(object obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )

Expand Down Expand Up @@ -1410,4 +1388,3 @@




33 changes: 32 additions & 1 deletion tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ let run() =
IL_0040: ldc.i4.s 42
IL_0042: ldc.i4.5
IL_0043: call void TailCall06::foo<int32>(int32,
!!0)
!!0)
"""
]

Expand All @@ -276,3 +276,34 @@ let rec countdown n =
"""
]

[<Fact>]
let ``TailCall 08 - No tail call when pinning local byref``() =
FSharp """
module TailCall08

open Microsoft.FSharp.NativeInterop
open System.Runtime.CompilerServices

[<MethodImpl(MethodImplOptions.NoInlining)>]
let bar (pValue: nativeptr<int>) : unit =
let value = NativePtr.read pValue
printfn "value = %A" value

[<MethodImpl(MethodImplOptions.NoInlining)>]
let foo() =
let mutable value = 42
use ptr = fixed &value
bar ptr

[<EntryPoint>]
let main _ =
foo()
0
"""
|> asExe
|> compileWithTailCalls
|> shouldSucceed
|> run
|> shouldSucceed
|> verifyOutput "value = 42\n"

Loading