Age | Commit message (Collapse) | Author |
|
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').
|
|
# Conflicts:
# lib/hipe/llvm/hipe_rtl_to_llvm.erl
|
|
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).
|
|
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.
|
|
Seems to work either way, it just seem more correct
as all other 'bif' calls are 'not_remote'.
|
|
|
|
|
|
to not be transformed to local calls.
code_SUITE:uprade still fails if run with compile option
{hipe,to_llvm}
|
|
LLVM currently hard-codes these. Since it is desirable to be able to
change things like PCB layout without requiring a change to LLVM, we
export these as LLVM metadata, which can easily be used from LLVM to
make it independent of them.
|
|
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.
|
|
Do not rely on MFA name for the arity of functions, since closures have
an extra argument. Instead, just use the length of the arguments list.
|
|
|