summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2019-11-10 09:53:40 +0800
committerJohn Hodge <tpg@mutabah.net>2019-11-10 09:53:40 +0800
commitf1c5c54cac4cbdec7dd8bd2c59b1dc3ac59c3f7b (patch)
tree5ec936e9e9c4ea3c23d84f32fecae3cf507dbd80
parent80fe05a7198104c840edea449a12f4b55dbd45c7 (diff)
downloadmrust-f1c5c54cac4cbdec7dd8bd2c59b1dc3ac59c3f7b.tar.gz
Notes - Update todo list (many completed)
-rw-r--r--Notes/todo.txt33
1 files changed, 8 insertions, 25 deletions
diff --git a/Notes/todo.txt b/Notes/todo.txt
index 5b244a34..290ac289 100644
--- a/Notes/todo.txt
+++ b/Notes/todo.txt
@@ -2,8 +2,6 @@ TODO:
- Get all run-pass and run-fail tests passing resolve
- Lots of fixes to do here
- Audit TODOs in codebase
-- MIR Optimisations
- - Remove variables that are just assigned from arguments
- Clean up AST
- Almost done, just a few little niggles left
- Optimise typecheck.
@@ -13,25 +11,26 @@ TODO:
## Big change TODOs
- Support MIR-only RLibs
- Defer C codegen until final binary generation?
-- Dylib support (requires trans API restructure)
- - Will improve disk usage for tests (can dynamically link libstd)
- Fix Span annotations
- Spans are missing on HIR items, sub-par reporting in typecheck and later
- Spans can be off by a line or two
- Refactor parse to use a consume model lexer
+ - Will _probably_ improve speed and simplicity, but will need checking
- Optimise optimise (and typecheck)
- Partially down with trait resolution optimisation. Needs further profiling
- Complete structed C codegen
- Upside: It'll look cool
- Unknown: Will it be faster?
-- RTL/register-based SSA interrim backend
+- RTL/register-based SSA IR backend (LIR?)
- Convert MIR into a form that can be handed over to LLVM or Cranelift (or GIMPLE)
- Use alloca-s for non-pointer/integer/borrowed locals
+- Restructure HIR node type annotations into a type table (de-duplicated types)
+ - This will save memory (both inline, and by de-duplicating)
+ - This can share the ivar table
+ - Compact/dedup the table once done?
+ - Store a `shared_ptr` and index on each node (3 pointers instead of huge TypeRef instance)
## Smaller changes
-- Make type ascritpion its own node type
- - AST and HIR
- - Then remove per-node type annotations from AST
- Cache specialisation tree
- TODO: Profile to determine if this is a slow point.
- Delete HIR after MIR generation
@@ -39,29 +38,13 @@ TODO:
- May just be able to do the delete in the main MIR gen phase
- Split types and patterns in HIR function arguments
- Upsides:
- - Less data in the serialsed .hir file
- - Note: Patterns aren't actually stored in metadata
- Simpler logic post MIR generation
- Reduced use of .first/.second
- Memory usage reduction for external functions
- Downsides:
- Lots of code touched
- Extra complexity in typecheck and MIR lowering?
-- Sort trait impls in a similar way to type impls
- - ```c++
- template<T> struct ImplGroup {
- std::map<SimplePath, T> named;
- std::vector<T> primitives;
- std::vector<T> generic;
- }
- std::map<SimplePath, ImplGroup<TraitImpl>> trait_impls;
- ``` <!-- `-->
- - Problem: Trait lookup on ivars?
- - TODO: Profile a large crate again to see what the overhead of searching
- trait impls is.
- - Should help with widely implemented traits (e.g. Debug)
- - Downside: Another SimplePath per impl cluster, plus the vector size - Not
- too big but something to be aware of (7 pointers overhead plus indirection).
+ - Need to check/assume that the lists are the same length
## Optimisations