7 Sep 2010 18:36
[PATCH] RFC: TCG constant propagation.
Filip Navara <filip.navara <at> gmail.com>
2009-07-21 16:36:56 GMT
2009-07-21 16:36:56 GMT
Add support for constant propagation to TCG. This has to be paired with the liveness
analysis to remove the dead code. Not all possible operations are covered, but the
most common ones are. This improves the code generation for several ARM instructions,
like MVN (immediate), and it may help other targets as well.
---
tcg/tcg.c | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 164 insertions(+), 0 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 4cb5934..10b6a99 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
<at> <at> -1025,7 +1025,169 <at> <at> void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
#endif
tdefs++;
}
+}
+
+static void tcg_const_analysis(TCGContext *s)
+{
+ int nb_cargs, nb_iargs, nb_oargs, dest, src, src2, del_args, i;
+ TCGArg *args;
+ uint16_t op;
+ uint16_t *opc_ptr;
+ const TCGOpDef *def;
+ uint8_t *const_temps;
+ tcg_target_ulong *temp_values;
+ tcg_target_ulong val, mask;
+ tcg_target_ulong dest_val, src_val, src2_val;
+
(Continue reading)
RSS Feed