Docs updated

This commit is contained in:
York Jasper Niebuhr 2025-10-15 23:03:02 +02:00
parent ae1d962dff
commit 233b217b01
2 changed files with 12 additions and 1 deletions

View File

@ -1,10 +1,20 @@
General:
- Use custom __builtin_offsetof definition to preserve the call until lower gimple
Approach:
OLD Approach:
- At the very last point of gimple (after gimple optimizations), recognize accesses
- Build a mapping of statement location (multiple statements share) to a semantic graph (or tree)
- Right after expansion to RTL, pattern match set of RTL instructions with same location to graph
- Add notes (persistent over RTL transformations) to any RTL instruction that is relevant
- After all RTL optimizations, add assembly labels before relevant RTL instructions (identified by notes)
- Might need an additional early pass to prevent COMPONENT_REFs to constant/static stuff from being folded early
Approach:
- At the very first point of gimple (before optimizations), replace COMPONENT_REFs of relevant structs
- Turn them into calls of __spslr_component_ref(base (new ssa stmt), type uid, member uid)
- Make sure the return type is matching that of the COMPONENT_REF (member type)
- Let those calls get lowered all the way into UNOPTIMIZED RTL
- Replace calls by inserting original constants and attaching notes
- Let RTL optimizations do their job with those many separate constants
- At the very end of RTL, recognize member offsets by notes and add assembly labels
- MIGHT require some logic to trace notes through RTL optimizations (which operand?, combined how?)

View File

@ -18,3 +18,4 @@ Constant foldable expressions, e.g. "size_t myOffset = ((size_t)&((struct task_s
-> gcc folds those expressions before PLUGIN_FINISH_PARSE_FUNCTION
-> any recoverability of COMPONENT_REF is impossible
-> requires gcc patch (fairly small one though)
-> fold_offsetof in the C frontend is responsible