Commit Graph

251458 Commits

Author SHA1 Message Date
Reid Kleckner 887602ae73 [CUDA] Add a host target triple to cuda-version-check.cu
It passes --sysroot for the Linux CUDA installation. To make this test
pass when targetting Windows, you would need to pass
--sysroot=Inputs/CUDA-windows.

llvm-svn: 291255
2017-01-06 18:16:03 +00:00
Chad Rosier e177185e79 [AArch64] Reduce vector insert/extract cost for Falkor.
Differential Revision: https://reviews.llvm.org/D28403

llvm-svn: 291254
2017-01-06 18:03:26 +00:00
Akira Hatanaka d62f2c8c0a Make ASTContext::getDeclAlign return the correct alignment for
FunctionDecls.

This commit silences an incorrect warning that is issued when a function
pointer is cast to another function pointer type. The warning gets
issued because alignments of the source and destination do not match in
Sema::CheckCastAlign, which happens because ASTContext::getTypeInfoImpl
and ASTContext::getDeclAlign return different values for functions (the
former returns 4 while the latter returns 1).

This should fix PR31558.

rdar://problem/29533528

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

llvm-svn: 291253
2017-01-06 17:56:15 +00:00
David Blaikie 98f0af4b3e Revert "Fix examples for recent shared_ptrification"
(should've rolled in to this revert of the CompilerInstance change in
the first place... anyway)

This reverts commit r291185.

llvm-svn: 291252
2017-01-06 17:50:34 +00:00
David Blaikie 2376c392f7 Revert "Fix for shared_ptrification in Clang"
The original commit caused an asan-detected memory leak in Clang.
Reverting while I investigate.

This reverts commit r291186.

llvm-svn: 291251
2017-01-06 17:47:19 +00:00
David Blaikie 64fb405836 Revert "Fixes for Clang API changes to use std::shared_ptr"
The original Clang change caused a memory leak detected by asan.
Reverting while I investigate.

This reverts commit r291200.

llvm-svn: 291250
2017-01-06 17:47:15 +00:00
David Blaikie 81d0829438 Revert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer"
Caused a memory leak reported by asan. Reverting while I investigate.

This reverts commit r291184.

llvm-svn: 291249
2017-01-06 17:47:10 +00:00
Simon Pilgrim 3128d6b520 [X86][SSE] Pass float domain flag to shuffle combine match functions. NFCI.
Early step towards ignoring domain above a certain shuffle depth.

llvm-svn: 291248
2017-01-06 17:34:30 +00:00
Tobias Grosser cdbe5c9d6c Fix some typos in comments
llvm-svn: 291247
2017-01-06 17:30:34 +00:00
Konstantin Zhuravlyov 31dbb0391d [AMDGPU] Remove extra semicolon. NFC
llvm-svn: 291246
2017-01-06 17:23:21 +00:00
Konstantin Zhuravlyov 67a6d5401a [AMDGPU] Do not emit .AMDGPU.config section for amdhsa
Differential Revision: https://reviews.llvm.org/D27732

llvm-svn: 291245
2017-01-06 17:02:10 +00:00
Simon Pilgrim bd3c6824d4 [X86][SSE] Simplify float domain requirement in unary shuffle matching.
The AVX1-only limit is never actually required in matchUnaryVectorShuffle

llvm-svn: 291244
2017-01-06 17:00:59 +00:00
Konstantin Zhuravlyov de70a8807f [OpenCL] Re-enable supported core extensions based on opencl version when disabling all extensions using pragma
Differential Revision: https://reviews.llvm.org/D28257

llvm-svn: 291243
2017-01-06 16:14:41 +00:00
Simon Pilgrim 9122793b15 [X86][AVX] Regenerate shuffle 128-bit tests.
The EVEX -> VEX fix means that AVX/AVX512 code is more likely the same now.

llvm-svn: 291242
2017-01-06 15:56:52 +00:00
Simon Pilgrim 10cc5d555f [X86][AVX] Regenerate tzcnt tests.
The EVEX -> VEX fix means that AVX/AVX512 code is more likely the same now.

llvm-svn: 291241
2017-01-06 15:54:23 +00:00
Simon Pilgrim a08d7b9913 Remove trailing whitespace. NFCI.
llvm-svn: 291240
2017-01-06 15:31:52 +00:00
Simon Pilgrim 9b8c7caf4e [X86] Add X86Subtarget argument. NFCI.
All callers of getTargetVShiftNode have access to X86Subtarget already so pass it along instead of re-extracting it.

llvm-svn: 291239
2017-01-06 15:29:17 +00:00
Filipe Cabecinhas 4647b74b51 [ASan] Make ASan instrument variable-masked loads and stores
Summary: Previously we only supported constant-masked loads and stores.

Reviewers: kcc, RKSimon, pgousseau, gbedwell, vitalybuka

Subscribers: llvm-commits

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

llvm-svn: 291238
2017-01-06 15:24:51 +00:00
Filipe Cabecinhas b5304e25fc [ubsan] Minimize size of data for type_mismatch (Redo of D19668)
Summary: This is the compiler-rt side of D28242.

Reviewers: kcc, vitalybuka, pgousseau, gbedwell

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 291237
2017-01-06 14:40:28 +00:00
Filipe Cabecinhas fe5e5afd53 [ubsan] Minimize size of data for type_mismatch (Redo of D19667)
Summary:
This patch makes the type_mismatch static data 7 bytes smaller (and it
ends up being 16 bytes smaller due to alignment restrictions, at least
on some x86-64 environments).

It revs up the type_mismatch handler version since we're breaking binary
compatibility. I will soon post a patch for the compiler-rt side.

Reviewers: rsmith, kcc, vitalybuka, pgousseau, gbedwell

Subscribers: llvm-commits

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

llvm-svn: 291236
2017-01-06 14:40:12 +00:00
Daniel Sanders 12360efa76 [globalisel] Stop requiring -debug/-debug-only=registerbankinfo for assertions.
Summary:
I've noticed that these assertions don't trigger when the condition is false.
The problem is that the DEBUG(x) macro only executes x when the pass is
emitting debug output via the -debug and -debug-only=registerbankinfo command
line arguments.

Debug builds should always execute the assertions so use '#ifndef NDEBUG' instead.

Also removed an assertion that is only true the first time it's tested. <Target>RegisterBankInfo's constructor will re-use register banks causing them to be valid on subsequent tests. That
assertion will fail on the first test too in the near future.

Reviewers: t.p.northover, ab, rovka, qcolombet

Subscribers: dberris, llvm-commits, kristof.beyls

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

llvm-svn: 291235
2017-01-06 14:29:34 +00:00
Pavel Labath c523c38fcc Another windows build fix
llvm-svn: 291234
2017-01-06 13:07:09 +00:00
Pavel Labath bda6fb7389 Attempt to fix windows build for r291198
llvm-svn: 291233
2017-01-06 12:41:15 +00:00
Alex Lorenz 6e0f393e12 [CodeCompletion] Block property setters: Use dynamic priority heuristic
Now when completing blocks properties that return void the block call completion
result shows up before the setter, otherwise the setter completion shows up
before the block call completion. We normally want to use the result of the
block call, so one typically wouldn't call a block that returns a non-void type
in a standalone statement.

rdar://28846153

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

llvm-svn: 291232
2017-01-06 12:00:44 +00:00
Alex Lorenz c7dc1a2a3c [ObjC] The declarator for a block literal should be a definition
This change avoids the -Wstrict-prototypes warning for block literals with an
empty argument list or without argument lists.

rdar://15060615

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

llvm-svn: 291231
2017-01-06 11:31:12 +00:00
Yaron Keren 01dd2f7b44 Constify UsingPackDecl::getInstantiatedFromUsingDecl(), NFC.
llvm-svn: 291230
2017-01-06 11:15:57 +00:00
Simon Pilgrim d8333372bc [CostModel][X86] Fix 512-bit SDIV/UDIV 'big' costs.
Set the costs on the lowest target that supports the type.

llvm-svn: 291229
2017-01-06 11:12:53 +00:00
Simon Pilgrim 441d1d35d2 [CostModel][X86] Add SDIV/UDIV cost tests for a wider range of targets
Added a test demonstrating bug in AVX512 division costs

llvm-svn: 291228
2017-01-06 11:02:40 +00:00
Daniel Jasper 965d802ec7 Move test input to directory called Inputs.
It is a common convention that our internal test runner depends upon.

llvm-svn: 291227
2017-01-06 10:22:15 +00:00
Pavel Labath 684c2c9394 Fix clang build for r291198
Older clangs (<=3.6) complain about a redefinition when we try to specialize a
templace function declared with = delete. Instead, I just don't define the
function body, which will trigger a linker error  if someone tries to use an
unknown function.

llvm-svn: 291226
2017-01-06 10:20:32 +00:00
Pavel Labath a284b76d9e Revert "XFAIL an lldb-mi test"
The clang bug is fixed now. This reverts commit r291100.

llvm-svn: 291225
2017-01-06 10:20:29 +00:00
Rui Ueyama 7a8ff1368a Unbreak Darwin buildbots.
llvm-svn: 291224
2017-01-06 10:15:47 +00:00
Rui Ueyama b4c63caf76 Rename lld::stringize -> lld::toString.
llvm-svn: 291223
2017-01-06 10:04:35 +00:00
Rui Ueyama ce039266c1 Merge elf::toString and coff::toString.
The two overloaded functions hid each other. This patch merges them.

llvm-svn: 291222
2017-01-06 10:04:08 +00:00
Rui Ueyama dac6169214 Remove lld::convertToUnixPathSeparator.
Now TarWriter takes care of path separator conversion, so we don't
need to handle that in LLD.

llvm-svn: 291221
2017-01-06 09:38:43 +00:00
Pavel Labath 927ec4b5ac Consolidate file handle usage in Editline.cpp
Summary:
To implement wide character reading, editline was mixing FILE*-based access with
a Connection-based one (plus it did some selects on the raw FD), which is very
fragile. Here, I replace it with one which uses only a Connection-based reads.
The code is somewhat longer as I had to read characters one by one to detect the
end of the multibyte sequence.

I've verified that international characters still work in lldb command line on
OSX.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 291220
2017-01-06 09:27:38 +00:00
Rui Ueyama 214a897681 Use \ as the path separator on Windows.
Previously, when we printed out a path obtained from DWARF debug info,
we replaced \ with / on Windows. But that doesn't make sense. We should
respect the system's path separator.

llvm-svn: 291219
2017-01-06 08:59:32 +00:00
Michal Gorny 1099e017f6 [llvm-config] Add --cmakedir to obtain CMake module location
Add a --cmakedir option to llvm-config that returns the correct path to
built/installed CMake modules (i.e. lib/cmake/llvm). This is mostly
intended as a convenience option for stand-alone builds of other LLVM
projects that frequently reconstruct LLVM_CMAKE_PATH after querying
llvm-config.

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

llvm-svn: 291218
2017-01-06 08:23:33 +00:00
Michal Gorny c74123bdff [cmake] Disable appending -msse4.2 flag implicitly
Disable the code appending -msse4.2 flag implicitly when the compiler
supports it. The compiler support for this flags do not indicate that
the underlying CPU will support SSE4.2, and passing it may result in
SSE4.2 code being emitted *implicitly*.

If the target platform supports SSE4.2 appropriately, the relevant bits
should be already enabled via -march= or equivalent. In this case
passing -msse4.2 is redundant.

If a runtime detection is desired (which seems to be a case with SCUDO),
then (as gcc manpage points out) the specific SSE4.2 needs to be
isolated into a separate file, the -msse4.2 flag can be forced only
for that file and the function defined in that file can only be called
when the CPU is determined to support SSE4.2.

This fixes SIGILL on SCUDO when it is compiled using gcc-5.4.

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

llvm-svn: 291217
2017-01-06 08:21:02 +00:00
Lang Hames 702b3e494f [Orc][RPC] Fix an obvious locking-order bug in RawByteChannel::startSendMessage.
The lock needs to be acquired before the data is sent, not afterwards. This
think-o slipped in during the refactor in r286620, but went unnoticed as the
resulting bug only manifests in multi-threaded clients (of which there are none
in-tree).

No unit test as the bug depends on thread scheduling.

llvm-svn: 291216
2017-01-06 06:22:31 +00:00
Rui Ueyama f2a6275116 TarWriter: Emit PAX headers only when needed.
We use PAX headers to store long filenames (>= 100 bytes).
It is not needed to emit PAX headers if filenames fit in the
Ustar header. This patch implements that optimization.

llvm-svn: 291215
2017-01-06 05:33:45 +00:00
Craig Topper e86fb932ea [AVX-512] Add EXTRACT_SUBVECTOR support to combineBitcastForMaskedOp.
llvm-svn: 291214
2017-01-06 05:18:48 +00:00
Craig Topper 8cbac879db [AVX-512] Add more masked vector extract test cases with and without a bitcast between the select.
The ones with the bitcast need additional work to fold the mask operation properly. This will be fixed in a future commit.

llvm-svn: 291213
2017-01-06 05:18:44 +00:00
Rui Ueyama 0b3b813172 Attempt to unbreak buildbots.
llvm-svn: 291212
2017-01-06 02:54:38 +00:00
David Majnemer 9e04befb09 [SelectionDAG] Rework lowerRangeToAssertZExt
Utilize ConstantRange to make it easier to interpret range metadata.

llvm-svn: 291211
2017-01-06 02:43:28 +00:00
Rui Ueyama 7f1f912794 Use TarWriter to create tar archives instead of cpio.
This is how we use TarWriter in LLD. Now LLD does not append
a file extension, so you need to pass `--reproduce foo.tar`
instead of `--reproduce foo`.

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

llvm-svn: 291210
2017-01-06 02:33:53 +00:00
Rui Ueyama 4bb7883f0c Add a class to create a tar archive file.
In LLD, we create cpio archive files for --reproduce command.
cpio was not a bad choice because it is very easy to create, but
it was sometimes hard to use because people are not familiar with
cpio command.

I noticed that creating a tar archive isn't as hard as I thought.
So I implemented it in this patch.

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

llvm-svn: 291209
2017-01-06 02:29:48 +00:00
Saleem Abdulrasool 3f4ab5c0c6 CodeGen: address post commit review comments for r291123
This test would force the execution of the backend.  However, the
backend already has a test for this.  Effectively, this was trying to
test that an API call was made properly.  We do not have a good way to
really test this.  The test itself tested very little.

Addresses post-commit review comments from Eric Christopher.

llvm-svn: 291208
2017-01-06 02:27:40 +00:00
Bob Wilson 37df90a474 Revert "Use _Unwind_Backtrace on Apple platforms."
This reverts commit 63165f6ae3bac1623be36d4b3ce63afa1d51a30a.

After making this change, I discovered that _Unwind_Backtrace is
unable to unwind past a signal handler after an assertion failure.
I filed a bug report about that issue in rdar://29866587 but even if
we get a fix soon, it will be awhile before it get released.

llvm-svn: 291207
2017-01-06 02:26:33 +00:00
Bob Wilson d39ead4105 Disable sigaltstack on Apple platforms
Using sigaltstack on Apple platforms is a bad idea. Darwin's backtrace()
function does not work with sigaltstack, and my change in r286851 was
supposed to solve that by using _Unwind_Backtrace instead. I tested that
_Unwind_Backtrace works for crashes but then discovered that it does not
work for assertion failures when using sigaltstack, at least on macOS.
The stack trace shows only the frames on the alternate stack.
I also saw some reports of this happening for crashes, but it fails
consistently for assertion failures. I tried various things to get it to
work but the problem seems to be in _Unwind_Backtrace itself. Disabling
sigaltstack is unfortunate since it would be nice to get backtraces for
stack overflows, but at least this gets us backtraces for the more common
cases. rdar://problem/29662459

llvm-svn: 291206
2017-01-06 02:26:30 +00:00