1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

228 Commits

Author SHA1 Message Date
Zachary Turner
35e4d81b8e Make frem.ll flush after calling printf.
Without this, the test was flaky, and FileCheck would sometimes
not detect any input on stdin.

llvm-svn: 229732
2015-02-18 19:32:28 +00:00
Lang Hames
25a7e6c730 [Orc] Make OrcMCJITReplacement::addObject calls transfer buffer ownership to the
ObjectLinkingLayer.

There are a two of overloads for addObject, one of which transfers ownership of
the underlying buffer to OrcMCJITReplacement. This commit makes the ownership
transfering version pass ownership down to the ObjectLinkingLayer in order to
prevent the issue described in r227778.

I think this commit will fix the sanitizer bot failures that necessitated the
removal of the load-object-a.ll regression test in r227785, so I'm reinstating
that test.

llvm-svn: 227845
2015-02-02 19:51:18 +00:00
Lang Hames
a6e75e31d5 [Orc] Remove one of the OrcMCJITReplacement regression tests while I
investigate a sanitizer bot failure.

llvm-svn: 227785
2015-02-02 06:01:02 +00:00
Lang Hames
2fa94e1724 [Orc] Regression tests for OrcMCJITReplacement.
Duplicated from the MCJIT regression tests.

llvm-svn: 227780
2015-02-02 05:04:55 +00:00
Lang Hames
4cf91c8bfc Remove a few more redundant ExecutionEngine regression tests.
llvm-svn: 227021
2015-01-24 22:41:13 +00:00
Lang Hames
df0b0520f5 Remove a number of redundant ExecutionEngine regression tests.
These tests used to test the legacy JIT but since that has been removed they're
just redundantly testing MCJIT. Remove them and just leave their counterparts in
test/ExecutionEngine/MCJIT.

llvm-svn: 227010
2015-01-24 18:49:51 +00:00
Kuba Brecka
d1eff2244d Reverting r226937: lit: Make MCJIT's supported arch check case insensitive
The r226937 commit causes ASan lit tests to be all skipped on OS X.

llvm-svn: 226979
2015-01-24 01:42:44 +00:00
Reid Kleckner
db3e376183 lit: Make MCJIT's supported arch check case insensitive
Should make the tests run when using CMake on systems where 'uname -p'
reports "amd64", such as FreeBSD.

Should fix PR21559.

llvm-svn: 226937
2015-01-23 21:11:40 +00:00
Lang Hames
58e00a9ed2 [MCJIT] Remove a few redundant MCJIT tests, and drop the extraneous datalayout
strings from the copies that remain.

llvm-svn: 225460
2015-01-08 18:52:15 +00:00
Alexey Samsonov
823c2375cf XFAIL several MCJIT EH tests under ASan and MSan bootstrap.
llvm-svn: 225393
2015-01-07 21:27:26 +00:00
Joerg Sonnenberger
0740338c61 Small model and JIT generally don't go well with each other.
On LP64 platforms, it will work or not depending on the choosen memory
layout, so neither PASS nor XFAIL is appropiate.
As UNSUPPORTED as per-test target doesn't exist (yet), remove the test
instead to unbreak the builds.

llvm-svn: 222767
2014-11-25 17:14:22 +00:00
Joerg Sonnenberger
6dd10513e3 Mark as explicit failing on x86-64 -- small memory model doesn't agree
with default address selections.

llvm-svn: 222759
2014-11-25 13:28:56 +00:00
Renato Golin
daa4ba29b8 MCJIT tests passing on ARM after r222414 fixed the relocation
llvm-svn: 222430
2014-11-20 13:32:16 +00:00
Reid Kleckner
b9aef21886 Fix symbol resolution of floating point libc builtins in MCJIT
Fix for LLI failure on Windows\X86: http://llvm.org/PR5053

LLI.exe crashes on Windows\X86 when single precession floating point
intrinsics like the following are used: acos, asin, atan, atan2, ceil,
copysign, cos, cosh, exp, floor, fmin, fmax, fmod, log, pow, sin, sinh,
sqrt, tan, tanh

The above intrinsics are defined as inline-expansions in math.h, and are
not exported by msvcr120.dll (Win32 API GetProcAddress returns null).

For an FREM instruction, the JIT compiler generates a call to a stub for
the fmodf() intrinsic, and adds a relocation to fixup at load time. The
loader searches the libraries for the function, but fails because the
symbol is not exported. So, the call target remains NULL and the
execution crashes.

Since the math functions are loaded at JIT/runtime, the JIT can patch
CALL instruction directly instead of the searching the libraries'
exported symbols.  However, this fix caused build failures due to
unresolved symbols like _fmodf at link time.

Therefore, the current fix defines helper functions in the Runtime
link/load library to perform the above operations.  The address of these
helper functions are used to patch up the CALL instruction at load time.

Reviewers: lhames, rnk

Reviewed By: rnk

Differential Revision: http://reviews.llvm.org/D5387

Patch by Swaroop Sridhar!

llvm-svn: 221947
2014-11-13 23:32:52 +00:00
Lang Hames
30fea694b9 [MCJIT] Defer application of AArch64 MachO GOT relocations until resolve time.
On AArch64, GOT references are page relative (ADRP + LDR), so they can't be
applied until we know exactly where, within a page, the GOT entry will be in
the target address space.

Fixes <rdar://problem/18693976>.

llvm-svn: 220347
2014-10-21 23:41:15 +00:00
Lang Hames
c38136f45c [MCJIT] Temporarily revert r220245 - it broke several bots.
(See e.g. http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/17653)

llvm-svn: 220249
2014-10-21 00:24:02 +00:00
Lang Hames
a4526eab43 [MCJIT] Make MCJIT honor symbol visibility settings when populating the global
symbol table.

Patch by Anthony Pesch. Thanks Anthony!

llvm-svn: 220245
2014-10-20 23:39:54 +00:00
Daniel Sanders
824cffe349 [mips] Remove XFAIL from two XPASS'ing tests on the llvm-mips-linux builder
llvm-svn: 218967
2014-10-03 08:49:44 +00:00
Lang Hames
5eb80e92d1 [MCJIT] Make sure we test ARM BR24 relocations with both internal and external
symbols.

Previously we have only been testing these relocations with external symbols.

<rdar://problem/18308413>

llvm-svn: 217635
2014-09-11 22:43:36 +00:00
Lang Hames
dcb52703cf [MCJIT] Add support for ARM HALF_DIFF relocations to MCJIT.
Fixes <rdar://problem/18297804>.

llvm-svn: 217620
2014-09-11 19:21:14 +00:00
Lang Hames
f8ba571e92 [MCJIT] Take the relocation addend into account when applying ARM MachO VANILLA
and BR24 relocations.

<rdar://problem/18296496>

llvm-svn: 217605
2014-09-11 17:27:01 +00:00
Lang Hames
8cb5d09ea4 [MCJIT] Make sure eh-frame fixups use the target's pointer type, not the host's.
If the wrong pointer type is used it can cause corruption of the frame
description entries.

llvm-svn: 217124
2014-09-04 04:53:03 +00:00
Eric Christopher
2f6f860aaa Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reinstates commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 216982
2014-09-02 22:28:02 +00:00
Josh Klontz
ad93d59be7 [PATCH][Interpreter] Add missing FP intrinsic lowering.
Summary:
This extends the work done in [1], adding missing intrinsic lowering for floor, trunc, round and copysign.

[1] http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/199372

Test Plan: Extended `test/ExecutionEngine/Interpreter/intrinsics.ll` to test the additional missing intrinsics. All tests pass.

Reviewers: dexonsmith

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5120

llvm-svn: 216827
2014-08-30 18:33:35 +00:00
Lang Hames
e8f7bb2a7a [MCJIT] Add an i386 RuntimeDyldMachO test case.
llvm-svn: 216024
2014-08-19 21:26:36 +00:00
Josh Klontz
6f066a7766 Add missing Interpreter intrinsic lowering for sin, cos and ceil
llvm-svn: 215209
2014-08-08 15:00:12 +00:00
Eric Christopher
378bc328f0 Temporarily Revert "Nuke the old JIT." as it's not quite ready to
be deleted. This will be reapplied as soon as possible and before
the 3.6 branch date at any rate.

Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reverts commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 215154
2014-08-07 22:02:54 +00:00
Rafael Espindola
0e6d6ff455 Remove a few XFAILs.
These tests now pass with MCJIT.

llvm-svn: 215136
2014-08-07 19:35:22 +00:00
Rafael Espindola
e9ebbe5559 Nuke the old JIT.
I am sure we will be finding bits and pieces of dead code for years to
come, but this is a good start.

Thanks to Lang Hames for making MCJIT a good replacement!

llvm-svn: 215111
2014-08-07 14:21:18 +00:00
Lang Hames
926cf02e43 [MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.
We now (1) correctly decode the branch immediate, (2) modify the immediate to
corretly treat it as PC-rel, and (3) properly populate the stub entry.
Previously we had been doing each of these wrong.

<rdar://problem/17750739>

llvm-svn: 214285
2014-07-30 03:35:05 +00:00
Lang Hames
c8d9cf454f [MCJIT] XFAIL some RuntimeDyld tests on MIPS - RuntimeDyldChecker isn't properly
endian-aware yet, and this is causing failures when cross-linking on MIPS.

llvm-svn: 214231
2014-07-29 21:48:22 +00:00
Lang Hames
46768ed40a [MCJIT] Make the RuntimeDyldChecker stub_addr builtin use file names rather than
full paths for its first argument.

This allows us to remove the annoying sed lines in the test cases, and write
direct references to file names in stub_addr calls (rather than <filename>
placeholders).

llvm-svn: 214211
2014-07-29 20:40:37 +00:00
Juergen Ributzka
2fe879698c [RuntimeDyld][AArch64] Make encode/decodeAddend also work on big-endian hosts.
llvm-svn: 214205
2014-07-29 19:57:15 +00:00
Lang Hames
6021790b64 [MCJIT] Remove extraneous parentheses in test case.
llvm-svn: 214117
2014-07-28 21:00:48 +00:00
Juergen Ributzka
dd1be32354 [RuntimeDyld][AArch64] Update relocation tests and also add a simple GOT test.
llvm-svn: 213807
2014-07-23 22:23:17 +00:00
NAKAMURA Takumi
413d897e7d Rework to let RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s pass on win32.
FIXME: "llvm-rtdyld -verify -check" is still sensitive to path separator.
Fix searching StubMap to be tolerant of both '/' and '\\' on Win32.

llvm-svn: 213723
2014-07-23 04:32:21 +00:00
NAKAMURA Takumi
4555cd0e60 Suppress a test on win32 for now, llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s.
FIXME: Fix searching StubMap with '/' and '\\' on Win32.
llvm-svn: 213721
2014-07-23 04:05:58 +00:00
NAKAMURA Takumi
a6795992fa RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s: Use %/T here, or sed(1) would be confused with dos path.
llvm-svn: 213720
2014-07-23 04:05:46 +00:00
Juergen Ributzka
00d4bb61a8 XFAIL the test on MIPS
Not sure how to debug this one without a MIPS machine. Any takers?

llvm-svn: 213705
2014-07-22 23:15:01 +00:00
Lang Hames
59246bdf0c [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework.
This patch introduces a 'stub_addr' builtin that can be used to find the address
of the stub for a given (<file>, <section>, <symbol>) tuple. This address can be
used both to verify the contents of stubs (by loading from the returned address)
and to verify references to stubs (by comparing against the returned address).

Example (1) - Verifying stub contents:

Load 8 bytes (assuming a 64-bit target) from the stub for 'x' in the __text
section of f.o, and compare that value against the addres of 'x'.

# rtdyld-check: *{8}(stub_addr(f.o, __text, x) = x

Example (2) - Verifying references to stubs:

Decode the immediate of the instruction at label 'l', and verify that it's
equal to the offset from the next instruction's PC to the stub for 'y' in the
__text section of f.o (i.e. it's the correct PC-rel difference).

# rtdyld-check: decode_operand(l, 4) = stub_addr(f.o, __text, y) - next_pc(l)
l:
        movq    y@GOTPCREL(%rip), %rax

Since stub inspection requires cooperation with RuntimeDyldImpl this patch
pimpl-ifies RuntimeDyldChecker. Its implementation is moved in to a new class,
RuntimeDyldCheckerImpl, that has access to the definition of RuntimeDyldImpl.

llvm-svn: 213698
2014-07-22 22:47:39 +00:00
Juergen Ributzka
b056ac8df3 [RuntimeDyld][MachO][AArch64] Add a helper function for encoding addends in instructions.
Factor out the addend encoding into a helper function and simplify the
processRelocationRef.

Also add a few simple rtdyld tests. More tests to come once GOTs can be tested too.

Related to <rdar://problem/17768539>

llvm-svn: 213689
2014-07-22 21:42:55 +00:00
Lang Hames
a9b683f346 [RuntimeDyld] Replace a crufty old ARM RuntimeDyld test with a new one that uses
RuntimeDyldChecker.

This allows us to remove one of the six remaining object files in the LLVM
source tree.

llvm-svn: 212780
2014-07-10 23:29:11 +00:00
Chandler Carruth
5030185558 Fix this test to not write to the source tree, and instead to write to
a temporary file. This fixes the test in cases where the source tree is
mounted read-only.

llvm-svn: 211975
2014-06-28 05:18:49 +00:00
Lang Hames
ca371c94cf [RuntimeDyld] Make sure that RuntimeDyld regression tests only run for targets
that have been enabled.

Without this, testers will fail when llvm-rtdyld is invoked with triples for
unsupported targets.

llvm-svn: 211969
2014-06-27 23:29:18 +00:00
Lang Hames
321bebf72e [RuntimeDyld] Add a framework for testing relocation logic in RuntimeDyld.
This patch adds a "-verify" mode to the llvm-rtdyld utility. In verify mode,
llvm-rtdyld will test supplied expressions against the linked program images
that it creates in memory. This scheme can be used to verify the correctness
of the relocation logic applied by RuntimeDyld.

The expressions to test will be read out of files passed via the -check option
(there may be more than one of these). Expressions to check are extracted from
lines of the form:
# rtdyld-check: <expression>

This system is designed to fit the llvm-lit regression test workflow. It is
format and target agnostic, and supports verification of images linked for
remote targets. The expression language is defined in
llvm/include/llvm/RuntimeDyldChecker.h . Examples can be found in
test/ExecutionEngine/RuntimeDyld.

llvm-svn: 211956
2014-06-27 20:20:57 +00:00
Ulrich Weigand
a5f93603cb [RuntimeDyld] Support more PPC64 relocations
This adds support for several missing PPC64 relocations in the
straight-forward manner to RuntimeDyldELF.cpp.

Note that this actually fixes a failure of a large-model test case on
PowerPC, allowing the XFAIL to be removed.

llvm-svn: 211382
2014-06-20 17:51:47 +00:00
Will Schmidt
5832e5b8ca mark the old jit tests as unsupported for powerpc64 (for cmake)
mark the old JIT tests as unsupported for powerpc64 - CMake style.
This follows the style used for hexagon/arm64/aarch64.
The equivalent tests still run under the supported MCJIT/*

llvm-svn: 211111
2014-06-17 17:04:42 +00:00
Alp Toker
03b6e12fae Reduce verbiage of lit.local.cfg files
We can just split targets_to_build in one place and make it immutable.

llvm-svn: 210496
2014-06-09 22:42:55 +00:00
Alexey Samsonov
fd0b788d88 Use AArch64 instead of now removed ARM64 in test configs
llvm-svn: 210229
2014-06-05 00:25:30 +00:00
Lang Hames
9eb43064f9 Fix testers by removing dubious testcase for r209154.
It turns out that not all the world is x86-64. Who knew?

I'll get to work on a more appropriate test case for this patch.

llvm-svn: 209155
2014-05-19 19:38:48 +00:00