Commit Graph

192792 Commits

Author SHA1 Message Date
Simon Pilgrim cd32254a35 [X86][XOP] Added XOP memory folding patterns + tests
This patch adds the complete AMD Bulldozer XOP instruction set to the memory folding pattern tables for stack folding, etc.

Note: Many of the XOP instructions have multiple table entries as it can fold loads from different sources.

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

llvm-svn: 228685
2015-02-10 12:57:17 +00:00
Jozef Kolek d68d424abf [mips][microMIPS] Fix disassembling of 16-bit microMIPS instructions LWM16 and SWM16
Differential Revision: http://reviews.llvm.org/D7436

llvm-svn: 228683
2015-02-10 12:41:13 +00:00
Andrea Di Biagio 62622d2396 [X86][FastIsel] Avoid introducing legacy SSE instructions if the target has AVX.
This patch teaches X86FastISel how to select AVX instructions for scalar
float/double convert operations.

Before this patch, X86FastISel always selected legacy SSE instructions
for FPExt (from float to double) and FPTrunc (from double to float).

For example:
\code
  define double @foo(float %f) {
    %conv = fpext float %f to double
    ret double %conv
  }
\end code

Before (with -mattr=+avx -fast-isel) X86FastIsel selected a CVTSS2SDrr which is
legacy SSE:
  cvtss2sd %xmm0, %xmm0

With this patch, X86FastIsel selects a VCVTSS2SDrr instead:
  vcvtss2sd %xmm0, %xmm0, %xmm0

Added test fast-isel-fptrunc-fpext.ll to check both the register-register and
the register-memory float/double conversion variants.

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

llvm-svn: 228682
2015-02-10 12:04:41 +00:00
Ilia K c4f7fdf571 Add thread-id field in *stopped notification (MI)
Summary:
Add thread-id field in *stopped notification (MI) + tests

All tests pass on OS X

Reviewers: zturner, clayborg, abidh

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, clayborg, abidh

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

llvm-svn: 228681
2015-02-10 12:02:03 +00:00
Denis Protivensky e35908b18f [ELF][ARM] Add veneer generation to branch instructions
When calling ARM code from Thumb and vice versa,
a veneer that switches instruction set should be generated.
Added veneer generation for ARM_JUMP24 ARM_THM_JUMP24 instructions.

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

llvm-svn: 228680
2015-02-10 09:31:42 +00:00
Gabor Horvath d4637fb433 [clang-tidy] Checker for inaccurate use of erase() method.
Algorithms like remove() does not actually remove any element from the
container but returns an iterator to the first redundant element at the end
of the container. These redundant elements must be removed using the
erase() method. This check warns when not all of the elements will be
removed due to using an inappropriate overload.

Reviewer: alexfh

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

llvm-svn: 228679
2015-02-10 09:14:26 +00:00
James Molloy 256f7ecad4 Fix __ldrexd arm intrinsic.
The parameter definition of this API is const volatile __int64*, but it is not defined correctly in clang. Move the 'CD' to the correct location.

Bug tracked here: http://llvm.org/bugs/show_bug.cgi?id=21004

Patch by Daniel Jump!

llvm-svn: 228678
2015-02-10 09:09:04 +00:00
Chandler Carruth 2496910325 Revert r228556: InstCombine: propagate nonNull through assume
This commit isn't using the correct context, and is transfoming calls
that are operands to loads rather than calls that are operands to an
icmp feeding into an assume. I've replied on the original review thread
with a very reduced test case and some thoughts on how to rework this.

llvm-svn: 228677
2015-02-10 08:07:32 +00:00
Lang Hames 70f78e3906 [Orc] Fix a bug in the LazyEmittingLayer - capture names by value (as
std::strings) rather than StringRefs in JITSymbol get-address lambda.

Capturing a StringRef by-value is still effectively capturing a reference, which
is no good here because the referenced string may be gone by the time the lambda
is being evaluated the original value may be gone. Make sure to capture a
std::string instead.

No test case: This bug doesn't manifest under OrcMCJITReplacement, since it
keeps IR modules (from which the StringRefs are sourced) alive permanently.

llvm-svn: 228676
2015-02-10 07:35:39 +00:00
Lang Hames 5b8cf29390 [Orc] Add missing casserts header to JITSymbol.h.
llvm-svn: 228675
2015-02-10 07:26:19 +00:00
Ilia K 536594f30e Add tests for -interpreter-exec command (MI)
llvm-svn: 228674
2015-02-10 06:35:58 +00:00
Bob Wilson 14ebd851d9 Do not force "-static" for aarch64 iOS kernel/kext assembly code.
Somehow a check for aarch64 was added to the Darwin toolchain's
isKernelStatic function as part of the initial commit for Apple's
arm64 target (r205100). That check was not in any of Apple's internal
code and no one here knows where it came from. It has been harmless
because "-static" does not change much, if anything, for arm64 iOS code,
but it makes no sense to keep this check.

llvm-svn: 228673
2015-02-10 06:33:04 +00:00
Craig Topper 9e71b82f40 [X86] Preserve mem refs on newly created 'Store' node instead of 'Load' node when handling store unfolding.
Bug spotted by Steve King.

I have no idea how to test this.

llvm-svn: 228672
2015-02-10 06:29:28 +00:00
Craig Topper f7e92f10b6 [X86] Remove unnecessary alignment checks from the load folding tables.
llvm-svn: 228671
2015-02-10 05:10:50 +00:00
Zachary Turner aeedd65c64 Teach llvm_add_library() to find include dirs.
Since header files are not compilation units, CMake does not require
you to specify them in the CMakeLists.txt file.  As a result, unless a
header file is explicitly added, CMake won't know about it, and when
generating IDE-based projects, CMake won't put the header files into
the IDE project.  LLVM currently tries to deal with this in two ways:

  1) It looks for all .h files that are in the project directory, and
     adds those.
  2) llvm_add_library() understands the ADDITIONAL_HEADERS argument,
     which allows one to list an arbitrary list of headers.

This patch takes things one step further.  It adds the ability for
llvm_add_library() to take an ADDITIONAL_HEADER_DIRS argument, which
will specify a list of folders which CMake will glob for header files.
Furthermore, it will glob not only for .h files, but also for .inc
files.

Included in this CL is an update to one of the existing users of
ADDITIONAL_HEADERS to use this new argument instead, to serve as an
illustration of how this cleans up the CMake.

The big advantage of this new approach is that until now, there was no
way for the IDE projects to locate the header files that are in the
include tree.  In other words, if you are in, for example,
lib/DebugInfo/DWARF, the corresponding includes for this project will
be located under include/llvm/DebugInfo/DWARF.  Now, in the
CMakeLists.txt for lib/DebugInfo/DWARF, you can simply write:

  ADDITIONAL_HEADER_DIRS
  ../../include/llvm/DebugInfo/DWARF

as an argument to llvm_add_library(), and all header files will get
added to the IDE project.

Differential Revision: http://reviews.llvm.org/D7460
Reviewed By: Chris Bieneman

llvm-svn: 228670
2015-02-10 05:04:37 +00:00
Zachary Turner 733b849a30 Define HAVE_DIA_SDK on Windows when DIA is present.
This allows all CMake projects, as well as C++ code, to detect if
and when DIA SDK is available for use so that we can enable the
DIA-based PDB reader implementation.

Differential Revision: http://reviews.llvm.org/D7457
Reviewed By: Chandler Carruth

llvm-svn: 228669
2015-02-10 05:04:25 +00:00
Saleem Abdulrasool bb0aba7a00 unwind: improve compilation on Linux with gcc
gcc still defaults to C89 which does not support BCPL style comments.  This
splits up the sources list in CMakeLists and selectively adds compile flags for
using C99 which avoids a number of warnings in -Wpedantic mode.  NFC.

llvm-svn: 228665
2015-02-10 03:43:33 +00:00
Saleem Abdulrasool 10abd2ad1c unwind: clean up some stray semicolons
Clean up some stray semicolons found by GCC 4.9 -Wpedantic.  NFC.

llvm-svn: 228664
2015-02-10 03:43:31 +00:00
Saleem Abdulrasool 1dd9f685f4 unwind: clean up -Wundef warnings
The unified register management interfaces had multiple naked macros for
conditional logic.  This cleans them up to use the defined() form, avoiding
-Wundef warnings.  NFC.

llvm-svn: 228663
2015-02-10 03:43:28 +00:00
Saleem Abdulrasool 2fdc44021f unwind: fix -Wformat warnings from gcc
Clean up the format specifiers for pedantic compilation with gcc 4.9 on Linux.
NFC.

llvm-svn: 228662
2015-02-10 03:43:23 +00:00
Richard Smith e8292b10a6 [modules] When determining whether a name from a module replaces a name we
already have, check whether the name from the module is actually newer than the
existing declaration. If it isn't, we might (say) replace a visible declaration
with an injected friend, and thus make it invisible (or lose a default argument
or an array bound).

llvm-svn: 228661
2015-02-10 03:28:10 +00:00
Enrico Granata c11b101fb6 And make the globbing behavior available via the SB API
llvm-svn: 228660
2015-02-10 03:16:55 +00:00
Enrico Granata af61b65f63 Add a test case for the launch via argdumper globbing mechanism
llvm-svn: 228659
2015-02-10 03:13:22 +00:00
Enrico Granata d7a83a9c66 Add a "launch with globber" mode that lets you launch a process after having globbed the command line arguments via argdumper instead of routing via /bin/sh
llvm-svn: 228658
2015-02-10 03:06:24 +00:00
Nick Lewycky 1cbc13a928 Remove non-test files that appear to have been accidentally committed in r228641.
llvm-svn: 228657
2015-02-10 02:39:17 +00:00
Chandler Carruth b65d61a2e8 [x86] Fix PR22524: the DAG combiner was incorrectly handling illegal
nodes when folding bitcasts of constants.

We can't fold things and then check after-the-fact whether it was legal.
Once we have formed the DAG node, arbitrary other nodes may have been
collapsed to it. There is no easy way to go back. Instead, we need to
test for the specific folding cases we're interested in and ensure those
are legal first.

This could in theory make this less powerful for bitcasting from an
integer to some vector type, but AFAICT, that can't actually happen in
the SDAG so its fine. Now, we *only* whitelist specific int->fp and
fp->int bitcasts for post-legalization folding. I've added the test case
from the PR.

(Also as a note, this does not appear to be in 3.6, no backport needed)

llvm-svn: 228656
2015-02-10 02:25:56 +00:00
Duncan P. N. Exon Smith 9e95f27eff Verifier: reuse getInlinedAt() result, NFC
llvm-svn: 228655
2015-02-10 02:25:18 +00:00
Larisse Voufo bcf327af7b A temporary fix for backward compatibility breakages caused by PR12117.
llvm-svn: 228654
2015-02-10 02:20:14 +00:00
Mehdi Amini 87661fb963 [DOC] Asserts are only enabled in Debug build, update the doc accordingly
Summary:
The CMake configuration is explicitely looking for Debug build, all the
other variant disable assertions.

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 228653
2015-02-10 02:04:29 +00:00
Duncan P. N. Exon Smith bd33d375f0 IR: Remove unnecessary fields from MDTemplateParameter
I noticed this fields were never used in r228607, but I neglected to
propagate that into `MDTemplateParameter` until now.  This really should
have been done before commit in r228640; sorry for the churn.

llvm-svn: 228652
2015-02-10 01:59:57 +00:00
Alexey Samsonov e977a8c747 [ASan] Add missing RUN: prefix.
llvm-svn: 228651
2015-02-10 01:55:02 +00:00
Alexey Samsonov 54a0e40442 [CMake] PowerPC: detect host endianness to build corresponding version of runtimes.
Prior to this change we built two identical runtimes, named "powerpc64"
and "powerpc64le", while their actual endianness matched the host
endianness.

llvm-svn: 228650
2015-02-10 01:42:44 +00:00
Duncan P. N. Exon Smith e4725beba7 Verifier: Check for valid tags in debug nodes
Check that specialized `DebugNode`s have valid `DW_TAG`s.

llvm-svn: 228649
2015-02-10 01:40:40 +00:00
Duncan P. N. Exon Smith dddc537cc0 IR: Add accessors to MDExpression
Add some accessors to `MDExpression`.

llvm-svn: 228648
2015-02-10 01:36:46 +00:00
Duncan P. N. Exon Smith 692bdb910d Verifier: Add simple checks for MDLocation
llvm-svn: 228647
2015-02-10 01:32:56 +00:00
Rui Ueyama 7960d04f13 Driver: Replace switch cases with ifs.
We used to do like this instead of putting all command line processing
code within one gigantic switch statement. It is converted to a switch
in r188958, which introduced InputGraph.

In this patch I roll that change back. Now all "break"s are removed,
and the nesting is one level shallow.

llvm-svn: 228646
2015-02-10 01:10:23 +00:00
Duncan P. N. Exon Smith b0a19ad08a Verifier: Create stubs for specialized metadata nodes
llvm-svn: 228645
2015-02-10 01:09:50 +00:00
Duncan P. N. Exon Smith ed458fa12c AsmParser: Add stubs for specialized MDNodes, NFC
Well, the exact error from the failed parse will change, but...

llvm-svn: 228644
2015-02-10 01:08:16 +00:00
Rui Ueyama 55240af6a3 Remove trailing space.
llvm-svn: 228643
2015-02-10 01:06:14 +00:00
David Majnemer 93c22a45be X86: Emit an ABI compliant prologue and epilogue for Win64
Win64 has specific contraints on what valid prologues and epilogues look
like.  This constraint is born from the flexibility and descriptiveness
of Win64's unwind opcodes.

Prologues previously emitted by LLVM could not be represented by the
unwind opcodes, preventing operations powered by stack unwinding to
successfully work.

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

llvm-svn: 228641
2015-02-10 00:57:42 +00:00
Duncan P. N. Exon Smith 01fc176977 IR: Add specialized debug info metadata nodes
Add specialized debug info metadata nodes that match the `DIDescriptor`
wrappers (used by `DIBuilder`) closely.  Assembly and bitcode support to
follow soon (it'll mostly just be obvious), but this sketches in today's
schema.  This is the first big commit (well, the only *big* one aside
from the testcase changes that'll come when I move this into place) for
PR22464.

I've marked a bunch of obvious changes as `TODO`s in the source; I plan
to make those changes promptly after this hierarchy is moved underneath
`DIDescriptor`, but for now I'm aiming mostly to match the status quo.

llvm-svn: 228640
2015-02-10 00:52:32 +00:00
Chaoren Lin be270c1c60 Add JSON.cpp to CMakeLists.txt
llvm-svn: 228639
2015-02-10 00:47:43 +00:00
Eric Christopher d49868080e Migrate PPCAsmPrinter's subtarget from reference to pointer in
preparation for making it MachineFunction dependent.

llvm-svn: 228638
2015-02-10 00:44:17 +00:00
Lang Hames b96afab184 [Orc] Back out one of the GCC ICE workarounds from r228568. NFC.
llvm-svn: 228637
2015-02-10 00:37:26 +00:00
Enrico Granata 89fdc9a61e Add a JSON producer to LLDB - this is a set of classes that encapsulate JSON objects and allow you to write them to a Stream for subsequent processing
Using this JSON producer, write a little tool that expands its own command-line arguments and dumps them to stdout as a JSON array

llvm-svn: 228636
2015-02-10 00:30:07 +00:00
David Blaikie 36a036909c Fix the clang -Werror build (-Wunused-variable)
llvm-svn: 228635
2015-02-10 00:16:36 +00:00
Philip Reames 7e7dc3e9df Adjust how we avoid poll insertion inside the poll function (NFC)
I realized that my early fix for this was overly complicated.  Rather than scatter checks around in a bunch of places, just exit early when we visit the poll function itself.

Thinking about it a bit, the whole inlining mechanism used with gc.safepoint_poll could probably be cleaned up a bit.  Originally, poll insertion was fused with gc relocation rewriting.  It might be worth going back to see if we can simplify the chain of events now that these two are seperated.  As one thought, maybe it makes sense to rewrite calls inside the helper function before inlining it to the many callers.  This would require us to visit the poll function before any other functions though..

llvm-svn: 228634
2015-02-10 00:04:53 +00:00
Aaron Ballman 6e82ddc5b4 Reverting r228628; it broke at least one builder due to the forward declare of RaiseException.
llvm-svn: 228633
2015-02-10 00:00:54 +00:00
Adrian Prantl 34e7590e0d Debug info: When updating debug info during SROA, do not emit debug info
for any padding introduced by SROA. In particular, do not emit debug info
for an alloca that represents only the padding introduced by a previous
iteration.

Fixes PR22495.

llvm-svn: 228632
2015-02-09 23:57:22 +00:00
Adrian Prantl 27bd01f71c Debug info: Use DW_OP_bit_piece instead of DW_OP_piece in the
intermediate representation. This
- increases consistency by using the same granularity everywhere
- allows for pieces < 1 byte
- DW_OP_piece didn't actually allow storing an offset.

Part of PR22495.

llvm-svn: 228631
2015-02-09 23:57:15 +00:00