Update plans

This commit is contained in:
Nikita Lisitsa 2026-03-23 00:26:58 +03:00
parent b267f09ea4
commit 776c12f6b5
2 changed files with 6 additions and 11 deletions

View file

@ -4,7 +4,6 @@
#include <pslang/ast/expression_visitor.hpp> #include <pslang/ast/expression_visitor.hpp>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
namespace pslang::ir namespace pslang::ir
{ {
@ -268,7 +267,10 @@ namespace pslang::ir
return last(); return last();
} }
// TODO: struct_definition node_ref apply(ast::struct_definition const & node)
{
return last();
}
// Statement list // Statement list

View file

@ -21,15 +21,8 @@ Aarch64 compiler backlog:
* Struct function arguments & return values * Struct function arguments & return values
* Arrays * Arrays
IR outline: IR backlog:
* Doubly-linked list (std::list will do) of instruction nodes * Structs & arrays: structs indexed by field index, make sure the representation allows for SROA
* Nodes reference other nodes for input data or branching target
* No temporary variables, nodes themselves represent data flow
* Assignment expressions turn into nodes that assign to previously-defined nodes
* Jump targets (first `while` node, node after an `if`, etc) are generated as nop nodes, to prevent them from being removed by the optimizer
* Structs & arrays can be split into several independent nodes per-field (before pointers are introduced)
IR optimizations:
* Inlining: track function IR size (number of nodes will do), substitute its code instead of calling if it is small enough (pay attention to recursion) * Inlining: track function IR size (number of nodes will do), substitute its code instead of calling if it is small enough (pay attention to recursion)
* Constant folding & propagation: if all node arguments are `const` nodes, replace the current node with the computed value * Constant folding & propagation: if all node arguments are `const` nodes, replace the current node with the computed value
* Arithmetic simplification: replace a+0 with a, etc * Arithmetic simplification: replace a+0 with a, etc