platform/upstream/llvm.git
9 years ago[x86,sdag] Two interrelated changes to the x86 and sdag code.
Chandler Carruth [Thu, 19 Feb 2015 10:36:19 +0000 (10:36 +0000)]
[x86,sdag] Two interrelated changes to the x86 and sdag code.

First, don't combine bit masking into vector shuffles (even ones the
target can handle) once operation legalization has taken place. Custom
legalization of vector shuffles may exist for these patterns (making the
predicate return true) but that custom legalization may in some cases
produce the exact bit math this matches. We only really want to handle
this prior to operation legalization.

However, the x86 backend, in a fit of awesome, relied on this. What it
would do is mark VSELECTs as expand, which would turn them into
arithmetic, which this would then match back into vector shuffles, which
we would then lower properly. Amazing.

Instead, the second change is to teach the x86 backend to directly form
vector shuffles from VSELECT nodes with constant conditions, and to mark
all of the vector types we support lowering blends as shuffles as custom
VSELECT lowering. We still mark the forms which actually support
variable blends as *legal* so that the custom lowering is bypassed, and
the legal lowering can even be used by the vector shuffle legalization
(yes, i know, this is confusing. but that's how the patterns are
written).

This makes the VSELECT lowering much more sensible, and in fact should
fix a bunch of bugs with it. However, as you'll see in the test cases,
right now what it does is point out the *hilarious* deficiency of the
new vector shuffle lowering when it comes to blends. Fortunately, my
very next patch fixes that. I can't submit it yet, because that patch,
somewhat obviously, forms the exact and/or pattern that the DAG combine
is matching here! Without this patch, teaching the vector shuffle
lowering to produce the right code infloops in the DAG combiner. With
this patch alone, we produce terrible code but at least lower through
the right paths. With both patches, all the regressions here should be
fixed, and a bunch of the improvements (like using 2 shufps with no
memory loads instead of 2 andps with memory loads and an orps) will
stay. Win!

There is one other change worth noting here. We had hilariously wrong
vectorization cost estimates for vselect because we fell through to the
code path that assumed all "expand" vector operations are scalarized.
However, the "expand" lowering of VSELECT is vector bit math, most
definitely not scalarized. So now we go back to the correct if horribly
naive cost of "1" for "not scalarized". If anyone wants to add actual
modeling of shuffle costs, that would be cool, but this seems an
improvement on its own. Note the removal of 16 and 32 "costs" for doing
a blend. Even in SSE2 we can blend in fewer than 16 instructions. ;] Of
course, we don't right now because of OMG bad code, but I'm going to fix
that. Next patch. I promise.

llvm-svn: 229835

9 years agoMake -fmodules-decluse and -fmodules-strict-decluse compatible options.
Daniel Jasper [Thu, 19 Feb 2015 09:56:13 +0000 (09:56 +0000)]
Make -fmodules-decluse and -fmodules-strict-decluse compatible options.

They don't actually influence the result of the module compilation.

llvm-svn: 229834

9 years ago[LSan][MIPS64] Enable LSan testing for mips64/mips64el
Mohit K. Bhakkad [Thu, 19 Feb 2015 09:14:43 +0000 (09:14 +0000)]
[LSan][MIPS64] Enable LSan testing for mips64/mips64el

Patch by Sagar Thakur

Reviewers: petarj, earthdok, kcc.

Subscribers:  samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229833

9 years agotsan: fix PTRACE_ATTACH handling during stop-the-world
Dmitry Vyukov [Thu, 19 Feb 2015 09:02:29 +0000 (09:02 +0000)]
tsan: fix PTRACE_ATTACH handling during stop-the-world

If the thread receives a signal concurrently with PTRACE_ATTACH,
we can get notification about the signal before notification about stop.
In such case we need to forward the signal to the thread, otherwise
the signal will be missed (as we do PTRACE_DETACH with arg=0) and
any logic relying on signals will break. After forwarding we need to
continue to wait for stopping, because the thread is not stopped yet.
We do ignore delivery of SIGSTOP, because we want to make stop-the-world
as invisible as possible.

http://reviews.llvm.org/D7723

 --This line, and those below, will be ignored--
M    lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
M    test/tsan/signal_segv_handler.cc

llvm-svn: 229832

9 years agoUse std::bitset for SubtargetFeatures
Michael Kuperstein [Thu, 19 Feb 2015 09:01:04 +0000 (09:01 +0000)]
Use std::bitset for SubtargetFeatures

Previously, subtarget features were a bitfield with the underlying type being uint64_t.
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.

No functional change.

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

llvm-svn: 229831

9 years ago[LSan] [MIPS] adding support of LSan for mips64/mips64el arch
Mohit K. Bhakkad [Thu, 19 Feb 2015 07:30:39 +0000 (07:30 +0000)]
[LSan] [MIPS] adding support of LSan for mips64/mips64el arch

Patch by Sagar Thakur

Reviewers: petarj, earthdok, kcc.

Subscribers:  samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229830

9 years agoMark DR1940 as implemented
David Majnemer [Thu, 19 Feb 2015 07:29:01 +0000 (07:29 +0000)]
Mark DR1940 as implemented

llvm-svn: 229829

9 years agoMark DR1947 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:57 +0000 (07:28 +0000)]
Mark DR1947 as implemented

llvm-svn: 229828

9 years agoMark DR1948 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:55 +0000 (07:28 +0000)]
Mark DR1948 as implemented

llvm-svn: 229827

9 years agoMark DR1994 as a duplicate of DR529
David Majnemer [Thu, 19 Feb 2015 07:28:52 +0000 (07:28 +0000)]
Mark DR1994 as a duplicate of DR529

llvm-svn: 229826

9 years agoMark DR1968 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:49 +0000 (07:28 +0000)]
Mark DR1968 as implemented

llvm-svn: 229825

9 years ago[Support/Timer] Make GetMallocUsage() aware of jemalloc.
Davide Italiano [Thu, 19 Feb 2015 07:27:14 +0000 (07:27 +0000)]
[Support/Timer] Make GetMallocUsage() aware of jemalloc.

Differential Revision: D7657
Reviewed by: shankarke, majnemer

llvm-svn: 229824

9 years agoCXXNameMangler::mangleUnresolvedPrefix(): Prune an obsolete \param, according to...
NAKAMURA Takumi [Thu, 19 Feb 2015 07:14:26 +0000 (07:14 +0000)]
CXXNameMangler::mangleUnresolvedPrefix(): Prune an obsolete \param, according to r229809. [-Wdocumentation]

llvm-svn: 229823

9 years agoItanium ABI: Don't pass nullptr to a bool argument
David Majnemer [Thu, 19 Feb 2015 05:51:14 +0000 (05:51 +0000)]
Itanium ABI: Don't pass nullptr to a bool argument

llvm-svn: 229822

9 years ago[Orc][Kaleidoscope] Fix typo in tutorial comment.
Lang Hames [Thu, 19 Feb 2015 05:33:30 +0000 (05:33 +0000)]
[Orc][Kaleidoscope] Fix typo in tutorial comment.

llvm-svn: 229821

9 years agoScopDetection: Only detect scops that have at least one read and one write
Tobias Grosser [Thu, 19 Feb 2015 05:31:07 +0000 (05:31 +0000)]
ScopDetection: Only detect scops that have at least one read and one write

Scops that only read seem generally uninteresting and scops that only write are
most likely initializations where there is also little to optimize.  To not
waste compile time we bail early.

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

llvm-svn: 229820

9 years agoProvide the same ABI regardless of NDEBUG
Dmitri Gribenko [Thu, 19 Feb 2015 05:30:16 +0000 (05:30 +0000)]
Provide the same ABI regardless of NDEBUG

For projects depending on LLVM, I find it very useful to combine a
release-no-asserts build of LLVM with a debug+asserts build of the dependent
project.  The motivation is that when developing a dependent project, you are
debugging that project itself, not LLVM.  In my usecase, a significant part of
the runtime is spent in LLVM optimization passes, so I would like to build LLVM
without assertions to get the best performance from this combination.

Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides
depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra
symbols when NDEBUG is not defined.  Thus, it is not possible to enable
assertions in an external project that uses facilities of `Debug.h`.

This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols
that other code may depend on when #including LLVM headers without NDEBUG.

http://reviews.llvm.org/D7662

llvm-svn: 229819

9 years agoUpdate C++ implementation status page with recent changes w.r.t. to sized deallocation.
Larisse Voufo [Thu, 19 Feb 2015 04:34:13 +0000 (04:34 +0000)]
Update C++ implementation status page with recent changes w.r.t. to sized deallocation.

llvm-svn: 229818

9 years ago[MSVC] Improved lookup into dependent/non-dependent bases of dependent class
Alexey Bataev [Thu, 19 Feb 2015 04:28:23 +0000 (04:28 +0000)]
[MSVC] Improved lookup into dependent/non-dependent bases of dependent class
Patch improves lookup into dependendt bases of dependent class and adds lookup
into non-dependent bases.
Differential Revision: http://reviews.llvm.org/D7173

llvm-svn: 229817

9 years agoPECOFF: Fix base relocation for an absolute symbol.
Rui Ueyama [Thu, 19 Feb 2015 04:22:27 +0000 (04:22 +0000)]
PECOFF: Fix base relocation for an absolute symbol.

Previously we wrongly emitted a base relocation entry for an absolute symbol.
That made the loader to rewrite some instruction operands with wrong values
only when a DLL is not loaded at the default address. That caused a
misterious crash of some executable.

Absolute symbols will of course never change value wherever the binary is
loaded to memory. We shouldn't emit base relocations for absolute symbols.

llvm-svn: 229816

9 years agoRevert adding hostname to module hash
Ben Langmuir [Thu, 19 Feb 2015 04:03:57 +0000 (04:03 +0000)]
Revert adding hostname to module hash

I didn't realize how easily the hostname could change - for example just
changing wireless networks seems to prompt it in some cases.

Users can always set their own local module cache path to avoid this.

This reverts commits r228592, 228594, 228601 and 228613.
rdar://19287368

llvm-svn: 229815

9 years agoPECOFF: use llvm-readobj to dump .reloc section
Rui Ueyama [Thu, 19 Feb 2015 04:02:17 +0000 (04:02 +0000)]
PECOFF: use llvm-readobj to dump .reloc section

When this test was written, no llvm tool could print out contents
of base relocation section. Now llvm-readobj is able to dump it in
a text format. Use that tool to make this test readable.

llvm-svn: 229814

9 years agoInstrProf: Always emit a coverage region for the condition of an if
Justin Bogner [Thu, 19 Feb 2015 03:10:30 +0000 (03:10 +0000)]
InstrProf: Always emit a coverage region for the condition of an if

When tools like llvm-cov show regions, it's much easier to understand
what's happening if the condition of an if shows a counter as well as
the body.

llvm-svn: 229813

9 years agoFix a test case.
Larisse Voufo [Thu, 19 Feb 2015 03:03:23 +0000 (03:03 +0000)]
Fix a test case.

llvm-svn: 229812

9 years ago[Headers] Add tests for _mm256_insert_epi64 and fix its definition
Filipe Cabecinhas [Thu, 19 Feb 2015 03:02:33 +0000 (03:02 +0000)]
[Headers] Add tests for _mm256_insert_epi64 and fix its definition

Summary:
The definition for _mm256_insert_epi64 was taking an int, which would get
truncated before being inserted in the vector.

Original patch by Joshua Magee!

Reviewers: bruno, craig.topper

Subscribers: cfe-commits

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

llvm-svn: 229811

9 years agoMark more tuple tests as unsupported in C++98 && C++03
Eric Fiselier [Thu, 19 Feb 2015 02:44:09 +0000 (02:44 +0000)]
Mark more tuple tests as unsupported in C++98 && C++03

llvm-svn: 229810

9 years agoItanium ABI: Properly qualify the destructor-name
David Majnemer [Thu, 19 Feb 2015 02:16:16 +0000 (02:16 +0000)]
Itanium ABI: Properly qualify the destructor-name

We didn't have enough qualificaiton before the scope specifier and we
had too much qualification in the destructor name itself.

llvm-svn: 229809

9 years ago[libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.
Eric Fiselier [Thu, 19 Feb 2015 02:10:42 +0000 (02:10 +0000)]
[libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.

Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED.

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

llvm-svn: 229808

9 years ago[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.
Lang Hames [Thu, 19 Feb 2015 01:32:43 +0000 (01:32 +0000)]
[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.

The new JIT doesn't IRGen stubs until they're referenced.

llvm-svn: 229807

9 years ago[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
Lang Hames [Thu, 19 Feb 2015 01:31:25 +0000 (01:31 +0000)]
[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
up before returning them to the available pool.

llvm-svn: 229806

9 years agoRemove the local subtarget variable from the SystemZ asm printer
Eric Christopher [Thu, 19 Feb 2015 01:26:28 +0000 (01:26 +0000)]
Remove the local subtarget variable from the SystemZ asm printer
and update the two calls accordingly.

llvm-svn: 229805

9 years agoRemove a few more calls to TargetMachine::getSubtarget from the
Eric Christopher [Thu, 19 Feb 2015 01:10:55 +0000 (01:10 +0000)]
Remove a few more calls to TargetMachine::getSubtarget from the
R600 port.

llvm-svn: 229804

9 years agoGrab the subtarget off of the machine function for the R600
Eric Christopher [Thu, 19 Feb 2015 01:10:53 +0000 (01:10 +0000)]
Grab the subtarget off of the machine function for the R600
asm printer and clean up a bunch of uses.

llvm-svn: 229803

9 years agoRemove the DisasmEnabled AsmPrinter variable and just look it
Eric Christopher [Thu, 19 Feb 2015 01:10:49 +0000 (01:10 +0000)]
Remove the DisasmEnabled AsmPrinter variable and just look it
up on the subtarget where it's set anyhow than looking it up
2-3 times in the same place.

llvm-svn: 229802

9 years agoImprove our handling of rtti/sanitize=vptr/sanitize=undefined
Filipe Cabecinhas [Thu, 19 Feb 2015 01:04:49 +0000 (01:04 +0000)]
Improve our handling of rtti/sanitize=vptr/sanitize=undefined

This patch removes the huge blob of code that is dealing with
rtti/exceptions/sanitizers and replaces it with:

A ToolChain function which, for a given set of Args, figures out if rtti
should be:
  - enabled
  - disabled implicitly
  - disabled explicitly

A change in the way SanitizerArgs figures out what sanitizers to enable
(or if it should error out, or warn);

And a check for exceptions/rtti interaction inside addExceptionArgs.

The RTTIMode algorithm is:
  - If -mkernel, -fapple-kext, or -fno-rtti are passed, rtti was disabled explicitly;
  - If -frtti was passed or we're not targetting the PS4, rtti is enabled;
  - If -fexceptions or -fcxx-exceptions was passed and we're targetting
    the PS4, rtti was enabled implicitly;
  - If we're targetting the PS4, rtti is disabled implicitly;
  - Otherwise, rtti is enabled;

Since the only flag needed to pass to -cc1 is -fno-rtti if we want to
disable it, there's no problem in saying rtti is enabled if we're
compiling C code, so we don't look at the input file type.

addExceptionArgs now looks at the RTTIMode and warns that rtti is being
enabled implicitly if targetting the PS4 and exceptions are on. It also
errors out if, targetting the PS4, -fno-rtti was passed, and exceptions
were turned on.

SanitizerArgs now errors out if rtti was disabled explicitly and the vptr
sanitizer was enabled implicitly, but just turns off vptr if rtti is
disabled but -fsanitize=undefined was passed.

Also fixed tests, removed duplicate name from addExceptionArgs comment,
and added one or two surrounding lines when running clang-format.
This changes test/Driver/fsanitize.c to make it not expect a warning when
passed -fsanitize=undefined -fno-rtti, but expect vptr to not be on.

Removed all users and definition of SanitizerArgs::sanitizesVptr().

Reviewers: samsonov

Subscribers: llvm-commits, samsonov, rsmith

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

llvm-svn: 229801

9 years agoMC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:07 +0000 (00:45 +0000)]
MC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.

llvm-svn: 229799

9 years agollvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:04 +0000 (00:45 +0000)]
llvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives.

llvm-svn: 229798

9 years agoIntroduce Target::createNullTargetStreamer and use it from IRObjectFile.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:02 +0000 (00:45 +0000)]
Introduce Target::createNullTargetStreamer and use it from IRObjectFile.

A null MCTargetStreamer allows IRObjectFile to ignore target-specific
directives. Previously we were crashing.

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

llvm-svn: 229797

9 years ago[objc-arc] Introduce the concept of RCIdentity and rename all relevant functions...
Michael Gottesman [Thu, 19 Feb 2015 00:42:38 +0000 (00:42 +0000)]
[objc-arc] Introduce the concept of RCIdentity and rename all relevant functions to use that name. NFC.

The RCIdentity root ("Reference Count Identity Root") of a value V is a
dominating value U for which retaining or releasing U is equivalent to
retaining or releasing V. In other words, ARC operations on V are
equivalent to ARC operations on U.

This is a useful property to ascertain since we can use this in the ARC
optimizer to make it easier to match up ARC operations by always mapping
ARC operations to RCIdentityRoots instead of pointers themselves. Then
we perform pairing of retains, releases which are applied to the same
RCIdentityRoot.

In general, the two ways that we see RCIdentical values in ObjC are via:

  1. PointerCasts
  2. Forwarding Calls that return their argument verbatim.

As such in ObjC, two RCIdentical pointers must always point to the same
memory location.

Previously this concept was implicit in the code and various methods
that dealt with this concept were given functional names that did not
conform to any name in the "ARC" model. This often times resulted in
code that was hard for the non-ARC acquanted to understand resulting in
unhappiness and confusion.

llvm-svn: 229796

9 years ago[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.
Michael Gottesman [Thu, 19 Feb 2015 00:42:34 +0000 (00:42 +0000)]
[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.

NFC. Makes it clearer what this method is actually supposed to do.

llvm-svn: 229795

9 years ago[objc-arc-contract] Refactor out tryToPeepholeInstruction into its own method. NFC.
Michael Gottesman [Thu, 19 Feb 2015 00:42:30 +0000 (00:42 +0000)]
[objc-arc-contract] Refactor out tryToPeepholeInstruction into its own method. NFC.

The main method of ObjCARCContract is really large and busy. By refactoring this
out, it becomes easier to reason about.

llvm-svn: 229794

9 years ago[objc-arc-contract] Reorganize the code a bit and make the debug output easier to...
Michael Gottesman [Thu, 19 Feb 2015 00:42:27 +0000 (00:42 +0000)]
[objc-arc-contract] Reorganize the code a bit and make the debug output easier to read.

llvm-svn: 229793

9 years agoPR22566: a conversion from a floating-point type to bool is a narrowing conversion.
Richard Smith [Thu, 19 Feb 2015 00:39:05 +0000 (00:39 +0000)]
PR22566: a conversion from a floating-point type to bool is a narrowing conversion.

llvm-svn: 229792

9 years agoIR: Drop scope from MDTemplateParameter
Duncan P. N. Exon Smith [Thu, 19 Feb 2015 00:37:21 +0000 (00:37 +0000)]
IR: Drop scope from MDTemplateParameter

Follow-up to r229740, which removed `DITemplate*::getContext()` after my
upgrade script revealed that scopes are always `nullptr` for template
parameters.  This is the other shoe: drop `scope:` from
`MDTemplateParameter` and its two subclasses.  (Note: a bitcode upgrade
would be pointless, since the hierarchy hasn't been moved into place.)

llvm-svn: 229791

9 years agoAvoid using a self-referential initializer and fix up uses.
Eric Christopher [Thu, 19 Feb 2015 00:22:47 +0000 (00:22 +0000)]
Avoid using a self-referential initializer and fix up uses.

llvm-svn: 229790

9 years ago80-column fixups.
Eric Christopher [Thu, 19 Feb 2015 00:15:33 +0000 (00:15 +0000)]
80-column fixups.

llvm-svn: 229789

9 years agoAllow errors on use of a private module header to be disabled, to better support...
Richard Smith [Thu, 19 Feb 2015 00:10:28 +0000 (00:10 +0000)]
Allow errors on use of a private module header to be disabled, to better support incremental transition to modules.

llvm-svn: 229788

9 years agoRemove all use of is64bit off of NVPTXSubtarget and clean up code
Eric Christopher [Thu, 19 Feb 2015 00:08:27 +0000 (00:08 +0000)]
Remove all use of is64bit off of NVPTXSubtarget and clean up code
accordingly. This changes the constructors of a number of classes
that don't need to know the subtarget's 64-bitness.

llvm-svn: 229787

9 years agoRemove all use of getDrvInterface off of NVPTXSubtarget and clean
Eric Christopher [Thu, 19 Feb 2015 00:08:23 +0000 (00:08 +0000)]
Remove all use of getDrvInterface off of NVPTXSubtarget and clean
up code accordingly. Delete code that was checking for all cases
of an enum.

llvm-svn: 229786

9 years agoMigrate the NVPTX backend asm printer to a per function subtarget.
Eric Christopher [Thu, 19 Feb 2015 00:08:14 +0000 (00:08 +0000)]
Migrate the NVPTX backend asm printer to a per function subtarget.

This involved moving two non-subtarget dependent features (64-bitness
and the driver interface) to the NVPTX target machine and updating
the uses (or migrating around the subtarget use for ease of review).
Otherwise use the cached subtarget or create a default subtarget
based on the TargetMachine cpu and feature string for the module
level assembler emission.

llvm-svn: 229785

9 years agoA few minor path fixes for Windows.
Zachary Turner [Wed, 18 Feb 2015 23:59:11 +0000 (23:59 +0000)]
A few minor path fixes for Windows.

When launching argdumper, there are a few problems with the
current logic.  First, on Windows, the file is called
argdumper.exe, not argdumper.  Second, Windows paths have
backslashes in them, and JSON treats <backslash><char> as an
escape sequence.  To fix the second problem, on Windows we
convert backslashes to forward slashes, since backslash isn't
a valid filename character anyway this shouldn't be a problem.

llvm-svn: 229784

9 years agoclang-format: Space and triple angle braces.
Jacques Pienaar [Wed, 18 Feb 2015 23:48:37 +0000 (23:48 +0000)]
clang-format: Space and triple angle braces.

Committing patch http://reviews.llvm.org/D6800.

llvm-svn: 229783

9 years ago[x86] Merge checks for a recently added test case that is the same on
Chandler Carruth [Wed, 18 Feb 2015 23:20:49 +0000 (23:20 +0000)]
[x86] Merge checks for a recently added test case that is the same on
all SSE variants and AVX variants.

llvm-svn: 229770

9 years agoIR: Allow MDSubrange to have 'count: -1'
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 23:17:51 +0000 (23:17 +0000)]
IR: Allow MDSubrange to have 'count: -1'

It turns out that `count: -1` is a special value indicating an empty
array, such as `Values` in:

    struct T {
      unsigned Count;
      int Values[];
    };

Handle it.

llvm-svn: 229769

9 years agoAdd an IR-to-IR test for dwarf EH preparation using opt
Reid Kleckner [Wed, 18 Feb 2015 23:17:41 +0000 (23:17 +0000)]
Add an IR-to-IR test for dwarf EH preparation using opt

This tests the simple resume instruction elimination logic that we have
before making some changes to it.

llvm-svn: 229768

9 years agoFix TestDataFormatter* on Linux
Vince Harron [Wed, 18 Feb 2015 23:16:51 +0000 (23:16 +0000)]
Fix TestDataFormatter* on Linux

llvm::StringRef doesn't make a copy of a string, it just holds a
reference. When special_directions_stream went out of scope,
special_directions was holding on to a stale pointer.

Moving special_directions_stream into a higher scope to keep
special_directions pointing to a valid string.

llvm-svn: 229767

9 years agoFixed TestProcessLaunch.py for remote targets
Vince Harron [Wed, 18 Feb 2015 23:16:09 +0000 (23:16 +0000)]
Fixed TestProcessLaunch.py for remote targets

Just needed to copy stdio redirect files to/from target

llvm-svn: 229766

9 years ago[Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.
Lang Hames [Wed, 18 Feb 2015 23:16:09 +0000 (23:16 +0000)]
[Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.

llvm-svn: 229765

9 years agoFixed remaining remote target failures in TestSettings.py
Vince Harron [Wed, 18 Feb 2015 23:14:49 +0000 (23:14 +0000)]
Fixed remaining remote target failures in TestSettings.py

needed to copy an output file back from remote target
skipped test that expects host env vars to be inherited by target
processes

llvm-svn: 229764

9 years agoFix SettingsCommandTestCase.test_set_error_output_path
Vince Harron [Wed, 18 Feb 2015 23:12:26 +0000 (23:12 +0000)]
Fix SettingsCommandTestCase.test_set_error_output_path

target.error-path (and output-path) were getting resolved on the
local file system, which doesn't make any sense for remote targets

So this patch prevents file paths from being resolved on the host
system.

llvm-svn: 229763

9 years agoPECOFF: Fix symbol aliases
Rui Ueyama [Wed, 18 Feb 2015 23:11:48 +0000 (23:11 +0000)]
PECOFF: Fix symbol aliases

Weak aliases defined using /alternatename command line option were getting
wrong RVAs in the final output because of wrong atom ordinal. Alias atoms
were assigned large ordinals than any other regular atoms because they were
instantiated after other atoms and just got new (larger) ordinals.

Atoms are sorted by its file and atom ordinals in the order pass. Alias
atoms were located after all other atoms in the same file.

An alias atom's ordinal needs to be smaller than its alias target but larger
than the atom appeared before the target -- so that the alias is located
between the two. Since an alias has no size, the alias target will be located
at the same location as the alias.

In this patch, I made a gap between two regular atoms so that we can put
aliases after instantiating them (without re-numbering existing atoms).

llvm-svn: 229762

9 years ago[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
Lang Hames [Wed, 18 Feb 2015 23:08:56 +0000 (23:08 +0000)]
[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
Darwin.

llvm-svn: 229761

9 years ago[Orc][Kaleidoscope] Make sure to look for the mangled name when updating the
Lang Hames [Wed, 18 Feb 2015 23:07:13 +0000 (23:07 +0000)]
[Orc][Kaleidoscope] Make sure to look for the mangled name when updating the
function body pointer in the fully lazy orc/kaleidoscope tutorial.

llvm-svn: 229760

9 years ago[Objdump] Fixing crash when printing symbols in ELF sections with special types.
Colin LeMahieu [Wed, 18 Feb 2015 23:00:22 +0000 (23:00 +0000)]
[Objdump] Fixing crash when printing symbols in ELF sections with special types.

llvm-svn: 229759

9 years agoStyle and formatting fixes for r229715
Andrew Kaylor [Wed, 18 Feb 2015 22:52:18 +0000 (22:52 +0000)]
Style and formatting fixes for r229715

llvm-svn: 229758

9 years agoRemove support for building sanitizers from Makefile/autoconf build on Linux.
Alexey Samsonov [Wed, 18 Feb 2015 22:26:49 +0000 (22:26 +0000)]
Remove support for building sanitizers from Makefile/autoconf build on Linux.

This is a re-application of r229554 restricted to Linux build only.
Apple still uses Makefile/autoconf to build Clang and sanitizers.

llvm-svn: 229756

9 years agoRemove support for building sanitizers from Makefile/autoconf build on Linux.
Alexey Samsonov [Wed, 18 Feb 2015 22:26:22 +0000 (22:26 +0000)]
Remove support for building sanitizers from Makefile/autoconf build on Linux.

This is a re-application of r229554 restricted to Linux build only.
Apple still uses Makefile/autoconf to build Clang and sanitizers.

llvm-svn: 229755

9 years ago[docs] Recommend to use CMake for building sanitizers.
Alexey Samsonov [Wed, 18 Feb 2015 22:26:20 +0000 (22:26 +0000)]
[docs] Recommend to use CMake for building sanitizers.

llvm-svn: 229754

9 years agoCMake: Fix add_lit_target for the case where a test suite has zero target dependencies.
Peter Collingbourne [Wed, 18 Feb 2015 22:25:35 +0000 (22:25 +0000)]
CMake: Fix add_lit_target for the case where a test suite has zero target dependencies.

This can happen with a standalone project containing a test suite with no
internal dependencies.

llvm-svn: 229753

9 years agoR600/SI: Fix READLANE and WRITELANE lane select for VI
Marek Olsak [Wed, 18 Feb 2015 22:12:45 +0000 (22:12 +0000)]
R600/SI: Fix READLANE and WRITELANE lane select for VI

VOP2 declares vsrc1, but VOP3 declares src1.
We can't use the same "ins" if the operands have different names in VOP2
and VOP3 encodings.

This fixes a hang in geometry shaders which spill M0 on VI.
(BTW it doesn't look like M0 needs spilling and the spilling seems
duplicated 3 times)

llvm-svn: 229752

9 years agoR600/SI: Simplify verification of AMDGPU::OPERAND_REG_INLINE_C
Marek Olsak [Wed, 18 Feb 2015 22:12:41 +0000 (22:12 +0000)]
R600/SI: Simplify verification of AMDGPU::OPERAND_REG_INLINE_C

llvm-svn: 229751

9 years agoR600/SI: Remove explicit VOP operand checking
Marek Olsak [Wed, 18 Feb 2015 22:12:37 +0000 (22:12 +0000)]
R600/SI: Remove explicit VOP operand checking

This should be handled by the OperandType checking.

llvm-svn: 229750

9 years agoFix use-after-free bug identified by the Address Sanitizer
Greg Fitzgerald [Wed, 18 Feb 2015 21:54:32 +0000 (21:54 +0000)]
Fix use-after-free bug identified by the Address Sanitizer

atomContent's memory is freed at the end of the stack frame,
but it is referenced by the atom pushed into _definedAtoms.

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

llvm-svn: 229749

9 years agoInstrProf: Rewrite most of coverage mapping generation in a simpler way
Justin Bogner [Wed, 18 Feb 2015 21:24:51 +0000 (21:24 +0000)]
InstrProf: Rewrite most of coverage mapping generation in a simpler way

The coverage mapping generation code previously generated a large
number of redundant coverage regions and then tried to merge similar
ones back together. This then relied on some awkward heuristics to
prevent combining of regions that were importantly different but
happened to have the same count. The end result was inefficient and
hard to follow.

Now, we more carefully create the regions we actually want. This makes
it much easier to create regions at precise locations as well as
making the basic approach quite a bit easier to follow. There's still
a fair bit of complexity here dealing with included code and macro
expansions, but that's pretty hard to avoid without significantly
reducing the quality of data we provide.

I had to modify quite a few tests where the source ranges became more
precise or the old ranges seemed to be wrong anyways, and I've added
quite a few new tests since a large number of constructs didn't seem
to be tested before.

llvm-svn: 229748

9 years agoIR: Swap order of name and value in MDEnum
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 21:16:33 +0000 (21:16 +0000)]
IR: Swap order of name and value in MDEnum

Put the name before the value in assembly for `MDEnum`.  While working
on the testcase upgrade script for the new hierarchy, I noticed that it
"looks nicer" to have the name first, since it lines the names up in the
(somewhat typical) case that they have a common prefix.

llvm-svn: 229747

9 years agoAdd decorator for failure setting prompt on FreeBSD
Ed Maste [Wed, 18 Feb 2015 20:55:13 +0000 (20:55 +0000)]
Add decorator for failure setting prompt on FreeBSD

llvm.org/pr22611

llvm-svn: 229745

9 years agoIR: Add MDCompositeTypeBase::replace*()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:47:52 +0000 (20:47 +0000)]
IR: Add MDCompositeTypeBase::replace*()

Add `replaceElements()`, `replaceVTableHolder()`, and
`replaceTemplateParams()` to `MDCompositeTypeBase`.  Included an
assertion in `replaceElements()` to match the one in
`DICompositeType::replaceArrays()`.

llvm-svn: 229744

9 years agoIR: Add MDCompileUnit::replace*()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:36:09 +0000 (20:36 +0000)]
IR: Add MDCompileUnit::replace*()

Add `MDCompileUnit::replaceGlobalVariables()` and
`MDCompileUnit::replaceSubprograms()`.

llvm-svn: 229743

9 years agoIR: Add MDSubprogram::replaceFunction()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:32:57 +0000 (20:32 +0000)]
IR: Add MDSubprogram::replaceFunction()

llvm-svn: 229742

9 years agoAdd decorators for failing lldb-mi tests
Ed Maste [Wed, 18 Feb 2015 20:31:30 +0000 (20:31 +0000)]
Add decorators for failing lldb-mi tests

Tests fail intermittently on FreeBSD and Linux, apparently due to
threading race conditions in lldb-mi.

See comments in http://reviews.llvm.org/D7529 and
http://reviews.llvm.org/D7727 for more information.

llvm.org/pr22411

llvm-svn: 229741

9 years agoIR: Drop the scope in DI template parameters
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:30:45 +0000 (20:30 +0000)]
IR: Drop the scope in DI template parameters

The scope/context is always the compile unit, which we replace with
`nullptr` anyway (via `getNonCompileUnitScope()`).  Drop it explicitly.

I noticed this field was always null while writing testcase upgrade
scripts to transition to the new hierarchy.  Seems wasteful to
transition it over if it's already out-of-use.

llvm-svn: 229740

9 years agoRevert "Enable ASAN build and test on AArch64"
Renato Golin [Wed, 18 Feb 2015 20:30:32 +0000 (20:30 +0000)]
Revert "Enable ASAN build and test on AArch64"

This reverts commit r229665. It seems that the AArch64 ASAN tests, that
pass on all our internal machines, doesn't like the public buildbot.

Turning this off until we can investigate the public bot for a better
understanding.

llvm-svn: 229739

9 years agoAdd decorator for process launch w/ glob not working on FreeBSD
Ed Maste [Wed, 18 Feb 2015 20:17:21 +0000 (20:17 +0000)]
Add decorator for process launch w/ glob not working on FreeBSD

llvm-svn: 229738

9 years agoAdd decorators for failing lldb-mi tests
Ed Maste [Wed, 18 Feb 2015 20:08:07 +0000 (20:08 +0000)]
Add decorators for failing lldb-mi tests

Tests fail intermittently on FreeBSD and Linux, apparently due to
threading race conditions in lldb-mi.

See comments in http://reviews.llvm.org/D7529 and
http://reviews.llvm.org/D7727 for more information.

llvm.org/pr22411

llvm-svn: 229737

9 years agoFix -DNDEBUG -Werror build after r229733
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 19:56:50 +0000 (19:56 +0000)]
Fix -DNDEBUG -Werror build after r229733

llvm-svn: 229736

9 years agodos2unix the WinEH file and tests
Reid Kleckner [Wed, 18 Feb 2015 19:52:46 +0000 (19:52 +0000)]
dos2unix the WinEH file and tests

llvm-svn: 229735

9 years agoIR: isScopeRef() should check isScope()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 19:46:02 +0000 (19:46 +0000)]
IR: isScopeRef() should check isScope()

r229733 removed an invalid use of `DIScopeRef`, so now we can enforce
that a `DIScopeRef` is actually a scope.

llvm-svn: 229734

9 years agoIR: Avoid DIScopeRef in DIImportedEntity::getEntity()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 19:39:36 +0000 (19:39 +0000)]
IR: Avoid DIScopeRef in DIImportedEntity::getEntity()

`DIImportedEntity::getEntity()` currently returns a `DIScopeRef`, but
the nodes it references aren't always `DIScope`s.  In particular, it can
reference global variables.

Introduce `DIDescriptorRef` to avoid the lie.

llvm-svn: 229733

9 years agoMake frem.ll flush after calling printf.
Zachary Turner [Wed, 18 Feb 2015 19:32:28 +0000 (19:32 +0000)]
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

9 years agoPartial fix for bug 22589
Sanjoy Das [Wed, 18 Feb 2015 19:32:25 +0000 (19:32 +0000)]
Partial fix for bug 22589

Don't spend the entire iteration space in the scalar loop prologue if
computing the trip count overflows.  This change also gets rid of the
backedge check in the prologue loop and the extra check for
overflowing trip-count.

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

llvm-svn: 229731

9 years agoModify llvm-readobj to dump symbol record bytes.
Zachary Turner [Wed, 18 Feb 2015 19:32:05 +0000 (19:32 +0000)]
Modify llvm-readobj to dump symbol record bytes.

This will help us study the format of individual symbol
records more closely.

Differential Revision: http://reviews.llvm.org/D7664
Reviewed by: Timur Iskhodzhanov

llvm-svn: 229730

9 years agoRemove unused diagnostic.
Benjamin Kramer [Wed, 18 Feb 2015 19:30:34 +0000 (19:30 +0000)]
Remove unused diagnostic.

llvm-svn: 229729

9 years agoRemove several unused forward declarations. Fixes PR22605.
Marshall Clow [Wed, 18 Feb 2015 19:28:35 +0000 (19:28 +0000)]
Remove several unused forward declarations. Fixes PR22605.

llvm-svn: 229728

9 years agoAdding install targets for individual LLVM tools and libraries.
Chris Bieneman [Wed, 18 Feb 2015 19:25:47 +0000 (19:25 +0000)]
Adding install targets for individual LLVM tools and libraries.

Summary:
* add_llvm_tool and add_llvm_library now add install-${name} targets to install specific components
* added installhdrs target to install just the LLVM headers
* The above changes only apply for single-configuration generators (Ninja, Makefiles...), not for multi-configuration generators (Visual Studio, Xcode...)

Reviewers: pete

Reviewed By: pete

Subscribers: pete, llvm-commits

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

llvm-svn: 229727

9 years agoItanium ABI: Write a character instead of a string literal
David Majnemer [Wed, 18 Feb 2015 19:08:14 +0000 (19:08 +0000)]
Itanium ABI: Write a character instead of a string literal

No functional change intended.

llvm-svn: 229726

9 years agoItanium ABI: Restore disabled tests which are correctly mangled
David Majnemer [Wed, 18 Feb 2015 19:08:12 +0000 (19:08 +0000)]
Itanium ABI: Restore disabled tests which are correctly mangled

llvm-svn: 229725

9 years agoItanium ABI: Properly mangle extern "C" template arguments
David Majnemer [Wed, 18 Feb 2015 19:08:11 +0000 (19:08 +0000)]
Itanium ABI: Properly mangle extern "C" template arguments

extern "C" declarations should be considered like global declarations
for mangling purposes.

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

llvm-svn: 229724

9 years agoInstrProf: Don't combine expansion regions with code regions
Justin Bogner [Wed, 18 Feb 2015 19:01:06 +0000 (19:01 +0000)]
InstrProf: Don't combine expansion regions with code regions

This was leading to duplicate counts when a code region happened to
overlap exactly with an expansion. The combining behaviour only makes
sense for code regions.

llvm-svn: 229723

9 years agoRemove unused member variables (-Wunused-private-field)
David Blaikie [Wed, 18 Feb 2015 18:52:49 +0000 (18:52 +0000)]
Remove unused member variables (-Wunused-private-field)

llvm-svn: 229722

9 years agoFixing a CMake developer warning.
Chris Bieneman [Wed, 18 Feb 2015 18:52:11 +0000 (18:52 +0000)]
Fixing a CMake developer warning.

llvm-svn: 229721