platform/upstream/llvm.git
9 years agoDon't actually generate code for testing the frontend's target cpu flag,
Chandler Carruth [Tue, 9 Dec 2014 15:52:55 +0000 (15:52 +0000)]
Don't actually generate code for testing the frontend's target cpu flag,
just verify. This should fix the bots where the x86 backend isn't built
into Clang. Sorry for the breakage.

llvm-svn: 223779

9 years agoMove the optional tests into test/experimental. They were put into test/utilities...
Marshall Clow [Tue, 9 Dec 2014 15:07:42 +0000 (15:07 +0000)]
Move the optional tests into test/experimental. They were put into test/utilities because optional was going to be part of C++14, and then was pulled and put into the Library Fundamentals TS instead. No funcitonality change here; just moving files around.

llvm-svn: 223778

9 years ago[clang-tidy] Fix a typo.
Alexander Kornienko [Tue, 9 Dec 2014 15:02:17 +0000 (15:02 +0000)]
[clang-tidy] Fix a typo.

llvm-svn: 223777

9 years agoRe-work the Clang system for classifying Intel x86 CPUs to use their
Chandler Carruth [Tue, 9 Dec 2014 14:50:25 +0000 (14:50 +0000)]
Re-work the Clang system for classifying Intel x86 CPUs to use their
basic microarchitecture names, and add support (with tests) for parsing
all of the masic microarchitecture names for CPUs documented to be
accepted by GCC with -march. I didn't go back through the 32-bit-only
old microarchitectures, but this at least brings the recent architecture
names up to speed. This is essentially the follow-up to the LLVM commit
r223769 which did similar cleanups for the LLVM CPUs.

One particular benefit is that you can now use -march=westmere in Clang
and get the LLVM westmere processor which is a different ISA variant (!)
and so quite significant.

Much like with r223769, I would appreciate the Intel folks carefully
thinking about the macros defined, names used, etc for the atom chips
and newest primary x86 chips. The current patterns seem quite strange to
me, especially here in Clang.

Note that I haven't replicated the per-microarchitecture macro defines
provided by GCC. I'm really opposed to source code using these rather
than using ISA feature macros.

llvm-svn: 223776

9 years agoAdd all the relational operators to std::experimental::optional. Also update bad_opti...
Marshall Clow [Tue, 9 Dec 2014 14:49:17 +0000 (14:49 +0000)]
Add all the relational operators to std::experimental::optional. Also update bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though.

llvm-svn: 223775

9 years ago[x86] Fix the test to actually test things for the CPU names, add the
Chandler Carruth [Tue, 9 Dec 2014 14:25:55 +0000 (14:25 +0000)]
[x86] Fix the test to actually test things for the CPU names, add the
missing barcelona CPU which that test uncovered, and remove the 32-bit
x86 CPUs which I really wasn't prepared to audit and test thoroughly.

If anyone wants to clean up the 32-bit only x86 CPUs, go for it.

Also, if anyone else wants to try to de-duplicate the AMD CPUs, that'd
be cool, but from the looks of it wouldn't save as much as it did for
the Intel CPUs.

llvm-svn: 223774

9 years agoRemoving an unused variable to silence a -Wunused-but-set-variable warning. NFC.
Aaron Ballman [Tue, 9 Dec 2014 13:20:11 +0000 (13:20 +0000)]
Removing an unused variable to silence a -Wunused-but-set-variable warning. NFC.

llvm-svn: 223773

9 years agoFix modified immediate bug reported by MC Hammer.
Asiri Rathnayake [Tue, 9 Dec 2014 13:14:58 +0000 (13:14 +0000)]
Fix modified immediate bug reported by MC Hammer.

Instructions of the form [ADD Rd, pc, #imm] are manually aliased
in processInstruction() to use ADR. To accomodate this, mod_imm handling
had to be tweaked a bit. Turns out it was the manual aliasing that must
be tweaked to accommodate mod_imms instead. More information about the
parsed instruction is available at the point where processInstruction()
is invoked, which makes it easier to detect a mod_imm at that point rather
than trying to detect a potential alias when a mod_imm is being prepped.
Added a test case and fixed some white spaces as well.

llvm-svn: 223772

9 years ago[clang-tidy] Extended the example check, added a fix-it, etc.
Alexander Kornienko [Tue, 9 Dec 2014 12:43:09 +0000 (12:43 +0000)]
[clang-tidy] Extended the example check, added a fix-it, etc.

llvm-svn: 223771

9 years ago[x86] Add a test for the CPU names that should have been in r223769.
Chandler Carruth [Tue, 9 Dec 2014 11:19:57 +0000 (11:19 +0000)]
[x86] Add a test for the CPU names that should have been in r223769.

llvm-svn: 223770

9 years ago[x86] Bring some sanity to the x86 CPU processor definitions.
Chandler Carruth [Tue, 9 Dec 2014 10:58:36 +0000 (10:58 +0000)]
[x86] Bring some sanity to the x86 CPU processor definitions.

Notably, this adds simple micro-architecture names for the Intel CPU
variants, and defines the old 'core'-based names as aliases. GCC has
started to simplify their documented interface to use these names as
well, so it seems like we can start to converge on a consistent pattern.

I'd appreciate Intel double checking the entries that aren't yet
documented widely, especially Atom (Bonnell and Silvermont), Knights
Landing, and Skylake. But this change shouldn't break any existing
users.

Also, ran clang-format to re-format this code and it actually worked
(modulo a tiny bug) so hopefully we can start to stop thinking about
formatting this stuff.

llvm-svn: 223769

9 years agoRemoval Of Duplicate Test Cases and Addition Of Missing Check Statements
Sonam Kumari [Tue, 9 Dec 2014 10:46:38 +0000 (10:46 +0000)]
Removal Of Duplicate Test Cases and Addition Of Missing Check Statements

llvm-svn: 223768

9 years ago[test/Transforms/InstCombine/shift.ll] Removed duplicate test cases. NFC.
Ankur Garg [Tue, 9 Dec 2014 10:35:19 +0000 (10:35 +0000)]
[test/Transforms/InstCombine/shift.ll] Removed duplicate test cases. NFC.

Removed some duplicate test cases from the file /test/Transforms/InstCombine/shift.ll.

test54 and test57 were duplicates of each other.
test55 and test58 were duplicates of each other.

(Removed test57 and test58)

llvm-svn: 223767

9 years agoclang-tidy: Add a basic python script to generate checks.
Daniel Jasper [Tue, 9 Dec 2014 10:02:51 +0000 (10:02 +0000)]
clang-tidy: Add a basic python script to generate checks.

There are still a vast range of improvements that can be done to this,
but it seems like an ok initial version. Suggestions or patches are
highly welcome.

llvm-svn: 223766

9 years agoImprove emacs coding style
Will Newton [Tue, 9 Dec 2014 08:58:31 +0000 (08:58 +0000)]
Improve emacs coding style

Remove setting of default style, this way is not recommended and
means that all the settings have to be duplicated to demonstrate the
c-add-style method which is a much better way of doing it.

Remove the modified date as it is better stored in SVN.

Tweak a few style parameters to make them conform to the actual LLVM
style.

llvm-svn: 223765

9 years agoTeach instcombine to canonicalize "element extraction" from a load of an
Chandler Carruth [Tue, 9 Dec 2014 08:55:32 +0000 (08:55 +0000)]
Teach instcombine to canonicalize "element extraction" from a load of an
integer and "element insertion" into a store of an integer into actual
element extraction, element insertion, and vector loads and stores.

Previously various parts of LLVM (including instcombine itself) would
introduce integer loads and stores into the code as a way of opaquely
loading and storing "bits". In some cases (such as a memcpy of
std::complex<float> object) we will eventually end up using those bits
in non-integer types. In order for SROA to effectively promote the
allocas involved, it splits these "store a bag of bits" integer loads
and stores up into the constituent parts. However, for non-alloca loads
and tsores which remain, it uses integer math to recombine the values
into a large integer to load or store.

All of this would be "fine", except that it forces LLVM to go through
integer math to combine and split up values. While this makes perfect
sense for integers (and in fact is critical for bitfields to end up
lowering efficiently) it is *terrible* for non-integer types, especially
floating point types. We have a much more canonical way of representing
the act of concatenating the bits of two SSA values in LLVM: a vector
and insertelement. This patch teaching InstCombine to use this
representation.

With this patch applied, LLVM will no longer introduce integer math into
the critical path of every loop over std::complex<float> operations such
as those that make up the hot path of ... oh, most HPC code, Eigen, and
any other heavy linear algebra library.

For the record, I looked *extensively* at fixing this in other parts of
the compiler, but it just doesn't work:
- We really do want to canonicalize memcpy and other bit-motion to
  integer loads and stores. SSA values are tremendously more powerful
  than "copy" intrinsics. Not doing this regresses massive amounts of
  LLVM's scalar optimizer.
- We really do need to split up integer loads and stores of this form in
  SROA or every memcpy of a trivially copyable struct will prevent SSA
  formation of the members of that struct. It essentially turns off
  SROA.
- The closest alternative is to actually split the loads and stores when
  partitioning with SROA, but this has all of the downsides historically
  discussed of splitting up loads and stores -- the wide-store
  information is fundamentally lost. We would also see performance
  regressions for bitfield-heavy code and other places where the
  integers aren't really intended to be split without seemingly
  arbitrary logic to treat integers totally differently.
- We *can* effectively fix this in instcombine, so it isn't that hard of
  a choice to make IMO.

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

llvm-svn: 223764

9 years agoSkip declarations in the case of functions.
Michael Ilseman [Tue, 9 Dec 2014 08:20:06 +0000 (08:20 +0000)]
Skip declarations in the case of functions.

This is a revert of r223521 in spirit, if not in content. I am not
sure why declarations ended up in LazilyLinkGlobalValues in the first
place; that will take some more investigation.

llvm-svn: 223763

9 years agoUse range-based for loops. NFC.
Craig Topper [Tue, 9 Dec 2014 08:05:51 +0000 (08:05 +0000)]
Use range-based for loops. NFC.

llvm-svn: 223762

9 years agoAVX-512: Added some comments to ERI scalar intrinsics.
Elena Demikhovsky [Tue, 9 Dec 2014 07:06:32 +0000 (07:06 +0000)]
AVX-512: Added some comments to ERI scalar intrinsics.
No functional change.

llvm-svn: 223761

9 years agoFix a few instances found in SelectionDAG where we were not handling F16 at parity...
Owen Anderson [Tue, 9 Dec 2014 06:50:39 +0000 (06:50 +0000)]
Fix a few instances found in SelectionDAG where we were not handling F16 at parity with F32 and F64.

llvm-svn: 223760

9 years agoRevert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 06:35:37 +0000 (06:35 +0000)]
Revert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."

This reverts commit r223753.  It broke the Green Dragon build for a few
hours:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/
  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/consoleFull#43901905849ba4694-19c4-4d7e-bec5-911270d8a58c

I suspect `clang-tools-extra` just needs a follow-up for an API change,
but I'm not the right one to look into it.

llvm-svn: 223759

9 years agotest commit (spelling correction)
Mohit K. Bhakkad [Tue, 9 Dec 2014 06:31:07 +0000 (06:31 +0000)]
test commit (spelling correction)

llvm-svn: 223758

9 years ago[X86] Convert esp-relative movs of function arguments into pushes, step 1
Michael Kuperstein [Tue, 9 Dec 2014 06:10:44 +0000 (06:10 +0000)]
[X86] Convert esp-relative movs of function arguments into pushes, step 1

This handles the simplest case for mov -> push conversion:
1. x86-32 calling convention, everything is passed through the stack.
2. There is no reserved call frame.
3. Only registers or immediates are pushed, no attempt to combine a mem-reg-mem sequence into a single PUSHmm.

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

llvm-svn: 223757

9 years agoReland r223754
David Majnemer [Tue, 9 Dec 2014 05:56:09 +0000 (05:56 +0000)]
Reland r223754

The commit is identical except a reference to `GV' should have been to
`GVal'.

llvm-svn: 223756

9 years agoRevert "AsmParser: Reject invalid mismatch between forward ref and def"
David Majnemer [Tue, 9 Dec 2014 05:50:11 +0000 (05:50 +0000)]
Revert "AsmParser: Reject invalid mismatch between forward ref and def"

This reverts commit r223754.  I've upset the buildbots.

llvm-svn: 223755

9 years agoAsmParser: Reject invalid mismatch between forward ref and def
David Majnemer [Tue, 9 Dec 2014 05:43:56 +0000 (05:43 +0000)]
AsmParser: Reject invalid mismatch between forward ref and def

Don't assume that the forward referenced entity was of the same
global-kind as the new entity.

This fixes PR21779.

llvm-svn: 223754

9 years ago[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.
Richard Smith [Tue, 9 Dec 2014 03:20:04 +0000 (03:20 +0000)]
[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.

For files named by -fmodule-map-file=, and files found by 'extern module'
directives, this flag specifies that we should resolve filenames relative to
the current working directory rather than relative to the directory in which
the module map file resides. This is aimed at fixing path handling, in
particular for relative -I paths, when building modules that represent
components of the current project (rather than libraries installed on the
current system, which the current project has as dependencies, where we'd
typically expect the module map files to be looked up implicitly).

llvm-svn: 223753

9 years agoImplement remote process listing in Linux platform.
Stephane Sezer [Tue, 9 Dec 2014 03:18:09 +0000 (03:18 +0000)]
Implement remote process listing in Linux platform.

Summary:

Test Plan: Connect to a remote implementing the platform protocol (ds2 in this case), run `platform process list` and see processes being displayed.

Reviewers: vharron, tfiala, clayborg

Subscribers: lldb-commits

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

llvm-svn: 223752

9 years agoRestore r223709 as it was meant to be, and enable FeatureP8Vector for P8
Bill Schmidt [Tue, 9 Dec 2014 03:02:48 +0000 (03:02 +0000)]
Restore r223709 as it was meant to be, and enable FeatureP8Vector for P8

llvm-svn: 223751

9 years agoHandle newlines on Windows correctly.
Nikola Smiljanic [Tue, 9 Dec 2014 02:57:56 +0000 (02:57 +0000)]
Handle newlines on Windows correctly.

llvm-svn: 223750

9 years agoAdd Linux support for HostInfo::GetOSBuildString and HostInfo::GetOSKernelDescription.
Oleksiy Vyalov [Tue, 9 Dec 2014 02:13:05 +0000 (02:13 +0000)]
Add Linux support for HostInfo::GetOSBuildString and HostInfo::GetOSKernelDescription.

llvm-svn: 223737

9 years agoMS ABI: Add another test for PR20017
David Majnemer [Tue, 9 Dec 2014 01:36:45 +0000 (01:36 +0000)]
MS ABI: Add another test for PR20017

llvm-svn: 223733

9 years ago[tsan] remove TSAN_GO in favor of SANITIZER_GO
Kostya Serebryany [Tue, 9 Dec 2014 01:31:14 +0000 (01:31 +0000)]
[tsan] remove TSAN_GO in favor of SANITIZER_GO

llvm-svn: 223732

9 years agoSimple test for file & line dummy breakpoints.
Jim Ingham [Tue, 9 Dec 2014 01:28:22 +0000 (01:28 +0000)]
Simple test for file & line dummy breakpoints.

llvm-svn: 223731

9 years ago[asan] move GetRSS from tsan to sanitizer_common
Kostya Serebryany [Tue, 9 Dec 2014 01:22:59 +0000 (01:22 +0000)]
[asan] move GetRSS from tsan to sanitizer_common

llvm-svn: 223730

9 years agoRevert r223709, "[PowerPC]Activate FeatureVSX for the Power target", to unbreak bots.
NAKAMURA Takumi [Tue, 9 Dec 2014 01:03:27 +0000 (01:03 +0000)]
Revert r223709, "[PowerPC]Activate FeatureVSX for the Power target", to unbreak bots.

CodeGen/PowerPC/vsx-p8.ll was failing.

  '+power8-vector' is not a recognized feature for this target (ignoring feature)
  llvm/test/CodeGen/PowerPC/vsx-p8.ll:33:14: error: expected string not found in input
  ; CHECK-REG: lxvw4x 34, 0, 3
               ^
  <stdin>:50:2: note: scanning from here
   .align 3
   ^
  <stdin>:61:2: note: possible intended match here
   lvx 3, 0, 3
   ^

llvm-svn: 223729

9 years agoOptimize comparisons to empty string.
Peter Collingbourne [Tue, 9 Dec 2014 01:02:12 +0000 (01:02 +0000)]
Optimize comparisons to empty string.

Geo-mean performance improvement of 0.2% (-0.3% - 0.9% @ 95% CI).

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

llvm-svn: 223728

9 years agoHandle early-clobber registers in the aggressive anti-dep breaker
Hal Finkel [Tue, 9 Dec 2014 01:00:59 +0000 (01:00 +0000)]
Handle early-clobber registers in the aggressive anti-dep breaker

The aggressive anti-dep breaker, used by the PowerPC backend during post-RA
scheduling (but is available to all targets), did not handle early-clobber MI
operands (at all). When constructing the list of available registers for the
replacement of some def operand, check the using instructions, and remove
registers assigned to early-clobbered defs from the set.

Fixes PR21452.

llvm-svn: 223727

9 years agoDebugInfo: Correctly identify the location of C++ member initializer list elements
David Blaikie [Tue, 9 Dec 2014 00:32:22 +0000 (00:32 +0000)]
DebugInfo: Correctly identify the location of C++ member initializer list elements

This particularly helps the fidelity of ASan reports (which can occur
even in these examples - if, for example, one uses placement new over a
buffer of insufficient size - now ASan will correctly identify which
member's initialization went over the end of the buffer).

This doesn't cover all types of members - more coming.

llvm-svn: 223726

9 years agoAdd argument variable support to the debug info tutorial
Eric Christopher [Tue, 9 Dec 2014 00:28:24 +0000 (00:28 +0000)]
Add argument variable support to the debug info tutorial
and rearrange the prologue source location hack to immediately
after it.

llvm-svn: 223725

9 years ago[modules] If the same .pcm file is imported via two different paths, don't
Richard Smith [Tue, 9 Dec 2014 00:14:36 +0000 (00:14 +0000)]
[modules] If the same .pcm file is imported via two different paths, don't
complain that the contained modules are defined twice.

llvm-svn: 223724

9 years agoRevert "Driver: Objective-C should respect -fno-exceptions"
David Majnemer [Tue, 9 Dec 2014 00:12:30 +0000 (00:12 +0000)]
Revert "Driver: Objective-C should respect -fno-exceptions"

This reverts commit r223455.  It's been succesfully argued that
-fexceptions (at the driver level) is a misnomer and has little to do
with -fobjc-exceptions.

llvm-svn: 223723

9 years agoR600/SI: Set MayStore = 0 on MUBUF loads
Tom Stellard [Tue, 9 Dec 2014 00:03:54 +0000 (00:03 +0000)]
R600/SI: Set MayStore = 0 on MUBUF loads

llvm-svn: 223722

9 years agoR600/SI: Move setting of the lds bit to the base MUBUF class
Tom Stellard [Tue, 9 Dec 2014 00:03:51 +0000 (00:03 +0000)]
R600/SI: Move setting of the lds bit to the base MUBUF class

llvm-svn: 223721

9 years ago[Hexagon] Removing old def versions and replacing usages with versions that have...
Colin LeMahieu [Mon, 8 Dec 2014 23:55:43 +0000 (23:55 +0000)]
[Hexagon] Removing old def versions and replacing usages with versions that have encodings.

llvm-svn: 223720

9 years agoMISched: Fix moving stores across barriers
Tom Stellard [Mon, 8 Dec 2014 23:36:48 +0000 (23:36 +0000)]
MISched: Fix moving stores across barriers

This fixes an issue with ScheduleDAGInstrs::buildSchedGraph
where stores without an underlying object would not be added
as a predecessor to the current BarrierChain.

llvm-svn: 223717

9 years agoUpdate bogus file permissions.
Alexey Samsonov [Mon, 8 Dec 2014 23:28:07 +0000 (23:28 +0000)]
Update bogus file permissions.

Suggested in http://reviews.llvm.org/D6547.

llvm-svn: 223715

9 years agoAdd a test for MS-ABI this adjustment for virtual calls to member operators.
Nico Weber [Mon, 8 Dec 2014 23:25:55 +0000 (23:25 +0000)]
Add a test for MS-ABI this adjustment for virtual calls to member operators.

They too were fixed by r223185, despite the commit message saying otherwise.
Add a test that makes sure they don't regress.

llvm-svn: 223714

9 years agoAdd the ability for an SBValue to create a persisted version of itself.
Enrico Granata [Mon, 8 Dec 2014 23:13:56 +0000 (23:13 +0000)]
Add the ability for an SBValue to create a persisted version of itself.
Such a persisted version is equivalent to evaluating the value via the expression evaluator, and holding on to the $n result of the expression, except this API can be used on SBValues that do not obviously come from an expression (e.g. are the result of a memory lookup)

Expose this via SBValue::Persist() in our public API layer, and ValueObject::Persist() in the lldb_private layer

Includes testcase

Fixes rdar://19136664

llvm-svn: 223711

9 years ago[Hexagon] Adding any8, all8, and/or/xor/andn/orn/not predicate register forms, mask...
Colin LeMahieu [Mon, 8 Dec 2014 23:07:59 +0000 (23:07 +0000)]
[Hexagon] Adding any8, all8, and/or/xor/andn/orn/not predicate register forms, mask, and vitpack instructions and patterns.

llvm-svn: 223710

9 years ago[PowerPC]Activate FeatureVSX for the Power target
Bill Seurer [Mon, 8 Dec 2014 23:07:12 +0000 (23:07 +0000)]
[PowerPC]Activate FeatureVSX for the Power target

This change activates FeatureVSX for Power 7 and Power 8 in PPC.td.

http://reviews.llvm.org/D6570

llvm-svn: 223709

9 years ago[PowerPC] Don't use a non-allocatable register to implement the 'cc' alias
Hal Finkel [Mon, 8 Dec 2014 22:54:22 +0000 (22:54 +0000)]
[PowerPC] Don't use a non-allocatable register to implement the 'cc' alias

GCC accepts 'cc' as an alias for 'cr0', and we need to do the same when
processing inline asm constraints. This had previously been implemented using a
non-allocatable register, named 'cc', that was listed as an alias of 'cr0', but
the infrastructure does not seem to support this properly (neither the register
allocator nor the scheduler properly accounts for the alias). Instead, we can
just process this as a naming alias inside of the inline asm
constraint-processing code, so we'll do that instead.

There are two regression tests, one where the post-RA scheduler did the wrong
thing with the non-allocatable alias, and one where the register allocator did
the wrong thing. Fixes PR21742.

llvm-svn: 223708

9 years agoHandle possible TypoExprs in member initializers.
Kaelyn Takata [Mon, 8 Dec 2014 22:41:42 +0000 (22:41 +0000)]
Handle possible TypoExprs in member initializers.

Includes a new test case since none of the existing tests were hitting
this code path.

llvm-svn: 223705

9 years ago[Hexagon] Fixing broken test.
Colin LeMahieu [Mon, 8 Dec 2014 22:29:06 +0000 (22:29 +0000)]
[Hexagon] Fixing broken test.

llvm-svn: 223704

9 years ago[Hexagon] Adding xtype doubleword add, sub, and, or, xor and patterns.
Colin LeMahieu [Mon, 8 Dec 2014 22:19:14 +0000 (22:19 +0000)]
[Hexagon] Adding xtype doubleword add, sub, and, or, xor and patterns.

llvm-svn: 223702

9 years ago[Hexagon] Adding xtype doubleword comparisons. Removing unused multiclass.
Colin LeMahieu [Mon, 8 Dec 2014 21:56:47 +0000 (21:56 +0000)]
[Hexagon] Adding xtype doubleword comparisons.  Removing unused multiclass.

llvm-svn: 223701

9 years agoFix platform shell test to run "dir c:\" instead of "ls /" on Windows.
Zachary Turner [Mon, 8 Dec 2014 21:50:05 +0000 (21:50 +0000)]
Fix platform shell test to run "dir c:\" instead of "ls /" on Windows.

llvm-svn: 223700

9 years agoDebugInfo: Ensure the store for an assignment is attributed to the beginning of the...
David Blaikie [Mon, 8 Dec 2014 21:48:57 +0000 (21:48 +0000)]
DebugInfo: Ensure the store for an assignment is attributed to the beginning of the assignment expression

llvm-svn: 223699

9 years agoFix some posix assumptions related to running shell commands.
Zachary Turner [Mon, 8 Dec 2014 21:36:42 +0000 (21:36 +0000)]
Fix some posix assumptions related to running shell commands.

This is a resubmit of r223548, which was reverted due to breaking
tests on Linux and Mac.

This resubmit fixes the reason for the revert by adding back some
accidentally removed code which appends -c to the command line
when running /bin/sh.

This resubmit also differs from the original patch in that it sets
the architecture on the ProcessLaunchInfo.  A follow-up patch will
refactor this to separate the logic for different platforms.

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

Reviewed By: Greg Clayton

llvm-svn: 223695

9 years agoclang-format: Indent correctly in conditional expressions after return.
Daniel Jasper [Mon, 8 Dec 2014 21:28:31 +0000 (21:28 +0000)]
clang-format: Indent correctly in conditional expressions after return.

This only applies when not aligning after the return itself (which is
commonly done for C++.

Before:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
             bbbbbb)  // This is indented relative to aaaaaaaaaa.
      : b;

After:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
            bbbbbb)
      : b;

llvm-svn: 223694

9 years ago[Hexagon] Adding xtype parity, min, minu, max, maxu instructions.
Colin LeMahieu [Mon, 8 Dec 2014 21:19:18 +0000 (21:19 +0000)]
[Hexagon] Adding xtype parity, min, minu, max, maxu instructions.

llvm-svn: 223693

9 years ago[Hexagon] Adding xtype halfword add/sub ll/hl/lh/hh/sat/<<16 instructions.
Colin LeMahieu [Mon, 8 Dec 2014 20:33:01 +0000 (20:33 +0000)]
[Hexagon] Adding xtype halfword add/sub ll/hl/lh/hh/sat/<<16 instructions.

llvm-svn: 223692

9 years agoMake myself the code owner for llgo.
Peter Collingbourne [Mon, 8 Dec 2014 20:30:39 +0000 (20:30 +0000)]
Make myself the code owner for llgo.

llvm-svn: 223691

9 years agoFix isInstantiated and isInTemplateInstantiation to not recreate the matchers on...
Samuel Benzaquen [Mon, 8 Dec 2014 20:17:58 +0000 (20:17 +0000)]
Fix isInstantiated and isInTemplateInstantiation to not recreate the matchers on each call.

Summary:
Store the result matcher after the first call and reuse it later on.
Recreating the matchers just to use them once incurs in a lot of
unnecessary temporary memory allocations.
This change speeds up our clang-tidy benchmarks by ~2%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 223690

9 years agoAdd .arcconfig file.
Peter Collingbourne [Mon, 8 Dec 2014 20:12:22 +0000 (20:12 +0000)]
Add .arcconfig file.

llvm-svn: 223689

9 years agoclang-format: [Java] Always break after annotations of multiline decls.
Daniel Jasper [Mon, 8 Dec 2014 20:08:04 +0000 (20:08 +0000)]
clang-format: [Java] Always break after annotations of multiline decls.

Before:
  @Mock DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  @Mock
  DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

llvm-svn: 223688

9 years agoRemove use of GCC-style intrinsics, as they are non-portable.
Zachary Turner [Mon, 8 Dec 2014 20:00:33 +0000 (20:00 +0000)]
Remove use of GCC-style intrinsics, as they are non-portable.

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

llvm-svn: 223687

9 years agoR600/SI: Move continue after checking s_mov_b32.
Matt Arsenault [Mon, 8 Dec 2014 19:55:43 +0000 (19:55 +0000)]
R600/SI: Move continue after checking s_mov_b32.

There's nothing else to bother trying to shrink these.

llvm-svn: 223686

9 years agoclang-format: Make clang-format-diff.py format java files.
Daniel Jasper [Mon, 8 Dec 2014 19:39:03 +0000 (19:39 +0000)]
clang-format: Make clang-format-diff.py format java files.

llvm-svn: 223685

9 years agoConstantFold: Zero-sized globals might land on top of another global
David Majnemer [Mon, 8 Dec 2014 19:35:31 +0000 (19:35 +0000)]
ConstantFold: Zero-sized globals might land on top of another global

A zero sized array is zero sized and might share its address with
another global.

llvm-svn: 223684

9 years agoInstrProf: Use LLVM's -instrprof pass for profiling
Justin Bogner [Mon, 8 Dec 2014 19:04:51 +0000 (19:04 +0000)]
InstrProf: Use LLVM's -instrprof pass for profiling

The logic for lowering profiling counters has been moved to an LLVM
pass. Emit the intrinsics rather than duplicating the whole pass in
clang.

llvm-svn: 223683

9 years agoClean up the rst for the debug info tutorial
Eric Christopher [Mon, 8 Dec 2014 18:48:08 +0000 (18:48 +0000)]
Clean up the rst for the debug info tutorial

llvm-svn: 223682

9 years agoLazily link GlobalVariables and GlobalAliases.
Rafael Espindola [Mon, 8 Dec 2014 18:45:16 +0000 (18:45 +0000)]
Lazily link GlobalVariables and GlobalAliases.

We were already lazily linking functions, but all GlobalValues can be treated
uniformly for this.

The test updates are to ensure that a given GlobalValue is still linked in.

This fixes pr21494.

llvm-svn: 223681

9 years ago[Hexagon] Adding add/sub with saturation. Removing unused def. Cleaning up shift...
Colin LeMahieu [Mon, 8 Dec 2014 18:33:49 +0000 (18:33 +0000)]
[Hexagon] Adding add/sub with saturation.  Removing unused def.  Cleaning up shift patterns.

llvm-svn: 223680

9 years agoInstSimplify: Try to bring back the rest of r223583
David Majnemer [Mon, 8 Dec 2014 18:30:43 +0000 (18:30 +0000)]
InstSimplify: Try to bring back the rest of r223583

This reverts r223624 with a small tweak, hopefully this will make stage3
equivalent.

llvm-svn: 223679

9 years agoOnce more on the cmake build. nativecodegen->native on the dependencies.
Eric Christopher [Mon, 8 Dec 2014 18:24:06 +0000 (18:24 +0000)]
Once more on the cmake build. nativecodegen->native on the dependencies.

Thanks to Rafael Espindola for testing assistance.

llvm-svn: 223678

9 years agoAttempt to fix the cmake build by requiring mcjit on the cmake
Eric Christopher [Mon, 8 Dec 2014 18:20:50 +0000 (18:20 +0000)]
Attempt to fix the cmake build by requiring mcjit on the cmake
dependencies for the KS tutorials

llvm-svn: 223677

9 years ago[CompactUnwind] Fix register encoding logic
Bruno Cardoso Lopes [Mon, 8 Dec 2014 18:18:32 +0000 (18:18 +0000)]
[CompactUnwind] Fix register encoding logic

Fix a compact unwind encoding logic bug which would try to encode
more callee saved registers than it should, leading to early bail out
in the encoding logic and abusive use of DWARF frame mode unnecessarily.

Also remove no-compact-unwind.ll which was testing the wrong thing
based on this bug and move it to valid 'compact unwind' tests. Added
other few more tests too.

llvm-svn: 223676

9 years agoFix KS tutorial build failure.
Eric Christopher [Mon, 8 Dec 2014 18:12:28 +0000 (18:12 +0000)]
Fix KS tutorial build failure.

make all doesn't build the examples and it was uniquified since
last build.

llvm-svn: 223675

9 years agoFix a bug where global variable can be reported as local.
Hafiz Abid Qadeer [Mon, 8 Dec 2014 18:07:40 +0000 (18:07 +0000)]
Fix a bug where global variable can be reported as local.

There was an error in ORing mask which is used for getting a list of variables.
Previously, these constants were unnamed, and possible it become the reason of this
bug. Also added test case for -stack-list-local and -stack-list_arguments.

Patch from Ilia K <ki.stfu@gmail.com>.

llvm-svn: 223674

9 years agoDon't crash when the key of a comdat is lazily linked.
Rafael Espindola [Mon, 8 Dec 2014 18:05:48 +0000 (18:05 +0000)]
Don't crash when the key of a comdat is lazily linked.

llvm-svn: 223673

9 years agoInstrProf: An intrinsic and lowering for instrumentation based profiling
Justin Bogner [Mon, 8 Dec 2014 18:02:35 +0000 (18:02 +0000)]
InstrProf: An intrinsic and lowering for instrumentation based profiling

Introduce the ``llvm.instrprof_increment`` intrinsic and the
``-instrprof`` pass. These provide the infrastructure for writing
counters for profiling, as in clang's ``-fprofile-instr-generate``.

The implementation of the instrprof pass is ported directly out of the
CodeGenPGO classes in clang, and with the followup in clang that rips
that code out to use these new intrinsics this ends up being NFC.

Doing the instrumentation this way opens some doors in terms of
improving the counter performance. For example, this will make it
simple to experiment with alternate lowering strategies, and allows us
to try handling profiling specially in some optimizations if we want
to.

Finally, this drastically simplifies the frontend and puts all of the
lowering logic in one place.

llvm-svn: 223672

9 years agoAdd Chapter 8 to the Kaleidoscope tutorial. This chapter adds
Eric Christopher [Mon, 8 Dec 2014 18:00:47 +0000 (18:00 +0000)]
Add Chapter 8 to the Kaleidoscope tutorial. This chapter adds
a description of how to add debug information using DWARF and
DIBuilder to the language.

Thanks to David Blaikie for his assistance with this tutorial.

llvm-svn: 223671

9 years agoFix the JIT code for the Kaleidoscope tutorial.
Eric Christopher [Mon, 8 Dec 2014 18:00:38 +0000 (18:00 +0000)]
Fix the JIT code for the Kaleidoscope tutorial.

llvm-svn: 223670

9 years agoAArch64: treat HFAs containing "half" types as blocks too.
Tim Northover [Mon, 8 Dec 2014 17:54:58 +0000 (17:54 +0000)]
AArch64: treat HFAs containing "half" types as blocks too.

llvm-svn: 223669

9 years ago[X86] Improved tablegen patters for matching TZCNT/LZCNT.
Andrea Di Biagio [Mon, 8 Dec 2014 17:47:18 +0000 (17:47 +0000)]
[X86] Improved tablegen patters for matching TZCNT/LZCNT.

Teach ISel how to match a TZCNT/LZCNT from a conditional move if the
condition code is X86_COND_NE.
Existing tablegen patterns only allowed to match TZCNT/LZCNT from a
X86cond with condition code equal to X86_COND_E. To avoid introducing
extra rules, I added an 'ImmLeaf' definition that checks if the
condition code is COND_E or COND_NE.

llvm-svn: 223668

9 years ago[Hexagon] Adding combine reg, reg with predicated forms.
Colin LeMahieu [Mon, 8 Dec 2014 17:33:06 +0000 (17:33 +0000)]
[Hexagon] Adding combine reg, reg with predicated forms.

llvm-svn: 223667

9 years agoSimplify the test. NFC.
Rafael Espindola [Mon, 8 Dec 2014 17:22:06 +0000 (17:22 +0000)]
Simplify the test. NFC.

Since the main file was empty, we can just copy the content of the Input file
into it.

llvm-svn: 223666

9 years agoSimplify test. NFC.
Rafael Espindola [Mon, 8 Dec 2014 17:02:50 +0000 (17:02 +0000)]
Simplify test. NFC.

This is just testing the largest merge mode for comdats. No need to use
hard to read names and fancy types.

llvm-svn: 223665

9 years ago[Hexagon] Adding packhl instruction.
Colin LeMahieu [Mon, 8 Dec 2014 17:01:18 +0000 (17:01 +0000)]
[Hexagon] Adding packhl instruction.

llvm-svn: 223664

9 years agoUse CHECK-DAG to reduce the noise in an upcoming patch.
Rafael Espindola [Mon, 8 Dec 2014 16:46:52 +0000 (16:46 +0000)]
Use CHECK-DAG to reduce the noise in an upcoming patch.

llvm-svn: 223663

9 years ago[mips] Add Mips-specific CCIf's for accessing the MipsCCState. NFC.
Daniel Sanders [Mon, 8 Dec 2014 15:40:09 +0000 (15:40 +0000)]
[mips] Add Mips-specific CCIf's for accessing the MipsCCState. NFC.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 223662

9 years agoExplicitly include <sched.h> for sched_yield()
Sergey Dmitrouk [Mon, 8 Dec 2014 14:50:21 +0000 (14:50 +0000)]
Explicitly include <sched.h> for sched_yield()

It might be implicitly included by <pthread.h> (and that's why it worked
so far), but it's not guaranteed (for example, this is not the case with
newlib).

llvm-svn: 223661

9 years ago[X86] Improved lowering of packed v8i16 vector shifts by non-constant count.
Andrea Di Biagio [Mon, 8 Dec 2014 14:36:51 +0000 (14:36 +0000)]
[X86] Improved lowering of packed v8i16 vector shifts by non-constant count.

Before this patch, the backend sub-optimally expanded the non-constant shift
count of a v8i16 shift into a sequence of two 'movd' plus 'movzwl'.

With this patch the backend checks if the target features sse4.1. If so, then
it lets the shuffle legalizer deal with the expansion of the shift amount.

Example:
;;
define <8 x i16> @test(<8 x i16> %A, <8 x i16> %B) {
  %shamt = shufflevector <8 x i16> %B, <8 x i16> undef, <8 x i32> zeroinitializer
  %shl = shl <8 x i16> %A, %shamt
  ret <8 x i16> %shl
}
;;

Before (with -mattr=+avx):
  vmovd  %xmm1, %eax
  movzwl  %ax, %eax
  vmovd  %eax, %xmm1
  vpsllw  %xmm1, %xmm0, %xmm0
  retq

Now:
  vpxor  %xmm2, %xmm2, %xmm2
  vpblendw  $1, %xmm1, %xmm2, %xmm1
  vpsllw  %xmm1, %xmm0, %xmm0
  retq

llvm-svn: 223660

9 years agoMove the ValueMap lookup inside linkFunctionBody. NFC.
Rafael Espindola [Mon, 8 Dec 2014 14:25:26 +0000 (14:25 +0000)]
Move the ValueMap lookup inside linkFunctionBody. NFC.

llvm-svn: 223659

9 years agoUse range loops. NFC.
Rafael Espindola [Mon, 8 Dec 2014 14:20:10 +0000 (14:20 +0000)]
Use range loops. NFC.

llvm-svn: 223658

9 years agoUse range loops. NFC.
Rafael Espindola [Mon, 8 Dec 2014 14:05:33 +0000 (14:05 +0000)]
Use range loops. NFC.

llvm-svn: 223657

9 years agoFix linking of prologue data.
Rafael Espindola [Mon, 8 Dec 2014 13:44:38 +0000 (13:44 +0000)]
Fix linking of prologue data.

It would crash when the function was lazy linked.

llvm-svn: 223656

9 years ago[CMake] Fix installation of llvm-ranlib on multiconfig builder.
NAKAMURA Takumi [Mon, 8 Dec 2014 13:43:38 +0000 (13:43 +0000)]
[CMake] Fix installation of llvm-ranlib on multiconfig builder.

Introduce install_symlink.cmake from clang/tools/driver/clang_symlink.cmake.

FIXME: Would it be generalized?
llvm-svn: 223655

9 years agoSimple style fixes.
Rafael Espindola [Mon, 8 Dec 2014 13:35:09 +0000 (13:35 +0000)]
Simple style fixes.

* Use a range loop.
* Move simple continue checks earlier.
* clang-format.

llvm-svn: 223654