platform/upstream/llvm.git
10 years agoCMake: avoid a reconfigure loop from r213091
Alp Toker [Tue, 15 Jul 2014 22:11:54 +0000 (22:11 +0000)]
CMake: avoid a reconfigure loop from r213091

Removing the native CMakeCache.txt causes the target to get re-run needlessly
on some systems. We'll want another solution for that part of the fix.

llvm-svn: 213099

10 years agoSwitching some iterator-based for loops to use range-based for loops. No functional...
Aaron Ballman [Tue, 15 Jul 2014 22:03:49 +0000 (22:03 +0000)]
Switching some iterator-based for loops to use range-based for loops. No functional changes intended.

llvm-svn: 213098

10 years agoAdd __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.
Joerg Sonnenberger [Tue, 15 Jul 2014 21:58:11 +0000 (21:58 +0000)]
Add __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.

llvm-svn: 213097

10 years agoR600/SI: Fix select on i1
Matt Arsenault [Tue, 15 Jul 2014 21:44:37 +0000 (21:44 +0000)]
R600/SI: Fix select on i1

llvm-svn: 213096

10 years agoAdded the pack_elements range accessor. Refactoring some for loops to use range-based...
Aaron Ballman [Tue, 15 Jul 2014 21:32:31 +0000 (21:32 +0000)]
Added the pack_elements range accessor. Refactoring some for loops to use range-based for loops instead. No functional changes intended.

llvm-svn: 213095

10 years agoThe following files:
Jim Ingham [Tue, 15 Jul 2014 21:24:58 +0000 (21:24 +0000)]
The following files:

LinuxThread.cpp
LinuxThread.h
NativeRegisterContext.h
ProcessLinux.cpp
ProcessLinux.h
ProcessMonitor.cpp
ProcessMonitor.h

Were inserted in the CopyFiles phase of the "desktop" aggregate target.  That caused them to get
copied to /usr/shared/man/man1 on install, which isn't right.  Not sure why they were there...
I removed them.  If this was supposed to achieve some other purpose, we should discuss how to do
that correctly on the mailing list.

<rdar://problem/17642262>

llvm-svn: 213094

10 years ago[Refactor] Use attributes to mark function as invalid for polly
Johannes Doerfert [Tue, 15 Jul 2014 21:06:48 +0000 (21:06 +0000)]
[Refactor] Use attributes to mark function as invalid for polly

  + Test case annotated with the new attribute
  + Modified test case to check if subfunctions are annotated

llvm-svn: 213093

10 years agoTry out FileCheck's new (in r212810) -implicit-check-not in a DebugInfo test.
David Blaikie [Tue, 15 Jul 2014 21:06:37 +0000 (21:06 +0000)]
Try out FileCheck's new (in r212810) -implicit-check-not in a DebugInfo test.

Just tried this on a few tests and this was the only one that was
easily ported to use the new feature, so we'll go with that for now.
Hopefully can act as inspiration/reminder for other tests.

Not all debug info tests need to check for every DW_TAG or NULL child
terminator, but perhaps they should (just to ensure they don't accidentally
end up with tags nested inside other tags without the test failing, for example)

llvm-svn: 213092

10 years agoCMake: fix cross-compilation with external source directories
Alp Toker [Tue, 15 Jul 2014 21:04:12 +0000 (21:04 +0000)]
CMake: fix cross-compilation with external source directories

This adds support for building native artifacts when cross-compiling using the
popular side-by-side source directory layout (no symlinks, no nested
repositories).

llvm-svn: 213091

10 years agoADT: Add MapVector::remove_if
Duncan P. N. Exon Smith [Tue, 15 Jul 2014 20:24:56 +0000 (20:24 +0000)]
ADT: Add MapVector::remove_if

Add a `MapVector::remove_if()` that erases items in bulk in linear time,
as opposed to quadratic time for repeated calls to `MapVector::erase()`.

llvm-svn: 213090

10 years agoR600/SI: Implement less wrong f32 fdiv
Matt Arsenault [Tue, 15 Jul 2014 20:18:31 +0000 (20:18 +0000)]
R600/SI: Implement less wrong f32 fdiv

Assuming single precision denormals and accurate sqrt/div are not
reported, this passes the OpenCL conformance test.

llvm-svn: 213089

10 years agoR600: Add predicate for UnsafeFPMath
Matt Arsenault [Tue, 15 Jul 2014 20:18:24 +0000 (20:18 +0000)]
R600: Add predicate for UnsafeFPMath

llvm-svn: 213088

10 years agoR600: Remove intrinsics that appear to be unused
Matt Arsenault [Tue, 15 Jul 2014 20:10:27 +0000 (20:10 +0000)]
R600: Remove intrinsics that appear to be unused

llvm-svn: 213087

10 years ago[RuntimeDyld] Revert r211652 - MachO object GDB registration support.
Lang Hames [Tue, 15 Jul 2014 19:35:22 +0000 (19:35 +0000)]
[RuntimeDyld] Revert r211652 - MachO object GDB registration support.

The registration scheme used in r211652 violated the read-only contract of
MemoryBuffer. This caused crashes in llvm-rtdyld where macho objects were backed
by read-only mmap'd memory.

llvm-svn: 213086

10 years agoFix the diagnostic.cpp test to explicitly disable more google checks
Reid Kleckner [Tue, 15 Jul 2014 18:52:34 +0000 (18:52 +0000)]
Fix the diagnostic.cpp test to explicitly disable more google checks

Imagine, hypothetically, that you had a build of clang-tidy that enabled
the google-* checks by default.  If you had such a binary, then this
test would fail.  Making it pass in that configuration isn't such a bad
thing.

llvm-svn: 213085

10 years agoADT: Fix MapVector::erase()
Duncan P. N. Exon Smith [Tue, 15 Jul 2014 18:32:30 +0000 (18:32 +0000)]
ADT: Fix MapVector::erase()

Actually update the changed indexes in the map portion of `MapVector`
when erasing from the middle.  Add a unit test that checks for this.

Note that `MapVector::erase()` is a linear time operation (it was and
still is).  I'll commit a new method in a moment called
`MapVector::remove_if()` that deletes multiple entries in linear time,
which should be slightly less painful.

llvm-svn: 213084

10 years agoclang-cl: Implement the -arch flag
Ehsan Akhgari [Tue, 15 Jul 2014 18:27:51 +0000 (18:27 +0000)]
clang-cl: Implement the -arch flag

Summary:
This implements the -arch flag for both x86 and x86-64 by letting
them affect the default target features we pass to cc1.  -m machine
flags will override the features set by -arch.

Reviewers: hansw

Subscribers: cfe-commits

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

llvm-svn: 213083

10 years agoADT: Add "end namespace" comment
Duncan P. N. Exon Smith [Tue, 15 Jul 2014 18:06:56 +0000 (18:06 +0000)]
ADT: Add "end namespace" comment

This keeps clang-format from deleting the preceding newline.

llvm-svn: 213082

10 years agoImprove test of my previous patch. rdar://17633301
Fariborz Jahanian [Tue, 15 Jul 2014 17:47:58 +0000 (17:47 +0000)]
Improve test of my previous patch. rdar://17633301

llvm-svn: 213081

10 years ago[ASan] Add ASan debugging API to get malloc/free stack traces and shadow memory mappi...
Kuba Brecka [Tue, 15 Jul 2014 17:33:23 +0000 (17:33 +0000)]
[ASan] Add ASan debugging API to get malloc/free stack traces and shadow memory mapping info

Reviewed at http://reviews.llvm.org/D4466

llvm-svn: 213080

10 years agoAdd codegen for more R600 builtins
Matt Arsenault [Tue, 15 Jul 2014 17:23:46 +0000 (17:23 +0000)]
Add codegen for more R600 builtins

llvm-svn: 213079

10 years ago[RegisterCoalescer] Add new subtarget hook allowing targets to opt-out of coalescing.
Chris Bieneman [Tue, 15 Jul 2014 17:18:41 +0000 (17:18 +0000)]
[RegisterCoalescer] Add new subtarget hook allowing targets to opt-out of coalescing.

The coalescer is very aggressive at propagating constraints on the register classes, and the register allocator doesn’t know how to split sub-registers later to recover. This patch provides an escape valve for targets that encounter this problem to limit coalescing.

This patch also implements such for ARM to lower register pressure when using lots of large register classes. This works around PR18825.

llvm-svn: 213078

10 years ago[ELF] Implement parsing `-l` prefixed items in the `GROUP` linker script command.
Simon Atanasyan [Tue, 15 Jul 2014 17:17:30 +0000 (17:17 +0000)]
[ELF] Implement parsing `-l` prefixed items in the `GROUP` linker script command.
There are two forms of `-l` prefixed expression:

* -l<libname>
* -l:<filename>

In the first case a linker should construct a full library name
`lib + libname + .[so|a]` and search this library as usual. In the second case
a linker should use the `<filename>` as is and search this file through library
search directories.

The patch reviewed by Shankar Easwaran.

llvm-svn: 213077

10 years agoObjective-C IRGen. Fixes an inconsistant linkage of
Fariborz Jahanian [Tue, 15 Jul 2014 17:14:34 +0000 (17:14 +0000)]
Objective-C IRGen. Fixes an inconsistant linkage of
ObC's metaclass metadata with its class metadata which
results in an assert. rdar://17633301

llvm-svn: 213076

10 years ago[clang-tidy] Add a checker that flags unnamed parameters.
Benjamin Kramer [Tue, 15 Jul 2014 16:47:09 +0000 (16:47 +0000)]
[clang-tidy] Add a checker that flags unnamed parameters.

Summary:
We still allow the escape hatch foo(int /*x*/) and also suggest this
in a fixit. This is more powerful than the corresponding cpplint.py check
it also flags functions with multiple arguments as naming all arguments is
recommended by the google style guide.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 213075

10 years ago[AArch64] Add negative tests for the SIMD & FP LDP instructions.
Tilmann Scheller [Tue, 15 Jul 2014 16:33:24 +0000 (16:33 +0000)]
[AArch64] Add negative tests for the SIMD & FP LDP instructions.

LDP is unpredictable if the registers in the pair are identical, these tests check that we don't assemble instructions like that and error out instead.

llvm-svn: 213074

10 years agoRevert r213070. It's breaking the build in MCELFStreamer::EmitInstToData(...).
Cameron McInally [Tue, 15 Jul 2014 16:24:24 +0000 (16:24 +0000)]
Revert r213070. It's breaking the build in MCELFStreamer::EmitInstToData(...).

llvm-svn: 213073

10 years agoR600: Implement zero undef variants of ctlz/cttz
Jan Vesely [Tue, 15 Jul 2014 15:51:09 +0000 (15:51 +0000)]
R600: Implement zero undef variants of ctlz/cttz

v2: use ffbh/l if available
v3: Rebase on top of Matt's SI patches

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 213072

10 years ago[mips] Correct .MIPS.abiflags fp_abi field for -mfpxx and without .module
Daniel Sanders [Tue, 15 Jul 2014 15:31:39 +0000 (15:31 +0000)]
[mips] Correct .MIPS.abiflags fp_abi field for -mfpxx and without .module

Summary: Previously all the test cases set it after initialization with '.module fp=xx'.

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

llvm-svn: 213071

10 years agoAdd x86 patterns to match a specific add-with-carry.
Cameron McInally [Tue, 15 Jul 2014 15:03:32 +0000 (15:03 +0000)]
Add x86 patterns to match a specific add-with-carry.

llvm-svn: 213070

10 years ago[DAGCombiner] Add more rules to fold shuffles.
Andrea Di Biagio [Tue, 15 Jul 2014 13:26:28 +0000 (13:26 +0000)]
[DAGCombiner] Add more rules to fold shuffles.

This patch adds two new rules to the DAGCombiner:
 1.  shuffle (shuffle A, Undef, M0), B, M1 -> shuffle A, B, M2
 2.  shuffle (shuffle A, Undef, M0), A, M1 -> shuffle A, Undef, M2

We only do this if the combined shuffle is legal for the target.

Example:
;;
define <4 x float> @test(<4 x float> %a, <4 x float> %b) {
  %1 = shufflevector <4 x float> %a, <4 x float> undef, <4 x i32><i32 6, i32 0, i32 1, i32 7>
  %2 = shufflevector <4 x float> %1, <4 x float> %b, <4 x i32><i32 1, i32 2, i32 4, i32 5>
  ret <4 x i32> %2
}
;;

(using llc -mcpu=corei7 -march=x86-64)
Before, the x86 backend generated:
  pshufd $120, %xmm0, %xmm0
  shufps $-108, %xmm0, %xmm1
  movaps %xmm1, %xmm0

Now the x86 backend generates:
  movsd %xmm1, %xmm0

llvm-svn: 213069

10 years ago[clang-tidy] extend make_pair test for fixits in template definitions.
Benjamin Kramer [Tue, 15 Jul 2014 13:11:49 +0000 (13:11 +0000)]
[clang-tidy] extend make_pair test for fixits in template definitions.

llvm-svn: 213068

10 years ago[clang-tidy] Add a checker that flags all instances of overloaded unary operator&
Benjamin Kramer [Tue, 15 Jul 2014 12:48:14 +0000 (12:48 +0000)]
[clang-tidy] Add a checker that flags all instances of overloaded unary operator&

This handles both methods and freestanding overloads.

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

llvm-svn: 213067

10 years agoDon't create non-temporary twines.
Joerg Sonnenberger [Tue, 15 Jul 2014 12:18:40 +0000 (12:18 +0000)]
Don't create non-temporary twines.

llvm-svn: 213066

10 years agoMake sure int64_t and uint64_t are consistent.
Joerg Sonnenberger [Tue, 15 Jul 2014 11:51:38 +0000 (11:51 +0000)]
Make sure int64_t and uint64_t are consistent.

llvm-svn: 213065

10 years agoPrune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.
NAKAMURA Takumi [Tue, 15 Jul 2014 11:37:03 +0000 (11:37 +0000)]
Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.

I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill.

llvm-svn: 213064

10 years agoProvide builtin macros as template for PRIab and SCNab, matching the
Joerg Sonnenberger [Tue, 15 Jul 2014 11:30:00 +0000 (11:30 +0000)]
Provide builtin macros as template for PRIab and SCNab, matching the
underlaying types.

llvm-svn: 213063

10 years agoUpdate to isl-0.13.0
Tobias Grosser [Tue, 15 Jul 2014 11:25:32 +0000 (11:25 +0000)]
Update to isl-0.13.0

This pulls in a couple of minor cleanups in isl. More importantly, in
preparation of the upcoming LLVM releases this change brings us back on a
released version of isl.

llvm-svn: 213062

10 years agoSilence a warning in conditional expression.
Andrea Di Biagio [Tue, 15 Jul 2014 10:53:44 +0000 (10:53 +0000)]
Silence a warning in conditional expression.

Fixes a gcc warning caused by a typo. A redundant assignment operation was
accidentally used as the third operand of a conditional expression.
No functional change intended.

llvm-svn: 213061

10 years agoMergeFunc patch from Björn Steinbrink.
Stepan Dyatkovskiy [Tue, 15 Jul 2014 10:46:51 +0000 (10:46 +0000)]
MergeFunc patch from Björn Steinbrink.
Phabricator ticket: D4246, Don't merge functions with different range metadata on call/invoke.
Thanks!

llvm-svn: 213060

10 years agoAArch64: fall back to generic code for out of range extract/insert.
Tim Northover [Tue, 15 Jul 2014 10:00:26 +0000 (10:00 +0000)]
AArch64: fall back to generic code for out of range extract/insert.

rdar://problem/17624784

llvm-svn: 213059

10 years ago[clang-tidy] Add a checker that removes deducible arguments from std::make_pair
Benjamin Kramer [Tue, 15 Jul 2014 09:50:32 +0000 (09:50 +0000)]
[clang-tidy] Add a checker that removes deducible arguments from std::make_pair

Those may be incompatible with C++11 and are unnecessary. We suggest
removing the template arguments when they match the types of the make_pair
arguments or replace it with std::pair and explicit template arguments when
not.

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

llvm-svn: 213058

10 years agotsan: remove special handling of false reports coming from JVM
Dmitry Vyukov [Tue, 15 Jul 2014 09:38:30 +0000 (09:38 +0000)]
tsan: remove special handling of false reports coming from JVM

There is now a more common functionality in the form of called_from_lib suppressions.

llvm-svn: 213057

10 years agotsan: remove compat mapping
Dmitry Vyukov [Tue, 15 Jul 2014 09:31:29 +0000 (09:31 +0000)]
tsan: remove compat mapping

There are no known usages anymore, so one less thing to support.

llvm-svn: 213056

10 years agoclang-format: Improve heuristic around avoiding bad line breaks.
Daniel Jasper [Tue, 15 Jul 2014 09:00:34 +0000 (09:00 +0000)]
clang-format: Improve heuristic around avoiding bad line breaks.

Now, this can be properly formatted:
  static_cast<A< //
      B> *>(     //
      );

Before, clang-format could end up, not formatting the code at all.

llvm-svn: 213055

10 years ago[sanitizer] De-flake one test.
Evgeniy Stepanov [Tue, 15 Jul 2014 08:46:51 +0000 (08:46 +0000)]
[sanitizer] De-flake one test.

llvm-svn: 213054

10 years ago[ASan] Only define macros in asan_init_version.h, move the __asan_init declaration...
Timur Iskhodzhanov [Tue, 15 Jul 2014 08:16:04 +0000 (08:16 +0000)]
[ASan] Only define macros in asan_init_version.h, move the __asan_init declaration back to asan_interface_internal.h

This fixes the issues we've uncovered after landing r212815.

Reviewed at http://reviews.llvm.org/D4500

llvm-svn: 213053

10 years agoFix typo in comment
David Majnemer [Tue, 15 Jul 2014 07:11:32 +0000 (07:11 +0000)]
Fix typo in comment

No functionality changed.

llvm-svn: 213052

10 years ago[FastISel][X86] Remove no longer needed functions.
Juergen Ributzka [Tue, 15 Jul 2014 06:35:53 +0000 (06:35 +0000)]
[FastISel][X86] Remove no longer needed functions.

llvm-svn: 213051

10 years ago[FastISel][X86] Implement the FastLowerIntrinsicCall hook.
Juergen Ributzka [Tue, 15 Jul 2014 06:35:50 +0000 (06:35 +0000)]
[FastISel][X86] Implement the FastLowerIntrinsicCall hook.

Rename X86VisitIntrinsicCall -> FastLowerIntrinsicCall, which effectively
implements the target hook.

llvm-svn: 213050

10 years ago[FastISel][X86] Implement the FastLowerCall hook.
Juergen Ributzka [Tue, 15 Jul 2014 06:35:47 +0000 (06:35 +0000)]
[FastISel][X86] Implement the FastLowerCall hook.

This implements the FastLowerCall hook, which is based on the DoSelectCall
function. The implementation is very similar, but the target-independent call
lowering part has been factored out.

This should also enable patchpoint intrinsic lowering for FastISel on X86.

Related to <rdar://problem/17427052>.

llvm-svn: 213049

10 years agoRevert "[FastISel][X86] Remove no longer needed functions."
Juergen Ributzka [Tue, 15 Jul 2014 05:23:40 +0000 (05:23 +0000)]
Revert "[FastISel][X86] Remove no longer needed functions."
Revert "[FastISel][X86] Implement the FastLowerIntrinsicCall hook."
Revert "[FastISel][X86] Implement the FastLowerCall hook."

This reverts commit r213035, r213036, and r213037 to make the
buildbots happy again.

llvm-svn: 213048

10 years ago[dfsan] Introduce an optimization to reduce the number of union queries.
Peter Collingbourne [Tue, 15 Jul 2014 04:41:17 +0000 (04:41 +0000)]
[dfsan] Introduce an optimization to reduce the number of union queries.

Specifically, when building a union query, if we are dominated by an identical
query then use the result of that query instead.

llvm-svn: 213047

10 years ago[dfsan] Move combineShadows to DFSanFunction in preparation for it to use a domtree.
Peter Collingbourne [Tue, 15 Jul 2014 04:41:14 +0000 (04:41 +0000)]
[dfsan] Move combineShadows to DFSanFunction in preparation for it to use a domtree.

llvm-svn: 213046

10 years agoGive SplitBlockAndInsertIfThen the ability to update a domtree.
Peter Collingbourne [Tue, 15 Jul 2014 04:40:27 +0000 (04:40 +0000)]
Give SplitBlockAndInsertIfThen the ability to update a domtree.

llvm-svn: 213045

10 years agoAST: Don't walk all redeclarations when looking for a uuid attr
David Majnemer [Tue, 15 Jul 2014 04:30:17 +0000 (04:30 +0000)]
AST: Don't walk all redeclarations when looking for a uuid attr

No funcionality changed, just a simplification of the existing code.

llvm-svn: 213044

10 years ago[modules] Rearrange and unify the way we determine if we need to pull in
Richard Smith [Tue, 15 Jul 2014 03:37:06 +0000 (03:37 +0000)]
[modules] Rearrange and unify the way we determine if we need to pull in
redeclaration chains when pulling in a declaration. We need the redecl chain
unless we know some other declaration will trigger it to be pulled in; that
happens if our originally-canonical declaration had all the knowledge that
we have (and isn't us).

llvm-svn: 213043

10 years agoSome targets don't prefix private symbols with dot
David Majnemer [Tue, 15 Jul 2014 03:00:41 +0000 (03:00 +0000)]
Some targets don't prefix private symbols with dot

llvm-svn: 213042

10 years agoSpecify a more specific triple for constant-pool-remat-0.ll
David Majnemer [Tue, 15 Jul 2014 03:00:39 +0000 (03:00 +0000)]
Specify a more specific triple for constant-pool-remat-0.ll

Instead of specifying 32-bit x86, specify 32-bit x86 linux.

This test is testing a very specific behavior which changed with
WinCOFF's constant pools.

llvm-svn: 213041

10 years ago[OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp...
Alexey Bataev [Tue, 15 Jul 2014 02:55:09 +0000 (02:55 +0000)]
[OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp single'.

llvm-svn: 213040

10 years agoRelax tests expecting to see CPI symbols
David Majnemer [Tue, 15 Jul 2014 02:44:49 +0000 (02:44 +0000)]
Relax tests expecting to see CPI symbols

WinCOFF doesn't use CPI symbols, it has a different scheme for naming
constant pool entries.  Update tests to handle either appearing.

llvm-svn: 213039

10 years agoCodeGen: Handle ConstantVector and undef in WinCOFF constant pools
David Majnemer [Tue, 15 Jul 2014 02:34:12 +0000 (02:34 +0000)]
CodeGen: Handle ConstantVector and undef in WinCOFF constant pools

The constant pool entry code for WinCOFF assumed that vector constants
would be formed using ConstantDataVector, it did not expect to see a
ConstantVector.  Furthermore, it did not expect undef as one of the
elements of the vector.

ConstantVectors should be handled like ConstantDataVectors, treat Undef
as zero.

llvm-svn: 213038

10 years ago[FastISel][X86] Remove no longer needed functions.
Juergen Ributzka [Tue, 15 Jul 2014 02:22:56 +0000 (02:22 +0000)]
[FastISel][X86] Remove no longer needed functions.

llvm-svn: 213037

10 years ago[FastISel][X86] Implement the FastLowerIntrinsicCall hook.
Juergen Ributzka [Tue, 15 Jul 2014 02:22:53 +0000 (02:22 +0000)]
[FastISel][X86] Implement the FastLowerIntrinsicCall hook.

Rename X86VisitIntrinsicCall -> FastLowerIntrinsicCall, which effectively
implements the target hook.

llvm-svn: 213036

10 years ago[FastISel][X86] Implement the FastLowerCall hook.
Juergen Ributzka [Tue, 15 Jul 2014 02:22:49 +0000 (02:22 +0000)]
[FastISel][X86] Implement the FastLowerCall hook.

This implements the FastLowerCall hook, which is based on the DoSelectCall
function. The implementation is very similar, but the target-independent call
lowering part has been factored out.

This should also enable patchpoint intrinsic lowering for FastISel on X86.

Related to <rdar://problem/17427052>.

llvm-svn: 213035

10 years ago[FastISel] Insert patchpoint instruction before the target generated call instruction.
Juergen Ributzka [Tue, 15 Jul 2014 02:22:46 +0000 (02:22 +0000)]
[FastISel] Insert patchpoint instruction before the target generated call instruction.

The patchpoint instruction should have been inserted before the target
generated call instruction to be inside the ADJSTACKDOWN/ADJSTACKUP call
sequence window.

llvm-svn: 213034

10 years ago[FastISel] Fix patchpoint lowering to set the result register.
Juergen Ributzka [Tue, 15 Jul 2014 02:22:43 +0000 (02:22 +0000)]
[FastISel] Fix patchpoint lowering to set the result register.

Always update the value map with the result register (if there is one), for the
patchpoint instruction we created to replace the target-specific call
instruction.

llvm-svn: 213033

10 years agoDon't get confused on the number of braces when braces start after the first __asm
Ehsan Akhgari [Tue, 15 Jul 2014 02:21:41 +0000 (02:21 +0000)]
Don't get confused on the number of braces when braces start after the first __asm

Summary:
Without this, we would not consume the closing brace which would cause
the parser to start consuming C++ and bad things would happen.

Reviewers: majnemer

Subscribers: cfe-commits

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

llvm-svn: 213032

10 years agoR600: Add dag combine for copy of an illegal type.
Matt Arsenault [Tue, 15 Jul 2014 02:06:31 +0000 (02:06 +0000)]
R600: Add dag combine for copy of an illegal type.

This helps avoid redundant instructions to unpack, and repack
the vectors. Ideally we could recognize that pattern and eliminate
it. Currently v4i8 and other small element type vectors are scalarized,
so this has the added bonus of avoiding that.

llvm-svn: 213031

10 years agoTeach computeKnownBits to look through addrspacecast.
Matt Arsenault [Tue, 15 Jul 2014 01:55:03 +0000 (01:55 +0000)]
Teach computeKnownBits to look through addrspacecast.

This fixes inferring alignment through an addrspacecast.

llvm-svn: 213030

10 years agoImprove test 'CodeGen/X86/combine-vec-shuffle-3.ll'.
Andrea Di Biagio [Tue, 15 Jul 2014 01:29:27 +0000 (01:29 +0000)]
Improve test 'CodeGen/X86/combine-vec-shuffle-3.ll'.
Now functions 'test4', 'test9', 'test14' and 'test19' correctly perform
a move of two packed values from the high quadword of vector %b to the low
quadword of vector %a (movhlps idiom).

No functional change intended.

llvm-svn: 213029

10 years agoVirtualFileSystem: Correctly generate the mapping for an empty VFS
Justin Bogner [Tue, 15 Jul 2014 01:24:35 +0000 (01:24 +0000)]
VirtualFileSystem: Correctly generate the mapping for an empty VFS

In r209332 I accidentally broke generation of empty VFS maps. This
fixes the issue and adds a test.

llvm-svn: 213028

10 years agoDocument the maximum LLVM IR alignment, which is 1 << 29 or 0.5 GiB
Reid Kleckner [Tue, 15 Jul 2014 01:16:09 +0000 (01:16 +0000)]
Document the maximum LLVM IR alignment, which is 1 << 29 or 0.5 GiB

Add verifier checks.  We already check these in the assembly parser, but
a frontend producing IR in memory wouldn't hit those checks.

llvm-svn: 213027

10 years ago[Format] Clang format IslAst.cpp
Johannes Doerfert [Tue, 15 Jul 2014 00:58:57 +0000 (00:58 +0000)]
[Format] Clang format IslAst.cpp

llvm-svn: 213026

10 years agoTeach GetUnderlyingObject / BasicAA about addrspacecast
Matt Arsenault [Tue, 15 Jul 2014 00:56:40 +0000 (00:56 +0000)]
Teach GetUnderlyingObject / BasicAA about addrspacecast

llvm-svn: 213025

10 years agoRevert r212572 "improve BasicAA CS-CS queries", it causes PR20303.
Nick Lewycky [Tue, 15 Jul 2014 00:53:38 +0000 (00:53 +0000)]
Revert r212572 "improve BasicAA CS-CS queries", it causes PR20303.

llvm-svn: 213024

10 years agoAny commands that are executed through the public interface using SBCommandInterprete...
Greg Clayton [Tue, 15 Jul 2014 00:25:59 +0000 (00:25 +0000)]
Any commands that are executed through the public interface using SBCommandInterpreter::HandleCommand() are assumed to be in non-interactive mode.

Any commands that want interactivity (stdin) will need to be executed through the normal command interpreter using the debugger's in/out/err file handles, or by using "command source".

Individual commands through the API will have their STDIN disabled. The STDOUT and STDERR will be redirected into the SBCommandReturnObject argument to SBCommandInterpreter::HandleCommand() as usual.

This helps with a deadlock situation in an IDE (Xcode) where the IDE was managing the breakpoint actions by setting a breakpoint callback and doing things manually.

<rdar://problem/17386271>

llvm-svn: 213023

10 years agoPR19751: (T())++ is not a cast-expression.
Richard Smith [Tue, 15 Jul 2014 00:11:48 +0000 (00:11 +0000)]
PR19751: (T())++ is not a cast-expression.

llvm-svn: 213022

10 years agoConvert test to FileCheck.
Matt Arsenault [Tue, 15 Jul 2014 00:07:27 +0000 (00:07 +0000)]
Convert test to FileCheck.

Check the individual test functions for more useful failure errors.

llvm-svn: 213021

10 years ago[DAGCombiner] Avoid calling method 'isShuffleMaskLegal' on illegal vector types.
Andrea Di Biagio [Tue, 15 Jul 2014 00:02:32 +0000 (00:02 +0000)]
[DAGCombiner] Avoid calling method 'isShuffleMaskLegal' on illegal vector types.

This patch fixes a crasher in method 'DAGCombiner::visitOR' due to an invalid
call to method 'isShuffleMaskLegal'. On x86, method 'isShuffleMaskLegal'
always expects a legal vector value type in input.

With this patch, we immediately check if the input OR dag node has a legal
vector type; we only try to fold a OR dag node into a single shufflevector
if we know that the resulting shuffle will have a legal type.
This is to avoid calling method 'isShuffleMaskLegal' on a potentially
illegal vector value type.

Added a new test-case to file 'CodeGen/X86/combine-or.ll' to verify that
DAGCombiner doesn't crash in the attempt to check/combine an OR between shuffles
with illegal types.

llvm-svn: 213020

10 years agoAnnotate reduction parallel loops in the IslAst textual output
Johannes Doerfert [Tue, 15 Jul 2014 00:00:35 +0000 (00:00 +0000)]
Annotate reduction parallel loops in the IslAst textual output

  + Introduced dependency type TYPE_TC_RED to represent the transitive closure
    (& the reverse) of reduction dependences. These are used when we check for
    reduction parallel loops.
  + Test cases including loop reversals and modulo schedules which compute
    reductions in a alternated order.

llvm-svn: 213019

10 years agoR600: Add denormal handling subtarget features.
Matt Arsenault [Mon, 14 Jul 2014 23:40:49 +0000 (23:40 +0000)]
R600: Add denormal handling subtarget features.

llvm-svn: 213018

10 years agoR600/SI: Default to no single precision denormals.
Matt Arsenault [Mon, 14 Jul 2014 23:40:43 +0000 (23:40 +0000)]
R600/SI: Default to no single precision denormals.

llvm-svn: 213017

10 years agoAST: Fix __uuidof for template specializations
David Majnemer [Mon, 14 Jul 2014 23:40:24 +0000 (23:40 +0000)]
AST: Fix __uuidof for template specializations

While we previously supported __uuidof applied to a template
specialization, we would only find the uuid attribute if it was applied
to the template argument.  We would erroneously ignore the uuid
attribute on the specialization itself.

This is required to parse Windows Runtime C++ Template Library headers.

llvm-svn: 213016

10 years agoRevert "Revert "Move clang feature flags settings out of LLVM core and into cfe""
Alp Toker [Mon, 14 Jul 2014 23:30:31 +0000 (23:30 +0000)]
Revert "Revert "Move clang feature flags settings out of LLVM core and into cfe""

It turns out this commit was fine. The problem was in the legacy build system (fixed r213010).

This reverts commit r213005.

llvm-svn: 213015

10 years agoRevert "Revert "Move clang feature flags settings out of LLVM core and into cfe""
Alp Toker [Mon, 14 Jul 2014 23:28:38 +0000 (23:28 +0000)]
Revert "Revert "Move clang feature flags settings out of LLVM core and into cfe""

It turns out this commit was fine. The problem was in the legacy build system (fixed r213010).

This reverts commit r213008.

llvm-svn: 213014

10 years agoRemove dead code.
Richard Smith [Mon, 14 Jul 2014 23:25:30 +0000 (23:25 +0000)]
Remove dead code.

llvm-svn: 213013

10 years ago[RuntimeDyld] Handle endiannes differences between the host and target while
Lang Hames [Mon, 14 Jul 2014 23:19:50 +0000 (23:19 +0000)]
[RuntimeDyld] Handle endiannes differences between the host and target while
reading MachO files magic numbers in RuntimeDyld.

This is required now that we're testing cross-platform JITing (via
RuntimeDyldChecker), and should fix some issues that David Fang has seen on PPC
builds.

llvm-svn: 213012

10 years ago[X86] Specify all TSFlags bit-offsets symbolically
Adam Nemet [Mon, 14 Jul 2014 23:18:39 +0000 (23:18 +0000)]
[X86] Specify all TSFlags bit-offsets symbolically

No functional change.

The offsets for the other bitfields are specified symbolically.  I need to
increase the size for one of the earlier fields which is easier after this
cleanup.

Why these bits are relative to VEXShift is a bit strange but that is for
another cleanup.

I made sure that the values for the enums are unchanged after this change.

llvm-svn: 213011

10 years agoDefine ENABLE_CLANG_ARCMT in the legacy build system too
Alp Toker [Mon, 14 Jul 2014 23:15:48 +0000 (23:15 +0000)]
Define ENABLE_CLANG_ARCMT in the legacy build system too

llvm-svn: 213010

10 years agoAST: Cleanup __uuidof related code
David Majnemer [Mon, 14 Jul 2014 23:12:54 +0000 (23:12 +0000)]
AST: Cleanup __uuidof related code

Switch some things to use range-based for loops.
Change CXXUuidofExpr::GetUuidAttrOfType's return type to be const.
No functionality changed.

llvm-svn: 213009

10 years agoRevert "Move clang feature flags settings out of LLVM core and into cfe"
Alp Toker [Mon, 14 Jul 2014 23:10:07 +0000 (23:10 +0000)]
Revert "Move clang feature flags settings out of LLVM core and into cfe"

Prospectively revert to get one of the many build configurations back working
(presumably the side-by-side+modular CMake config).

This reverts commit r212997.

llvm-svn: 213008

10 years agoIf Process::Finalize() has been called, don't track process state changes.
Greg Clayton [Mon, 14 Jul 2014 23:09:29 +0000 (23:09 +0000)]
If Process::Finalize() has been called, don't track process state changes.

<rdar://problem/17540766>

llvm-svn: 213007

10 years agoCodeGen: Stick constant pool entries in COMDAT sections for WinCOFF
David Majnemer [Mon, 14 Jul 2014 22:57:27 +0000 (22:57 +0000)]
CodeGen: Stick constant pool entries in COMDAT sections for WinCOFF

COFF lacks a feature that other object file formats support: mergeable
sections.

To work around this, MSVC sticks constant pool entries in special COMDAT
sections so that each constant is in it's own section.  This permits
unused constants to be dropped and it also allows duplicate constants in
different translation units to get merged together.

This fixes PR20262.

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

llvm-svn: 213006

10 years agoRevert "Move clang feature flags settings out of LLVM core and into cfe"
Alp Toker [Mon, 14 Jul 2014 22:54:22 +0000 (22:54 +0000)]
Revert "Move clang feature flags settings out of LLVM core and into cfe"

This broke one of the builds, presumably side-by-side modular CMake.
Investigating.

This reverts commit r212998.

llvm-svn: 213005

10 years agolldb.LLDB_ARCH_DEFAULT now works correctly on Macs with haswell enabled kernels.
Greg Clayton [Mon, 14 Jul 2014 22:53:02 +0000 (22:53 +0000)]
lldb.LLDB_ARCH_DEFAULT now works correctly on Macs with haswell enabled kernels.

<rdar://problem/17604133>

llvm-svn: 213004

10 years agoContinue parsing an expression list even after an error is encountered.
Kaelyn Takata [Mon, 14 Jul 2014 22:48:10 +0000 (22:48 +0000)]
Continue parsing an expression list even after an error is encountered.

Otherwise, multiple errors such as having unknown identifiers for two
arguments won't be diagnosed properly (e.g. only the first one would
have a diagnostic message if typo correction fails even though both
would be diagnosed if typo correction suggests a replacement).

llvm-svn: 213003

10 years agoFix a -Wunused-local-typedefs warning
Alp Toker [Mon, 14 Jul 2014 22:46:45 +0000 (22:46 +0000)]
Fix a -Wunused-local-typedefs warning

llvm-svn: 213002

10 years ago[DAGCombiner] Add more rules to combine shuffle vector dag nodes.
Andrea Di Biagio [Mon, 14 Jul 2014 22:46:26 +0000 (22:46 +0000)]
[DAGCombiner] Add more rules to combine shuffle vector dag nodes.

This patch teaches the DAGCombiner how to fold a pair of shuffles
according to rules:
  1.  shuffle(shuffle A, B, M0), B, M1) -> shuffle(A, B, M2)
  2.  shuffle(shuffle A, B, M0), A, M1) -> shuffle(A, B, M3)

The new rules would only trigger if the resulting shuffle has legal type and
legal mask.

Added test 'combine-vec-shuffle-3.ll' to verify that DAGCombiner correctly
folds shuffles on x86 when the resulting mask is legal. Also added some negative
cases to verify that we avoid introducing illegal shuffles.

llvm-svn: 213001

10 years agoLook through addrspacecast in IsConstantOffsetFromGlobal
Matt Arsenault [Mon, 14 Jul 2014 22:39:26 +0000 (22:39 +0000)]
Look through addrspacecast in IsConstantOffsetFromGlobal

llvm-svn: 213000