Skip to content
Browse files
Don't run unsafe compiler passes
As a preparation for replacing v3_codegen with a new code generator,
remove unsafe optimization passes. Especially the older compiler
passes have implicit assumptions about how the code is generated.

Remove the optimizations in beam_block (keep the code that creates
blocks) because they are unsafe. beam_block also calls
beam_utils:live_opt/1, which is unsafe.

Remove beam_type because it calls beam_utils:live_opt/1, and also
because it recalculates the number of heaps words and number of live
registers in allocation instructions, thus potentially hiding bugs in
other passes.

Remove beam_receive because it is unsafe.

Remove beam_record because it is the only remaining user
of beam_utils:anno_defs/1.

Remove beam_reorder because it makes much more sense to run it
as an early SSA-based optimization pass.

Remove the now unused functions in beam_utils:


Note that the following test cases will fail because of the
removed optimizations:

  • Loading branch information
bjorng committed Aug 17, 2018
1 parent 6065d9f commit 3fc40fd
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1,198 deletions.
@@ -61,12 +61,8 @@ MODULES = \
beam_listing \
beam_opcodes \
beam_peep \
beam_receive \
beam_reorder \
beam_record \
beam_split \
beam_trim \
beam_type \
beam_utils \
beam_validator \
beam_z \

0 comments on commit 3fc40fd

Please sign in to comment.