diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-28 10:38:52 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:05:08 -0700 |
commit | e19250992c2bf7b95dafed7dea3751428bdf7c32 (patch) | |
tree | 4e7b1b53a34f43e1007f36c7bf0fa0ba74f5d31b /flow.c | |
parent | Make list-ptr remove/replace take a count. (diff) | |
download | sparse-e19250992c2bf7b95dafed7dea3751428bdf7c32.tar.gz sparse-e19250992c2bf7b95dafed7dea3751428bdf7c32.tar.bz2 sparse-e19250992c2bf7b95dafed7dea3751428bdf7c32.zip |
Allow CSE to run after bb packing.
...but we can't merge phi-sources after packing. Or rather, we
could, but we'll have to be more careful about not re-ordering
them, which we aren't. Sort it out later.
Diffstat (limited to 'flow.c')
-rw-r--r-- | flow.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -32,6 +32,8 @@ static void rewrite_branch(struct basic_block *bb, if (*ptr != old) return; + /* We might find new if-conversions or non-dominating CSEs */ + repeat_phase |= REPEAT_CSE; *ptr = new; replace_bb_in_list(&bb->children, old, new, 1); remove_bb_from_list(&old->parents, bb, 1); @@ -814,6 +816,21 @@ out: goto no_merge; } END_FOR_EACH_PTR(child); + /* + * Merge the two. + */ + repeat_phase |= REPEAT_CSE; + + /* + * But don't allow phi-source merges after this. + * FIXME, FIXME! I really need to think about this. + * Is it true? I think it's ok to merge phi-sources, + * as long as we keep their relative position in + * the stream. It's the re-ordering we can't have. + * I think. + */ + merge_phi_sources = 0; + parent->children = bb->children; FOR_EACH_PTR(bb->children, child) { struct basic_block *p; @@ -823,6 +840,7 @@ out: *THIS_ADDRESS(p) = parent; } END_FOR_EACH_PTR(p); } END_FOR_EACH_PTR(child); + bb->children = NULL; delete_last_instruction(&parent->insns); FOR_EACH_PTR(bb->insns, insn) { |