platform/upstream/llvm.git
7 years ago[X86] Add SSE, AVX, and AVX2 version of MOVDQU to the load/store folding tables for...
Craig Topper [Sat, 26 Nov 2016 02:13:58 +0000 (02:13 +0000)]
[X86] Add SSE, AVX, and AVX2 version of MOVDQU to the load/store folding tables for consistency.

Not sure this is truly needed but we had the floating point equivalents, the aligned equivalents, and the EVEX equivalents. So this just makes it complete.

llvm-svn: 287960

7 years ago[asan] Support handle_sigill on Darwin
Kuba Mracek [Sat, 26 Nov 2016 01:30:31 +0000 (01:30 +0000)]
[asan] Support handle_sigill on Darwin

Handling SIGILL on Darwin works fine, so let's just make this feature work and re-enable the ill.cc testcase.

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

llvm-svn: 287959

7 years agoUn-XFAIL an AVR CodeGen test
Dylan McKay [Sat, 26 Nov 2016 01:07:32 +0000 (01:07 +0000)]
Un-XFAIL an AVR CodeGen test

llvm-svn: 287958

7 years ago[asan] Add a "dump_registers" flag to print out CPU registers after a SIGSEGV
Kuba Mracek [Sat, 26 Nov 2016 00:50:08 +0000 (00:50 +0000)]
[asan] Add a "dump_registers" flag to print out CPU registers after a SIGSEGV

This patch prints out all CPU registers after a SIGSEGV. These are available in the signal handler context. Only implemented for Darwin. Can be turned off with the dump_registers flag.

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

llvm-svn: 287957

7 years ago[AVX-512] Put the AVX-512 sections of the load folding tables into mostly alphabetica...
Craig Topper [Fri, 25 Nov 2016 23:21:34 +0000 (23:21 +0000)]
[AVX-512] Put the AVX-512 sections of the load folding tables into mostly alphabetical order. This is consistent with the older sections of the table. NFC

llvm-svn: 287956

7 years agoReplace some callers of setTailCall with setTailCallKind
David Majnemer [Fri, 25 Nov 2016 22:35:09 +0000 (22:35 +0000)]
Replace some callers of setTailCall with setTailCallKind

We were a little sloppy with adding tailcall markers.  Be more
consistent by using setTailCallKind instead of setTailCall.

llvm-svn: 287955

7 years ago[SimplifyCFG] auto-generate better checks; NFC
Sanjay Patel [Fri, 25 Nov 2016 21:12:39 +0000 (21:12 +0000)]
[SimplifyCFG] auto-generate better checks; NFC

llvm-svn: 287954

7 years ago[SimplifyCFG] auto-generate better checks; NFC
Sanjay Patel [Fri, 25 Nov 2016 21:07:13 +0000 (21:07 +0000)]
[SimplifyCFG] auto-generate better checks; NFC

llvm-svn: 287953

7 years agoFix buildbots.
Rui Ueyama [Fri, 25 Nov 2016 20:42:39 +0000 (20:42 +0000)]
Fix buildbots.

llvm-svn: 287952

7 years agoFix typo.
Rui Ueyama [Fri, 25 Nov 2016 20:41:45 +0000 (20:41 +0000)]
Fix typo.

llvm-svn: 287951

7 years agoDo not print out ARGV0 in white because it's unreadable on white background.
Rui Ueyama [Fri, 25 Nov 2016 20:37:16 +0000 (20:37 +0000)]
Do not print out ARGV0 in white because it's unreadable on white background.

llvm-svn: 287950

7 years agoSupport -color-diagnostics={auto,always,never}.
Rui Ueyama [Fri, 25 Nov 2016 20:27:32 +0000 (20:27 +0000)]
Support -color-diagnostics={auto,always,never}.

-color-diagnostics=auto is default because that's the same as
Clang's default. When color is enabled, error or warning messages
are colored like this.

  error:
  <bold>ld.lld</bold> <red>error:</red> foo.o: no such file

  warning:
  <bold>ld.lld</bold> <magenta>warning:</magenta> foo.o: no such file

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

llvm-svn: 287949

7 years agoWe shouldn't call parallle_for_each if -no-thread is given.
Rui Ueyama [Fri, 25 Nov 2016 20:20:57 +0000 (20:20 +0000)]
We shouldn't call parallle_for_each if -no-thread is given.

llvm-svn: 287948

7 years agoTypo.
Joerg Sonnenberger [Fri, 25 Nov 2016 20:15:57 +0000 (20:15 +0000)]
Typo.

llvm-svn: 287947

7 years agoParallelize uncompress() and splitIntoPieces().
Rui Ueyama [Fri, 25 Nov 2016 20:05:08 +0000 (20:05 +0000)]
Parallelize uncompress() and splitIntoPieces().

Uncompressing section contents and spliting mergeable section contents
into smaller chunks are heavy tasks. They scan entire section contents
and do CPU-intensive tasks such as uncompressing zlib-compressed data
or computing a hash value for each section piece.

Luckily, these tasks are independent to each other, so we can do that
in parallel_for_each. The number of input sections is large (as opposed
to the number of output sections), so there's a large parallelism here.

Actually the current design to call uncompress() and splitIntoPieces()
in batch was chosen with doing this in mind. Basically what we need to
do here is to replace `for` with `parallel_for_each`.

It seems this patch improves latency significantly if linked programs
contain debug info (which in turn contain lots of mergeable strings.)
For example, the latency to link Clang (debug build) improved by 20% on
my machine as shown below. Note that ld.gold took 19.2 seconds to do
the same thing.

Before:
    30801.782712 task-clock (msec)         #    3.652 CPUs utilized            ( +-  2.59% )
         104,084 context-switches          #    0.003 M/sec                    ( +-  1.02% )
           5,063 cpu-migrations            #    0.164 K/sec                    ( +- 13.66% )
       2,528,130 page-faults               #    0.082 M/sec                    ( +-  0.47% )
  85,317,809,130 cycles                    #    2.770 GHz                      ( +-  2.62% )
  67,352,463,373 stalled-cycles-frontend   #   78.94% frontend cycles idle     ( +-  3.06% )
 <not supported> stalled-cycles-backend
  44,295,945,493 instructions              #    0.52  insns per cycle
                                           #    1.52  stalled cycles per insn  ( +-  0.44% )
   8,572,384,877 branches                  #  278.308 M/sec                    ( +-  0.66% )
     141,806,726 branch-misses             #    1.65% of all branches          ( +-  0.13% )

     8.433424003 seconds time elapsed                                          ( +-  1.20% )

After:
    35523.764575 task-clock (msec)         #    5.265 CPUs utilized            ( +-  2.67% )
         159,107 context-switches          #    0.004 M/sec                    ( +-  0.48% )
           8,123 cpu-migrations            #    0.229 K/sec                    ( +- 23.34% )
       2,372,483 page-faults               #    0.067 M/sec                    ( +-  0.36% )
  98,395,342,152 cycles                    #    2.770 GHz                      ( +-  2.62% )
  79,294,670,125 stalled-cycles-frontend   #   80.59% frontend cycles idle     ( +-  3.03% )
 <not supported> stalled-cycles-backend
  46,274,151,813 instructions              #    0.47  insns per cycle
                                           #    1.71  stalled cycles per insn  ( +-  0.47% )
   8,987,621,670 branches                  #  253.003 M/sec                    ( +-  0.60% )
     148,900,624 branch-misses             #    1.66% of all branches          ( +-  0.27% )

     6.747548004 seconds time elapsed                                          ( +-  0.40% )

llvm-svn: 287946

7 years agoMove typedefs inside a class definition.
Rui Ueyama [Fri, 25 Nov 2016 18:51:56 +0000 (18:51 +0000)]
Move typedefs inside a class definition.

llvm-svn: 287945

7 years agoRemove a parameter from ScriptParser.
Rui Ueyama [Fri, 25 Nov 2016 18:51:54 +0000 (18:51 +0000)]
Remove a parameter from ScriptParser.

llvm-svn: 287944

7 years agoMove getLocation from Relocations.cpp to InputSection.cpp.
Rui Ueyama [Fri, 25 Nov 2016 18:51:53 +0000 (18:51 +0000)]
Move getLocation from Relocations.cpp to InputSection.cpp.

The function was used only within Relocations.cpp, but now we are
using it in many places, so this patch moves it to a file that fits
to the functionality.

llvm-svn: 287943

7 years agoAMDGPU/SI: Add back reverted SGPR spilling code, but disable it
Marek Olsak [Fri, 25 Nov 2016 17:37:09 +0000 (17:37 +0000)]
AMDGPU/SI: Add back reverted SGPR spilling code, but disable it

suggested as a better solution by Matt

llvm-svn: 287942

7 years agoUse SDValue helpers instead of explicitly going via SDValue::getNode(). NFCI
Simon Pilgrim [Fri, 25 Nov 2016 17:25:21 +0000 (17:25 +0000)]
Use SDValue helpers instead of explicitly going via SDValue::getNode(). NFCI

llvm-svn: 287941

7 years agoUse SDValue helper instead of explicitly going via SDValue::getNode(). NFCI
Simon Pilgrim [Fri, 25 Nov 2016 17:19:53 +0000 (17:19 +0000)]
Use SDValue helper instead of explicitly going via SDValue::getNode(). NFCI

llvm-svn: 287940

7 years ago[AVX-512] Add support for changing VSHUFF64x2 to VSHUFF32x4 when its feeding a vselec...
Craig Topper [Fri, 25 Nov 2016 16:48:05 +0000 (16:48 +0000)]
[AVX-512] Add support for changing VSHUFF64x2 to VSHUFF32x4 when its feeding a vselect with 32-bit element size.

Summary:
Shuffle lowering may have widened the element size of a i32 shuffle to i64 before selecting X86ISD::SHUF128. If this shuffle was used by a vselect this can prevent us from selecting masked operations.

This patch detects this and changes the element size to match the vselect.

I don't handle changing integer to floating point or vice versa as its not clear if its better to push such a bitcast to the inputs of the shuffle or to the user of the vselect. So I'm ignoring that case for now.

Reviewers: delena, zvi, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 287939

7 years ago[ELF] Add explicit template instantiations for toString
Eugene Leviant [Fri, 25 Nov 2016 16:42:04 +0000 (16:42 +0000)]
[ELF] Add explicit template instantiations for toString

llvm-svn: 287938

7 years ago[AVX-512] Add VPERMT2* and VPERMI2* instructions to load folding tables.
Craig Topper [Fri, 25 Nov 2016 16:33:53 +0000 (16:33 +0000)]
[AVX-512] Add VPERMT2* and VPERMI2* instructions to load folding tables.

llvm-svn: 287937

7 years agoRevert "AMDGPU: Implement SGPR spilling with scalar stores"
Marek Olsak [Fri, 25 Nov 2016 16:03:34 +0000 (16:03 +0000)]
Revert "AMDGPU: Implement SGPR spilling with scalar stores"

This reverts commit 4404d0d6e354e80dd7f8f0a0e12d8ad809cf007e.

llvm-svn: 287936

7 years agoRevert "AMDGPU: Fix MMO when splitting spill"
Marek Olsak [Fri, 25 Nov 2016 16:03:27 +0000 (16:03 +0000)]
Revert "AMDGPU: Fix MMO when splitting spill"

This reverts commit 79d4f8b8b1ce430c3d5dac4fc72a9eebaed24fe1.

llvm-svn: 287935

7 years agoRevert "AMDGPU: Fix adding extra implicit def of register"
Marek Olsak [Fri, 25 Nov 2016 16:03:22 +0000 (16:03 +0000)]
Revert "AMDGPU: Fix adding extra implicit def of register"

This reverts commit e834ce5976567575621901fb967b8018b9916d71.

llvm-svn: 287934

7 years agoRevert "AMDGPU: Fix not setting kill flag on temp reg when spilling"
Marek Olsak [Fri, 25 Nov 2016 16:03:19 +0000 (16:03 +0000)]
Revert "AMDGPU: Fix not setting kill flag on temp reg when spilling"

This reverts commit 057bbbe4ae170247ba37f08f2e70ef185267d1bb.

llvm-svn: 287933

7 years agoRevert "AMDGPU: Make m0 unallocatable"
Marek Olsak [Fri, 25 Nov 2016 16:03:15 +0000 (16:03 +0000)]
Revert "AMDGPU: Make m0 unallocatable"

This reverts commit 124ad83dae04514f943902446520c859adee0e96.

llvm-svn: 287932

7 years agoRevert "AMDGPU: Remove m0 spilling code"
Marek Olsak [Fri, 25 Nov 2016 16:03:06 +0000 (16:03 +0000)]
Revert "AMDGPU: Remove m0 spilling code"

This reverts commit f18de36554eb22416f8ba58e094e0272523a4301.

llvm-svn: 287931

7 years agoRevert "AMDGPU: Preserve m0 value when spilling"
Marek Olsak [Fri, 25 Nov 2016 16:03:02 +0000 (16:03 +0000)]
Revert "AMDGPU: Preserve m0 value when spilling"

This reverts commit a5a179ffd94fd4136df461ec76fb30f04afa87ce.

llvm-svn: 287930

7 years agoDo not do raw name replacement when FromDecl is a class forward-declaration.
Eric Liu [Fri, 25 Nov 2016 16:02:49 +0000 (16:02 +0000)]
Do not do raw name replacement when FromDecl is a class forward-declaration.

Summary:
If the `FromDecl` is a class forward declaration, the reference is
still considered as referring to the original definition given the nature
of forward-declarations, so we can't do a raw name replacement in this case.

Reviewers: bkramer

Subscribers: cfe-commits, klimek

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

llvm-svn: 287929

7 years ago[X86][SSE] Added knownbits through bitcast test
Simon Pilgrim [Fri, 25 Nov 2016 15:07:15 +0000 (15:07 +0000)]
[X86][SSE] Added knownbits through bitcast test

llvm-svn: 287928

7 years agoFix builds Windows and OSX builds after Connection refactor in r287922
Pavel Labath [Fri, 25 Nov 2016 14:43:37 +0000 (14:43 +0000)]
Fix builds Windows and OSX builds after Connection refactor in r287922

Switch various bits of platform-specific code to chrono that I did not notice
when doing a linux build. This exposed a bug that ConnectionGenericFileWindows
did not handle the magic UINT32_MAX timeout value (instead it waited for about an
hour, which is close enough I guess). Fix that as well.

llvm-svn: 287927

7 years agoDocument the arguments form of commands.
Joerg Sonnenberger [Fri, 25 Nov 2016 14:14:43 +0000 (14:14 +0000)]
Document the arguments form of commands.

llvm-svn: 287926

7 years ago[Loop Unswitch] Patch to selective unswitch only the reachable branch instructions.
Abhilash Bhandari [Fri, 25 Nov 2016 14:07:44 +0000 (14:07 +0000)]
[Loop Unswitch] Patch to selective unswitch only the reachable branch instructions.

Summary:
The iterative algorithm for Loop Unswitching may render some of the branches unreachable in the unswitched loops.
Given the exponential nature of the algorithm, this is quite an overhead.
This patch fixes this problem by selectively unswitching only those branches within a loop that are reachable from the loop header.

Reviewers: Michael Zolothukin, Anna Thomas, Weiming Zhao.
Subscribers: llvm-commits.

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

llvm-svn: 287925

7 years agoConsider nested namespaces in the canonical namespace as canonical as well.
Eric Liu [Fri, 25 Nov 2016 12:39:03 +0000 (12:39 +0000)]
Consider nested namespaces in the canonical namespace as canonical as well.

Summary:
For example, this case was missed when looking for different but canonical
namespaces. UseContext in this case should be considered as in the canonical
namespace.
```
namespace a { namespace b { <FromContext> } }
namespace a { namespace b { namespace c { <UseContext> } } }
```
Added some commenting.

Reviewers: bkramer

Subscribers: klimek, cfe-commits

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

llvm-svn: 287924

7 years agoFix darwin build broken by r287920
Pavel Labath [Fri, 25 Nov 2016 12:37:49 +0000 (12:37 +0000)]
Fix darwin build broken by r287920

I accidentally used the wrong brackets when including llvm headers.

llvm-svn: 287923

7 years agoIntroduce Chrono to the Connection class. NFCI.
Pavel Labath [Fri, 25 Nov 2016 12:22:32 +0000 (12:22 +0000)]
Introduce Chrono to the Connection class. NFCI.

llvm-svn: 287922

7 years agoFix FreeBSD build error in r287920
Pavel Labath [Fri, 25 Nov 2016 12:15:17 +0000 (12:15 +0000)]
Fix FreeBSD build error in r287920

The conditional expression is ambiguous there, so help it by explicitly casting.
This will go away once we use chrono all the way down.

llvm-svn: 287921

7 years agoIntroduce chrono to the Communication class
Pavel Labath [Fri, 25 Nov 2016 11:58:44 +0000 (11:58 +0000)]
Introduce chrono to the Communication class

This replaces the raw integer timeout parameters in the class with their
chrono-based equivalents.  To achieve this, I have moved the Timeout class to a
more generic place and added a quick unit test for it.

llvm-svn: 287920

7 years ago[X86][SSE] Added v16i8 shuffle test case from PR31151
Simon Pilgrim [Fri, 25 Nov 2016 11:10:43 +0000 (11:10 +0000)]
[X86][SSE] Added v16i8 shuffle test case from PR31151

llvm-svn: 287919

7 years ago[mips] Correct jal expansion for local symbols in .local directives.
Simon Dardis [Fri, 25 Nov 2016 11:06:43 +0000 (11:06 +0000)]
[mips] Correct jal expansion for local symbols in .local directives.

This patch corrects the behaviour of code such as:

   .local foo
   jal foo
foo:
to use the correct jal expansion when writing ELF files.

Patch by: Daniel Sanders

Reviewers: zoran.jovanovic, seanbruno, vkalintiris

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

llvm-svn: 287918

7 years agoUse Clang for D language support.
Johan Engelen [Fri, 25 Nov 2016 11:01:12 +0000 (11:01 +0000)]
Use Clang for D language support.

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

llvm-svn: 287917

7 years agoMerge Linux and FreeBSD arm64 register contexts
Pavel Labath [Fri, 25 Nov 2016 10:28:09 +0000 (10:28 +0000)]
Merge Linux and FreeBSD arm64 register contexts

Summary:
This is a test-the-water change about possibilities of reducing duplication in
the register context definitions.

I've named the new class RegisterInfoPOSIX, as RegisterContextPOSIX was already
taken :(.  The two files were identical except for a fix by Tamas in D12636,
which was applied to the Linux version only, which fixed a discrepancy between
the definitions of fpsr and fpcr on one hand, and all other floating point
register definitions on the other.

Linux test suite still passes after this change. For freebsd, make the floating
point register behavior consistent, but I don't know whether it will be
consistently fixed, or consistently broken. By eyeballing the code, I have a
feeling that a similar fix to D12636 will be required in
RegisterContextPOSIXProcessMonitor_arm64::ReadRegister, but I can't be sure as I
have no way to test it (the assert in that function should fire upon accessing
the registers if it is wrong though).

Reviewers: emaste, clayborg

Subscribers: aemerson, rengolin, beanz, mgorny, modocache, dmikulin, lldb-commits

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

llvm-svn: 287916

7 years ago[ELF] Refactor getDynRel to print error location
Eugene Leviant [Fri, 25 Nov 2016 08:56:36 +0000 (08:56 +0000)]
[ELF] Refactor getDynRel to print error location

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

llvm-svn: 287915

7 years ago[ELF] EhOutputSection improvements
Eugene Leviant [Fri, 25 Nov 2016 08:27:15 +0000 (08:27 +0000)]
[ELF] EhOutputSection improvements

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

llvm-svn: 287914

7 years ago[ELF] - Add support for access to most of synthetic sections from linkerscript.
George Rimar [Fri, 25 Nov 2016 08:05:41 +0000 (08:05 +0000)]
[ELF] - Add support for access to most of synthetic sections from linkerscript.

This is important for cases like:

  .sdata        : {
    *(.got.plt .got)
...
  }

That was not supported before as there was no way to get access to
synthetic sections from script.

More details on review page.

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

llvm-svn: 287913

7 years agoRevert "[XRay][compiler-rt] XRay Buffer Queue"
Dean Michael Berris [Fri, 25 Nov 2016 03:54:45 +0000 (03:54 +0000)]
Revert "[XRay][compiler-rt] XRay Buffer Queue"

Broke the build on arm7 and aarch64.

llvm-svn: 287911

7 years ago[XRay][compiler-rt] XRay Buffer Queue
Dean Michael Berris [Fri, 25 Nov 2016 03:14:10 +0000 (03:14 +0000)]
[XRay][compiler-rt] XRay Buffer Queue

Summary:
This implements a simple buffer queue to manage a pre-allocated queue of
fixed-sized buffers to hold XRay records. We need this to support
Flight Data Recorder (FDR) mode. We also implement this as a sub-library
first to allow for development before actually using it in an
implementation.

Some important properties of the buffer queue:

- Thread-safe enqueueing/dequeueing of fixed-size buffers.
- Pre-allocation of buffers at construction.

Reviewers: majnemer, rSerge, echristo

Subscribers: mehdi_amini, mgorny, llvm-commits

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

llvm-svn: 287910

7 years ago[X86] Invert an 'if' and early out to fix a weird indentation. NFCI
Craig Topper [Fri, 25 Nov 2016 02:29:24 +0000 (02:29 +0000)]
[X86] Invert an 'if' and early out to fix a weird indentation. NFCI

llvm-svn: 287909

7 years ago[X86] Size a SmallVector to the worst case mask size for a 512-bit shuffle. NFCI
Craig Topper [Fri, 25 Nov 2016 02:29:21 +0000 (02:29 +0000)]
[X86] Size a SmallVector to the worst case mask size for a 512-bit shuffle. NFCI

llvm-svn: 287908

7 years agoAdd "compiler-rt", "libcxx" and "libcxxabi" to svn:ignore under projects/
Kuba Mracek [Thu, 24 Nov 2016 22:50:22 +0000 (22:50 +0000)]
Add "compiler-rt", "libcxx" and "libcxxabi" to svn:ignore under projects/

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

llvm-svn: 287905

7 years ago[DAGCombine] Teach DAG combine that if both inputs of a vselect are the same, then...
Craig Topper [Thu, 24 Nov 2016 21:48:52 +0000 (21:48 +0000)]
[DAGCombine] Teach DAG combine that if both inputs of a vselect are the same, then the condition doesn't matter and the vselect can be removed.

Selects with scalar condition already handle this correctly.

llvm-svn: 287904

7 years ago[X86] Modify two tests that passed undef to both sides of a vselect to instead pass...
Craig Topper [Thu, 24 Nov 2016 21:48:50 +0000 (21:48 +0000)]
[X86] Modify two tests that passed undef to both sides of a vselect to instead pass unique values.

I'd like to teach DAG combine to remove vselects where both sides are identical and these tests were in the way of that.

llvm-svn: 287903

7 years ago[tsan] Add support for GCD dispatch_suspend and dispatch_resume
Kuba Mracek [Thu, 24 Nov 2016 21:24:54 +0000 (21:24 +0000)]
[tsan] Add support for GCD dispatch_suspend and dispatch_resume

GCD queues can be suspended and resumed with dispatch_suspend and dispatch_resume. We need to add synchronization between the call to dispatch_resume and any subsequent executions of blocks in the queue that was resumed. We already have an Acquire(q) before the block executes, so this patch just adds the Release(q) in an interceptor of dispatch_resume.

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

llvm-svn: 287902

7 years agoUse toString() to report incompatible files.
Rui Ueyama [Thu, 24 Nov 2016 20:59:44 +0000 (20:59 +0000)]
Use toString() to report incompatible files.

llvm-svn: 287901

7 years agoInclude a hint how to see all errors if error is truncated.
Rui Ueyama [Thu, 24 Nov 2016 20:31:43 +0000 (20:31 +0000)]
Include a hint how to see all errors if error is truncated.

This patch changes the error message from

  too many errors emitted, stopping now

to

  too many errors emitted, stopping now (use -error-limit=0 to see all errors)

Thanks for Sean for the suggestion!

llvm-svn: 287900

7 years agoDefine toString(const SymbolBody &) and remove maybeDemangle instead.
Rui Ueyama [Thu, 24 Nov 2016 20:24:18 +0000 (20:24 +0000)]
Define toString(const SymbolBody &) and remove maybeDemangle instead.

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

llvm-svn: 287899

7 years agoTest commit access.
Serge Rogatch [Thu, 24 Nov 2016 18:51:47 +0000 (18:51 +0000)]
Test commit access.

llvm-svn: 287898

7 years ago[AVX-512] Add tests demonstrating failure to generated masked instructions for VSHUFF...
Craig Topper [Thu, 24 Nov 2016 18:24:46 +0000 (18:24 +0000)]
[AVX-512] Add tests demonstrating failure to generated masked instructions for VSHUFF32x4 and VSHUFI32x4 due to shuffle lowering widening elements.

llvm-svn: 287897

7 years agoAdd a couple of tests for the Listener class
Pavel Labath [Thu, 24 Nov 2016 17:10:10 +0000 (17:10 +0000)]
Add a couple of tests for the Listener class

I'm considering doing some refactor there, so I am adding these to guard the
current behavior.

llvm-svn: 287896

7 years agoUse a more explicit type for the sizeof.
Rafael Espindola [Thu, 24 Nov 2016 16:38:35 +0000 (16:38 +0000)]
Use a more explicit type for the sizeof.

llvm-svn: 287895

7 years ago[CodeGen] Pass objects that are expensive to copy by const ref.
Benjamin Kramer [Thu, 24 Nov 2016 16:01:20 +0000 (16:01 +0000)]
[CodeGen] Pass objects that are expensive to copy by const ref.

No functionality change. Found by clang-tidy's
performance-unnecessary-value-param.

llvm-svn: 287894

7 years agoFix TestMiExec.test_lldbmi_exec_next_instruction
Pavel Labath [Thu, 24 Nov 2016 15:54:15 +0000 (15:54 +0000)]
Fix TestMiExec.test_lldbmi_exec_next_instruction

The line numbers come out slightly differently when the test is run with gcc-4.9
as a compiler. The test probably should not depend on that, but that is a
different story.

llvm-svn: 287893

7 years ago[Format] Avoid copying std::sets and simplify code a bit.
Benjamin Kramer [Thu, 24 Nov 2016 15:42:29 +0000 (15:42 +0000)]
[Format] Avoid copying std::sets and simplify code a bit.

No functional change.

llvm-svn: 287892

7 years agoTest Commit, removing a blank line in CREDITS.TXT
Abhilash Bhandari [Thu, 24 Nov 2016 15:40:19 +0000 (15:40 +0000)]
Test Commit, removing a blank line in CREDITS.TXT

llvm-svn: 287891

7 years ago[Sema] Pass APSInts by const ref, avoiding copies.
Benjamin Kramer [Thu, 24 Nov 2016 15:36:17 +0000 (15:36 +0000)]
[Sema] Pass APSInts by const ref, avoiding copies.

No functionality change intended. Fix by clang-tidy's
performance-unnecessary-value-param check.

llvm-svn: 287890

7 years agoFix unused variable warning
Simon Pilgrim [Thu, 24 Nov 2016 15:24:47 +0000 (15:24 +0000)]
Fix unused variable warning

llvm-svn: 287889

7 years ago[X86] Don't round trip a unique_ptr through a raw pointer for assignment.
Benjamin Kramer [Thu, 24 Nov 2016 15:17:39 +0000 (15:17 +0000)]
[X86] Don't round trip a unique_ptr through a raw pointer for assignment.

No functional change.

llvm-svn: 287888

7 years agoEnable MiExecTestCase-test_lldbmi_exec_next_instruction
Pavel Labath [Thu, 24 Nov 2016 15:16:07 +0000 (15:16 +0000)]
Enable MiExecTestCase-test_lldbmi_exec_next_instruction

Test passes consistently, at least on linux.

llvm-svn: 287887

7 years ago[X86][SSE] Improve UINT_TO_FP v2i32 -> v2f64
Simon Pilgrim [Thu, 24 Nov 2016 15:12:56 +0000 (15:12 +0000)]
[X86][SSE] Improve UINT_TO_FP v2i32 -> v2f64

Vectorize UINT_TO_FP v2i32 -> v2f64 instead of scalarization (albeit still on the SIMD unit).

The codegen matches that generated by legalization (and is in fact used by AVX for UINT_TO_FP v4i32 -> v4f64), but has to be done in the x86 backend to account for legalization via 4i32.

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

llvm-svn: 287886

7 years agoEnable TestMultithreaded-sb_api_listener_event_process_state on linux/gcc
Pavel Labath [Thu, 24 Nov 2016 15:10:15 +0000 (15:10 +0000)]
Enable TestMultithreaded-sb_api_listener_event_process_state on linux/gcc

Passing consistently now.

llvm-svn: 287885

7 years agoEnable TestBitfields on linux with clang
Pavel Labath [Thu, 24 Nov 2016 15:03:31 +0000 (15:03 +0000)]
Enable TestBitfields on linux with clang

The test has been passing for a while now.

llvm-svn: 287884

7 years agoEnable TestRegisterVariables for some configurations
Pavel Labath [Thu, 24 Nov 2016 14:54:53 +0000 (14:54 +0000)]
Enable TestRegisterVariables for some configurations

It consistently passes for linux-clang-i386, and linux-gcc-x86_64.

llvm-svn: 287883

7 years ago[X86][AVX512] Add support for v2i64 fptosi/fptoui/sitofp/uitofp on AVX512DQ-only...
Simon Pilgrim [Thu, 24 Nov 2016 14:46:55 +0000 (14:46 +0000)]
[X86][AVX512] Add support for v2i64 fptosi/fptoui/sitofp/uitofp on AVX512DQ-only targets

Use 512-bit instructions with subvector insertion/extraction like we do in a number of similar circumstances

llvm-svn: 287882

7 years agoEnable WatchpointPythonCommandTestCase-test_continue_in_watchpoint_command
Pavel Labath [Thu, 24 Nov 2016 14:41:36 +0000 (14:41 +0000)]
Enable WatchpointPythonCommandTestCase-test_continue_in_watchpoint_command

This test passes consistently on linux, so I am removing the overall XFAIL. If it
fails on your configuration, please put a targeted xfail instead (i'll add them
my self if I get any breakage emails).

llvm-svn: 287881

7 years agoUse more chrono in AdbClient
Pavel Labath [Thu, 24 Nov 2016 14:11:47 +0000 (14:11 +0000)]
Use more chrono in AdbClient

This refactors AdbClient interface in terms of std::chrono.

llvm-svn: 287880

7 years agoUse chrono in AdbClient
Pavel Labath [Thu, 24 Nov 2016 14:03:57 +0000 (14:03 +0000)]
Use chrono in AdbClient

This refactors the class implementations to use chrono. I'll follow this up with
a refactor of the class interface.

llvm-svn: 287879

7 years ago[X86][AVX512DQVL] Add awareness of vcvtqq2ps and vcvtuqq2ps implicit zeroing of upper...
Simon Pilgrim [Thu, 24 Nov 2016 14:02:30 +0000 (14:02 +0000)]
[X86][AVX512DQVL] Add awareness of vcvtqq2ps and vcvtuqq2ps implicit zeroing of upper 64-bits of xmm result

llvm-svn: 287878

7 years ago[X86][AVX512DQVL] Add support for v2i64 -> v2f32 SINT_TO_FP/UINT_TO_FP lowering
Simon Pilgrim [Thu, 24 Nov 2016 13:38:59 +0000 (13:38 +0000)]
[X86][AVX512DQVL] Add support for v2i64 -> v2f32 SINT_TO_FP/UINT_TO_FP lowering

llvm-svn: 287877

7 years ago[X86][AVX512DQVL] Add v2i64 -> v2f32 + zero codegen tests
Simon Pilgrim [Thu, 24 Nov 2016 13:26:51 +0000 (13:26 +0000)]
[X86][AVX512DQVL] Add v2i64 -> v2f32 + zero codegen tests

llvm-svn: 287876

7 years ago[x86] Fixing PR28755 by precomputing the address used in CMPXCHG8B
Nikolai Bozhenov [Thu, 24 Nov 2016 13:23:35 +0000 (13:23 +0000)]
[x86] Fixing PR28755 by precomputing the address used in CMPXCHG8B

The bug arises during register allocation on i686 for
CMPXCHG8B instruction when base pointer is needed. CMPXCHG8B
needs 4 implicit registers (EAX, EBX, ECX, EDX) and a memory address,
plus ESI is reserved as the base pointer. With such constraints the only
way register allocator would do its job successfully is when the addressing
mode of the instruction requires only one register. If that is not the case
- we are emitting additional LEA instruction to compute the address.

It fixes PR28755.

Patch by Alexander Ivchenko <alexander.ivchenko@intel.com>

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

llvm-svn: 287875

7 years ago[x86] Minor refactoring of X86TargetLowering::EmitInstrWithCustomInserter
Nikolai Bozhenov [Thu, 24 Nov 2016 13:15:49 +0000 (13:15 +0000)]
[x86] Minor refactoring of X86TargetLowering::EmitInstrWithCustomInserter

Move the definitions of three variables out of the switch.

Patch by Alexander Ivchenko <alexander.ivchenko@intel.com>

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

llvm-svn: 287874

7 years ago[x86] Rewrite getAddressFromInstr helper function
Nikolai Bozhenov [Thu, 24 Nov 2016 13:05:43 +0000 (13:05 +0000)]
[x86] Rewrite getAddressFromInstr helper function

- It does not modify the input instruction
- Second operand of any address is always an Index Register,
  make sure we actually check for that, instead of a check for
  an immediate value

Patch by Alexander Ivchenko <alexander.ivchenko@intel.com>

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

llvm-svn: 287873

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Thu, 24 Nov 2016 12:40:04 +0000 (12:40 +0000)]
[PPC] support for arithmetic builtins in the FE

(commit again after fixing the buildbot failures)
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

llvm-svn: 287872

7 years ago[AVR] Mark the 'select-must-add-unconditional-jump' test as 'XFAIL'
Dylan McKay [Thu, 24 Nov 2016 12:38:54 +0000 (12:38 +0000)]
[AVR] Mark the 'select-must-add-unconditional-jump' test as 'XFAIL'

llvm-svn: 287871

7 years ago[X86] Generalize CVTTPD2DQ/CVTTPD2UDQ and CVTDQ2PD/CVTUDQ2PD opcodes. NFCI
Simon Pilgrim [Thu, 24 Nov 2016 12:13:46 +0000 (12:13 +0000)]
[X86] Generalize CVTTPD2DQ/CVTTPD2UDQ and CVTDQ2PD/CVTUDQ2PD opcodes. NFCI

Replace the CVTTPD2DQ/CVTTPD2UDQ and CVTDQ2PD/CVTUDQ2PD opcodes with general versions.

This is an initial step towards similar FP_TO_SINT/FP_TO_UINT and SINT_TO_FP/UINT_TO_FP lowering to AVX512 CVTTPS2QQ/CVTTPS2UQQ and CVTQQ2PS/CVTUQQ2PS with illegal types.

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

llvm-svn: 287870

7 years ago[ELF] Add terminating sentinel .ARM.exidx table entry
Peter Smith [Thu, 24 Nov 2016 11:43:55 +0000 (11:43 +0000)]
[ELF] Add terminating sentinel .ARM.exidx table entry

The .ARM.exidx table has an entry for each function with the first entry
giving the start address of the function, the table is sorted in ascending
order of function address. Given a PC value, the unwinder will search the
table for the entry that contains the PC value.

If the table entry happens to be the last, the range of the addresses that
the final unwinding table describes will extend to the end of the address
space. To prevent an incorrect address outside the address range of the
program matching the last entry we follow ld.bfd's example and add a
sentinel EXIDX_CANTUNWIND entry at the end of the table. This gives the
final real table entry an upper bound.

In addition the llvm libunwind unwinder currently depends on the presence
of a sentinel entry (PR31091).

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

llvm-svn: 287869

7 years agoReverting wrong diff
Roger Ferrer Ibanez [Thu, 24 Nov 2016 11:28:02 +0000 (11:28 +0000)]
Reverting wrong diff

I managed to confuse me with two reviews of the same thing and ended commiting the wrong one.

llvm-svn: 287868

7 years agoAttempt to fix freebsd build after r287864
Pavel Labath [Thu, 24 Nov 2016 11:22:43 +0000 (11:22 +0000)]
Attempt to fix freebsd build after r287864

the chrono library there uses long long as the underlying chrono type, but
defines int64_t as long (or the other way around, I am not sure). In any case,
this caused the implicit conversion to not trigger. This should address that.

Also fix up the relevant unit test.

llvm-svn: 287867

7 years agoProtect tests for std::uninitialized_{copy,fill} under libcpp-no-exceptions
Roger Ferrer Ibanez [Thu, 24 Nov 2016 11:17:09 +0000 (11:17 +0000)]
Protect tests for std::uninitialized_{copy,fill} under libcpp-no-exceptions

Skip tests that expect an exception be thrown.

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

llvm-svn: 287866

7 years agoProtect std::string tests under libcpp-no-exceptions
Roger Ferrer Ibanez [Thu, 24 Nov 2016 11:15:09 +0000 (11:15 +0000)]
Protect std::string tests under libcpp-no-exceptions

Skip tests that expect an exception be thrown and/or disable
unreachable catch handlers.

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

llvm-svn: 287865

7 years agoIntroduce chrono to more gdb-remote functions
Pavel Labath [Thu, 24 Nov 2016 10:54:49 +0000 (10:54 +0000)]
Introduce chrono to more gdb-remote functions

Summary:
This replaces the usage of raw integers with duration classes in the gdb-remote
packet management functions. The values are still converted back to integers once
they go into the generic Communication class -- that I am leaving to a separate
change.

The changes are mostly straight-forward (*), the only tricky part was
representation of infinite timeouts.

Currently, we use UINT32_MAX to denote infinite timeout. This is not well suited
for duration classes, as they tend to do arithmetic on the values, and the
identity of the MAX value can easily get lost (e.g.
microseconds(seconds(UINT32_MAX)).count() != UINT32_MAX). We cannot use zero to
represent infinity (as Listener classes do) because we already use it to do
non-blocking polling reads. For this reason, I chose to have an explicit value
for infinity.

The way I achieved that is via llvm::Optional, and I think it reads quite
natural. Passing llvm::None as "timeout" means "no timeout", while passing zero
means "poll". The only tricky part is this breaks implicit conversions (seconds
are implicitly convertible to microseconds, but Optional<seconds> cannot be
easily converted into Optional<microseconds>). For this reason I added a special
class Timeout, inheriting from Optional, and enabling the necessary conversions
one would normally expect.

(*) The other tricky part was GDBRemoteCommunication::PopPacketFromQueue, which
was needlessly complicated. I've simplified it, but that one is only used in
non-stop mode, and so is untested.

Reviewers: clayborg, zturner, jingham

Subscribers: lldb-commits

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

llvm-svn: 287864

7 years ago[clang-move] Enable dump all declarations in old header.
Haojian Wu [Thu, 24 Nov 2016 10:17:17 +0000 (10:17 +0000)]
[clang-move] Enable dump all declarations in old header.

Summary:
* Add -dump_dels option to dump all declarations from old header. It
  will allow clang-move used as a frontend to get declarations from
  header. Further more, this will make debugging stuff easier. Currently only
  class/function types are supported.
* Refactoring code a little bit by creating a ClangMoveContext which
  holds all options for ClangMoveTool, which can simplify the code in
  some degree.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 287863

7 years agoRemove \x13 (^S) character that was likely added by mistake.
Adrian Kuegel [Thu, 24 Nov 2016 10:01:34 +0000 (10:01 +0000)]
Remove \x13 (^S) character that was likely added by mistake.

r287386 added a \x13 character inside a string literal. Most likely this
was by mistake, so remove it.

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

llvm-svn: 287862

7 years agoPatch for lldb bug 26322 “core load hangs”
Howard Hellyer [Thu, 24 Nov 2016 09:54:09 +0000 (09:54 +0000)]
Patch for lldb bug 26322 “core load hangs”

Correct 0 byte core files uploaded by arc.

llvm-svn: 287861

7 years ago[ELF] - Removed unused method. NFC.
George Rimar [Thu, 24 Nov 2016 09:42:10 +0000 (09:42 +0000)]
[ELF] - Removed unused method. NFC.

llvm-svn: 287860

7 years ago[ASTDumper] Add some more character escapes for convenience.
Benjamin Kramer [Thu, 24 Nov 2016 09:41:33 +0000 (09:41 +0000)]
[ASTDumper] Add some more character escapes for convenience.

llvm-svn: 287859

7 years agoPatch for lldb bug 26322 “core load hangs”
Howard Hellyer [Thu, 24 Nov 2016 08:56:37 +0000 (08:56 +0000)]
Patch for lldb bug 26322 “core load hangs”

Summary:
This patch changes the way ProcessElfCore.cpp handles signal information.
The patch changes ProcessElfCore.cpp to use the signal from si_signo in SIGINFO notes in preference to the value of cursig in PRSTATUS notes. The value from SIGINFO seems to be more thread specific. The value from PRSTATUS is usually the same for all threads even if only one thread received a signal.
If it cannot find any SIGINFO blocks it reverts to the old behaviour and uses the value from cursig in PRSTATUS. If after that no thread appears to have been stopped it forces the status of the first thread to be SIGSTOP to prevent lldb hanging waiting for any thread from the core file to change state.

The order is:
- If one or more threads have a non-zero si_signo in SIGINFO that will be used.
- If no threads had a SIGINFO block with a non-zero si_signo set all threads signals to the value in cursig in their PRSTATUS notes.
- If no thread has a signal set to a non-zero value set the signal for only the first thread to SIGSTOP.

This resolves two issues. The first was identified in bug 26322, the second became apparent while investigating this problem and looking at the signal values reported for each thread via “thread list”.

Firstly lldb is able to load core dumps generated by gcore where each thread has a SIGINFO note containing a signal number but cursig in the PRSTATUS block for each thread is 0.

Secondly if a SIGINFO note was found the “thread list” command will no longer show the same signal number for all threads. At the moment if a process crashes, for example with SIGILL, all threads will show “stop reason = signal SIGILL”. With this patch only the thread that executed the illegal instruction shows that stop reason. The other threads show “stop reason = signal 0”.

Reviewers: jingham, clayborg

Subscribers: sas, labath, lldb-commits

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

llvm-svn: 287858