platform/upstream/llvm.git
8 years agoMark an LLGS test as flaky
Pavel Labath [Wed, 16 Mar 2016 09:58:34 +0000 (09:58 +0000)]
Mark an LLGS test as flaky

cause: Async output arrival over pty
llvm-svn: 263631

8 years agoAvoid using LookupResult's implicit copy ctor and assignment operator to avoid warnings
Marina Yatsina [Wed, 16 Mar 2016 09:56:58 +0000 (09:56 +0000)]
Avoid using LookupResult's implicit copy ctor and assignment operator to avoid warnings

The purpose of this patch is to keep the same functionality without using LookupResult's implicit copy ctor and assignment operator, because they cause warnings when -Wdeprecated is passed.
This patch is meant to help the following review: http://reviews.llvm.org/D18123.
The functionality is covered by the tests in my original commit (255890)
The test case in this patch was added to test a bug caught in the review of the first version of this fix.

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

llvm-svn: 263630

8 years ago[test] Persist packets between expect_gdbremote_sequence invocations
Pavel Labath [Wed, 16 Mar 2016 09:44:49 +0000 (09:44 +0000)]
[test] Persist packets between expect_gdbremote_sequence invocations

Summary:
Some tests (Hc_then_Csignal_signals_correct_thread, at least) were sending a "continue" packet in
one expect_gdbremote_sequence invocation, and "expecting" the stop-reply in another call. This
posed a problem, because the were packets were not persisted between the two invocations, and if
the stub was exceptionally fast to respond, the packet would be received in the first invocation
(where it would be ignored) and then the second invocation would fail because it could not find
the packet.

Since doing matching in two invocations seems like a reasonable use of the packet pump, instead
of fixing the test, I make sure the packet_pump supports this usage by making the list of
captured packets persistent.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 263629

8 years agoFix thread/process ID reading from linux core files
Pavel Labath [Wed, 16 Mar 2016 09:19:57 +0000 (09:19 +0000)]
Fix thread/process ID reading from linux core files

Summary:
This also adds a basic smoke test for linux core file reading. I'm checking in the core files as
well, so that the tests can run on all platforms. With some tricks I was able to produce
reasonably-sized core files (~40K).

This fixes the first part of pr26322.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 263628

8 years agoAMDGPU: Verify instructions in non-debug builds as well
Michel Danzer [Wed, 16 Mar 2016 09:10:42 +0000 (09:10 +0000)]
AMDGPU: Verify instructions in non-debug builds as well

And emit an error if it fails.

This prevents illegal instructions from getting sent to the GPU, which
would potentially result in a hang.

This is a candidate for the stable branch(es).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
llvm-svn: 263627

8 years agoAMDGPU/SI: Clean up indentation in SIInstrInfo::getDefaultRsrcDataFormat
Michel Danzer [Wed, 16 Mar 2016 09:10:35 +0000 (09:10 +0000)]
AMDGPU/SI: Clean up indentation in SIInstrInfo::getDefaultRsrcDataFormat

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 263626

8 years agoMove OperatingSystem plugins to SystemInitializerFull
Pavel Labath [Wed, 16 Mar 2016 08:48:56 +0000 (08:48 +0000)]
Move OperatingSystem plugins to SystemInitializerFull

Summary: These are not needed in lldb-server. Removing them shrinks the server size by about 1.5%.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 263625

8 years agoAVX512BW: Fix SRA v64i8 lowering. Use PCMPGTM (cmp result in k register) for 512bit...
Igor Breger [Wed, 16 Mar 2016 08:48:26 +0000 (08:48 +0000)]
AVX512BW: Fix SRA v64i8 lowering. Use PCMPGTM (cmp result in k register) for 512bit vector because PCMPGT supported only for 128/256bit.

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

llvm-svn: 263624

8 years agoRevert r263622, "clang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config...
NAKAMURA Takumi [Wed, 16 Mar 2016 08:44:37 +0000 (08:44 +0000)]
Revert r263622, "clang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config/config.h instead of llvm's."

I'll commit better fix(es) later. "llvm/Config/config.h" shouldn't be available here.

llvm-svn: 263623

8 years agoclang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config/config.h instead...
NAKAMURA Takumi [Wed, 16 Mar 2016 08:28:55 +0000 (08:28 +0000)]
clang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config/config.h instead of llvm's.

llvm-svn: 263622

8 years ago[ASAN] Add support for mips/mips64 android
Mohit K. Bhakkad [Wed, 16 Mar 2016 08:23:10 +0000 (08:23 +0000)]
[ASAN] Add support for mips/mips64 android

Patch by Duane Sand

Reviewers: samsonov

Subscribers: duanesand, jaydeep, sagar, llvm-commits, filcab.

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

llvm-svn: 263621

8 years ago[Bitcode] Add compatibility test for the 3.8 release
Vedant Kumar [Wed, 16 Mar 2016 05:43:03 +0000 (05:43 +0000)]
[Bitcode] Add compatibility test for the 3.8 release

Fork off compatibility.ll for the 3.8 release. The *.bc file in this
commit was produced using a Release build of the release_38 branch.

llvm-svn: 263620

8 years ago[JumpThreading] See through Cast Instructions
Haicheng Wu [Wed, 16 Mar 2016 04:52:52 +0000 (04:52 +0000)]
[JumpThreading] See through Cast Instructions

To capture more jump-thread opportunity.

llvm-svn: 263618

8 years agoReapply: [VFS] Add support for handling path traversals
Bruno Cardoso Lopes [Wed, 16 Mar 2016 04:39:38 +0000 (04:39 +0000)]
Reapply: [VFS] Add support for handling path traversals

This is originally r261551, reverted because of windows bots failing on
unittests. Change the current behavior to do not handle path traversals
on windows.

Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.

Include the support for symlinks into components. Given the path:

/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.

Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.

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

rdar://problem/24499339

llvm-svn: 263617

8 years agoAdd clang thread safety annotations to mutex and lock_guard. Patch by jamesr@google...
Eric Fiselier [Wed, 16 Mar 2016 02:30:06 +0000 (02:30 +0000)]
Add clang thread safety annotations to mutex and lock_guard. Patch by jamesr@google.com.

This adds clang thread safety annotations to std::mutex and
std::lock_guard so code using these types can use these types directly
instead of having to wrap the types to provide annotations. These checks
when enabled by -Wthread-safety provide simple but useful static
checking to detect potential race conditions.
See http://clang.llvm.org/docs/ThreadSafetyAnalysis.html for details.

This patch was reviewed in http://reviews.llvm.org/D14731.

llvm-svn: 263611

8 years ago[Support] Update Error unit test to remove implementation specific behaviour.
Lang Hames [Wed, 16 Mar 2016 01:20:54 +0000 (01:20 +0000)]
[Support] Update Error unit test to remove implementation specific behaviour.

llvm-svn: 263610

8 years ago[Support] Add the 'Error' class for structured error handling.
Lang Hames [Wed, 16 Mar 2016 01:02:46 +0000 (01:02 +0000)]
[Support] Add the 'Error' class for structured error handling.

This patch introduces the Error classs for lightweight, structured,
recoverable error handling. It includes utilities for creating, manipulating
and handling errors. The scheme is similar to exceptions, in that errors are
described with user-defined types. Unlike exceptions however, errors are
represented as ordinary return types in the API (similar to the way
std::error_code is used).

For usage notes see the LLVM programmer's manual, and the Error.h header.
Usage examples can be found in unittests/Support/ErrorTest.cpp.

Many thanks to David Blaikie, Mehdi Amini, Kevin Enderby and others on the
llvm-dev and llvm-commits lists for lots of discussion and review.

llvm-svn: 263609

8 years ago[X86] Regenerated widen load tests
Simon Pilgrim [Wed, 16 Mar 2016 00:41:21 +0000 (00:41 +0000)]
[X86] Regenerated widen load tests

llvm-svn: 263608

8 years agoConvert some ObjC msgSends to runtime calls.
Pete Cooper [Wed, 16 Mar 2016 00:33:21 +0000 (00:33 +0000)]
Convert some ObjC msgSends to runtime calls.

It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions.

This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls.

Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions.

Reviewed by John McCall.

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

llvm-svn: 263607

8 years ago[X86][SSE41] Additional tests for extracting zeroable shuffle elements
Simon Pilgrim [Wed, 16 Mar 2016 00:13:36 +0000 (00:13 +0000)]
[X86][SSE41] Additional tests for extracting zeroable shuffle elements

We can currently only match zeroable vector elements of the same size as the shuffle type - these tests demonstrate the problem and a solution will be shortly added in an updated D14261

llvm-svn: 263606

8 years agoRevert "[JumpThreading] Simplify Instructions first in ComputeValueKnownInPredecessors()"
Haicheng Wu [Tue, 15 Mar 2016 23:38:47 +0000 (23:38 +0000)]
Revert "[JumpThreading] Simplify Instructions first in ComputeValueKnownInPredecessors()"

Not sure it handles undef properly.

llvm-svn: 263605

8 years agoOn some platforms, the compiler is allowed to assume that BOOL == bool. On others...
Enrico Granata [Tue, 15 Mar 2016 23:38:04 +0000 (23:38 +0000)]
On some platforms, the compiler is allowed to assume that BOOL == bool. On others, BOOL == signed char.
This can cause differences in which bit patterns end up meaning YES or NO. In general, however, 0 == NO and 1 == YES.

To keep it simple, LLDB will now show "YES" and "NO" only for 1 and 0 respectively, and format other values as the plain numeric value instead.

Fixes rdar://24809994

llvm-svn: 263604

8 years agoMake it so that the data formatter for NSError can see through a variable of type...
Enrico Granata [Tue, 15 Mar 2016 23:20:10 +0000 (23:20 +0000)]
Make it so that the data formatter for NSError can see through a variable of type NSError**. Fixes rdar://25060684

llvm-svn: 263603

8 years agoOnly try to load the OS plug-in after a shared library load if we don't already have...
Greg Clayton [Tue, 15 Mar 2016 22:44:07 +0000 (22:44 +0000)]
Only try to load the OS plug-in after a shared library load if we don't already have one.

<rdar://problem/24162686>

llvm-svn: 263602

8 years agoFix ClangASTContext::GetFunctionArgumentAtIndex() to not water down the type to the...
Greg Clayton [Tue, 15 Mar 2016 22:43:26 +0000 (22:43 +0000)]
Fix ClangASTContext::GetFunctionArgumentAtIndex() to not water down the type to the canonical type before handing the type out for the function type.

llvm-svn: 263601

8 years agoUnbreak buildbot.
Davide Italiano [Tue, 15 Mar 2016 22:38:21 +0000 (22:38 +0000)]
Unbreak buildbot.

It passed on a case-insensitive filesystem, but
it was broken on a case-sensitive one.

llvm-svn: 263598

8 years agollvm-bcanalyzer: Fix handling of attribute group entries
Justin Bogner [Tue, 15 Mar 2016 22:37:25 +0000 (22:37 +0000)]
llvm-bcanalyzer: Fix handling of attribute group entries

These were printing as "UnknownCode3", since we were looking for them
inside PARAMATTR blocks instead of PARAMATTR_GROUP blocks.

llvm-svn: 263597

8 years agoMyriad: define __myriad2 macro automatically
Douglas Katzman [Tue, 15 Mar 2016 22:34:02 +0000 (22:34 +0000)]
Myriad: define __myriad2 macro automatically

llvm-svn: 263596

8 years agoTurn LoopLoadElimination on again
Adam Nemet [Tue, 15 Mar 2016 22:26:12 +0000 (22:26 +0000)]
Turn LoopLoadElimination on again

The latent bug that LLE exposed in the LoopVectorizer was resolved
(PR26952).

The pass can be disabled with -mllvm -enable-loop-load-elim=0

llvm-svn: 263595

8 years ago[ELF] Ignore _GLOBAL_OFFSET_TABLE_ symbol in shared libs.
Davide Italiano [Tue, 15 Mar 2016 22:24:58 +0000 (22:24 +0000)]
[ELF] Ignore _GLOBAL_OFFSET_TABLE_ symbol in shared libs.

This fixes PR26705.

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

llvm-svn: 263594

8 years agoDon't crash if the TypeSP is empty.
Greg Clayton [Tue, 15 Mar 2016 21:58:28 +0000 (21:58 +0000)]
Don't crash if the TypeSP is empty.

llvm-svn: 263593

8 years agoImprove the 'type lookup' command such that it guesses to use the current's frame...
Enrico Granata [Tue, 15 Mar 2016 21:50:51 +0000 (21:50 +0000)]
Improve the 'type lookup' command such that it guesses to use the current's frame language as the one to start searching from.

llvm-svn: 263592

8 years ago[libfuzzer] speeding up corpus load
Mike Aizatsky [Tue, 15 Mar 2016 21:47:21 +0000 (21:47 +0000)]
[libfuzzer] speeding up corpus load

llvm-svn: 263591

8 years agoFix EHFrame processing to add implicit references when needed.
Pete Cooper [Tue, 15 Mar 2016 21:33:10 +0000 (21:33 +0000)]
Fix EHFrame processing to add implicit references when needed.

The current code for processCIE and processFDE returns out if it sees
any references.  The problem with this is that some references could be
explicit in the binary, while others are implicit as they can be
inferred from the content of the EHFrame itself.

This change walks the references we have against the references we
need, and verifies that all explicit references are in the correct place,
and generates any missing implicit ones.

Reviewed by Lang Hames and Nick Kledzik.

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

llvm-svn: 263590

8 years agoRevert commit http://reviews.llvm.org/D17877 to fix tests on x86.
Arpith Chacko Jacob [Tue, 15 Mar 2016 21:26:34 +0000 (21:26 +0000)]
Revert commit reviews.llvm.org/D17877 to fix tests on x86.

llvm-svn: 263589

8 years agoRemove unnecessary <limits> includes.
Jim Ingham [Tue, 15 Mar 2016 21:11:02 +0000 (21:11 +0000)]
Remove unnecessary <limits> includes.

llvm-svn: 263588

8 years ago[OpenMP] Base support for target directive codegen on NVPTX device.
Arpith Chacko Jacob [Tue, 15 Mar 2016 21:04:57 +0000 (21:04 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.

Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

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

llvm-svn: 263587

8 years agoFix spelling error in comment
Jonathan Peyton [Tue, 15 Mar 2016 20:59:10 +0000 (20:59 +0000)]
Fix spelling error in comment

llvm-svn: 263586

8 years agoAlso handle the new Rust pers fn to isCatchAll()
Bjorn Steinbrink [Tue, 15 Mar 2016 20:57:07 +0000 (20:57 +0000)]
Also handle the new Rust pers fn to isCatchAll()

llvm-svn: 263585

8 years agoMove the fixit for -Wformat-security to a note.
Bob Wilson [Tue, 15 Mar 2016 20:56:38 +0000 (20:56 +0000)]
Move the fixit for -Wformat-security to a note.

r263299 added a fixit for the -Wformat-security warning, but that runs
into complications with our guideline that error recovery should be done
as-if the fixit had been applied. Putting the fixit on a note avoids that.

llvm-svn: 263584

8 years ago[STATS] Print "Unknown" for frequency if it wasn't able to be parsed
Jonathan Peyton [Tue, 15 Mar 2016 20:55:32 +0000 (20:55 +0000)]
[STATS] Print "Unknown" for frequency if it wasn't able to be parsed

llvm-svn: 263583

8 years ago[STATS] Fix comments in kmp_stats.h
Jonathan Peyton [Tue, 15 Mar 2016 20:49:01 +0000 (20:49 +0000)]
[STATS] Fix comments in kmp_stats.h

llvm-svn: 263582

8 years agoAdd Rust's personality function to the list of known personality functions
Bjorn Steinbrink [Tue, 15 Mar 2016 20:35:45 +0000 (20:35 +0000)]
Add Rust's personality function to the list of known personality functions

Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 263581

8 years ago[STATS] Add header information to stats print out
Jonathan Peyton [Tue, 15 Mar 2016 20:28:47 +0000 (20:28 +0000)]
[STATS] Add header information to stats print out

This change adds a header to the printout of the statistics which includes the
time, machine name, and processor info if available. This change also includes
some cosmetic changes like using enum casting for timer and counter iteration.

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

llvm-svn: 263580

8 years ago[msan] Don't put module constructors in comdats.
Evgeniy Stepanov [Tue, 15 Mar 2016 20:25:47 +0000 (20:25 +0000)]
[msan] Don't put module constructors in comdats.

There is something strange going on with debug info (.eh_frame_hdr)
disappearing when msan.module_ctor are placed in comdat sections.

Moving this functionality under flag, disabled by default.

llvm-svn: 263579

8 years ago[cfi] Don't emit checks for disabled CFI kinds.
Evgeniy Stepanov [Tue, 15 Mar 2016 20:19:29 +0000 (20:19 +0000)]
[cfi] Don't emit checks for disabled CFI kinds.

In the cross-DSO CFI mode clang emits __cfi_check_fail that handles
errors triggered from other modules with targets in the current
module. With this change, __cfi_check_fail will handle errors for
CFI kinds that are not enabled in the current module as if they
have the trapping behaviour (-fsanitize-trap=...).

This fixes a bug where some combinations of -fsanitize* flags may
result in a link failure due to a missing sanitizer runtime library
for the diagnostic calls in __cfi_check_fail.

llvm-svn: 263578

8 years agoAdd missing error handling in llvm-lto
Mehdi Amini [Tue, 15 Mar 2016 20:17:55 +0000 (20:17 +0000)]
Add missing error handling in llvm-lto

Annoyingly, ErrorOr allows to *not check* the error when things go
well. It will crash badly when there is an error though. It should
runtime assert when it is used without being checked!

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263577

8 years ago[ThinLTO] Record all global variable defs in the summary
Teresa Johnson [Tue, 15 Mar 2016 19:35:45 +0000 (19:35 +0000)]
[ThinLTO] Record all global variable defs in the summary

Record all variable defs with a summary record to aid in building a
complete reference graph and locating constant variable defs to import.

llvm-svn: 263576

8 years ago[ASan] Make sure unittest works if sized-delete is enabled by default.
Alexey Samsonov [Tue, 15 Mar 2016 19:07:56 +0000 (19:07 +0000)]
[ASan] Make sure unittest works if sized-delete is enabled by default.

llvm-svn: 263575

8 years agoTest commit - Remove some trailing whitespace
Pablo Barrio [Tue, 15 Mar 2016 19:03:09 +0000 (19:03 +0000)]
Test commit - Remove some trailing whitespace

llvm-svn: 263574

8 years ago[MIR] Add a test case for the diagnostic of a wrongly typed generic instruction
Quentin Colombet [Tue, 15 Mar 2016 18:31:29 +0000 (18:31 +0000)]
[MIR] Add a test case for the diagnostic of a wrongly typed generic instruction

llvm-svn: 263573

8 years ago[AArch64] Move GlobalISel test cases into a GlobalISel subdirectory
Quentin Colombet [Tue, 15 Mar 2016 18:30:00 +0000 (18:30 +0000)]
[AArch64] Move GlobalISel test cases into a GlobalISel subdirectory

llvm-svn: 263572

8 years ago[CMake] Updating Apple build configurations
Chris Bieneman [Tue, 15 Mar 2016 18:27:28 +0000 (18:27 +0000)]
[CMake] Updating Apple build configurations

This updates Apple build configurations to adapt to r263566 & r263570, which added a PACKAGE_VENDOR variable.

llvm-svn: 263571

8 years ago[CMake] Defaulting CLANG_VENDOR to PACKAGE_VENDOR
Chris Bieneman [Tue, 15 Mar 2016 18:25:36 +0000 (18:25 +0000)]
[CMake] Defaulting CLANG_VENDOR to PACKAGE_VENDOR

LLVM r263566 adds a generic PACKAGE_VENDOR configuration which can be used to specify the vendor for LLVM toolchain tools. This change defaults the CLANG_VENDOR to the PACKAGE_VENDOR so that you don't have to specify both when building a package.

llvm-svn: 263570

8 years agoELF: Fix use-after-free problem.
Rui Ueyama [Tue, 15 Mar 2016 18:20:50 +0000 (18:20 +0000)]
ELF: Fix use-after-free problem.

Fixes pr26908. This patch is based on Filipe Cabecinhas'
patch (http://reviews.llvm.org/D18167)

http://reviews.llvm.org/D18169

llvm-svn: 263569

8 years agoFix a bot I broke.
Chris Bieneman [Tue, 15 Mar 2016 18:17:48 +0000 (18:17 +0000)]
Fix a bot I broke.

The builtin library isn't added by the driver unless it exists, so we shouldn't check for it. I've marked this as a FIXME, because we probably should have a way to test this.

llvm-svn: 263568

8 years ago[Driver] [Darwin] Fix linking libclang_rt.profile_*sim.a
Chris Bieneman [Tue, 15 Mar 2016 18:08:20 +0000 (18:08 +0000)]
[Driver] [Darwin] Fix linking libclang_rt.profile_*sim.a

Summary: isTarget*() calls are order-dependent. This is because iOS Sim *is* iOS. This means checks for the simulator version of the platform must always be ahead of checks for the embedded platform.

Reviewers: zaks.anna, bogner

Subscribers: cfe-commits

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

llvm-svn: 263567

8 years ago[CMake] Add PACKAGE_VENDOR for customizing version output
Chris Bieneman [Tue, 15 Mar 2016 18:07:46 +0000 (18:07 +0000)]
[CMake] Add PACKAGE_VENDOR for customizing version output

Summary: This change adds a PACKAGE_VENDOR variable. When set it makes the version output more closely resemble the clang version output.

Reviewers: aprantl, bogner

Subscribers: llvm-commits

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

llvm-svn: 263566

8 years ago[LV] Preserve LoopInfo when store predication is used
Adam Nemet [Tue, 15 Mar 2016 18:06:20 +0000 (18:06 +0000)]
[LV] Preserve LoopInfo when store predication is used

This was a latent bug that got exposed by the change to add LoopSimplify
as a dependence to LoopLoadElimination.  Since LoopInfo was corrupted
after LV, LoopSimplify mis-compiled nbench in the test-suite (more
details in the PR).

The problem was that when we create the blocks for predicated stores we
didn't add those to any loops.

The original testcase for store predication provides coverage for this
assuming we verify LI on the way out of LV.

Fixes PR26952.

llvm-svn: 263565

8 years ago[MC] Rename TLSDESC as it's not ARM specific.
Davide Italiano [Tue, 15 Mar 2016 17:29:52 +0000 (17:29 +0000)]
[MC] Rename TLSDESC as it's not ARM specific.

Similarly to what was done for TLSCALL in r263515.

llvm-svn: 263564

8 years agoAMDGPU/SI: Implement GroupStaticSize Intrinsic for Dynamic LDS
Changpeng Fang [Tue, 15 Mar 2016 17:28:44 +0000 (17:28 +0000)]
AMDGPU/SI: Implement GroupStaticSize Intrinsic for Dynamic LDS

Summary:
  Static LDS size is saved in MachineFunctionInfo::LDSSize,
We define a pseudo instruction with usesCustomInserter bit set. Then, in EmitInstrWithCustomInserter,
we replace this pseudo instruction with a mov of MachineFunctionInfo::LDSSize.

Reviewers:
    arsenm
    tstellarAMD

Subscribers
    llvm-commits, arsenm

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

llvm-svn: 263563

8 years ago[llvm-readobj] Impl GNU style printing of sections and relocations
Hemant Kulkarni [Tue, 15 Mar 2016 17:25:31 +0000 (17:25 +0000)]
[llvm-readobj] Impl GNU style printing of  sections and relocations

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

llvm-svn: 263561

8 years ago[COFF] Don't trust a symbol's section number
David Majnemer [Tue, 15 Mar 2016 16:47:28 +0000 (16:47 +0000)]
[COFF] Don't trust a symbol's section number

This fixes a test which exposed an ASan issue.

We assumed that a symbol's section number had a corresponding section
without performing validation.

llvm-svn: 263558

8 years agoMyriad: Add new sparc CPU kinds.
Douglas Katzman [Tue, 15 Mar 2016 16:41:47 +0000 (16:41 +0000)]
Myriad: Add new sparc CPU kinds.

llvm-svn: 263557

8 years agoMyriad: Pass -mcpu to movi{Compile,Asm}
Douglas Katzman [Tue, 15 Mar 2016 16:41:31 +0000 (16:41 +0000)]
Myriad: Pass -mcpu to movi{Compile,Asm}

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

llvm-svn: 263556

8 years agoReverted http://reviews.llvm.org/D17877 to fix tests.
Arpith Chacko Jacob [Tue, 15 Mar 2016 16:19:13 +0000 (16:19 +0000)]
Reverted reviews.llvm.org/D17877 to fix tests.

llvm-svn: 263555

8 years ago[libcxx] Remove localization tests for Russian month names
Jonas Hahnfeld [Tue, 15 Mar 2016 15:55:58 +0000 (15:55 +0000)]
[libcxx] Remove localization tests for Russian month names

Commit f49839299a085505eb673544744b61d2d9cdd1db in glibc-2.14 changed the
locales to the currently required format. However, they were again changed in
commit 55bdd2866f23b28422d969060b3518909a12b100 which has been released in 2.17.

That leads to the current situation where Debian and e.g. CentOS 6 have the
pre-2.14 locales, for example Ubuntu 14.04 has pre-2.17 and CentOS 7 on the
other hand has the newest locales in glibc-2.17.

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

llvm-svn: 263554

8 years agoRevert r263551 due to a test failure.
Kuba Brecka [Tue, 15 Mar 2016 15:53:39 +0000 (15:53 +0000)]
Revert r263551 due to a test failure.

llvm-svn: 263553

8 years ago[OpenMP] Base support for target directive codegen on NVPTX device.
Arpith Chacko Jacob [Tue, 15 Mar 2016 15:24:52 +0000 (15:24 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.

Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

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

llvm-svn: 263552

8 years ago[sanitizer] On OS X, verify that interceptors work and abort if not
Kuba Brecka [Tue, 15 Mar 2016 14:30:28 +0000 (14:30 +0000)]
[sanitizer] On OS X, verify that interceptors work and abort if not

On OS X 10.11+, we have "automatic interceptors", so we don't need to use DYLD_INSERT_LIBRARIES when launching instrumented programs. However, non-instrumented programs that load TSan late (e.g. via dlopen) are currently broken, as TSan will still try to initialize, but the program will crash/hang at random places (because the interceptors don't work). This patch adds an explicit check that interceptors are working, and if not, it aborts and prints out an error message suggesting to explicitly use DYLD_INSERT_LIBRARIES.

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

llvm-svn: 263551

8 years ago[GlobalOpt] Don't look through aliases when sorting names of globals.
Benjamin Kramer [Tue, 15 Mar 2016 14:18:26 +0000 (14:18 +0000)]
[GlobalOpt] Don't look through aliases when sorting names of globals.

If both are different aliases to the same value the sorting becomes
non-deterministic as array_pod_sort is not stable.

llvm-svn: 263550

8 years agoError/warning/log messages should start with lowercase letters.
George Rimar [Tue, 15 Mar 2016 14:00:22 +0000 (14:00 +0000)]
Error/warning/log messages should start with lowercase letters.

llvm-svn: 263549

8 years ago[SLP] Update comment to reflect reality. NFC.
Chad Rosier [Tue, 15 Mar 2016 13:27:58 +0000 (13:27 +0000)]
[SLP] Update comment to reflect reality. NFC.

llvm-svn: 263548

8 years agoAdd regression test for expressions calling functions taking anonymous struct typedef...
Ewan Crawford [Tue, 15 Mar 2016 13:02:11 +0000 (13:02 +0000)]
Add regression test for expressions calling functions taking anonymous struct typedef arguments

This CL adds a regression test for the bug listed at https://llvm.org/bugs/show_bug.cgi?id=26790
Functionality was implemented in commit r263544

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D17777

llvm-svn: 263547

8 years agoMake it possible for AST plugins to enable themselves by default
John Brawn [Tue, 15 Mar 2016 12:51:40 +0000 (12:51 +0000)]
Make it possible for AST plugins to enable themselves by default

Currently when an AST plugin is loaded it must then be enabled by passing
-plugin pluginname or -add-plugin pluginname to the -cc1 command line. This
patch adds a method to PluginASTAction which allows it to declare that the
action happens before, instead of, or after the main AST action, plus the
relevant changes to make the plugin action happen at that time automatically.

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

llvm-svn: 263546

8 years agoFix expression evaluation for resolving anonymous aggregrate types with a typedefed...
Ewan Crawford [Tue, 15 Mar 2016 09:50:16 +0000 (09:50 +0000)]
Fix expression evaluation for resolving anonymous aggregrate types with a typedefed name

This fixes a recently reported a bug(https://llvm.org/bugs/show_bug.cgi?id=26790) relating to the clang expression evaluator no longer being able to resolve calls to
functions with arguments to typedefed anonymous structs, unions, or enums after a cleanup to the expression parsing code in r260768

This fixes the issue by attaching the tagged name to the original clang::TagDecl object when generating the typedef in lldb::ClangAstContext::CreateTypeDef.

This also fixes the issue for anonymous typedefs for non-struct types (unions and enums) where we have a tag name.

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D18099

llvm-svn: 263544

8 years ago[COFF] Don't hard-code the load configuration size
David Majnemer [Tue, 15 Mar 2016 09:48:27 +0000 (09:48 +0000)]
[COFF] Don't hard-code the load configuration size

The load configuration directory is a structure whose size varies as the
OS gains additional functionality.  To account for this, the structure's
layout begins with a size field; this allows loaders to know which
fields are available.

However, LLD hard-coded the sizes (112 bytes for 64-bit and 64 for
32-bit).  This means that we might not inform the loader of all the
pertinent fields or we might claim that there are more fields than are
actually present.

To correctly account for this, the size field must be loaded from the
_load_config_used symbol.

N.B.  The COFF spec is either wrong or out of date, the load
configuration directory is not correctly documented in the
specification: it omits the size field.

llvm-svn: 263543

8 years ago[COFF] Remove an unused function, getFileOff
David Majnemer [Tue, 15 Mar 2016 09:48:18 +0000 (09:48 +0000)]
[COFF] Remove an unused function, getFileOff

The function was not used and was not functional: all paths would lead
to report_fatal_error or endless stack recursion.

llvm-svn: 263542

8 years agoRestrict the hack from r263429 to asan and msan.
Benjamin Kramer [Tue, 15 Mar 2016 09:41:39 +0000 (09:41 +0000)]
Restrict the hack from r263429 to asan and msan.

The other sanitizers don't have backend passes that rely on value names.
Avoid paying the compile time cost of names there.

llvm-svn: 263541

8 years ago[AMDGPU] Assembler: Update SOP* tests
Nikolay Haustov [Tue, 15 Mar 2016 07:44:57 +0000 (07:44 +0000)]
[AMDGPU] Assembler: Update SOP* tests

Add VI encodings.
Reformat sopp.s to match style of other files.

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

llvm-svn: 263540

8 years ago[COFF] Use the correct size of the TLS directory
David Majnemer [Tue, 15 Mar 2016 06:41:02 +0000 (06:41 +0000)]
[COFF] Use the correct size of the TLS directory

The TLS directory has a different layout depending on the bitness of the
machine the image will run on.  LLD would always use the 64-bit TLS
directory for the data directory entry instead of an appropriately sized
TLS directory.

llvm-svn: 263539

8 years agoMemAccInt: Do not strip pointer casts
Tobias Grosser [Tue, 15 Mar 2016 06:35:08 +0000 (06:35 +0000)]
MemAccInt: Do not strip pointer casts

This mirrors:

commit  https://llvm.org/svn/llvm-project/llvm/trunk@263462
Author: Michael Kuperstein <michael.kuperstein@gmail.com>
Date:   Mon Mar 14 18:34:29 2016 +0000

    [AliasSetTracker] Do not strip pointer casts when processing MemSetInst

and fixes the failure the above commit triggered in Polly.

llvm-svn: 263538

8 years ago[llvm-objdump] Add support for dumping the PE TLS directory
David Majnemer [Tue, 15 Mar 2016 06:14:01 +0000 (06:14 +0000)]
[llvm-objdump] Add support for dumping the PE TLS directory

The PE TLS directory contains information about where the TLS data
resides in the image, what functions should be executed when threads are
created, etc.

llvm-svn: 263537

8 years ago[llgo] Roll gofrontend forward
Andrew Wilkins [Tue, 15 Mar 2016 05:36:43 +0000 (05:36 +0000)]
[llgo] Roll gofrontend forward

Switch gofrontend to using go.googlesource.com, and
update to 81eb6a3f425b2158c67ee32c0cc973a72ce9d6be.

There are various changes required to update to the
go 1.5 runtime:

typemap.go is changed to accommodate the change in representation for equal/hash algorithms, and the removal of the zero value/type.
CMakeLists.txt is updated to add the build tree to the package search path, so internal packages, which are not installed, are found.
various files changes due to removal of __go_new_nopointers; the same change as in D11863, but with NoUnwindAttribute added to the added runtime functions which are called with "callOnly".
minor cleanups in ssa.go while investigating issues with unwinding/panic handling.

Differential Revisision: http://reviews.llvm.org/D15188

llvm-svn: 263536

8 years agobindings/go: reinstate TargetMachine.TargetData
Andrew Wilkins [Tue, 15 Mar 2016 05:04:06 +0000 (05:04 +0000)]
bindings/go: reinstate TargetMachine.TargetData

Summary:
LLVMGetTargetDataLayout was removed from the C API,
and then TargetMachine.TargetData was removed. Later,
LLVMCreateTargetMachineData was added to the C API,
and we now expose this via the Go API.

Reviewers: deadalnix, pcc

Subscribers: cierniak, llvm-commits, axw

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

llvm-svn: 263530

8 years agoBump the lldb version # in the xcode project files from
Jason Molenda [Tue, 15 Mar 2016 04:36:11 +0000 (04:36 +0000)]
Bump the lldb version # in the xcode project files from
350.99.0 to 360.99.0.

llvm-svn: 263529

8 years ago[MachO] Extend the alt_entry support for aliases added in r263521 to
Lang Hames [Tue, 15 Mar 2016 04:20:49 +0000 (04:20 +0000)]
[MachO] Extend the alt_entry support for aliases added in r263521 to
expressions of the form 'a = .' and 'a = Ltmp'.

llvm-svn: 263528

8 years agoUse some braces to format this a little better.
Eric Christopher [Tue, 15 Mar 2016 03:01:31 +0000 (03:01 +0000)]
Use some braces to format this a little better.

llvm-svn: 263527

8 years agoBitcodeWriter dyn_cast cleanup for r263275 (NFC)
Teresa Johnson [Tue, 15 Mar 2016 02:41:29 +0000 (02:41 +0000)]
BitcodeWriter dyn_cast cleanup for r263275 (NFC)

Address review suggestions from dblaikie: change a few dyn_cast to cast
and fold a cast into if condition.

llvm-svn: 263526

8 years agoFix llvm/llvm/lib/Transforms/Utils/LoopUnroll.cpp:285:53: error: suggest
Eric Christopher [Tue, 15 Mar 2016 02:19:06 +0000 (02:19 +0000)]
Fix llvm/llvm/lib/Transforms/Utils/LoopUnroll.cpp:285:53: error: suggest
parentheses around '&&' within '||' [-Werror=parentheses].

llvm-svn: 263525

8 years agoMove global ID computation from Function to GlobalValue (NFC)
Teresa Johnson [Tue, 15 Mar 2016 02:13:19 +0000 (02:13 +0000)]
Move global ID computation from Function to GlobalValue (NFC)

Since the static getGlobalIdentifier and getGUID methods are now called
for global values other than functions, reflect that by moving these
methods to the GlobalValue class.

llvm-svn: 263524

8 years agoWorkaround the fact that "b" is now a separate command object from "_regexp-break...
Enrico Granata [Tue, 15 Mar 2016 01:57:10 +0000 (01:57 +0000)]
Workaround the fact that "b" is now a separate command object from "_regexp-break", and thus "help b" doesn't show the possible syntaxes

It would be nice to have a longer-term plan for how to handle help for regular expression commands, since their syntax is highly irregular. I can see a few options (*), but for now this is a reasonable stop-gag measure for the most blatant regression.

(*) the simplest is, of course, to detect a regex command and inherit the syntax for any aliases thereof; it would be nice if this also didn't show the underlying regex command name when the alias is used

llvm-svn: 263523

8 years agoDenseMap: make .resize() do the intuitive thing
Fiona Glaser [Tue, 15 Mar 2016 01:50:46 +0000 (01:50 +0000)]
DenseMap: make .resize() do the intuitive thing

In some places, like InstCombine, we resize a DenseMap to fit the elements
we intend to put in it, then insert those elements (to avoid continual
reallocations as it grows). But .resize(foo) doesn't actually do what
people think; it resizes to foo buckets (which is really an
implementation detail the user of DenseMap probably shouldn't care about),
not the space required to fit foo elements. DenseMap grows if 3/4 of its
buckets are full, so this actually causes one forced reallocation every
time instead of avoiding a reallocation.

This patch makes .resize(foo) do the intuitive thing: it grows to the size
necessary to fit foo elements without new allocations.

Also include a test to verify that .resize() actually does what we think it
does.

llvm-svn: 263522

8 years ago[MachO] Add MachO alt-entry directive support.
Lang Hames [Tue, 15 Mar 2016 01:43:05 +0000 (01:43 +0000)]
[MachO] Add MachO alt-entry directive support.

This patch adds support for the MachO .alt_entry assembly directive, and uses
it for global aliases with non-zero GEP offsets. The alt_entry flag indicates
that a symbol should be layed out immediately after the preceding symbol.
Conceptually it introduces an alternate entry point for a function or data
structure. E.g.:

safe_foo:
  // check preconditions for foo
.alt_entry fast_foo
fast_foo:
  // body of foo, can assume preconditions.

The .alt_entry flag is also implicitly set on assembly aliases of the form:

a = b + C

where C is a non-zero constant, since these have the same effect as an
alt_entry symbol: they introduce a label that cannot be moved relative to the
preceding one. Setting the alt_entry flag on aliases of this form fixes
http://llvm.org/PR25381.

llvm-svn: 263521

8 years agoAdd some test coverage for the changes in alias help
Enrico Granata [Tue, 15 Mar 2016 01:43:00 +0000 (01:43 +0000)]
Add some test coverage for the changes in alias help

llvm-svn: 263520

8 years agoImprove the way we decide whether an alias is a dashdash alias
Enrico Granata [Tue, 15 Mar 2016 01:42:34 +0000 (01:42 +0000)]
Improve the way we decide whether an alias is a dashdash alias

llvm-svn: 263519

8 years ago[libFuzzer] use max_len exactly equal to the max size of input. Fix 32-bit build
Kostya Serebryany [Tue, 15 Mar 2016 01:28:00 +0000 (01:28 +0000)]
[libFuzzer] use max_len exactly equal to the max size of input. Fix 32-bit build

llvm-svn: 263518

8 years agoThis was printing arguments twice in dash-dash aliases; don't do that
Enrico Granata [Tue, 15 Mar 2016 01:17:32 +0000 (01:17 +0000)]
This was printing arguments twice in dash-dash aliases; don't do that

llvm-svn: 263517

8 years ago[StatepointLowering] Move an assertion; NFCI
Sanjoy Das [Tue, 15 Mar 2016 01:16:31 +0000 (01:16 +0000)]
[StatepointLowering] Move an assertion; NFCI

Instead of running an explicit loop over `gc.relocate` calls hanging off
of a `gc.statepoint`, assert the validity of the type of the value being
relocated in `visitRelocate`.

llvm-svn: 263516

8 years ago[MC] Rename TLSCALL as it's not ARM specific.
Davide Italiano [Tue, 15 Mar 2016 00:25:22 +0000 (00:25 +0000)]
[MC] Rename TLSCALL as it's not ARM specific.

`MCSymbolRefExpr` variant kind for TLSCALL is prefixed with
_ARM_ since this is how it was originally implemented.
The X86_64 version is exactly the same so there's no reason
to create a new variant, we can just rename the existing
one to be machine-independent.
This generalization is the first step to implement support
for GNU2 TLS dialect in MC.

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

llvm-svn: 263515