aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
AgeCommit message (Collapse)Author
2017-01-12Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Compact 'file' annotations in Core code dialyzer: Try to reduce memory usage dialyzer: Use less memory when translating contracts dialyzer: Use maps instaed of dict dialyzer: Use maps instead of dict for module contracts map dialyzer: Compress a few more ETS tables dialyzer: Optimize memory consumption dialyzer: Reduce memory consumption during 'remote' phase dialyzer: Update code for finding parallelism compiler: Do not spawn process when dialyzing dialyzer: Reduce ETS usage during the typesig phase dialyzer: Optimize graph condensation dialyzer: Do not send full PLTs as messages
2017-01-11dialyzer: Use maps instaed of dictHans Bolinder
2017-01-11Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Fix check of parameterized opaque types Conflicts: lib/hipe/cerl/erl_types.erl
2017-01-11Merge branch 'hasse/dialyzer/fix_opaque_parms/OTP-14130' into maintHans Bolinder
* hasse/dialyzer/fix_opaque_parms/OTP-14130: dialyzer: Fix check of parameterized opaque types
2017-01-10Merge branch 'maint'Hans Bolinder
* maint: stdlib: Allow characters in types and constant patterns
2017-01-10dialyzer: Fix check of parameterized opaque typesHans Bolinder
Two parameters used to be "compatible" if one is a specialization of the other, in the way that the input type of t_limit() is a specialization of the output type. This check is now relaxed: any() in any of the two parameters is compatible with any type of the other parameter. The change is due to bugus warnings. A clause for maps has been added.
2016-12-21stdlib: Allow characters in types and constant patternsHans Bolinder
Characters ($char) can be used in constant pattern expressions. They can also be used in types and contracts.
2016-12-16Merge branch 'maint'Sverker Eriksson
2016-12-16Merge pull request #1270 from kostis/hipe-testSverker Eriksson
hipe: one more test file and some cleanups
2016-12-14Merge tag 'OTP-19.2'Dan Gudmundsson
=== OTP-19.2 === Changed Applications: - common_test-1.13 - compiler-7.0.3 - crypto-3.7.2 - dialyzer-3.0.3 - edoc-0.8.1 - erl_docgen-0.6.1 - erl_interface-3.9.2 - erts-8.2 - eunit-2.3.2 - hipe-3.15.3 - inets-6.3.4 - kernel-5.1.1 - mnesia-4.14.2 - observer-2.3 - odbc-2.12 - parsetools-2.1.4 - public_key-1.3 - runtime_tools-1.11 - sasl-3.0.2 - ssh-4.4 - ssl-8.1 - stdlib-3.2 - syntax_tools-2.1.1 - tools-2.9 - wx-1.8 Unchanged Applications: - asn1-4.0.4 - cosEvent-2.2.1 - cosEventDomain-1.2.1 - cosFileTransfer-1.2.1 - cosNotification-1.2.2 - cosProperty-1.2.1 - cosTime-1.2.2 - cosTransactions-1.3.2 - debugger-4.2.1 - diameter-1.12.1 - eldap-1.2.2 - et-1.6 - gs-1.6.2 - ic-4.4.2 - jinterface-1.7.1 - megaco-3.18.1 - orber-3.8.2 - os_mon-2.4.1 - otp_mibs-1.1.1 - percept-0.9 - reltool-0.7.2 - snmp-5.2.4 - typer-0.9.11 - xmerl-1.3.12 * tag 'OTP-19.2': Updated OTP version Prepare release Conflicts: OTP_VERSION
2016-12-09Prepare releaseErlang/OTP
2016-12-07Update copyright-yearErlang/OTP
2016-12-06Add some tests for numeric BIFsKostis Sagonas
2016-12-06Substitute export_all with proper exportKostis Sagonas
2016-11-25Merge branch 'richarl/fix-license-headers/PR-788'Björn Gustavsson
* richarl/fix-license-headers/PR-788: Make use of the Header feature in yecc Remove Emacs timestamp markers Remove obsolete CVS keyword markup Update obsolete author e-mails Replace broken example URL Add missing entries to COPYRIGHT file Correct copyright on stdlib files Add license headers to hipe files in kernel Correct copyright info on typer files Correct copyright and license on dialyzer files Correct copyright on remaining hipe files Correct copyright info on hipe cerl files Correct copyright info on cerl-related files Correct the copyright info in docgen_edoc_xml_cb Update Syntax Tools license headers Remove some obsolete files Update EDoc license headers to dual Apache2/LGPL Update EUnit license headers to dual Apache2/LGPL
2016-11-23Remove Emacs timestamp markersRichard Carlsson
2016-11-23Remove obsolete CVS keyword markupRichard Carlsson
2016-11-23Update obsolete author e-mailsRichard Carlsson
2016-11-23Correct copyright on remaining hipe filesRichard Carlsson
2016-11-23Correct copyright info on hipe cerl filesRichard Carlsson
2016-11-23Merge branch 'maint'Sverker Eriksson
2016-11-23Merge branch 'margnus1/hipe-call-elim-crash/PR-1253/OTP-13965' into maintSverker Eriksson
* margnus1/hipe-call-elim-crash/PR-1253: hipe_icode_call_elim: Fix cf elimination crash hipe: Improve error message on internal crashes
2016-11-23Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Substitute 'opacity' for 'opaqueness' dialyzer: Improve a warning message dialyzer: Improve a warning message dialyzer: Correct a warnings message
2016-11-22dialyzer: Substitute 'opacity' for 'opaqueness'Hans Bolinder
Suggested by Kostis.
2016-11-19hipe_icode_call_elim: Fix cf elimination crashMagnus Lång
hipe_icode_call_elim could in some cases replace an #icode_call{} with control flow with a move instruction. This would break the control flow graph invariants and cause a crash.
2016-11-19hipe: Improve error message on internal crashesMagnus Lång
Print the MFA/module being compiled, and pretty-print the backtrace with lib:format_stacktrace/4. Additionally, make the error_msg/2 macro in hipe.hrl respect the HIPE_LOGGING define, since messages produced by this macro just before runtime shutdown were sometimes lost (since code_server:error_msg/2 is asynchronous).
2016-11-16hipe_x86: Fix encoding of test instr w/ neg immMagnus Lång
Also, use byte form for immediates up to 255, since there's no sign extension in byte form. HiPE seems to never generate negative test immediates currently, but we should at least not output incorrect encodings.
2016-11-16hipe_tagscheme: Simplify test_two_fixnums with immMagnus Lång
test_two_fixnums would previously only check its right-hand argument for immediates, but not it's left. Now, test_two_fixnums reduces to test_fixnum if either argument is an immediate.
2016-11-16hipe_icode: Always const-propagate if&call argsMagnus Lång
2016-11-16hipe_tagscheme: x86 lea+test for mask_and_compareMagnus Lång
By changing mask_and_compare from and,sub to sub,and, x86 can use a 3-address LEA immediate add, saving a mov. The RISC backends should see no change in sequence length. We make test_(heap_|sub)binary use mask_and_compare so they will benefit too.
2016-11-16hipe_tagscheme: Improve fixnum_addsub with immMagnus Lång
The addsub sequence was suboptimal when one of the arguments was immediate, because it became an immediate alu followed by an immediate alub, and the optimisers would not combine them due to the risk of altering the branch. However, in this case we know that such a rewrite is safe, and do it directly in hipe_tagscheme:fixnum_addsub/5 instead.
2016-11-16hipe: Make realloc_binary fast case true branchMagnus Lång
This makes the fast case a fallthrough and the slow case a branch, hopefully improving cache locality.
2016-11-16hipe_x86_postpass: Negate conditions in goto elimMagnus Lång
2016-11-16hipe_tagscheme: Improve fixnum add on x86Magnus Lång
With the introduction of immediate adds encoded as 'LEA' on x86, it is now possible to do a fixnum add in two instructions and one branch by commuting the addition and reusing the result register as a temporary, which makes the 'alub' a 2-address add, saving a move instruction.
2016-11-15hipe_rtl_to_x86: Use LEA only for immediate addsMagnus Lång
It seems that most 3-address adds of temps can be move coalesced. Therefore, we limit the behaviour added by 1567585dda8 to only affect immediate adds. Also, add conversion of immediate mov+sub to lea.
2016-11-15hipe_x86: LeaToAdd peephole ruleMagnus Lång
Although LEA is useful for three-address form adds, sometimes it is used where a normal add would have sufficed (due to the addition being the last use of one of the operands; but RTL lowering does not know that as it does not have liveness information). As a workaround, we convert LEA back to ADD when the destination is the same as one of the operands.
2016-11-15hipe_sparc: move coalescingMagnus Lång
2016-11-15hipe_ppc: better rlwinm ppMagnus Lång
2016-11-15hipe_ppc: move coalescingMagnus Lång
2016-11-15hipe_rtl: drop alub dest when unusedMagnus Lång
2016-11-15hipe_rtl: unify branch and alubMagnus Lång
branch and alub overlap in their use cases, but the backends rely on knowing that the result is unused in their lowering of branch. By extending alub so that the destination is optional, it can fully replace branch. This simplifies rtl by reducing code duplication and the number of instructions. Also, in the x86 and arm backends, we can now use 'test' and {'tst','mvn','teq'} to lower some alubs without destinations. This is particularly good for x86, as sequences such as 'is_boxed' type tests now get shorter (both from not needing a mov to copy the variable, but also from the fact that 'testb' encodes shorter than 'andq').
2016-11-15hipe_x86: Fix&activate ElimCmp0 peephole ruleMagnus Lång
2016-11-15hipe_{x86,amd64}: Finish test instr implementationMagnus Lång
2016-11-10Merge branch 'maint'Sverker Eriksson
# Conflicts: # lib/hipe/llvm/hipe_rtl_to_llvm.erl
2016-11-10Merge branch 'margnus1/hipe_llvm39_bugs/PR-1237/OTP-14027/OTP-14028' into maintSverker Eriksson
* margnus1/hipe_llvm39_bugs/PR-1237: hipe_rtl_to_llvm: Constants for bits per byte/word hipe_llvm: Work around LLVM 3.9 sdesc bug hipe_llvm: Fix incorrect atom alignment assumption
2016-11-08hipe_rtl_to_llvm: Constants for bits per byte/wordMagnus Lång
The constant ?WORD_WIDTH is renamed ?BITS_IN_WORD, and a new constant ?BITS_IN_BYTE is introduced. Additionally, a bug in a currently unused case clause of llvm_type_from_size/1 is fixed (the size of a word was hardcoded to 64 bits).
2016-11-07hipe_llvm: Work around LLVM 3.9 sdesc bugMagnus Lång
As of LLVM 3.9, the x86-call-frame-opt pass in LLVM's X86 backend causes the stack descriptors to contain incorrect (or even negative) frame sizes or root slot offsets. This might cause LLVM-compiled modules to be rejected during loading with a badarg exception in hipe_bifs:enter_sdecs/1 (which additionally prints a "hipe_bifs_enter_sdesc_1: bad sdesc!" message to stderr), or it might cause corruption or segmentation faults when walking stacks (f.ex. during GC) containing frames compiled with ErLLVM. As a workaround, we pass the -no-x86-call-frame-opt flag to llc when the version is at least 3.9
2016-11-07hipe_llvm: Fix incorrect atom alignment assumptionMagnus Lång
ErLLVM was declaring atoms in the following manner: @atom_ok = external constant i64 ; Used inside a function like this %var = ptrtoint i64* @atom_ok to i64 However, doing so makes LLVM think the `atom_ok` is 8-byte aligned, since it refers to a i64 value. This resulted in LLVM occasionally incorrectly optimising away type tests on atoms, causing incorrect behaviour or even segfaults. One such case is in bs_match_compiler:coverage_apply/2, in which an is_boxed test on a literal atom was optimised away, causing the code to try and load the "header" of an atom. This problem reproduces with LLVM versions 3.7 through 3.9. By declaring atoms as i8 (byte) constants instead, LLVM no longer makes these alignment assumptions, and the bug is fixed.
2016-11-07Merge branch 'maint'Sverker Eriksson
2016-11-03Add a test case that should now workKostis Sagonas