From 2f879c0c3089e54472860a23a27985ac687d375d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 26 Jul 2023 13:35:18 -0700 Subject: End the current basic block on a Call (#5823) Before this PR, if a call had no paths to a catch in the same function then we skipped creating a new basic block right after it. As a result, we could have a call in the middle of a basic block. If EH is enabled that means we might transfer control flow out of the function from the middle of a block. But it is better to have the property that any transfer of control flow - to another basic block, or outside of the function - can only happen at the end of a basic block. This causes some overhead, but a subsequent PR (#5838) will remove that as a followup, and this PR adds a little code to pass the module and check if EH is enabled, and avoid the overhead if not, which at least avoids regressing the non-EH case until that followup lands. --- src/ir/possible-contents.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir/possible-contents.cpp') diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp index db2655e8a..3430bc872 100644 --- a/src/ir/possible-contents.cpp +++ b/src/ir/possible-contents.cpp @@ -1177,7 +1177,7 @@ struct InfoCollector assert(handledPops == totalPops); // Handle local.get/sets: each set must write to the proper gets. - LocalGraph localGraph(func); + LocalGraph localGraph(func, getModule()); for (auto& [get, setsForGet] : localGraph.getSetses) { auto index = get->index; -- cgit v1.2.3