Commit Graph

314984 Commits

Author SHA1 Message Date
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
Sam Clegg b685ddf288 [WebAssembly] Always take into account added when applying runtime relocations
The code we generate for applying data relocations at runtime omitted
the symbols with GOT entries.

Also refactor the code to reduce duplication.

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

llvm-svn: 359207
2019-04-25 17:11:54 +00:00
Raphael Isemann a1309a3147 Fixed typo in CompileUnit::GetImportedModules documentation [NFC]
llvm-svn: 359206
2019-04-25 17:08:54 +00:00
Robert Lougher d469133f95 [Evaluator] Walk initial elements when handling load through bitcast
When evaluating a store through a bitcast, the evaluator tries to move the
bitcast from the pointer onto the stored value. If the cast is invalid, it
tries to "introspect" the type to get a valid cast by obtaining a pointer to
the initial element (if the type is nested, this may require walking several
initial elements).

In some situations it is possible to get a bitcast on a load (e.g. with
unions, where the bitcast may not be the same type as the store). However,
equivalent logic to the store to introspect the type is missing. This patch
add this logic.

Note, when developing the patch I was unhappy with adding similar logic
directly to the load case as it could get out of step. Instead, I have
abstracted the "introspection" into a helper function, with the specifics
being handled by a passed-in lambda function.

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

llvm-svn: 359205
2019-04-25 17:00:01 +00:00
Jessica Paquette ba55767f51 [GlobalISel][AArch64] Legalize G_FNEARBYINT
Add legalizer support for G_FNEARBYINT. It's the same as G_FCEIL etc.

Since the importer allows us to automatically select this after legalization,
also add tests for selection etc. Also update arm64-vfloatintrinsics.ll.

llvm-svn: 359204
2019-04-25 16:44:40 +00:00
Jessica Paquette bd7ac30b15 [GlobalISel] Add IRTranslator support for G_FNEARBYINT
Translate llvm.nearbyint into G_FNEARBYINT as a simple intrinsic. Update
arm64-irtranslator.ll.

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

llvm-svn: 359203
2019-04-25 16:39:28 +00:00
Sam McCall 79e7e439e5 [clangd] Use JSON streaming API for Trace rather than pasting strings. NFC
llvm-svn: 359202
2019-04-25 16:37:07 +00:00
Jessica Paquette f13b6a74ce [GlobalISel] Add a G_FNEARBYINT opcode
For eventually selecting llvm.nearbyint. Equivalent to the SelectionDAG
nearbyint node.

Update legalizer-info-validation.mir.

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

llvm-svn: 359201
2019-04-25 16:36:03 +00:00
Alexey Bataev 2f9ef332d1 [OPENMP] Improved check for the linear dependency in the non-rectangular
loop nests.

Added a checks that the initializer/condition expressions depend only
only of the single previous loop iteration variable.

llvm-svn: 359200
2019-04-25 16:21:13 +00:00
Kostya Kortchinsky 3fad6a206f [scudo][standalone] Introduce the SizeClassMap
Summary:
As with the sanitizer_common allocator, the SCM allows for efficient
mapping between sizes and size-classes, table-free.

It doesn't depart significantly from the original, except that we
allow the use of size-class 0 for other purposes (as opposed to
chunks of size 0). The Primary will use it to hold TransferBatches.

Reviewers: vitalybuka, eugenis, hctim, morehouse

Reviewed By: vitalybuka

Subscribers: srhines, mgorny, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 359199
2019-04-25 15:49:34 +00:00
Lang Hames b534f7245c Revert "[JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows."
This reverts r359169, as it broke one of the windows bots.

llvm-svn: 359198
2019-04-25 15:18:31 +00:00
George Rimar 44f2d74aa5 [LLD][ELF] - Convert symbol-index.s testcase to a YAML test case. NFCI.
This removes one more binary object from the inputs and fixes the
test case description.

Previously it said that:
"symbol-index.elf has incorrect type of .symtab section.
There is no symbol bodies because of that and any symbol index becomes incorrect."

But the real reason of the failture was not the incorrect type of a symbol table,
but invalid index of the symbol used in a relocation, what happened because
previous test tried to read .symtab as a SHT_RELA section.

llvm-svn: 359197
2019-04-25 15:08:52 +00:00
Nico Weber a506fab189 gn build: Document llvm_enable_dia_sdk variable better
llvm-svn: 359196
2019-04-25 14:56:56 +00:00
Nico Weber 5d22bcbb78 gn build: Make setting llvm_enable_dia_sdk=true work
If this is set, %INCLUDE% must contain ".../DIA SDK/include"
and %LIB% must contain ".../DIA SKD/lib/amd64" (assuming you're doing a
64-bit build).

llvm-svn: 359195
2019-04-25 14:53:53 +00:00
George Rimar e043417268 [LLD][ELF] - Move the test to a correct folder, remove excessive input. NFCI.
This test should live in `invalid` folder.

Also it was possible to avoid adding input
with use of `-docnum=x` yaml2obj argument.

llvm-svn: 359194
2019-04-25 14:53:23 +00:00
Alexey Bataev 8b17621040 [OPENMP][AARCH64]Fix the test for declare simd, NFC.
Renamed function a01 in the test to fix possible problems with the git
hash match during testing.

llvm-svn: 359193
2019-04-25 14:04:37 +00:00
Nico Weber c0838af754 lld-link: Implement /swaprun: flag
r191276 added this to old LLD, but it never made it to new LLD -- except
that the flag was in Options.td, so it was silently ignored. I figured
it should be easy to implement, so I did that instead of removing the
flags from Options.td.

I then discovered that link.exe also supports comma-separated lists of
'cd' and 'net', which made the parsing code a bit annoying.

The Alias technique in Options.td is to get nice help output.

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

llvm-svn: 359192
2019-04-25 14:02:26 +00:00
Simon Pilgrim 48a3b54572 [InstCombine][X86] Tweak generic expansion of PACKSS/PACKUS to shuffle then truncate. NFCI.
This has no effect on constant folding but will be useful when we expand non-saturating PACKSS/PACKUS intrinsics.

llvm-svn: 359191
2019-04-25 13:51:57 +00:00
Sam McCall 0fc09d0d25 [Support] json::OStream::flush(), which passes through to the underlying stream
llvm-svn: 359190
2019-04-25 13:33:18 +00:00
Nico Weber 98b0c910fb gn build: Merge r359179
llvm-svn: 359189
2019-04-25 13:29:34 +00:00
Nico Weber 7b37559b5d gn build: Merge r359174
llvm-svn: 359188
2019-04-25 13:26:54 +00:00
Nico Weber 0f85875a9b gn build: Merge r359142
llvm-svn: 359187
2019-04-25 13:25:00 +00:00
Sam McCall a7edcfb533 [Support] Add JSON streaming output API, faster where the heavy value types aren't needed.
Summary:
There's still a little bit of constant factor that could be trimmed (e.g.
more overloads to avoid round-tripping primitives through json::Value).
But this solves the memory scaling problem, and greatly improves the performance
constant factor, and the API should leave room for optimization if needed.

Adapt TimeProfiler to use it, eliminating almost all the performance regression
from r358476.

Performance test on my machine:
perf stat -r 5 ~/llvmbuild-opt/bin/clang++ -w -S -ftime-trace -mllvm -time-trace-granularity=0 spirit.cpp

Handcrafted JSON (HEAD=r358532 with r358476 reverted): 2480ms
json::Value (HEAD): 2757ms (+11%)
After this patch: 2520 ms (+1.6%)

Reviewers: anton-afanasyev, lebedev.ri

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 359186
2019-04-25 12:51:42 +00:00
Simon Pilgrim 86ff9d313a [InstCombine][X86] Add PACKSS/PACKUS tests for truncation where saturation won't occur
llvm-svn: 359185
2019-04-25 12:45:11 +00:00
Marshall Clow d3d0ecbfd5 Implement midpoint for floating point types. Reviewed as https://reviews.llvm.org/D61014.
llvm-svn: 359184
2019-04-25 12:11:43 +00:00
Ilya Biryukov 31aa2ea3a3 [Support] Try to unbreak windows buildbot
After r359179.

llvm-svn: 359183
2019-04-25 11:57:40 +00:00
Fangrui Song f6a6290908 Parallel: only allow the first TaskGroup to run tasks parallelly
Summary:
Concurrent (e.g. nested) llvm::parallel::for_each() may lead to dead
locks. See PR35788 (fixed by rLLD322041) and PR41508 (fixed by D60757).

When parallel_for_each() is about to return, in ~Latch() called by
~TaskGroup(), a thread (in the default executor) may block in
Latch::sync() waiting for Count to become zero. If all threads in the
default executor are blocked, it is a dead lock.

To fix this, force serial execution if the current TaskGroup is not the
first one. For a nested llvm::parallel::for_each(), this parallelizes
the outermost loop and serializes inner loops.

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

llvm-svn: 359182
2019-04-25 11:33:30 +00:00
Fangrui Song 9e8d0d981b [llvm-objdump] Prep for adding newlines before and after "Disassembly of section ...:"
llvm-svn: 359181
2019-04-25 10:25:52 +00:00
Florian Hahn 1038137f14 [ConstantRange] [a, b) udiv a full range is [0, umax(b)).
Reviewers: nikic, spatel, efriedma

Reviewed By: nikic

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

llvm-svn: 359180
2019-04-25 10:12:43 +00:00
Ilya Biryukov 6fae38ec91 [Testing] Move clangd::Annotations to llvm testing support
Summary:
Annotations allow writing nice-looking unit test code when one needs
access to locations from the source code, e.g. running code completion
at particular offsets in a file. See comments in Annotations.cpp for
more details on the API.

Also got rid of a duplicate annotations parsing code in clang's code
complete tests.

Reviewers: gribozavr, sammccall

Reviewed By: gribozavr

Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 359179
2019-04-25 10:08:31 +00:00
George Rimar 45d042ed96 [yaml2obj] - Don't crash on invalid inputs.
yaml2obj might crash on invalid input when unable to parse the YAML.

Recently a crash with a very similar nature was fixed for an empty files. 
This patch revisits the fix and does it in yaml::Input instead.
It seems to be more correct way to handle such situation.

With that crash for invalid inputs is also fixed now.

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

llvm-svn: 359178
2019-04-25 09:59:55 +00:00
Simon Pilgrim 4b7d3c4831 Fix include order. NFCI.
llvm-svn: 359177
2019-04-25 09:49:37 +00:00
Simon Pilgrim 0a7d1b3ce1 [X86][SSE] combineBitcastvxi1 - add support for bitcasting to non-scalar integers
Truncate the movmsk scalar integer result to the equivalent scalar integer width as before but then bitcast to the requested type.

We still have the issue identified in PR41594 but D61114 should handle this.

llvm-svn: 359176
2019-04-25 09:34:36 +00:00
Michael Platings d144572dac Fix compilation error with -DLIBCXXABI_ENABLE_THREADS=OFF
The error is:

libcxxabi/src/cxa_guard_impl.h: In instantiation of ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’:
libcxxabi/src/cxa_guard_impl.h:529:62:   required from here
libcxxabi/src/cxa_guard_impl.h:510:23: error: ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’ has incomplete type
 _LIBCPP_SAFE_STATIC T GlobalStatic<T>::instance = {};
                       ^

llvm-svn: 359175
2019-04-25 09:27:50 +00:00
Ilya Biryukov 4ea70ecda8 [Support] Add a GTest matcher for Optional<T>
Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 359174
2019-04-25 09:03:32 +00:00
Roman Lebedev 445c22b7eb [NFC][LoopIdiomRecognize] Some basic baseline tests for bcmp loop idiom
Doubt this is the final test coverage, but this appears to have good
coverage already, so i figure i might as well precommit it.

llvm-svn: 359173
2019-04-25 08:33:47 +00:00
Nikolai Kosjar 2ec51879a7 [NFC] test commit removing excess line
llvm-svn: 359172
2019-04-25 08:14:39 +00:00
Simon Atanasyan a0291110da [MIPS] Use custom bitcast lowering to avoid excessive instructions
On Mips32r2 bitcast can be expanded to two sw instructions and an ldc1
when using bitcast i64 to double or an sdc1 and two lw instructions when
using bitcast double to i64. By introducing custom lowering that uses
mtc1/mthc1 we can avoid excessive instructions.

Patch by Mirko Brkusanin.

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

llvm-svn: 359171
2019-04-25 07:47:28 +00:00
Craig Topper 013503c78d [X86] Remove part of an if condition that should always be true.
The IndexReg will always be non-null at this point. Earlier in the function, if
IndexReg was null we set it to CurDAG->getRegister(0, VT) which made it
non-null.

llvm-svn: 359170
2019-04-25 06:08:02 +00:00
Lang Hames 64eb9a95be [JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows.
This should fix the MachO/x86-64 eh-frame regression test by ensuring that
the symbols __ZTIi and ___gxx_personality_v0 are defined on all platforms.

llvm-svn: 359169
2019-04-25 05:24:40 +00:00
Lang Hames cf49aa3908 [llvm-rtdyld] Add support for passing command line arguments to rtdyld-run code.
The --args option can now be used to pass arguments to code linked with
llvm-rtdyld. E.g.

$ llvm-rtdyld file1.o file2.o --args a b c

is equivalent to:

$ ld -o program file1.o file2.o
$ ./program a b c

This is the rtdyld counterpart to the jitlink change in r359115, and makes
benchmarking and comparison between the tools easier.

llvm-svn: 359168
2019-04-25 05:02:10 +00:00