File 2112-beam_ssa-Simplify-normalization.patch of Package erlang
From 8ff6e534226c38b617c8071d7578ab9932aa51c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org>
Date: Fri, 6 May 2022 16:48:58 +0200
Subject: [PATCH 2/7] beam_ssa: Simplify normalization
---
lib/compiler/src/beam_ssa.erl | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/compiler/src/beam_ssa.erl b/lib/compiler/src/beam_ssa.erl
index e07a38ca85..52af0e8eeb 100644
--- a/lib/compiler/src/beam_ssa.erl
+++ b/lib/compiler/src/beam_ssa.erl
@@ -374,11 +374,9 @@ successors(#b_blk{last=Terminator}) ->
normalize(#b_set{op={bif,Bif},args=Args}=Set) ->
case {is_commutative(Bif),Args} of
- {false,_} ->
- Set;
- {true,[#b_literal{}=Lit,#b_var{}=Var]} ->
+ {true, [#b_literal{}=Lit,#b_var{}=Var]} ->
Set#b_set{args=[Var,Lit]};
- {true,_} ->
+ {_, _} ->
Set
end;
normalize(#b_set{}=Set) ->
--
2.35.3