platform/upstream/llvm.git
8 years agoRevert r275141 - Mips: Avoid implicit iterator conversions, NFC
Daniel Sanders [Fri, 15 Jul 2016 13:54:20 +0000 (13:54 +0000)]
Revert r275141 - Mips: Avoid implicit iterator conversions, NFC

It appears to have caused some failures in our buildbots.

llvm-svn: 275562

8 years agocode hoisting pass based on GVN
Sebastian Pop [Fri, 15 Jul 2016 13:45:20 +0000 (13:45 +0000)]
code hoisting pass based on GVN

This pass hoists duplicated computations in the program. The primary goal of
gvn-hoist is to reduce the size of functions before inline heuristics to reduce
the total cost of function inlining.

Pass written by Sebastian Pop, Aditya Kumar, Xiaoyu Hu, and Brian Rzycki.
Important algorithmic contributions by Daniel Berlin under the form of reviews.

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

llvm-svn: 275561

8 years agoRemoving a few more :option: tags that we do not have corresponding .. option directi...
Aaron Ballman [Fri, 15 Jul 2016 13:13:45 +0000 (13:13 +0000)]
Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15214/steps/docs-clang-html/logs/stdio).

llvm-svn: 275560

8 years ago[LLVM][MIPS] Fix createStubFunction to emit JR encoding based on Arch.
Nitesh Jain [Fri, 15 Jul 2016 12:56:37 +0000 (12:56 +0000)]
[LLVM][MIPS] Fix createStubFunction to emit JR encoding based on Arch.

Reviewers: vkalintiris, dsanders

Subscribers: jaydeep, bhushan, mohit.bhakkad, slthakur, llvm-commits

Differential Revision: https://reviews.llvm.org/D21172

llvm-svn: 275559

8 years agoRemoving a few more :option: tags that we do not have corresponding .. option directi...
Aaron Ballman [Fri, 15 Jul 2016 12:55:47 +0000 (12:55 +0000)]
Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15213/steps/docs-clang-html/logs/stdio).

llvm-svn: 275558

8 years agoGPGPU: Add memory reference tag ids to tagged accesses
Tobias Grosser [Fri, 15 Jul 2016 12:44:27 +0000 (12:44 +0000)]
GPGPU: Add memory reference tag ids to tagged accesses

It seems we forgot to actually add the memory access ids to the tagged accesses,
but instead just tagged the accesses with empty isl_ids. This issue was found
by inspection and without code generation it is difficult to test just by
itself. We fix it for now without test case and expect our code generation
tests to cover this later on.

llvm-svn: 275557

8 years ago[clang-rename] fix testset
Kirill Bobyrev [Fri, 15 Jul 2016 12:22:38 +0000 (12:22 +0000)]
[clang-rename] fix testset

Make yet unsupported tests marked with FIXME pass so that buildbot doesn't fail.

llvm-svn: 275556

8 years agoFix TestDarwinNSLogOutput for windows
Pavel Labath [Fri, 15 Jul 2016 12:19:28 +0000 (12:19 +0000)]
Fix TestDarwinNSLogOutput for windows

pexpect python package does not exist on windows

llvm-svn: 275555

8 years ago[X86][AVX] Added shuffle tests for UNPCK+PERMUTE
Simon Pilgrim [Fri, 15 Jul 2016 11:51:46 +0000 (11:51 +0000)]
[X86][AVX] Added shuffle tests for UNPCK+PERMUTE

lowerVectorShuffleAsPermuteAndUnpack could solve this if it worked with 256-bit vectors

llvm-svn: 275554

8 years agoGPGPU: Do not check for hidden declarations
Tobias Grosser [Fri, 15 Jul 2016 11:42:53 +0000 (11:42 +0000)]
GPGPU: Do not check for hidden declarations

We do not have them in Polly and the code to check for them is directly
referring to pet data structures which we do not have available.

This commit avoids undefined behavior. As such issues are difficult to
reproduce, this commit comes without a test case.

llvm-svn: 275553

8 years ago[X86][AVX2] Added a memory version of test_mm256_broadcastsi128_si256
Simon Pilgrim [Fri, 15 Jul 2016 11:40:27 +0000 (11:40 +0000)]
[X86][AVX2] Added a memory version of test_mm256_broadcastsi128_si256

This should lower to vbroadcasti128

llvm-svn: 275552

8 years agoGPGPU: Test scalar/array types i1/i3/i8/i32/i60/i64/i80/i120/i128/i3000
Tobias Grosser [Fri, 15 Jul 2016 11:33:47 +0000 (11:33 +0000)]
GPGPU: Test scalar/array types i1/i3/i8/i32/i60/i64/i80/i120/i128/i3000

Arrays with integer base type are similar to arrays with floating point types,
with the exception that LLVM's integer types can take some odd values. We
add a selection of different values to make sure we correctly round these
types when necessary.

References to scalar integer types are special, as we currently do not model
these types as array accesses as they are considered 'synthesizable' by Polly.
As a result, we do not generate explicit data-transfers for them, but instead
will need to keep track of all references to 'synthesizable' values separately.

At the current stage, this is only visible by missing host-to-device
data-transfer calls. In the future, we will also require special code generation
strategies.

llvm-svn: 275551

8 years ago[clang-rename] apply stylistic fixes
Kirill Bobyrev [Fri, 15 Jul 2016 11:29:16 +0000 (11:29 +0000)]
[clang-rename] apply stylistic fixes

llvm-svn: 275550

8 years ago[ELF] Overriding reserved symbols in linker script
Eugene Leviant [Fri, 15 Jul 2016 11:20:04 +0000 (11:20 +0000)]
[ELF] Overriding reserved symbols in linker script

llvm-svn: 275549

8 years agoGPGPU: Test scalar parameters of type half/float/double/fp128/x86_fp80/ppc_fp128
Tobias Grosser [Fri, 15 Jul 2016 11:12:29 +0000 (11:12 +0000)]
GPGPU: Test scalar parameters of type half/float/double/fp128/x86_fp80/ppc_fp128

We currently only test that the code structure we generate for these scalar
parameters is correct and we add these types to make sure later code generation
additions have sufficient test coverage.

In case some of these types cannot be mapped due to missing hardware support
on the GPU some of these test cases may need to be updated later on.

llvm-svn: 275548

8 years agoGPGPU: Make sure scops with more than one array work
Tobias Grosser [Fri, 15 Jul 2016 10:51:14 +0000 (10:51 +0000)]
GPGPU: Make sure scops with more than one array work

We use this opportunity to add a test case containing a scalar parameter.

llvm-svn: 275547

8 years agoGPGPU: Free options to avoid memory leak
Tobias Grosser [Fri, 15 Jul 2016 10:32:22 +0000 (10:32 +0000)]
GPGPU: Free options to avoid memory leak

ppcg does not free the option structs for us. To avoid a memory leak we do this
ourselves.

llvm-svn: 275546

8 years ago[clang-rename] add few tests
Kirill Bobyrev [Fri, 15 Jul 2016 10:21:33 +0000 (10:21 +0000)]
[clang-rename] add few tests

Thiis patch introduces few additional tests including one case the tool does not handle yet, which should be fixed in the future.

Differential Revision: https://reviews.llvm.org/D22102

llvm-svn: 275545

8 years ago[NPL] Simplify process launch code
Pavel Labath [Fri, 15 Jul 2016 10:18:15 +0000 (10:18 +0000)]
[NPL] Simplify process launch code

Summary:
This removes one level of indirection, which was just packing and repacking launch args into
different structures. NFC.

Reviewers: tberghammer

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D22357

llvm-svn: 275544

8 years ago[X86][AVX2] Improve lowerShuffleAsRepeatedMaskAndLanePermute permutation of 64-bit...
Simon Pilgrim [Fri, 15 Jul 2016 09:49:12 +0000 (09:49 +0000)]
[X86][AVX2] Improve lowerShuffleAsRepeatedMaskAndLanePermute permutation of 64-bit sub-lanes

As discussed on PR28136, lowerShuffleAsRepeatedMaskAndLanePermute was attempting to match repeated masks at the 128-bit level and then permute the resultant lanes at the 128-bit (AVX1) or 64-bit (AVX2) sub-lane level.

This change allows us to create the repeated masks at the sub-lane level (and then concat them together to create a 128-bit repeated mask) and then select which sub-lane to permute. This has no effect on the AVX1 codegen.

Fixes PR28136.

llvm-svn: 275543

8 years ago[include-fixer] Always add as few as possible qualifiers to the unidentified symbol.
Haojian Wu [Fri, 15 Jul 2016 08:12:48 +0000 (08:12 +0000)]
[include-fixer] Always add as few as possible qualifiers to the unidentified symbol.

Reviewers: bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D22367

llvm-svn: 275542

8 years ago[ARM] Fix build after r275540
James Molloy [Fri, 15 Jul 2016 08:12:44 +0000 (08:12 +0000)]
[ARM] Fix build after r275540

A rebase seemed so innocent before committing. Turns out someone changed a pointer to a reference in the mean time :(

llvm-svn: 275541

8 years ago[Thumb-1] Select post-increment load and store where possible
James Molloy [Fri, 15 Jul 2016 08:03:56 +0000 (08:03 +0000)]
[Thumb-1] Select post-increment load and store where possible

Thumb-1 doesn't have post-inc or pre-inc load or store instructions. However the LDM/STM instructions with writeback can function as post-inc load/store:

  ldm r0!, {r1}  @ load from r0 into r1 and increment r0 by 4

Obviously, this only works if the post increment is 4.

llvm-svn: 275540

8 years ago[asan] Reduce flakiness of halt_on_error-torture.cc testcase.
Maxim Ostapenko [Fri, 15 Jul 2016 07:57:43 +0000 (07:57 +0000)]
[asan] Reduce flakiness of halt_on_error-torture.cc testcase.

It seems in some situations we have clashes on very first error so test only prints "nested bug in the same thread, aborting" rather than "use-after-poison", so remove corresponding " RUN: FileCheck %s < 10.txt" line.
Also, the two last " RUN: FileCheck --check-prefix=CHECK-COLLISION %s < 1.txt || FileCheck --check-prefix=CHECK-NO-COLLISION %s < 1.txt" look wrong, they should check 10.txt. Fix these lines too.

Differential Revision: https://reviews.llvm.org/D22309

llvm-svn: 275539

8 years ago[ARM] Followup to r275537 addressing review comments
James Molloy [Fri, 15 Jul 2016 07:57:35 +0000 (07:57 +0000)]
[ARM] Followup to r275537 addressing review comments

Address Chad's comment in D22216 which I missed due to tunnel vision on the "LGTM" comment.

llvm-svn: 275538

8 years ago[ARM] Prefer indirect calls in minsize mode
James Molloy [Fri, 15 Jul 2016 07:55:21 +0000 (07:55 +0000)]
[ARM] Prefer indirect calls in minsize mode

... When we emit several calls to the same function in the same basic block.

An indirect call uses a "BLX r0" instruction which has a 16-bit encoding. If many calls are made to the same target, this can enable significant code size reductions.

llvm-svn: 275537

8 years agoGPGPU: Shorten ppcg include paths to avoid conflict with cuda.h
Tobias Grosser [Fri, 15 Jul 2016 07:50:36 +0000 (07:50 +0000)]
GPGPU: Shorten ppcg include paths to avoid conflict with cuda.h

Instead of directly linking to ppcg's main source directory, we link to the
parent director. This allows us to access ppcg's include files with
'ppcg/cuda.h' and avoids a conflict with NVIDIA's cuda.h header.

Also drop an include directory that is currently not used.

llvm-svn: 275536

8 years agoGPGPU: Model array access information
Tobias Grosser [Fri, 15 Jul 2016 07:05:54 +0000 (07:05 +0000)]
GPGPU: Model array access information

This allows us to derive host-device and device-host data-transfers.

llvm-svn: 275535

8 years agoGPGPU: Use CHECK-NEXT to harden test cases
Tobias Grosser [Fri, 15 Jul 2016 07:05:49 +0000 (07:05 +0000)]
GPGPU: Use CHECK-NEXT to harden test cases

A sequence of CHECK lines allows additional statements to appear in the
output of the tested program without any test failures appearing. As we do
not want this to happen, switch this test case to use CHECK-NEXT.

llvm-svn: 275534

8 years agoXFAIL two SeparateConstOffsetFromGEP tests
David Majnemer [Fri, 15 Jul 2016 05:37:22 +0000 (05:37 +0000)]
XFAIL two SeparateConstOffsetFromGEP tests

They appear to have relied on bugs hidden in copyIRFlags/andIRFlags.

This has been filed as PR28564.

llvm-svn: 275533

8 years ago[IR] andIRFlags and copyIRFlags needs to handle GEP
David Majnemer [Fri, 15 Jul 2016 05:02:31 +0000 (05:02 +0000)]
[IR] andIRFlags and copyIRFlags needs to handle GEP

We didn't consider the inbounds flag on GEPs leading to downstream users
introducing UB.

This fixes PR28562.

llvm-svn: 275532

8 years agoInline traceUndefined function.
Rui Ueyama [Fri, 15 Jul 2016 04:57:46 +0000 (04:57 +0000)]
Inline traceUndefined function.

llvm-svn: 275531

8 years agoUpdate comments.
Rui Ueyama [Fri, 15 Jul 2016 04:57:44 +0000 (04:57 +0000)]
Update comments.

llvm-svn: 275530

8 years ago[OpenMP] add check for both simdlen and safelen clauses specified
Kelvin Li [Fri, 15 Jul 2016 04:39:07 +0000 (04:39 +0000)]
[OpenMP] add check for both simdlen and safelen clauses specified

This patch adds the check for specifying both simdlen and safelen clauses on the 'distribute simd' or 'distribute parallel for simd' constructs.

Differential Revision: https://reviews.llvm.org/D22384

llvm-svn: 275529

8 years agoRemove redundant `return`.
Rui Ueyama [Fri, 15 Jul 2016 04:32:11 +0000 (04:32 +0000)]
Remove redundant `return`.

llvm-svn: 275528

8 years agoMerge SymbolAssignmentKind and ExprKind.
Rui Ueyama [Fri, 15 Jul 2016 04:19:37 +0000 (04:19 +0000)]
Merge SymbolAssignmentKind and ExprKind.

In a linker script, `.` is a special symbol indicating a counter.
Previously, we had two expression types, ExprKind and SymbolAssignmentKind
for `.` and all the other symbol names, respectively. But we could merge
them because the former is a special case of the latter.

llvm-svn: 275527

8 years agoELF: Remove member variables that are used only in one function.
Rui Ueyama [Fri, 15 Jul 2016 03:06:42 +0000 (03:06 +0000)]
ELF: Remove member variables that are used only in one function.

Differential Revision: https://reviews.llvm.org/D22396

llvm-svn: 275526

8 years agoAvoid writing to errs().
Rui Ueyama [Fri, 15 Jul 2016 02:51:05 +0000 (02:51 +0000)]
Avoid writing to errs().

We should write to ErrorOS instead. Normaly, *ErrorOS == errs(),
but they can be different if LLD is embedded.

llvm-svn: 275525

8 years agoInline a vairable that is used only once. NFC.
Rui Ueyama [Fri, 15 Jul 2016 02:42:18 +0000 (02:42 +0000)]
Inline a vairable that is used only once. NFC.

llvm-svn: 275524

8 years agoELF: Simplify path constructions for -save-temps. NFC.
Rui Ueyama [Fri, 15 Jul 2016 02:17:13 +0000 (02:17 +0000)]
ELF: Simplify path constructions for -save-temps. NFC.

llvm-svn: 275523

8 years ago[llvm-cov] Relax a test for Windows
Vedant Kumar [Fri, 15 Jul 2016 02:11:37 +0000 (02:11 +0000)]
[llvm-cov] Relax a test for Windows

Attempt to address this bot failure:

  http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/4967

llvm-svn: 275522

8 years agoELF: Make check() always return a value.
Rui Ueyama [Fri, 15 Jul 2016 02:01:03 +0000 (02:01 +0000)]
ELF: Make check() always return a value.

This patch corresponds to r275511 for COFF.

llvm-svn: 275521

8 years ago[llvm-cov] Improve error messages
Vedant Kumar [Fri, 15 Jul 2016 01:53:39 +0000 (01:53 +0000)]
[llvm-cov] Improve error messages

While we're at it, extend an existing test to make sure that error
messages look reasonable.

llvm-svn: 275520

8 years agoRemember to add the testcase I wrote for r274822.
Jim Ingham [Fri, 15 Jul 2016 01:41:54 +0000 (01:41 +0000)]
Remember to add the testcase I wrote for r274822.

llvm-svn: 275519

8 years ago[Kaleidoscope][BuildingAJIT] Start filling in text for chapter 3.
Lang Hames [Fri, 15 Jul 2016 01:39:49 +0000 (01:39 +0000)]
[Kaleidoscope][BuildingAJIT] Start filling in text for chapter 3.

llvm-svn: 275518

8 years agoELF: Make error() to always set HasError.
Rui Ueyama [Fri, 15 Jul 2016 01:38:54 +0000 (01:38 +0000)]
ELF: Make error() to always set HasError.

Previously, it checked for the EC parameter and set HasError
only when there was an error. But in most places we called
error only when error had occurred, so this behavior was confusing.

llvm-svn: 275517

8 years ago[llvm-cov] Fix a use-after-free
Vedant Kumar [Fri, 15 Jul 2016 01:19:36 +0000 (01:19 +0000)]
[llvm-cov] Fix a use-after-free

Taking a lock before appending to a vector does no good unless threads
reading from the vector also take the lock, because the vector could be
re-sized.

I don't have a good isolated test for this. I found the issue with ASan
while testing a large project.  I'm working on a bot that does this.

llvm-svn: 275516

8 years ago[llvm-cov] Clean up an awkward capture-by-reference (NFC)
Vedant Kumar [Fri, 15 Jul 2016 01:19:35 +0000 (01:19 +0000)]
[llvm-cov] Clean up an awkward capture-by-reference (NFC)

Writing `for (StringRef &SourceFile : ...)` is strange to begin with.
Subsequently capturing "SourceFile" by reference is even stranger. Just
copy the StringRef, since that's cheap to do.

llvm-svn: 275515

8 years ago[Coverage] Mark a few more methods const (NFC)
Vedant Kumar [Fri, 15 Jul 2016 01:19:33 +0000 (01:19 +0000)]
[Coverage] Mark a few more methods const (NFC)

llvm-svn: 275514

8 years agoCOFF: Update error messages so that they start with lowercase letters.
Rui Ueyama [Fri, 15 Jul 2016 01:12:24 +0000 (01:12 +0000)]
COFF: Update error messages so that they start with lowercase letters.

llvm-svn: 275513

8 years agoRemove unnecessary explicit call of Twine ctor.
Rui Ueyama [Fri, 15 Jul 2016 01:06:40 +0000 (01:06 +0000)]
Remove unnecessary explicit call of Twine ctor.

llvm-svn: 275512

8 years agoMake check() always return a value.
Rui Ueyama [Fri, 15 Jul 2016 01:06:38 +0000 (01:06 +0000)]
Make check() always return a value.

Previously, one of two check functions didn't return a value.
It was confusing. This patch makes both functions return values.

llvm-svn: 275511

8 years agoAMDGPU: Fix not expanding control flow after some kill blocks
Matt Arsenault [Fri, 15 Jul 2016 00:58:15 +0000 (00:58 +0000)]
AMDGPU: Fix not expanding control flow after some kill blocks

Also stop trying to insert skip blocks at end_cf. This
was inserting them at the end of the block which doesn't make
sense. The skip should be inserted at the beginning of the block
right after the end cf. Just remove this for now since no tests
seem to stress this and I think this can be handled more generally
later.

Fixes bug 28550

llvm-svn: 275510

8 years agoAMDGPU: Fix trying to skip from a block with no successors
Matt Arsenault [Fri, 15 Jul 2016 00:58:13 +0000 (00:58 +0000)]
AMDGPU: Fix trying to skip from a block with no successors

Found while reducing bug 28550

llvm-svn: 275509

8 years agoAMDGPU: Fix splitting kill blocks with defs before kill
Matt Arsenault [Fri, 15 Jul 2016 00:58:09 +0000 (00:58 +0000)]
AMDGPU: Fix splitting kill blocks with defs before kill

llvm-svn: 275508

8 years agoFrontend: Simplify ownership model for clang's output streams.
Peter Collingbourne [Fri, 15 Jul 2016 00:55:40 +0000 (00:55 +0000)]
Frontend: Simplify ownership model for clang's output streams.

This changes the CompilerInstance::createOutputFile function to return
a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream
implicitly owned by the CompilerInstance. This in most cases required that
I move ownership of the output stream to the relevant ASTConsumer.

The motivation for this change is to allow BackendConsumer to be a client
of interfaces such as D20268 which take ownership of the output stream.

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

llvm-svn: 275507

8 years agoadjust one of the NSLog output tests to only run on macOS 10.12+
Todd Fiala [Fri, 15 Jul 2016 00:51:26 +0000 (00:51 +0000)]
adjust one of the NSLog output tests to only run on macOS 10.12+

The LLDB NSLog handling when Xcode intends to suppress NSLog
output only works on Fall 2016 OS releases.  Skip it on earlier
OSes.

llvm-svn: 275506

8 years agolibc++abi: add a top level option for using CompilerRT
Saleem Abdulrasool [Fri, 15 Jul 2016 00:49:42 +0000 (00:49 +0000)]
libc++abi: add a top level option for using CompilerRT

Add an option to opt into compiler-rt instead of libgcc.  This option defaults
to OFF to avoid a behaviour change.  It is not possible to mix and match
different runtime libraries.  Disabling this requires that libc++ is built
accordingly.  This knob is particularly useful for targets that are GCC by
default (i.e. Linux).

llvm-svn: 275505

8 years agoCOFF: Remove `void error()` functions and use fatal instead.
Rui Ueyama [Fri, 15 Jul 2016 00:40:46 +0000 (00:40 +0000)]
COFF: Remove `void error()` functions and use fatal instead.

This change makes the control flow more explicit.

llvm-svn: 275504

8 years ago[AArch64] Set COPY ZR isAsCheapAsAMove when needed.
Haicheng Wu [Fri, 15 Jul 2016 00:27:01 +0000 (00:27 +0000)]
[AArch64] Set COPY ZR isAsCheapAsAMove when needed.

If a subtarget has both ZCZeroing and CustomCheapAsMoveHandling features (now
only Kryo has both), set COPY (W|X)ZR isAsCheapAsAMove.

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

llvm-svn: 275503

8 years ago[codeview] Shrink inlined call site line info tables
Reid Kleckner [Thu, 14 Jul 2016 23:47:15 +0000 (23:47 +0000)]
[codeview] Shrink inlined call site line info tables

For a fully inlined call chain like a -> b -> c -> d, we were emitting
line info for 'd' 3 separate times: once for d's actual InlineSite line
table, and twice for 'b' and 'c'. This is particularly inefficient when
all these functions are in different headers, because now we need to
encode the file change. Windbg was coping with our suboptimal output, so
this should not be noticeable from the debugger.

llvm-svn: 275502

8 years agoCOFF: Remove unnecessary explicit calls of Twine ctor.
Rui Ueyama [Thu, 14 Jul 2016 23:43:36 +0000 (23:43 +0000)]
COFF: Remove unnecessary explicit calls of Twine ctor.

llvm-svn: 275501

8 years agoCOFF: Rename noreturn error -> fatal.
Rui Ueyama [Thu, 14 Jul 2016 23:37:14 +0000 (23:37 +0000)]
COFF: Rename noreturn error -> fatal.

This new name is also consistent with ELF.

llvm-svn: 275500

8 years agoCOFF: Rename non-noreturn error -> check.
Rui Ueyama [Thu, 14 Jul 2016 23:37:10 +0000 (23:37 +0000)]
COFF: Rename non-noreturn error -> check.

The new name is consistent with ELF.

llvm-svn: 275499

8 years agollvm-objdump: extend __mh_execute_header handling to other special syms
Tim Northover [Thu, 14 Jul 2016 23:13:03 +0000 (23:13 +0000)]
llvm-objdump: extend __mh_execute_header handling to other special syms

We don't need to print any of the special __mh_*_header symbols when
disassembling. Since they point at the beginning of the segment (not where the
actual code is) they're pretty misleading.

Should also fix lld bots.

llvm-svn: 275498

8 years ago[X86][AVX2] Allow VPERMPD/VPERMQ shuffles to call combineShuffle (reapplied)
Simon Pilgrim [Thu, 14 Jul 2016 23:05:09 +0000 (23:05 +0000)]
[X86][AVX2] Allow VPERMPD/VPERMQ shuffles to call combineShuffle (reapplied)

This improves the situation discussed in D19228 where we were forcing VPERMPD/VPERMQ where VPERM2F128/VPERM2I128 would have been better.

This was incorrectly reverted in rL275421 during triage of PR28552.

llvm-svn: 275497

8 years agoRemove the new module cache from the index-module test
Ben Langmuir [Thu, 14 Jul 2016 22:53:23 +0000 (22:53 +0000)]
Remove the new module cache from the index-module test

Forgot to add the new cache to the `rm -rf` line. This broke some bots
when trying to load a module built with an older compiler.

llvm-svn: 275496

8 years ago[LoopDist] Fix typo in diagnostic
Adam Nemet [Thu, 14 Jul 2016 22:33:46 +0000 (22:33 +0000)]
[LoopDist] Fix typo in diagnostic

llvm-svn: 275495

8 years ago[asan] Avoid hooking memchr() on Windows64
Etienne Bergeron [Thu, 14 Jul 2016 22:29:22 +0000 (22:29 +0000)]
[asan] Avoid hooking memchr() on Windows64

There is not enough padding in front of memchr(), and, the first 6 bytes
contains a branch instruction. Basically the current interception will
not work on memchr().

It was disabled before, but was missing the part to disable it for
INTERCEPT_LIBRARY_FUNCTION.

Patch by Wei Wang

Differential Revision: https://reviews.llvm.org/D22371

llvm-svn: 275494

8 years agoC does not have inline variables.
Paul Robinson [Thu, 14 Jul 2016 22:22:58 +0000 (22:22 +0000)]
C does not have inline variables.
Add a few missing tests for related C++ diagnostics.

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

llvm-svn: 275493

8 years agoaddress comments in: https://reviews.llvm.org/D22363
Etienne Bergeron [Thu, 14 Jul 2016 22:18:21 +0000 (22:18 +0000)]
address comments in: https://reviews.llvm.org/D22363

llvm-svn: 275492

8 years ago[compiler-rt] Fix missing argument in asan unittest
Etienne Bergeron [Thu, 14 Jul 2016 22:16:31 +0000 (22:16 +0000)]
[compiler-rt] Fix missing argument in asan unittest

Summary:
Both test have the same command-line.
The second test is missing the /GS-.

Keep in mind that /GS is on by default.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

Differential Revision: https://reviews.llvm.org/D22339

llvm-svn: 275491

8 years agoAdd test inputs missed by r275481.
Richard Smith [Thu, 14 Jul 2016 22:15:06 +0000 (22:15 +0000)]
Add test inputs missed by r275481.

llvm-svn: 275490

8 years ago[compiler-rt] Add more assembly patterns for interception
Etienne Bergeron [Thu, 14 Jul 2016 22:14:33 +0000 (22:14 +0000)]
[compiler-rt] Add more assembly patterns for interception

Summary:
These patterns are encounter when using instrumented DLL.

Without this patch, asan lit test are crashing when trying to hook
on RaiseException function.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, chrisha

Differential Revision: https://reviews.llvm.org/D22340

llvm-svn: 275489

8 years ago[compiler-rt] Add internal wcslen to avoid crashing on windows 64-bits
Etienne Bergeron [Thu, 14 Jul 2016 22:13:41 +0000 (22:13 +0000)]
[compiler-rt] Add internal wcslen to avoid crashing on windows 64-bits

Summary:
The function wcslen is incorrectly hooked on windows 64-bits.

The interception library is not able to hook without breaking the code.
The function is too small and the interception must be done with
trampoline-hooking which turned out to be incorrect on a small
loop (first few instructions have a backedge).

Reviewers: rnk

Subscribers: wang0109, chrisha, llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D22363

llvm-svn: 275488

8 years agollvm-objdump: handle stubbed and malformed dylibs better
Tim Northover [Thu, 14 Jul 2016 22:13:32 +0000 (22:13 +0000)]
llvm-objdump: handle stubbed and malformed dylibs better

We were quite happy to read past the end of the valid section data when
disassembling. Instead we entirely skip stub dylibs, and tell the user what's
happened if their section only has partial data.

llvm-svn: 275487

8 years ago[compiler-rt] Fix missing frame with stackwalking on windows 64-bits
Etienne Bergeron [Thu, 14 Jul 2016 22:04:28 +0000 (22:04 +0000)]
[compiler-rt] Fix missing frame with stackwalking on windows 64-bits

Summary: Fix missing frame with stackwalking on windows 64-bits

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

Differential Revision: https://reviews.llvm.org/D22358

llvm-svn: 275486

8 years agoLLDB help content has accumulated over time without a recent attempt to
Kate Stone [Thu, 14 Jul 2016 22:03:10 +0000 (22:03 +0000)]
LLDB help content has accumulated over time without a recent attempt to
review it for consistency, accuracy, and clarity. These changes attempt to
address all of the above while keeping the text relatively terse.

<rdar://problem/24868841>

llvm-svn: 275485

8 years agoAdd runtime support for __cpu_model (__builtin_cpu_supports)
Alina Sbirlea [Thu, 14 Jul 2016 22:02:35 +0000 (22:02 +0000)]
Add runtime support for __cpu_model (__builtin_cpu_supports)

Summary:
    This aims to add support for __cpu_model and address Bug 25510. It uses
    the code from lib/Support/Host.cpp for cpu detection, and creates
    __cpu_model with that info.

    Tested on OSX and built on Linux as well (though libgcc is the default).
    The use of "asm" required -std=gnu99, hence the cmake change. Corrections
    on better addressing this are welcome.

    Previously reverted, up for review again to iron out outstanding issues.

Reviewers: llvm-commits, joerg, echristo, mehdi_amini

Subscribers: mehdi_amini

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

llvm-svn: 275484

8 years ago[GVN] Fold constant expression in GVN.
Ekaterina Romanova [Thu, 14 Jul 2016 22:02:25 +0000 (22:02 +0000)]
[GVN] Fold constant expression in GVN.

Fix for PR 28418.

opt never finishes compiling a test when -gvn option is passed.
The problem is caused by the fact that GVN fails to fold a constant expression.

Differential Revision: https://reviews.llvm.org/D22185

llvm-svn: 275483

8 years agoEditing multi-line content in a terminal environment involves a lot of
Kate Stone [Thu, 14 Jul 2016 22:00:04 +0000 (22:00 +0000)]
Editing multi-line content in a terminal environment involves a lot of
trade-offs. When LLDB's multi-line editing support was first introduced
for expressions / REPL contexts the behavior was as follows:

* The Return key is treated as a line-break except at the end of the input
  buffer, where a completeness test is applied

This worked well enough when writing code, and makes it trivial to insert
new lines above code you've already typed. Just use cursor navigation to
move up and type freely. Where it was awkward is that the gesture to insert
a line break and end editing is conflated for most people. Sometimes you
want Return to end the editing session and other times you want to insert
a line break.

This commit changes the behavior as follows:

* The Return key is treated as the end of editing except at the end of the
  input buffer, where a completeness test is applied

* The Meta+Return sequence is always treated as a line break. This is
  consistent with conventions in Facebook and elsewhere since
  Alt/Option+Return is often mapped to Meta+Return. The unfortunate
  exception is on macOS where this *can* be the case, but isn't by
  default. Sigh.

Note that by design both before and after the patch pasting a Return
character always introduces a line break.

<rdar://problem/26886287>

llvm-svn: 275482

8 years ago[modules] Don't pass interesting decls to the consumer for a module file that's
Richard Smith [Thu, 14 Jul 2016 21:50:09 +0000 (21:50 +0000)]
[modules] Don't pass interesting decls to the consumer for a module file that's
passed on the command line but never actually used. We consider a (top-level)
module to be used if any part of it is imported, either by the current
translation unit, or by any part of a top-level module that is itself used.

(Put another way, a module is used if an implicit modules build would have
loaded its .pcm file.)

llvm-svn: 275481

8 years agoCOFF: Update remaining #include paths.
Peter Collingbourne [Thu, 14 Jul 2016 21:30:37 +0000 (21:30 +0000)]
COFF: Update remaining #include paths.

llvm-svn: 275480

8 years agoremoved darwin_log.py file from previous check-in
Todd Fiala [Thu, 14 Jul 2016 21:25:42 +0000 (21:25 +0000)]
removed darwin_log.py file from previous check-in

This file was not intended to be part of the last check-in.

llvm-svn: 275478

8 years agoELF: Update #include path for D22173.
Peter Collingbourne [Thu, 14 Jul 2016 21:21:20 +0000 (21:21 +0000)]
ELF: Update #include path for D22173.

llvm-svn: 275477

8 years agoMove legacy LTO interface headers to legacy/ directory.
Peter Collingbourne [Thu, 14 Jul 2016 21:21:16 +0000 (21:21 +0000)]
Move legacy LTO interface headers to legacy/ directory.

Differential Revision: https://reviews.llvm.org/D22173

llvm-svn: 275476

8 years agoReplace -mllvm -asan-use-after-scope=1 with -fsanitize-address-use-after-scope
Vitaly Buka [Thu, 14 Jul 2016 21:18:06 +0000 (21:18 +0000)]
Replace -mllvm -asan-use-after-scope=1 with -fsanitize-address-use-after-scope

Summary:
When test was added we had no -fsanitize-address-use-after-scope in clang
so we had to use -mllvm -asan-use-after-scope=1.

Reviewers: eugenis

Subscribers: kubabrecka

Differential Revision: https://reviews.llvm.org/D22382

llvm-svn: 275475

8 years ago[ThinLTO/gold] Perform index-based weak/linkonce resolution
Teresa Johnson [Thu, 14 Jul 2016 21:13:24 +0000 (21:13 +0000)]
[ThinLTO/gold] Perform index-based weak/linkonce resolution

Summary:
Invoke the weak/linkonce symbol resolution support (already used by
libLTO) that operates via the summary index.

This ensures prevailing linkonce are kept, by making them weak, and
marks preempted copies as available_externally when possible.

With this change, the older support for keeping the prevailing linkonce
(by changing their symbol resolution) is removed.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 275474

8 years ago[LV] Rename StrideAccesses to AccessStrideInfo (NFC)
Matthew Simpson [Thu, 14 Jul 2016 21:05:08 +0000 (21:05 +0000)]
[LV] Rename StrideAccesses to AccessStrideInfo (NFC)

We now collect all accesses with a constant stride, not just the ones with a
stride greater than one. This change was requested in the review of D19984.

llvm-svn: 275473

8 years agofix command-line LLDB so NSLog messages show up
Todd Fiala [Thu, 14 Jul 2016 21:02:45 +0000 (21:02 +0000)]
fix command-line LLDB so NSLog messages show up

Changes to the underlying logging infrastructure in Fall 2016 Darwin
OSes were no longer showing up NSLog messages in command-line LLDB.
This change restores that functionality, and adds test cases to
verify the new behavior.

rdar://26732492

llvm-svn: 275472

8 years ago[LV] Allow interleaved accesses in loops with predicated blocks
Matthew Simpson [Thu, 14 Jul 2016 20:59:47 +0000 (20:59 +0000)]
[LV] Allow interleaved accesses in loops with predicated blocks

This patch allows the formation of interleaved access groups in loops
containing predicated blocks. However, the predicated accesses are prevented
from forming groups.

Differential Revision: https://reviews.llvm.org/D19694

llvm-svn: 275471

8 years agodon't repeat function names in comments; NFC
Sanjay Patel [Thu, 14 Jul 2016 20:54:43 +0000 (20:54 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 275470

8 years ago[Object] Change Archive::findSym to return an Expected<Optional<Child>>.
Lang Hames [Thu, 14 Jul 2016 20:44:27 +0000 (20:44 +0000)]
[Object] Change Archive::findSym to return an Expected<Optional<Child>>.

As suggested by Rafael in review of D22079 - this was accidentally left out of
the final commit (r275316).

llvm-svn: 275469

8 years ago[SCCP] Pass the Solver by reference, copies are expensive ...
Davide Italiano [Thu, 14 Jul 2016 20:25:54 +0000 (20:25 +0000)]
[SCCP] Pass the Solver by reference, copies are expensive ...

.. enough to cause LTO compile time to regress insanely.
Thanks *a lot* to Rafael for reporting the problem and testing
the fix!

llvm-svn: 275468

8 years agoAdd recently added TargetOptions::EnableIPRA member to operator==
Mehdi Amini [Thu, 14 Jul 2016 20:22:13 +0000 (20:22 +0000)]
Add recently added TargetOptions::EnableIPRA member to operator==

llvm-svn: 275467

8 years ago[arcmt/objcmt] Fix ParentMap crash with invalid code.
Argyrios Kyrtzidis [Thu, 14 Jul 2016 20:21:16 +0000 (20:21 +0000)]
[arcmt/objcmt] Fix ParentMap crash with invalid code.

rdar://22489560

llvm-svn: 275466

8 years ago[ValueTracking] Use Instruction::getFunction; NFC
Sanjoy Das [Thu, 14 Jul 2016 20:19:01 +0000 (20:19 +0000)]
[ValueTracking] Use Instruction::getFunction; NFC

llvm-svn: 275465

8 years agoAttempt to workaround Windows bots after my previous commit
Ben Langmuir [Thu, 14 Jul 2016 20:08:43 +0000 (20:08 +0000)]
Attempt to workaround Windows bots after my previous commit

For some reason it seems the second invocation is getting DMOD_OTHER_H
set to a path with/forward/slashes, but one of the use sites
has\back\slashes. There should be no difference with what was already
there, but for now try to avoid checking those paths.

llvm-svn: 275464

8 years agos/constexpr/LLVM_CONSTEXPR in AArch64InstrInfo.cpp.
Justin Lebar [Thu, 14 Jul 2016 20:08:23 +0000 (20:08 +0000)]
s/constexpr/LLVM_CONSTEXPR in AArch64InstrInfo.cpp.

Yet again.

llvm-svn: 275463

8 years agoReverting 275417
Roger Ferrer Ibanez [Thu, 14 Jul 2016 20:05:30 +0000 (20:05 +0000)]
Reverting 275417

This change has triggered unexpected failures.

llvm-svn: 275462