platform/upstream/llvm.git
8 years ago[LinkerScript] Filler can have a decimal value.
Davide Italiano [Fri, 29 Jul 2016 22:21:28 +0000 (22:21 +0000)]
[LinkerScript] Filler can have a decimal value.

llvm-svn: 277222

8 years agoRemove unused variable.
Eric Christopher [Fri, 29 Jul 2016 22:11:11 +0000 (22:11 +0000)]
Remove unused variable.

Fixes PR28761.

llvm-svn: 277221

8 years ago[Hexagon] Referencify MachineInstr in HexagonInstrInfo, NFC
Krzysztof Parzyszek [Fri, 29 Jul 2016 21:49:42 +0000 (21:49 +0000)]
[Hexagon] Referencify MachineInstr in HexagonInstrInfo, NFC

llvm-svn: 277220

8 years ago[X86] Match PSADBW in straight-line code
Michael Kuperstein [Fri, 29 Jul 2016 21:45:51 +0000 (21:45 +0000)]
[X86] Match PSADBW in straight-line code

Up until now, we only had code to match PSADBW patterns that look like what
comes out of the loop vectorizer - a partial reduction inside the loop body
that gets fed into a horizontal operation in a different basic block.

This adds support for straight-line patterns, like those generated by the
SLP vectorizer.

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

llvm-svn: 277219

8 years ago[Hexagon] Fix test that uses -debug-only to require asserts.
Michael Kuperstein [Fri, 29 Jul 2016 21:44:33 +0000 (21:44 +0000)]
[Hexagon] Fix test that uses -debug-only to require asserts.

llvm-svn: 277218

8 years agoSorting includes; NFC.
Aaron Ballman [Fri, 29 Jul 2016 21:41:18 +0000 (21:41 +0000)]
Sorting includes; NFC.

llvm-svn: 277217

8 years agopdbdump: Dump Free Page Map contents.
Rui Ueyama [Fri, 29 Jul 2016 21:38:00 +0000 (21:38 +0000)]
pdbdump: Dump Free Page Map contents.

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

llvm-svn: 277216

8 years agolibunwind: correct return code in unwinding trace log message
Ed Maste [Fri, 29 Jul 2016 21:24:19 +0000 (21:24 +0000)]
libunwind: correct return code in unwinding trace log message

llvm-svn: 277215

8 years ago[X86][AVX] Fix VBROADCASTF128 selection bug (PR28770)
Simon Pilgrim [Fri, 29 Jul 2016 21:05:10 +0000 (21:05 +0000)]
[X86][AVX] Fix VBROADCASTF128 selection bug (PR28770)

Support for lowering to VBROADCASTF128 etc. in D22460 was not correctly ensuring that the only users of the 128-bit vector load were the insertions of the vector into the lower/upper subvectors.

llvm-svn: 277214

8 years ago[msf] Resubmit "Rename Msf -> MSF".
Zachary Turner [Fri, 29 Jul 2016 20:56:36 +0000 (20:56 +0000)]
[msf] Resubmit "Rename Msf -> MSF".

Previously this change was submitted from a Windows machine, so
changes made to the case of filenames and directory names did
not survive the commit, and as a result the CMake source file
names and the on-disk file names did not match on case-sensitive
file systems.

I'm resubmitting this patch from a Linux system, which hopefully
allows the case changes to make it through unfettered.

llvm-svn: 277213

8 years agoMake balanced affinity work on AArch64.
Paul Osmialowski [Fri, 29 Jul 2016 20:55:03 +0000 (20:55 +0000)]
Make balanced affinity work on AArch64.

This patch enables balanced affinity on machines that do not have
hardware threads and have cores clustered into packages. In facts,
balacing algorithm could be generalized for any arrangement with
at least two levels of hierarchy (depth > 1).

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

llvm-svn: 277212

8 years agoFix CGOpenMPRuntime.cpp for VS2013. NFC.
Paul Robinson [Fri, 29 Jul 2016 20:46:16 +0000 (20:46 +0000)]
Fix CGOpenMPRuntime.cpp for VS2013.  NFC.
I don't know why these changes work but they do.

llvm-svn: 277211

8 years ago[StreamExecutor] Add error handling library
Jason Henline [Fri, 29 Jul 2016 20:45:52 +0000 (20:45 +0000)]
[StreamExecutor] Add error handling library

Summary:
Error handling in StreamExecutor is based on llvm::Error and
llvm::Expected. This CL sets up the StreamExecutor wrapper classes in
the streamexecutor namespace.

All the other StreamExecutor code makes use of this error handling code,
so this is the first CL for checking in StreamExecutor.

Reviewers: jlebar, tra

Subscribers: parallel_libs-commits

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

llvm-svn: 277210

8 years agoCodeGen: add new "intrinsic" MachineOperand kind.
Tim Northover [Fri, 29 Jul 2016 20:32:59 +0000 (20:32 +0000)]
CodeGen: add new "intrinsic" MachineOperand kind.

This will be used during GlobalISel, where we need a more robust and readable
way to write tests than a simple immediate ID.

llvm-svn: 277209

8 years ago[lld][MachO] Replace some std::string with char* buffers to eliminate mem leaks.
Lang Hames [Fri, 29 Jul 2016 20:04:18 +0000 (20:04 +0000)]
[lld][MachO] Replace some std::string with char* buffers to eliminate mem leaks.

The MachO debug support code (committed in r276935) occasionally needs to
allocate string copies, and was doing so by creating std::strings on a
BumpPtrAllocator. The strings were untracked, so the destructors weren't being
run and we were leaking the memory when the allocator was thrown away. Since
it's easier than tracking the strings, this patch switches the copies to char
buffers allocated directly in the bump-ptr allocator.

llvm-svn: 277208

8 years agoEnsure Ident_GNU_final is properly initialized in the Parser Initialize function
David Majnemer [Fri, 29 Jul 2016 20:01:12 +0000 (20:01 +0000)]
Ensure Ident_GNU_final is properly initialized in the Parser Initialize function

The recent change implementing __final forgot to initialize a variable.
This was caught by the Memory Sanitizer.

Properly initialize the value to nullptr to ensure proper memory reads.

Patch by Erich Keane!

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

llvm-svn: 277206

8 years agoFix naked.cpp test on 32-bit Windows
Reid Kleckner [Fri, 29 Jul 2016 19:43:28 +0000 (19:43 +0000)]
Fix naked.cpp test on 32-bit Windows

llvm-svn: 277205

8 years agoAdd a REQUIRES: assert on a Lanai test that uses a -debug-only flag
Eli Bendersky [Fri, 29 Jul 2016 19:35:22 +0000 (19:35 +0000)]
Add a REQUIRES: assert on a Lanai test that uses a -debug-only flag

llvm-svn: 277204

8 years ago[LoopUnroll] Include hotness of region in opt remark
Adam Nemet [Fri, 29 Jul 2016 19:29:47 +0000 (19:29 +0000)]
[LoopUnroll] Include hotness of region in opt remark

LoopUnroll is a loop pass, so the analysis of OptimizationRemarkEmitter
is added to the common function analysis passes that loop passes
depend on.

The BFI and indirectly BPI used in this pass is computed lazily so no
overhead should be observed unless -pass-remarks-with-hotness is used.

This is how the patch affects the O3 pipeline:

         Dominator Tree Construction
         Natural Loop Information
         Canonicalize natural loops
         Loop-Closed SSA Form Pass
         Basic Alias Analysis (stateless AA impl)
         Function Alias Analysis Results
         Scalar Evolution Analysis
+        Lazy Branch Probability Analysis
+        Lazy Block Frequency Analysis
+        Optimization Remark Emitter
         Loop Pass Manager
           Rotate Loops
           Loop Invariant Code Motion
           Unswitch loops
         Simplify the CFG
         Dominator Tree Construction
         Basic Alias Analysis (stateless AA impl)
         Function Alias Analysis Results
         Combine redundant instructions
         Natural Loop Information
         Canonicalize natural loops
         Loop-Closed SSA Form Pass
         Scalar Evolution Analysis
+        Lazy Branch Probability Analysis
+        Lazy Block Frequency Analysis
+        Optimization Remark Emitter
         Loop Pass Manager
           Induction Variable Simplification
           Recognize loop idioms
           Delete dead loops
           Unroll loops
...

llvm-svn: 277203

8 years agoDon't crash if PT_TLS is empty.
Rafael Espindola [Fri, 29 Jul 2016 19:24:27 +0000 (19:24 +0000)]
Don't crash if PT_TLS is empty.

llvm-svn: 277202

8 years ago[GlobalISel] Add missing link components to r277160 unittest. NFC.
Ahmed Bougacha [Fri, 29 Jul 2016 19:19:32 +0000 (19:19 +0000)]
[GlobalISel] Add missing link components to r277160 unittest. NFC.

It broke a shared builder:
  http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/17320

llvm-svn: 277201

8 years agoCodeGen: try harder to make the CFString structure RW
Saleem Abdulrasool [Fri, 29 Jul 2016 19:15:51 +0000 (19:15 +0000)]
CodeGen: try harder to make the CFString structure RW

The previous change was insufficient to mark the content as read-write as the
structure itself was marked constant.  Adjust this and add tests to ensure that
the section is marked appropriately as being read-write.

llvm-svn: 277200

8 years agoFixed line endings
Simon Pilgrim [Fri, 29 Jul 2016 18:58:57 +0000 (18:58 +0000)]
Fixed line endings

llvm-svn: 277199

8 years agoFixed (incorrectly firing) MSVC unused variable warning
Simon Pilgrim [Fri, 29 Jul 2016 18:57:32 +0000 (18:57 +0000)]
Fixed (incorrectly firing) MSVC unused variable warning

llvm-svn: 277198

8 years ago[ConstantFolding] Handle bitcasts of undef fp vector elements
David Majnemer [Fri, 29 Jul 2016 18:48:27 +0000 (18:48 +0000)]
[ConstantFolding] Handle bitcasts of undef fp vector elements

We used the wrong type for constructing a zero vector element which led
to type mismatches.

This fixes PR28771.

llvm-svn: 277197

8 years agoRemove the test/tools/llvm-objdump/malformed-archives.test for
Kevin Enderby [Fri, 29 Jul 2016 18:46:24 +0000 (18:46 +0000)]
Remove the test/tools/llvm-objdump/malformed-archives.test for
now while I investagate the bot failures with this test.

llvm-svn: 277196

8 years agoFixed MSVC out of range shift warning
Simon Pilgrim [Fri, 29 Jul 2016 18:43:59 +0000 (18:43 +0000)]
Fixed MSVC out of range shift warning

llvm-svn: 277195

8 years agoRevert "[msf] Rename Msf to MSF."
Zachary Turner [Fri, 29 Jul 2016 18:38:47 +0000 (18:38 +0000)]
Revert "[msf] Rename Msf to MSF."

This reverts commit 4d1557ffac41e079bcb1abbcf04f512474dcd6fe.

llvm-svn: 277194

8 years agoImprove documentation of the type safety attributes.
Yunzhong Gao [Fri, 29 Jul 2016 18:34:21 +0000 (18:34 +0000)]
Improve documentation of the type safety attributes.
1. Add description of the arguments to these attributes.
2. Add missing declarations to some of the MPI code examples.
3. Made clarifications where possible.

Based on the write-up by: Craig Flores.

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

llvm-svn: 277192

8 years agoFixing broken MSVS builds
Piotr Padlewski [Fri, 29 Jul 2016 18:28:07 +0000 (18:28 +0000)]
Fixing broken MSVS builds

llvm-svn: 277191

8 years ago[msf] Rename Msf to MSF.
Zachary Turner [Fri, 29 Jul 2016 18:24:26 +0000 (18:24 +0000)]
[msf] Rename Msf to MSF.

In a previous patch, it was suggested to use all caps instead of
rolling caps for initialisms, so this patch changes everything
to do this.

llvm-svn: 277190

8 years agoRecommitting r275284: add support to inline __builtin_mempcpy
Andrew Kaylor [Fri, 29 Jul 2016 18:23:18 +0000 (18:23 +0000)]
Recommitting r275284: add support to inline __builtin_mempcpy

Patch by Sunita Marathe

Third try, now following fixes to MSan to handle mempcy in such a way that this commit won't break the MSan buildbots. (Thanks, Evegenii!)

llvm-svn: 277189

8 years agoGlobalISel: make translate* functions take the most specialized class possible.
Tim Northover [Fri, 29 Jul 2016 18:11:21 +0000 (18:11 +0000)]
GlobalISel: make translate* functions take the most specialized class possible.

NFC.

llvm-svn: 277188

8 years agoCodegen: MachineBlockPlacement Improve probability layout.
Kyle Butt [Fri, 29 Jul 2016 18:09:28 +0000 (18:09 +0000)]
Codegen: MachineBlockPlacement Improve probability layout.

The following pattern was being layed out poorly:

              A
             / \
            B   C
           / \ / \
          D   E   ? (Doesn't matter)

Where A->B is far more likely than A->C, and prob(B->D) = prob(B->E)

The current algorithm gives:
A,B,C,E (D goes on worklist)

It does this even if C has a frequency count of 0. This patch
adjusts the layout calculation so that if freq(B->E) >> freq(C->E)
then we go ahead and layout E rather than C. Fallthrough half the time
is better than fallthrough never, or fallthrough very rarely. The
resulting layout is:

A,B,E, (C and D are in a worklist)

llvm-svn: 277187

8 years agoTests: Add branch weights to non-layout tests.
Kyle Butt [Fri, 29 Jul 2016 18:09:25 +0000 (18:09 +0000)]
Tests: Add branch weights to non-layout tests.

Add branch weights to a few tests that aren't testing layout to make them less
sensitive to changes in the layout algorithm.

llvm-svn: 277186

8 years agoSome code that is sanity checking stepping out back out from one inlined
Jim Ingham [Fri, 29 Jul 2016 18:09:12 +0000 (18:09 +0000)]
Some code that is sanity checking stepping out back out from one inlined
frame to another was triggering an early stop when stepping back out to a
real frame.  Check that we're doing this only for inlined frames.

<rdar://problem/26482931>

llvm-svn: 277185

8 years agoGlobalISel: add generic conditional branch.
Tim Northover [Fri, 29 Jul 2016 17:58:00 +0000 (17:58 +0000)]
GlobalISel: add generic conditional branch.

Just the basic equivalent to DAG's condbr for now, we'll get to things like
br_cc when we start doing more legalization.

llvm-svn: 277184

8 years agoMatching change needed to lld for llvm trunk change r277177.
Kevin Enderby [Fri, 29 Jul 2016 17:56:00 +0000 (17:56 +0000)]
Matching change needed to lld for llvm trunk change r277177.

Where Archive::getMemoryBufferRef() was changed to return Expected<>

llvm-svn: 277183

8 years ago[Hexagon] Testcase for not merging stores into a misaligned store
Krzysztof Parzyszek [Fri, 29 Jul 2016 17:55:37 +0000 (17:55 +0000)]
[Hexagon] Testcase for not merging stores into a misaligned store

The DAG combiner will try to merge consecutive stores into a bigger
store, unless the resulting store is not fast. Misaligned vector stores
are allowed on Hexagon, but are not fast. Add a testcase to make sure
this type of merging does not occur.

Patch by Pranav Bhandarkar.

llvm-svn: 277182

8 years ago[OpenCL] Add extension cl_khr_mipmap_image to clang
Yaxun Liu [Fri, 29 Jul 2016 17:52:34 +0000 (17:52 +0000)]
[OpenCL] Add extension cl_khr_mipmap_image to clang

Adding extension cl_khr_mipmap_image to clang's OpenCL Extensions and initiated inside AMDGPU Target.

Patch by Aaron En Ye Shi.

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

llvm-svn: 277181

8 years agoRevert r277178, the actual change had already been applied
Krzysztof Parzyszek [Fri, 29 Jul 2016 17:50:47 +0000 (17:50 +0000)]
Revert r277178, the actual change had already been applied

Will submit another patch with the testcase only.

llvm-svn: 277180

8 years ago[OpenCL] Added CLK_ABGR definition for get_image_channel_order return value
Yaxun Liu [Fri, 29 Jul 2016 17:50:10 +0000 (17:50 +0000)]
[OpenCL] Added CLK_ABGR definition for get_image_channel_order return value

Added CLK_ABGR definition for get_image_channel_order return value inside opencl-c.h file.

Patch by Aaron En Ye Shi.

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

llvm-svn: 277179

8 years ago[Hexagon] Misaligned loads and stores are not fast
Krzysztof Parzyszek [Fri, 29 Jul 2016 17:45:16 +0000 (17:45 +0000)]
[Hexagon] Misaligned loads and stores are not fast

The DAG combiner tries to merge stores to adjacent vector wide memory
locations by creating stores which are integral multiples of the vector
width. Discourage this by informing it that this is slow. This should
not affect legalization passes, because all of them ignore the "Fast"
argument.

Patch by Pranav Bhandarkar.

llvm-svn: 277178

8 years agoThe next step along the way to getting good error messages for bad archives.
Kevin Enderby [Fri, 29 Jul 2016 17:44:13 +0000 (17:44 +0000)]
The next step along the way to getting good error messages for bad archives.

As mentioned in commit log for r276686 this next step is adding a new
method in the ArchiveMemberHeader class to get the full name that
does proper error checking, and can be use for error messages.

To do this the name of ArchiveMemberHeader::getName() is changed to
ArchiveMemberHeader::getRawName() to be consistent with
Archive::Child::getRawName().  Then the “new” method is the addition
of a new implementation of ArchiveMemberHeader::getName() which gets
the full name and provides proper error checking.  Which is mostly a rewrite
of what was Archive::Child::getName() and cleaning up incorrect uses of
llvm_unreachable() in the code which were actually just cases of errors
in the input Archives.

Then Archive::Child::getName() is changed to return Expected<> and use
the new implementation of ArchiveMemberHeader::getName() .

Also needed to change Archive::getMemoryBufferRef() with these
changes to return Expected<> as well to propagate Errors up.
As well as changing Archive::isThinMember() to return Expected<> .

llvm-svn: 277177

8 years agoCodeGen: improve MachineInstrBuilder & MachineIRBuilder interface
Tim Northover [Fri, 29 Jul 2016 17:43:52 +0000 (17:43 +0000)]
CodeGen: improve MachineInstrBuilder & MachineIRBuilder interface

For MachineInstrBuilder, having to manually use RegState::Define is ugly and
makes register definitions clunkier than they need to be, so this adds two
convenience functions: addDef and addUse.

For MachineIRBuilder, we want to avoid BuildMI's first-reg-is-def rule because
it's hidden away and causes bugs. So this patch switches buildInstr to
returning a MachineInstrBuilder and adding *all* operands via addDef/addUse.

NFC.

llvm-svn: 277176

8 years agoReapply r277058: "[ObjC] Consider availability of context when emitting availability...
Erik Pilkington [Fri, 29 Jul 2016 17:37:38 +0000 (17:37 +0000)]
Reapply r277058: "[ObjC] Consider availability of context when emitting availability warnings"

llvm-svn: 277175

8 years agoFix a typo in document.
Haojian Wu [Fri, 29 Jul 2016 17:30:13 +0000 (17:30 +0000)]
Fix a typo in document.

llvm-svn: 277174

8 years ago[AArch64][GlobalISel] Select G_XOR.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:25 +0000 (16:56 +0000)]
[AArch64][GlobalISel] Select G_XOR.

llvm-svn: 277173

8 years ago[GlobalISel] Add G_XOR.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:20 +0000 (16:56 +0000)]
[GlobalISel] Add G_XOR.

llvm-svn: 277172

8 years ago[AArch64][GlobalISel] Select G_LOAD/G_STORE.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:16 +0000 (16:56 +0000)]
[AArch64][GlobalISel] Select G_LOAD/G_STORE.

Mostly straightforward as we ignore addressing modes and just
use the base + unsigned immediate offset (always 0) variants.

This currently fails to select extloads because we have yet to
agree on a representation.

llvm-svn: 277171

8 years ago[GlobalISel] Add LLT raw_ostream operator<< overload.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:12 +0000 (16:56 +0000)]
[GlobalISel] Add LLT raw_ostream operator<< overload.

Helpful when debugging; will be used in the following commit.

llvm-svn: 277170

8 years agoMachinePipeliner pass that implements Swing Modulo Scheduling
Brendon Cahoon [Fri, 29 Jul 2016 16:44:44 +0000 (16:44 +0000)]
MachinePipeliner pass that implements Swing Modulo Scheduling

Software pipelining is an optimization for improving ILP by
overlapping loop iterations. Swing Modulo Scheduling (SMS) is
an implementation of software pipelining that attempts to
reduce register pressure and generate efficient pipelines with
a low compile-time cost.

This implementaion of SMS is a target-independent back-end pass.
When enabled, the pass should run just prior to the register
allocation pass, while the machine IR is in SSA form. If the pass
is successful, then the original loop is replaced by the optimized
loop. The optimized loop contains one or more prolog blocks, the
pipelined kernel, and one or more epilog blocks.

This pass is enabled for Hexagon only. To enable for other targets,
a couple of target specific hooks must be implemented, and the
pass needs to be called from the target's TargetMachine
implementation.

Differential Review: http://reviews.llvm.org/D16829

llvm-svn: 277169

8 years ago[Hexagon] Custom lower VECTOR_SHUFFLE and EXTRACT_SUBVECTOR for HVX
Krzysztof Parzyszek [Fri, 29 Jul 2016 16:44:27 +0000 (16:44 +0000)]
[Hexagon] Custom lower VECTOR_SHUFFLE and EXTRACT_SUBVECTOR for HVX

If the mask of a vector shuffle has alternating odd or even numbers
starting with 1 or 0 respectively up to the largest possible index
for the given type in the given HVX mode (single of double) we can
generate vpacko or vpacke instruction respectively.

E.g.
  %42 = shufflevector <32 x i16> %37, <32 x i16> %41,
                      <32 x i32> <i32 1, i32 3, ..., i32 63>
  is %42.h = vpacko(%41.w, %37.w)

Patch by Pranav Bhandarkar.

llvm-svn: 277168

8 years agoInitial vectorization support for svml calls (short vector math library).
Matt Masten [Fri, 29 Jul 2016 16:44:24 +0000 (16:44 +0000)]
Initial vectorization support for svml calls (short vector math library).

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

llvm-svn: 277167

8 years agoInitial support for vectorization using svml (short vector math library).
Matt Masten [Fri, 29 Jul 2016 16:42:44 +0000 (16:42 +0000)]
Initial support for vectorization using svml (short vector math library).

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

llvm-svn: 277166

8 years ago[ELF] - Linkerscript: implemented SIZEOF(section)
George Rimar [Fri, 29 Jul 2016 16:18:47 +0000 (16:18 +0000)]
[ELF] - Linkerscript: implemented SIZEOF(section)

SIZEOF(section)
Return the size in bytes of the named section, if that section has been allocated.

SIZEOF(section) often used in scripts. Few examples from the wild:
https://github.com/chipKIT32/pic32-Arduino-USB-Bootloader-original/blob/master/boot-linkerscript.ld
https://github.com/devkitPro/buildscripts/blob/master/dkarm-eabi/crtls/gba_cart.ld

Patch implements it.

Differential revision: https://reviews.llvm.org/D22915

llvm-svn: 277165

8 years ago[GlobalISel] Auto-brief LowLevelType. NFC.
Ahmed Bougacha [Fri, 29 Jul 2016 16:11:06 +0000 (16:11 +0000)]
[GlobalISel] Auto-brief LowLevelType. NFC.

llvm-svn: 277163

8 years ago[GlobalISel] Add LLT::operator!=().
Ahmed Bougacha [Fri, 29 Jul 2016 16:11:04 +0000 (16:11 +0000)]
[GlobalISel] Add LLT::operator!=().

llvm-svn: 277162

8 years ago[GlobalISel] Fix LLT::unsized to match LLT(LabelTy).
Ahmed Bougacha [Fri, 29 Jul 2016 16:11:02 +0000 (16:11 +0000)]
[GlobalISel] Fix LLT::unsized to match LLT(LabelTy).

When coming from an IR label type, we set a 0 NumElements, but not
when constructing an LLT using unsized(), causing comparisons to fail.

Pick one variant and fix the other.

llvm-svn: 277161

8 years ago[GlobalISel] Add unittests for LowLevelType.
Ahmed Bougacha [Fri, 29 Jul 2016 16:10:57 +0000 (16:10 +0000)]
[GlobalISel] Add unittests for LowLevelType.

llvm-svn: 277160

8 years agoRemove dead declaration.
Rui Ueyama [Fri, 29 Jul 2016 16:08:04 +0000 (16:08 +0000)]
Remove dead declaration.

llvm-svn: 277159

8 years agoReinstate optnone test for GVN Hoisting, removed in r276479.
Paul Robinson [Fri, 29 Jul 2016 16:05:50 +0000 (16:05 +0000)]
Reinstate optnone test for GVN Hoisting, removed in r276479.

llvm-svn: 277158

8 years agoRevert "updated Xcode project r277139"
Todd Fiala [Fri, 29 Jul 2016 16:00:25 +0000 (16:00 +0000)]
Revert "updated Xcode project r277139"

This undoes my last commit.  It collided with Pavel undoing
his change that my previous commit was adjusting for in the
Xcode file.

This reverts commit f6f29cb7d7c56f96f21d9c115ecc66d652639df3.

llvm-svn: 277157

8 years agoupdated Xcode project r277139
Todd Fiala [Fri, 29 Jul 2016 15:51:43 +0000 (15:51 +0000)]
updated Xcode project r277139

llvm-svn: 277156

8 years ago[ASTMatcher] Add templateName matcher.
Haojian Wu [Fri, 29 Jul 2016 15:45:11 +0000 (15:45 +0000)]
[ASTMatcher] Add templateName matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 277155

8 years agoRevert "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"
Pavel Labath [Fri, 29 Jul 2016 15:41:52 +0000 (15:41 +0000)]
Revert "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"

This reverts commit r277139, because:
- broken unittest on windows (likely typo on my part)
- seems to break TestCallThatRestart (needs investigation)

llvm-svn: 277154

8 years ago[ELF] - Linkerscript: Implemented SORT command.
George Rimar [Fri, 29 Jul 2016 15:32:46 +0000 (15:32 +0000)]
[ELF] - Linkerscript: Implemented SORT command.

When the SORT keyword is used, the linker will sort the files or sections into ascending order by name before placing them in the output file.
It is used in FreeBSD script:
https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l139

This is PR28689.

Differential revision: https://reviews.llvm.org/D22749

llvm-svn: 277153

8 years agoRemove inline-comment-2.ll until I can debug why it fails on some builds
Nirav Dave [Fri, 29 Jul 2016 15:24:06 +0000 (15:24 +0000)]
Remove inline-comment-2.ll until I can debug why it fails on some builds

llvm-svn: 277152

8 years ago[Hexagon] Improve balancing of address calculation
Krzysztof Parzyszek [Fri, 29 Jul 2016 15:15:35 +0000 (15:15 +0000)]
[Hexagon] Improve balancing of address calculation

Rebalances address calculation trees and applies Hexagon-specific
optimizations to the trees to improve instruction selection.

Patch by Tobias Edler von Koch.

llvm-svn: 277151

8 years ago[ELF] - Linkerscript: make addSection() global function instead lambda. NFC.
George Rimar [Fri, 29 Jul 2016 15:12:48 +0000 (15:12 +0000)]
[ELF] - Linkerscript: make addSection() global function instead lambda. NFC.

llvm-svn: 277150

8 years agoFix inline-comment-2.ll triple
Nirav Dave [Fri, 29 Jul 2016 15:12:00 +0000 (15:12 +0000)]
Fix inline-comment-2.ll triple

llvm-svn: 277149

8 years agoAvoid unnecessary 32-bit to 64-bit zero extensions following
David L Kreitzer [Fri, 29 Jul 2016 15:09:54 +0000 (15:09 +0000)]
Avoid unnecessary 32-bit to 64-bit zero extensions following
32-bit CMOV instructions on x86_64. The 32-bit CMOV implicitly
zero extends.

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

llvm-svn: 277148

8 years ago[ELF] - Update comment. NFC.
George Rimar [Fri, 29 Jul 2016 15:07:11 +0000 (15:07 +0000)]
[ELF] - Update comment. NFC.

llvm-svn: 277147

8 years ago[MC] When emitting output hash comments always use standard line comment seperator
Nirav Dave [Fri, 29 Jul 2016 14:42:00 +0000 (14:42 +0000)]
[MC] When emitting output hash comments always use standard line comment seperator

llvm-svn: 277146

8 years agoFix license information in the file header
Krzysztof Parzyszek [Fri, 29 Jul 2016 14:04:17 +0000 (14:04 +0000)]
Fix license information in the file header

llvm-svn: 277145

8 years agoAdd missing files to r277143
Krzysztof Parzyszek [Fri, 29 Jul 2016 13:59:55 +0000 (13:59 +0000)]
Add missing files to r277143

llvm-svn: 277144

8 years ago[Hexagon] Implement DFA based hazard recognizer
Krzysztof Parzyszek [Fri, 29 Jul 2016 13:59:09 +0000 (13:59 +0000)]
[Hexagon] Implement DFA based hazard recognizer

The post register allocator scheduler can generate poor schedules
because the scoreboard hazard recognizer is unable to identify
hazards for Hexagon precisely. Instead, Hexagon should use a DFA
based hazard recognizer.

Patch by Brendon Cahoon.

llvm-svn: 277143

8 years ago[ASTMatcher] Add hasTemplateArgument/hasAnyTemplateArgument support in functionDecl.
Haojian Wu [Fri, 29 Jul 2016 13:57:27 +0000 (13:57 +0000)]
[ASTMatcher] Add hasTemplateArgument/hasAnyTemplateArgument support in functionDecl.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 277142

8 years agoAdd missing '-no-canonical-prefixes' in test.
Daniel Jasper [Fri, 29 Jul 2016 13:45:03 +0000 (13:45 +0000)]
Add missing '-no-canonical-prefixes' in test.

llvm-svn: 277141

8 years agoAdd/fix support for i386 elf core files
Dimitar Vlahovski [Fri, 29 Jul 2016 13:18:09 +0000 (13:18 +0000)]
Add/fix support for i386 elf core files

Summary:
There were places in the code, assuming(hardcoding) offsets
and types that were only valid for the x86_64 elf core file format.

The NT_PRSTATUS and NT_PRPSINFO structures are with the 64 bit layout.
I have reused them and parse i386 files manually, and fill them in the
same struct.

Also added some error handling during parsing that checks if the
available bytes in the buffer are enough to fill the structures.

The i386 core file test case now passes.

For reference on the structures layout, I generally used the
source of binutils (bfd, readelf)

Bug: https://llvm.org/bugs/show_bug.cgi?id=26947

Reviewers: labath

Subscribers: lldb-commits

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

llvm-svn: 277140

8 years agoRewrite gdb-remote's SendContinuePacketAndWaitForResponse
Pavel Labath [Fri, 29 Jul 2016 13:10:02 +0000 (13:10 +0000)]
Rewrite gdb-remote's SendContinuePacketAndWaitForResponse

SendContinuePacketAndWaitForResponse was huge function with very complex interactions with
several other functions (SendAsyncSignal, SendInterrupt, SendPacket). This meant that making any
changes to how packet sending functions and threads interact was very difficult and error-prone.

This change does not add any functionality yet, it merely paves the way for future changes. In a
follow-up, I plan to add the ability to have multiple query packets in flight (i.e.,
request,request,response,response instead of the usual request,response sequences) and use that
to speed up qModuleInfo packet processing.

Here, I introduce two special kinds of locks: ContinueLock, which is used by the continue thread,
and Lock, which is used by everyone else. ContinueLock (atomically) sends a continue packet, and
blocks any other async threads from accessing the connection. Other threads create an instance of
the Lock object when they want to access the connection. This object, while in scope prevents the
continue from being send. Optionally, it can also interrupt the process to gain access to the
connection for async processing.

Most of the syncrhonization logic is encapsulated within these two classes. Some of it still
had to bleed over into the SendContinuePacketAndWaitForResponse, but the function is still much
more manageable than before -- partly because of most of the work is done in the ContinueLock
class, and partly because I have factored out a lot of the packet processing code separate
functions (this also makes the functionality more easily testable). Most importantly, there is
none of syncrhonization code in the async thread users -- as far as they are concerned, they just
need to declare a Lock object, and they are good to go (SendPacketAndWaitForResponse is now a
very thin wrapper around the NoLock version of the function, whereas previously it had over 100
lines of synchronization code).  This will make my follow up changes there easy.

I have written a number of unit tests for the new code and I have ran the test suite on linux and
osx with no regressions.

Subscribers: tberghammer

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

llvm-svn: 277139

8 years agoMake test not fail on hosts where the default omp library is gomp.
Benjamin Kramer [Fri, 29 Jul 2016 13:07:09 +0000 (13:07 +0000)]
Make test not fail on hosts where the default omp library is gomp.

This is the case on some linuxes, just force libomp so we get the
desired results.

llvm-svn: 277138

8 years agotsan: Enable 48-bit VMA support on aarch64
Adhemerval Zanella [Fri, 29 Jul 2016 12:45:35 +0000 (12:45 +0000)]
tsan: Enable 48-bit VMA support on aarch64

This patch adds 48-bits VMA support for tsan on aarch64.  As current
mappings for aarch64, 48-bit VMA also supports PIE executable.  This
limits the mapping mechanism because the PIE address bits
(usually 0aaaaXXXXXXXX) makes it harder to create a mask/xor value
to include all memory regions.  I think it is possible to create a
large application VAM range by either dropping PIE support or tune
current range.

It also changes slight the way addresses are packed in SyncVar structure:
previously it assumes x86_64 as the maximum VMA range.  Since ID is 14 bits
wide, shifting 48 bits should be ok.

Tested on x86_64, ppc64le and aarch64 (39 and 48 bits VMA).

llvm-svn: 277137

8 years agoRe-commit: [mips][fastisel] Handle 0-4 arguments without SelectionDAG.
Daniel Sanders [Fri, 29 Jul 2016 12:27:28 +0000 (12:27 +0000)]
Re-commit: [mips][fastisel] Handle 0-4 arguments without SelectionDAG.

Summary:
Implements fastLowerArguments() to avoid the need to fall back on
SelectionDAG for 0-4 argument functions that don't do tricky things like
passing double in a pair of i32's.

This allows us to move all except one test to -fast-isel-abort=3. The
remaining one has function prototypes of the form 'i32 (i32, double, double)'
which requires floats to be passed in GPR's.

The previous commit had an uninitialized variable that caused the incoming
argument region to have undefined size. This has been fixed.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

llvm-svn: 277136

8 years agoCleanup TransferDbgValues
Nirav Dave [Fri, 29 Jul 2016 11:49:32 +0000 (11:49 +0000)]
Cleanup TransferDbgValues

[DAG] Check debug values for invalidation before transferring and mark
old debug values invalid when transferring to another SDValue.

This fixes PR28613.

Reviewers: jyknight, hans, dblaikie, echristo

Subscribers: yaron.keren, ismail, llvm-commits

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

llvm-svn: 277135

8 years ago[GCC] Support for __final specifier
Andrey Bokhanko [Fri, 29 Jul 2016 10:42:48 +0000 (10:42 +0000)]
[GCC] Support for __final specifier

As reported in bug 28473, GCC supports "final" functionality in pre-C++11 code using the __final keyword. Clang currently supports the "final" keyword in accordance with the C++11 specification, however it ALSO supports it in pre-C++11 mode, with a warning.

This patch adds the "__final" keyword for compatibility with GCC in GCC Keywords mode (so it is enabled with existing flags), and issues a warning on its usage (suggesting switching to the C++11 keyword). This patch also adds a regression test for the functionality described. I believe this patch has minimal impact, as it simply adds a new keyword for existing behavior.

This has been validated with check-clang to avoid regressions. Patch is created in reference to revisions 276665.

Patch by Erich Keane.

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

llvm-svn: 277134

8 years agoFixup r277011 - wrong use of infinite timeout
Pavel Labath [Fri, 29 Jul 2016 10:34:52 +0000 (10:34 +0000)]
Fixup r277011 - wrong use of infinite timeout

The commit accidentally switched a timed wait on a condition variable into an infinite timeout.
Change that back. Android tests were timeing out without this.

llvm-svn: 277133

8 years ago[X86][SSE] Optimize the truncation of vector comparison results with PACKSS
Simon Pilgrim [Fri, 29 Jul 2016 10:23:10 +0000 (10:23 +0000)]
[X86][SSE] Optimize the truncation of vector comparison results with PACKSS

We currently default to using either generic shuffles or MASK+PACKUS/PACKSS to truncate all integer vectors. For vector comparisons, we know that the result will be either all or zero bits in every element, which can be efficiently truncated by directly using PACKSS to repeatedly halve the size of each element.

Due to the limited input values (-1 or 0) we don't need to account for vector element size, so for simplicity we just use the PACKSS(vXi16,vXi16) implementation in all cases. Additionally for AVX2 PACKSS of 256bit data we must perform a PERMQ shuffle to reorder the data into the correct order. I did investigate performing a single shuffle after all the PACKSS calls but the need to cross 128bit lanes makes this difficult to achieve efficiently.

We avoid performing this on AVX512 as it should have better alternative truncation instructions.

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

llvm-svn: 277132

8 years ago[clang-rename] speedup RenamingAction
Kirill Bobyrev [Fri, 29 Jul 2016 10:16:45 +0000 (10:16 +0000)]
[clang-rename] speedup RenamingAction

The complexity of renaming a USR is O(N) [N stands for number of nodes in
Translation Unit]. In some cases there are more than one USR for a single symbol
(see overridden functions and ctor/dtor handling), which means that the
complexity of finding all of the corresponding USRs is O(N * M) [M stands for
number of USRs corresponding to the symbols, which may be not quite small]. With
a simple tweak we can make it O(N * log(M)) by passing whole list of USRs
corresponding to the symbol to USRLocFinder.

llvm-svn: 277131

8 years agoFixed MSVC out of range shift warning
Simon Pilgrim [Fri, 29 Jul 2016 10:03:39 +0000 (10:03 +0000)]
Fixed MSVC out of range shift warning

llvm-svn: 277130

8 years agoFix for commit rL277126 that broke a build.
Sjoerd Meijer [Fri, 29 Jul 2016 09:57:37 +0000 (09:57 +0000)]
Fix for commit rL277126 that broke a build.

llvm-svn: 277129

8 years ago[Thumb] Emit Thumb move in both Thumb modes for struct_byval predicates
Prakhar Bahuguna [Fri, 29 Jul 2016 09:16:46 +0000 (09:16 +0000)]
[Thumb] Emit Thumb move in both Thumb modes for struct_byval predicates

Summary:
The MOV/MOVT instructions being chosen for struct_byval predicates was
conditional only on Thumb2, resulting in an ARM MOV/MOVT instruction
being incorrectly emitted in Thumb1 mode. This is especially apparent
with v8-m.base targets. This patch ensures that Thumb instructions are
emitted in both Thumb modes.

Reviewers: rengolin, t.p.northover

Subscribers: llvm-commits, aemerson, rengolin

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

llvm-svn: 277128

8 years ago[lanai] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change
Jacques Pienaar [Fri, 29 Jul 2016 08:50:23 +0000 (08:50 +0000)]
[lanai] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change

llvm-svn: 277127

8 years agoTargetInstrInfo: add virtual function getInstSizeInBytes
Sjoerd Meijer [Fri, 29 Jul 2016 08:16:16 +0000 (08:16 +0000)]
TargetInstrInfo: add virtual function getInstSizeInBytes

This adds a target hook getInstSizeInBytes to TargetInstrInfo that a lot of
subclasses already implement.

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

llvm-svn: 277126

8 years agoImprove code of loading plugins that provide cmnds
Abhishek Aggarwal [Fri, 29 Jul 2016 07:46:32 +0000 (07:46 +0000)]
Improve code of loading plugins that provide cmnds

Summary:
 - Modified code that enables writing new user-defined commands
   and use them through LLDB CLI. Modifications are:

  -- Define the 'syntax' for each user-defined command
    --- Added an argument in SBCommandInterpreter::AddCommand()
        and SBCommand::AddCommand() API
    --- Allow passing syntax for each user-defined command
    --- Earlier, only 'help' could be defined and passed for commands

  -- Passed 'number of arguments' entered on CLI for user-defined commands
    --- Added an argument (number of options) in SBCommandPluginInterface::DoExecute()
        API to know the number of arguments passed for commands

  -- In CommandPluginInterfaceImplementation class:
    --- Make the data member m_backend a shared_ptr
    --- Avoids memory leaks of dynamically allocated SBCommandPluginInterface instances
        created in lldb::PluginInitialize() API

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
Reviewers: jingham, granata.enrico, clayborg

Subscribers: labath, lldb-commits

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

llvm-svn: 277125

8 years ago[compiler-rt][XRay] Address follow-up comments to initial interface and initialisatio...
Dean Michael Berris [Fri, 29 Jul 2016 07:11:58 +0000 (07:11 +0000)]
[compiler-rt][XRay] Address follow-up comments to initial interface and initialisation code

This addresses some comments from D21612, which contains the following changes:

- Update __xray_patch() and __xray_unpatch() API documentation to not imply asynchrony.
- Introduce a scope cleanup mechanism to make sure we can roll-back changes to the XRayPatching global atomic.
- Introduce a few more comments for potential extension points for other platforms (for the implementation details of patching and un-patching).

Reviewers: eugenis, rnk, kcc, echristo, majnemer

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 277124

8 years agoPlatformDarwinKernel maintains a list of kexts and kernels
Jason Molenda [Fri, 29 Jul 2016 06:24:03 +0000 (06:24 +0000)]
PlatformDarwinKernel maintains a list of kexts and kernels
that it finds on the local computer in "well known" locations
when we start up the darwin-kernel platform.  It did not
distinguish between kexts/kernels with dSYMs from others -
when it needed a kernel/kext with a given UUID, it would grab
the first one it finds.

This change separates these into two vectors -- a collection
of kexts and kernels with dSYMs next t othem, and a collection
of kexts and kernels without dSYMs.  When we have a bundle ID
and uuid to search for, we first try the collections with
dSYMs, and if that fails, then we try the collections that
did not have dSYMs next to them.

Often times we'll have a situation where a kext will be
installed in multiple locations on a system, but only one
of them will have a dSYM next to it, where the dev just copied
it to a local directory.  This fixes that problem, giving
precedence to those binaries with debug information.

llvm-svn: 277123

8 years agoRemove `continue` at end of a for-loop.
Rui Ueyama [Fri, 29 Jul 2016 06:21:06 +0000 (06:21 +0000)]
Remove `continue` at end of a for-loop.

llvm-svn: 277122

8 years agoSplit readOutputSectionDescription.
Rui Ueyama [Fri, 29 Jul 2016 06:14:07 +0000 (06:14 +0000)]
Split readOutputSectionDescription.

llvm-svn: 277121

8 years ago[AVX512] Mark EVEX VMOVSSrm and VMOVSDrm as canFoldAsLoad and isReMaterializable.
Craig Topper [Fri, 29 Jul 2016 06:06:04 +0000 (06:06 +0000)]
[AVX512] Mark EVEX VMOVSSrm and VMOVSDrm as canFoldAsLoad and isReMaterializable.

llvm-svn: 277120