From 81da1cdebb213077a1ce2c1aaed051de0751e13c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 11 Apr 2019 19:36:13 +0200 Subject: properly detect ssa form Previously, we would skip ssa construction when a temporary has a single definition. This is only part of the ssa invariant: we must also check that all uses are dominated by the single definition. The new code does this. In fact, qbe does not store all the dominators for a block, so instead of walking the idom linked list we use a rough heuristic and declare conservatively that B0 dominates B1 when one of the two conditions is true: a. B0 is the start block b. B0 is B1 Some measurements on a big file from Michael Forney show that the code is still as fast as before this patch. --- main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'main.c') diff --git a/main.c b/main.c index 033ed9c..99ab330 100644 --- a/main.c +++ b/main.c @@ -65,6 +65,7 @@ func(Fn *fn) fillpreds(fn); filluse(fn); memopt(fn); + filluse(fn); ssa(fn); filluse(fn); ssacheck(fn); -- cgit 1.4.1