platform/upstream/llvm.git
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

7 years ago[CommandLine] Remove redundant initializers for StringRef members
Malcolm Parsons [Thu, 24 Nov 2016 08:54:05 +0000 (08:54 +0000)]
[CommandLine] Remove redundant initializers for StringRef members

Summary: The default constructor for a StringRef stores an empty string.

Reviewers: beanz, zturner

Subscribers: llvm-commits

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

llvm-svn: 287857

7 years agoTableGen: Allow signed immediates for instruction aliases
Jacob Baungard Hansen [Thu, 24 Nov 2016 08:53:28 +0000 (08:53 +0000)]
TableGen: Allow signed immediates for instruction aliases

Patch by Daniel Cederman.

Reviewers: stoklund, arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 287856

7 years ago[AVX-512] Fix some mask shuffle tests to actually test the case they were supposed...
Craig Topper [Thu, 24 Nov 2016 05:36:50 +0000 (05:36 +0000)]
[AVX-512] Fix some mask shuffle tests to actually test the case they were supposed to test.

llvm-svn: 287854

7 years ago[AVX-512] Move a 16 x float shuffle test to the v16 test file and add an integer...
Craig Topper [Thu, 24 Nov 2016 05:36:47 +0000 (05:36 +0000)]
[AVX-512] Move a 16 x float shuffle test to the v16 test file and add an integer variant.

llvm-svn: 287853

7 years agoRemove comments (NFC)
Kelvin Li [Thu, 24 Nov 2016 03:18:07 +0000 (03:18 +0000)]
Remove comments (NFC)

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

llvm-svn: 287852

7 years agoMake these tests work more reliably with Release builds.
Douglas Yung [Thu, 24 Nov 2016 01:53:38 +0000 (01:53 +0000)]
Make these tests work more reliably with Release builds.

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

llvm-svn: 287851

7 years agoUpdate comment.
Rui Ueyama [Thu, 24 Nov 2016 01:44:21 +0000 (01:44 +0000)]
Update comment.

llvm-svn: 287850

7 years agoRemove HasError and use ErrorCount instead.
Rui Ueyama [Thu, 24 Nov 2016 01:43:21 +0000 (01:43 +0000)]
Remove HasError and use ErrorCount instead.

HasError was always true if ErrorCount > 0, so we can use ErrorCount instead.

llvm-svn: 287849

7 years agoFix a comparison of integers of different signs warning.
Taras Tsugrii [Thu, 24 Nov 2016 01:34:43 +0000 (01:34 +0000)]
Fix a comparison of integers of different signs warning.

  source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:403:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < llvm::array_lengthof (magicks); i++)
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

llvm-svn: 287848

7 years agoSpelling.
Joerg Sonnenberger [Thu, 24 Nov 2016 01:24:38 +0000 (01:24 +0000)]
Spelling.

llvm-svn: 287847

7 years agoObject: Add IRObjectFile::getTargetTriple().
Peter Collingbourne [Thu, 24 Nov 2016 01:13:09 +0000 (01:13 +0000)]
Object: Add IRObjectFile::getTargetTriple().

This lets us remove a use of IRObjectFile::getModule() in llvm-nm.

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

llvm-svn: 287846

7 years agoObject: Simplify the IRObjectFile symbol iterator implementation.
Peter Collingbourne [Thu, 24 Nov 2016 00:41:05 +0000 (00:41 +0000)]
Object: Simplify the IRObjectFile symbol iterator implementation.

Change the IRObjectFile symbol iterator to be a pointer into a vector of
PointerUnions representing either IR symbols or asm symbols.

This change is in preparation for a future change for supporting multiple
modules in an IRObjectFile. Although it causes an increase in memory
consumption, we can deal with that issue separately by introducing a bitcode
symbol table.

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

llvm-svn: 287845

7 years agoAMDGPU: Preserve m0 value when spilling
Matt Arsenault [Thu, 24 Nov 2016 00:26:50 +0000 (00:26 +0000)]
AMDGPU: Preserve m0 value when spilling

llvm-svn: 287844

7 years agoTRI: Add hook to pass scavenger during frame elimination
Matt Arsenault [Thu, 24 Nov 2016 00:26:47 +0000 (00:26 +0000)]
TRI: Add hook to pass scavenger during frame elimination

The scavenger was not passed if requiresFrameIndexScavenging was
enabled. I need to be able to test for the availability of an
unallocatable register here, so I can't create a virtual register for
it.

It might be better to just always use the scavenger and stop
creating virtual registers.

llvm-svn: 287843

7 years agoAMDGPU: Remove m0 spilling code
Matt Arsenault [Thu, 24 Nov 2016 00:26:44 +0000 (00:26 +0000)]
AMDGPU: Remove m0 spilling code

Since m0 isn't allocatable it should never be spilled anymore.

llvm-svn: 287842

7 years agoAMDGPU: Make m0 unallocatable
Matt Arsenault [Thu, 24 Nov 2016 00:26:40 +0000 (00:26 +0000)]
AMDGPU: Make m0 unallocatable

m0 may need to be written for spill code, so
we don't want general code uses relying on the
value stored in it.

This introduces a few code quality regressions where copies
from m0 are not coalesced into copies of a copy of m0.

llvm-svn: 287841

7 years ago[lib/LTO] Rename few instances of Lto to LTO.
Davide Italiano [Thu, 24 Nov 2016 00:23:09 +0000 (00:23 +0000)]
[lib/LTO] Rename few instances of Lto to LTO.

llvm-svn: 287840

7 years agoRely on a single DWARF version instead of having two copies
Greg Clayton [Wed, 23 Nov 2016 23:30:37 +0000 (23:30 +0000)]
Rely on a single DWARF version instead of having two copies

This patch makes AsmPrinter less reliant on DwarfDebug by relying on the DWARF version in the AsmPrinter's MCStreamer's MCContext. This allows us to remove the redundant DWARF version from DwarfDebug. It also lets us change code that used to access the AsmPrinter's DwarfDebug just to get to the DWARF version by changing the DWARF version accessor on AsmPrinter so that it grabs the version from its MCStreamer's MCContext.

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

llvm-svn: 287839

7 years ago[DebugInfo] Fix some Clang-tidy modernize-use-default and Include What You Use warnin...
Eugene Zelenko [Wed, 23 Nov 2016 23:16:32 +0000 (23:16 +0000)]
[DebugInfo] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).

Per Zachary Turner and Mehdi Amini suggestion to make only post-commit reviews.

llvm-svn: 287838

7 years ago[COFF] Add DebugInfoCodeView dependency
Rui Ueyama [Wed, 23 Nov 2016 22:58:25 +0000 (22:58 +0000)]
[COFF] Add DebugInfoCodeView dependency

rL287555 introduces a link error when building with BUILD_SHARED_LIBS:

  undefined reference to llvm::codeview::CVSymbolDumper::dump(),
  and more...

The functions are available in libDebugInfoCodeView, from LLVM.

Patch by Visoiu Mistrih Francis!

llvm-svn: 287837

7 years agoSet default entry point to .text if no entry point is found.
Rui Ueyama [Wed, 23 Nov 2016 22:41:00 +0000 (22:41 +0000)]
Set default entry point to .text if no entry point is found.

Previously, if a symbol specified by -e or ENTRY() is not found,
we didn't set entry point address. That is incompatible with GNU
because GNU linkers set the first address of .text to entry.
This patch implement that behavior.

llvm-svn: 287836

7 years ago[X86][SSE] Add awareness of (v)cvtpd2dq and vcvtpd2udq implicit zeroing of upper...
Simon Pilgrim [Wed, 23 Nov 2016 22:35:06 +0000 (22:35 +0000)]
[X86][SSE] Add awareness of (v)cvtpd2dq and vcvtpd2udq implicit zeroing of upper 64-bits of xmm result

We've already added the equivalent for (v)cvttpd2dq (rL284459) and vcvttpd2udq

llvm-svn: 287835

7 years ago[IR] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete and Includ...
Eugene Zelenko [Wed, 23 Nov 2016 22:25:16 +0000 (22:25 +0000)]
[IR] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete and Include What You Use warnings; other minor fixes (NFC).

Per Zachary Turner and Mehdi Amini suggestion to make only post-commit reviews.

llvm-svn: 287834

7 years ago[test] Use a helper macro to refer to MAP_ANON (NFC)
Vedant Kumar [Wed, 23 Nov 2016 22:23:42 +0000 (22:23 +0000)]
[test] Use a helper macro to refer to MAP_ANON (NFC)

Some of our internal bots use old SDK's which don't define MAP_ANON.
Use a helper macro to pass the right flag into mmap().

llvm-svn: 287833

7 years ago[ELF][MIPS] Fix handling of _gp/_gp_disp/__gnu_local_gp symbols
Simon Atanasyan [Wed, 23 Nov 2016 22:22:16 +0000 (22:22 +0000)]
[ELF][MIPS] Fix handling of _gp/_gp_disp/__gnu_local_gp symbols

Offset between beginning of a .got section and _gp symbols used in MIPS
GOT relocations calculations. Usually the expression looks like
VA + Offset - GP, where VA is the .got section address, Offset - offset
of the GOT entry, GP - offset between .got and _gp. Also there two "magic"
symbols _gp_disp and __gnu_local_gp which hold the offset mentioned above.
These symbols might be referenced by MIPS relocations.

Now the linker always defines _gp symbol and uses hardcoded value for
its initialization. So offset between .got and _gp is 0x7ff0. The _gp_disp
and __gnu_local_gp defined if required and initialized by 0x7ff0.
In fact that is not correct because _gp symbol might be defined by a linker
script and holds arbitrary value. In that case we need to use this value
in relocation calculation and initialize _gp_disp and __gnu_local_gp
properly.

The patch fixes the problem and completes fixing the bug #30311.
https://llvm.org/bugs/show_bug.cgi?id=30311

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

llvm-svn: 287832

7 years ago[SelectionDAG] Early-out in TargetLowering::expandMUL (NFC)
Nicolai Haehnle [Wed, 23 Nov 2016 22:14:20 +0000 (22:14 +0000)]
[SelectionDAG] Early-out in TargetLowering::expandMUL (NFC)

Summary: Reduce indentation level; preparation for D24956.

Reviewers: efriedma

Subscribers: llvm-commits

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

llvm-svn: 287831

7 years agoRemove trailing whitespace.
Rui Ueyama [Wed, 23 Nov 2016 22:10:46 +0000 (22:10 +0000)]
Remove trailing whitespace.

llvm-svn: 287830

7 years ago[libcxx] [test] D27027: Strip trailing whitespace.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:03:28 +0000 (22:03 +0000)]
[libcxx] [test] D27027: Strip trailing whitespace.

llvm-svn: 287829

7 years ago[libcxx] [test] D27026: Fix copy-paste silliness; ULL can't ever be 32-bit.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:59 +0000 (22:02 +0000)]
[libcxx] [test] D27026: Fix copy-paste silliness; ULL can't ever be 32-bit.

llvm-svn: 287828

7 years ago[libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed...
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:53 +0000 (22:02 +0000)]
[libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/12.

When initializing unsigned integers to their maximum values, change "const T M(~0);" to "const T M(static_cast<T>(-1));".

~0 and -1 are equivalent, but I consider the -1 form to be significantly clearer (and more consistent with other tests).

llvm-svn: 287827

7 years ago[libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed...
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:44 +0000 (22:02 +0000)]
[libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 6/12.

Add static_cast when initializing unsigned integers with negative numbers (in order to obtain big values).

llvm-svn: 287826

7 years ago[libcxx] [test] D27018: Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:35 +0000 (22:02 +0000)]
[libcxx] [test] D27018: Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.

Various changes:

test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
Change M from unsigned to int. It's compared against "int x",
and we binary_search() for it within a vector<int>.

test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
Add static_cast<unsigned> when comparing int to unsigned.

test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
Change unsigned indices to int when we're being given int as a bound.

llvm-svn: 287825

7 years ago[libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:27 +0000 (22:02 +0000)]
[libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.

Change "int j;" indices to "std::size_t j;".

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287824

7 years ago[libcxx] [test] D27015: Fix MSVC warning C4018 "signed/unsigned mismatch", part 3/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:16 +0000 (22:02 +0000)]
[libcxx] [test] D27015: Fix MSVC warning C4018 "signed/unsigned mismatch", part 3/12.

Change unsigned to int in parameters.

llvm-svn: 287823

7 years ago[libcxx] [test] D27014: Fix MSVC warning C4018 "signed/unsigned mismatch", part 2/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:01:58 +0000 (22:01 +0000)]
[libcxx] [test] D27014: Fix MSVC warning C4018 "signed/unsigned mismatch", part 2/12.

Add static_cast<std::size_t> when comparing int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287822

7 years ago[X86][AVX512VL] Add v2f64 -> v2i32/v2f32 + zero codegen tests
Simon Pilgrim [Wed, 23 Nov 2016 22:01:50 +0000 (22:01 +0000)]
[X86][AVX512VL] Add v2f64 -> v2i32/v2f32 + zero codegen tests

llvm-svn: 287821

7 years ago[libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:01:19 +0000 (22:01 +0000)]
[libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.

Change loop indices from int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287820

7 years agoFix typo.
Hongbin Zheng [Wed, 23 Nov 2016 21:59:33 +0000 (21:59 +0000)]
Fix typo.

llvm-svn: 287819

7 years agoAMDGPU: Cleanup immediate folding code
Matt Arsenault [Wed, 23 Nov 2016 21:51:07 +0000 (21:51 +0000)]
AMDGPU: Cleanup immediate folding code

Move code down to use, reorder to avoid hard to follow
immediate folding logic.

llvm-svn: 287818

7 years agoAMDGPU: Fix debug printing
Matt Arsenault [Wed, 23 Nov 2016 21:51:05 +0000 (21:51 +0000)]
AMDGPU: Fix debug printing

The uint8_t was printed as a char which didn't really work.

llvm-svn: 287817

7 years agoUse llvm::utohexstr instead of Twine::utohexstr.
Rui Ueyama [Wed, 23 Nov 2016 21:24:26 +0000 (21:24 +0000)]
Use llvm::utohexstr instead of Twine::utohexstr.

They are essentially the same in this context, so I prefer the one
that doesn't need `Twine::`.

llvm-svn: 287814

7 years ago[X86][SSE] Add v2i64 -> v2i32 + zero codegen test
Simon Pilgrim [Wed, 23 Nov 2016 21:19:57 +0000 (21:19 +0000)]
[X86][SSE] Add v2i64 -> v2i32 + zero codegen test

llvm-svn: 287813

7 years agoAMDGPU: Fix not setting kill flag on temp reg when spilling
Matt Arsenault [Wed, 23 Nov 2016 21:00:12 +0000 (21:00 +0000)]
AMDGPU: Fix not setting kill flag on temp reg when spilling

llvm-svn: 287808

7 years agoAMDGPU: Fix adding extra implicit def of register
Matt Arsenault [Wed, 23 Nov 2016 21:00:10 +0000 (21:00 +0000)]
AMDGPU: Fix adding extra implicit def of register

In the scalar case, there's no reason to add an additional
def of the same register.

llvm-svn: 287807

7 years agoAMDGPU: Fix MMO when splitting spill
Matt Arsenault [Wed, 23 Nov 2016 20:52:53 +0000 (20:52 +0000)]
AMDGPU: Fix MMO when splitting spill

The size and offset were wrong. The size of the object was
being used for the size of the access, when here it is really
being split into 4-byte accesses. The underlying object size
is set in the MachinePointerInfo, which also didn't have the
offset set.

llvm-svn: 287806

7 years agoRevert "[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right...
Vedant Kumar [Wed, 23 Nov 2016 20:51:09 +0000 (20:51 +0000)]
Revert "[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path."

This reverts commit r287403. It breaks an internal asan bot. According
to Kuba, a fix is up for review here: https://reviews.llvm.org/D26929

llvm-svn: 287804

7 years agollvm-nm: Print correct symbol types for init and fini sections
Meador Inge [Wed, 23 Nov 2016 20:17:20 +0000 (20:17 +0000)]
llvm-nm: Print correct symbol types for init and fini sections

This patch fixes a small bug where symbols defined in the INIT
and FINI sections were incorrectly getting a type of 'n'.

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

llvm-svn: 287803

7 years agollvm-nm: Don't print value or size for undefined or weak symbols
Meador Inge [Wed, 23 Nov 2016 20:17:15 +0000 (20:17 +0000)]
llvm-nm: Don't print value or size for undefined or weak symbols

Undefined and weak symbols don't have a meaningful size or value.
As such, nothing should be printed for those attributes (this is
already done for the address with 'U') with the BSD format.  This
matches what GNU nm does.

Note that for the POSIX.2 format [1] zero values are still
printed for the size and value.  This seems in spirit with
the format strings in that specification, but is debatable.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/

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

llvm-svn: 287802

7 years ago[SLP] Add more tests for SLP Vectorizer.
Alexey Bataev [Wed, 23 Nov 2016 20:10:32 +0000 (20:10 +0000)]
[SLP] Add more tests for SLP Vectorizer.

llvm-svn: 287801

7 years ago[LoopUnroll] Move code to exit early. NFC.
Haicheng Wu [Wed, 23 Nov 2016 19:39:26 +0000 (19:39 +0000)]
[LoopUnroll] Move code to exit early. NFC.

Just to save some compilation time.

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

llvm-svn: 287800

7 years agoFix this on 32 bit hosts.
Rafael Espindola [Wed, 23 Nov 2016 19:16:20 +0000 (19:16 +0000)]
Fix this on 32 bit hosts.

Looks like we have no 32 bit bot that builds with mips support.

llvm-svn: 287799

7 years agoRevert "[Triple] Add Facebook vendor"
Daniel Berlin [Wed, 23 Nov 2016 19:03:54 +0000 (19:03 +0000)]
Revert "[Triple] Add Facebook vendor"

This reverts commit r287684

Objections on the review thread had not been addressed to
prior to commit.  I asked the committer to revert, but i expect they
are gone for the US holiday or something.

llvm-svn: 287798

7 years agoFix uninitialized variable access.
Rui Ueyama [Wed, 23 Nov 2016 19:03:35 +0000 (19:03 +0000)]
Fix uninitialized variable access.

llvm-svn: 287797

7 years ago[PPC] revert r287795
Ehsan Amiri [Wed, 23 Nov 2016 18:55:17 +0000 (18:55 +0000)]
[PPC] revert r287795

A test that passed locally is failing on one of the build bots.

llvm-svn: 287796

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Wed, 23 Nov 2016 18:36:29 +0000 (18:36 +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: 287795

7 years agoMake log(), error() and fatal() thread-safe.
Rui Ueyama [Wed, 23 Nov 2016 18:34:28 +0000 (18:34 +0000)]
Make log(), error() and fatal() thread-safe.

llvm-svn: 287794

7 years agoAdd dllexport default ctor closure PCH regression test for PR31121
Reid Kleckner [Wed, 23 Nov 2016 18:33:54 +0000 (18:33 +0000)]
Add dllexport default ctor closure PCH regression test for PR31121

Follow up to r287774

llvm-svn: 287793

7 years ago[X86] Allow folding of stack reloads when loading a subreg of the spilled reg
Michael Kuperstein [Wed, 23 Nov 2016 18:33:49 +0000 (18:33 +0000)]
[X86] Allow folding of stack reloads when loading a subreg of the spilled reg

We did not support subregs in InlineSpiller:foldMemoryOperand() because targets
may not deal with them correctly.

This adds a target hook to let the spiller know that a target can handle
subregs, and actually enables it for x86 for the case of stack slot reloads.
This fixes PR30832.

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

llvm-svn: 287792

7 years ago[asan/win] Skip incremental linker padding during unregistration
Reid Kleckner [Wed, 23 Nov 2016 18:28:04 +0000 (18:28 +0000)]
[asan/win] Skip incremental linker padding during unregistration

Should fix issues that came up while testing Win64 ASan.

llvm-svn: 287791

7 years agoLimit default maximum number of errors to 20.
Rui Ueyama [Wed, 23 Nov 2016 18:15:37 +0000 (18:15 +0000)]
Limit default maximum number of errors to 20.

This is in the context of https://llvm.org/bugs/show_bug.cgi?id=31109.
When LLD prints out errors for relocations, it tends to print out
extremely large number of errors (like millions) because it would
print out one error per relocation.

This patch makes LLD bail out if it prints out more than 20 errors.
You can configure the limitation using -error-limit argument.
-error-limit=0 means no limit.

I chose the flag name because Clang has the same feature as -ferror-limit.
"f" doesn't make sense to us, so I omitted it.

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

llvm-svn: 287789

7 years agoRe-commit r287727: Use SHA1::hash and MD5::hash functions.
Rui Ueyama [Wed, 23 Nov 2016 18:11:38 +0000 (18:11 +0000)]
Re-commit r287727: Use SHA1::hash and MD5::hash functions.

r287727 was not a change that broke buildbots; the other change
(r287726) that I made to LLVM broke them.

llvm-svn: 287788

7 years agoDefine toString() as a generic function to get a string for error message.
Rui Ueyama [Wed, 23 Nov 2016 18:07:33 +0000 (18:07 +0000)]
Define toString() as a generic function to get a string for error message.

We have different functions to stringize objects to construct
error messages. For InputFile, we have getFilename, and for
InputSection, we have getName. You had to memorize them.

I think this is the case where the function overloading comes in handy.

This patch defines toString() functions that are overloaded for all these
types, so that you just call it in error().

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

llvm-svn: 287787

7 years agollvm-readobj: Use hash tables to print dynamic symbols.
Hemant Kulkarni [Wed, 23 Nov 2016 18:04:23 +0000 (18:04 +0000)]
llvm-readobj: Use hash tables to print dynamic symbols.

-symbols prints both .symtab and .dynsym symbols for GNU style in ELF.
-dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables.

llvm-svn: 287786