diff options
author | 2004-12-10 11:47:19 -0700 | |
---|---|---|
committer | 2005-04-07 21:05:53 -0700 | |
commit | 0f56c21f6291adda2e426f7181171123283ec956 (patch) | |
tree | 9100c989bd839bb586f8bb1d644135419b1346ae /liveness.c | |
parent | Track phi uses in a separate pass from the liveness analysis. (diff) | |
download | sparse-0f56c21f6291adda2e426f7181171123283ec956.tar.gz sparse-0f56c21f6291adda2e426f7181171123283ec956.tar.bz2 sparse-0f56c21f6291adda2e426f7181171123283ec956.zip |
Remove pseudos from liveness list when they are defined.
This only matters for phi-nodes, since other kinds of pseudos
should never see any use before their def anyway.
Diffstat (limited to 'liveness.c')
-rw-r--r-- | liveness.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -311,6 +311,20 @@ static void track_pseudo_death_bb(struct basic_block *bb) FOR_EACH_PTR_REVERSE(bb->insns, insn) { if (!insn->bb) continue; + + /* + * A "def" of a pseudo removes it from the liveness + * list. However, we only bother doing that for + * phi-nodes, since no other pseudos should ever + * be even used before they are def'ed. + */ + if (insn->opcode == OP_PHISOURCE) { + struct instruction *phi; + FOR_EACH_PTR(insn->phi_users, phi) { + remove_pseudo(live_list, phi->target); + } END_FOR_EACH_PTR(phi); + } + dead_list = NULL; track_instruction_usage(bb, insn, death_def, death_use); if (dead_list) { |