Commit Graph

26 Commits

Author SHA1 Message Date
Mark Wielaard
461cc5c003 Cleanup GPL header address notices by using http://www.gnu.org/licenses/
Sync VEX/LICENSE.GPL with top-level COPYING file. We used 3 different
addresses for writing to the FSF to receive a copy of the GPL. Replace
all different variants with an URL <http://www.gnu.org/licenses/>.

The following files might still have some slightly different (L)GPL
copyright notice because they were derived from other programs:

- files under coregrind/m_demangle which come from libiberty:
  cplus-dem.c, d-demangle.c, demangle.h, rust-demangle.c,
  safe-ctype.c and safe-ctype.h
- coregrind/m_demangle/dyn-string.[hc] derived from GCC.
- coregrind/m_demangle/ansidecl.h derived from glibc.
- VEX files for FMA detived from glibc:
  host_generic_maddf.h and host_generic_maddf.c
- files under coregrin/m_debuginfo derived from LZO:
  lzoconf.h, lzodefs.h, minilzo-inl.c and minilzo.h
- files under coregrind/m_gdbserver detived from GDB:
  gdb/signals.h, inferiors.c, regcache.c, regcache.h,
  regdef.h, remote-utils.c, server.c, server.h, signals.c,
  target.c, target.h and utils.c

Plus the following test files:

- none/tests/ppc32/testVMX.c derived from testVMX.
- ppc tests derived from QEMU: jm-insns.c, ppc64_helpers.h
  and test_isa_3_0.c
- tests derived from bzip2 (with embedded GPL text in code):
  hackedbz2.c, origin5-bz2.c, varinfo6.c
- tests detived from glibc: str_tester.c, pth_atfork1.c
- test detived from GCC libgomp: tc17_sembar.c
- performance tests derived from bzip2 or tinycc (with embedded GPL
  text in code): bz2.c, test_input_for_tinycc.c and tinycc.c
2019-05-26 20:07:51 +02:00
Ivo Raisr
83cabd3249 Refactor tracking of MOV coalescing.
Reg<->Reg MOV coalescing status is now a part of the HRegUsage.
This allows register allocation to query it two times without incurring
a performance penalty. This in turn allows to better keep track of
vreg<->vreg MOV coalescing so that all vregs in the coalesce chain
get the effective |dead_before| of the last vreg.

A small performance improvement has been observed because this allows
to coalesce even spilled vregs (previously only assigned ones).
2017-10-11 20:56:48 +02:00
Ivo Raisr
1639d6c783 Small performance enhancement to VEX register allocator v2.
Iterate only over real registers of the target hreg class.
2017-09-04 09:22:15 +02:00
Ivo Raisr
efa1e5ef8d VEX register allocator version 3.
Implements a new version of VEX register allocator which
keeps the main state per virtual registers, as opposed
to real registers in v2. This results in a simpler and
cleaner design and much simpler implementation.
It has been observed that the new allocator executes 20-30%
faster than the previous one but could produce slightly worse
spilling decisions. Overall performance improvement when running
the Valgrind performance regression test suite has been observed
in terms of a few percent.

The new register allocator (v3) is now the default one.
The old register allocator (v2) is still kept around and can be
activated with command line option '--vex-regalloc-version=2'.

Fixes BZ#381553.
2017-08-28 12:40:17 +02:00
Ivo Raisr
bed4f39768 Fix a possible array overrun in VEX register allocator.
Fixes BZ#381162.


git-svn-id: svn://svn.valgrind.org/vex/trunk@3392
2017-06-13 18:14:28 +00:00
Ivo Raisr
f69152ed6f Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/vex/trunk@3360
2017-05-04 15:10:00 +00:00
Julian Seward
4682dbc5e1 Reduce the number of IR sanity checks from 4 per block to 2 per block.
Also relax assertion checking in the register allocator.

Together with valgrind r15927 this reduces per-block JITting cost by 10%-15%.



git-svn-id: svn://svn.valgrind.org/vex/trunk@3239
2016-08-05 15:02:48 +00:00
Julian Seward
0a399baa49 Update copyright dates, to include 2015. No functional change.
git-svn-id: svn://svn.valgrind.org/vex/trunk@3181
2015-08-21 11:29:16 +00:00
Julian Seward
23edc61c6b Bug 345215 - Performance improvements for the register allocator
The basic idea is to change the representation of registers (HReg) so
as to give Real registers a unique integer index starting from 0, with
the registers available for allocation numbered consectively from zero
upwards. This allows the register allocator to index into its primary
data structure -- a table tracking the status of each available
register -- using normal array index instead of having to search
sequentially through the table, as now.

It also allows an efficient bitmap-based representation for "set of
Real registers", which is important for the NCODE work.

There are various other perf improvements, most notably in calling
getRegUsage once rather than twice per instruction.

Cost of register allocation is reduced to around 65% ish of what it
previously was. This translates in to speedups close to zero for
compute intensive code up to around 7% for JITing intensive
situations, eg "time perl tests/vg_regtest memcheck/tests/amd64".



git-svn-id: svn://svn.valgrind.org/vex/trunk@3107
2015-03-26 07:18:32 +00:00
Florian Krohm
f26b4d4918 r2974 moved the inline definition of LibVEX_Alloc from libvex.h
to main_util.c because it caused linker problems with ICC.
See comments in BZ #339542.
This change re-enables inlining of that function by adding it
(renamed as LibVEX_Alloc_inline) to main_util.h.
500+ callsites changed accordingly.


git-svn-id: svn://svn.valgrind.org/vex/trunk@3103
2015-03-13 12:46:49 +00:00
Florian Krohm
172c915361 Add symbolic constant LibVEX_GUEST_STATE_ALIGN.
Use it.


git-svn-id: svn://svn.valgrind.org/vex/trunk@3091
2015-02-13 16:25:41 +00:00
Florian Krohm
222705b21c Constification part 5.
Constify ppXXXInstr, getRegUsage_XXXInstr, isMove_XXXInstr, emit_XXXInstr,
and iselSB_XXX.


git-svn-id: svn://svn.valgrind.org/vex/trunk@2970
2014-10-08 08:54:44 +00:00
Florian Krohm
4a8a504011 Fix comments and code snippets that were making incorrect claims about
the alignment requirement of the guest state, shadow areas, and register
spill area sizes.
The size of these areas ought to be a multiple of 16 bytes.


git-svn-id: svn://svn.valgrind.org/vex/trunk@2818
2014-02-14 08:55:32 +00:00
Julian Seward
8b03b71df7 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2792
2013-10-18 14:12:58 +00:00
Florian Krohm
a87a4d1bfd Make HReg a struct. In the past there were several occurences where
a HReg was assigned to an integer. This worked by accident because the
bits representing the register number (which was meant to be accessed)
happened to be in the right place.
Two new functions: hregIsInvalid and sameHReg.
The HReg struct just wraps the integer that was previously used to
represent a register without changing the encoding.


git-svn-id: svn://svn.valgrind.org/vex/trunk@2682
2013-02-11 00:47:35 +00:00
Florian Krohm
07f4cd2e95 Fix HReg <--> UInt mixup.
vreg is a HReg, so we should not assign a hregNumber() to it.
Introduce and use vregno instead.


git-svn-id: svn://svn.valgrind.org/vex/trunk@2658
2013-01-24 16:18:48 +00:00
Julian Seward
5c6e719070 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/vex/trunk@2460
2012-08-05 15:36:51 +00:00
Julian Seward
009babcc9f Increase max allowed pre-allocation (vreg-ised) block size from 10000
to 15000.  In very extreme circumstances the JIT pipeline can create
huge blocks.  Fixes #303250, at least for the time being.



git-svn-id: svn://svn.valgrind.org/vex/trunk@2430
2012-07-14 09:18:02 +00:00
Julian Seward
d6a5e7a23c Remove, or (where it might later come in handy) comment out artefacts
for 256 bit (AVX) code generation on amd64.  Although that was the
plan at first, it turns out to be infeasible to generate 256 bit
instructions for the IR created by Memcheck's instrumentation of 256
bit Ity_V256 IR.  This is because it would require 256 bit integer
SIMD operations, and AVX as currently available only provides 256 bit
operations for floating point.  So, fall back to generating 256 IR
into 128-bit XMM register pairs, and using the existing SSE facilities
in the back end.  This change only affects the amd64 back end -- it
does not affect IR, which remains unchanged, and capable of
representing 256 bit vector operations wherever needed.



git-svn-id: svn://svn.valgrind.org/vex/trunk@2355
2012-05-27 16:18:13 +00:00
Julian Seward
92cc69c4fc Add initial support for Intel AVX instructions (VEX side).
Tracker bug is #273475.


git-svn-id: svn://svn.valgrind.org/vex/trunk@2330
2012-05-21 10:18:49 +00:00
Florian Krohm
669492555c Revert accidental check in (part of r2240).
git-svn-id: svn://svn.valgrind.org/vex/trunk@2241
2012-01-18 14:04:23 +00:00
Florian Krohm
3be9593f32 Revert r2238. In 64-bit mode the length is in bits 0:63.
Not sure what I was thinking then....


git-svn-id: svn://svn.valgrind.org/vex/trunk@2240
2012-01-18 14:00:31 +00:00
Julian Seward
0b2a888e13 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/vex/trunk@2225
2011-10-23 07:33:43 +00:00
Julian Seward
beb36a8a31 Update copyright dates to 2010 and change license to standard GPL2+.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1977
2010-05-03 21:38:49 +00:00
Julian Seward
61f3b8fc3c Merge r1925:1948 from branches/ARM. This temporarily breaks all other
targets, because a few IR primops to do with int<->float conversions
have been renamed, and because an internal interface for creating
spill/reload instructions has changed.



git-svn-id: svn://svn.valgrind.org/vex/trunk@1949
2009-12-31 18:00:12 +00:00
Julian Seward
42e4fdf5ce Flatten out the directory structure in the priv/ side, by pulling all
files into priv/ and giving them unique names.  This makes it easier
to use automake to build all this stuff in Valgrind.  It also tidies
up a directory structure which had become a bit pointlessly complex.



git-svn-id: svn://svn.valgrind.org/vex/trunk@1904
2009-07-02 12:21:59 +00:00