Commit Graph

315024 Commits

Author SHA1 Message Date
Tom Stellard 0184819e81 Revert lib/Header: Fix Visual Studio builds
This reverts r359257 (git commit 00d9789509)

This broke check-clang.

llvm-svn: 359258
2019-04-26 01:43:59 +00:00
Tom Stellard 00d9789509 lib/Header: Fix Visual Studio builds
Summary:
This is a follow up to r355253, which inadvertently broke Visual
Studio builds by trying to copy files from CMAKE_CFG_INTDIR.

See https://reviews.llvm.org/D58537#inline-532492

Reviewers: smeenai, vzakhari, phosek

Reviewed By: smeenai

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 359257
2019-04-26 01:18:59 +00:00
Eric Fiselier eea2287f83 add tuple_cat test for const T
llvm-svn: 359256
2019-04-26 01:06:32 +00:00
Eric Fiselier 7e528bc4ce Fix return type of std::tuple_cat.
When the arguments to tuple cat were const, the const was incorrectly
propagated into the type of the resulting tuple. For example:

const std::tuple<int> t(42);
auto r = std::tuple_cat(t, t);
// Incorrect! should be std::tuple<int, int>.
static_assert(is_same_v<decltype(r), std::tuple<const int, const int>>);

llvm-svn: 359255
2019-04-26 01:02:18 +00:00
Matt Morehouse 1b76063a5e [libFuzzer] Disable MSan interceptors in SIGINT handler.
Summary:
Avoids an MSan false positive if the SIGINT comes while the user
callback is running.  The false positive happens when the interrupt
handler calls opendir() to remove some temporary files, which is
intercepted by MSan.

Fixes https://github.com/google/oss-fuzz/issues/2332.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits, Dor1s, metzman

Tags: #llvm

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

llvm-svn: 359254
2019-04-26 00:17:41 +00:00
Justin Bogner df5d2b3846 [GlobalOpt] Swap the expensive check for cold calls with the cheap TTI check
isValidCandidateForColdCC is much more expensive than
TTI.useColdCCForColdCall, which by default just returns false. Avoid
doing this work if we're not going to look at the answer anyway.

This change is NFC, but I see significant compile time improvements on
some code with pathologically many functions.

llvm-svn: 359253
2019-04-26 00:12:50 +00:00
Lang Hames 4f71049a39 [ORC] Remove symbols from dependency lists when failing materialization.
When failing materialization of a symbol X, remove X from the dependants list
of any of X's dependencies. This ensures that when X's dependencies are
emitted (or fail themselves) they do not try to access the no-longer-existing
MaterializationInfo for X.

llvm-svn: 359252
2019-04-25 23:31:33 +00:00
Reid Kleckner 1be5369a0c Revert [COFF] Statically link certain runtime library functions
This reverts r359250 (git commit 4730604bd3)

The newly added test should use -cc1 and -emit-llvm and there are other
test failures that need fixing.

llvm-svn: 359251
2019-04-25 23:30:41 +00:00
Reid Kleckner 4730604bd3 [COFF] Statically link certain runtime library functions
Statically link certain runtime library functions for MSVC/GNU Windows
environments. This is consistent with MSVC behavior.

Fixes LNK4286 and LNK4217 warnings from link.exe when linking the static
CRT:
  LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.x86_64-calls.o'
  LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_test_main.cc.x86_64-calls.o'
  LINK : warning LNK4217: symbol '_CxxThrowException' defined in 'libvcruntime.lib(throw.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.x86_64-calls.o' in function '"int `public: static class UnitTest::GetInstance * __cdecl testing::UnitTest::GetInstance(void)'::`1'::dtor$5" (?dtor$5@?0??GetInstance@UnitTest@testing@@SAPEAV12@XZ@4HA)'

Reviewers: mstorsjo, efriedma, TomTan, compnerd, smeenai, mgrang

Subscribers: abdulras, theraven, smeenai, pcc, mehdi_amini, javed.absar, inglorion, kristof.beyls, dexonsmith, cfe-commits

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

llvm-svn: 359250
2019-04-25 23:04:20 +00:00
Davide Italiano 2d6e156e40 [TestTemplateFunction] Add a missing debug info variant.
llvm-svn: 359249
2019-04-25 22:53:10 +00:00
Artem Belevich 5fe85a003f [CUDA] Implemented _[bi]mma* builtins.
These builtins provide access to the new integer and
sub-integer variants of MMA (matrix multiply-accumulate) instructions
provided by CUDA-10.x on sm_75 (AKA Turing) GPUs.

Also added a feature for PTX 6.4. While Clang/LLVM does not generate
any PTX instructions that need it, we still need to pass it through to
ptxas in order to be able to compile code that uses the new 'mma'
instruction as inline assembly (e.g used by NVIDIA's CUTLASS library
https://github.com/NVIDIA/cutlass/blob/master/cutlass/arch/mma.h#L101)

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

llvm-svn: 359248
2019-04-25 22:28:09 +00:00
Artem Belevich 16737538f4 PTX 6.3 extends `wmma` instruction to support s8/u8/s4/u4/b1 -> s32.
All of the new instructions are still handled mostly by tablegen. I've slightly
refactored the code to drive intrinsic/instruction generation from a master
list of supported variants, so all irregularities have to be implemented in one place only.

The test generation script wmma.py has been refactored in a similar way.

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

llvm-svn: 359247
2019-04-25 22:27:57 +00:00
Artem Belevich 8d825b38ed [NVPTX] generate correct MMA instruction mnemonics with PTX63+.
PTX 6.3 requires using ".aligned" in the MMA instruction names.
In order to generate correct name, now we pass current
PTX version to each instruction as an extra constant operand
and InstPrinter adjusts its output accordingly.

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

llvm-svn: 359246
2019-04-25 22:27:46 +00:00
Artem Belevich 7ecd82ce19 [NVPTX] Refactor generation of MMA intrinsics and instructions. NFC.
Generalized constructions of 'fragments' of MMA operations to provide
common primitives for construction of the ops. This will make it easier
to add new variants of the instructions that operate on integer types.

Use nested foreach loops which makes it possible to better control
naming of the intrinsics.

This patch does not affect LLVM's output, so there are no test changes.

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

llvm-svn: 359245
2019-04-25 22:27:35 +00:00
Sean Fertile a93a33cb87 [Object][XCOFF] Add intial support for section header table.
Adds a representation of the section header table to XCOFFObjectFile,
and implements enough to dump the section headers with llvm-obdump.

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

llvm-svn: 359244
2019-04-25 21:36:04 +00:00
Richard Smith de329354aa Remove incorrect explicit instantiation declarations for valarray
libc++ ABI v1 provides three valarray symbols as part of the shared library:

valarray<size_t>::valarray(size_t)
valarray<size_t>::~valarray()
valarray<size_t>::resize(size_t, size_t)

The first two of these are intended to be removed in V2 of the ABI: they're
attributed _LIBCPP_HIDE_FROM_ABI_AFTER_V1, and  it appears that the intention
is that these symbols from the library are not used even when building using
the V1 ABI. However, there are explicit instantiation declarations for all
three symbols in the header, which are not correct as we do not intend to find
an instantiation of these functions that is provided elsewhere.

(A recent change to clang to properly diagnose explicit instantiation
declarations of internal linkage functions -- required by [temp.explicit]p13 --
had to be rolled back because it diagnosed these explicit instantiations.)

Remove the explicit instantiation declarations, and remove the explicit
instantiation definitions for V2 of the libc++ ABI onwards.

llvm-svn: 359243
2019-04-25 21:31:58 +00:00
Keno Fischer e008be2b07 [CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPC
Summary:
This value is derived from the host triple, which on the machine
I'm currently using is `ppc64le-linux-redhat`. This change makes
LLVM compile.

Reviewers: nemanjai
Differential Revision: https://reviews.llvm.org/D57118

llvm-svn: 359242
2019-04-25 21:28:03 +00:00
Rong Xu cef8481af0 [PGO] Fix buildbot failure in 359215
Revert the part of changes in r359215 that failing in some platforms.
I will re-enable them later.

llvm-svn: 359241
2019-04-25 21:16:41 +00:00
Jason Molenda 1cb2c21fb4 Another use of the interactive lldb.debugger.
llvm-svn: 359240
2019-04-25 20:45:10 +00:00
Stanislav Mekhanoshin 917c477a07 [AMDGPU] gfx1010 - fix ubsan failure
Revert DecoderNamespace in one place for now. It will need more
changes to properly work.

llvm-svn: 359239
2019-04-25 20:39:06 +00:00
Sanjay Patel 7a2718181e [x86] add tests for vector fdiv reciprocal estimate; NFC
llvm-svn: 359238
2019-04-25 20:35:47 +00:00
Artem Dergachev ecefce6a49 [analyzer] Add FIXMEs for alpha.unix.cstring.OutOfBounds false positives.
Caused by incorrect strlcat() modeling in r332303,
cf. https://bugs.llvm.org/show_bug.cgi?id=37687#c8

llvm-svn: 359237
2019-04-25 20:30:14 +00:00
David Blaikie 0c4dbf9ecd Assigning to a local object in a return statement prevents copy elision. NFC.
I added a diagnostic along the lines of `-Wpessimizing-move` to detect `return x = y` suppressing copy elision, but I don't know if the diagnostic is really worth it. Anyway, here are the places where my diagnostic reported that copy elision would have been possible if not for the assignment.

P1155R1 in the post-San-Diego WG21 (C++ committee) mailing discusses whether WG21 should fix this pitfall by just changing the core language to permit copy elision in cases like these.

(Kona update: The bulk of P1155 is proceeding to CWG review, but specifically *not* the parts that explored the notion of permitting copy-elision in these specific cases.)

Reviewed By: dblaikie

Author: Arthur O'Dwyer

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

llvm-svn: 359236
2019-04-25 20:09:00 +00:00
David Blaikie f0d66559ea Skip type units/type uniquing when we know we're only emitting the type once (vtable-based emission when triggered by a strong vtable, with -fno-standalone-debug)
(this would regress size without a corresponding LLVM change that avoids
putting other user defined types inside type units when they aren't in
their own type units - instead emitting declarations inside the type
unit and a definition in the primary CU)

Reviewers: aprantl

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

llvm-svn: 359235
2019-04-25 20:05:47 +00:00
Jason Molenda 3775794812 Two tests were using the interactive convenience variable
lldb.debugger.  They should not be.
<rdar://problem/50210340> 

llvm-svn: 359234
2019-04-25 20:03:39 +00:00
Martin Storsjo ceb71e887b [Windows] Separate elements in -print-search-dirs with semicolons
Path lists on windows should always be separated by semicolons, not
colons. Reuse llvm::sys::EnvPathSeparator for this purpose (as that's
also a path list that is separated in the same way).

Alternatively, this could just be a local ifdef _WIN32 in this function,
or generalizing the existing EnvPathSeparator to e.g. a
llvm::sys::path::PathListSeparator?

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

llvm-svn: 359233
2019-04-25 20:03:20 +00:00
Richard Smith ae62727a28 Remove libc++ checks and workarounds for unsupported old versions of GCC (<4.9).
Differential Revision: https://reviews.llvm.org/D61107

llvm-svn: 359232
2019-04-25 20:02:10 +00:00
Jessica Paquette f54258c888 [GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16s
This case was missing before, so we couldn't legalize it.

Add it to AArch64LegalizerInfo.cpp and update select-extract-vector-elt.mir.

llvm-svn: 359231
2019-04-25 20:00:57 +00:00
Kristof Umann f46c58e0c6 [analyzer][UninitializedObjectChecker] PR41590: Regard _Atomic types as primitive
https://bugs.llvm.org/show_bug.cgi?id=41590

For the following code snippet, UninitializedObjectChecker crashed:

struct MyAtomicInt {
  _Atomic(int) x;
  MyAtomicInt() {}
};

void entry() {
  MyAtomicInt b;
}

The problem was that _Atomic types were not regular records, unions,
dereferencable or primitive, making the checker hit the llvm_unreachable at
lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:347.
The solution is to regard these types as primitive as well. The test case shows
that with this addition, not only are we able to get rid of the crash, but we
can identify x as uninitialized.

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

llvm-svn: 359230
2019-04-25 20:00:51 +00:00
Richard Smith 65d4d5e9e7 Fix buildbot failures after r359159.
std::mutex was not actually is_nothrow_default_constructible in C++98/C++03,
because the variable declaration

  std::mutex M;

... could throw an exception from the mutex destructor. Fix it by marking the
destructor as non-throwing. This has no effect in C++11 onwards, because
destructors are non-throwing by default in those language modes.

llvm-svn: 359229
2019-04-25 20:00:06 +00:00
Michal Gorny 3bf8d7639f [lldb] [lit] Use constexpr and better constraints in Register tests
Use constexpr to explicitly indicate that we're dealing with integer
constants, and provoke clang to assign them straight to registers
whenever possible.  Adjust input constraints in %mmN tests to "rm"
as using integer constants is apparently disallowed there.  Also
use "i" for %rN tests, as we don't want clang to accidentally clobber
those general purpose registers while assigning to them (however
unlikely that is).

llvm-svn: 359228
2019-04-25 19:56:54 +00:00
Martin Storsjo 2bbb7feda8 Set _LIBCPP_DLL_VIS on _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS in MinGW mode
Contrary to MSVC, MinGW compilers wants the dllexport attribute on
the declaration of an explicit template instantiation, not on the
definition.

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

llvm-svn: 359227
2019-04-25 19:46:28 +00:00
Akira Hatanaka 8edf8f317b [ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
it keeps track of becomes too large

ARC optimizer does a top-down and a bottom-up traversal of the whole
function to pair up retain and release instructions and remove them.
This can be expensive if the number of instructions in the function and
pointer states it tracks are large since it has to look at each pointer
state and determine whether the instruction being visited can
potentially use the pointer.

This patch adds a command line option that sets a limit to the number of
pointers it tracks.

rdar://problem/49477063

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

llvm-svn: 359226
2019-04-25 19:42:55 +00:00
Stanislav Mekhanoshin 2c97ff07bf [AMDGPU] gfx1010 VOP1 instructions
Differential Revision: https://reviews.llvm.org/D61099

llvm-svn: 359225
2019-04-25 19:01:51 +00:00
Stanislav Mekhanoshin 956b0be72e [AMDGPU] gfx1010 utility functions
Differential Revision: https://reviews.llvm.org/D61094

llvm-svn: 359224
2019-04-25 18:53:41 +00:00
Matt Morehouse e9640afddd [libFuzzer] Require linux for libcxx.test
llvm-svn: 359223
2019-04-25 18:42:30 +00:00
Jessica Paquette 8184b6e7f6 [GlobalISel][AArch64] Add generic legalization rule for extends
This adds a legalization rule for G_ZEXT, G_ANYEXT, and G_SEXT which allows
extends whenever the types will fit in registers (or the source is an s1).

Update tests. Add GISel checks throughout all of arm64-vabs.ll,
where we now select a good portion of the code. Add GISel checks to
arm64-subvector-extend.ll, which has a good number of vector extends in it.

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

llvm-svn: 359222
2019-04-25 18:42:00 +00:00
Michal Gorny 8879bba679 [lldb] [lit] Un-XFAIL Register/x86-64-read.test for Darwin
llvm-svn: 359221
2019-04-25 18:38:58 +00:00
Casey Carter 413732354d [libc++][test] Fix noexcept assertions in variant's get tests
All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+.

Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers.

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

llvm-svn: 359220
2019-04-25 18:36:29 +00:00
Craig Topper f9c30eddd0 [SelectionDAG][X86] Use stack load/store in PromoteIntRes_BITCAST when the input needs to be be split and the output type is a vector.
We had special case handling here, but it uses a scalar any_extend for the
promotion then bitcasts to the final type. This won't split up the input data
into multiple promoted elements like we need.

This patch falls back to doing the conversion through memory.

Fixes PR41594 which I believe was reflected in the bitcast-vector-bool.ll
changes. The changes to vector-half-conversions.ll are fixing a previously
unknown miscompile from this issue.

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

llvm-svn: 359219
2019-04-25 18:19:59 +00:00
Matt Morehouse 42ef2c6d06 [compiler-rt] Build custom libc++abi without exceptions.
Summary:
Since neither compiler-rt nor the libc++ we build use exceptions, we
don't need libc++abi to have them either.

This resolves an issue where libFuzzer's private libc++ contains
implementations for __cxa_throw and friends, causing fuzz targets built
with their own C++ library to segfault during exception unwinding.

See https://github.com/google/oss-fuzz/issues/2328.

Reviewers: phosek, EricWF, kcc

Reviewed By: phosek

Subscribers: kcc, dberris, mgorny, christof, llvm-commits, metzman

Tags: #llvm

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

llvm-svn: 359218
2019-04-25 18:14:24 +00:00
David Blaikie 538bbe5814 DebugInfo: Fix bitrotted test case
This test was updated with some CHECK suffix variants, but dropped
checking for the unsuffixed 'CHECK'

llvm-svn: 359217
2019-04-25 18:11:48 +00:00
Amy Huang 124debd0d2 creduce-clang-crash: add -F flag to grep to avoid interpreting string as regex
llvm-svn: 359216
2019-04-25 18:00:25 +00:00
Rong Xu 4059e143dc [PGO] Enable InstrProf lowering for Clang PGO instrumentation in the new pass manager
Currently InstrProf lowering is not enabled for Clang PGO instrumentation in
the new pass manager. The following command
"-fprofile-instr-generate -fexperimental-new-pass-manager ..." is broken.

This CL enables InstrProf lowering pass for Clang PGO instrumentation in the
new pass manager.

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

llvm-svn: 359215
2019-04-25 17:52:43 +00:00
Sam McCall e3559eee63 [clangd] Optimize "don't include me" check.
Summary:
llvm::Regex is really slow, and regex evaluation during preamble indexing was
showing up as 25% on a profile of clangd in a codebase with large preambles.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 359214
2019-04-25 17:47:07 +00:00
Julian Lettner 8b36610bfa [NFC][Sanitizer] Extract GetFuncAddr from GetRealFunctionAddress
Summary:
Hopefully, this will enable cleanup/removal of GetRealFunctionAddress in
follow-up commits.

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 359213
2019-04-25 17:46:29 +00:00
Jennifer Yu c19f4f8069 Fix bug 37903:MS ABI: handle inline static data member and inline variable as template static data member
llvm-svn: 359212
2019-04-25 17:45:45 +00:00
Marshall Clow b0e2daf64b Implement 'lerp'; which is the last bit of P0811. Mark that paper as complete.
llvm-svn: 359211
2019-04-25 17:44:18 +00:00
Michal Gorny 19376ebd1a [lldb] [lit] Add tests for reading new x86_64 registers
Add tests covering read operations for the general-purpose and XMM
registers added in x86_64 (r8-r15 and xmm8-xmm15).

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

llvm-svn: 359210
2019-04-25 17:42:49 +00:00
Michal Gorny ec3f09f30f [lldb] [lit] Remove unnecessary array use in XMM reading test
Remove the use of 2-element array for XMM data.  It is an accidental
leftover from previous implementation attempt, and it is unnecessary
with xmm_t.

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

llvm-svn: 359208
2019-04-25 17:42:40 +00:00