Added approach description

This commit is contained in:
York Jasper Niebuhr 2025-10-13 11:43:49 +02:00
parent 29fafcdef3
commit a22b507a4c
2 changed files with 10 additions and 1 deletions

9
plan.txt Normal file
View File

@ -0,0 +1,9 @@
General:
- Use custom __builtin_offsetof definition to preserve the call until lower gimple
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)

View File

@ -349,8 +349,8 @@ int plugin_init(plugin_name_args *plugin_info, plugin_gcc_version *version)
struct register_pass_info ginfo;
ginfo.pass = new gimplabels_pass(nullptr);
ginfo.reference_pass_name = "cfg";
ginfo.ref_pass_instance_number = 1;
ginfo.reference_pass_name = "optimized";
ginfo.pos_op = PASS_POS_INSERT_AFTER;
register_callback(plugin_info->base_name, PLUGIN_PASS_MANAGER_SETUP, nullptr, &ginfo);