diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-29 17:48:21 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-09-01 22:53:30 +0200 |
| commit | e9c1560304d73c118cf641b318ef8959c01d7463 (patch) | |
| tree | 2e2133919246e48847b2ce911cdee58d3e50f8ac | |
| parent | 1b2f4d1229fb2c9d55cbc56be5319c26662c45ca (diff) | |
| download | sparse-dev-e9c1560304d73c118cf641b318ef8959c01d7463.tar.gz | |
trivial-phi: make clean_up_phi() more sequential
Reorganize clean_up_phi() so that the tests in the loop
are more sequential. It functionally identical but will
help to detect other, less trivial, trivial phi-nodes.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | simplify.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -187,12 +187,13 @@ static int clean_up_phi(struct instruction *insn) def = phi->def; if (def->phi_src == VOID || !def->bb) continue; - if (last) { - if (last->phi_src != def->phi_src) - same = 0; + if (!last) { + last = def; continue; } - last = def; + if (last->phi_src == def->phi_src) + continue; + same = 0; } END_FOR_EACH_PTR(phi); if (same) { |
