aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-01-25Merge pull request #2106 from bjorng/bjorn/compiler/fewer-movesBjörn Gustavsson
Reduce redundant moves and register shuffling
2019-01-25Merge pull request #2104 from bjorng/bjorn/compiler/ssa-opt-tail-phisBjörn Gustavsson
Introduce optimizations of tail building
2019-01-24Merge branch 'maint'Rickard Green
* maint: Pluggable distribution socket implementation for EI
2019-01-24Merge branch 'rickard/ei-ext-maint/OTP-15442' into maintRickard Green
* rickard/ei-ext-maint/OTP-15442: Pluggable distribution socket implementation for EI
2019-01-24Merge branch 'maint'Sverker Eriksson
2019-01-24Merge PR-2103 from sverker/ets-iteration-doc/OTP-15545Sverker Eriksson
Clarify ETS docs about table iterations
2019-01-24stdlib: Clarify ets docs about table iterationsSverker Eriksson
2019-01-24Introduce optimizations of tail phisBjörn Gustavsson
Try to eliminate short blocks that starts with a phi node and end in a return. For example: Result = phi { Res1, 4 }, { literal true, 5 } Ret = put_tuple literal ok, Result ret Ret The code in this block can be inserted at the end blocks 4 and 5. Thus, the following code can be inserted into block 4: Ret:1 = put_tuple literal ok, Res1 ret Ret:1 And the following code into block 5: Ret:2 = put_tuple literal ok, literal true ret Ret:2 Which can be further simplified to: ret literal {ok, true} This transformation may lead to more code improvements, for example: * Stack trimming * Fewer test_heap instructions * Smaller stack frames
2019-01-24Merge pull request #2100 from jhogberg/john/compiler/module-type-optimizationJohn Högberg
Apply type optimizations across local function calls
2019-01-24compiler: Introduce module-level type optimizationJohn Högberg
This commit lets the type optimization pass work across functions, tracking return and argument types to eliminate redundant tests.
2019-01-24beam_ssa_opt: Add a scaffold for module-level optimizationsJohn Högberg
This serves as a base for the upcoming module-level type optimization, but may come in handy for other passes like beam_ssa_funs and beam_ssa_bsm that have their own ad-hoc implementations.
2019-01-24Reduce redundant moves and register shufflingBjörn Gustavsson
Consider this function and its corresponding BEAM code: foo(Map, Key) -> Val = case Map of #{Key:=Val0} -> Val0; _ -> default end, bar(1, 2, Val). {label,2}. {test,is_map,{f,3},[{x,0}]}. {get_map_elements,{f,3},{x,0},{list,[{x,1},{x,0}]}}. ^^^^^ {jump,{f,4}}. {label,3}. {move,{atom,default},{x,0}}. ^^^^^ {label,4}. {move,{integer,2},{x,1}}. {move,{x,0},{x,2}}. ^^^^^ {move,{integer,1},{x,0}}. {call_only,3,{f,6}}. Note that the value of the variable `Val` will first be placed in `{x,0}` and then moved to `{x,2}` where it needs to be when calling the `bar/3` function. The reason for the extra `move` instruction is that the register allocator picks the lowest numbered available register when choosing a register to put a variable in. In this case, `{x,0}` will be chosen. If we only could give a hint to the register allocator that it would be better to put `Val` in `{x,2}`, the extra `move` would disappear: {label,2}. {test,is_map,{f,3},[{x,0}]}. {get_map_elements,{f,3},{x,0},{list,[{x,1},{x,2}]}}. {jump,{f,4}}. {label,3}. {move,{atom,default},{x,2}}. {label,4}. {move,{integer,2},{x,1}}. {move,{integer,1},{x,0}}. {call_only,3,{f,6}}. There already is an existing sub pass (`reserve_regs`) in `beam_ssa_pre_codegen` that among things tries to give the register allocator hints that some variables should be placed in specific registers, if possible. However, the existing hinting mechanism is limited, essentially only working within a single SSA block. This commit extends the hinting mechanism, allowing hints to be passed across SSA blocks, eliminating `move` instructions and register shuffling in many places. (494 modules out of a sample of 1236 modules were changed by this commit.)
2019-01-23Merge branch 'rickard/ei-ext/OTP-15442' into rickard/ei-ext-maint/OTP-15442Rickard Green
2019-01-23Pluggable distribution socket implementation for EIRickard Green
2019-01-23Merge branch 'maint'Ingela Anderton Andin
2019-01-23Merge branch 'ingela/inets/httpc-ipv6-brackets/OTP-15544' into maintIngela Anderton Andin
* ingela/inets/httpc-ipv6-brackets/OTP-15544: inets: httpc - Do not use bracked addresses to gen_tcp or ssl calls
2019-01-23inets: httpc - Do not use bracked addresses to gen_tcp or ssl callsIngela Anderton Andin
2019-01-23Merge branch 'maint'Lukas Larsson
2019-01-23Merge branch 'lukas/erts/set_logger_process/OTP-15375' into maintLukas Larsson
* lukas/erts/set_logger_process/OTP-15375: erts: Fix type of system_logger variable
2019-01-23erts: Fix type of system_logger variableLukas Larsson
2019-01-23Merge branch 'bjorn/erts/optimize-is_function2'Björn Gustavsson
* bjorn/erts/optimize-is_function2: Optimize the is_function/2 guard test
2019-01-23beam_ssa_pre_codegen: Use lists:splitwith/2 for separating phi nodesBjörn Gustavsson
Use lists:splitwith/2 instead of lists:partition/2 for splitting out phi nodes. Since phi nodes are always the first instructions in a block, the result will be the same, but splitwith/2 is faster.
2019-01-23Merge branch 'maint'Lukas Larsson
2019-01-23Merge branch 'maint'Ingela Anderton Andin
Conflicts: lib/ssl/src/tls_connection.erl
2019-01-23Merge branch 'lukas/erts/scheduler-pollset-fixes/OTP-15538' into maintLukas Larsson
* lukas/erts/scheduler-pollset-fixes/OTP-15538: erts: Fix getting of poll events on linux >= 4.15.0 erts: Use reduction based polling for starved poll-set erts: Fix pollset test cases
2019-01-23Merge branch 'lukas/erts/fix_spawn_driver_early_close/OTP-15537' into maintLukas Larsson
* lukas/erts/fix_spawn_driver_early_close/OTP-15537: erts: Fix too early close of spawn driver fd
2019-01-23Merge branch 'lukas/erts/fix_inet_multitimer_cleanup/OTP-15536' into maintLukas Larsson
* lukas/erts/fix_inet_multitimer_cleanup/OTP-15536: erts: Fix cleanup of the inet MultiTimer
2019-01-23Merge branch 'ingela/ssl/continue-optimize/OTP-15445' into maintIngela Anderton Andin
* ingela/ssl/continue-optimize/OTP-15445: ssl: If possible assemble several received application data records
2019-01-22Merge pull request #2089 from richcarl/document-undefined-current_functionRickard Green
Document that current_function can be undefined OTP-15543
2019-01-22Merge branch 'maint'Sverker Eriksson
2019-01-22Merge branch 'sverker/fix-since-clauses/OTP-15460' into maintSverker Eriksson
* sverker/fix-since-clauses/OTP-15460: Fix "since" for all multi clause functions
2019-01-22ssl: If possible assemble several received application data recordsIngela Anderton Andin
2019-01-22Merge branch 'maint'Ingela Anderton Andin
Conflicts: lib/ssl/src/ssl_connection.erl lib/ssl/src/ssl_connection.hrl lib/ssl/src/tls_connection.erl
2019-01-22Merge pull request #2086 from disappearer/improve-mnesia-start-docsDan Gudmundsson
Specify that mnesia:start/0 is async
2019-01-22Merge branch 'ingela/ssl/hs-env-start' into maintIngela Anderton Andin
* ingela/ssl/hs-env-start: ssl: Create hs_env ssl: Remove unnecessary iolist_to_binary
2019-01-22ssl: Create hs_envIngela Anderton Andin
We want to decrease the size of the outer state tuple, and gain ease of understanding by better grouping. This is the first step of creating a hs_env (handshake environment) part of the state. This change will be performed gradually to reduce merge conflicts complexity and risk of introducing errors.
2019-01-22ssl: Remove unnecessary iolist_to_binaryIngela Anderton Andin
2019-01-22erts: Fix cleanup of the inet MultiTimerLukas Larsson
2019-01-22Merge branch 'maint'Ingela Anderton Andin
2019-01-22Merge branch 'ingela/ssl/test-cuddle' into maintIngela Anderton Andin
* ingela/ssl/test-cuddle: ssl: Correct test input
2019-01-21ssl: Correct test inputIngela Anderton Andin
2019-01-21Merge branch 'maint'Siri Hansen
2019-01-21Merge branch 'siri/logger/erts-and-remote-log-olp' into maintSiri Hansen
* siri/logger/erts-and-remote-log-olp: [logger] Update bench marks to report percent instead of 0.XX [logger] Minor fix in logger_olp_SUITE to avoid error in end_per_testcase [logger] Remove info and reset functions from handler modules [logger] Remove some unused variable warnings [logger] Store proxy config in logger ets table [logger] Log mode change and flushes in logger_proxy [logger] Move out overload protection macros from logger_h_common.hrl [logger] Allow logger_olp callbacks to return {stop,...} Add logger_stress_SUITE to benchmarks spec [logger] Add idle timer in logger_olp [logger] Use persistent_term for storing proxy reference Update preloaded Use system_time instead of monotonic_time in log events [logger] Add test for restart of logger proxy [logger] Add API function for configuring logger proxy [logger] Add logger_stress_SUITE [logger] Add tests for logger_proxy [logger] Overload protect logging from erts and remote nodes [logger] Split overload protection functionality to own module
2019-01-21beam_ssa_opt: Don't ruin arguments of bs_match/skipJohn Högberg
If the match instruction was already marked as a skip, we'd ruin its argument list.
2019-01-21Optimize the is_function/2 guard testBjörn Gustavsson
The is_function2 instruction is executed surprisingly frequently when running dialyzer or the compiler. It cannot hurt to optimize it a little.
2019-01-21Merge pull request #2048 from essen/cover-output-line-linksSiri Hansen
Add a link on the line number in cover output OTP-15541
2019-01-21Merge pull request #2030 from yakubovsky/patch-1Siri Hansen
Fix encrypt_config_file and decrypt_config_file OTP-15540
2019-01-21Merge branch 'raimo/stdlib/gen_statem-optimization/OTP-15452'Raimo Niskanen
* raimo/stdlib/gen_statem-optimization/OTP-15452: correct: Work around a compiler mis-optimization
2019-01-21correct: Work around a compiler mis-optimizationRaimo Niskanen
This was not a compiler optimization that misfired, rather that the code neede separate case clauses for when the timer was running and not, so to not call erlang:cancel_timer/1 nor maps:remove/2 in the case clause where only a map update was needed before recursion. See the comment in loop_timouts_cancel/13
2019-01-21Merge branch 'maint'Ingela Anderton Andin