Commit Graph

266921 Commits

Author SHA1 Message Date
Reid Kleckner 03b5baf480 Re-land "[PDB] Use a more appropriate message for a fatal error"
This re-commits r307726 with valid line table relocations.

llvm-svn: 307829
2017-07-12 18:49:43 +00:00
Jakub Kuderski b323f4f173 [LoopRotate] Fix DomTree update logic for unreachable nodes. Fix PR33701.
Summary:
LoopRotate manually updates the DoomTree by iterating over all predecessors of a basic block and computing the Nearest Common Dominator.

When a predecessor happens to be unreachable, `DT.findNearestCommonDominator` returns nullptr.

This patch teaches LoopRotate to handle this case and fixes [[ https://bugs.llvm.org/show_bug.cgi?id=33701 | PR33701 ]].

In the future, LoopRotate should be taught to use the new incremental API for updating the DomTree.

Reviewers: dberlin, davide, uabelho, grosser

Subscribers: efriedma, mzolotukhin

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

llvm-svn: 307828
2017-07-12 18:42:16 +00:00
Reid Kleckner 5ae1bfe813 Use std::mutex to avoid memory allocation after OOM
ManagedStatic<sys::Mutex> would lazilly allocate a sys::Mutex to lock
when reporting an OOM, which is a bad idea.

The three STL implementations that I know of use pthread_mutex_lock and
EnterCriticalSection to implement std::mutex. I'm pretty sure that
neither of those allocate heap memory.

It seems that we unconditionally use std::mutex without testing
LLVM_ENABLE_THREADS elsewhere in the codebase, so this should be
portable.

llvm-svn: 307827
2017-07-12 18:23:06 +00:00
George Karpenkov 52b2dbb673 [libFuzzer] Add a dependency on symbolizer from libFuzzer tests
Some libFuzzer tests on Linux would fail with bizarre error messages
unless llvm-symbolizer binary is present.

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

llvm-svn: 307826
2017-07-12 18:17:34 +00:00
George Karpenkov cf26a86601 [libFuzzer] NFC Declare LIBFUZZER_FLAGS_BASE outside of an if-block
The current code relies on the assumption that tests are included only
if LLVM_USE_SANITIZE_COVERAGE is enabled.
This commit makes it easier to relax the assumption in the future, as
the variable LIBFUZZER_FLAGS_BASE is used further in libFuzzer tests.

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

llvm-svn: 307825
2017-07-12 18:16:09 +00:00
George Karpenkov 6eab75fbb0 [libFuzzer] Do not use LLVM ostream in tests
Differential Revision: https://reviews.llvm.org/D35312

llvm-svn: 307824
2017-07-12 18:14:19 +00:00
Adrian McCarthy a6c21919d0 Temporary fix to green up the build bots on behalf of zturner who's on vacation.
llvm-svn: 307823
2017-07-12 18:10:02 +00:00
Alexey Bataev 3344603f7b [OPENMP] Emit implicit taskgroup block around taskloop directives.
If taskloop directive has no associated nogroup clause, it must emitted
inside implicit taskgroup block. Runtime supports it, but we need to
generate implicit taskgroup block explicitly to support future
reductions codegen.

llvm-svn: 307822
2017-07-12 18:09:32 +00:00
Sanjay Patel 4450e73b5e [x86] improve SBB optimizations for SETB/SETA with subtract
This is another step towards removing a combine that turns sext
into select of constants and preparing the backend for an IR
future where select is the canonical form.

Earlier commits in this area:
https://reviews.llvm.org/rL306040
https://reviews.llvm.org/rL306072
https://reviews.llvm.org/rL307404 (https://reviews.llvm.org/D34652)
https://reviews.llvm.org/rL307471

llvm-svn: 307821
2017-07-12 17:56:46 +00:00
Rafael Espindola d3fc0c91e3 Bring back InVersionScript.
We were producing bogus warnings without it.

llvm-svn: 307820
2017-07-12 17:49:17 +00:00
Sanjay Patel 6d6c06879c [x86] add tests for improving sbb transforms; NFC
We're subtracting X from X the hard way...

llvm-svn: 307819
2017-07-12 17:44:50 +00:00
Yan Wang b38045d02e [clang-tidy] Add a new Android check "android-cloexec-socket"
Summary: socket() is better to include SOCK_CLOEXEC in its type argument to avoid the file descriptor leakage.

Reviewers: chh, Eugene.Zelenko, alexfh, hokein, aaron.ballman

Reviewed By: chh, alexfh

Subscribers: srhines, mgorny, JDevlieghere, xazax.hun, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 307818
2017-07-12 17:43:36 +00:00
Justin Bogner 4fc696635d GlobalISel: Handle selection of G_IMPLICIT_DEF in AArch64
A generic variant of IMPLICIT_DEF was added in r306875, but this
survives to selection and hits a `Cannot Select`. Add handling that
converts the note to a regular IMPLICIT_DEF.

llvm-svn: 307817
2017-07-12 17:32:32 +00:00
Kuba Mracek 46f2b8485a On Darwin, start building the TSan dylib for the iOS simulator.
llvm-svn: 307816
2017-07-12 17:30:54 +00:00
Kuba Mracek 476c3e9ba0 Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before the return).
llvm-svn: 307815
2017-07-12 17:11:53 +00:00
Singapuram Sanjay Srivallabh 1abd9ffa37 [PPCGCodeGen] Differentiate kernels based on their parent Scop
Summary:
Add a sequence number that identifies a ptx_kernel's parent Scop within a function to it's name to differentiate it from other kernels produced from the same function, yet different Scops.

Kernels produced from different Scops can end up having the same name. Consider a function with 2 Scops and each Scop being able to produce just one kernel. Both of these kernels have the name "kernel_0". This can lead to the wrong kernel being launched when the runtime picks a kernel from its cache based on the name alone. This patch supplements D33985, by differentiating kernels across Scops as well.

Previously (even before D33985) while profiling kernels generated through JIT e.g. Julia, [[ https://groups.google.com/d/msg/polly-dev/J1j587H3-Qw/mR-jfL16BgAJ | kernels associated with different functions, and even different SCoPs within a function, would be grouped together due to the common name ]]. This patch prevents this grouping and the kernels are reported separately.

Reviewers: grosser, bollu

Reviewed By: grosser

Subscribers: mehdi_amini, nemanjai, pollydev, kbarton

Tags: #polly

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

llvm-svn: 307814
2017-07-12 16:46:19 +00:00
Alex Lorenz ada11923fa [diagtool] Add a 'find-diagnostic-id' subcommand that converts a name of
the diagnostic to its enum value

This will be used by a script that invokes clang in a debugger and forces it
to stop when it reports a particular diagnostic.

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

llvm-svn: 307813
2017-07-12 16:41:49 +00:00
Haojian Wu a9a1b403bc [clang-tidy] Ignore blank spaces between cast's ")" and its sub expr.
Summary:
Before the change:

`auto i = (Enum) 5;` => `auto i = static_cast<Enum>( 5);`

After the change:

`auto i = (Enum) 5;` => `auto i = static_cast<Enum>(5);`

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: JDevlieghere, xazax.hun, cfe-commits

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

llvm-svn: 307812
2017-07-12 16:38:59 +00:00
George Burgess IV 6f92d2dd24 Add a test for r307754
As promised in D35003.

Uses -codegenprepare instead of -instcombine since we hit the same
buggy path anyway, and CGP lets us keep this test really simple
(instcombine likes turning the alloca T, N into alloca [N x T], which
hides the bug this is testing for).

llvm-svn: 307811
2017-07-12 16:30:37 +00:00
Chih-Hung Hsieh 98a6b3ea87 [clang-tidy] add regression test to performance-unnecessary-value-param
This test shows the problem in https://bugs.llvm.org/show_bug.cgi?id=33734

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

llvm-svn: 307810
2017-07-12 16:27:00 +00:00
Chih-Hung Hsieh 322e8c2bc1 [clang] buildFixItInsertionLine should use Hints of the same FID and LineNo
Fix bug https://bugs.llvm.org/show_bug.cgi?id=33734

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

llvm-svn: 307809
2017-07-12 16:25:40 +00:00
Simon Dardis 76eb647e1e [mips][mt][5/7] Add support for fork and yield instructions.
Reviewers: slthakur, atanasyan

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

llvm-svn: 307808
2017-07-12 16:23:57 +00:00
Rafael Espindola 1e6b49e144 Add back a CHECK line.
I accidentally removed it in r307730.

Thanks to Martin Storsjö for noticing!

llvm-svn: 307801
2017-07-12 16:14:00 +00:00
Siddharth Bhat 6cbb5a478e [NFC] [SCEVValidator] Make parameter name of `hasScalarDepsInsideRegion` consistent.
`SCEV` parameter is called as `Expr` in `SCEVValidator.cpp`, as well
as in other functions in `SCEVValidator.h`.

llvm-svn: 307800
2017-07-12 15:32:30 +00:00
Evandro Menezes 14ba3d7730 [CodeGen] Add dependency printer
Add SDep printer to make debugging sessions more productive.

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

llvm-svn: 307799
2017-07-12 15:30:59 +00:00
Kostya Kortchinsky 00582563be [scudo] PRNG makeover
Summary:
This follows the addition of `GetRandom` with D34412. We remove our
`/dev/urandom` code and use the new function. Additionally, change the PRNG for
a slightly faster version. One of the issues with the old code is that we have
64 full bits of randomness per "next", using only 8 of those for the Salt and
discarding the rest. So we add a cached u64 in the PRNG that can serve up to
8 u8 before having to call the "next" function again.

During some integration work, I also realized that some very early processes
(like `init`) do not benefit from `/dev/urandom` yet. So if there is no
`getrandom` syscall as well, we have to fallback to some sort of initialization
of the PRNG.

Now a few words on why XoRoShiRo and not something else. I have played a while
with various PRNGs on 32 & 64 bit platforms. Some results are below. LCG 32 & 64
are usually faster but produce respectively 15 & 31 bits of entropy, meaning
that to get a full 64-bit, you would need to call them several times. The simple
XorShift is fast, produces 32 bits but is mediocre with regard to PRNG test
suites, PCG is slower overall, and XoRoShiRo is faster than XorShift128+ and
produces full 64 bits.

%%%
root@tulip-chiphd:/data # ./randtest.arm
[+] starting xs32...
[?] xs32 duration: 22431833053ns
[+] starting lcg32...
[?] lcg32 duration: 14941402090ns
[+] starting pcg32...
[?] pcg32 duration: 44941973771ns
[+] starting xs128p...
[?] xs128p duration: 48889786981ns
[+] starting lcg64...
[?] lcg64 duration: 33831042391ns
[+] starting xos128p...
[?] xos128p duration: 44850878605ns

root@tulip-chiphd:/data # ./randtest.aarch64
[+] starting xs32...
[?] xs32 duration: 22425151678ns
[+] starting lcg32...
[?] lcg32 duration: 14954255257ns
[+] starting pcg32...
[?] pcg32 duration: 37346265726ns
[+] starting xs128p...
[?] xs128p duration: 22523807219ns
[+] starting lcg64...
[?] lcg64 duration: 26141304679ns
[+] starting xos128p...
[?] xos128p duration: 14937033215ns
%%%

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: aemerson, kristof.beyls, llvm-commits

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

llvm-svn: 307798
2017-07-12 15:29:08 +00:00
Davide Italiano a63981aaa9 [X86/FastIsel] Fall-back to SelectionDAG when lowering soft-floats.
FastIsel can't handle them, so we would end up crashing during
register class selection.
Fixes PR26522.

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

llvm-svn: 307797
2017-07-12 15:26:06 +00:00
Daniel Neilson 57226ef33c Add element atomic memmove intrinsic
Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memmove intrinsic. This intrinsic is essentially memmove with the implementation requirement that all loads/stores used for the copy are done with unordered-atomic loads/stores of a given element size.

Reviewers: eli.friedman, reames, mkazantsev, skatkov

Reviewed By: reames

Subscribers: llvm-commits

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

llvm-svn: 307796
2017-07-12 15:25:26 +00:00
Krasimir Georgiev e092634f31 [clang-format] Keep level of comment before an empty line
Summary:
This patch fixes bug https://bugs.llvm.org/show_bug.cgi?id=3313: a comment line
was aligned with the next #ifdef even in the presence of an empty line between
them.

Reviewers: djasper, klimek

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 307795
2017-07-12 15:21:43 +00:00
George Rimar 8c804d9746 [ELF] - Allow moving location counter backward in some cases.
Patch removes restriction about moving location counter
backwards outside of output sections declarations.

That may be useful for some apps relying on such scripts, 
known example is linux kernel.

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

llvm-svn: 307794
2017-07-12 14:50:25 +00:00
Simon Dardis 2de1ddbd9c [mips][mt][4/7] Add IAS support for dvpe, evpe instructions.
Reviewers: slthakur, atanasyan

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

llvm-svn: 307793
2017-07-12 14:48:27 +00:00
George Rimar 3e8a461bdf [ELF] - Give a symbol version extracted from name a priority over version set by script.
This fixes PR33712.

Imagine following script and code:

VER1 { global: foo; local: *; };
VER2 { global: foo; };

.global bar
bar:
.symver bar, foo@VER1

.global zed
zed:
.symver zed, foo@@VER2

We add foo@@VER2 as foo to symbol table, because have to resolve references to
foo for default symbols.
Later we are trying to assign symbol versions from script. For that we are searching for 'foo'
again. Here it is placed under VER1 and VER2 at the same time, we find it twice and trying to
set version again both times, hence LLD shows a warning.
Though sample code is correct: we have 2 different versions of foo.

Patch gives a symbol version extracted from name a priority over version set by script.

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

llvm-svn: 307792
2017-07-12 13:54:42 +00:00
Gabor Horvath 5314521328 [clang-tidy] Add new modernize use unary assert check
Patch by: Lilla Barancsuk

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

llvm-svn: 307791
2017-07-12 13:43:35 +00:00
Simon Pilgrim 8dfbc772d7 [X86][SSE] Fix file check prefix warning breaking buildbots
llvm-svn: 307790
2017-07-12 13:41:13 +00:00
Kamil Rytarowski cce21c1dfe Make shell redirection construct portable
Summary:
NetBSD shell sh(1) does not support ">& /dev/null" construct.
This is bashism. The portable and POSIX solution is to use:
"> /dev/null 2>&1".

This change fixes 22 Unexpected Failures on NetBSD/amd64
for the "check-llvm" target.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dim, rnk

Reviewed By: joerg, rnk

Subscribers: rnk, davide, llvm-commits

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

llvm-svn: 307789
2017-07-12 13:24:46 +00:00
John Brawn 97cc283117 [ARM] Adjust ifcvt heuristic for the diamond ifcvt case
When we have a diamond ifcvt the fallthough block will have a branch at the end
of it that disappears when predicated, so discount it from the predication cost.

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

llvm-svn: 307788
2017-07-12 13:23:10 +00:00
Alexander Kornienko c2dcdd9984 [clang-tidy] add_new_check.py updates ReleaseNotes.rst now
llvm-svn: 307787
2017-07-12 13:13:41 +00:00
Dmitry Vyukov 1fa729999b tsan: remove some clock-related stats
The stats are too dependent on implementation
and won't be relevant in future.

llvm-svn: 307786
2017-07-12 12:54:38 +00:00
Dmitry Vyukov 62b9ad718f tsan: refactor SyncClock code
1. Add SyncClock::ResetImpl which removes code
   duplication between ctor and Reset.
2. Move SyncClock::Resize to SyncClock methods,
   currently it's defined between ThreadClock methods.

llvm-svn: 307785
2017-07-12 12:50:36 +00:00
Dmitry Vyukov 5f924089e5 tsan: prepare clock for future changes
Pass ClockCache to ThreadClock::set and introduce ThreadCache::ResetCached.
For now both are unused, but will reduce future diffs.

llvm-svn: 307784
2017-07-12 12:45:20 +00:00
Simon Pilgrim ebbb969d21 [X86][SSE] Add 512-bit (iX bitcast(vXi1)) test cases
Improves test coverage for pre-AVX512 targets as well

llvm-svn: 307783
2017-07-12 12:44:10 +00:00
Petr Pavlu 8c5dafde49 [MainLoop] Fix possible use of an invalid iterator
Store file descriptors from loop.m_read_fds (if FORCE_PSELECT is
defined) and signals from loop.m_signals that need to be processed in
MainLoop::RunImpl::ProcessEvents() into a separate vector and then
iterate over this container to invoke the callbacks.

This prevents a problem where when the code iterated directly over
m_read_fds/m_signals, a callback invoked from within the loop could
modify these variables and invalidate the loop iterator. This would then
result in an assertion failure in llvm::DenseMapIterator::operator++().

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

llvm-svn: 307782
2017-07-12 12:38:31 +00:00
Dmitry Vyukov 293b4fc04e tsan: s/-1/kInvalidTid/
llvm-svn: 307781
2017-07-12 12:36:44 +00:00
Dmitry Vyukov 5abf9bb1ca tsan: give debug names to dense allocators
Improves crash message on dense alloc overflow.
Allows to understand what alloc overflowed.

llvm-svn: 307780
2017-07-12 12:34:12 +00:00
Simon Dardis 7323f7ac63 [mips][mt] Add missing files from last commit
llvm-svn: 307779
2017-07-12 12:33:40 +00:00
Dmitry Vyukov 7bf9ee041a tsan: don't create sync objects on acquire-load
Don't create sync object if it does not exist yet. For example, an atomic
pointer is initialized to nullptr and then periodically acquire-loaded.

llvm-svn: 307778
2017-07-12 12:28:23 +00:00
Dmitry Vyukov 0a9265c26c tsan: add another test for clock growth
llvm-svn: 307777
2017-07-12 12:25:03 +00:00
Dmitry Vyukov 05d297080e tsan: add test for __tsan_java_find
The test should have been added in 289682
"tsan: allow Java VM iterate over allocated objects"
but I forgot to avn add.

Author: Alexander Smundak (asmundak)
Reviewed in https://reviews.llvm.org/D27720

llvm-svn: 307776
2017-07-12 12:23:31 +00:00
Hiroshi Inoue 7d7df204ef fix typo in document; NFC
llvm-svn: 307775
2017-07-12 12:16:22 +00:00
Simon Dardis 5cc5051017 [mips][mt][3/7] Add IAS support for emt, dmt instructions.
Reviewers: slthakur, atanasyan

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

llvm-svn: 307774
2017-07-12 11:57:44 +00:00