Peter Wang
4365e00a30
Simplify nested case expressions of a specific form generated by the Erlang
...
Estimated hours taken: 3
Branches: main
Simplify nested case expressions of a specific form generated by the Erlang
backend when calling semidet procedures, where the inner case expression
returns values which is switched on by the outer case expression. We can move
code from the arms of the outer case expression into the inner case expression.
e.g.
fib_1_f_0(N_3 ) ->
(case
(begin
V_4_4 = 2 ,
(case
N_3 =< V_4_4
of
true ->
{} ;
false ->
fail
end)
end)
of
{} ->
HeadVar__2_2 = 1 ,
HeadVar__2_2 ;
_ ->
V_8_8 = 1 ,
V_7_7 = N_3 - V_8_8 ,
V_5_5 = fib_1_f_0(V_7_7 ),
V_10_10 = 2 ,
V_9_9 = N_3 - V_10_10 ,
V_6_6 = fib_1_f_0(V_9_9 ),
HeadVar__2_2 = V_5_5 + V_6_6 ,
HeadVar__2_2
end).
===>
fib_1_f_0(N_3 ) ->
V_4_4 = 2 ,
(case
N_3 =< V_4_4
of
true ->
HeadVar__2_2 = 1 ,
HeadVar__2_2 ;
false ->
V_8_8 = 1 ,
V_7_7 = N_3 - V_8_8 ,
V_5_5 = fib_1_f_0(V_7_7 ),
V_10_10 = 2 ,
V_9_9 = N_3 - V_10_10 ,
V_6_6 = fib_1_f_0(V_9_9 ),
HeadVar__2_2 = V_5_5 + V_6_6 ,
HeadVar__2_2
end).
fib is ~20% faster.
compiler/erl_code_util.m:
Add a predicate to apply the simplication above.
compiler/erl_call_gen.m:
Apply the simplication to semidet calls.
compiler/erl_code_gen.m:
Apply the simplication to disjuncts.
Unrelated change: don't wrap disjuncts with case expressions when they
are unnecessary, e.g.
case foo() of
{} -> {};
fail -> fail
end
2007-08-15 01:47:23 +00:00
..
2007-06-25 00:58:14 +00:00
2007-06-15 12:41:47 +00:00
2007-08-07 07:10:09 +00:00
2007-05-21 04:23:26 +00:00
2007-06-01 12:54:15 +00:00
2007-08-07 07:10:09 +00:00
2007-08-01 07:23:28 +00:00
2007-07-17 23:48:29 +00:00
2007-01-19 07:05:06 +00:00
2007-05-17 03:53:13 +00:00
2007-08-07 07:10:09 +00:00
2007-05-07 05:21:36 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-06-01 02:13:02 +00:00
2007-08-13 03:02:02 +00:00
2007-01-06 09:23:59 +00:00
2007-08-07 07:10:09 +00:00
2007-07-02 05:30:32 +00:00
2007-02-27 02:10:53 +00:00
2007-08-07 07:10:09 +00:00
2007-07-02 05:30:32 +00:00
2007-08-09 06:05:36 +00:00
2007-08-07 07:10:09 +00:00
2007-06-25 00:58:14 +00:00
2007-05-17 03:53:13 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 03:02:02 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-07-20 01:22:06 +00:00
2007-07-31 07:59:23 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 03:02:02 +00:00
2007-08-07 07:10:09 +00:00
2007-08-02 01:24:01 +00:00
2007-08-13 03:02:02 +00:00
2007-08-13 03:02:02 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-01-06 09:23:59 +00:00
2007-08-07 07:10:09 +00:00
2007-01-06 09:23:59 +00:00
2007-01-06 09:23:59 +00:00
2007-08-07 07:10:09 +00:00
2007-05-17 03:53:13 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-07-31 01:56:41 +00:00
2007-07-31 01:56:41 +00:00
2007-08-01 05:51:04 +00:00
2007-08-01 05:47:06 +00:00
2007-08-07 07:10:09 +00:00
2007-01-19 07:05:06 +00:00
2007-05-28 03:13:53 +00:00
2007-08-15 01:47:23 +00:00
2007-08-15 01:47:23 +00:00
2007-08-15 01:47:23 +00:00
2007-07-09 04:49:25 +00:00
2007-08-07 07:10:09 +00:00
2007-06-07 07:53:06 +00:00
2007-07-31 03:53:30 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 01:27:52 +00:00
2007-07-31 01:56:41 +00:00
2007-08-13 01:27:52 +00:00
2007-08-07 10:03:51 +00:00
2007-01-06 09:23:59 +00:00
2007-08-13 01:27:52 +00:00
2007-08-07 07:10:09 +00:00
2007-07-31 01:56:41 +00:00
2007-07-31 01:56:41 +00:00
2007-07-14 02:33:27 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 03:02:02 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-01-19 07:05:06 +00:00
2007-05-17 03:53:13 +00:00
2007-07-09 13:28:36 +00:00
2007-01-19 07:05:06 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 03:02:02 +00:00
2007-08-15 01:35:03 +00:00
2007-08-15 01:35:03 +00:00
2007-08-13 03:02:02 +00:00
2007-05-14 10:58:26 +00:00
2007-01-19 07:05:06 +00:00
2007-08-07 07:10:09 +00:00
2007-08-08 05:08:45 +00:00
2007-05-23 10:09:24 +00:00
2007-01-19 07:05:06 +00:00
2007-01-19 07:05:06 +00:00
2007-06-01 04:25:08 +00:00
2007-07-14 02:33:27 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-07-31 01:56:41 +00:00
2007-01-06 09:23:59 +00:00
2007-08-07 07:10:09 +00:00
2007-06-12 06:06:35 +00:00
2007-06-12 06:06:35 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-07-31 01:56:41 +00:00
2007-08-07 07:10:09 +00:00
2007-02-27 20:36:29 +00:00
2007-08-07 05:51:47 +00:00
2007-02-08 01:02:53 +00:00
2007-07-31 01:56:41 +00:00
2007-07-31 01:56:41 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-05-23 10:09:24 +00:00
2007-08-13 01:27:52 +00:00
2007-08-07 07:10:09 +00:00
2007-03-04 23:38:09 +00:00
2007-07-31 07:59:23 +00:00
2007-07-14 02:33:27 +00:00
2007-07-12 01:28:48 +00:00
2007-05-02 04:45:05 +00:00
2007-07-14 02:33:27 +00:00
2007-07-14 02:33:27 +00:00
2007-07-12 01:28:48 +00:00
2007-01-06 09:23:59 +00:00
2007-01-06 09:23:59 +00:00
2007-01-06 09:23:59 +00:00
2007-08-13 03:02:02 +00:00
2007-07-25 06:12:32 +00:00
2007-08-14 01:52:30 +00:00
2007-07-31 01:56:41 +00:00
2007-01-19 07:05:06 +00:00
2007-08-13 01:27:52 +00:00
2007-08-13 03:02:02 +00:00
2007-08-13 03:02:02 +00:00
2007-07-25 06:12:32 +00:00
2007-08-13 01:27:52 +00:00
2007-05-07 05:21:36 +00:00
2007-07-25 06:12:32 +00:00
2007-07-25 06:12:32 +00:00
2007-07-06 02:35:23 +00:00
2007-01-19 07:05:06 +00:00
2007-08-13 01:27:52 +00:00
2007-07-25 06:12:32 +00:00
2007-08-13 01:27:52 +00:00
2007-07-25 06:12:32 +00:00
2007-07-25 06:12:32 +00:00
2007-07-25 06:12:32 +00:00
2007-07-25 06:12:32 +00:00
2007-07-20 01:22:06 +00:00
2007-01-06 10:56:27 +00:00
2007-08-07 07:10:09 +00:00
2007-08-14 01:52:30 +00:00
2007-08-14 01:52:30 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-14 01:52:30 +00:00
2007-08-14 01:52:30 +00:00
2007-08-14 01:52:30 +00:00
2007-07-25 06:12:32 +00:00
2007-07-25 06:12:32 +00:00
2007-01-19 07:05:06 +00:00
2007-07-31 01:56:41 +00:00
2007-07-31 01:56:41 +00:00
2007-08-13 03:02:02 +00:00
2007-07-31 05:02:13 +00:00
2007-08-08 16:41:22 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-01-19 07:05:06 +00:00
2007-02-09 04:05:18 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-01-06 09:23:59 +00:00
2007-08-07 07:10:09 +00:00
2007-01-23 07:00:38 +00:00
2007-08-07 07:10:09 +00:00
2007-07-02 05:30:32 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 01:27:52 +00:00
2007-01-19 07:05:06 +00:00
2007-08-13 03:02:02 +00:00
2007-08-13 03:02:02 +00:00
2007-06-14 02:24:40 +00:00
2007-07-25 06:12:32 +00:00
2007-05-01 06:31:26 +00:00
2007-07-14 02:33:27 +00:00
2007-01-19 07:05:06 +00:00
2007-05-30 03:49:50 +00:00
2007-07-25 06:12:32 +00:00
2007-01-19 07:05:06 +00:00
2007-01-19 07:05:06 +00:00
2007-07-31 05:02:13 +00:00
2007-07-25 06:12:32 +00:00
2007-08-06 12:50:25 +00:00
2007-08-09 03:45:54 +00:00
2007-08-07 07:10:09 +00:00
2007-08-09 05:28:26 +00:00
2007-01-19 07:05:06 +00:00
2007-08-07 07:10:09 +00:00
2007-01-19 07:05:06 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-20 08:09:53 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-23 05:06:15 +00:00
2007-07-31 01:56:41 +00:00
2007-05-23 10:09:24 +00:00
2007-01-19 07:05:06 +00:00
2007-01-19 07:05:06 +00:00
2007-07-25 06:12:32 +00:00
2007-05-22 00:58:00 +00:00
2007-05-22 00:58:00 +00:00
2007-08-15 01:35:03 +00:00
2007-08-07 07:10:09 +00:00
2007-08-09 05:28:26 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-05-23 09:41:49 +00:00
2007-05-07 06:59:24 +00:00
2007-05-30 08:16:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 03:02:02 +00:00
2007-08-07 07:10:09 +00:00
2007-01-19 07:05:06 +00:00
2007-07-31 01:56:41 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-01-06 09:23:59 +00:00
2007-05-17 03:53:13 +00:00
2007-01-06 09:23:59 +00:00
2007-08-07 07:10:09 +00:00
2007-05-23 09:41:49 +00:00
2007-08-02 01:24:01 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-01-06 09:23:59 +00:00
2007-05-17 03:53:13 +00:00
2007-08-07 07:10:09 +00:00
2007-08-02 01:24:01 +00:00
2007-01-19 07:05:06 +00:00
2007-08-07 07:10:09 +00:00
2007-01-06 09:23:59 +00:00
2007-08-15 01:35:03 +00:00
2007-01-19 07:05:06 +00:00
2007-01-06 09:23:59 +00:00
2007-08-07 07:10:09 +00:00
2007-05-23 10:09:24 +00:00
2007-07-03 04:27:58 +00:00
2007-05-17 03:53:13 +00:00
2007-08-07 07:10:09 +00:00
2007-05-17 03:53:13 +00:00
2007-08-07 07:10:09 +00:00
2007-05-23 10:09:24 +00:00
2007-05-31 08:12:53 +00:00
2007-05-15 02:38:23 +00:00
2007-08-07 07:10:09 +00:00
2007-05-02 02:16:02 +00:00
2007-08-07 07:10:09 +00:00
2007-01-19 07:05:06 +00:00
2007-05-23 00:17:23 +00:00
2007-01-19 07:05:06 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-13 03:02:02 +00:00
2007-08-09 05:28:26 +00:00
2007-05-17 03:53:13 +00:00
2007-05-14 08:20:17 +00:00
2007-08-07 07:10:09 +00:00
2007-05-14 08:20:17 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-14 01:52:30 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-08-07 07:10:09 +00:00
2007-05-17 03:53:13 +00:00
2007-07-31 01:56:41 +00:00
2007-07-09 13:28:36 +00:00
2007-01-06 09:23:59 +00:00
2007-02-27 20:36:29 +00:00
2007-02-27 20:36:29 +00:00
2007-02-27 20:36:29 +00:00
2007-05-23 10:09:24 +00:00