platform/upstream/llvm.git
9 years ago[X86] Remove 'memop' uses from AVX512. Use 'load' instead.
Craig Topper [Mon, 9 Feb 2015 04:04:50 +0000 (04:04 +0000)]
[X86] Remove 'memop' uses from AVX512. Use 'load' instead.

llvm-svn: 228562

9 years agoDeadArgElim: fix mismatch in accounting of array return types.
Tim Northover [Mon, 9 Feb 2015 01:21:00 +0000 (01:21 +0000)]
DeadArgElim: fix mismatch in accounting of array return types.

Some parts of DeadArgElim were only considering the individual fields
of StructTypes separately, but others (where insertvalue &
extractvalue instructions occur) also looked into ArrayTypes.

This one is an actual bug; the mismatch can lead to an argument being
considered used by a return sub-value that isn't being tracked (and
hence is dead by default). It then gets incorrectly eliminated.

llvm-svn: 228559

9 years agoDeadArgElim: assess uses of entire return value aggregate.
Tim Northover [Mon, 9 Feb 2015 01:20:53 +0000 (01:20 +0000)]
DeadArgElim: assess uses of entire return value aggregate.

Previously, a non-extractvalue use of an aggregate return value meant
the entire return was considered live (the algorithm gave up
entirely). This was correct, but conservative. It's better to actually
look at that Use, making the analysis results apply to all sub-values
under consideration.

E.g.

  %val = call { i32, i32 } @whatever()
  [...]
  ret { i32, i32 } %val

The return is using the entire aggregate (sub-values 0 and 1). We can
still simplify @whatever if we can prove that this return is itself
unused.

Also unifies the logic slightly between aggregate and non-aggregate
cases..

llvm-svn: 228558

9 years ago[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.
Lang Hames [Mon, 9 Feb 2015 01:20:51 +0000 (01:20 +0000)]
[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.

This patch refactors a key piece of the Orc APIs: It removes the
*::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target
addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn
respectively, which return instances of the new JITSymbol type. Unlike the old
methods, calling findSymbol or findSymbolIn does not cause the symbol to be
immediately materialized when found. Instead, the symbol will be materialized
if/when the getAddress method is called on the returned JITSymbol. This allows
us to query for the existence of symbols without actually materializing them. In
the future I expect more information to be attached to the JITSymbol class, for
example whether the returned symbol is a weak or strong definition. This will
allow us to properly handle weak symbols and multiple definitions.

llvm-svn: 228557

9 years agoInstCombine: propagate nonNull through assume
Ramkumar Ramachandra [Mon, 9 Feb 2015 01:13:13 +0000 (01:13 +0000)]
InstCombine: propagate nonNull through assume

Make assume (load (call|invoke) != null) set nonNull return attribute
for the call and invoke. Also include tests.

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

llvm-svn: 228556

9 years ago[emacs] Get llvm-mode to font-lock "personality"
Ramkumar Ramachandra [Mon, 9 Feb 2015 00:30:03 +0000 (00:30 +0000)]
[emacs] Get llvm-mode to font-lock "personality"

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

llvm-svn: 228555

9 years agoFix -Wuninitialized build by referencing the relevant ctor parameter instead of the...
David Blaikie [Sun, 8 Feb 2015 23:15:37 +0000 (23:15 +0000)]
Fix -Wuninitialized build by referencing the relevant ctor parameter instead of the base class member variable.

llvm-svn: 228554

9 years agoMake PDBSymbol's IPDBSymbol reference const.
Zachary Turner [Sun, 8 Feb 2015 22:53:53 +0000 (22:53 +0000)]
Make PDBSymbol's IPDBSymbol reference const.

llvm-svn: 228553

9 years agoBugfix: ScalarEvolution incorrectly assumes that the start of certain
Sanjoy Das [Sun, 8 Feb 2015 22:52:17 +0000 (22:52 +0000)]
Bugfix: ScalarEvolution incorrectly assumes that the start of certain
add recurrences don't overflow.

This change makes the optimization more restrictive.  It still assumes
that an overflowing `add nsw` is undefined behavior; and this change
will need revisiting once we have a consistent semantics for poison
values.

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

llvm-svn: 228552

9 years ago[X86] Remove the remaining uses of memop from AVX and AVX2 instruction patterns....
Craig Topper [Sun, 8 Feb 2015 22:38:25 +0000 (22:38 +0000)]
[X86] Remove the remaining uses of memop from AVX and AVX2 instruction patterns. AVX and AVX2 can handle unaligned loads being folded so we can just use 'load'

llvm-svn: 228551

9 years agoMetadata: Use <algorithm> to simplify code. NFC.
Benjamin Kramer [Sun, 8 Feb 2015 21:56:09 +0000 (21:56 +0000)]
Metadata: Use <algorithm> to simplify code. NFC.

llvm-svn: 228550

9 years agoFix sorting. Spotted by emaste.
Justin Hibbits [Sun, 8 Feb 2015 21:34:29 +0000 (21:34 +0000)]
Fix sorting.  Spotted by emaste.

llvm-svn: 228549

9 years agoPowerPC64 host also supports 32-bit binaries, so note it.
Justin Hibbits [Sun, 8 Feb 2015 21:23:27 +0000 (21:23 +0000)]
PowerPC64 host also supports 32-bit binaries, so note it.

llvm-svn: 228548

9 years agoFix off-by-one IsGPR().
Justin Hibbits [Sun, 8 Feb 2015 21:23:23 +0000 (21:23 +0000)]
Fix off-by-one IsGPR().

f0 was being counted as a GPR, due to the check in IsGPR().  Correct it by
looking at the precise GPR range.

llvm-svn: 228547

9 years agofix test attributes; this is an SSE2 test, not a Nehalem test
Sanjay Patel [Sun, 8 Feb 2015 21:14:27 +0000 (21:14 +0000)]
fix test attributes; this is an SSE2 test, not a Nehalem test

llvm-svn: 228546

9 years agofix test attributes; this is an x86-64 test, not a Nehalem test
Sanjay Patel [Sun, 8 Feb 2015 21:10:40 +0000 (21:10 +0000)]
fix test attributes; this is an x86-64 test, not a Nehalem test

llvm-svn: 228545

9 years agofix test attributes; these are SSE2 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 21:05:03 +0000 (21:05 +0000)]
fix test attributes; these are SSE2 tests, not Nehalem tests

llvm-svn: 228544

9 years agoKaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and remove...
David Blaikie [Sun, 8 Feb 2015 21:03:30 +0000 (21:03 +0000)]
Kaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and remove an unused parameter.

llvm-svn: 228543

9 years agoDebugInfoPDB: Make the symbol base case hold an IPDBSession ref.
Zachary Turner [Sun, 8 Feb 2015 20:58:09 +0000 (20:58 +0000)]
DebugInfoPDB: Make the symbol base case hold an IPDBSession ref.

Dumping a symbol often requires access to data that isn't inside
the symbol hierarchy, but which is only accessible through the
top-level session.  This patch is a pure interface change to give
symbols a reference to the session.

llvm-svn: 228542

9 years agofix test attributes; these are SSE2 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 20:50:58 +0000 (20:50 +0000)]
fix test attributes; these are SSE2 tests, not Nehalem tests

llvm-svn: 228541

9 years ago[Refactor] Use the LoopInfo object already present
Johannes Doerfert [Sun, 8 Feb 2015 20:50:42 +0000 (20:50 +0000)]
[Refactor] Use the LoopInfo object already present

llvm-svn: 228540

9 years agoKaleidoscope-Orc: Extract IRGen work into a utility function.
David Blaikie [Sun, 8 Feb 2015 20:29:28 +0000 (20:29 +0000)]
Kaleidoscope-Orc: Extract IRGen work into a utility function.

llvm-svn: 228539

9 years agoFix a handling of full path in break-insert.
Hafiz Abid Qadeer [Sun, 8 Feb 2015 20:21:08 +0000 (20:21 +0000)]
Fix a handling of full path in break-insert.
For some time, eclipse (CDT) uses full path of the file in break-insert command
when putting breakpoint on a source line. On windows, a typical command looks
like the following.
56-break-insert -f F:\\work\\ws\\test\\main.c:49

Current implementation in lldb-mi have problem in 2 ways.
1. It was assuming that there will be only one : in the path which is wrong if full
path is supplied.
2. CDT sends out path with double backslashes in windows which gives error on
resolution.

Fixed the : issue in lldb-mi. Changed FileSpec::Normalize to make sure that it
handles the path with \\ correctly. Added test cases to check for full path in
both lldb-mi and lldb. Also added a test case to check SBFileSpec with double
slashes.

llvm-svn: 228538

9 years agoConstify the Orc Kaleidoscope examples IRGen functions.
David Blaikie [Sun, 8 Feb 2015 20:15:01 +0000 (20:15 +0000)]
Constify the Orc Kaleidoscope examples IRGen functions.

llvm-svn: 228537

9 years agofix test attributes; these are x86-64 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 20:05:53 +0000 (20:05 +0000)]
fix test attributes; these are x86-64 tests, not Nehalem tests

llvm-svn: 228536

9 years agofix test attributes; these are MMX tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 20:01:12 +0000 (20:01 +0000)]
fix test attributes; these are MMX tests, not Nehalem tests

llvm-svn: 228535

9 years agofix test attributes; these are SSE2 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 19:50:55 +0000 (19:50 +0000)]
fix test attributes; these are SSE2 tests, not Nehalem tests

llvm-svn: 228534

9 years ago[ELF] Implement --strip-all/-s
Davide Italiano [Sun, 8 Feb 2015 19:42:15 +0000 (19:42 +0000)]
[ELF] Implement --strip-all/-s

Differential Revision: D7489
Reviewed by: shankarke

llvm-svn: 228533

9 years agogeneralize test; nothing Nehalem-specific here
Sanjay Patel [Sun, 8 Feb 2015 19:38:25 +0000 (19:38 +0000)]
generalize test; nothing Nehalem-specific here

llvm-svn: 228532

9 years ago[Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.
Lang Hames [Sun, 8 Feb 2015 19:15:33 +0000 (19:15 +0000)]
[Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.

llvm-svn: 228531

9 years ago[Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code and
Lang Hames [Sun, 8 Feb 2015 19:14:56 +0000 (19:14 +0000)]
[Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code and
further c++ify the Kaleidoscope/Orc tutorials.

llvm-svn: 228530

9 years agofix typos; NFC
Sanjay Patel [Sun, 8 Feb 2015 18:54:22 +0000 (18:54 +0000)]
fix typos; NFC

llvm-svn: 228529

9 years ago[X86][AVX2] AVX2 broadcast + permute memory folding tests.
Simon Pilgrim [Sun, 8 Feb 2015 18:33:13 +0000 (18:33 +0000)]
[X86][AVX2] AVX2 broadcast + permute memory folding tests.

llvm-svn: 228528

9 years agoMake UTF8->UTF16 conversion null terminate output on empty input.
Zachary Turner [Sun, 8 Feb 2015 18:08:51 +0000 (18:08 +0000)]
Make UTF8->UTF16 conversion null terminate output on empty input.

llvm-svn: 228527

9 years agoMoved AVX2 vbroadcast (reg) instruction foldings under the correct grouping. NFC.
Simon Pilgrim [Sun, 8 Feb 2015 17:13:54 +0000 (17:13 +0000)]
Moved AVX2 vbroadcast (reg) instruction foldings under the correct grouping. NFC.

llvm-svn: 228526

9 years agoCorrectly combine alias.scope metadata by a union instead of intersecting
Bjorn Steinbrink [Sun, 8 Feb 2015 17:07:14 +0000 (17:07 +0000)]
Correctly combine alias.scope metadata by a union instead of intersecting

Summary:
The alias.scope metadata represents sets of things an instruction might
alias with. When generically combining the metadata from two
instructions the result must be the union of the original sets, because
the new instruction might alias with anything any of the original
instructions aliased with.

Reviewers: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 228525

9 years ago[CMake] Kaleidoscope-Orc: Update libdeps.
NAKAMURA Takumi [Sun, 8 Feb 2015 11:15:08 +0000 (11:15 +0000)]
[CMake] Kaleidoscope-Orc: Update libdeps.

llvm-svn: 228524

9 years agoSema: Don't give attribute alias vars with struct type an init expr
David Majnemer [Sun, 8 Feb 2015 10:55:14 +0000 (10:55 +0000)]
Sema: Don't give attribute alias vars with struct type an init expr

We'd give the VarDecl a CXXConstructExpr even though it is annotated
with an alias attribute.  This would make us trip over sanity checking
asserts.

This fixes PR22493.

llvm-svn: 228523

9 years agoclang-format: Correctly mark preprocessor lines in child blocks.
Daniel Jasper [Sun, 8 Feb 2015 09:34:49 +0000 (09:34 +0000)]
clang-format: Correctly mark preprocessor lines in child blocks.

This prevents contracting:
  auto lambda = []() {
    int a = 2
  #if A
            + 2
  #endif
        ;
  };

into:
  auto lambda = []() { int a = 2
  #if A + 2
  #endif ; };

Which is obviously BAD.

This fixes llvm.org/PR22496.

llvm-svn: 228522

9 years agoMasked Gather and Scatter Intrinsics.
Elena Demikhovsky [Sun, 8 Feb 2015 08:27:19 +0000 (08:27 +0000)]
Masked Gather and Scatter Intrinsics.

Gather and Scatter are new introduced intrinsics, comming after recently implemented masked load and store.
This is the first patch for Gather and Scatter intrinsics. It includes only the syntax, parsing and verification.

Gather and Scatter intrinsics allow to perform multiple memory accesses (read/write) in one vector instruction.
The intrinsics are not target specific and will have the following syntax:
Gather:
declare <16 x i32> @llvm.masked.gather.v16i32(<16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1> <mask>, <16 x i32> <passthru>)
declare <8 x float> @llvm.masked.gather.v8f32(<8 x float*><vector of ptrs>, i32 <alignment>, <8 x i1> <mask>, <8 x float><passthru>)

Scatter:
declare void @llvm.masked.scatter.v8i32(<8 x i32><vector value to be stored> , <8 x i32*><vector of ptrs> , i32 <alignment>, <8 x i1> <mask>)
declare void @llvm.masked.scatter.v16i32(<16 x i32> <vector value to be stored> , <16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1><mask> )

Vector of ptrs - a set of source/destination addresses, to load/store the value.
Mask - switches on/off vector lanes to prevent memory access for switched-off lanes
vector of ptrs, value and mask should have the same vector width.

These are code examples where gather / scatter should be used and will allow function vectorization
;void foo1(int * restrict A, int * restrict B, int * restrict C) {
; for (int i=0; i<SIZE; i++) {
; A[i] = B[C[i]];
; }
;}

;void foo3(int * restrict A, int * restrict B) {
; for (int i=0; i<SIZE; i++) {
; A[B[i]] = i+5;
; }
;}

Tests will come in the following patches, with CodeGen and Vectorizer.

http://reviews.llvm.org/D7433

llvm-svn: 228521

9 years agoAdd CMake build support for Orc examples (& fix some clang -Werror build
David Blaikie [Sun, 8 Feb 2015 07:20:04 +0000 (07:20 +0000)]
Add CMake build support for Orc examples (& fix some clang -Werror build
breaks due to unused variables).

llvm-svn: 228520

9 years ago[Orc][Kaleidoscope] Fix method-name think-o. NFC.
Lang Hames [Sun, 8 Feb 2015 04:34:13 +0000 (04:34 +0000)]
[Orc][Kaleidoscope] Fix method-name think-o. NFC.

llvm-svn: 228519

9 years agoARM & AArch64: teach LowerVSETCC that output type size may differ from input.
Tim Northover [Sun, 8 Feb 2015 00:50:47 +0000 (00:50 +0000)]
ARM & AArch64: teach LowerVSETCC that output type size may differ from input.

While various DAG combines try to guarantee that a vector SETCC
operation will have the same output size as input, there's nothing
intrinsic to either creation or LegalizeTypes that actually guarantees
it, so the function needs to be ready to handle a mismatch.

Fortunately this is easy enough, just extend or truncate the naturally
compared result.

I couldn't reproduce the failure in other backends that I know have
SIMD, so it's probably only an issue for these two due to shared
heritage.

Should fix PR21645.

llvm-svn: 228518

9 years agoRemoved unused function mistakenly left in, triggering -Werror.
Zachary Turner [Sun, 8 Feb 2015 00:41:31 +0000 (00:41 +0000)]
Removed unused function mistakenly left in, triggering -Werror.

llvm-svn: 228517

9 years agoSome cleanup for libpdb.
Zachary Turner [Sun, 8 Feb 2015 00:29:29 +0000 (00:29 +0000)]
Some cleanup for libpdb.

This patch implements a few of the optional suggestions from the
initial patch comitting libpdb.  In particular, it implements a
virtual function out of line for each of the concrete classes.

A few other minor cleanups exist as well, such as using override
instead of virtual, etc.

llvm-svn: 228516

9 years ago[X86] Add register use/def for wrmsr and rdmsr.
Craig Topper [Sat, 7 Feb 2015 23:36:51 +0000 (23:36 +0000)]
[X86] Add register use/def for wrmsr and rdmsr.

llvm-svn: 228515

9 years ago[X86] Add GETSEC instruction.
Craig Topper [Sat, 7 Feb 2015 23:36:36 +0000 (23:36 +0000)]
[X86] Add GETSEC instruction.

llvm-svn: 228514

9 years ago[X86][AVX2] AVX2 integer stack folding tests.
Simon Pilgrim [Sat, 7 Feb 2015 23:28:16 +0000 (23:28 +0000)]
[X86][AVX2] AVX2 integer stack folding tests.

This adds tests for the remaining AVX2 instructions that currently support memory folding.

llvm-svn: 228513

9 years agoRename the 'Extending the Language: Debug Information' to 'Adding Debug Information...
David Blaikie [Sat, 7 Feb 2015 23:23:43 +0000 (23:23 +0000)]
Rename the 'Extending the Language: Debug Information' to 'Adding Debug Information' since this isn't actually modifying/extending the language.

llvm-svn: 228512

9 years agoReplace DeclContext::getNextContext with DeclContext::collectAllContexts
Yaron Keren [Sat, 7 Feb 2015 22:16:16 +0000 (22:16 +0000)]
Replace DeclContext::getNextContext with DeclContext::collectAllContexts
in the Clang CFE Internals Manual (done in r147729).

llvm-svn: 228510

9 years ago[X86][AVX] Added missing stack folding support + test for vptest ymm instruction
Simon Pilgrim [Sat, 7 Feb 2015 21:44:06 +0000 (21:44 +0000)]
[X86][AVX] Added missing stack folding support + test for vptest ymm instruction

llvm-svn: 228509

9 years agoLoopIdiom: Use utility functions.
Benjamin Kramer [Sat, 7 Feb 2015 21:37:08 +0000 (21:37 +0000)]
LoopIdiom: Use utility functions.

The only difference between deleteIfDeadInstruction and
RecursivelyDeleteTriviallyDeadInstructions is that the former also
manually invalidates SCEV. That's unnecessary because SCEV automatically
gets informed when an instruction is deleted via a ValueHandle. NFC.

llvm-svn: 228508

9 years agoAvoid integer overflows around realloc calls resulting in potential
Joerg Sonnenberger [Sat, 7 Feb 2015 21:24:06 +0000 (21:24 +0000)]
Avoid integer overflows around realloc calls resulting in potential
heap. Problem identified by Guido Vranken. Changes differ from original
OpenBSD sources by not depending on non-portable reallocarray.

llvm-svn: 228507

9 years ago[X86][SSE] Added missing stack folding tests for (v)mpsadbw instruction
Simon Pilgrim [Sat, 7 Feb 2015 21:20:11 +0000 (21:20 +0000)]
[X86][SSE] Added missing stack folding tests for (v)mpsadbw instruction

llvm-svn: 228506

9 years ago[clang-tidy] Checker for inefficient use of algorithms on associative containers
Gabor Horvath [Sat, 7 Feb 2015 19:54:19 +0000 (19:54 +0000)]
[clang-tidy] Checker for inefficient use of algorithms on associative containers

Summary:
Associative containers implements some of the algorithms as methods which
should be preferred to the algorithms in the algorithm header. The methods
can take advantage of the order of the elements.

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: cfe-commits

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

llvm-svn: 228505

9 years agoValueTracking: Make isBytewiseValue simpler and more powerful at the same time.
Benjamin Kramer [Sat, 7 Feb 2015 19:29:02 +0000 (19:29 +0000)]
ValueTracking: Make isBytewiseValue simpler and more powerful at the same time.

Turns out there is a simpler way of checking that all bytes in a word are equal
than binary decomposition.

llvm-svn: 228503

9 years agoProperly update AA metadata when performing call slot optimization
Bjorn Steinbrink [Sat, 7 Feb 2015 17:54:36 +0000 (17:54 +0000)]
Properly update AA metadata when performing call slot optimization

Subscribers: llvm-commits

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

llvm-svn: 228500

9 years agoFix docs typo regarding lit.local.cfg files
Jonathan Roelofs [Sat, 7 Feb 2015 17:18:26 +0000 (17:18 +0000)]
Fix docs typo regarding lit.local.cfg files

llvm-svn: 228499

9 years ago[BasicAA] Try to disambiguate GEPs through arrays of structs into
Ahmed Bougacha [Sat, 7 Feb 2015 17:04:29 +0000 (17:04 +0000)]
[BasicAA] Try to disambiguate GEPs through arrays of structs into
different fields.

We can show that two GEPs off of the same (possibly multidimensional)
array of structs, into different fields, can't alias.  Quoting:

For two GEPOperators GEP1 and GEP2, if we find that:
- both GEPs begin indexing from the exact same pointer;
- the last indices in both GEPs are constants, indexing into a struct;
- said indices are different, hence,the pointed-to fields are different;
- and both GEPs only index through arrays prior to that;

this lets us determine that the struct that GEP1 indexes into and the
struct that GEP2 indexes into must either precisely overlap or be
completely disjoint.  Because they cannot partially overlap, indexing
into different non-overlapping fields of the struct will never alias.

The other BasicAA::aliasGEP rules worked in some cases, but not all
(for example, the i32x3 struct in the testcase).
We can add this simple ad-hoc rule to complement them.

rdar://19717375
Differential Revision: http://reviews.llvm.org/D7453

llvm-svn: 228498

9 years agoSCEV: Compress disposition pairs.
Benjamin Kramer [Sat, 7 Feb 2015 16:41:12 +0000 (16:41 +0000)]
SCEV: Compress disposition pairs.

Composing DenseMaps and SmallVectors is still somewhat suboptimal,
but this at least halves the size of the vector elements. NFC.

llvm-svn: 228497

9 years agoSmallVector: Move emplace_back to SmallVectorImpl.
Benjamin Kramer [Sat, 7 Feb 2015 16:41:02 +0000 (16:41 +0000)]
SmallVector: Move emplace_back to SmallVectorImpl.

This resolves the strange effect that emplace_back is only available
when the type contained in the vector is not trivially copyable.

llvm-svn: 228496

9 years ago[X86] Force fp stack folding tests to keep to specific domain.
Simon Pilgrim [Sat, 7 Feb 2015 16:14:55 +0000 (16:14 +0000)]
[X86] Force fp stack folding tests to keep to specific domain.

General boolean instructions (AND, ANDN, OR, XOR) need to use a specific domain instruction (and not just the default).

llvm-svn: 228495

9 years ago[X86][AVX2] More AVX2 integer stack folding tests.
Simon Pilgrim [Sat, 7 Feb 2015 16:07:27 +0000 (16:07 +0000)]
[X86][AVX2] More AVX2 integer stack folding tests.

llvm-svn: 228494

9 years agoFix typos; NFC.
Andrea Di Biagio [Sat, 7 Feb 2015 13:56:20 +0000 (13:56 +0000)]
Fix typos; NFC.

llvm-svn: 228493

9 years agoCodeGen: Move DebugLocs.
Benjamin Kramer [Sat, 7 Feb 2015 13:15:54 +0000 (13:15 +0000)]
CodeGen: Move DebugLocs.

It's slightly cheaper than copying it, if the DebugLoc points to replaceable
metadata every copy is recorded in a DenseMap, moving reduces the peak size of
that map.

llvm-svn: 228492

9 years agoMove DebugLocs around instead of copying.
Benjamin Kramer [Sat, 7 Feb 2015 12:28:15 +0000 (12:28 +0000)]
Move DebugLocs around instead of copying.

llvm-svn: 228491

9 years agoMC: Emit COFF section flags in the "proper" order
David Majnemer [Sat, 7 Feb 2015 08:26:40 +0000 (08:26 +0000)]
MC: Emit COFF section flags in the "proper" order

COFF section flags are not idempotent:
  'rd' will make a read-write section because 'd' implies write
  'dr' will make a read-only section because 'r' disables write

llvm-svn: 228490

9 years agoConsistently use override rather than virtual.
Chandler Carruth [Sat, 7 Feb 2015 08:12:22 +0000 (08:12 +0000)]
Consistently use override rather than virtual.

This fixes -Winconsistent-missing-override warnings.

llvm-svn: 228489

9 years ago[PowerPC] Handle loop predecessor invokes
Hal Finkel [Sat, 7 Feb 2015 07:32:58 +0000 (07:32 +0000)]
[PowerPC] Handle loop predecessor invokes

If a loop predecessor has an invoke as its terminator, and the return value
from that invoke is used to determine the loop iteration space, then we can't
insert a computation based on that value in the loop predecessor prior to the
terminator (oops). If there's such an invoke, or just no predecessor for that
matter, insert a new loop preheader.

llvm-svn: 228488

9 years agoAdd more DWARF 5 language constants.
Bruce Mitchener [Sat, 7 Feb 2015 06:35:30 +0000 (06:35 +0000)]
Add more DWARF 5 language constants.

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

llvm-svn: 228487

9 years agoWhen creating a disassembler for one of the arm variants that can
Jason Molenda [Sat, 7 Feb 2015 06:03:49 +0000 (06:03 +0000)]
When creating a disassembler for one of the arm variants that can
only execute thumb instructions, force the arch triple string to
be "thumbv..." instead of "armv..." so we do the right thing by
default when disassembling arbitrary chunks of code.
<rdar://problem/15126397>

llvm-svn: 228486

9 years ago[modules] Treat friend declarations that are lexically within a dependent
Richard Smith [Sat, 7 Feb 2015 03:11:11 +0000 (03:11 +0000)]
[modules] Treat friend declarations that are lexically within a dependent
context as anonymous for merging purposes. They can't be found by their names,
so we merge them based on their position within the surrounding context.

llvm-svn: 228485

9 years agoChange RHS-style decltype to LHS-style decltype<declval()>.
Zachary Turner [Sat, 7 Feb 2015 02:02:23 +0000 (02:02 +0000)]
Change RHS-style decltype to LHS-style decltype<declval()>.

Seems some compilers don't like the RHS-style decltype specifier.

This should fix the buildbots.

llvm-svn: 228484

9 years agoclang-format: Format Objective-C try blocks like all the other try blocks.
Nico Weber [Sat, 7 Feb 2015 01:57:32 +0000 (01:57 +0000)]
clang-format: Format Objective-C try blocks like all the other try blocks.

Before:

  @try {
    // ...
  }
  @finally {
    // ...
  }

Now:

  @try {
    // ...
  } @finally {
    // ...
  }

This is consistent with how we format C++ try blocks and SEH try blocks.
clang-format not doing this before was an implementation oversight.

This is dependent on BraceBreakingStyle.  The snippet above is with the
Attach style.  Style Stroustrip for example still results in the "Before:"
snippet, which makes sense since other blocks (try, else) break after '}' too.

llvm-svn: 228483

9 years agoResubmit unittests for DebugInfoPDB.
Zachary Turner [Sat, 7 Feb 2015 01:47:14 +0000 (01:47 +0000)]
Resubmit unittests for DebugInfoPDB.

These were originally submitted as part of r228428, but this part
caused a build breakage in LLVMConfig.  The library portion was
resubmitted independently since it was not causing breakage.

There were two reasons this was causing the build to fail.  The
first is that there were no Makefiles added for the PDB tests.  And
the second is that the DebugInfoPDB library was only being built by
CMake behind an "if (MSVC)" check.  This is wrong since this the
library hides platform specific details, and it was causing
LLVM-Config to not find the library when trying to build unittests.

llvm-svn: 228482

9 years agoMake the byte-shift SSE intrinsics emit vector shuffles which we know the backend...
Filipe Cabecinhas [Sat, 7 Feb 2015 01:37:09 +0000 (01:37 +0000)]
Make the byte-shift SSE intrinsics emit vector shuffles which we know the backend can handle.

Also removed unused builtins.

Original patch by Andrea Di Biagio!

Reviewers: craig.topper, nadav

Subscribers: cfe-commits

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

llvm-svn: 228481

9 years ago[docs][LLVM-style RTTI] Add a mention of multiple inheritance.
Sean Silva [Sat, 7 Feb 2015 01:16:26 +0000 (01:16 +0000)]
[docs][LLVM-style RTTI] Add a mention of multiple inheritance.

llvm-svn: 228479

9 years agoSupport: Fix tests for VirtualityString
Duncan P. N. Exon Smith [Sat, 7 Feb 2015 01:07:30 +0000 (01:07 +0000)]
Support: Fix tests for VirtualityString

Since these `dwarf` functions return `const char *`, the tests need to
use `StringRef` for checks.  Should fix, e.g., hexagon [1].

[1]: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/22435

llvm-svn: 228478

9 years agoRemove unused parameter.
Rui Ueyama [Sat, 7 Feb 2015 00:54:46 +0000 (00:54 +0000)]
Remove unused parameter.

llvm-svn: 228476

9 years ago[modules] Don't accidentally trigger deserialization from DeclContext::noload_lookup.
Richard Smith [Sat, 7 Feb 2015 00:45:52 +0000 (00:45 +0000)]
[modules] Don't accidentally trigger deserialization from DeclContext::noload_lookup.

llvm-svn: 228475

9 years agoSupport: Add dwarf::getVirtuality()
Duncan P. N. Exon Smith [Sat, 7 Feb 2015 00:37:15 +0000 (00:37 +0000)]
Support: Add dwarf::getVirtuality()

llvm-svn: 228474

9 years agoSupport: Use Dwarf.def for DW_VIRTUALITY, NFC
Duncan P. N. Exon Smith [Sat, 7 Feb 2015 00:36:23 +0000 (00:36 +0000)]
Support: Use Dwarf.def for DW_VIRTUALITY, NFC

Use definition file for `DW_VIRTUALITY_*`.  Add a `DW_VIRTUALITY_max`
both for ease of testing and for future use by the `LLParser`.

llvm-svn: 228473

9 years agoDont' use close_fds = True on Windows.
Zachary Turner [Sat, 7 Feb 2015 00:14:55 +0000 (00:14 +0000)]
Dont' use close_fds = True on Windows.

If you do, the test runner will fail immediately with the error:

close_fds is not supported on Windows platforms if you redirect
stdin/stdout/stderr.

llvm-svn: 228472

9 years agoSupport: Add dwarf::getAttributeEncoding()
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 23:46:49 +0000 (23:46 +0000)]
Support: Add dwarf::getAttributeEncoding()

llvm-svn: 228470

9 years agoSupport: Rewrite AttributeEncodingString(), NFC
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 23:45:37 +0000 (23:45 +0000)]
Support: Rewrite AttributeEncodingString(), NFC

llvm-svn: 228469

9 years agoSupport: Stop stringifying DW_ATE_{lo,hi}_user
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 23:44:24 +0000 (23:44 +0000)]
Support: Stop stringifying DW_ATE_{lo,hi}_user

llvm-svn: 228468

9 years ago[PowerPC] Fixup incomplete revert of test/CodeGen/PowerPC/tls-pic.ll
Hal Finkel [Fri, 6 Feb 2015 23:30:06 +0000 (23:30 +0000)]
[PowerPC] Fixup incomplete revert of test/CodeGen/PowerPC/tls-pic.ll

llvm-svn: 228467

9 years ago[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.
Lang Hames [Fri, 6 Feb 2015 23:26:33 +0000 (23:26 +0000)]
[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.

This tutorial builds on the lazy_codegen kaleidoscope/orc tutorial by making
a small set of changes (~75 lines diff) to defer ir-generation for function
definitions until functions are actually referenced.

llvm-svn: 228466

9 years agoAdd code to llvm-objdump so the -section option with -macho will dump literal
Kevin Enderby [Fri, 6 Feb 2015 23:25:38 +0000 (23:25 +0000)]
Add code to llvm-objdump so the -section option with -macho will dump literal
sections with the Mach-O S_{4,8,16}BYTE_LITERALS section types.

llvm-svn: 228465

9 years agoPR22405: don't lose implicit-deleted-ness across AST write / read.
Richard Smith [Fri, 6 Feb 2015 23:20:21 +0000 (23:20 +0000)]
PR22405: don't lose implicit-deleted-ness across AST write / read.

llvm-svn: 228464

9 years ago[AArch64] Use the source location of the IR branch when creating Bcc
Ahmed Bougacha [Fri, 6 Feb 2015 23:15:39 +0000 (23:15 +0000)]
[AArch64] Use the source location of the IR branch when creating Bcc
from a conditional branch fed by an add/sub/mul-with-overflow node.

We previously used the SDLoc of the overflow node, for no good reason.
In some cases, this led to the Bcc and B terminators having different
source orders, and DBG_VALUEs being inserted between them.

The real issue is with the code that can't handle DBG_VALUEs between
terminators: the few places affected by this will be fixed soon.
In the meantime, fixing the SDLoc is a positive change no matter what.

No tests, as I have no idea how to get .loc emitted for branches?

rdar://19347133

llvm-svn: 228463

9 years ago[X86][AVX2] Begun adding AVX2 integer stack folding tests.
Simon Pilgrim [Fri, 6 Feb 2015 23:12:15 +0000 (23:12 +0000)]
[X86][AVX2] Begun adding AVX2 integer stack folding tests.

llvm-svn: 228462

9 years agoPECOFF: Move error check for invalid command line combination to validateImpl.
Rui Ueyama [Fri, 6 Feb 2015 23:09:13 +0000 (23:09 +0000)]
PECOFF: Move error check for invalid command line combination to validateImpl.

llvm-svn: 228461

9 years agoRevert "r227976 - [PowerPC] Yet another approach to __tls_get_addr" and related fixups
Hal Finkel [Fri, 6 Feb 2015 23:07:40 +0000 (23:07 +0000)]
Revert "r227976 - [PowerPC] Yet another approach to __tls_get_addr" and related fixups

Unfortunately, even with the workaround of disabling the linker TLS
optimizations in Clang restored (which has already been done), this still
breaks self-hosting on my P7 machine (-O3 -DNDEBUG -mcpu=native).

Bill is currently working on an alternate implementation to address the TLS
issue in a way that also fully elides the linker bug (which, unfortunately,
this approach did not fully), so I'm reverting this now.

llvm-svn: 228460

9 years ago[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-codegen.
Lang Hames [Fri, 6 Feb 2015 23:04:53 +0000 (23:04 +0000)]
[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-codegen.

This tutorial builds on the initial kaleidoscope/orc tutorial by adding a
LazyEmittingLayer to the custom stack. This extra layer defers compilation
of modules in the JIT until they are statically referenced.

llvm-svn: 228459

9 years agoSupport: Add dwarf::getLanguage()
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:55:13 +0000 (22:55 +0000)]
Support: Add dwarf::getLanguage()

llvm-svn: 228458

9 years agoSupport: Rewrite dwarf::LanguageString(), NFC
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:53:19 +0000 (22:53 +0000)]
Support: Rewrite dwarf::LanguageString(), NFC

llvm-svn: 228457

9 years ago[Orc] Add a Kaleidoscope tutorial for Orc demonstrating eager compilation.
Lang Hames [Fri, 6 Feb 2015 22:52:04 +0000 (22:52 +0000)]
[Orc] Add a Kaleidoscope tutorial for Orc demonstrating eager compilation.

This tutorial demonstrates a very basic custom Orc JIT stack that performs eager
compilation: All modules are CodeGen'd immediately upon being added to the JIT.

llvm-svn: 228456

9 years agoIR: Allow 32-bits for lines in debug location
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:50:13 +0000 (22:50 +0000)]
IR: Allow 32-bits for lines in debug location

Remove unnecessary restriction of 24-bits for line numbers in
`MDLocation`.

The rest of the debug info schema (with the exception of local
variables) uses 32-bits for line numbers.  As I introduce the
specialized nodes, it makes sense to canonicalize on one size or the
other.

llvm-svn: 228455

9 years ago[Orc] Add more missing headers.
Lang Hames [Fri, 6 Feb 2015 22:48:43 +0000 (22:48 +0000)]
[Orc] Add more missing headers.

llvm-svn: 228454