From 120f316162879b6165deba77815cd4193fb2fb59 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 30 May 2025 17:40:17 +0200 Subject: [PATCH] skip deleted phis in use width scan --- copy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/copy.c b/copy.c index c76bb79..43b9490 100644 --- a/copy.c +++ b/copy.c @@ -60,7 +60,13 @@ usewidthle(Fn *fn, Ref r, int w) switch (u->type) { case UPhi: p = u->u.phi; - if (p->visit) + /* during gvn, phi nodes may be + * replaced by other temps; in + * this case, the replaced phi + * uses are added to the + * replacement temp uses and + * Phi.to is set to R */ + if (p->visit || req(p->to, R)) continue; p->visit = 1; b = usewidthle(fn, p->to, w);