From 9a2ab9bb803aa4da2a6007cc2e945d6bc1fe0b39 Mon Sep 17 00:00:00 2001 From: dibyendumajumdar Date: Fri, 25 Aug 2023 23:16:07 +0100 Subject: Reorganized the project as multi-maven module Updated README Added language module with grammar Split the code into common and chapter01 modules. Removed a number of utility classes that were imported from AA. Added github workflow file. --- README.md | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ba068fb9..f764099c 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,38 @@ A Simple showcase for the Sea-of-Nodes compiler IR This repo is intended to demonstrate the Sea-of-Nodes compiler IR. -The Sea-of-Nodes is the core IR inside of HotSpot's C2 compiler and Google's V8 compiler and Sun/Oracle's Graal compiler. + +The Sea-of-Nodes is the core IR inside of HotSpot's C2 compiler +and Google's V8 compiler and Sun/Oracle's Graal compiler. + Since we are show casing the SoN IR, the *language* being implemented is less important. We're using a very simple language similar to C or Java, but with far fewer features. -The Sea-of-Nodes is used for machine code generation in these industrial strength systems - but for this demonstration the backend is both difficult and less important. -This repo also is not intended to be a complete language in any sense, and so the backend will probably start with levering C or Java. +The Sea-of-Nodes is used for machine code generation in these industrial +strength systems - but for this demonstration the backend is both difficult +and less important. + +This repo also is not intended to be a complete language in any sense, +and so the backend will probably start with levering C or Java. + +## Chapters + +The following is a rough plan, subject to change. + +The Common chapter defines code that will be reused throughout. + +The remaining chapters will each be self-sufficient and complete; in the sense that each chapter will fully implement +a subset of the simple language. Each chapter will also include a detailed commentary on relevant aspects of the +Sea Of Nodes intermediate representation. + +The simple language will be a small subset of C. +* [Common](common/README.md): Common utilities including a lexer. +* [Language](language/README.md): definition. +* [Chapter 1](chapter01/README.md): Simple control flow statements, `if` and `while`. Variables of `int` type. Simple + arithmetic such as addition, subtraction, multiplication, division. Non-zero values will be truthy. +* Chapter 2: Function calls. +* Chapter 3: Comparison operators. +* Chapter 4: Boolean operators `&&`, `||` and `!`. +* Chapter 5: `float` and one dimensional static length array type. +* Chapter 6: Visualize Sea of Nodes IR. +* Chapter 7: Optimizations - tbc \ No newline at end of file -- cgit v1.2.3 From b8f815a16ebad6675b6305d623196a8210145b75 Mon Sep 17 00:00:00 2001 From: dibyendumajumdar Date: Fri, 25 Aug 2023 23:26:23 +0100 Subject: Added a grammar definition for chapter 01. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index f764099c..78db3c08 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Sea Of Nodes intermediate representation. The simple language will be a small subset of C. * [Common](common/README.md): Common utilities including a lexer. -* [Language](language/README.md): definition. +* [Language](language/README.md): Simple language definition. * [Chapter 1](chapter01/README.md): Simple control flow statements, `if` and `while`. Variables of `int` type. Simple arithmetic such as addition, subtraction, multiplication, division. Non-zero values will be truthy. * Chapter 2: Function calls. -- cgit v1.2.3 From 85e5d41217d27fd481a21d17f061d31dc120873b Mon Sep 17 00:00:00 2001 From: dibyendumajumdar Date: Thu, 7 Sep 2023 19:33:52 +0100 Subject: Removed all external code. Removed the common chapter. Reimplemented Lexer. Revised the list of chapters to something more accurate. --- README.md | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 78db3c08..8acd8585 100644 --- a/README.md +++ b/README.md @@ -19,21 +19,29 @@ and so the backend will probably start with levering C or Java. The following is a rough plan, subject to change. -The Common chapter defines code that will be reused throughout. - -The remaining chapters will each be self-sufficient and complete; in the sense that each chapter will fully implement -a subset of the simple language. Each chapter will also include a detailed commentary on relevant aspects of the +Each chapter will be self-sufficient and complete; in the sense that each chapter will fully implement +a subset of the simple language, and include everything that was created in the previous chapter. +Each chapter will also include a detailed commentary on relevant aspects of the Sea Of Nodes intermediate representation. The simple language will be a small subset of C. -* [Common](common/README.md): Common utilities including a lexer. -* [Language](language/README.md): Simple language definition. -* [Chapter 1](chapter01/README.md): Simple control flow statements, `if` and `while`. Variables of `int` type. Simple - arithmetic such as addition, subtraction, multiplication, division. Non-zero values will be truthy. -* Chapter 2: Function calls. -* Chapter 3: Comparison operators. -* Chapter 4: Boolean operators `&&`, `||` and `!`. -* Chapter 5: `float` and one dimensional static length array type. -* Chapter 6: Visualize Sea of Nodes IR. -* Chapter 7: Optimizations - tbc \ No newline at end of file +* [Language](language/README.md): Simple language grammar. +* [Chapter 1](chapter01/README.md): Empty script - i.e. empty function that takes no args and returns nothing, and has empty body. +* Chapter 2: Simple binary arithmetic such as addition, subtraction, multiplication, division with constants. Peephole optimization / simple constant folding. +* Chapter 3: Graphical Visualization of Sea of Nodes IR. +* Chapter 4: Local variables, and assignment statements. Read on RHS, SSA, more peephole optimization if local is a constant. +* Chapter 5: Binary and Comparison operators involving constants and variables. Non-zero values will be truthy. +* Chapter 6: `if` statement. CFG construction, peephole optimization around dead control flow. +* Chapter 7: `while` statement. +* Chapter 8: Global Value Numbering. +* Chapter 9: Function calls. +* Chapter 10: Boolean operators `&&`, `||` and `!` including short circuit. +* Chapter 11: `float` type. +* Chapter 12: Memory effects: general memory edges in SSA. Peephole optimization around load-after-store/store-after-store. +* Chapter 13: Equivalence class aliasing, fine grained peephole optimizations. Free ptr-to analysis in SoN; but does not handle aliasing in arrays. +* Chapter 14: One dimensional static length array type. Array load/store. +* Chapter 15: Global Code Motion - unwind SoN to CFG. Scheduling. +* Chapter 16: Instruction selection, BURS. +* Chapter 17: Backend register allocation. +* Chapter 18: Garbage Collection. \ No newline at end of file -- cgit v1.2.3