diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-30 21:50:17 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-09-01 08:43:12 +0200 |
| commit | d82ff76577aafcb3f01422c2592aebd503816d80 (patch) | |
| tree | 6f5c16f2224d3bf78e62f3e71bdae64d027a4cf2 | |
| parent | 47da866ed7671944d66b1075f2beeb494e5fa924 (diff) | |
| download | sparse-dev-d82ff76577aafcb3f01422c2592aebd503816d80.tar.gz | |
ir-validate: ignore dead phis
Dead phi-nodes should be eliminated early or, even better,
never emitted.
For the moment, ignore them during IR validation since they
make the tests fail despite being no-ops.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | ir.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -29,6 +29,9 @@ static int check_phi_node(struct instruction *insn) pseudo_t phi; int err = 0; + if (!has_users(insn->target)) + return err; + if (bb_list_size(insn->bb->parents) != nbr_phi_operands(insn)) { sparse_error(insn->pos, "bad number of phi operands in:\n\t%s", show_instruction(insn)); |
