platform/upstream/llvm.git
7 years ago[X86][AVX512] Tag CLWB instruction to CLFLUSH/PREFETCH scheduler class
Simon Pilgrim [Fri, 8 Dec 2017 15:19:10 +0000 (15:19 +0000)]
[X86][AVX512] Tag CLWB instruction to CLFLUSH/PREFETCH scheduler class

llvm-svn: 320156

7 years ago[PatternMatch] Add matcher for LoadInst, NFC.
Alexey Bataev [Fri, 8 Dec 2017 15:17:37 +0000 (15:17 +0000)]
[PatternMatch] Add matcher for LoadInst, NFC.

llvm-svn: 320155

7 years ago[X86][AVX512] Tag AVX512_512_SEXT_MASK_* instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 15:17:32 +0000 (15:17 +0000)]
[X86][AVX512] Tag AVX512_512_SEXT_MASK_* instructions scheduler classes

Match VPTERNLOG which these pseudos will eventually alias to

llvm-svn: 320154

7 years ago[CMake] Remove legacy LIBOMP_LIT_ARGS
Jonas Hahnfeld [Fri, 8 Dec 2017 15:07:08 +0000 (15:07 +0000)]
[CMake] Remove legacy LIBOMP_LIT_ARGS

The bots have been updated, this option isn't needed anymore.

llvm-svn: 320153

7 years agoUse hyperbarrier by default on all architectures
Jonas Hahnfeld [Fri, 8 Dec 2017 15:07:07 +0000 (15:07 +0000)]
Use hyperbarrier by default on all architectures

All architectures except x86_64 used the linear barrier implementation
by default which doesn't give good performance for a larger number
of threads.

Improvements for PARALLEL overhead (EPCC) with this patch on a Power8
system (2 sockets x 10 cores x 8 threads, OMP_PLACES=cores)

 20 threads:  4.55us -> 3.49us
 40 threads:  8.84us -> 4.06us
 80 threads: 19.18us -> 4.74us
160 threads: 54.22us -> 6.73us

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

llvm-svn: 320152

7 years agoFix thread affinity on non-x86 Linux
Jonas Hahnfeld [Fri, 8 Dec 2017 15:07:05 +0000 (15:07 +0000)]
Fix thread affinity on non-x86 Linux

To make thread affinity work according to the OpenMP spec, the
runtime needs information about the hardware topology. On Linux
the default way is to parse /proc/cpuinfo which contains this
information for x86 machines but (at least) not for AArch64 and
Power architectures.

Fortunately, there is a different code path which is able to get
that data from sysfs. The needed patch has landed in 2006 for
Linux 2.6.16 which is safe to assume nowadays (even RHEL 5 had
a kernel version derived from 2.6.18, and we are now at RHEL 7!).

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

llvm-svn: 320151

7 years agoAdd missing memory barrier for queuing locks
Jonas Hahnfeld [Fri, 8 Dec 2017 15:07:02 +0000 (15:07 +0000)]
Add missing memory barrier for queuing locks

Otherwise I see hangs in the omp_single_copyprivate test when
compiling in release mode. With the debug assertions, I get a
failure `head > 0 && tail > 0`.

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

llvm-svn: 320150

7 years ago[OPENMP] Initial codegen for `target teams distribute` directive.
Alexey Bataev [Fri, 8 Dec 2017 15:03:50 +0000 (15:03 +0000)]
[OPENMP] Initial codegen for `target teams distribute` directive.

Host + default devices codegen for `target teams distribute` directive.

llvm-svn: 320149

7 years ago[clangd] Convert lit code completion tests to unit-tests. NFC
Sam McCall [Fri, 8 Dec 2017 15:00:59 +0000 (15:00 +0000)]
[clangd] Convert lit code completion tests to unit-tests. NFC

Summary: This improves readability of tests and error messages.

Reviewers: ioeric

Subscribers: klimek, ilya-biryukov, cfe-commits

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

llvm-svn: 320148

7 years agoPrint the bad value and required alignment for unaligned relocations
Alexander Richardson [Fri, 8 Dec 2017 14:53:14 +0000 (14:53 +0000)]
Print the bad value and required alignment for unaligned relocations

Reviewers: ruiu, grimar

Reviewed By: ruiu

Subscribers: emaste, javed.absar, llvm-commits

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

llvm-svn: 320147

7 years ago[AMDGPU] add labels to +DumpCode output
Tim Renouf [Fri, 8 Dec 2017 14:09:34 +0000 (14:09 +0000)]
[AMDGPU] add labels to +DumpCode output

Summary:
+DumpCode is a hack to embed disassembly in the ELF file. This commit
fixes it to include labels, to make it slightly more useful.

Reviewers: arsenm, kzhuravl

Subscribers: nhaehnle, timcorringham, dstuttard, llvm-commits, t-tye, yaxunl, wdng, kzhuravl

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

llvm-svn: 320146

7 years ago[NFC] Rename variable from Cond to Pred to make it more sound
Max Kazantsev [Fri, 8 Dec 2017 12:54:32 +0000 (12:54 +0000)]
[NFC] Rename variable from Cond to Pred to make it more sound

llvm-svn: 320144

7 years ago[SCEV] Fix predicate usage in computeExitLimitFromICmp
Max Kazantsev [Fri, 8 Dec 2017 12:19:45 +0000 (12:19 +0000)]
[SCEV] Fix predicate usage in computeExitLimitFromICmp

In this method, we invoke `SimplifyICmpOperands` which takes the `Cond` predicate
by reference and may change it along with `LHS` and `RHS` SCEVs. But then we invoke
`computeShiftCompareExitLimit` with Values from which the SCEVs have been derived,
these Values have not been modified while `Cond` could be.

One of possible outcomes of this is that we may falsely prove that an infinite loop ends
within some finite number of iterations.

In this patch, we save the original `Cond` and pass it along with original operands.
This logic may be removed in future once `computeShiftCompareExitLimit` works
with SCEVs instead of value operands.

Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D40953

llvm-svn: 320142

7 years ago[CodeGen] Move printing MO_MachineBasicBlock operands to MachineOperand::print
Francis Visoiu Mistrih [Fri, 8 Dec 2017 11:48:02 +0000 (11:48 +0000)]
[CodeGen] Move printing MO_MachineBasicBlock operands to MachineOperand::print

Work towards the unification of MIR and debug output by refactoring the
interfaces.

llvm-svn: 320141

7 years ago[CodeGen] Move printing MO_CImmediate operands to MachineOperand::print
Francis Visoiu Mistrih [Fri, 8 Dec 2017 11:40:06 +0000 (11:40 +0000)]
[CodeGen] Move printing MO_CImmediate operands to MachineOperand::print

Work towards the unification of MIR and debug output by refactoring the
interfaces.

llvm-svn: 320140

7 years ago[change-namespace] Fix crash when injected base-class name is used in friend declarat...
Eric Liu [Fri, 8 Dec 2017 10:06:16 +0000 (10:06 +0000)]
[change-namespace] Fix crash when injected base-class name is used in friend declarations.

Reviewers: hokein

Subscribers: klimek, cfe-commits

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

llvm-svn: 320139

7 years ago[cmake] Make setting of CMAKE_C(XX)_COMPILER flags overridable for cross-builds
Pavel Labath [Fri, 8 Dec 2017 09:59:48 +0000 (09:59 +0000)]
[cmake] Make setting of CMAKE_C(XX)_COMPILER flags overridable for cross-builds

Summary:
r319898 made it possible to override these variables via the
CROSS_TOOLCHAIN_FLAGS setting, but this only worked if one explicitly
specifies these variables there. If, instead, one uses
CROSS_TOOLCHAIN_FLAGS to specify a toolchain file (as our internal
builds do, to point cmake to a checked-in toolchain), the
CMAKE_C(XX)_COMPILER flags would still win over the ones specified by
the toolchain file.

To fix is to make the mere presence of these flags overridable. I do
this by putting them as a default value for the CROSS_TOOLCHAIN_FLAGS
setting, so they can be overridden at cmake configuration time.

Reviewers: hintonda, beanz

Subscribers: bogner, llvm-commits, mgorny

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

llvm-svn: 320138

7 years ago[X86][Haswell]: Updating the scheduling information for the Haswell subtarget.
Gadi Haber [Fri, 8 Dec 2017 09:48:44 +0000 (09:48 +0000)]
[X86][Haswell]: Updating the scheduling information for the Haswell subtarget.

Updated the scheduling information for the Haswell subtarget with the following changes:

Regrouped the instructions after adding appropriate load + store latencies.
Added scheduling for missing instructions such as the GATHER instrs.
The changes were made after revisiting the latencies impact of all memory uOps.

Reviewers: RKSimon, zvi, craig.topper, apilipenko
Differential Revision: https://reviews.llvm.org/D40021

Change-Id: Iaf6c1f5169add1552845a8a566af4e5a359217a7
llvm-svn: 320137

7 years ago[FuzzMutate] Correctly insert sinks and sources around invoke instructions
Igor Laevsky [Fri, 8 Dec 2017 08:53:16 +0000 (08:53 +0000)]
[FuzzMutate] Correctly insert sinks and sources around invoke instructions

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

llvm-svn: 320136

7 years agoIn stdbool.h, define bool, false, true only in gnu++98
Stephan Bergmann [Fri, 8 Dec 2017 08:28:08 +0000 (08:28 +0000)]
In stdbool.h, define bool, false, true only in gnu++98

GCC has meanwhile corrected that with the similar
<https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216679> "C++11
explicitly forbids macros for bool, true and false."

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

llvm-svn: 320135

7 years ago[X86] Always consider inserting a vXi1 vector into the lsbs of a zero vector to be...
Craig Topper [Fri, 8 Dec 2017 08:10:58 +0000 (08:10 +0000)]
[X86] Always consider inserting a vXi1 vector into the lsbs of a zero vector to be legal during lowering. Add isel patterns to emit shifts.

Previously we only allowed these through if the subvector came from a compare or test instruction which we would again check for during isel.

With this change we only check for the compare and test instructions during isel and have fallback patterns that emit the shifts if needed.

I noticed that in a lot of cases we don't actually see the compare during lowering and rely on an odd legalization of concat_vectors with a zero vector as the second argument. This keeps the concat_vectors around long enough for a later dag combine to expose the compare then we re-legalize the concat_vectors and catch the compare.

llvm-svn: 320134

7 years agoRevert r320124 "Fold together the in-range and out-of-range portions of -Wtautologica...
Hans Wennborg [Fri, 8 Dec 2017 05:19:12 +0000 (05:19 +0000)]
Revert r320124 "Fold together the in-range and out-of-range portions of -Wtautological-compare."

This broke Chromium:

../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64
with expression of type 'unsigned int' is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
  DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize);
         ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The 'unsigned int' is really a 6-bit bitfield, which is why it's always
less than 63.

Did this use to fall under the "in-range" case before? I thought we
didn't use to warn when comparing against the boundaries of a type.

llvm-svn: 320133

7 years ago[Blocks] Inherit sanitizer options from parent decl
Vedant Kumar [Fri, 8 Dec 2017 02:47:58 +0000 (02:47 +0000)]
[Blocks] Inherit sanitizer options from parent decl

There is no way to apply sanitizer suppressions to ObjC blocks. A
reasonable default is to have blocks inherit their parent's sanitizer
options.

rdar://32769634

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

llvm-svn: 320132

7 years agoAdd a test that the __STDC_VERSION__ macro reports the correct value for -std=c17.
Aaron Ballman [Fri, 8 Dec 2017 02:39:26 +0000 (02:39 +0000)]
Add a test that the __STDC_VERSION__ macro reports the correct value for -std=c17.

llvm-svn: 320131

7 years agoUse lambda to simplify code.
Rui Ueyama [Fri, 8 Dec 2017 02:20:50 +0000 (02:20 +0000)]
Use lambda to simplify code.

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

llvm-svn: 320130

7 years ago[ubsan] Test for pass_object_size bounds checks
Vedant Kumar [Fri, 8 Dec 2017 01:51:51 +0000 (01:51 +0000)]
[ubsan] Test for pass_object_size bounds checks

llvm-svn: 320129

7 years ago[ubsan] Use pass_object_size info in bounds checks
Vedant Kumar [Fri, 8 Dec 2017 01:51:47 +0000 (01:51 +0000)]
[ubsan] Use pass_object_size info in bounds checks

Teach UBSan's bounds check to opportunistically use pass_object_size
information to check array accesses.

rdar://33272922

llvm-svn: 320128

7 years ago[MachException] Avoid alignment UB, NFC
Vedant Kumar [Fri, 8 Dec 2017 01:09:40 +0000 (01:09 +0000)]
[MachException] Avoid alignment UB, NFC

Fix alignment UB in some Mach exception-handling logic.

This lets us build lldb and debugserver with UBSan in trapping mode, and
get further along in the testing process before a trap is encountered.

rdar://35923991

llvm-svn: 320127

7 years agoRemove extant references to g_message_mutex, NFC
Vedant Kumar [Fri, 8 Dec 2017 01:09:39 +0000 (01:09 +0000)]
Remove extant references to g_message_mutex, NFC

Thanks to Jim Ingham for providing the explanation!

llvm-svn: 320126

7 years agoPrefer `ArrayRef` over `const std::vector&`
Sam Clegg [Fri, 8 Dec 2017 01:09:21 +0000 (01:09 +0000)]
Prefer `ArrayRef` over `const std::vector&`

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

llvm-svn: 320125

7 years agoFold together the in-range and out-of-range portions of -Wtautological-compare.
Richard Smith [Fri, 8 Dec 2017 01:00:27 +0000 (01:00 +0000)]
Fold together the in-range and out-of-range portions of -Wtautological-compare.

llvm-svn: 320124

7 years ago[AArch64] Avoid SIMD interleaved store instruction for Exynos.
Abderrazek Zaafrani [Fri, 8 Dec 2017 00:58:49 +0000 (00:58 +0000)]
[AArch64] Avoid SIMD interleaved store instruction for Exynos.

Replace interleaved store instructions by equivalent and more efficient instructions based on latency cost model.
Https://reviews.llvm.org/D38196

llvm-svn: 320123

7 years agoUnify implementation of our two different flavours of -Wtautological-compare.
Richard Smith [Fri, 8 Dec 2017 00:45:25 +0000 (00:45 +0000)]
Unify implementation of our two different flavours of -Wtautological-compare.

In so doing, fix a handful of remaining bugs where we would report false
positives or false negatives if we promote a signed value to an unsigned type
for the comparison.

llvm-svn: 320122

7 years agoRevert "[WebAssemby] Support main functions with alternate signatures."
Derek Schuff [Fri, 8 Dec 2017 00:39:54 +0000 (00:39 +0000)]
Revert "[WebAssemby] Support main functions with alternate signatures."

This reverts commit 959e37e669b0c3cfad4cb9f1f7c9261ce9f5e9ae.
That commit doesn't handle the case where main is declared rather than defined,
in particular the even-more special case where main is a prototypeless
declaration (which is of course the one actually used by musl currently).

llvm-svn: 320121

7 years ago[X86] Handle alls version of vXi1 insert_vector_elt with a constant index without...
Craig Topper [Fri, 8 Dec 2017 00:16:09 +0000 (00:16 +0000)]
[X86] Handle alls version of vXi1 insert_vector_elt with a constant index without falling back to shuffles.

We previously only supported inserting to the LSB or MSB where it was easy to zero to perform an OR to insert.

This change effectively extracts the old value and the new value, xors them together and then xors that single bit with the correct location in the original vector. This will cancel out the old value in the first xor leaving the new value in the position.

The way I've implemented this uses 3 shifts and two xors and uses an additional register. We can avoid the additional register at the cost of another shift.

llvm-svn: 320120

7 years ago[X86] Fix indentation. NFC
Craig Topper [Fri, 8 Dec 2017 00:15:57 +0000 (00:15 +0000)]
[X86] Fix indentation. NFC

llvm-svn: 320119

7 years ago[WebAssembly] Add check to ensure symbol VA is only set once. NFC.
Sam Clegg [Fri, 8 Dec 2017 00:13:14 +0000 (00:13 +0000)]
[WebAssembly] Add check to ensure symbol VA is only set once. NFC.

Also remove resulting unneeded function.

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

llvm-svn: 320118

7 years agoFix a test that didn't actually test anything.
Rui Ueyama [Fri, 8 Dec 2017 00:00:37 +0000 (00:00 +0000)]
Fix a test that didn't actually test anything.

llvm-svn: 320117

7 years ago[ORC] Mark SymbolStringPool methods as inline to avoid linkage errors, add a
Lang Hames [Thu, 7 Dec 2017 23:32:11 +0000 (23:32 +0000)]
[ORC] Mark SymbolStringPool methods as inline to avoid linkage errors, add a
less-than comparison to SymbolStringPtr and a corresponding unit test.

llvm-svn: 320116

7 years agoCorrect line endings that got mixed up in r320088; NFC.
Aaron Ballman [Thu, 7 Dec 2017 23:10:09 +0000 (23:10 +0000)]
Correct line endings that got mixed up in r320088; NFC.

llvm-svn: 320115

7 years agoFix more line endings changed in r320089. NFC.
Ahmed Bougacha [Thu, 7 Dec 2017 23:08:46 +0000 (23:08 +0000)]
Fix more line endings changed in r320089. NFC.

llvm-svn: 320114

7 years agoCorrect line endings that got mixed up in r320089; NFC.
Aaron Ballman [Thu, 7 Dec 2017 23:04:11 +0000 (23:04 +0000)]
Correct line endings that got mixed up in r320089; NFC.

llvm-svn: 320113

7 years agoRemove line-endings added by r320089. NFC.
Ahmed Bougacha [Thu, 7 Dec 2017 22:58:02 +0000 (22:58 +0000)]
Remove line-endings added by r320089. NFC.

llvm-svn: 320112

7 years ago[dump] Make LLVM_ENABLE_DUMP independent, and move to llvm-config.h
Don Hinton [Thu, 7 Dec 2017 22:55:40 +0000 (22:55 +0000)]
[dump] Make LLVM_ENABLE_DUMP independent, and move to llvm-config.h

Summary: Make LLVM_ENABLE_DUMP independent LLVM_ENABLE_ASSERTIONS,
move it to llvm-config.h, and update description.

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

llvm-svn: 320111

7 years ago[PowerPC][asan] Update asan to handle changed memory layouts in newer kernels
Bill Seurer [Thu, 7 Dec 2017 22:53:49 +0000 (22:53 +0000)]
[PowerPC][asan] Update asan to handle changed memory layouts in newer kernels

In more recent Linux kernels with 47 bit VMAs the layout of virtual memory
for powerpc64 changed causing the address sanitizer to not work properly. This
patch adds support for 47 bit VMA kernels for powerpc64 and fixes up test
cases.

https://reviews.llvm.org/D40908

There is an associated patch for trunk.

Tested on several 4.x and 3.x kernel releases.

llvm-svn: 320110

7 years ago[PowerPC][asan] Update asan to handle changed memory layouts in newer kernels
Bill Seurer [Thu, 7 Dec 2017 22:53:33 +0000 (22:53 +0000)]
[PowerPC][asan] Update asan to handle changed memory layouts in newer kernels

In more recent Linux kernels with 47 bit VMAs the layout of virtual memory
for powerpc64 changed causing the address sanitizer to not work properly. This
patch adds support for 47 bit VMA kernels for powerpc64 and fixes up test
cases.

https://reviews.llvm.org/D40907

There is an associated patch for compiler-rt.

Tested on several 4.x and 3.x kernel releases.

llvm-svn: 320109

7 years ago[DebugInfo] Fix register variables not showing up in pdb.
Zachary Turner [Thu, 7 Dec 2017 22:51:16 +0000 (22:51 +0000)]
[DebugInfo] Fix register variables not showing up in pdb.

Previously, when linking against libcmt from the MSVC runtime,
lld-link /verbose would show "Ignoring unknown symbol record
with kind 0x1006".  It turns out this was because
TypeIndexDiscovery did not handle S_REGISTER records, so these
records were not getting properly remapped.

Patch by: Alexnadre Ganea
Differential Revision: https://reviews.llvm.org/D40919

llvm-svn: 320108

7 years ago[ModRefInfo] Make enum ModRefInfo an enum class [NFC].
Alina Sbirlea [Thu, 7 Dec 2017 22:41:34 +0000 (22:41 +0000)]
[ModRefInfo] Make enum ModRefInfo an enum class [NFC].

Summary:
Make enum ModRefInfo an enum class. Changes to ModRefInfo values should
be done using inline wrappers.
This should prevent future bit-wise opearations from being added, which can be more error-prone.

Reviewers: sanjoy, dberlin, hfinkel, george.burgess.iv

Subscribers: llvm-commits

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

llvm-svn: 320107

7 years agoTemporarily revert "[PowerPC] Allow tail calls of fastcc functions from C CallingConv...
Eric Christopher [Thu, 7 Dec 2017 22:26:19 +0000 (22:26 +0000)]
Temporarily revert "[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions."

It is causing sanitizer failures on llvm tests in a bootstrapped compiler. No bot link since it's currently down, but following up to get the bot up.

This reverts commit r319218.

llvm-svn: 320106

7 years agoTest case update for D40873
Xinliang David Li [Thu, 7 Dec 2017 22:23:43 +0000 (22:23 +0000)]
Test case update for D40873

llvm-svn: 320105

7 years ago[PGO] detect infinite loop and form MST properly
Xinliang David Li [Thu, 7 Dec 2017 22:23:28 +0000 (22:23 +0000)]
[PGO] detect infinite loop and form MST properly

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

llvm-svn: 320104

7 years ago[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Thu, 7 Dec 2017 21:55:09 +0000 (21:55 +0000)]
[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 320091

7 years ago[MachineOutliner] Fix offset overflow check
Jessica Paquette [Thu, 7 Dec 2017 21:51:43 +0000 (21:51 +0000)]
[MachineOutliner] Fix offset overflow check

The offset overflow check before was incorrect. It would always give the
correct result, but it was comparing the SCALED potential fixed-up offset
against an UNSCALED minimum/maximum. As a result, the outliner was missing a
bunch of frame setup/destroy instructions that ought to have been safe to
outline. This fixes that, and adds an instruction to the .mir test that
failed the old test.

llvm-svn: 320090

7 years agoAdd new language mode flags for C17.
Aaron Ballman [Thu, 7 Dec 2017 21:46:26 +0000 (21:46 +0000)]
Add new language mode flags for C17.

This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode flags for C17 and updates the value of __STDC_VERSION__ to the value based on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is expected that we (and GCC) will add c18 flags as aliases once the ballot passes.

llvm-svn: 320089

7 years agoAdd support for the __has_c_attribute builtin preprocessor macro.
Aaron Ballman [Thu, 7 Dec 2017 21:37:49 +0000 (21:37 +0000)]
Add support for the __has_c_attribute builtin preprocessor macro.

This behaves similar to the __has_cpp_attribute builtin macro in that it allows users to detect whether an attribute is supported with the [[]] spelling syntax, which can be enabled in C with -fdouble-square-bracket-attributes.

llvm-svn: 320088

7 years ago[AMDGPU] Fix typo in Kernel Descriptor for GFX6-GFX9
Mark Searles [Thu, 7 Dec 2017 21:24:27 +0000 (21:24 +0000)]
[AMDGPU] Fix typo in Kernel Descriptor for GFX6-GFX9

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

llvm-svn: 320087

7 years ago[AMDGPU] Revert "[AMDGPU] Add options for waitcnt pass debugging; add instr count...
Mark Searles [Thu, 7 Dec 2017 21:14:41 +0000 (21:14 +0000)]
[AMDGPU] Revert "[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output."

Patch caused a buildbot failure; http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/15733/steps/build_Lld/logs/stdio :
lib/Target/AMDGPU/SIInsertWaitcnts.cpp:396:11: error: private field 'InstCnt' is not used [-Werror,-Wunused-private-field]
  int32_t InstCnt = 0;
          ^
1 error generated.
"
This reverts commit 71627f79010aafe74fdcba901bba28dd7caa0869.

llvm-svn: 320086

7 years ago[libclang] Record code-completion invocations to a temporary file when
Alex Lorenz [Thu, 7 Dec 2017 20:37:50 +0000 (20:37 +0000)]
[libclang] Record code-completion invocations to a temporary file when
requested by client

This is a follow up to r319702 which records parsing invocations.

These files are not emitted by default, and the client has to specify the
invocation emission path first.

rdar://35322543

llvm-svn: 320085

7 years ago[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output.
Mark Searles [Thu, 7 Dec 2017 20:36:39 +0000 (20:36 +0000)]
[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output.
-amdgpu-waitcnt-forcezero={1|0}  Force all waitcnt instrs to be emitted as s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-amdgpu-waitcnt-forceexp=<n>  Force emit a s_waitcnt expcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcelgkm=<n> Force emit a s_waitcnt lgkmcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcevm=<n>   Force emit a s_waitcnt vmcnt(0) before the first <n> instrs

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

llvm-svn: 320084

7 years ago[AMDGPU] Add GCNHazardRecognizer::checkInlineAsmHazards() and GCNHazardRecognizer...
Mark Searles [Thu, 7 Dec 2017 20:34:25 +0000 (20:34 +0000)]
[AMDGPU] Add GCNHazardRecognizer::checkInlineAsmHazards() and GCNHazardRecognizer::checkVALUHazardsHelper(). checkInlineAsmHazards() checks INLINEASM for hazards that we particularly care about (so not exhaustive); this patch adds a check for INLINEASM that defs vregs that hold data-to-be stored by immediately preceding store of more than 8 bytes. If the instr were not within an INLINEASM, this scenario would be handled by checkVALUHazard(). Add checkVALUHazardsHelper(), which will be called by both checkVALUHazards() and checkInlineAsmHazards().

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

llvm-svn: 320083

7 years ago[OpenMP] NVPTX: Set default/minimum compute capability to sm_35
George Rokos [Thu, 7 Dec 2017 20:27:31 +0000 (20:27 +0000)]
[OpenMP] NVPTX: Set default/minimum compute capability to sm_35

The current implementation of the nvptx runtime (to be upstreamed shortly) uses the atomicMax operation on 64-bit integers.
This is only supported in compute capabilities 3.5 and later. I've changed the clang default to sm_35.

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

llvm-svn: 320082

7 years ago[X86] Fix InsertBitToMaskVector to only issue KSHIFTS of native size so that upper...
Craig Topper [Thu, 7 Dec 2017 20:10:04 +0000 (20:10 +0000)]
[X86] Fix InsertBitToMaskVector to only issue KSHIFTS of native size so that upper bits are properly zeroed.

There's no v2i1 or v4i1 kshift, and v8i1 is only supported with AVXDQ. Isel has fake patterns to extend these types to native shifts, but makes no guarantees about the value of any bits shifted in when shifting right.

This patch promotes the vector to a type that supports a native shift first and only allows inserting into the msb of a native sized shift.

I've constructed this in a way that doesn't do the promotion if we're going to fallback to using a xmm/ymm/zmm shuffle. I think I have a plan to remove the shuffle fall back entirely. In which case we this can be simplified, but I wanted to fix the correctness issue first.

llvm-svn: 320081

7 years ago[X86] Fix typo in variable name. NFC
Craig Topper [Thu, 7 Dec 2017 20:10:01 +0000 (20:10 +0000)]
[X86] Fix typo in variable name. NFC

llvm-svn: 320080

7 years ago[X86] Make a couple helper lowering methods static.
Craig Topper [Thu, 7 Dec 2017 20:09:55 +0000 (20:09 +0000)]
[X86] Make a couple helper lowering methods static.

llvm-svn: 320079

7 years ago[OPENMP] Do not capture private variables in the target regions.
Alexey Bataev [Thu, 7 Dec 2017 19:49:28 +0000 (19:49 +0000)]
[OPENMP] Do not capture private variables in the target regions.

Private variables are completely redefined in the outlined regions, so
we don't need to capture them. Patch adds this behavior to the
target-based regions.

llvm-svn: 320078

7 years agoThese tests don't depend on debug info format.
Jim Ingham [Thu, 7 Dec 2017 19:44:09 +0000 (19:44 +0000)]
These tests don't depend on debug info format.

Mark them as such.

llvm-svn: 320077

7 years agoRevert "Temporarily pin tests to DWARF v2 until a more recent version of LLDB"
Adrian Prantl [Thu, 7 Dec 2017 19:40:31 +0000 (19:40 +0000)]
Revert "Temporarily pin tests to DWARF v2 until a more recent version of LLDB"

This reverts commit 319790.

We worked around the bug in LLVM instead.

llvm-svn: 320076

7 years agoupdate hwasan docs
Kostya Serebryany [Thu, 7 Dec 2017 19:21:30 +0000 (19:21 +0000)]
update hwasan docs

Summary:
* use more readable name
* document the hwasan attribute

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, cfe-commits

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

llvm-svn: 320075

7 years ago[clangd-fuzzer] Update contruction of LSPServer.
Matt Morehouse [Thu, 7 Dec 2017 19:04:27 +0000 (19:04 +0000)]
[clangd-fuzzer] Update contruction of LSPServer.

The constructor for ClangdLSPServer changed in r318412 and r318925,
breaking the clangd-fuzzer build.

llvm-svn: 320074

7 years ago[driver] Set the 'simulator' environment for Darwin when compiling for
Alex Lorenz [Thu, 7 Dec 2017 19:04:10 +0000 (19:04 +0000)]
[driver] Set the 'simulator' environment for Darwin when compiling for
iOS/tvOS/watchOS simulator

rdar://35135215

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

llvm-svn: 320073

7 years agoFurther simplify .gnu.hash writing. NFC.
Rafael Espindola [Thu, 7 Dec 2017 18:59:29 +0000 (18:59 +0000)]
Further simplify .gnu.hash writing. NFC.

llvm-svn: 320072

7 years agoDisable warnings related to anonymous types in the ObjC plugin
Vedant Kumar [Thu, 7 Dec 2017 18:57:09 +0000 (18:57 +0000)]
Disable warnings related to anonymous types in the ObjC plugin

This part of lldb make use of anonymous structs and unions. The usage is
idiomatic and doesn't deserve a warning. Logic in the NSDictionary and NSSet
plugins use anonymous structs in a manner consistent with the relevant Apple
frameworks.

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

llvm-svn: 320071

7 years agoSimplify .gnu.hash writing. NFC.
Rafael Espindola [Thu, 7 Dec 2017 18:51:19 +0000 (18:51 +0000)]
Simplify .gnu.hash writing. NFC.

llvm-svn: 320070

7 years agoAvoid using a temporary std::vector.
Rafael Espindola [Thu, 7 Dec 2017 18:46:03 +0000 (18:46 +0000)]
Avoid using a temporary std::vector.

With this memory usage when linking clang goes from 174.62MB to
172.77MB.

llvm-svn: 320069

7 years ago[InstCombine] add tests for abs using bit hackery; NFC
Sanjay Patel [Thu, 7 Dec 2017 18:13:33 +0000 (18:13 +0000)]
[InstCombine] add tests for abs using bit hackery; NFC

llvm-svn: 320068

7 years ago[SBBreakpointOptionCommon] Give this class an explicit destructor.
Davide Italiano [Thu, 7 Dec 2017 18:06:06 +0000 (18:06 +0000)]
[SBBreakpointOptionCommon] Give this class an explicit destructor.

llvm-svn: 320067

7 years ago[SBBreakpoint] Outline some functions to prevent to be exported.
Davide Italiano [Thu, 7 Dec 2017 18:06:06 +0000 (18:06 +0000)]
[SBBreakpoint] Outline some functions to prevent to be exported.

They're hidden, so all they cause is a linker warning.

ld: warning: cannot export hidden symbol
lldb::SBBreakpointNameImpl::operator==(lldb::SBBreakpointNameImpl const&) from
tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointName.cpp.o

llvm-svn: 320066

7 years ago[X86] Replace tabs with spaces. NFCI.
Simon Pilgrim [Thu, 7 Dec 2017 17:55:19 +0000 (17:55 +0000)]
[X86] Replace tabs with spaces. NFCI.

llvm-svn: 320065

7 years ago[X86] Tag BMI/BMI2/TBM instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 17:37:39 +0000 (17:37 +0000)]
[X86] Tag BMI/BMI2/TBM instructions scheduler classes

Put these under UNARY/BINOP ALU itinerary classes for now - seems to be a good average value

llvm-svn: 320064

7 years ago[Hexagon] Generate HVX code for basic arithmetic operations
Krzysztof Parzyszek [Thu, 7 Dec 2017 17:37:28 +0000 (17:37 +0000)]
[Hexagon] Generate HVX code for basic arithmetic operations

Handle and, or, xor, add, sub, mul for vectors of i8, i16, and i32.

llvm-svn: 320063

7 years ago[X86][TBM] Add TBM scheduling tests
Simon Pilgrim [Thu, 7 Dec 2017 17:23:00 +0000 (17:23 +0000)]
[X86][TBM] Add TBM scheduling tests

llvm-svn: 320062

7 years ago[CodeGen] Fix index when printing tied machine operands
Francis Visoiu Mistrih [Thu, 7 Dec 2017 17:12:30 +0000 (17:12 +0000)]
[CodeGen] Fix index when printing tied machine operands

llvm-svn: 320061

7 years ago[Target] Remove commented out code. Found by inspection. NFCI.
Davide Italiano [Thu, 7 Dec 2017 17:05:56 +0000 (17:05 +0000)]
[Target] Remove commented out code. Found by inspection. NFCI.

llvm-svn: 320060

7 years ago[X86] Rename function in recently added test case to not be 'main' returning 'void...
Craig Topper [Thu, 7 Dec 2017 17:02:49 +0000 (17:02 +0000)]
[X86] Rename function in recently added test case to not be 'main' returning 'void'. NFC

llvm-svn: 320059

7 years agoFix the test from r320056 on Windows
Alexander Richardson [Thu, 7 Dec 2017 16:41:43 +0000 (16:41 +0000)]
Fix the test from r320056 on Windows

llvm-svn: 320058

7 years ago[DebugInfo] Move this test to X86/ now that it specifies a triple.
Davide Italiano [Thu, 7 Dec 2017 16:10:39 +0000 (16:10 +0000)]
[DebugInfo] Move this test to X86/ now that it specifies a triple.

Should bring back the arm/arm64 bots. Reported by Yvan Roux.

llvm-svn: 320057

7 years ago[ELF][mips] Print the full file path for files with incompatible ISA
Alexander Richardson [Thu, 7 Dec 2017 16:08:59 +0000 (16:08 +0000)]
[ELF][mips] Print the full file path for files with incompatible ISA

Summary:
I also changed the message to print both the ISA and the the architecture
name for incompatible files. Previously it would be quite hard to find the
actual path of the incompatible object files in projects that have many
object files with the same name in different directories.

Reviewers: atanasyan, ruiu

Reviewed By: atanasyan

Subscribers: emaste, sdardis, llvm-commits

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

llvm-svn: 320056

7 years ago[X86] Tag SALC instructions scheduler class
Simon Pilgrim [Thu, 7 Dec 2017 16:07:06 +0000 (16:07 +0000)]
[X86] Tag SALC instructions scheduler class

Treat these the same as LAHF/SAHF (although its not a x86_64 instruction)

llvm-svn: 320055

7 years ago[X86] Add LAHF/SAHF scheduling test
Simon Pilgrim [Thu, 7 Dec 2017 16:04:20 +0000 (16:04 +0000)]
[X86] Add LAHF/SAHF scheduling test

llvm-svn: 320054

7 years ago[X86][VMX] Tag VMX instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 15:57:32 +0000 (15:57 +0000)]
[X86][VMX] Tag VMX instructions scheduler classes

Tagged all as system instructions

llvm-svn: 320053

7 years ago[X86] Add SALC scheduling test
Simon Pilgrim [Thu, 7 Dec 2017 15:46:58 +0000 (15:46 +0000)]
[X86] Add SALC scheduling test

llvm-svn: 320052

7 years ago[X86] Tag LZCNT/TZCNT instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 15:24:14 +0000 (15:24 +0000)]
[X86] Tag LZCNT/TZCNT instructions scheduler classes

Tagged as IMUL instructions for a reasonable approximation (ALU tends to be a lot faster) - POPCNT is currently tagged as FAdd which I think should be replaced with IMUL as well

llvm-svn: 320051

7 years ago[DAGCombiner] eliminate shuffle of insert element
Sanjay Patel [Thu, 7 Dec 2017 15:17:58 +0000 (15:17 +0000)]
[DAGCombiner] eliminate shuffle of insert element

I noticed this pattern in D38316 / D38388. We failed to combine a shuffle that is either
repeating a scalar insertion at the same position in a vector or translated to a different
element index.

Like the earlier patch, this could be an instcombine too, but since we opted to make this
a DAG transform earlier, I've made this one a DAG patch too.

We do not need any legality checking because the new insert is identical to the existing
insert except that it may have a different constant insertion operand.

The constant insertion test in test/CodeGen/X86/vector-shuffle-combining.ll was the
motivation for D38756.

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

llvm-svn: 320050

7 years ago[InstCombine] Don't crash on out of bounds index in the insertelement
Igor Laevsky [Thu, 7 Dec 2017 15:00:52 +0000 (15:00 +0000)]
[InstCombine] Don't crash on out of bounds index in the insertelement

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

llvm-svn: 320049

7 years ago[X86][FMA] Regenerate fma schedule tests
Simon Pilgrim [Thu, 7 Dec 2017 14:51:47 +0000 (14:51 +0000)]
[X86][FMA] Regenerate fma schedule tests

llvm-svn: 320048

7 years ago[X86][SVM] Tag SVM instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 14:35:17 +0000 (14:35 +0000)]
[X86][SVM] Tag SVM instructions scheduler classes

Tagged all as system instructions

llvm-svn: 320047

7 years ago[CodeGen] Use more getMFIfAvailable
Francis Visoiu Mistrih [Thu, 7 Dec 2017 14:32:15 +0000 (14:32 +0000)]
[CodeGen] Use more getMFIfAvailable

llvm-svn: 320046

7 years ago[X86] Tag RDRAND/RDSEED instruction scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 14:18:48 +0000 (14:18 +0000)]
[X86] Tag RDRAND/RDSEED instruction scheduler classes

llvm-svn: 320045

7 years ago[X86][X87] X87 math binop pseudo instructions don't need scheduling info
Simon Pilgrim [Thu, 7 Dec 2017 14:07:18 +0000 (14:07 +0000)]
[X86][X87] X87 math binop pseudo instructions don't need scheduling info

llvm-svn: 320044

7 years ago[X86][SSE42] SSE42 string pseudo instructions don't need scheduling info
Simon Pilgrim [Thu, 7 Dec 2017 13:52:07 +0000 (13:52 +0000)]
[X86][SSE42] SSE42 string pseudo instructions don't need scheduling info

llvm-svn: 320043