platform/upstream/llvm.git
9 years ago[Hexagon] Adding encoding bits for indirect long load instructions.
Colin LeMahieu [Wed, 4 Feb 2015 16:56:46 +0000 (16:56 +0000)]
[Hexagon] Adding encoding bits for indirect long load instructions.

llvm-svn: 228152

9 years ago[ARM] Fix subtarget feature set truncation when using .cpu directive
Bradley Smith [Wed, 4 Feb 2015 16:23:24 +0000 (16:23 +0000)]
[ARM] Fix subtarget feature set truncation when using .cpu directive

This is a bug that was caused due to storing the feature bitset in a 32-bit
variable when it is a 64-bit mask, discarding the top half of the feature set.

llvm-svn: 228151

9 years agoFix a typo.
Hafiz Abid Qadeer [Wed, 4 Feb 2015 16:04:16 +0000 (16:04 +0000)]
Fix a typo.

The member m_nTimes is used in rest of lldb-mi to represent hit count.
In one place, it was assigned a wrong value (number of locations). This
resulted in lldb-mi showing a hit count of variable 1 when it was created.

Committed as obvious.

llvm-svn: 228150

9 years ago[mips][microMIPS] Implement CodeGen support for SW16 and LW16 instructions
Zoran Jovanovic [Wed, 4 Feb 2015 15:43:17 +0000 (15:43 +0000)]
[mips][microMIPS] Implement CodeGen support for SW16 and LW16 instructions
Differential Revision: http://reviews.llvm.org/D6581

llvm-svn: 228149

9 years agoclang-format: Add support for SEH __try / __except / __finally blocks.
Nico Weber [Wed, 4 Feb 2015 15:26:27 +0000 (15:26 +0000)]
clang-format: Add support for SEH __try / __except / __finally blocks.

This lets clang-format format

    __try {
    } __except(0) {
    }

and

    __try {
    } __finally {
    }

correctly. __try and __finally are keywords if `LangOpts.MicrosoftExt` is set,
so this turns this on.  This also enables a few other keywords, but it
shouldn't overly perturb regular clang-format operation.  __except is a
context-sensitive keyword, so `AdditionalKeywords` needs to be passed around to
a few more places.

Fixes PR22321.

llvm-svn: 228148

9 years ago[mips] Make MipsSubtarget::hasMips*() functions consistent. NFC.
Daniel Sanders [Wed, 4 Feb 2015 15:18:11 +0000 (15:18 +0000)]
[mips] Make MipsSubtarget::hasMips*() functions consistent. NFC.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 228147

9 years agoTweak clang/test/CodeGenCXX/copy-constructor-elim.cpp to satisfy i686-linux.
NAKAMURA Takumi [Wed, 4 Feb 2015 14:51:30 +0000 (14:51 +0000)]
Tweak clang/test/CodeGenCXX/copy-constructor-elim.cpp to satisfy i686-linux.

llvm-svn: 228146

9 years ago[mips] Remove unused check prefix from tests. NFC.
Daniel Sanders [Wed, 4 Feb 2015 14:48:39 +0000 (14:48 +0000)]
[mips] Remove unused check prefix from tests. NFC.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 228145

9 years agoRewrite r228138 to be somewhat saner.
Daniel Jasper [Wed, 4 Feb 2015 14:29:47 +0000 (14:29 +0000)]
Rewrite r228138 to be somewhat saner.

While probably technically correct, the solution r228138 was quite hard
to read/understand. This should be simpler.

Also added a test to ensure that we are still visiting the syntactic form
as well.

llvm-svn: 228144

9 years agoPreserve early clobber flag when using named registers in inline assembly.
Daniel Sanders [Wed, 4 Feb 2015 14:25:47 +0000 (14:25 +0000)]
Preserve early clobber flag when using named registers in inline assembly.

Summary:
Named registers with the constraint "=&r" currently lose the early clobber flag
and turn into "=r" when converted to LLVM-IR. This patch correctly passes it on.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits

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

llvm-svn: 228143

9 years agoFixing a -Wsign-compare warning; NFC
Aaron Ballman [Wed, 4 Feb 2015 14:01:08 +0000 (14:01 +0000)]
Fixing a -Wsign-compare warning; NFC

llvm-svn: 228142

9 years agoTeaches the Clang driver to accept Cortex-A72
Renato Golin [Wed, 4 Feb 2015 13:31:56 +0000 (13:31 +0000)]
Teaches the Clang driver to accept Cortex-A72

A previous commit added Cortex-A72 to LLVM, this teaches Clang to
accept it as well.

Patch by Ranjeet Singh.

llvm-svn: 228141

9 years agoAdding support to LLVM for targeting Cortex-A72
Renato Golin [Wed, 4 Feb 2015 13:31:29 +0000 (13:31 +0000)]
Adding support to LLVM for targeting Cortex-A72

Currently, Cortex-A72 is modelled as an Cortex-A57 except the fp
load balancing pass isn't enabled for Cortex-A72 as it's not
profitable to have it enabled for this core.

Patch by Ranjeet Singh.

llvm-svn: 228140

9 years agoFix warning: "function declaration isn’t a prototype"
Rafael Espindola [Wed, 4 Feb 2015 13:30:28 +0000 (13:30 +0000)]
Fix warning: "function declaration isn’t a prototype"

llvm-svn: 228139

9 years agoLet RecursiveASTVisitor walk both syntactic and semantic form of InitListExprs.
Daniel Jasper [Wed, 4 Feb 2015 13:11:42 +0000 (13:11 +0000)]
Let RecursiveASTVisitor walk both syntactic and semantic form of InitListExprs.

Otherwise, this can lead to unexpected results when AST matching as
some nodes are only present in the semantic form.

For example, only looking at the syntactic form does not find the
DeclRefExpr to f() in:

  struct S { S(void (*a)()); };
  void f();
  S s[1] = {&f};

llvm-svn: 228138

9 years ago[ASan] Add the new __asan_mz_* symbols to asan_interface_internal.h
Alexander Potapenko [Wed, 4 Feb 2015 12:42:12 +0000 (12:42 +0000)]
[ASan] Add the new __asan_mz_* symbols to asan_interface_internal.h
to fix the interface_symbols_darwin.c test.

llvm-svn: 228137

9 years agoInstrProf: std::to_string needs to #include <string>
Justin Bogner [Wed, 4 Feb 2015 11:19:16 +0000 (11:19 +0000)]
InstrProf: std::to_string needs to #include <string>

llvm-svn: 228136

9 years ago[x86] Give movss and movsd execution domains in the x86 backend.
Chandler Carruth [Wed, 4 Feb 2015 10:58:53 +0000 (10:58 +0000)]
[x86] Give movss and movsd execution domains in the x86 backend.

This associates movss and movsd with the packed single and packed double
execution domains (resp.). While this is largely cosmetic, as we now
don't have weird ping-pong-ing between single and double precision, it
is also useful because it avoids the domain fixing algorithm from seeing
domain breaks that don't actually exist. It will also be much more
important if we have an execution domain default other than packed
single, as that would cause us to mix movss and movsd with integer
vector code on a regular basis, a very bad mixture.

llvm-svn: 228135

9 years agoHave llgs tests output their traces into session dir
Pavel Labath [Wed, 4 Feb 2015 10:48:29 +0000 (10:48 +0000)]
Have llgs tests output their traces into session dir

Summary: This reduces the bloat in the source tree and makes the tests more consistent.

Reviewers: vharron, zturner

Subscribers: lldb-commits

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

llvm-svn: 228134

9 years ago[x86] Remove a low-value test that was just checking how we cleared
Chandler Carruth [Wed, 4 Feb 2015 10:47:34 +0000 (10:47 +0000)]
[x86] Remove a low-value test that was just checking how we cleared
a register. We have lots of tests covering this.

llvm-svn: 228133

9 years ago[x86] Mechanically update a bunch of tests' check lines using the latest
Chandler Carruth [Wed, 4 Feb 2015 10:46:53 +0000 (10:46 +0000)]
[x86] Mechanically update a bunch of tests' check lines using the latest
version of the script.

Changes include:
- Using the VEX prefix
- Skipping more detail when we have useful shuffle comments to match
- Matching more shuffle comments that have been added to the printer
  (yay!)
- Matching the destination registers of some AVX instructions
- Stripping trailing whitespace that crept in
- Fixing indentation issues

Nothing interesting going on here. I'm just trying really hard to ensure
these changes don't show up in the diffs with actual changes to the
backend.

llvm-svn: 228132

9 years ago[x86] Teach the test update script to strip trailing whitespace.
Chandler Carruth [Wed, 4 Feb 2015 10:46:48 +0000 (10:46 +0000)]
[x86] Teach the test update script to strip trailing whitespace.

This is done in a bit of a strange way to use a multiline RE instead of
looping over the lines. Suggestions welcome here for a more pythonic way
of doing this as long as its reasonably fast.

llvm-svn: 228131

9 years agoAvoid leakage of file descriptors in LLDB and LLGS
Pavel Labath [Wed, 4 Feb 2015 10:36:57 +0000 (10:36 +0000)]
Avoid leakage of file descriptors in LLDB and LLGS

Summary:
Both LLDB and LLGS are leaking file descriptors into the debugged process. This plugs the leak by
closing the unneeded descriptors. In one case I use O_CLOEXEC, which I hope is supported on
relevant platforms. I also added a regression test and plugged a fd leak in dosep.py.

Reviewers: vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 228130

9 years agoReverting VLD1/VST1 base-updating/post-incrementing combining
Renato Golin [Wed, 4 Feb 2015 10:11:59 +0000 (10:11 +0000)]
Reverting VLD1/VST1 base-updating/post-incrementing combining

This reverts patches 223862, 224198, 224203, and 224754, which were all
related to the vector load/store combining and were reverted/reaplied
a few times due to the same alignment problems we're seeing now.

Further tests, mainly self-hosting Clang, will be needed to reapply this
patch in the future.

llvm-svn: 228129

9 years agoFix a race condition in lldb-mi.
Hafiz Abid Qadeer [Wed, 4 Feb 2015 09:59:23 +0000 (09:59 +0000)]
Fix a race condition in lldb-mi.

lldb-mi has 3 threads.
1. One that waits for user intput.
2. Another waits for 1st thread to get input command.
3. Waits for events from lldb.

2 & 3 needs to be synchronized so that they don't end up
doing things at same time. For example, while "break insert" is
processing, we can get a breakpoint event. Depending on where we
are in "break-insert", it can have different behavior. In some
cases, it can cause breakpoint to be deleted too. I have added a
mutex so that command processing and event processing are done
exclusively and they are not running at the same time.

In longer term, I think thread 2 & 3 should be merged to be only
one thread which can wait on command or events.

Reviewed in http://reviews.llvm.org/D7371.

llvm-svn: 228128

9 years ago[x86] Include the destination register in the check-lines for AVX
Chandler Carruth [Wed, 4 Feb 2015 09:18:27 +0000 (09:18 +0000)]
[x86] Include the destination register in the check-lines for AVX
instructions.

No actual change here.

llvm-svn: 228127

9 years ago[x86] Add some tests I missed in the prior commit to cover blends with
Chandler Carruth [Wed, 4 Feb 2015 09:15:46 +0000 (09:15 +0000)]
[x86] Add some tests I missed in the prior commit to cover blends with
zero for v8i16 as well.

These exhibit the same domain badness, but also exhibit other weaknesses
in our blend lowering. More fixes to come.

llvm-svn: 228126

9 years ago[Msan] Fix the pthread_attr_get unit test to build on FreeBSD
Viktor Kutuzov [Wed, 4 Feb 2015 09:08:00 +0000 (09:08 +0000)]
[Msan] Fix the pthread_attr_get unit test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D7342

llvm-svn: 228125

9 years ago[x86] Start to introduce bit-masking based blend lowering.
Chandler Carruth [Wed, 4 Feb 2015 09:06:05 +0000 (09:06 +0000)]
[x86] Start to introduce bit-masking based blend lowering.

This is the simplest form of bit-math based blending which only fires
when we are blending with zero and is relatively profitable. I've only
enabled this path on very specific lowering strategies. I'm planning to
widen its applicability in subsequent patches, but so far you'll notice
that even though we get fewer shufps instructions, we *still* do the bit
math in the FP execution port. I'm looking into why this is still
happening.

llvm-svn: 228124

9 years ago[x86] Add missing patterns for andps, orps, xorps, and andnps.
Chandler Carruth [Wed, 4 Feb 2015 09:06:01 +0000 (09:06 +0000)]
[x86] Add missing patterns for andps, orps, xorps, and andnps.

Specifically, the existing patterns were scalar-only. These cover the
packed vector bitwise operations when specifically requested with pseudo
instructions. This is particularly important in SSE1 where we can't
actually emit a logical operation on a v2i64 as that isn't a legal type.

This will be tested in subsequent patches which form the floating point
and patterns in more places.

llvm-svn: 228123

9 years ago[x86] Add tests for blends-with-zero on 4-element vectors.
Chandler Carruth [Wed, 4 Feb 2015 09:05:58 +0000 (09:05 +0000)]
[x86] Add tests for blends-with-zero on 4-element vectors.

llvm-svn: 228122

9 years agoParse: Handle __declspec in a lambda definition
David Majnemer [Wed, 4 Feb 2015 08:22:46 +0000 (08:22 +0000)]
Parse: Handle __declspec in a lambda definition

llvm-svn: 228121

9 years agoSema: Add support for __declspec(restrict)
David Majnemer [Wed, 4 Feb 2015 07:23:21 +0000 (07:23 +0000)]
Sema: Add support for __declspec(restrict)

__declspec(restrict) and __attribute(malloc) are both handled
identically by clang: they are allowed to the noalias LLVM attribute.

Seeing as how noalias models the C99 notion of 'restrict', rename the
internal clang attribute to Restrict from Malloc.

llvm-svn: 228120

9 years agoRegister parameters have local storage.
Anna Zaks [Wed, 4 Feb 2015 07:15:12 +0000 (07:15 +0000)]
Register parameters have local storage.

Fixes a regression introduced in r209149.

llvm-svn: 228119

9 years agoOpenCL: handle ternary operator when the condition is a vector
Sameer Sahasrabuddhe [Wed, 4 Feb 2015 06:38:18 +0000 (06:38 +0000)]
OpenCL: handle ternary operator when the condition is a vector

When the condition is a vector, OpenCL specifies additional
requirements on the operand types, and also the operations
required to determine the result type of the operator. This is a
combination of OpenCL v1.1 s6.3.i and s6.11.6, and the semantics
remain unchanged in later versions of OpenCL.

llvm-svn: 228118

9 years agoReplace tabs with spaces from r228116. Oops.
Bill Schmidt [Wed, 4 Feb 2015 06:14:38 +0000 (06:14 +0000)]
Replace tabs with spaces from r228116.  Oops.

llvm-svn: 228117

9 years ago[PowerPC] Handle 32-bit targets properly in PPCTLSDynamicCall.cpp
Bill Schmidt [Wed, 4 Feb 2015 05:51:56 +0000 (05:51 +0000)]
[PowerPC] Handle 32-bit targets properly in PPCTLSDynamicCall.cpp

llvm-svn: 228116

9 years agoTest commit.
Chaoren Lin [Wed, 4 Feb 2015 05:40:07 +0000 (05:40 +0000)]
Test commit.

Removed trailing whitespace.

From: Vince Harron <vharron@google.com>
llvm-svn: 228115

9 years agoFix a warning in non-asserts builds
Philip Reames [Wed, 4 Feb 2015 05:11:20 +0000 (05:11 +0000)]
Fix a warning in non-asserts builds

llvm-svn: 228114

9 years ago[MSVC2012] Allow 'mutable' references
Alexey Bataev [Wed, 4 Feb 2015 04:45:32 +0000 (04:45 +0000)]
[MSVC2012] Allow 'mutable' references
Some standard header files from MSVC2012 use 'mutable' on references, though it is directly prohibited by the standard.
Fix for http://llvm.org/PR22444
Differential Revision: http://reviews.llvm.org/D7370

llvm-svn: 228113

9 years agoMake this test stricter. NFC.
Rafael Espindola [Wed, 4 Feb 2015 04:23:48 +0000 (04:23 +0000)]
Make this test stricter. NFC.

llvm-svn: 228112

9 years agoFix ARM buildbot
David Majnemer [Wed, 4 Feb 2015 03:30:00 +0000 (03:30 +0000)]
Fix ARM buildbot

llvm-svn: 228111

9 years agoFix typo in test case.
Larisse Voufo [Wed, 4 Feb 2015 03:16:46 +0000 (03:16 +0000)]
Fix typo in test case.

llvm-svn: 228110

9 years agoFix some unnoticed/unwanted behavior change from r222319.
Frederic Riss [Wed, 4 Feb 2015 03:10:03 +0000 (03:10 +0000)]
Fix some unnoticed/unwanted behavior change from r222319.

The ARM assembler allows register alias redefinitions as long as it
targets the same register. r222319 broke that. In the AArch64 case
it would just produce a new warning, but in the ARM case it would
error out on previously accepted assembler.

llvm-svn: 228109

9 years agoFix typo in test case.
Larisse Voufo [Wed, 4 Feb 2015 02:46:33 +0000 (02:46 +0000)]
Fix typo in test case.

llvm-svn: 228108

9 years agoGeneralize r228066 to give all implicit global allocation functions default visibility.
Larisse Voufo [Wed, 4 Feb 2015 02:34:32 +0000 (02:34 +0000)]
Generalize r228066 to give all implicit global allocation functions default visibility.

llvm-svn: 228107

9 years agoEarly return. NFC.
Rui Ueyama [Wed, 4 Feb 2015 02:01:04 +0000 (02:01 +0000)]
Early return. NFC.

llvm-svn: 228106

9 years agoAdd missing file from r228104.
Richard Smith [Wed, 4 Feb 2015 01:51:12 +0000 (01:51 +0000)]
Add missing file from r228104.

llvm-svn: 228105

9 years ago[modules] If we already have a fake definition for one declaration of a class,
Richard Smith [Wed, 4 Feb 2015 01:23:46 +0000 (01:23 +0000)]
[modules] If we already have a fake definition for one declaration of a class,
don't think we're providing a new one in an update record adding a definition
to another declaration of the same class.

llvm-svn: 228104

9 years ago[fuzzer]: fix exit code, add more diagnostics
Kostya Serebryany [Wed, 4 Feb 2015 01:22:57 +0000 (01:22 +0000)]
[fuzzer]: fix exit code, add more diagnostics

llvm-svn: 228103

9 years ago[sanitizer] add another workaround for PR 17409: when over a threshold emit coverage...
Kostya Serebryany [Wed, 4 Feb 2015 01:21:45 +0000 (01:21 +0000)]
[sanitizer] add another workaround for PR 17409: when over a threshold emit coverage instrumentation as calls.

llvm-svn: 228102

9 years agoAdd code to llvm-objdump so the -section option with -macho will disassemble sections
Kevin Enderby [Wed, 4 Feb 2015 01:01:38 +0000 (01:01 +0000)]
Add code to llvm-objdump so the -section option with -macho will disassemble sections
that have attributes indicating they contain instructions.

llvm-svn: 228101

9 years agoclang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Unbreak build to add explicit...
NAKAMURA Takumi [Wed, 4 Feb 2015 01:00:12 +0000 (01:00 +0000)]
clang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Unbreak build to add explicit triple x86_64-unknown.

It seems incompatible to i686.

llvm-svn: 228100

9 years agoclang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Fix for -Asserts.
NAKAMURA Takumi [Wed, 4 Feb 2015 01:00:04 +0000 (01:00 +0000)]
clang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Fix for -Asserts.

llvm-svn: 228099

9 years agoAdd LF to EOF.
NAKAMURA Takumi [Wed, 4 Feb 2015 00:59:59 +0000 (00:59 +0000)]
Add LF to EOF.

llvm-svn: 228098

9 years ago[x86] Refresh the checks of a number of tests using
Chandler Carruth [Wed, 4 Feb 2015 00:58:42 +0000 (00:58 +0000)]
[x86] Refresh the checks of a number of tests using
update_llc_test_checks.py.

The exact format of the checks has changed over time. This includes
different indenting rules, new shuffle comments that have been added,
and more operand hiding behind regular expressions.

No functional change to the tests are expected here, but this will make
subsequent patches have a clean diff as they change shuffle lowering.

llvm-svn: 228097

9 years ago[x86] Switch to using the long '--check-prefix' form which the
Chandler Carruth [Wed, 4 Feb 2015 00:58:40 +0000 (00:58 +0000)]
[x86] Switch to using the long '--check-prefix' form which the
update_llc_test_checks.py script uses, and refresh the checks in this
test.

No functionality changed here, just bringing this test up to work with
automated updates using the python script.

llvm-svn: 228096

9 years ago[x86] Port this test to use utils/update_llc_test_checks.py.
Chandler Carruth [Wed, 4 Feb 2015 00:58:37 +0000 (00:58 +0000)]
[x86] Port this test to use utils/update_llc_test_checks.py.

This will make it easy to update as I change some parts of the X86
backend, makes it more clear what instruction differences are
introduced, and I find it makes it a bit easier to read as well.

llvm-svn: 228095

9 years agoStyle cleanup in compareByPosition().
Davide Italiano [Wed, 4 Feb 2015 00:44:52 +0000 (00:44 +0000)]
Style cleanup in compareByPosition().

Differential Revision: D7394
Reported by: ruiu
Reviewed by: ruiu

llvm-svn: 228094

9 years agoMisc documentation/comment fixes.
Peter Collingbourne [Wed, 4 Feb 2015 00:42:45 +0000 (00:42 +0000)]
Misc documentation/comment fixes.

llvm-svn: 228093

9 years agoFix it so we always get major, minor and update from the version in ObjectFileMachO...
Greg Clayton [Wed, 4 Feb 2015 00:40:25 +0000 (00:40 +0000)]
Fix it so we always get major, minor and update from the version in ObjectFileMachO::GetMinimumOSVersion(...) and ObjectFileMachO::GetSDKVersion(...).

<rdar://problem/19697053>

llvm-svn: 228092

9 years agoClang format of a file introduced in 228090 (NFC)
Philip Reames [Wed, 4 Feb 2015 00:39:57 +0000 (00:39 +0000)]
Clang format of a file introduced in 228090 (NFC)

llvm-svn: 228091

9 years agoAdd a pass for inserting safepoints into (nearly) arbitrary IR
Philip Reames [Wed, 4 Feb 2015 00:37:33 +0000 (00:37 +0000)]
Add a pass for inserting safepoints into (nearly) arbitrary IR

This pass is responsible for figuring out where to place call safepoints and safepoint polls. It doesn't actually make the relocations explicit; that's the job of the RewriteStatepointsForGC pass (http://reviews.llvm.org/D6975).

Note that this code is not yet finalized.  Its moving in tree for incremental development, but further cleanup is needed and will happen over the next few days.  It is not yet part of the standard pass order.

Planned changes in the near future:
 - I plan on restructuring the statepoint rewrite to use the functions add to the IRBuilder a while back.
 - In the current pass, the function "gc.safepoint_poll" is treated specially but is not an intrinsic. I plan to make identifying the poll function a property of the GCStrategy at some point in the near future.
 - As follow on patches, I will be separating a collection of test cases we have out of tree and submitting them upstream.
 - It's not explicit in the code, but these two patches are introducing a new state for a statepoint which looks a lot like a patchpoint. There's no a transient form which doesn't yet have the relocations explicitly represented, but does prevent reordering of memory operations. Once this is in, I need to update actually make this explicit by reserving the 'unused' argument of the statepoint as a flag, updating the docs, and making the code explicitly check for such a thing. This wasn't really planned, but once I split the two passes - which was done for other reasons - the intermediate state fell out. Just reminds us once again that we need to merge statepoints and patchpoints at some point in the not that distant future.

Future directions planned:
 - Identifying more cases where a backedge safepoint isn't required to ensure timely execution of a safepoint poll.
 - Tweaking the insertion process to generate easier to optimize IR. (For example, investigating making SplitBackedge) the default.
 - Adding opt-in flags for a GCStrategy to use this pass. Once done, add this pass to the actual pass ordering.

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

llvm-svn: 228090

9 years ago[inlineasm] Fix an incorrect warning about register constraint and modifier.
Akira Hatanaka [Wed, 4 Feb 2015 00:27:13 +0000 (00:27 +0000)]
[inlineasm] Fix an incorrect warning about register constraint and modifier.

Previously, when the following piece of code was compiled, clang would
incorrectly warn that the size of "wide_two" does not match register size
specified by the constraint and modifier":

long wide_two = two;
asm ("%w0 %1" : "+r" (one), "+r"(wide_two));

This was caused by a miscalculation of ConstraintIdx in Sema::ActOnGCCAsmStmt.

This commit fixes PR21270 and rdar://problem/18668354.

llvm-svn: 228089

9 years agoUnbreak the MIPS buildbot
David Majnemer [Wed, 4 Feb 2015 00:26:13 +0000 (00:26 +0000)]
Unbreak the MIPS buildbot

llvm-svn: 228088

9 years agoHeaders: Don't use attribute keywords which aren't reserved
David Majnemer [Wed, 4 Feb 2015 00:26:10 +0000 (00:26 +0000)]
Headers: Don't use attribute keywords which aren't reserved

Instead of using 'unavailable', use '__unavailable__'

llvm-svn: 228087

9 years agoimproved CHECK
Sanjay Patel [Wed, 4 Feb 2015 00:24:06 +0000 (00:24 +0000)]
improved CHECK

llvm-svn: 228086

9 years agoAdded missing header for the explicit dependency on MDNode.
Galina Kistanova [Wed, 4 Feb 2015 00:20:52 +0000 (00:20 +0000)]
Added missing header for the explicit dependency on MDNode.

llvm-svn: 228085

9 years agoInstrProf: Add some unit tests for CoverageMapping
Justin Bogner [Wed, 4 Feb 2015 00:15:12 +0000 (00:15 +0000)]
InstrProf: Add some unit tests for CoverageMapping

The llvm-level tests for coverage mapping need a binary input file,
which means they're hard to understand, hard to update, and it's
difficult to add new ones. By adding some unit tests that build up the
coverage data structures in C++, we can write more meaningful and
targeted tests.

llvm-svn: 228084

9 years agoInstrProf: Use a stable sort when reading coverage regions
Justin Bogner [Wed, 4 Feb 2015 00:12:18 +0000 (00:12 +0000)]
InstrProf: Use a stable sort when reading coverage regions

Keeping regions that start at the same location in insertion order
makes this logic easier to test / more deterministic.

llvm-svn: 228083

9 years ago[Hexagon] Revert change to isCodeGenOnly = 1 in r228080
Colin LeMahieu [Wed, 4 Feb 2015 00:09:23 +0000 (00:09 +0000)]
[Hexagon] Revert change to isCodeGenOnly = 1 in r228080

llvm-svn: 228082

9 years ago[Hexagon] Changing some isCodeGenOnly to isAsmParserOnly since we want them to asm...
Colin LeMahieu [Wed, 4 Feb 2015 00:07:26 +0000 (00:07 +0000)]
[Hexagon] Changing some isCodeGenOnly to isAsmParserOnly since we want them to asm parse but not cause decode conflicts.

llvm-svn: 228080

9 years agoRemove a gross usage of environment variables in MachineVerifier, replacing it with...
Owen Anderson [Wed, 4 Feb 2015 00:02:59 +0000 (00:02 +0000)]
Remove a gross usage of environment variables in MachineVerifier, replacing it with support for setting the -verify-machineinstrs flag via an environment variable in LIT.

This preserves the handy functionality of force-enabling the MachineVerifier, without the need to embed usage of environment variables in LLVM client applications.

llvm-svn: 228079

9 years agoSimplify large switches.
Rui Ueyama [Wed, 4 Feb 2015 00:00:21 +0000 (00:00 +0000)]
Simplify large switches.

This may be a little bit inefficient than the original code
but that should be okay as this is not really in a performance
critical pass.

http://reviews.llvm.org/D7393

llvm-svn: 228077

9 years agoInstrProf: Update for LLVM API change
Justin Bogner [Tue, 3 Feb 2015 23:59:48 +0000 (23:59 +0000)]
InstrProf: Update for LLVM API change

Update for the API change in r228075

llvm-svn: 228076

9 years agoInstrProf: Make CounterMappingRegions less confusing to construct
Justin Bogner [Tue, 3 Feb 2015 23:59:33 +0000 (23:59 +0000)]
InstrProf: Make CounterMappingRegions less confusing to construct

Creating empty and expansion regions is awkward with the current API.
Expose static methods to make this simpler.

llvm-svn: 228075

9 years agoMake test require 'linux' instead of 'linux2'
Eric Fiselier [Tue, 3 Feb 2015 23:50:47 +0000 (23:50 +0000)]
Make test require 'linux' instead of 'linux2'

llvm-svn: 228073

9 years agoadd platform to LIT's available features
Eric Fiselier [Tue, 3 Feb 2015 23:49:58 +0000 (23:49 +0000)]
add platform to LIT's available features

llvm-svn: 228071

9 years agoAvoid two function calls of file() when not needed.
Davide Italiano [Tue, 3 Feb 2015 23:44:33 +0000 (23:44 +0000)]
Avoid two function calls of file() when not needed.

Reported by: ruiu

llvm-svn: 228069

9 years ago[PBQP] Provide more information in the debug prints
Arnaud A. de Grandmaison [Tue, 3 Feb 2015 23:40:24 +0000 (23:40 +0000)]
[PBQP] Provide more information in the debug prints

Based on a patch by Jonas Paulsson

llvm-svn: 228068

9 years agoSmall fix for the "memory write -i filename" command -- if the user fails to specify the
Jason Molenda [Tue, 3 Feb 2015 23:39:47 +0000 (23:39 +0000)]
Small fix for the "memory write -i filename" command -- if the user fails to specify the
number of bytes to write into the inferior process, the "default byte size" will be 1.
In that case, we want to copy the entire file into memory.  The code was looking for
a default byte size of 0 to indicate that the user had not provided a specific # of
bytes to copy; adjust that to 1 to match the actual default value.
<rdar://problem/18074973>

llvm-svn: 228067

9 years agoPR22419: Give implicit sized deallocation functions default visibility
Larisse Voufo [Tue, 3 Feb 2015 23:31:50 +0000 (23:31 +0000)]
PR22419: Give implicit sized deallocation functions default visibility

llvm-svn: 228066

9 years agoUnbreak hexagon bot
David Majnemer [Tue, 3 Feb 2015 23:21:21 +0000 (23:21 +0000)]
Unbreak hexagon bot

llvm-svn: 228065

9 years agoUse ImmutableCallSite for statepoint verification.
Philip Reames [Tue, 3 Feb 2015 23:18:47 +0000 (23:18 +0000)]
Use ImmutableCallSite for statepoint verification.

Patch by: Igor Laevsky

"This change generalizes statepoint verification to use ImmutableCallSite instead of CallInst. This will allow to easily implement invoke statepoint verification (in a following change)."

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

llvm-svn: 228064

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Tue, 3 Feb 2015 23:10:18 +0000 (23:10 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 228063

9 years agoCodeGen: Copy-ctorm must obey the destination's alignment requirement
David Majnemer [Tue, 3 Feb 2015 23:04:06 +0000 (23:04 +0000)]
CodeGen: Copy-ctorm must obey the destination's alignment requirement

We would synthesize memcpy intrinsics when emitting calls to trivial C++
constructors but we wouldn't take into account the alignment of the
destination.

llvm-svn: 228061

9 years agoELF: Support INPUT linker script directive
Rui Ueyama [Tue, 3 Feb 2015 23:00:19 +0000 (23:00 +0000)]
ELF: Support INPUT linker script directive

INPUT directive is a variant of GROUP in the sense that that specifies
a list of input files. The only difference is whether the entire file
list is wrapped with a --start-group/--end-group or not.

http://reviews.llvm.org/D7390

llvm-svn: 228060

9 years agoSEH: Track users of __try so we can pick a per-func EH personality
Reid Kleckner [Tue, 3 Feb 2015 22:52:35 +0000 (22:52 +0000)]
SEH: Track users of __try so we can pick a per-func EH personality

There are four major kinds of declarations that cause code generation:
- FunctionDecl (includes CXXMethodDecl etc)
- ObjCMethodDecl
- BlockDecl
- CapturedDecl

This patch tracks __try usage on FunctionDecls and diagnoses __try usage
in other decls. If someone wants to use __try from ObjC, they can use it
from a free function, since the ObjC code will need an ObjC-style EH
personality.

Eventually we will want to look through CapturedDecls and track SEH
usage on the parent FunctionDecl, if present.

llvm-svn: 228058

9 years agoUse basename of main executable in POSIX-DYLD on Android.
Stephane Sezer [Tue, 3 Feb 2015 22:48:34 +0000 (22:48 +0000)]
Use basename of main executable in POSIX-DYLD on Android.

Summary:
The Android dynamic linker reports only the basename of each SO entry, so for
the above check to be successful, we need to compare it to the basename of the
main executable.

This also has a nasty side-effect when working with older version of
Android (verified on platform version 16), and debugging PIE
executables: the dynamic linker has a bug and reports the load address
of the main executable (which is a shared object, because PIE) to be 0.
We then try to update the list of loaded sections for all shared
objects, including the main executable, and set the load address to 0,
which breaks everything that relies on resolving addresses in the main
executable (breakpoints, stepping, etc). This commit also fixes that broken
behavior when debugging on older Androids. This bug doesn't happen on newer
Android versions (verified for Android L).

Test Plan: Run test suite on linux.

Reviewers: clayborg, tfiala, richard.mitton

Subscribers: lldb-commits

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

llvm-svn: 228057

9 years ago[LV] Split off memcheck block really at the first check
Adam Nemet [Tue, 3 Feb 2015 22:45:39 +0000 (22:45 +0000)]
[LV] Split off memcheck block really at the first check

I've noticed this while trying to move addRuntimeCheck to LoopAccessAnalysis.

I think that the intention was to early exit from the overflow checking before
the code for the memchecks.  This is the entire reason why we compute
FirstCheckInst but then we don't use that as the splitting instruction but the
final check.  Looks like an oversight.

llvm-svn: 228056

9 years ago[x86] Fix signed vs. unsigned comparison.
Chandler Carruth [Tue, 3 Feb 2015 22:43:30 +0000 (22:43 +0000)]
[x86] Fix signed vs. unsigned comparison.

llvm-svn: 228055

9 years agoFixed unused variable warning.
Simon Pilgrim [Tue, 3 Feb 2015 22:39:28 +0000 (22:39 +0000)]
Fixed unused variable warning.

llvm-svn: 228054

9 years agoDebugInfo: Ensure calls to functions with default arguments which themselves have...
David Blaikie [Tue, 3 Feb 2015 22:37:17 +0000 (22:37 +0000)]
DebugInfo: Ensure calls to functions with default arguments which themselves have default arguments, still have locations.

To handle default arguments in C++ in the debug info, we disable code
updating the debug location during the emission of default arguments.

This code was buggy in the case of default arguments which, themselves,
have default arguments - the inner default argument would re-enable
debug info when it was finished, but before the outer default argument
was finished.

This was already a bug, but got worse (because a crasher instead of just
a quality bug) with the recent improvements to debug info line quality
because... The ApplyDebugLocation scoped device would find the debug
info disabled and not save any debug location. But then in
~ApplyDebugLocation it would find the debug info had been enabled and
would then apply the no-location. Then the outer function call would be
emitted without any location. That's bad.

Arguably we could /also/ fix the ApplyDebugLocation to assert on this
situation (where debug info was disabled in the ctor and enabled in the
dtor, or the other way around) but this is at least the necessary fix
regardless.

(also, I imagine this disabling behavior might need to be in-place for
CGExprComplex and CGExprAgg too, maybe... ?)

And I seem to recall seeing some weird default arg stepping behavior
recently which might be related to this too... I'll have to look into
it.

llvm-svn: 228053

9 years agoDiagnose CXX 'this' pointer reference in funcs with naked attr
Weiming Zhao [Tue, 3 Feb 2015 22:35:58 +0000 (22:35 +0000)]
Diagnose CXX 'this' pointer reference in funcs with naked attr

Clang asserts for this pointer reference in asms of naked functions.
This patch diagnoses if this pointer reference is used.

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

llvm-svn: 228052

9 years agoThread Safety Analysis: add support for before/after annotations on mutexes.
DeLesley Hutchins [Tue, 3 Feb 2015 22:11:04 +0000 (22:11 +0000)]
Thread Safety Analysis: add support for before/after annotations on mutexes.
These checks detect potential deadlocks caused by inconsistent lock
ordering.  The checks are implemented under the -Wthread-safety-beta flag.

This patch also replaces calls to getAttrs() with calls to attrs() throughout
ThreadSafety.cpp, which fixes the earlier issue that cause assert failures.

llvm-svn: 228051

9 years ago[Hexagon] Marking a bunch of non-encoded instructions with isCodeGenOnly = 1.
Colin LeMahieu [Tue, 3 Feb 2015 22:09:51 +0000 (22:09 +0000)]
[Hexagon] Marking a bunch of non-encoded instructions with isCodeGenOnly = 1.

llvm-svn: 228050

9 years ago[CMake] add_llvm_library: don't use .imp suffix for import libraries on Windows ...
Hans Wennborg [Tue, 3 Feb 2015 22:08:20 +0000 (22:08 +0000)]
[CMake] add_llvm_library: don't use .imp suffix for import libraries on Windows (PR22334)

This was added in r188351 to fix a naming conflict between the
profile_rt-static and profile_rt-shared who both ended up in
lib/profile_rt.lib.

The change also affected other libraries (like libclang), and
users are reporting that they find it surprising that there's
no longer a libclang.lib. Since the profile_rt naming conflict
doesn't seem to exist any more, I think we can remove this.

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

llvm-svn: 228049

9 years ago[PBQP] Constify Graph::getEdgeNode1Id and Graph::getEdgeNode2Id
Arnaud A. de Grandmaison [Tue, 3 Feb 2015 22:02:45 +0000 (22:02 +0000)]
[PBQP] Constify Graph::getEdgeNode1Id and Graph::getEdgeNode2Id

llvm-svn: 228048

9 years ago[X86][SSE] psrl(w/d/q) and psll(w/d/q) bit shifts for SSE2
Simon Pilgrim [Tue, 3 Feb 2015 21:58:29 +0000 (21:58 +0000)]
[X86][SSE] psrl(w/d/q) and psll(w/d/q) bit shifts for SSE2

Patch to match cases where shuffle masks can be reduced to bit shifts. Similar to byte shift shuffle matching from D5699.

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

llvm-svn: 228047

9 years ago[PowerPC] Implement the vpopcnt instructions for POWER8
Bill Schmidt [Tue, 3 Feb 2015 21:58:23 +0000 (21:58 +0000)]
[PowerPC] Implement the vpopcnt instructions for POWER8

Patch by Kit Barton.

Add the vector population count instructions for byte, halfword, word,
and doubleword sizes.  There are two major changes here:

    PPCISelLowering.cpp: Make CTPOP legal for vector types.
    PPCRegisterInfo.td: Added v2i64 to the VRRC register
      definition. This is needed for the doubleword variations of the
      integer ops that were added in P8.

Test Plan

Test the instruction vpcnt* encoding/decoding in ppc64-encoding-vmx.s

Test the generation of the vpopcnt instructions for various vector
data types.  When adding the v2i64 type to the Vector Register set, I
also needed to add the appropriate bit conversion patterns between
v2i64 and the existing vector types.  Testing for these conversions
were also added in the test case by passing a different vector type as
a parameter into the test functions.  There is also a run step that
will ensure the vpopcnt instructions are generated when the vsx
feature is disabled.

llvm-svn: 228046