File 0251-beam_ssa_dead-Lower-the-threshold-for-giving-up.patch of Package erlang

From e971d78d450e116d046b67f899ae53a6f718ee09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Mon, 30 Nov 2020 10:06:00 +0100
Subject: [PATCH 1/3] beam_ssa_dead: Lower the threshold for giving up

There is a mechanism for giving up a search for a forced label
in beam_ssa_dead. Based on the compilation time for this code:

https://gist.github.com/josevalim/2c175678a0f85568eb001dcb97024ef5

where the running time for beam_ssa_dead still dominates, it seems
prudent to lower the threshold for when the seach should be given
up.

https://bugs.erlang.org/browse/ERL-1302
---
 lib/compiler/src/beam_ssa_dead.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/compiler/src/beam_ssa_dead.erl b/lib/compiler/src/beam_ssa_dead.erl
index cf0132ebb1..a62da9dac2 100644
--- a/lib/compiler/src/beam_ssa_dead.erl
+++ b/lib/compiler/src/beam_ssa_dead.erl
@@ -196,7 +196,7 @@ shortcut_1(L, From, Bs0, UnsetVars0, St) ->
 %% Try to shortcut this block, branching to a successor.
 shortcut_2(L, From, Bs, UnsetVars, St) ->
     case cerl_sets:size(UnsetVars) of
-        SetSize when SetSize > 128 ->
+        SetSize when SetSize > 64 ->
             %% This is an heuristic to limit the search for a forced label
             %% before it drastically slows down the compiler. Experiments
             %% with scripts/diffable showed that limits larger than 31 did not
-- 
2.26.2

openSUSE Build Service is sponsored by