Skip to content

Remove inline IL for public 'not' function #9473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/prim-types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3792,7 +3792,7 @@ namespace Microsoft.FSharp.Core
let (|Failure|_|) (error: exn) = if error.GetType().Equals(typeof<System.Exception>) then Some error.Message else None

[<CompiledName("Not")>]
let inline not (value: bool) = (# "ceq" value false : bool #)
let inline not (value: bool) = if value then false else true


let inline (<) x y = GenericLessThan x y
Expand Down
39 changes: 22 additions & 17 deletions tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/Seq_for_all01.il.bsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Microsoft (R) .NET Framework IL Disassembler. Version 4.8.3928.0
// Copyright (c) Microsoft Corporation. All rights reserved.


Expand All @@ -13,7 +13,7 @@
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
.ver 4:4:1:0
.ver 4:7:0:0
}
.assembly Seq_for_all01
{
Expand All @@ -29,20 +29,20 @@
}
.mresource public FSharpSignatureData.Seq_for_all01
{
// Offset: 0x00000000 Length: 0x000001AB
// Offset: 0x00000000 Length: 0x000001C1
}
.mresource public FSharpOptimizationData.Seq_for_all01
{
// Offset: 0x000001B0 Length: 0x00000072
// Offset: 0x000001C8 Length: 0x00000072
}
.module Seq_for_all01.exe
// MVID: {59B19213-D30D-BA80-A745-03831392B159}
// MVID: {5EE40368-D30D-BA80-A745-03836803E45E}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x02A60000
// Image base: 0x07080000


// =============== CLASS MEMBERS DECLARATION ===================
Expand All @@ -69,28 +69,33 @@
.method public strict virtual instance bool
Invoke(int32 s) cil managed
{
// Code size 14 (0xe)
// Code size 18 (0x12)
.maxstack 8
.language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
.line 5,5 : 31,47 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\Misc\\Seq_for_all01.fs'
.line 5,5 : 31,47 'C:\\Users\\phcart\\source\\repos\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\Misc\\Seq_for_all01.fs'
IL_0000: ldc.i4.1
IL_0001: brtrue.s IL_0005
IL_0001: ldc.i4.0
IL_0002: ceq
.line 100001,100001 : 0,0 ''
IL_0004: nop
.line 100001,100001 : 0,0 ''
IL_0005: brfalse.s IL_0009

IL_0003: br.s IL_0007
IL_0007: br.s IL_000b

IL_0005: br.s IL_000b
IL_0009: br.s IL_000f

.line 5,5 : 48,50 ''
IL_0007: nop
IL_000b: nop
.line 100001,100001 : 0,0 ''
IL_0008: nop
IL_0009: br.s IL_000c
IL_000c: nop
IL_000d: br.s IL_0010

.line 100001,100001 : 0,0 ''
IL_000b: nop
IL_000f: nop
.line 6,6 : 31,35 ''
IL_000c: ldc.i4.1
IL_000d: ret
IL_0010: ldc.i4.1
IL_0011: ret
} // end of method q@4::Invoke

} // end of class q@4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Microsoft (R) .NET Framework IL Disassembler. Version 4.8.3928.0
// Copyright (c) Microsoft Corporation. All rights reserved.


Expand All @@ -13,7 +13,7 @@
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
.ver 4:4:1:0
.ver 4:7:0:0
}
.assembly comparison_decimal01
{
Expand All @@ -29,20 +29,20 @@
}
.mresource public FSharpSignatureData.comparison_decimal01
{
// Offset: 0x00000000 Length: 0x00000176
// Offset: 0x00000000 Length: 0x0000018C
}
.mresource public FSharpOptimizationData.comparison_decimal01
{
// Offset: 0x00000180 Length: 0x0000005B
// Offset: 0x00000190 Length: 0x0000005B
}
.module comparison_decimal01.exe
// MVID: {59B19240-76D8-7EE3-A745-03834092B159}
// MVID: {5EE40368-76D8-7EE3-A745-03836803E45E}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x02980000
// Image base: 0x06B30000


// =============== CLASS MEMBERS DECLARATION ===================
Expand All @@ -63,10 +63,12 @@
.method public static void main@() cil managed
{
.entrypoint
// Code size 228 (0xe4)
// Code size 233 (0xe9)
.maxstack 8
.locals init ([0] valuetype [mscorlib]System.Decimal V_0,
[1] valuetype [mscorlib]System.Decimal V_1)
.language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
.line 4,4 : 9,20 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\Operators\\comparison_decimal01.fs'
.line 4,4 : 9,20 'C:\\Users\\phcart\\source\\repos\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\Operators\\comparison_decimal01.fs'
IL_0000: ldc.i4.s 10
IL_0002: ldc.i4.0
IL_0003: ldc.i4.0
Expand Down Expand Up @@ -197,70 +199,76 @@
int32,
bool,
uint8)
IL_0097: ldc.i4.s 20
IL_0099: ldc.i4.0
IL_0097: stloc.0
IL_0098: ldc.i4.s 20
IL_009a: ldc.i4.0
IL_009b: ldc.i4.0
IL_009c: ldc.i4.1
IL_009d: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
IL_009c: ldc.i4.0
IL_009d: ldc.i4.1
IL_009e: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
int32,
int32,
bool,
uint8)
IL_00a2: call bool [mscorlib]System.Decimal::op_Equality(valuetype [mscorlib]System.Decimal,
IL_00a3: stloc.1
IL_00a4: ldloc.0
IL_00a5: ldloc.1
IL_00a6: call bool [mscorlib]System.Decimal::op_Equality(valuetype [mscorlib]System.Decimal,
valuetype [mscorlib]System.Decimal)
IL_00a7: ldc.i4.0
IL_00a8: ceq
IL_00aa: pop
IL_00ab: ldc.i4.0
IL_00ac: ceq
IL_00ae: pop
.line 100001,100001 : 0,0 ''
IL_00af: nop
.line 10,10 : 9,20 ''
IL_00ab: ldc.i4.s 10
IL_00ad: ldc.i4.0
IL_00ae: ldc.i4.0
IL_00af: ldc.i4.0
IL_00b0: ldc.i4.1
IL_00b1: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
IL_00b0: ldc.i4.s 10
IL_00b2: ldc.i4.0
IL_00b3: ldc.i4.0
IL_00b4: ldc.i4.0
IL_00b5: ldc.i4.1
IL_00b6: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
int32,
int32,
bool,
uint8)
IL_00b6: ldc.i4.s 20
IL_00b8: ldc.i4.0
IL_00b9: ldc.i4.0
IL_00ba: ldc.i4.0
IL_00bb: ldc.i4.1
IL_00bc: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
IL_00bb: ldc.i4.s 20
IL_00bd: ldc.i4.0
IL_00be: ldc.i4.0
IL_00bf: ldc.i4.0
IL_00c0: ldc.i4.1
IL_00c1: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
int32,
int32,
bool,
uint8)
IL_00c1: call bool [mscorlib]System.Decimal::op_Equality(valuetype [mscorlib]System.Decimal,
IL_00c6: call bool [mscorlib]System.Decimal::op_Equality(valuetype [mscorlib]System.Decimal,
valuetype [mscorlib]System.Decimal)
IL_00c6: pop
IL_00cb: pop
.line 11,11 : 9,26 ''
IL_00c7: ldc.i4.s 10
IL_00c9: ldc.i4.0
IL_00ca: ldc.i4.0
IL_00cb: ldc.i4.0
IL_00cc: ldc.i4.1
IL_00cd: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
IL_00cc: ldc.i4.s 10
IL_00ce: ldc.i4.0
IL_00cf: ldc.i4.0
IL_00d0: ldc.i4.0
IL_00d1: ldc.i4.1
IL_00d2: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
int32,
int32,
bool,
uint8)
IL_00d2: ldc.i4.s 20
IL_00d4: ldc.i4.0
IL_00d5: ldc.i4.0
IL_00d6: ldc.i4.0
IL_00d7: ldc.i4.1
IL_00d8: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
IL_00d7: ldc.i4.s 20
IL_00d9: ldc.i4.0
IL_00da: ldc.i4.0
IL_00db: ldc.i4.0
IL_00dc: ldc.i4.1
IL_00dd: newobj instance void [mscorlib]System.Decimal::.ctor(int32,
int32,
int32,
bool,
uint8)
IL_00dd: call int32 [mscorlib]System.Decimal::Compare(valuetype [mscorlib]System.Decimal,
IL_00e2: call int32 [mscorlib]System.Decimal::Compare(valuetype [mscorlib]System.Decimal,
valuetype [mscorlib]System.Decimal)
IL_00e2: pop
IL_00e3: ret
IL_00e7: pop
IL_00e8: ret
} // end of method $Comparison_decimal01::main@

} // end of class '<StartupCode$comparison_decimal01>'.$Comparison_decimal01
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Microsoft (R) .NET Framework IL Disassembler. Version 4.8.3928.0
// Copyright (c) Microsoft Corporation. All rights reserved.


Expand All @@ -13,7 +13,7 @@
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
.ver 4:5:0:0
.ver 4:7:0:0
}
.assembly extern Utils
{
Expand All @@ -33,20 +33,20 @@
}
.mresource public FSharpSignatureData.Linq101Partitioning01
{
// Offset: 0x00000000 Length: 0x000003DE
// Offset: 0x00000000 Length: 0x000003EC
}
.mresource public FSharpOptimizationData.Linq101Partitioning01
{
// Offset: 0x000003E8 Length: 0x00000138
// Offset: 0x000003F0 Length: 0x00000138
}
.module Linq101Partitioning01.exe
// MVID: {5B9A632A-B280-A6A2-A745-03832A639A5B}
// MVID: {5EE4036A-B280-A6A2-A745-03836A03E45E}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x00AF0000
// Image base: 0x00C40000


// =============== CLASS MEMBERS DECLARATION ===================
Expand Down Expand Up @@ -100,7 +100,7 @@
.locals init ([0] int32 V_0,
[1] int32 n)
.language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
.line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Partitioning01.fs'
.line 100001,100001 : 0,0 'C:\\Users\\phcart\\source\\repos\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Partitioning01.fs'
IL_0000: ldarg.0
IL_0001: ldfld int32 Linq101Partitioning01/first3Numbers@12::pc
IL_0006: ldc.i4.1
Expand Down Expand Up @@ -1797,17 +1797,23 @@
.method public strict virtual instance bool
Invoke(int32 n) cil managed
{
// Code size 10 (0xa)
.maxstack 8
// Code size 14 (0xe)
.maxstack 6
.locals init ([0] int32 V_0,
[1] int32 V_1)
.line 53,53 : 20,30 ''
IL_0000: ldarg.1
IL_0001: ldc.i4.3
IL_0002: rem
IL_0003: ldc.i4.0
IL_0004: ceq
IL_0006: ldc.i4.0
IL_0007: ceq
IL_0009: ret
IL_0003: stloc.0
IL_0004: ldc.i4.0
IL_0005: stloc.1
IL_0006: ldloc.0
IL_0007: ldloc.1
IL_0008: ceq
IL_000a: ldc.i4.0
IL_000b: ceq
IL_000d: ret
} // end of method 'allButFirst3Numbers@53-1'::Invoke

} // end of class 'allButFirst3Numbers@53-1'
Expand All @@ -1817,7 +1823,7 @@
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::'numbers@7-5'
IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::numbers@7
IL_0005: ret
} // end of method Linq101Partitioning01::get_numbers

Expand All @@ -1835,7 +1841,7 @@
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<class [Utils]Utils/Customer> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::'customers@17-2'
IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<class [Utils]Utils/Customer> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::customers@17
IL_0005: ret
} // end of method Linq101Partitioning01::get_customers

Expand Down Expand Up @@ -1937,11 +1943,11 @@
.class private abstract auto ansi sealed '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01
extends [mscorlib]System.Object
{
.field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32> 'numbers@7-5'
.field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32> numbers@7
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32> first3Numbers@10
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<class [Utils]Utils/Customer> 'customers@17-2'
.field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<class [Utils]Utils/Customer> customers@17
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field static assembly class [mscorlib]System.Tuple`3<string,int32,valuetype [mscorlib]System.DateTime>[] WAOrders@18
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
Expand Down Expand Up @@ -2009,7 +2015,7 @@
IL_003d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<!0> class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32>::Cons(!0,
class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<!0>)
IL_0042: dup
IL_0043: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::'numbers@7-5'
IL_0043: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<int32> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::numbers@7
IL_0048: stloc.0
.line 10,14 : 1,20 ''
IL_0049: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query()
Expand All @@ -2033,7 +2039,7 @@
.line 17,17 : 1,34 ''
IL_0076: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<class [Utils]Utils/Customer> [Utils]Utils::getCustomerList()
IL_007b: dup
IL_007c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<class [Utils]Utils/Customer> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::'customers@17-2'
IL_007c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<class [Utils]Utils/Customer> '<StartupCode$Linq101Partitioning01>'.$Linq101Partitioning01::customers@17
IL_0081: stloc.2
.line 18,24 : 1,21 ''
IL_0082: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query()
Expand Down
Loading