aboutsummaryrefslogtreecommitdiff
path: root/copy.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2025-05-30 17:40:17 +0200
committerQuentin Carbonneaux <[email protected]>2025-05-30 17:40:17 +0200
commit120f316162879b6165deba77815cd4193fb2fb59 (patch)
tree07d50a01f709996dc97e1999c40aaa5be17cc271 /copy.c
parent8d5b86ac4c24e24802a60e5e9df2dd5902fe0a5c (diff)
skip deleted phis in use width scan
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c8
1 files changed, 7 insertions, 1 deletions
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);