Skip to content
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

X86 Lea Instruction Expansion #1172

Merged
merged 23 commits into from
Nov 16, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
contents: write

env:
BUILD_VERSION: 2.5.0.${{ github.run_number }}
BUILD_VERSION: 2.5.1.${{ github.run_number }}

jobs:

Expand Down
33 changes: 0 additions & 33 deletions Source/Data/IR-Optimizations-ConstantFolding-MemoryAccess.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,39 +305,6 @@
"Result": "(IR.StoreR8 a [Add##(To##(b),To##(c))] d)"
},

{
"Type": "ConstantFolding",
"Name": "Store8",
"SubName": "FoldAdd##",
"Expression": "IR.Store8 (IR.Add## a b) c d",
"Filter": "IsResolvedConstant(c) & IsResolvedConstant(b)",
"Result": "(IR.Store8 a [Add##(To##(b),To##(c))] d)"
},
{
"Type": "ConstantFolding",
"Name": "Store8",
"SubName": "FoldAdd##",
"Expression": "IR.Store8 (IR.Add## a b) c d",
"Filter": "IsResolvedConstant(c) & IsResolvedConstant(b)",
"Result": "(IR.Store8 a [Add##(To##(b),To##(c))] d)"
},
{
"Type": "ConstantFolding",
"Name": "Store8",
"SubName": "FoldAdd##",
"Expression": "IR.Store8 (IR.Add## a b) c d",
"Filter": "IsResolvedConstant(c) & IsResolvedConstant(b)",
"Result": "(IR.Store8 a [Add##(To##(b),To##(c))] d)"
},
{
"Type": "ConstantFolding",
"Name": "Store8",
"SubName": "FoldAdd##",
"Expression": "IR.Store8 (IR.Add## a b) c d",
"Filter": "IsResolvedConstant(c) & IsResolvedConstant(b)",
"Result": "(IR.Store8 a [Add##(To##(b),To##(c))] d)"
},

{
"Type": "ConstantFolding",
"Name": "Store8",
Expand Down
52 changes: 10 additions & 42 deletions Source/Data/IR-Optimizations-ConstantFolding.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"Family": "IR",
"Section": "Optimizations.Auto",
"Commutative": [
"IR.Compare32x32",
"IR.Compare32x64",
"IR.Compare64x32",
"IR.Compare64x64",
"IR.CompareObject",
"IR.CompareManagedPointer"
],
"Optimizations": [

{
Expand Down Expand Up @@ -421,26 +429,6 @@
"Priority": "100",
"Variations": "Yes"
},
{
"Type": "ConstantFolding",
"Name": "Compare32x##",
"SubName": "LessThanZero",
"Expression": "IR.Compare32x## {>u} 0 a",
"Filter": "",
"Result": "(IR.Move## 0)",
"Priority": "100",
"Variations": "Yes"
},
{
"Type": "ConstantFolding",
"Name": "Compare64x##",
"SubName": "LessThanZero",
"Expression": "IR.Compare64x## {>u} 0 a",
"Filter": "",
"Result": "(IR.Move## 0)",
"Priority": "100",
"Variations": "Yes"
},
{
"Type": "ConstantFolding",
"Name": "Compare32x##",
Expand Down Expand Up @@ -504,27 +492,7 @@
{
"Type": "ConstantFolding",
"Name": "Compare32x##",
"SubName": "LessThanMax",
"Expression": "IR.Compare32x## {<u} 0xFFFFFFFF a",
"Filter": "",
"Result": "(IR.Move## 0)",
"Priority": "100",
"Variations": "Yes"
},
{
"Type": "ConstantFolding",
"Name": "Compare64x##",
"SubName": "LessThanMax",
"Expression": "IR.Compare64x## {<u} 0xFFFFFFFFFFFFFFFF a",
"Filter": "",
"Result": "(IR.Move## 0)",
"Priority": "100",
"Variations": "Yes"
},
{
"Type": "ConstantFolding",
"Name": "Compare32x##",
"SubName": "LessThanMax",
"SubName": "LessThanOrEqualMax",
"Expression": "IR.Compare32x## {>=u} 0xFFFFFFFF a",
"Filter": "",
"Result": "(IR.Move## 1)",
Expand All @@ -534,7 +502,7 @@
{
"Type": "ConstantFolding",
"Name": "Compare64x##",
"SubName": "LessThanMax",
"SubName": "LessThanOrEqualMax",
"Expression": "IR.Compare64x## {>=u} 0xFFFFFFFFFFFFFFFF a",
"Filter": "",
"Result": "(IR.Move## 1)",
Expand Down
27 changes: 5 additions & 22 deletions Source/Data/IR-Optimizations-StrengthReduction.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,6 @@
"Result": "(IR.Move32 0)",
"Priority": "80"
},
{
"Type": "StrengthReduction",
"Name": "ShiftLeft64",
"SubName": "By64",
"Expression": "IR.ShiftLeft64 x 64",
"Filter": "",
"Result": "(IR.Move64 0)",
"Priority": "80"
},
{
"Type": "StrengthReduction",
"Name": "ShiftRight32",
Expand All @@ -401,13 +392,14 @@
},
{
"Type": "StrengthReduction",
"Name": "ShiftLeft32",
"SubName": "By32",
"Expression": "IR.ShiftLeft32 a 32",
"Name": "ShiftLeft64",
"SubName": "By64",
"Expression": "IR.ShiftLeft64 x 64",
"Filter": "",
"Result": "(IR.Move32 0)",
"Result": "(IR.Move64 0)",
"Priority": "80"
},

{
"Type": "StrengthReduction",
"Name": "ShiftRight64",
Expand All @@ -426,15 +418,6 @@
"Result": "(IR.Move64 0)",
"Priority": "80"
},
{
"Type": "StrengthReduction",
"Name": "ShiftLeft64",
"SubName": "By64",
"Expression": "IR.ShiftLeft64 a 64",
"Filter": "",
"Result": "(IR.Move64 0)",
"Priority": "80"
},
{
"Type": "StrengthReduction",
"Name": "MulHu32",
Expand Down
21 changes: 1 addition & 20 deletions Source/Data/IR-Optimizations-Useless.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,7 @@
"Priority": "85",
"Variations": "No"
},
{
"Type": "Useless",
"Name": "ZeroExtend8x32",
"SubName": "ZeroExtend16x32",
"Expression": "IR.ZeroExtend8x32 (IR.ZeroExtend16x32 a)",
"Filter": "!IsConstant(a)",
"Result": "(IR.ZeroExtend8x32 a)",
"Priority": "85",
"Variations": "No"
},
{
"Type": "Useless",
"Name": "ZeroExtend16x32",
"SubName": "ZeroExtend8x32",
"Expression": "IR.ZeroExtend16x32 (IR.ZeroExtend8x32 a)",
"Filter": "!IsConstant(a)",
"Result": "(IR.ZeroExtend8x32 a)",
"Priority": "85",
"Variations": "No"
},

{
"Type": "Useless",
"Name": "ZeroExtend8x64",
Expand Down
12 changes: 6 additions & 6 deletions Source/Data/X64-Optimizations-Standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"Optimizations": [
{
"Type": "Standard",
"Type": "Simplification",
"Name": "Mov##",
"SubName": "Coalescing",
"Expression": "X64.Mov## (X64.Mov## a)",
Expand All @@ -24,7 +24,7 @@
"Name": "Add##",
"SubName": "ByZero",
"Expression": "X64.Add## a 0",
"Filter": "!AreStatusFlagUsed(@)",
"Filter": "!AreAnyStatusFlagsUsed(@)",
"Result": "(X64.Mov## a)",
"Variations": "No"
},
Expand All @@ -33,7 +33,7 @@
"Name": "Sub##",
"SubName": "ByZero",
"Expression": "X64.Sub## a 0",
"Filter": "!AreStatusFlagUsed(@)",
"Filter": "!AreAnyStatusFlagsUsed(@)",
"Result": "(X64.Mov## a)",
"Variations": "Yes"
},
Expand All @@ -42,7 +42,7 @@
"Name": "And##",
"SubName": "ByFF",
"Expression": "X64.And## a 0xFF",
"Filter": "!IsCPURegister(a,%RSI) && !IsCPURegister(a,%RDI) && !AreStatusFlagUsed(@)",
"Filter": "!IsCPURegister(a,%RSI) && !IsCPURegister(a,%RDI) && !AreAnyStatusFlagsUsed(@)",
"Result": "(X64.Movzx8To## a)",
"Variations": "Yes",
"Log": "Yes",
Expand Down Expand Up @@ -77,8 +77,8 @@
},
{
"Type": "Simplication",
"Name": "SubFromZero",
"SubName": "",
"Name": "Sub##",
"SubName": "FromZero",
"Expression": "X64.Sub## 0 x",
"Filter": "IsVirtualRegister(x)",
"Result": "(X64.Neg## x)",
Expand Down
Loading
Loading