aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
AgeCommit message (Collapse)Author
2017-11-30Clean up collection of basic blocksBjörn Gustavsson
2017-11-29v3_codegen: Remove check of operand for bs_context_to_binaryBjörn Gustavsson
The bs_context_to_binary instruction only allows a register operand. v3_codegen has a test to ensure that the operand is a register. That test is no longer necessary. There used to be a possibility that optimizations in sys_core_fold and the inliner could change the operand for bs_context_to_binary to a binary literal. Since 09112806c15a81b that can no longer happen, because no more optimizations are run after the introduction of the bs_context_to_binary instruction.
2017-11-27beam_jump: Eliminate a repeated clauseBjörn Gustavsson
This clause seems to have been introduced in cac51274eb9a.
2017-11-27beam_asm: No longer allow iolists as contents in chunk/2Björn Gustavsson
The clause that converted an iolist to a binary was never executed. Note that chunk/2 is called for all chunks in the {extra_chunks,Chunks} option. This change will enforce that the contents of each chunk must be a binary (as documented).
2017-11-27beam_utils_SUITE: Cover more lines in beam_utilsBjörn Gustavsson
2017-11-27guard_SUITE: Add a test case to cover beam_dead:turn_op/1Björn Gustavsson
f9a323d10a9f5d added consistent operand order for equality comparisons. As a result, beam_dead:turn_op/1 is no longer covered. We must keep the uncovered lines in beam_dead to ensure that beam_dead can handle BEAM assembly code from another source than v3_codegen that might not follow the operand order convention. The only way to cover the lines is to use BEAM assembly in the test case.
2017-11-27Recognize 'nil' as a literal in beam_utils:bif_to_test/3Björn Gustavsson
beam_utils:bif_to_test/3 is supposed to never put a literal operand as the first operand in is_eq_exact or is_ne_exact, but 'nil' was not recognized as a literal.
2017-11-27Cover more code in beam_bsm:btb_opt_1/3Björn Gustavsson
2017-11-27Add test to cover a line in v3_kernel:opt_single_valued/3Björn Gustavsson
The uncovered line was added in 6753bbcc3fdb0.
2017-11-27Merge pull request #1545 from michalmuskala/move-optBjörn Gustavsson
Place move S x0 instructions at the end of blocks
2017-11-23Place move S x0 instructions at the end of blocksMichał Muskała
The loader has a lot of fused instructions that include move S x0. Placing them at the end of blocks makes it possible to take advantage of this optimization more frequently.
2017-11-22Fix broken to_dis after merge from maint to masterBjörn Gustavsson
d8d07a7593d811 that added the to_dis option to the compiler no longer works when merged to master. That is because of 79f28cfd8df1b7 that removed some unused code in erts_debug. Fix this by adding a new function erts_debug:dis_to_file/2 and use it from compile module where we have access to the filename (in beam_listing we only have an opened file).
2017-11-20Merge branch 'maint'Lukas Larsson
Conflicts: lib/compiler/src/beam_listing.erl
2017-11-20Merge branch 'lukas/compiler/add_to_dis/OTP-14784' into maintLukas Larsson
* lukas/compiler/add_to_dis/OTP-14784: compiler: Add +to_dis option that dumps loaded asm
2017-11-20compiler: Add +to_dis option that dumps loaded asmLukas Larsson
2017-11-20Merge branch 'maint'Lukas Larsson
2017-11-20Merge branch 'lukas/docs/xmllint_fixes/OTP-14721' into maintLukas Larsson
* lukas/docs/xmllint_fixes/OTP-14721: ssl/ssh: Remove/ignore unused XML_FILES doc files Refactor xmllint check and make it fail on failure Add toplevel xmllint make target Conflicts: lib/crypto/doc/src/Makefile
2017-11-16Merge branch 'maint'Hans Nilsson
2017-11-16Merge branch 'maint-18' into maintHans Nilsson
* maint-18: Updated OTP version Prepare release ssh: Unicode encoding fix ssh: testcases for space trailing Hello msg Remove unused test include file from test suites eldap: Repair Makefile ssh: Don't remove trailing WS in Hello msg Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/vsn.mk lib/compiler/doc/src/notes.xml lib/compiler/vsn.mk lib/crypto/test/blowfish_SUITE.erl lib/eldap/doc/src/notes.xml lib/eldap/vsn.mk lib/inets/test/httpd_load.erl lib/inets/test/httpd_mod.erl lib/inets/test/old_httpd_SUITE.erl lib/ssh/doc/src/notes.xml lib/ssh/vsn.mk lib/stdlib/test/zip_SUITE.erl otp_versions.table
2017-11-15Prepare releaseErlang/OTP
2017-11-15Merge branch ↵Erlang/OTP
'john/compiler/fail-labels-in-blocks-otp-18/ERIERL-48/OTP-14522' into maint-18 * john/compiler/fail-labels-in-blocks-otp-18/ERIERL-48/OTP-14522: compiler: Fix live regs update on allocate in validator Take fail labels into account when determining liveness in block ops
2017-11-13Merge branch 'maint'Björn Gustavsson
* maint: Recognize 'deterministic' when given in a -compile() attribute Conflicts: lib/compiler/src/beam_asm.erl
2017-11-10Merge branch 'bjorn/cuddle-with-tests'Björn Gustavsson
* bjorn/cuddle-with-tests: Skip compile_SUITE:pre_load_check/1 when code is native-compiled
2017-11-10Recognize 'deterministic' when given in a -compile() attributeBjörn Gustavsson
The compiler option 'deterministic' was only recognized when given as an option to the compiler, not when it was specified in a -compile() attribute in the source file. https://bugs.erlang.org/browse/ERL-498
2017-11-09Merge pull request #1609 from bjorng/bjorn/compiler/add-internal_docBjörn Gustavsson
Add some internal documentation about cerl_clauses
2017-10-31Refactor xmllint check and make it fail on failureLukas Larsson
This commit also adds a check to see that all files that are part of an xi:include also have part of XML_FILES and vice versa. It also fixes any applications where this was not true.
2017-10-27Eliminate the v3_life passBjörn Gustavsson
The v3_life pass does not do enough to be worth being its own pass. Essentially it does two things: * Calculates life-time information starting from the annotations that v3_kernel provides. That part can be moved into v3_codegen. * Rewrites the Kernel Erlang records to similar plain tuples (for example, #k_cons{hd=Hd,tl=Tl} is rewritten to {cons,Hd,Tl}). That rewriting is not needed and can be eliminated.
2017-10-26Skip compile_SUITE:pre_load_check/1 when code is native-compiledBjörn Gustavsson
Tracing won't work on modules that are native-compiled.
2017-10-26Add some internal documentation about cerl_clausesBjörn Gustavsson
I recently tried to add some additional optimizations for matching of maps, but found out that the inliner will need some updates to be able to handle those optimizations. Add lib/compiler/internal_doc/cerl-notes.md to document what I've learned.
2017-10-21Optimize matching of literals for single-valued typesBjörn Gustavsson
If a type only has one clause and if the pattern is literal, the matching can be done more efficiently by directly comparing with the literal. Example: find(String, "") -> String; find(String, <<>>) -> String; find(String, SearchPattern) -> . . . Without this optimization, the relevant part of the code would look this: {test,bs_start_match2,{f,3},2,[{x,1},0],{x,2}}. {test,bs_test_tail2,{f,4},[{x,2},0]}. return. {label,3}. {test,is_nil,{f,4},[{x,1}]}. return. {label,4}. . . . That is, if {x,1} is a binary, a match context will be built to test whether {x,1} is an empty binary. With the optimization, the code will look this: {test,is_eq_exact,{f,3},[{x,1},{literal,<<>>}]}. return. {label,3}. {test,is_nil,{f,4},[{x,1}]}. return. {label,4}. . . .
2017-10-13Merge pull request #1596 from bjorng/bjorn/enhance-try-catchBjörn Gustavsson
(Slightly) optimize catch and try/catch OTP-14683
2017-10-11Optimize a catch whose return value is ignoredBjörn Gustavsson
Rewrite a catch expression like this: catch side_effect(), ... to: try side_effect() catch _:_ -> ok end, ... A try/catch is more efficient since no stack trace will be built when an exception occurs.
2017-10-11Do the receive optimization in the presence of try/catchBjörn Gustavsson
Improve the receive optimization to be able to handle code such as this: Ref = make_ref(), try side_effect() catch _:_ -> ok end, receive %% Clauses that all match Ref. . . . end
2017-10-11Optimize try/catch that ignores the return valueBjörn Gustavsson
If a try/catch is used to ignore the potential exception caused by some expression with a side effect such as: try side_effect() catch _Class:_Reason -> ok end, . . . the generated code will be wasteful: try YReg TryLabel %% call side_effect() here try_end Yreg jump GoodLabel TryLabel: try_case YReg %% try_case has set up registers as follows: %% x(0) -> error | exit | throw %% x(1) -> reason %% x(2) -> raw stack trace data GoodLabel: %% This code does not use any x registers. There will be two code paths that both end up at GoodLabel, and the try_case instruction will set up registers that are never used. We can do better by replacing try_case with try_end to obtain this code: try YReg TryLabel %% call side_effect() here try_end Yreg jump GoodLabel TryLabel: try_end YReg GoodLabel: The jump optimizer (beam_jump) can further optimize this code like this: try YReg TryLabel %% call side_effect() here TryLabel: try_end YReg
2017-10-10Merge branch 'maint'Lars Thorsen
2017-10-10Merge branch 'lars/doc-cleanup/OTP-14475' into maintLars Thorsen
* lars/doc-cleanup/OTP-14475: [edoc] Remove unused module otpsgml_layout.erl Remove unused files from the documentation build
2017-10-05Merge branch 'maint'Rickard Green
* maint: Updated OTP version Update release notes Update version numbers
2017-10-05Merge branch 'maint-19' into maintRickard Green
* maint-19: Updated OTP version Update release notes Update version numbers Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/vsn.mk lib/compiler/doc/src/notes.xml lib/compiler/vsn.mk otp_versions.table
2017-10-05Update release notesErlang/OTP
2017-10-05Update version numbersErlang/OTP
2017-10-03Merge branch 'maint'Hans Nilsson
* maint: Updated OTP version Prepare release Fix zlib merge snafu ssh: fix broken printouts ssh: exclude aes_gcm if peer is OpenSSH 6.2 (known bug) Conflicts: OTP_VERSION
2017-10-02Prepare releaseErlang/OTP
2017-10-02Merge pull request #1546 from michalmuskala/bs-add-optBjörn Gustavsson
Optimise size calculation for binary construction OTP-14654
2017-10-01Merge branch 'maint'Björn Gustavsson
* maint: Fix incorrect internal consistency failure for binary matching code
2017-09-29Fix incorrect internal consistency failure for binary matching codeBjörn Gustavsson
4c31fd0b9665 made the merging of match contexts stricter; in fact, a little bit too strict. Two match contexts with different number of slots would be downgraded to the 'term' type. The correct way is to keep the match context but set the number of slots to the lowest number of slots of the two match contexts. https://bugs.erlang.org/browse/ERL-490
2017-09-28Remove unused files from the documentation buildLars Thorsen
2017-09-26Merge branch 'maint'Henrik Nord
2017-09-22Update release notesErlang/OTP
2017-09-22Update version numbersErlang/OTP
2017-09-15Merge branch 'siri/string-new-api'Siri Hansen
* siri/string-new-api: (28 commits) hipe (test): Do not use deprecated functions in string(3) dialyzer (test): Do not use deprecated functions in string(3) eunit (test): Do not use deprecated functions in string(3) system (test): Do not use deprecated functions in string(3) system (test): Do not use deprecated functions in string(3) mnesia (test): Do not use deprecated functions in string(3) Deprecate old string functions observer: Do not use deprecated functions in string(3) common_test: Do not use deprecated functions in string(3) eldap: Do not use deprecated functions in string(3) et: Do not use deprecated functions in string(3) os_mon: Do not use deprecated functions in string(3) debugger: Do not use deprecated functions in string(3) runtime_tools: Do not use deprecated functions in string(3) asn1: Do not use deprecated functions in string(3) compiler: Do not use deprecated functions in string(3) sasl: Do not use deprecated functions in string(3) reltool: Do not use deprecated functions in string(3) kernel: Do not use deprecated functions in string(3) hipe: Do not use deprecated functions in string(3) ... Conflicts: lib/eunit/src/eunit_lib.erl lib/observer/src/crashdump_viewer.erl lib/reltool/src/reltool_target.erl