aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-30 21:50:17 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-09-01 08:43:12 +0200
commitd82ff76577aafcb3f01422c2592aebd503816d80 (patch)
tree6f5c16f2224d3bf78e62f3e71bdae64d027a4cf2
parent47da866ed7671944d66b1075f2beeb494e5fa924 (diff)
downloadsparse-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ir.c b/ir.c
index 533e8e23..836d4eb2 100644
--- a/ir.c
+++ b/ir.c
@@ -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));