aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
AgeCommit message (Collapse)Author
2016-05-23Added elimination of maps:is_key/2 calls to HiPEMagnus Lång
* Implemented removal of maps:is_key/2 calls of which the result is known in a new pass during the typed phase, called hipe_icode_call_elim. * Added the option icode_call_elim that enables the hipe_icode_call_elim pass, and made it default for o2.
2016-05-18hipe_llvm: Move elf_format.hrl types to moduleMagnus Lång
Named types, except those for the records in the header files, have been moved from elf*_format.hrl to elf_format.erl. Also: * Use lists instead of element/2-indexed tuples for ELF section and symbol tables. * Enable +warn_export_vars for hipe/llvm/ subdirectory and fix warning. * Extract duplicated code in hipe_llvm module into help function pp_dereference_type/3.
2016-05-16Merge branch 'kostis/dialyzer/opaque_type/OTP-13586/PR-1047'Hans Bolinder
* kostis/dialyzer/opaque_type/OTP-13586/PR-1047: Declare the erl_types:var_table() type as opaque
2016-05-12Revert "Prepare release"Erlang/OTP
This reverts commit bd64ad8e15d66e48b36dbe3584315dd5cfc8b59a.
2016-05-11hipe_llvm: Disable floats for x86Magnus Lång
A bug in LLVM miscompiles x86 functions that have floats are spilled to stack. We work around it by disabling (inlined) floats when using llvm on x86. Once a LLVM version in which the bug is fixed is released, we can make the workaround conditional depending on the version.
2016-05-11Prepare releaseErlang/OTP
2016-05-11hipe_llvm: Allow LLVM-generated constantsMagnus Lång
Since 3.7, LLVM sometimes generates SSE constants in a special constant section with the requisite alignment (".rodata.cst16"). This broke hipe_llvm since it assumed that all constants that were linked from the text section were constants generated by hipe_llvm. As this is the first time alignments larger than 8 have been required, some small changes were required to hipe_consttab and hipe_bifs:alloc_data/2. Note that hipe_bifs:alloc_data/2 still assumes that erl_alloc will provide the requisite alignment.
2016-05-11hipe: Extract some records into elf_format.hrlMagnus Lång
This allows for much more robust interpretation of relocations, symbols and sections in hipe_llvm_main, without the clunkiness of an abstract interface between two internal modules that belong to the same subsystem anyway.
2016-05-10hipe: Restructure elf_format moduleMagnus Lång
2016-05-09hipe: Cleanup elf_format moduleMagnus Lång
2016-05-09hipe: Remove runtime elf_format class switchingMagnus Lång
The elf_format module was written in such a way that some of the customisation to ELF-32 vs ELF-64 was made at compile-time and some of it at run-time. As such it was not actually possible to read 32-bit files with a module compiled for 64-bit support, or vice versa. As the run-time selection uses some process dictionary ugliness, it was removed, shifting all the customisation to be compile-time.
2016-05-09Merge branch 'kostis/hipe/add-bs_match-tests/PR-1044/OTP-13549'Björn-Egil Dahlberg
* kostis/hipe/add-bs_match-tests/PR-1044/OTP-13549: Up the limit for the timetrap used in the HiPE testsuite One more test suite for binary pattern matching
2016-05-04Declare the erl_types:var_table() type as opaqueKostis Sagonas
and do the following changes: in erl_types: export the type and an appropriate constructor for it in dialyzer_contracts: perform all necessary code modifications to fix all dialyzer warnings Although no warnings are reported by dialyzer, it's quite possible that these are not the only places where the opacity of the var_table() data structure is violated. But I decided to leave these places for a better version of dialyzer to discover...
2016-05-04hipe_llvm: Syntax compatibility with 3.7-3.8Magnus Lång
2016-05-04Up the limit for the timetrap used in the HiPE testsuiteKostis Sagonas
Without this change, one test (bs_utf) times out when run on some very slow SUN/SPARC machine we still have around. Unfortunately, this is the only such machine that we have access to these days. Perhaps suprisingly, all the HiPE tests pass on SPARC, which is nice to know that this backend still works, despite not having been tested for more than one (almost two?) years now.
2016-05-04hipe: Use maps for unification and substitutionHans Bolinder
2016-05-04dialyzer: Use maps instead of dictHans Bolinder
Optimization: A few dictionaries are maps instead of dicts.
2016-05-03One more test suite for binary pattern matchingKostis Sagonas
Taken from the OTP test suites and changed accordingly for HiPE. Used to be problematic in the tests that matched against a segment of 'bad_size'. This was corrected in the BEAM compiler for OTP 19.
2016-04-29dialyzer: Fix a bug in the translation of forms to typesHans Bolinder
A bug is fixed, but there are more problems. Modify erl_types.erl like this: -define(EXPAND_LIMIT, 500). and bogus warnings are output (again). Callbacks and specs are compared (subtype) in dialyzer_behaviour. If they are expanded to different depths, then invalid warnings can be generated.
2016-04-29Merge branch 'sverker/hipe/remove-ct_hooks'Sverker Eriksson
2016-04-28erl_types: Don't consider opaque keys singletonMagnus Lång
Opaque singleton keys have the unfortunate property, unlike any other singleton type, to overlap with other singleton types that do not have the same internal representation. Therefore, we must not keep opaque singletons in the Pairs list in a map type.
2016-04-28erl_types: Fix t_subtract/2 correctness bugMagnus Lång
t_subtract/2 would break its postcondition by always returning the underapproximation none() when given a variable on the right hand side. This broke map type parsing, since it relied on t_subtract/2 to tell it when map keys would shadow each other.
2016-04-28erl_types: Fix crash merging maps with opaque keysMagnus Lång
Opaque keys in maps broke an assumption in erl_types:mapmerge_otherv/3 (that the infinimum of a singleton type and some other type would either be none() or that same singleton type), causing a case_clause crash.
2016-04-28erl_bif_types: Add a selection of maps BIFsMagnus Lång
* maps:from_list/1 * maps:get/2 * maps:is_key/2 * maps:merge/2 * maps:put/3 * maps:size/1 * maps:to_list/1 * maps:update/3
2016-04-28erl_types: Add a map type representationMagnus Lång
The type of a map is represented as a three-tuple {Pairs, DefaultKey, DefaultValue}. DefaultKey and DefaultValue are types. Pairs is a list of three-tuples {Key, mandatory | optional, Value}, where Key and Value are types. All types Key must be singleton, or "known at compile time," as the EEP put it. Examples: #{integer()=>list()} {[], integer(), list()} #{a=>char(), b=>atom()} {[{a, optional, char()}, {b, optional, atom()}], none(), none()} map() {[], any(), any()} A more formal description of the representation and its invariants can be found in erl_types.erl Special thanks to Daniel S. McCain (@dsmccain) that co-authored a very early version of this with me back in April 2014, although only the singleton type logic remains from that version.
2016-04-19Remove unused ct_hooksSverker Eriksson
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-03-21Merge branch 'kostis/hipe-inline-fp-crash/PR-984/OTP-13407'Sverker Eriksson
2016-03-15update copyright-yearHenrik Nord
2016-03-15Merge tag 'OTP-18.3'Lars Thorsen
=== OTP-18.3 === Changed Applications: - asn1-4.0.2 - common_test-1.12 - compiler-6.0.3 - cosNotification-1.2.1 - cosTime-1.2.1 - cosTransactions-1.3.1 - crypto-3.6.3 - debugger-4.1.2 - dialyzer-2.9 - diameter-1.11.2 - edoc-0.7.18 - eldap-1.2.1 - erl_docgen-0.4.2 - erl_interface-3.8.2 - erts-7.3 - eunit-2.2.13 - hipe-3.15 - inets-6.2 - kernel-4.2 - mnesia-4.13.3 - observer-2.1.2 - orber-3.8.1 - public_key-1.1.1 - runtime_tools-1.9.3 - sasl-2.7 - snmp-5.2.2 - ssh-4.2.2 - ssl-7.3 - stdlib-2.8 - test_server-3.10 - tools-2.8.3 - webtool-0.9.1 - wx-1.6.1 - xmerl-1.3.10 Unchanged Applications: - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosProperty-1.2 - et-1.5.1 - gs-1.6 - ic-4.4 - jinterface-1.6.1 - megaco-3.18 - odbc-2.11.1 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - parsetools-2.1.1 - percept-0.8.11 - reltool-0.7 - syntax_tools-1.7 - typer-0.9.10 Conflicts: OTP_VERSION erts/vsn.mk lib/test_server/doc/src/notes.xml lib/test_server/vsn.mk lib/webtool/doc/src/notes.xml lib/webtool/vsn.mk
2016-03-14Prepare releaseErlang/OTP
2016-03-10hipe_icode_fp: simplify match/2Magnus Lång
2016-03-07Comment and clean up a testKostis Sagonas
2016-03-07hipe_icode_fp: Replace helper with lists:allMagnus Lång
2016-03-03hipe_icode_fp: Define types for all records usedMagnus Lång
2016-03-03hipe_icode_fp: Add specs and switch trees to mapsMagnus Lång
2016-03-02hipe: Fix crashing bugs when inlining FP opsMagnus Lång
It was assumed in hipe_icode_fp:filter_map/3 that either all predecessors would have an up-to-date ("assigned") tagged copy, or none of them. This is temporarily false during the fixpoint loop in basic_floats:test_icode_type_crash_2/0, which exercises the all_args_equal(Bindings) =:= true branch, that would previously erroneously end up in the 'false' branch, which is what caused the crash in that case. This is likewise only temporarily false during the fixpoint loop in basic_floats:test_icode_type_crash/0, but that case instead exercises the 'false' branch, justifying the inclusion of both tests.
2016-02-29A test that crashes the HiPE compiler when inlining FP opsKostis Sagonas
2016-02-25Merge branch 'maint'Henrik Nord
2016-02-25Merge branch 'kostis/hipe-icode-cleanup' into maintHenrik Nord
* kostis/hipe-icode-cleanup: Fix dialyzer warning and some code refactoring OTP-13379
2016-02-17Makefiles: Remove test_server from include path and code pathBjörn Gustavsson
Since no test suites includede test_server.hrl, there is no need to have test_server in the include path or code path.
2016-02-17Eliminate use of test_server.hrl and test_server_line.hrlBjörn Gustavsson
As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl.
2016-02-10Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Correct byte_size() and comparisons Conflicts: lib/hipe/cerl/erl_bif_types.erl
2016-02-09dialyzer: Correct byte_size() and comparisonsHans Bolinder
The argument of byte_size() is a bitstring(). The code in erl_bif_types that finds cases where comparisons always return true or false is corrected when it comes to maps and bit strings.
2016-02-07Fix dialyzer warning and some code refactoringKostis Sagonas
A previous commit introduced a change that exposed dead code in this module and caused dialyzer warnings. This dead code was taken out. While at it, performed some code refactoring in the handling of the bs_get_integer primop.
2016-02-02Merge branch 'maint'Zandra
Conflicts: erts/emulator/beam/beam_emu.c
2016-02-02Merge branch 'margnus1/bs_unit_fix' into maintZandra
* margnus1/bs_unit_fix: hipe: Fix signed compares of unsigned sizes beam: Fix overflow bug in i_bs_add_jId hipe: Add tests for bad bit syntax float sizes Add a case testing the handling of guards involving binaries Add some more binary syntax construction tests hipe: Guard against enormous numbers in ranges hipe: Fix constructing huge binaries hipe: Fix binary constructions failing with badarith Add missing corner-case to bs_construct_SUITE hipe: Allow unsigned args in hipe_rtl_arith hipe: test unit size match in bs_put_binary_all hipe: test unit size match in bs_append Fix hipe_rtl_binary_construct:floorlog2/1 OTP-13272
2016-02-01dialyzer: Remove t_parameterized_module/0 from erl_typesStavros Aronis
Parameterized modules are no longer supported, so module() can only be an atom().
2016-01-27Merge branch 'maint'Zandra
2016-01-27Merge branch 'kostis/hipe-tests-basic' into maintZandra
OTP-13269 * kostis/hipe-tests-basic: Fix compilation of matching with UTF binaries Cleanup and add one more test case Two tests that depend on inlining being turned on More tests for BIFs Include some more old HiPE tests to the test suite Add tests for the is_boolean/1 guard Two more tests added Test that apply/3 is tail recursive Three more tests added Minor cleanup Comment out tests that are not ready for to_llvm Cleanups & uncomment some code More tests for handling of UTF in bitstrings Minor code cleanup Add more generated test suites in Makefile Use function from hipe module instead of a local one Add function to prevent running tests in the LLVM backend More basic tests First part of the basic test suite for the HiPE compiler