File 0276-beam_ssa_dead-Fix-inefficient-tuple-matching.patch of Package erlang
From 7a5d46366308758597c74d51600d7c93f91ee92e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Sat, 1 Feb 2020 07:42:10 +0100
Subject: [PATCH 02/13] beam_ssa_dead: Fix inefficient tuple matching
The compiler will compare the underscored variables to each
other instead of comparing the entire tuple.
---
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 1719166b59..697aeb23fb 100644
--- a/lib/compiler/src/beam_ssa_dead.erl
+++ b/lib/compiler/src/beam_ssa_dead.erl
@@ -726,7 +726,7 @@ eval_boolean(_, _, _) ->
%% PrevCondition is a condition known to be true. This function
%% will tell whether Condition will succeed.
-will_succeed({_Op,_Var,_Value}=Same, {_Op,_Var,_Value}=Same) ->
+will_succeed({_,_,_}=Same, {_,_,_}=Same) ->
%% Repeated test.
yes;
will_succeed({Op1,Var,#b_literal{val=A}}, {Op2,Var,#b_literal{val=B}}) ->
--
2.16.4