1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

102182 Commits

Author SHA1 Message Date
Lang Hames
91cdab6916 [MC] Require an MCContext when constructing an MCDisassembler.
This patch re-introduces the MCContext member that was removed from
MCDisassembler in r206063, and requires that an MCContext be passed in at
MCDisassembler construction time. (Previously the MCContext member had been
initialized in an ad-hoc fashion after construction). The MCCContext member
can be used by MCDisassembler sub-classes to construct constant or
target-specific MCExprs.

This patch updates disassemblers for in-tree targets, and provides the
MCRegisterInfo instance that some disassemblers were using through the
MCContext (previously those backends were constructing their own
MCRegisterInfo instances).

llvm-svn: 206241
2014-04-15 04:40:56 +00:00
NAKAMURA Takumi
11d1c480fb X86JITInfo: [x86] Use X86CompilationCallback_SSE() along;
*not* Subtarget->hasSSE1()
  *but* __SSE__, the flag that LLVM libraries are compiled

The callback calls internal LLVM JIT libraries. It may be built with -msse (or above).

FIXME: JIT may use "host" instead of "generic" by default.
llvm-svn: 206240
2014-04-15 04:12:21 +00:00
Jim Grosbach
161b74b41e [ARM64,C++11]: Range'ify the dead-register-definition pass.
Range-based for loops. No functional change intended.

llvm-svn: 206239
2014-04-15 02:14:09 +00:00
Jim Grosbach
63cf16558e Add iterator_range for MachineInstr defs.
llvm-svn: 206238
2014-04-15 02:14:06 +00:00
Quentin Colombet
e6f12ef160 [MC] Emit an error if cfi_startproc is used before a symbol is defined.
Currently, we bind those directives with the last symbol, so if none
has been defined, this would lead to a crash of the compiler.

<rdar://problem/15939159>

llvm-svn: 206236
2014-04-15 01:17:45 +00:00
Quentin Colombet
dbdc47bc92 [Register Coalescer] Add a test case for 206060.
<rdar://problem/16582185>

llvm-svn: 206235
2014-04-15 01:15:32 +00:00
Chandler Carruth
6136d79545 [Allocator] Add Deallocate support to the AllocatorBase CRTP class,
along with templated overloads much like we have for Allocate. These
will facilitate switching the Deallocate interface of all the Allocator
classes to accept the size by pre-filling it from the type size where we
can do so. I plan to convert several uses to the template variants in
subsequent patches prior to adding the Size parameter.

No functionality changed, WIP.

llvm-svn: 206230
2014-04-15 00:47:47 +00:00
Quentin Colombet
d141feffeb [ARM64][MC] Set the default CPU string to generic.
llvm-svn: 206228
2014-04-15 00:28:39 +00:00
Chandler Carruth
e214e6ab62 [Allocator] Hack around the fact that GCC can't compile the
static_assert added in r206225. I'm looking into a proper fix, but
wanted the bots back.

llvm-svn: 206226
2014-04-15 00:22:53 +00:00
Chandler Carruth
e2b7c08bf9 [Allocator] Factor the Allocate template overloads into a base class
rather than defining them (differently!) in both allocators. This also
serves as a basis for documenting and even enforcing some of the
LLVM-style "allocator" concept methods which must exist with various
signatures.

I plan on extending and changing the signatures of these to further
simplify our allocator model in subsequent commits, so I wanted to
factor things as best as I could first. Notably, I'm working to add the
'Size' to the deallocation method of all allocators. This has several
implications not the least of which are faster deallocation times on
certain allocation libraries (tcmalloc). It also will allow the JIT
allocator to fully model the existing allocation interfaces and allow
sanitizer poisoning of deallocated regions. The list of advantages goes
on. =] But by factoring things first I'll be able to make this easier by
first introducing template helpers for the deallocation path.

llvm-svn: 206225
2014-04-15 00:19:41 +00:00
David Blaikie
7495172545 Use std::unique_ptr for DIE children
Got bored, removed some manual memory management.

Pushed references (rather than pointers) through a few APIs rather than
replacing *x with x.get().

llvm-svn: 206222
2014-04-14 22:45:02 +00:00
Jim Grosbach
20e09f25d7 X86: Nuke one more CPU autodetect blurb.
Missed one in r206094. This brings MC and TargetMachine back into sync.

llvm-svn: 206220
2014-04-14 22:23:30 +00:00
David Blaikie
5191eb8e9f Change argument order and add explanatory comment to r206130
Changes requested in code review by Eric Christopher of r206130.

llvm-svn: 206219
2014-04-14 22:23:06 +00:00
Eric Christopher
de23a0240e Use FrameSetup on frame instructions for the Mips port.
I can't seem to get a testcase to show a difference here, but it's
part of the unconditional-br.ll line table weirdness.

llvm-svn: 206218
2014-04-14 22:21:22 +00:00
NAKAMURA Takumi
1664e20d84 [CMake] Reformat, if(MSVC)...else()...endif()
llvm-svn: 206215
2014-04-14 21:58:19 +00:00
Matt Arsenault
2a6aada789 Revert "Revert r206045, "Fix shift by constants for vector.""
Fix cases where the Value itself is used, and not the constant value.

llvm-svn: 206214
2014-04-14 21:50:37 +00:00
Quentin Colombet
e2f7da8884 [ARM64][MC] Set the default CPU to cyclone when initilizating the MC layer.
This matches that ARM64Subtarget does for now.

This is related to <rdar://problem/16573920>

llvm-svn: 206211
2014-04-14 21:25:53 +00:00
Adrian Prantl
ee1b12d3e5 Re-apply r206096 after investigating the gdb buildbot failure.
Thanks to dblaikie for updating the testcase!

Debug info: (bugfix) C++ C/Dtors can be compiled to multiple functions,
therefore, their declaration cannot have one DW_AT_linkage_name.
The specific instances however can and should have that attribute.

This patch reorders the code in DwarfUnit::getOrCreateSubprogramDIE()
to emit linkage names for C/Dtors.

rdar://problem/16362674.

llvm-svn: 206210
2014-04-14 21:16:04 +00:00
Chandler Carruth
74733593d9 [cleanup] Run clang-format over most of YAMLParser.h to fix a bunch of
small formatting inconsistencies with the rest of LLVM and even this
file. I looked at all the changes and they seemed like just better
formatting.

llvm-svn: 206209
2014-04-14 21:12:15 +00:00
Louis Gerbarg
3eecd92d3d Fix for codegen bug that could cause illegal cmn instruction generation
In rare cases the dead definition elimination pass code can cause illegal cmn
instructions when it replaces dead registers on instructions that use
unmaterialized frame indexes. This patch disables the dead definition
optimization for instructions which include frame index operands.

rdar://16438284

llvm-svn: 206208
2014-04-14 21:05:05 +00:00
Louis Gerbarg
c06e27404e Add a flag to disable the ARM64DeadRegisterDefinitionsPass
This patch adds a -arm64-dead-def-elimination flag so that it is possible to
disable dead definition elimination. Includes test case.

llvm-svn: 206207
2014-04-14 21:05:02 +00:00
James Molloy
4482987575 [ARM64] Port over missing subtarget features, and CPU definitions from AArch64.
llvm-svn: 206198
2014-04-14 17:38:00 +00:00
James Molloy
db53ec7e4f [ARM64] Add big endian target arm64_be.
llvm-svn: 206197
2014-04-14 17:37:53 +00:00
Kaelyn Takata
5db7807928 Replace two calls to object::symbol_iterator::increment(), which had
been removed in r200442.

llvm-svn: 206196
2014-04-14 17:26:50 +00:00
Kaelyn Takata
1bd7494436 Remove a variable from r206192 that is only used in an assert.
llvm-svn: 206195
2014-04-14 17:21:50 +00:00
Akira Hatanaka
bf62cde86e Fix a bug in which BranchProbabilityInfo wasn't setting branch weights of basic blocks inside loops correctly.
Previously, BranchProbabilityInfo::calcLoopBranchHeuristics would determine the weights of basic blocks inside loops even when it didn't have enough information to estimate the branch probabilities correctly. This patch fixes the function to exit early if it doesn't see any exit edges or back edges and let the later heuristics determine the weights.

This fixes PR18705 and <rdar://problem/15991090>.

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

llvm-svn: 206194
2014-04-14 16:56:19 +00:00
Richard Trieu
fe14a33790 Fix 2008-03-05-SxtInRegBug.ll so that the CHECK-NOT will not match the filename.
llvm-svn: 206193
2014-04-14 16:53:50 +00:00
Kaelyn Takata
7f0dccdbd8 Fix up MCFixup::getAccessVariant to handle unary expressions.
This allows correct relocations to be generated for a symbolic
address that is being adjusted by a negative constant. Since r204294,
such expressions have triggered undefined behavior when LLVM was built
without assertions.

Credit goes to Rafael for this patch; I'm submitting it on his behalf
as he is on vacation this week.

llvm-svn: 206192
2014-04-14 16:50:22 +00:00
Saleem Abdulrasool
27e18491ee tools: fix heap-buffer-overrun detected via ASAN
Once the auxiliary fields relating to the filename have been inspected, any
following auxiliary fields need not be visited as they have been consumed (the
following fields comprise the filepath as a single unit).

Adjust the test to catch this even if ASAN is not enabled.

llvm-svn: 206190
2014-04-14 16:38:25 +00:00
Daniel Sanders
5698dfd860 [mips] Fix fcopysign for MIPS-IV and add the test.
Summary:
This was another incorrect use of hasMips64() vs isGP64bit().

Depends on D3344

Reviewers: matheusalmeida, vmedic

Reviewed By: vmedic

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

llvm-svn: 206187
2014-04-14 16:24:12 +00:00
Daniel Sanders
a4a46c15fe [mips] MIPS-IV is broadly the same as MIPS64 so duplicate all -mcpu=mips64 tests with -mcpu=mips4 as a starting point
Summary:
Two exceptions to this:
  test/CodeGen/Mips/octeon.ll
  test/CodeGen/Mips/octeon_popcnt.ll
these test extensions to MIPS64

One test is altered for MIPS-IV:
  test/CodeGen/Mips/mips64countleading.ll
    Tests dclo/dclz which were added in MIPS64. The MIPS-IV version tests
    that dclo/dclz are not emitted.

Four tests fail and are not in this patch:
  test/CodeGen/Mips/abicalls.ll
  test/CodeGen/Mips/fcopysign-f32-f64.ll
  test/CodeGen/Mips/fcopysign.ll
  test/CodeGen/Mips/stack-alignment.ll

Depends on D3343

Reviewers: matheusalmeida, vmedic

Reviewed By: vmedic

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

llvm-svn: 206185
2014-04-14 16:00:28 +00:00
Daniel Sanders
b3f0be8f2e [mips] Fix more incorrect uses of HasMips64 and isMips64()
Summary:
- Conditional moves acting on 64-bit GPR's should require MIPS-IV rather than MIPS64
- ISD::MUL, and ISD::MULH[US] should be lowered on all 64-bit ISA's

Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

I've added additional testcases to cover as much of the codegen changes
affecting MIPS-IV as I can. Where I've been unable to find an existing
MIPS64 testcase that can be re-used for MIPS-IV (mainly tests covering
ISD::GlobalAddress and similar), I at least agree that MIPS-IV should
behave like MIPS64. Further testcases that are fixed by this patch will follow
in my next commit. The testcases from that commit that fail for MIPS-IV without
this patch are:
    LLVM :: CodeGen/Mips/2010-07-20-Switch.ll
    LLVM :: CodeGen/Mips/cmov.ll
    LLVM :: CodeGen/Mips/eh-dwarf-cfa.ll
    LLVM :: CodeGen/Mips/largeimmprinting.ll
    LLVM :: CodeGen/Mips/longbranch.ll
    LLVM :: CodeGen/Mips/mips64-f128.ll
    LLVM :: CodeGen/Mips/mips64directive.ll
    LLVM :: CodeGen/Mips/mips64ext.ll
    LLVM :: CodeGen/Mips/mips64fpldst.ll
    LLVM :: CodeGen/Mips/mips64intldst.ll
    LLVM :: CodeGen/Mips/mips64load-store-left-right.ll
    LLVM :: CodeGen/Mips/sint-fp-store_pattern.ll

Reviewers: dsanders

Reviewed By: dsanders

CC: matheusalmeida

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

llvm-svn: 206183
2014-04-14 15:44:42 +00:00
James Molloy
b0f3737522 Teach llvm-lto to respect the given RelocModel.
Patch by Nick Tomlinson!

llvm-svn: 206177
2014-04-14 13:54:16 +00:00
Tim Northover
977888c9a2 ARM64: specify full triple in tests to pacify Windows.
llvm-svn: 206175
2014-04-14 13:18:48 +00:00
Tim Northover
67d0c1d00c AArch64: add newline to end of test files.
Should be no other change.

llvm-svn: 206174
2014-04-14 13:18:40 +00:00
Tim Northover
1ddf6e933e ARM64: remove buggy REV16 pattern.
The 32-bit pattern is still valid: 0123 -> 3210 -> 1032.

llvm-svn: 206172
2014-04-14 12:59:52 +00:00
Tim Northover
837be1f97d AArch64/ARM64: enable directcond.ll test on ARM64.
Code change is because optimizeCompareInstr didn't know how to pull the
condition code out of FCSEL instructions.

llvm-svn: 206171
2014-04-14 12:51:06 +00:00
Tim Northover
3a59e7c449 ARM64: add patterns for csXYZ with reversed operands.
AArch64 tests for this, and it's obviously a good idea. Have to invert the
condition code, of course.

llvm-svn: 206170
2014-04-14 12:51:02 +00:00
Tim Northover
601b8c24ef ARM64: enable more regression tests from AArch64
llvm-svn: 206169
2014-04-14 12:50:58 +00:00
Tim Northover
0f5179b30d ARM64: add support for AArch64's addsub_ext.ll
There was one definite issue in ARM64 (the off-by-1 check for whether
a shift could be folded in) and one difference that is probably
correct: ARM64 didn't fold nodes with multiple uses into the
arithmetic operations unless optimising for code size.

llvm-svn: 206168
2014-04-14 12:50:50 +00:00
Tim Northover
614708ff8e ARM64: optimise (cmp x, (sub 0, y)) to (cmn x, y).
This transformation is only valid when being used for an EQ or NE
comparison since the flags change otherwise.

llvm-svn: 206167
2014-04-14 12:50:47 +00:00
Tim Northover
ce243cb6ce ARM64: start porting regression test suite from AArch64
llvm-svn: 206166
2014-04-14 12:50:41 +00:00
Arnaud A. de Grandmaison
e3379a3373 Display the name of the project failing the url check in the release script
llvm-svn: 206164
2014-04-14 12:36:48 +00:00
Richard Osborne
6d5512a94e [XCore] Don't create invalid MKMSK instructions inside loadImmediate().
Summary:
Previously loadImmediate() would produce MKMSK instructions with invalid
immediate values such as mkmsk r0, 9. Fix this by checking the mask size
is valid.

Reviewers: robertlytton

Reviewed By: robertlytton

CC: llvm-commits

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

llvm-svn: 206163
2014-04-14 12:30:35 +00:00
NAKAMURA Takumi
1a21e608ca Whitespace.
llvm-svn: 206154
2014-04-14 07:03:13 +00:00
NAKAMURA Takumi
c6fb0494ea Revert r206045, "Fix shift by constants for vector."
It broke some builders, at least, i686.

llvm-svn: 206153
2014-04-14 07:02:57 +00:00
Chandler Carruth
feba5396be [Allocator] Hoist the external helper function into a namespace scope
declaration. GCC 4.7 appears to get hopelessly confused by declaring
this function within a member function of a class template. Go figure.

llvm-svn: 206152
2014-04-14 06:42:56 +00:00
Chandler Carruth
10755b471b [cleanup] Normalize YAMLParser.h's doxygen markers with '\foo' instead
of '@foo'. The slash variant is prefered in LLVM and the file was
already using a mixture. =/

llvm-svn: 206151
2014-04-14 06:22:03 +00:00
Hal Finkel
93c495a063 Don't assert in BasicTTI::getMemoryOpCost for non-simple types
BasicTTI::getMemoryOpCost must explicitly check for non-simple types; setting
AllowUnknown=true with TLI->getSimpleValueType is not sufficient because, for
example, non-power-of-two vector types return non-simple EVTs (not MVT::Other).

llvm-svn: 206150
2014-04-14 05:59:09 +00:00
Chandler Carruth
0ecbcadf5d [Allocator] Make the underlying allocator a template instead of an
abstract interface. The only user of this functionality is the JIT
memory manager and it is quite happy to have a custom type here. This
removes a virtual function call and a lot of unnecessary abstraction
from the common case where this is just a *very* thin vaneer around
a call to malloc.

Hopefully still no functionality changed here. =]

llvm-svn: 206149
2014-04-14 05:11:27 +00:00