platform/upstream/llvm.git
8 years ago[Hexagon] Add NewValueJump support for C4_cmpneq, C4_cmplte, C4_cmplteu
Ron Lieberman [Tue, 8 Dec 2015 16:28:32 +0000 (16:28 +0000)]
[Hexagon] Add NewValueJump support for C4_cmpneq, C4_cmplte, C4_cmplteu

llvm-svn: 255027

8 years agoflip on executable bit on test runner tests
Todd Fiala [Tue, 8 Dec 2015 16:22:27 +0000 (16:22 +0000)]
flip on executable bit on test runner tests

llvm-svn: 255025

8 years agoMove all private members together. NFC.
Rafael Espindola [Tue, 8 Dec 2015 14:54:49 +0000 (14:54 +0000)]
Move all private members together. NFC.

llvm-svn: 255021

8 years ago[tsan] Add dispatch_group API interceptors and synchronization
Kuba Brecka [Tue, 8 Dec 2015 14:54:43 +0000 (14:54 +0000)]
[tsan] Add dispatch_group API interceptors and synchronization

This patch adds release and acquire semantics for dispatch groups, plus a test case.

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

llvm-svn: 255020

8 years ago[tsan] Fix memcmp interceptor to correctly use COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED
Kuba Brecka [Tue, 8 Dec 2015 14:48:21 +0000 (14:48 +0000)]
[tsan] Fix memcmp interceptor to correctly use COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED

The memcmp interceptor checks COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED only after it calls COMMON_INTERCEPTOR_ENTER, which causes an early process launch crash when running TSan in iOS simulator. Let's fix this by checking COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED as the very first thing in the interceptor.

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

llvm-svn: 255019

8 years ago[mips][ias] Range check uimm8 operands
Daniel Sanders [Tue, 8 Dec 2015 14:42:10 +0000 (14:42 +0000)]
[mips][ias] Range check uimm8 operands

Summary:

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 255018

8 years agoFix MSVC build after rL255016
Tamas Berghammer [Tue, 8 Dec 2015 14:27:40 +0000 (14:27 +0000)]
Fix MSVC build after rL255016

llvm-svn: 255017

8 years agoModify "platform connect" to connect to processes as well
Tamas Berghammer [Tue, 8 Dec 2015 14:08:19 +0000 (14:08 +0000)]
Modify "platform connect" to connect to processes as well

The standard remote debugging workflow with gdb is to start the
application on the remote host under gdbserver (e.g.: gdbserver :5039
a.out) and then connect to it with gdb.

The same workflow is supported by debugserver/lldb-gdbserver with a very
similar syntax but to access all features of lldb we need to be
connected also to an lldb-platform instance running on the target.

Before this change this had to be done manually with starting a separate
lldb-platform on the target machine and then connecting to it with lldb
before connecting to the process.

This change modifies the behavior of "platform connect" with
automatically connecting to the process instance if it was started by
the remote platform. With this command replacing gdbserver in a gdb
based worflow is usually as simple as replacing the command to execute
gdbserver with executing lldb-platform.

Differential revision: http://reviews.llvm.org/D14952

llvm-svn: 255016

8 years ago[mips][ias] Range check uimm6 operands and fix a bug this revealed.
Daniel Sanders [Tue, 8 Dec 2015 13:49:19 +0000 (13:49 +0000)]
[mips][ias] Range check uimm6 operands and fix a bug this revealed.

Summary:
We don't check the size operand on ext/dext*/ins/dins* yet because the
permitted range depends on the pos argument and we can't check that using
this mechanism.

The bug was that dextu/dinsu accepted 0..31 in the pos operand instead of 32..63.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 255015

8 years agoAdd a new option to Platform::LoadImage to install the image
Tamas Berghammer [Tue, 8 Dec 2015 13:43:59 +0000 (13:43 +0000)]
Add a new option to Platform::LoadImage to install the image

This change introduce 3 different working mode for Platform::LoadImage
depending on the file specs specified.
* If only a remote file is specified then the remote file is loaded on
  the target (same behavior as before)
* If only a local file is specified then the local file is installed to
  the current working directory and then loaded from there.
* If both local and remote file is specified then the local file is
  installed to the specified location and then loaded from there.

The same options are exposed on the SB API with a new method LoadImage
method while the old signature presers its meaning.

On the command line the installation of the shared library can be specified
with the "--install" option of "process load".

Differential revision: http://reviews.llvm.org/D15152

llvm-svn: 255014

8 years agoFixup dotest.py on mac for the configuration package
Pavel Labath [Tue, 8 Dec 2015 13:32:07 +0000 (13:32 +0000)]
Fixup dotest.py on mac for the configuration package

llvm-svn: 255013

8 years ago[x86][avx512] more changes in intrinsics to be align with gcc format
Asaf Badouh [Tue, 8 Dec 2015 12:34:38 +0000 (12:34 +0000)]
[x86][avx512] more changes in intrinsics to be align with gcc format

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

llvm-svn: 255012

8 years ago[x86][avx512] more changes in intrinsics to be align with gcc format
Asaf Badouh [Tue, 8 Dec 2015 12:34:34 +0000 (12:34 +0000)]
[x86][avx512] more changes in intrinsics to be align with gcc format

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

llvm-svn: 255011

8 years ago[AArch64] Add ARMv8.2-A FP16 vector instructions
Oliver Stannard [Tue, 8 Dec 2015 12:16:10 +0000 (12:16 +0000)]
[AArch64] Add ARMv8.2-A FP16 vector instructions

ARMv8.2-A adds 16-bit floating point versions of all existing SIMD
floating-point instructions. This is an optional extension, so all of
these instructions require the FeatureFullFP16 subtarget feature.

Note that VFP without SIMD is not a valid combination for any version of
ARMv8-A, but I have ensured that these instructions all depend on both
FeatureNEON and FeatureFullFP16 for consistency.

The ".2h" vector type specifier is now legal (for the scalar pairwise
reduction instructions), so some unrelated tests have been modified as
different error messages are emitted. This is not a problem as the
invalid operands are still caught.

llvm-svn: 255010

8 years agoFixup dotest.py after the configuration package introduction
Pavel Labath [Tue, 8 Dec 2015 12:09:56 +0000 (12:09 +0000)]
Fixup dotest.py after the configuration package introduction

llvm-svn: 255009

8 years ago[OPENMP 4.5] Parsing/sema for 'num_tasks' clause.
Alexey Bataev [Tue, 8 Dec 2015 12:06:20 +0000 (12:06 +0000)]
[OPENMP 4.5] Parsing/sema for 'num_tasks' clause.
OpenMP 4.5 adds directives 'taskloop' and 'taskloop simd'. These directives support clause 'num_tasks'. Patch adds parsing/semantic analysis for this clause.

llvm-svn: 255008

8 years agodding test for fnstsw
Michael Zuckerman [Tue, 8 Dec 2015 12:00:24 +0000 (12:00 +0000)]
dding test for fnstsw

continue of Wrong FNSTSW size operator
url: http://reviews.llvm.org/D14953

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

llvm-svn: 255007

8 years agoReplace bitwise AND with logical AND in an expression that already had another logica...
Craig Topper [Tue, 8 Dec 2015 06:49:15 +0000 (06:49 +0000)]
Replace bitwise AND with logical AND in an expression that already had another logical AND. NFC

llvm-svn: 255006

8 years ago[LLDB][MIPS] Handle PIC calling convention for MIPS32
Bhushan D. Attarde [Tue, 8 Dec 2015 06:05:57 +0000 (06:05 +0000)]
[LLDB][MIPS] Handle PIC calling convention for MIPS32

    SUMMARY:
    - PrepareTrivialCall() to setup register r25 with the address of function to be called.
    - RegisterIsCalleeSaved() to use name of a register instead of its byte_offset.

    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D15273

llvm-svn: 255005

8 years ago[Sema] Remove tab characters. NFC
Craig Topper [Tue, 8 Dec 2015 04:33:04 +0000 (04:33 +0000)]
[Sema] Remove tab characters. NFC

llvm-svn: 255004

8 years ago[SCEV] Move some struct declarations inside functions; NFC
Sanjoy Das [Tue, 8 Dec 2015 04:32:54 +0000 (04:32 +0000)]
[SCEV] Move some struct declarations inside functions; NFC

Reduces the scope over which the struct is visible, making its usages
obvious.  I did not move structs in cases where this wasn't a clear
win (the struct is too large, or is grouped in some other interesting
way).

llvm-svn: 255003

8 years ago[SCEV] Fix indentation; NFC
Sanjoy Das [Tue, 8 Dec 2015 04:32:51 +0000 (04:32 +0000)]
[SCEV] Fix indentation; NFC

llvm-svn: 255002

8 years agoAdd parse and sema for OpenMP distribute directive and all its clauses excluding...
Carlo Bertolli [Tue, 8 Dec 2015 04:21:03 +0000 (04:21 +0000)]
Add parse and sema for OpenMP distribute directive and all its clauses excluding dist_schedule.

llvm-svn: 255001

8 years ago[OperandBundles] Remove unncessary constructor
Sanjoy Das [Tue, 8 Dec 2015 03:50:32 +0000 (03:50 +0000)]
[OperandBundles] Remove unncessary constructor

The StringRef constructor is unnecessary (since we're converting to
std::string anyway), and having it requires an explicit call to
StringRef's or std::string's constructor.

llvm-svn: 255000

8 years ago[WebAssembly] Fix a typo in a comment.
Dan Gohman [Tue, 8 Dec 2015 03:43:03 +0000 (03:43 +0000)]
[WebAssembly] Fix a typo in a comment.

llvm-svn: 254999

8 years ago[WebAssembly] Remove an unneeded static_cast.
Dan Gohman [Tue, 8 Dec 2015 03:42:50 +0000 (03:42 +0000)]
[WebAssembly] Remove an unneeded static_cast.

llvm-svn: 254998

8 years ago[WebAssembly] Fix an emacs syntax highlighting comment.
Dan Gohman [Tue, 8 Dec 2015 03:36:00 +0000 (03:36 +0000)]
[WebAssembly] Fix an emacs syntax highlighting comment.

llvm-svn: 254997

8 years ago[WebAssembly] Convert a file-level comment to doxygen style.
Dan Gohman [Tue, 8 Dec 2015 03:33:51 +0000 (03:33 +0000)]
[WebAssembly] Convert a file-level comment to doxygen style.

llvm-svn: 254996

8 years ago[WebAssembly] Assert MRI.isSSA() in passes that depend on SSA form.
Dan Gohman [Tue, 8 Dec 2015 03:30:42 +0000 (03:30 +0000)]
[WebAssembly] Assert MRI.isSSA() in passes that depend on SSA form.

llvm-svn: 254995

8 years ago[WebAssembly] Trim some unneeded #includes.
Dan Gohman [Tue, 8 Dec 2015 03:25:35 +0000 (03:25 +0000)]
[WebAssembly] Trim some unneeded #includes.

llvm-svn: 254994

8 years ago[WebAssembly] Remove the override of haveFastSqrt.
Dan Gohman [Tue, 8 Dec 2015 03:22:33 +0000 (03:22 +0000)]
[WebAssembly] Remove the override of haveFastSqrt.

The default implementation in BasicTTI already checks TLI and does
the right thing.

llvm-svn: 254993

8 years agoExplicitly permit undefined behavior in constant initializers for global
Richard Smith [Tue, 8 Dec 2015 03:21:47 +0000 (03:21 +0000)]
Explicitly permit undefined behavior in constant initializers for global
variables in C, in the cases where we can constant-fold it to a value
regardless (such as floating-point division by zero and signed integer
overflow). Strictly enforcing this rule breaks too much code.

llvm-svn: 254992

8 years agoIR: Allow vectors of halfs to be ConstantDataVectors
Justin Bogner [Tue, 8 Dec 2015 03:01:16 +0000 (03:01 +0000)]
IR: Allow vectors of halfs to be ConstantDataVectors

Currently, vectors of halfs end up as ConstantVectors, but there isn't
a good reason they can't be ConstantDataVectors. This should save some
memory.

llvm-svn: 254991

8 years ago[llvm-objdump/MachO] Don't cut'n'paste the same code over and over.
Davide Italiano [Tue, 8 Dec 2015 02:45:59 +0000 (02:45 +0000)]
[llvm-objdump/MachO] Don't cut'n'paste the same code over and over.

Use the appropriate helper instead.

llvm-svn: 254990

8 years agoAdd a test showing that we internalize lazily linked GVs.
Rafael Espindola [Tue, 8 Dec 2015 02:38:14 +0000 (02:38 +0000)]
Add a test showing that we internalize lazily linked GVs.

llvm-svn: 254989

8 years agoAsmPrinter: Use emitGlobalConstantFP to emit elements of constant data
Justin Bogner [Tue, 8 Dec 2015 02:37:48 +0000 (02:37 +0000)]
AsmPrinter: Use emitGlobalConstantFP to emit elements of constant data

It's strange to duplicate the logic for emitting FP values into
emitGlobalConstantDataSequential, and it's even stranger that we end
up printing the verbose assembly comments differently between the two
paths. Just call into emitGlobalConstantFP rather than crudely
duplicating its logic.

llvm-svn: 254988

8 years agoSimplify test. NFC.
Rafael Espindola [Tue, 8 Dec 2015 02:29:45 +0000 (02:29 +0000)]
Simplify test. NFC.

llvm-svn: 254987

8 years agoReplace a bunch of duplicate conditions with the call from types::.
Eric Christopher [Tue, 8 Dec 2015 02:10:19 +0000 (02:10 +0000)]
Replace a bunch of duplicate conditions with the call from types::.

llvm-svn: 254986

8 years agoRemove name from FIXME.
Eric Christopher [Tue, 8 Dec 2015 01:59:51 +0000 (01:59 +0000)]
Remove name from FIXME.

llvm-svn: 254985

8 years agoUpdate comment to reflect that we use other tools via the toolchain to
Eric Christopher [Tue, 8 Dec 2015 01:59:47 +0000 (01:59 +0000)]
Update comment to reflect that we use other tools via the toolchain to
handle more than just C.

llvm-svn: 254984

8 years agoMove LLDBTestResult class to its own module.
Zachary Turner [Tue, 8 Dec 2015 01:15:44 +0000 (01:15 +0000)]
Move LLDBTestResult class to its own module.

llvm-svn: 254983

8 years agoGet rid of global variables in dotest.py
Zachary Turner [Tue, 8 Dec 2015 01:15:30 +0000 (01:15 +0000)]
Get rid of global variables in dotest.py

This moves all the global variables into a separate module called
`configuration`.  This has a number of advantages:

1. Configuration data is centrally maintained so it's easy to get
   a high level overview of what configuration data the test suite
   makes use of.
2. The method of sharing configuration data among different parts
   of the test suite becomes standardized.  Previously we would
   put some things into the `lldb` module, some things into the
   `lldbtest_config` module, and some things would not get shared.
   Now everything is shared through one module and is available to
   the entire test suite.
3. It opens the door to moving some of the initialization code into
   the `configuration` module, simplifying the implementation of
   `dotest.py`.

There are a few stragglers that didn't get converted over to using
the `configuration` module in this patch, because it would have grown
the size of the patch unnecessarily.  This includes everything
currently in the `lldbtest_config` module, as well as the
`lldb.remote_platform` variable.  We can address these in the future.

llvm-svn: 254982

8 years ago[diagnostics] Avoid crashes while printing macro backtraces
Reid Kleckner [Tue, 8 Dec 2015 01:08:09 +0000 (01:08 +0000)]
[diagnostics] Avoid crashes while printing macro backtraces

When attempting to map a source into a given level of macro expansion,
this code was ignoring the possibility that the start and end of the
range might take wildly different paths through the tree of macro
expansions. It was assuming that the begin spelling location would
always precede the end spelling location, which is false. A macro can
easily transpose its arguments.

This also fixes a related issue where there are extra macro arguments
between the begin location and the end location. In this situation, we
now highlight the entire macro invocation.

Pair programmed with Richard Smith.

Fixes PR12818.

llvm-svn: 254981

8 years agoTrying to submit 254476 one more time. This implement -gmodule debugging support.
Greg Clayton [Tue, 8 Dec 2015 01:02:08 +0000 (01:02 +0000)]
Trying to submit 254476 one more time. This implement -gmodule debugging support.

It was previously reverted due to issues that showed up only on linux. I was able to reproduce these issues and fix the underlying cause.

So this is the same patch as 254476 with the following two fixes:
- Fix not trying to complete classes that don't have external sources
- Fix ClangASTSource::CompleteType() to check the decl context of types that it finds by basename to ensure we don't complete a type "S" with a type like "std::S". Before this fix ClangASTSource::CompleteType() would accept _any_ type that had a matching basename and copy it into the other type.

<rdar://problem/22992457>

llvm-svn: 254980

8 years agoRefactor ResultsFormatter creation into result_formatter.
Todd Fiala [Tue, 8 Dec 2015 00:53:56 +0000 (00:53 +0000)]
Refactor ResultsFormatter creation into result_formatter.

This cleans up dotest.py and is a pre-step for getting
the test inferior runner to send post-inferior run events
to the events collector, as this code needs to be accessed
from within dosep.py.

llvm-svn: 254979

8 years ago[CXX TLS calling convention] Add support for AArch64.
Manman Ren [Tue, 8 Dec 2015 00:14:38 +0000 (00:14 +0000)]
[CXX TLS calling convention] Add support for AArch64.

rdar://9001553

llvm-svn: 254978

8 years ago[IndVars] Have getInsertPointForUses preserve LCSSA
Sanjoy Das [Tue, 8 Dec 2015 00:13:21 +0000 (00:13 +0000)]
[IndVars] Have getInsertPointForUses preserve LCSSA

Summary:
Also add a stricter post-condition for IndVarSimplify.

Fixes PR25578.  Test case by Michael Zolotukhin.

Reviewers: hfinkel, atrick, mzolotukhin

Subscribers: llvm-commits

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

llvm-svn: 254977

8 years ago[SCEVExpander] Have hoistIVInc preserve LCSSA
Sanjoy Das [Tue, 8 Dec 2015 00:13:17 +0000 (00:13 +0000)]
[SCEVExpander] Have hoistIVInc preserve LCSSA

Summary:
(Note: the problematic invocation of hoistIVInc that caused PR24804 came
from IndVarSimplify, not from SCEVExpander itself)

Fixes PR24804.  Test case by David Majnemer.

Reviewers: hfinkel, majnemer, atrick, mzolotukhin

Subscribers: llvm-commits

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

llvm-svn: 254976

8 years agoAdd Instruction::getFunction; NFC
Sanjoy Das [Tue, 8 Dec 2015 00:13:12 +0000 (00:13 +0000)]
Add Instruction::getFunction; NFC

Will be used in a upcoming patch.

llvm-svn: 254975

8 years ago[PassManager] Tuning Memory Usage of AnalysisUsage
Philip Reames [Tue, 8 Dec 2015 00:10:56 +0000 (00:10 +0000)]
[PassManager] Tuning Memory Usage of AnalysisUsage

We were using unneccessarily large initial sizes for these SmallVectors.  This was wasting around 50kb of memory for the O3 pipeline, even after the uniquing changes.  We're still using around 20kb which is a bit much, but it's definitely better.  This is about a 6% improvement in total O3 memory usage.

Note: The raw data on structure size which were used to pick these thresholds can be found in the review thread.

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

llvm-svn: 254974

8 years ago80-column fixup.
Eric Christopher [Tue, 8 Dec 2015 00:10:13 +0000 (00:10 +0000)]
80-column fixup.

llvm-svn: 254973

8 years agoUpdate comment.
Eric Christopher [Tue, 8 Dec 2015 00:10:10 +0000 (00:10 +0000)]
Update comment.

llvm-svn: 254972

8 years agoCleaned up the intro for the TS status page; really need much more info here
Marshall Clow [Tue, 8 Dec 2015 00:08:23 +0000 (00:08 +0000)]
Cleaned up the intro for the TS status page; really need much more info here

llvm-svn: 254971

8 years agofix return values to match bool return type; NFC
Sanjay Patel [Mon, 7 Dec 2015 23:34:30 +0000 (23:34 +0000)]
fix return values to match bool return type; NFC

llvm-svn: 254968

8 years agoFactor two calls to a common location.
Rafael Espindola [Mon, 7 Dec 2015 23:32:39 +0000 (23:32 +0000)]
Factor two calls to a common location.

llvm-svn: 254967

8 years ago[TSan] Enforce TSan runtime doesn't include system headers with --sysroot flag.
Alexey Samsonov [Mon, 7 Dec 2015 23:21:36 +0000 (23:21 +0000)]
[TSan] Enforce TSan runtime doesn't include system headers with --sysroot flag.

llvm-svn: 254966

8 years agoStabilize llvm/test/Object/archive-update.test a bit.
NAKAMURA Takumi [Mon, 7 Dec 2015 23:15:57 +0000 (23:15 +0000)]
Stabilize llvm/test/Object/archive-update.test a bit.

A manipulation (in this case, mkdir) can make slack between creating and touching %t.older/evenlen.

I would make this rewrote with python if this were still unstable.

llvm-svn: 254965

8 years agoSupport: Teach Asan about BumpPtrAllocator
Justin Bogner [Mon, 7 Dec 2015 23:12:26 +0000 (23:12 +0000)]
Support: Teach Asan about BumpPtrAllocator

Based on patch by Pete Cooper.

llvm-svn: 254964

8 years agoLet llvm-lto installed. A few tests in clang/test are using it.
NAKAMURA Takumi [Mon, 7 Dec 2015 23:07:16 +0000 (23:07 +0000)]
Let llvm-lto installed. A few tests in clang/test are using it.

llvm-svn: 254963

8 years ago[analyzer] Fix crash when lambda captures a variable-length array.
Devin Coughlin [Mon, 7 Dec 2015 23:01:53 +0000 (23:01 +0000)]
[analyzer] Fix crash when lambda captures a variable-length array.

When a C++ lambda captures a variable-length array, it creates a capture
field to store the size of the array. The initialization expression for this
capture is null, which led the analyzer to crash when initializing the field.
To avoid this, use the size expression from the VLA type to determine the
initialization value.

rdar://problem/23748072

llvm-svn: 254962

8 years agoAdd llvm-objdump to compiler-rt test deps.
Alexey Samsonov [Mon, 7 Dec 2015 22:45:36 +0000 (22:45 +0000)]
Add llvm-objdump to compiler-rt test deps.

llvm-svn: 254961

8 years agoRemove debug output that snuck into 254957
Philip Reames [Mon, 7 Dec 2015 22:43:56 +0000 (22:43 +0000)]
Remove debug output that snuck into 254957

llvm-svn: 254960

8 years ago[TSan] Use llvm-objdump+FileCheck instead of standalone .sh script.
Alexey Samsonov [Mon, 7 Dec 2015 22:43:30 +0000 (22:43 +0000)]
[TSan] Use llvm-objdump+FileCheck instead of standalone .sh script.

llvm-svn: 254959

8 years ago80-col and whitespace fixups.
Eric Christopher [Mon, 7 Dec 2015 22:43:05 +0000 (22:43 +0000)]
80-col and whitespace fixups.

llvm-svn: 254958

8 years agoReapply 254950 w/fix
Philip Reames [Mon, 7 Dec 2015 22:41:23 +0000 (22:41 +0000)]
Reapply 254950 w/fix

254950 ended up being not NFC.  The previous code was overriding the flags for whether an instruction read or wrote memory using the target specific flags returned via TTI.  I'd missed this in my refactoring.  Since I mistakenly built only x86 and didn't notice the number of unsupported tests, I didn't catch that before the original checkin.

This raises an interesting issue though.  Given we have function attributes (i.e. readonly, readnone, argmemonly) which describe the aliasing of intrinsics, why does TTI have this information overriding the instruction definition at all?  I see no reason for this, but decided to preserve existing behavior for the moment.  The root issue might be that we don't have a "writeonly" attribute.

Original commit message:
[EarlyCSE] Simplify and invert ParseMemoryInst [NFCI]

Restructure ParseMemoryInst - which was introduced to abstract over target specific load and stores instructions - to just query the underlying instructions. In theory, this could be slightly slower than caching the results, but in practice, it's very unlikely to be measurable.

The simple query scheme makes it far easier to understand, and much easier to extend with new queries. Given I'm about to need to add new query types, doing the cleanup first seemed worthwhile.

Do we still believe the target specific intrinsic handling is worthwhile in EarlyCSE? It adds quite a bit of complexity and makes the code harder to read. Being able to delete the abstraction entirely would be wonderful.

llvm-svn: 254957

8 years agoRemove useless hack that avoids calling LLVMLinkInInterpreter()
Mehdi Amini [Mon, 7 Dec 2015 22:27:19 +0000 (22:27 +0000)]
Remove useless hack that avoids calling LLVMLinkInInterpreter()

This is supposed to force-link the Interpreter, by inserting a dead
call to LLVMLinkInInterpreter().
Since it is actually an empty function, there is no reason for the
call to be dead.

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

8 years ago[TSan] Port check_memcpy.sh script to a regular lit test.
Alexey Samsonov [Mon, 7 Dec 2015 21:53:59 +0000 (21:53 +0000)]
[TSan] Port check_memcpy.sh script to a regular lit test.

Check that TSan runtime doesn't contain compiler-inserted calls
to memset/memmove functions.

In future, we may consider moving this test to test/sanitizer_common,
as we don't want to have compiler-inserted memcpy/memmove calls in
any sanitizer runtime.

llvm-svn: 254955

8 years agoRevert 254950
Philip Reames [Mon, 7 Dec 2015 21:41:29 +0000 (21:41 +0000)]
Revert 254950

It's causing test failures on AArch64.  Due to a bad build config on my part, I apparently wasn't running the tests I thought I was.

llvm-svn: 254954

8 years agoUpdate doc for C++ TLS calling convention.
Manman Ren [Mon, 7 Dec 2015 21:40:09 +0000 (21:40 +0000)]
Update doc for C++ TLS calling convention.

llvm-svn: 254953

8 years agoSimplify the error handling a bit. NFC.
Rafael Espindola [Mon, 7 Dec 2015 21:28:22 +0000 (21:28 +0000)]
Simplify the error handling a bit. NFC.

llvm-svn: 254952

8 years ago[EarlyCSE] Simplify and invert ParseMemoryInst [NFCI]
Philip Reames [Mon, 7 Dec 2015 21:27:15 +0000 (21:27 +0000)]
[EarlyCSE] Simplify and invert ParseMemoryInst [NFCI]

Restructure ParseMemoryInst - which was introduced to abstract over target specific load and stores instructions - to just query the underlying instructions. In theory, this could be slightly slower than caching the results, but in practice, it's very unlikely to be measurable.

The simple query scheme makes it far easier to understand, and much easier to extend with new queries. Given I'm about to need to add new query types, doing the cleanup first seemed worthwhile.

Do we still believe the target specific intrinsic handling is worthwhile in EarlyCSE? It adds quite a bit of complexity and makes the code harder to read. Being able to delete the abstraction entirely would be wonderful.

llvm-svn: 254950

8 years agoAdd NetBSD in platform specific logging of the specified category in RegisterCommands...
Kamil Rytarowski [Mon, 7 Dec 2015 21:26:56 +0000 (21:26 +0000)]
Add NetBSD in platform specific logging of the specified category in RegisterCommandsTestCase()

Summary: NetBSD soon will reuse this feature while running tests.

Reviewers: emaste, tfiala, clayborg

Subscribers: lldb-commits, joerg

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

llvm-svn: 254949

8 years agoAdd initial NetBSD support in lldbsuite/test/lldbtest.py
Kamil Rytarowski [Mon, 7 Dec 2015 21:25:57 +0000 (21:25 +0000)]
Add initial NetBSD support in lldbsuite/test/lldbtest.py

Summary:
Add new functions:

  - expectedFailureNetBSD()
  - expectedFlakeyNetBSD()
  - skipIfNetBSD()

Add new NetBSD entry in:

  - getPlatform()
  - getHostPlatform()

Assume that libc++ is installed and use the GNU toolchain

Reviewers: joerg, emaste, tfiala, clayborg

Subscribers: lldb-commits

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

llvm-svn: 254948

8 years agoReturn gmake as the default name for GNU make on NetBSD
Kamil Rytarowski [Mon, 7 Dec 2015 21:24:25 +0000 (21:24 +0000)]
Return gmake as the default name for GNU make on NetBSD

Summary:
The base make(1) on NetBSD is BSD make.

In the default installation of NetBSD GNU make comes via pkgsrc under the gmake name.

Reviewers: emaste, tfiala, clayborg

Subscribers: joerg, lldb-commits

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

llvm-svn: 254947

8 years agoRename test_results.py to result_formatter.py.
Zachary Turner [Mon, 7 Dec 2015 21:23:41 +0000 (21:23 +0000)]
Rename test_results.py to result_formatter.py.

There is already a class called LLDBTestResults which I would like
to move into a separate file, but the most appropriate filename
was taken.

llvm-svn: 254946

8 years agoUse updated threshold for indirect call bonus
Easwaran Raman [Mon, 7 Dec 2015 21:21:20 +0000 (21:21 +0000)]
Use updated threshold for indirect call bonus

When considering foo->bar inlining, if there is an indirect call in foo which gets resolved to a direct call (say baz), then we try to inline baz into bar with a threshold T and subtract max(T - Cost(bar->baz), 0) from Cost(foo->bar). This patch uses max(Threshold(bar->baz) - Cost(bar->baz)) instead, where Thresheld(bar->baz) could be different from T due to bonuses or subtractions. Threshold(bar->baz) - Cost(bar->baz) better represents the desirability of inlining baz into bar.

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

llvm-svn: 254945

8 years agogetwd(3) with NULL pointer extension is supported on NetBSD
Kamil Rytarowski [Mon, 7 Dec 2015 21:21:12 +0000 (21:21 +0000)]
getwd(3) with NULL pointer extension is supported on NetBSD

Summary:
The getwd() and getcwd() functions conform to IEEE Std 1003.1-1990
(POSIX.1).  The IEEE Std 1003.1-2004 (POSIX.1) revision marked
getwd() as legacy and recommended the use of getcwd() instead.  The IEEE
Std 1003.1-2008 (``POSIX.1'') revision removed getwd() from the
specification.

The ability to specify a NULL pointer and have getcwd() allocate memory
as necessary is an extension.

The getwd() function appeared in 4.0BSD.

Reviewers: emaste, tfiala, clayborg

Subscribers: lldb-commits, joerg

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

llvm-svn: 254944

8 years ago[PGO] Stop leaking libc function to buffer API impl
Xinliang David Li [Mon, 7 Dec 2015 21:18:16 +0000 (21:18 +0000)]
[PGO] Stop leaking libc function to buffer API impl

llvm-svn: 254943

8 years ago[PPC64] Convert bool literals to i32
Kit Barton [Mon, 7 Dec 2015 20:50:29 +0000 (20:50 +0000)]
[PPC64] Convert bool literals to i32

Convert i1 values to i32 values if they should be allocated in GPRs instead of CRs.

Phabricator: http://reviews.llvm.org/D14064
llvm-svn: 254942

8 years agoAllow variable names to be quoted with -var-list-children
Chuck Ries [Mon, 7 Dec 2015 20:43:52 +0000 (20:43 +0000)]
Allow variable names to be quoted with -var-list-children

Allow both '-var-list-children var0' and '-var-list-children "var0"' to be used with the -var-list-children command. GDB MI allows for this and it is necessary if the variable name contains spaces, such as var5.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<cahr> > > >.

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

llvm-svn: 254941

8 years agoRemove target specifier from new tests
Teresa Johnson [Mon, 7 Dec 2015 20:40:36 +0000 (20:40 +0000)]
Remove target specifier from new tests

Hopefully fix the remaining bot failure from r254927. Remove
target specification since it shouldn't be needed, and this causes
an error when trying to check the pass execution structure in
test/CodeGen/thinlto_backend.c on non-x86 arches.

llvm-svn: 254940

8 years agoFix line endings
Simon Pilgrim [Mon, 7 Dec 2015 20:36:00 +0000 (20:36 +0000)]
Fix line endings

llvm-svn: 254939

8 years agoAdjust test to fix bot error from r254927.
Teresa Johnson [Mon, 7 Dec 2015 20:26:57 +0000 (20:26 +0000)]
Adjust test to fix bot error from r254927.

Remove the part of the error message that may vary across systems.

llvm-svn: 254938

8 years ago[TSan] Slightly improve check_analyze script.
Alexey Samsonov [Mon, 7 Dec 2015 20:18:50 +0000 (20:18 +0000)]
[TSan] Slightly improve check_analyze script.

De-hardcode path to TSan-ified executable: pass it as an input to
the scripts. Fix them so that they don't write to the current
directory. Remove their invocation from Makefile.old: they are
broken there anyway, as check_analyze.sh now matches trunk Clang.

llvm-svn: 254936

8 years agoAST: defer to TypeLoc::copy in TypeLoc::initializeFullCopy
Justin Bogner [Mon, 7 Dec 2015 20:04:57 +0000 (20:04 +0000)]
AST: defer to TypeLoc::copy in TypeLoc::initializeFullCopy

If we're initializing a TypeLoc from one that's been allocated with
different alignment, memcpy will get the padding wrong. The `copy`
method already checks and handles this case, so we should just defer
to it.

This also drops the `const` off of the `initializeFullCopy`
declarations, since it isn't even remotely true (and the compiler
notices when we try to call copy() instead of tricking it with
memcpy).

Fixes llvm.org/pr23516.

llvm-svn: 254935

8 years agoFix function return type in declaration (bot errors from r254926).
Teresa Johnson [Mon, 7 Dec 2015 19:53:38 +0000 (19:53 +0000)]
Fix function return type in declaration (bot errors from r254926).

Try to fix bot build errors from r254926 by correcting the function
return type.

llvm-svn: 254934

8 years agoclang-format: Make wrapping after "./->" cheaper, even if the element
Daniel Jasper [Mon, 7 Dec 2015 19:50:48 +0000 (19:50 +0000)]
clang-format: Make wrapping after "./->" cheaper, even if the element
before it is not a closing parenthesis.

Otherwise, this frequently leads to "hanging" indents that users
perceive as "weird".

Before:
  return !soooooooooooooome_map.insert(
                                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
              .second;

After:
  return !soooooooooooooome_map
              .insert(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
              .second;

llvm-svn: 254933

8 years ago[TSan] Delete legacy test_output.sh script.
Alexey Samsonov [Mon, 7 Dec 2015 19:40:33 +0000 (19:40 +0000)]
[TSan] Delete legacy test_output.sh script.

This script is superseded by lit test suite integrated into CMake
for quite a while now. It doesn't support many tests, and require
custom hacks for a few other.

llvm-svn: 254932

8 years agoFix watchpoint check to use watchpoint ranges
Ted Woodward [Mon, 7 Dec 2015 19:38:58 +0000 (19:38 +0000)]
Fix watchpoint check to use watchpoint ranges

Summary: Watchpoints, unlike breakpoints, have an address range. This patch changes WatchpointList::FindByAddress() to match on any address in the watchpoint range, instead of only matching on the watchpoint's base address.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 254931

8 years agodon't repeat function names in comments; NFC
Sanjay Patel [Mon, 7 Dec 2015 19:31:34 +0000 (19:31 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 254930

8 years agofix 'the the '; NFC
Sanjay Patel [Mon, 7 Dec 2015 19:21:39 +0000 (19:21 +0000)]
fix 'the the '; NFC

llvm-svn: 254928

8 years ago[ThinLTO] Option to invoke ThinLTO backend passes and importing
Teresa Johnson [Mon, 7 Dec 2015 19:21:34 +0000 (19:21 +0000)]
[ThinLTO] Option to invoke ThinLTO backend passes and importing

Summary:
Adds new option -fthinlto-index=<file> to invoke the LTO pipeline
along with function importing via clang using the supplied function
summary index file. This supports invoking the parallel ThinLTO
backend processes in a distributed build environment via clang.

Additionally, this causes the module linker to be invoked on the bitcode
file being compiled to perform any necessary promotion and renaming of
locals that are exported via the function summary index file.

Add a couple tests that confirm we get expected errors when we try to
use the new option on a file that isn't bitcode, or specify an invalid
index file. The tests also confirm that we trigger the expected function
import pass.

Depends on D15024

Reviewers: joker.eph, dexonsmith

Subscribers: joker.eph, davidxl, cfe-commits

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

llvm-svn: 254927

8 years ago[ThinLTO] Support for specifying function index from pass manager
Teresa Johnson [Mon, 7 Dec 2015 19:21:11 +0000 (19:21 +0000)]
[ThinLTO] Support for specifying function index from pass manager

Summary:
Add a field on the PassManagerBuilder that clang or gold can use to pass
down a pointer to the function index in memory to use for importing when
the ThinLTO backend is triggered. Add support to supply this to the
function import pass.

Reviewers: joker.eph, dexonsmith

Subscribers: davidxl, llvm-commits, joker.eph

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

llvm-svn: 254926

8 years agoremove redundant check: optForSize() includes a check for the minsize attribute;...
Sanjay Patel [Mon, 7 Dec 2015 19:13:40 +0000 (19:13 +0000)]
remove redundant check: optForSize() includes a check for the minsize attribute; NFCI

llvm-svn: 254925

8 years agotest commit.
Chuck Ries [Mon, 7 Dec 2015 19:08:15 +0000 (19:08 +0000)]
test commit.

llvm-svn: 254924

8 years ago[Hexagon] Adding v60 test, vasr in particular.
Ron Lieberman [Mon, 7 Dec 2015 18:52:39 +0000 (18:52 +0000)]
[Hexagon] Adding v60 test, vasr in particular.

llvm-svn: 254923

8 years ago[llvm-dwp] Restructure inputs for test case so they're all grouped together
David Blaikie [Mon, 7 Dec 2015 18:46:41 +0000 (18:46 +0000)]
[llvm-dwp] Restructure inputs for test case so they're all grouped together

llvm-svn: 254922

8 years agoScopInfo: Add MemoryAccess::isScalar()
Tobias Grosser [Mon, 7 Dec 2015 18:06:08 +0000 (18:06 +0000)]
ScopInfo: Add MemoryAccess::isScalar()

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 254921

8 years agoTighten checks so we can see existing codegen
Sanjay Patel [Mon, 7 Dec 2015 17:39:48 +0000 (17:39 +0000)]
Tighten checks so we can see existing codegen

The 2-element vector case shows a surprising bug: we failed to
eliminate ops on undefs, so there are 4 fmax calls even though
there can only be 2 valid elements in the inputs.

llvm-svn: 254920

8 years ago[Orc] Removing traces of takeOwnershipOfBuffers left after r251560.
Lang Hames [Mon, 7 Dec 2015 17:35:56 +0000 (17:35 +0000)]
[Orc] Removing traces of takeOwnershipOfBuffers left after r251560.

Patch by Joshua Gerrard. Thanks Joshua!

llvm-svn: 254919