diff --git a/plan.txt b/plan.txt new file mode 100644 index 0000000..ac95985 --- /dev/null +++ b/plan.txt @@ -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) diff --git a/plugin/main.cpp b/plugin/main.cpp index 8fe440a..9e196c0 100644 --- a/plugin/main.cpp +++ b/plugin/main.cpp @@ -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);