Dump final-most gimple (with ssa) using the plugin option
karthik duraisami
kdconstant@hotmail.com
Fri Jun 11 19:11:00 GMT 2010
Hi,
I am trying to dump the final-most gimple (in ssa) file. My understanding is that lto encodes GIMPLE IR in the bytestream of the object files and accordingly I invoke PLUGIN_PASS_MANAGER_SETUP to embed my faux dummy pass after 'pass_ipa_lto_finish_out'. Is ssa information available at the 'all_lto_gen_passes' stage?
Also, should I check for other properties (PROP_trees) and should I bother with TODO_cleanup_cfg?
Error message:
cc1: fatal error: pass آ‘ipa_lto_gimple_outآ’ not found but is referenced by new pass آ‘gimpleSSA_outآ’
Any help would be greatly appreciated.
Thank you.
Regards,
Karthik
-----------------------------------####################-----------------------------------
-----------------------------------####################-----------------------------------
#include "gcc-plugin.h"
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tree.h"
#include "intl.h"
#include "tm.h"
#include "gimple.h"
#include "tree-pass.h"
#include <string.h>
int plugin_is_GPL_compatible;
struct ipa_opt_pass_d pass_dump_GSSA =
آ {
آ {
آ آ IPA_PASS,
آ آ "gimpleSSA_out",آ آ آ آ آ آ آ /* name */
آ آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* gate */
آ آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* execute */
آ آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* sub */
آ آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* next */
آ آ 0,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* static_pass_number - a nonzero static_pass_number
آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ indicates that the pass is already in the list. */
آ آ 0,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* tv_id */
آ آ PROP_ssa,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* properties_required */
آ آ 0,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* properties_provided */
آ آ 0,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* properties_destroyed */
آ آ 0,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* todo_flags_start */
آ آ آ TODO_update_ssa_any
آ آ | TODO_dump_funcآ آ آ آ آ /* todo_flags_finish */
آ },
آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* generate_summary */
آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* write_summary */
آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* read_summary */
آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* function_read_summary */
آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* stmt_fixup */
آ 0,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* TODOs */
آ NULL,آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* function_transform */
آ NULLآ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ /* variable_transform */
آ };
int
plugin_init (struct plugin_name_args *plugin_info,
آ آ آ آ آ آ آ آ آ آ آ آ struct plugin_gcc_version *version)
{
آ /* if (!plugin_default_version_check (version, &gcc_version))
آ آ آ return 1; */
آ struct register_pass_info pass_info;
آ const char *plugin_name = plugin_info->base_name;
آ int argc = plugin_info->argc;
آ struct plugin_argument *argv = plugin_info->argv;
آ
آ pass_info.pass = &pass_dump_GSSA.pass;
آ pass_info.reference_pass_name = "ipa_lto_gimple_out";
آ /*Do it for every instance if it is 0. */
آ pass_info.ref_pass_instance_number = 0;
آ /* This pass can go almost anywhere as long as you're in SSA form */
آ pass_info.pos_op = PASS_POS_INSERT_AFTER;
آ
آ /* Register this new pass with GCC */
آ register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ آ &pass_info);
آ
آ /* Register the user attribute */
آ /*register_callback (plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL); */
آ
آ return 0;
}
-----------------------------------####################-----------------------------------
-----------------------------------####################-----------------------------------
GCC=/usr/local/bin/gcc-4.5
PLUGIN_SOURCE_FILES= plugin_dumpGimpleSSA.c
PLUGIN_OBJECT_FILES= $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
GCCPLUGINS_DIR:= $(shell $(GCC) -print-file-name=plugin)
CFLAGS+= -I$(GCCPLUGINS_DIR)/include -fPIC -O2
dumpGimpleSSA_plugin.so: $(PLUGIN_OBJECT_FILES)
آ آ آ $(GCC) -shared $^ -o $@
آ -----------------------------------####################-----------------------------------
/usr/local/bin/gcc-4.5 -v -O2 -o prova -fdump-tree-all -fplugin=/home/karthik/Temp/dumpGimpleSSA_plugin.so ../../prova.c
آ -----------------------------------####################-----------------------------------
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
More information about the Gcc-help
mailing list