Commit Graph

218192 Commits

Author SHA1 Message Date
Artem Belevich 7fda3c9ff3 [CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.h
Currently it's easy to break CUDA compilation by passing
"-isystem /path/to/cuda/include" to compiler which leads to
compiler including real cuda_runtime.h from there instead
of the wrapper we need.

Renaming the wrapper ensures that we can include the wrapper
regardless of user-specified include paths and files.

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

llvm-svn: 255802
2015-12-16 18:51:59 +00:00
Chris Bieneman 5ac5d61b9c [CMake] If you're building compiler-rt, the bootstrap build should depend on it.
Adding optional dependency for the bootstrap targets on compiler-rt.

llvm-svn: 255801
2015-12-16 18:49:12 +00:00
Chris Bieneman 475f52c93f [CMake] Make CLANG_BOOTSTRAP_TARGETS overridable
This allows exposing a custom list of targets from the next stage build up.

llvm-svn: 255799
2015-12-16 18:45:53 +00:00
Chris Bieneman 77c5e78e71 [CMake] ExternalProject for compiler-rt needs to depend on llvm-config and clang
The add_dependencies call on compiler-rt-configure adds llvm-config and clang to the phony target, but not to the actual configure custom command. We need the dependency bound to the custom command so that it can't be re-ordered by Ninja.

llvm-svn: 255798
2015-12-16 18:42:14 +00:00
Justin Bogner 883a3ea67f LPM: Make callers of LPM.deleteLoopFromQueue update LoopInfo directly. NFC
As of r255720, the loop pass manager will DTRT when passes update the
loop info for removed loops, so they no longer need to reach into
LPPassManager APIs to do this kind of transformation. This change very
nearly removes the need for the LPPassManager to even be passed into
loop passes - the only remaining pass that uses the LPM argument is
LoopUnswitch.

llvm-svn: 255797
2015-12-16 18:40:20 +00:00
Matt Arsenault e05ff15186 AMDGPU: Override getCFInstrCost
The default cost was 0 with the assumption that it is predictable.

llvm-svn: 255796
2015-12-16 18:37:19 +00:00
Tom Stellard 5ce530608f MachineScheduler: Add a target hook for deciding which RegPressure sets to
increase

Summary:
This patch adds a function called getRegPressureSetScore() to
TargetRegisterInfo.  The MachineScheduler uses this when comparing
instruction that increase the register pressure of different sets
to determine which set is safer to increase.

This hook is useful for GPU targets where the number of registers in the
class is not the best metric for determing which presser set is safer to
increase.

Future work may include adding more parameters to this function, like
for example, the current pressure level of the set or the amount that
the pressure will be increased/decreased.

Reviewers: qcolombet, escha, arsenm, atrick, MatzeB

Subscribers: llvm-commits

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

llvm-svn: 255795
2015-12-16 18:31:01 +00:00
Chris Bieneman d6f5f24a29 [CMake] Adding llvm-profdata to the list of tools clang needs.
Bootstrapping clang to generate PGO data (patches coming soon), requires llvm-profdata targets to be generated before clang.

llvm-svn: 255794
2015-12-16 18:30:36 +00:00
Reid Kleckner 83ebad370c Reland "[llvm-readobj] Simplify usage of -codeview flag"
Relands r255790 with fixed tests.

llvm-svn: 255793
2015-12-16 18:28:12 +00:00
Charlie Turner 5b8895b496 [SLPVectorizer] Ensure dominated reduction values.
When considering incoming values as part of a reduction phi, ensure the
incoming value is dominated by said phi.

Failing to ensure this property causes miscompiles.

Fixes PR25787.

Many thanks to Mattias Eriksson for reporting, reducing and analyzing the
problem for me.

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

llvm-svn: 255792
2015-12-16 18:23:44 +00:00
Reid Kleckner b88796baf7 Revert "[llvm-readobj] Simplify usage of -codeview flag"
This reverts commit r255790.

llvm-svn: 255791
2015-12-16 18:19:34 +00:00
Reid Kleckner d37fe9acb5 [llvm-readobj] Simplify usage of -codeview flag
llvm-svn: 255790
2015-12-16 18:18:39 +00:00
Benjamin Kramer 2c5712051b Generate a clang CompilationDatabase when running CMake
This generates a compile_commands.json file, which tells tools like
YouCompleteMe and clang_complete exactly how to build each source file.

Patch by Justin Lebar!

llvm-svn: 255789
2015-12-16 18:17:45 +00:00
Dan Gohman e2831b4e27 [WebAssembly] Use the new offset syntax for memory operands in inline asm.
llvm-svn: 255788
2015-12-16 18:14:49 +00:00
Ulrich Weigand 88a7a2eac7 [SystemZ] Sort relocs to avoid code corruption by linker optimization
The SystemZ linkers provide an optimization to transform a general-
or local-dynamic TLS sequence into an initial-exec sequence if possible.
Do do that, the compiler generates a function call to __tls_get_offset,
which is a brasl instruction annotated with *two* relocations:

- a R_390_PLT32DBL to install __tls_get_offset as branch target
- a R_390_TLS_GDCALL / R_390_TLS_LDCALL to inform the linker that
  the TLS optimization should be performed if possible

If the optimization is performed, the brasl is replaced by an ld load
instruction.

However, *both* relocs are processed independently by the linker.
Therefore it is crucial that the R_390_PLT32DBL is processed *first*
(installing the branch target for the brasl) and the R_390_TLS_GDCALL
is processed *second* (replacing the whole brasl with an ld).

If the relocs are swapped, the linker will first replace the brasl
with an ld, and *then* install the __tls_get_offset branch target
offset.  Since ld has a different layout than brasl, this may even
result in a completely different (or invalid) instruction; in any
case, the resulting code is corrupted.

Unfortunately, the way the MC common code sorts relocations causes
these two to *always* end up the wrong way around, resulting in
wrong code generation by the linker and crashes.

This patch overrides the sortRelocs routine to detect this particular
pair of relocs and enforce the required order.

llvm-svn: 255787
2015-12-16 18:12:40 +00:00
Ulrich Weigand 47f3649374 [SystemZ] Fix assertion failure in adjustSubwordCmp
When comparing a zero-extended value against a constant small enough to
be in range of the inner type, it doesn't matter whether a signed or
unsigned compare operation (for the outer type) is being used.  This is
why the code in adjustSubwordCmp had this assertion:

    assert(C.ICmpType == SystemZICMP::Any &&
           "Signedness shouldn't matter here.");

assuming the the caller had already detected that fact.  However, it
turns out that there cases, in particular with always-true or always-
false conditions that have not been eliminated when compiling at -O0,
where this is not true.

Instead of failing an assertion if C.ICmpType is not SystemZICMP::Any
here, we can simply *set* it safely to SystemZICMP::Any, however.

llvm-svn: 255786
2015-12-16 18:04:06 +00:00
Tobias Edler von Koch b51460cf86 [Hexagon] Make memcpy lowering thread-safe
This removes an unpleasant hack involving a global variable for special
lowering of certain memcpy calls. These are now lowered as intended in
EmitTargetCodeForMemcpy in the same way that other targets do it.

llvm-svn: 255785
2015-12-16 17:29:37 +00:00
Paul Robinson d083b9a8f6 [PS4][Profile] add "--dependent-lib=libclang_rt.profile-x86_64.a" to
the CC1 command line when enabling code coverage.

Patch by Ying Yi!

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

llvm-svn: 255784
2015-12-16 17:25:27 +00:00
Charlie Turner b69b92855d [NFC] Update horizontal reduction test cases.
These testcases no longer need to specify -slp-vectorize-hor, since it was
enabled by default in r252733.

llvm-svn: 255783
2015-12-16 17:22:24 +00:00
Dan Gohman 30a42bf585 [WebAssembly] Support more kinds of inline asm operands
llvm-svn: 255782
2015-12-16 17:15:17 +00:00
Sumanth Gundapaneni 279c73f9e0 Install runtime dlls in the INSTALL_DIR/bin directory. NFC
One of the earlier patches updated the cmake rule to install the
runtime dlls in INSTALL_DIR/lib which is not correct. This patch
updates the rule to install CMake's RUNTIME in bin directory
Differential Revision: http://reviews.llvm.org/D15505

llvm-svn: 255781
2015-12-16 17:07:15 +00:00
Krzysztof Parzyszek 2005d7dc01 [Packetizer] Add a check whether an instruction should be packetized now
Add a function VLIWPacketizerList::shouldAddToPacket, which will allow
specific implementations to decide if it is profitable to add given
instruction to the current packet.

llvm-svn: 255780
2015-12-16 16:38:16 +00:00
Teresa Johnson cb15b739ef Add RAII wrapper for gold plugin file management
Suggested in review of r255256.

llvm-svn: 255779
2015-12-16 16:34:06 +00:00
Vaivaswatha Nagaraj fb3f4907c0 Add InaccessibleMemOnly and inaccessibleMemOrArgMemOnly attributes
Summary:
This patch introduces two new function attributes 

InaccessibleMemOnly: This attribute indicates that the function may only access memory that is not accessible by the program/IR being compiled. This is a weaker form of ReadNone.
inaccessibleMemOrArgMemOnly: This attribute indicates that the function may only access memory that is either not accessible by the program/IR being compiled, or is pointed to by its pointer arguments. This is a weaker form of  ArgMemOnly

Test cases have been updated. This revision uses this (d001932f3a) as reference.

Reviewers: jmolloy, hfinkel

Subscribers: reames, joker.eph, llvm-commits

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

llvm-svn: 255778
2015-12-16 16:16:19 +00:00
Tobias Grosser 10120189ab ScopInfo: Directly store MemoryAccessList in InstructionToAccess
This avoids the need for explicit memory management, simplifies the code and
also fixes a memory leak in removeMemoryAccesses.

llvm-svn: 255777
2015-12-16 16:14:03 +00:00
Tobias Grosser 2ed317383b ScopInfo: Introduce getNumberOfArrayAccesses
Use the new function to clarify that we indeed only want to know it at least
one array access is associated with an instruction.

llvm-svn: 255776
2015-12-16 16:14:00 +00:00
Todd Fiala 271186bbb6 Remove the "MacOSX and Linux" and "Linux" targets from Xcode.
I added these long ago, but as we work to simplify the Xcode
project, their lack of use has made them cleanup targets.

llvm-svn: 255775
2015-12-16 16:09:59 +00:00
Ed Maste a6b380652d Wrap Notes in --help output to 80 columns
llvm-svn: 255774
2015-12-16 15:49:38 +00:00
Manuel Klimek 66a4dae57f Make matchers thread compatible, so we can pass them to different threads and run them on multiple translation units in parallel.
llvm-svn: 255773
2015-12-16 15:48:58 +00:00
Alexander Kornienko 2a538309ac [clang-tidy] google-readability-namespace-comments: ignore stray semicolons
llvm-svn: 255772
2015-12-16 15:44:42 +00:00
Ed Maste f7fe3b99c7 Include -c, -core in the lldb(1) man page
llvm-svn: 255771
2015-12-16 15:37:21 +00:00
Alexander Kornienko 821ca470bb [clang-tidy] Add namespace support to add_new_check.py
Summary: Without namespace you can not create checks with same name in different modules

Reviewers: alexfh

Subscribers: cfe-commits

Patch by Cong Liu!

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

llvm-svn: 255770
2015-12-16 15:05:27 +00:00
Ed Maste d4ff820fb8 Man page whitespace/formatting change to appease igor(1)
igor is a tool to detect common problems and style conformance issues in
man pages and other documents.  This is a non-content change to address
the items it reported, before making content changes.

See http://www.wonkity.com/~wblock/igor/igor.1.html for more information
about igor(1).

llvm-svn: 255769
2015-12-16 14:59:48 +00:00
Simon Atanasyan 09dae7c3e7 [ELF][MIPS] Handle R_MIPS_HI16/LO16 relocations against _gp_disp symbol
The `_gp_disp` is a magic symbol designates offset between start of
function and gp pointer into GOT. Only `R_MIPS_HI16` and `R_MIPS_LO16`
relocations are permitted with `_gp_disp`. The patch adds the `_gp_disp`
as an ignored symbol and adjusts symbol value before call the `relocateOne`
for `R_MIPS_HI16/LO16` relocations.

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

llvm-svn: 255768
2015-12-16 14:45:09 +00:00
James Molloy 3d21dcf3ed [SimplifyCFG] Don't create unnecessary PHIs
In conditional store merging, we were creating PHIs when we didn't
need to. If the value to be predicated isn't defined in the block
we're predicating, then it doesn't need a PHI at all (because we only
deal with triangles and diamonds, any value not in the predicated BB
must dominate the predicated BB).

This fixes a large code size increase in some benchmarks in a popular embedded benchmark suite.

Now with a fix (and fixed tests) for the conformance issue seen in Chromium.

llvm-svn: 255767
2015-12-16 14:12:44 +00:00
Andrey Bokhanko 0b135e05ec [x86] Exclusion of incorrect include headers paths for MCU target
Exclusion of /usr/include and /usr/local/include headers paths for MCU target.

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

llvm-svn: 255766
2015-12-16 13:27:38 +00:00
Alexander Kornienko d819364e81 [clang-tidy] Don't use diag() for debug output
llvm-svn: 255765
2015-12-16 13:19:08 +00:00
Oliver Stannard 2de8c16913 [ARM] Add ARMv8.2-A FP16 vector instructions
ARMv8.2-A adds 16-bit floating point versions of all existing SIMD
floating-point instructions. This is an optional extension, so all of
these instructions require the FeatureFullFP16 subtarget feature.

Note that VFP without SIMD is not a valid combination for any version of
ARMv8-A, but I have ensured that these instructions all depend on both
FeatureNEON and FeatureFullFP16 for consistency.

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

llvm-svn: 255764
2015-12-16 12:37:39 +00:00
Pavel Labath 25e241b006 [test] Add ability to expect timeouts
Summary:
This adds ability to mark test that do not complete due to hangs, crashes, etc., as "expected",
to avoid flagging the build red for a known problem. Functionally, this extends the scope of the
existing expectedFailureXXX decorators to cover these states as well. Once this is in, I will
start replacing the magic list of failing tests in dosep.py with our regular annotations which
should hopefully make code simpler.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 255763
2015-12-16 12:09:45 +00:00
Oliver Stannard 48568cbe18 [ARM] Add ARMv8.2-A FP16 scalar instructions
ARMv8.2-A adds 16-bit floating point versions of all existing VFP
floating-point instructions. This is an optional extension, so all of
these instructions require the FeatureFullFP16 subtarget feature.

The assembly for these instructions uses S registers (AArch32 does not
have H registers), but the instructions have ".f16" type specifiers
rather than ".f32" or ".f64". The top 16 bits of each source register
are ignored, and the top 16 bits of the destination register are set to
zero.

These instructions are mostly the same as the 32- and 64-bit versions,
but they use coprocessor 9 rather than 10 and 11.

Two new instructions, VMOVX and VINS, have been added to allow packing
and extracting two 16-bit floats stored in the top and bottom halves of
an S register.

New fixup kinds have been added for the PC-relative load and store
instructions, but no ELF relocations have been added as they have a
range of 512 bytes.

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

llvm-svn: 255762
2015-12-16 11:35:44 +00:00
Michael Kuperstein e75e6e2a23 [X86] Improve shift combining
This folds (ashr (shl a, [56,48,32,24,16]), SarConst)
into       (shl, (sext (a), [56,48,32,24,16] - SarConst))
or into    (lshr, (sext (a), SarConst - [56,48,32,24,16]))
depending on sign of (SarConst - [56,48,32,24,16])

sexts in X86 are MOVs.
The MOVs have the same code size as above SHIFTs (only SHIFT by 1 has lower code size).
However the MOVs have 2 advantages to SHIFTs on x86:
1. MOVs can write to a register that differs from source.
2. MOVs accept memory operands.

This fixes PR24373.

Patch by: evgeny.v.stupachenko@intel.com
Differential Revision: http://reviews.llvm.org/D13161

llvm-svn: 255761
2015-12-16 11:22:37 +00:00
Keno Fischer 94f181a45f [SectionMemoryManager] Make better use of virtual memory
Summary: On Windows, the allocation granularity can be significantly
larger than a page (64K), so with many small objects, just clearing
the FreeMem list rapidly leaks quite a bit of virtual memory space
(if not rss). Fix that by only removing those parts of the FreeMem
blocks that overlap pages for which we are applying memory permissions,
rather than dropping the FreeMem blocks entirely.

Reviewers: lhames

Subscribers: llvm-commits

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

llvm-svn: 255760
2015-12-16 11:13:23 +00:00
Vikram TV 859ad29b52 Recommit LiveDebugValues pass after fixing a couple of minor issues.
llvm-svn: 255759
2015-12-16 11:09:48 +00:00
Alexander Kornienko 32032f5e64 [clang-tidy] Fix a crash in misc-new-delete-overloads
llvm-svn: 255758
2015-12-16 10:58:14 +00:00
Daniel Jasper d2629dc812 clang-format: Extend header sort category implementation.
Specifically, it is sometimes necessary to keep certain #includes as
the first #include, even before the main #include for a .cc file.
Switching the category to be signed instead of unsigned isn't ideal,
but it seems as good of an option as any and is fully backwards
compatible.

llvm-svn: 255757
2015-12-16 10:10:16 +00:00
Chen Li e2222fdf95 Remove FileCheck from test case token_landingpad.ll.
The test case only needs to make sure it does not crash LLVM.

llvm-svn: 255755
2015-12-16 06:27:09 +00:00
Akira Hatanaka 8ebd580cf5 [Objective-c] Fix a crash that occurs when ObjCTypeParamList::back() is
called on an empty list.

This commit makes Parser::parseObjCTypeParamListOrProtocolRefs return
nullptr if it sees an invalid type parameter (e.g., __kindof) in the
type parameter list.

rdar://problem/23068920

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

llvm-svn: 255754
2015-12-16 06:25:38 +00:00
Craig Topper c82f896188 [CodeGen] Use llvm::CmpInst::Predicate instead of unsigned for parameter types in EmitCompare to eliminate some later explicit casts. NFC.
llvm-svn: 255753
2015-12-16 06:24:28 +00:00
Cong Hou 08ec3d91bb Minor change to TailDuplication.cpp to turn on normalization when removing successor
llvm-svn: 255752
2015-12-16 06:03:30 +00:00
George Burgess IV 500d3039d7 Minor cleanup of Attribute code. NFC.
llvm-svn: 255751
2015-12-16 05:21:02 +00:00