Sam Clegg [Wed, 12 Jul 2017 20:49:21 +0000 (20:49 +0000)]
Remove unneeded use of #undef DEBUG_TYPE. NFC
Where is is needed (at the end of headers that define it), be
consistent about its use.
Also fix a few header guards that I found in the process.
Differential Revision: https://reviews.llvm.org/D34916
llvm-svn: 307840
Kuba Mracek [Wed, 12 Jul 2017 20:25:14 +0000 (20:25 +0000)]
On Darwin, start building the TSan iOS dylib by default.
llvm-svn: 307839
Ekaterina Romanova [Wed, 12 Jul 2017 20:18:55 +0000 (20:18 +0000)]
[DOXYGEN] Corrected typos and incorrect parameters description.
Corrected several typos and incorrect parameters description that Sony
's techinical writer found during review.
I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.
llvm-svn: 307838
Michael Kuperstein [Wed, 12 Jul 2017 19:53:55 +0000 (19:53 +0000)]
[LV] Don't allow outside uses of IVs if the SCEV is predicated on loop conditions.
This fixes PR33706.
Differential Revision: https://reviews.llvm.org/D35227
llvm-svn: 307837
Simon Dardis [Wed, 12 Jul 2017 19:47:45 +0000 (19:47 +0000)]
[mips][mt][6/7] Add support for mftr, mttr instructions.
Unlike many other instructions, these instructions have aliases which
take coprocessor registers, gpr register, accumulator (and dsp accumulator)
registers, floating point registers, floating point control registers and
coprocessor 2 data and control operands.
For the moment, these aliases are treated as pseudo instructions which are
expanded into the underlying instruction. As a result, disassembling these
instructions shows the underlying instruction and not the alias.
Reviewers: slthakur, atanasyan
Differential Revision: https://reviews.llvm.org/D35253
llvm-svn: 307836
Reid Kleckner [Wed, 12 Jul 2017 19:46:35 +0000 (19:46 +0000)]
Fix non-Windows build after PDB native builtin type change
Some C++14 features slipped in along with an extra member qualification.
llvm-svn: 307835
Adrian McCarthy [Wed, 12 Jul 2017 19:38:11 +0000 (19:38 +0000)]
[PDB] Enable NativeSession to create symbols for built-in types on demand
Summary:
There is a reserved range of type indexes for built-in types (like integers).
This will create a symbol for a built-in type if the caller askes for one by
type index. This is also plumbing for being able to recall symbols by type
index in general, but user-defined types will come in subsequent patches.
Reviewers: rnk, zturner
Subscribers: mgorny, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D35163
llvm-svn: 307834
Dominic Chen [Wed, 12 Jul 2017 19:37:57 +0000 (19:37 +0000)]
[analyzer] Support generating and reasoning over more symbolic constraint types
Summary: Generate more IntSymExpr constraints, perform SVal simplification for IntSymExpr and SymbolCast constraints, and create fully symbolic SymExprs
Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D28953
llvm-svn: 307833
Petr Hosek [Wed, 12 Jul 2017 19:33:30 +0000 (19:33 +0000)]
[builtins] Better Fuchsia support
Add Fuchsia support to some builtings and avoid building builtins
that are not and will never be used on Fuchsia.
Differential Revision: https://reviews.llvm.org/D34075
llvm-svn: 307832
Daniel Neilson [Wed, 12 Jul 2017 19:24:07 +0000 (19:24 +0000)]
Fix to web assembly lib call list
Summary:
Revision 307796 caused an internal build break in WebAssembly bots in the form of a
crash. ex:
Here's the crash dump from one of the failing tests:
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/llc < /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll
--
Exit Code: 2
Command Output (stderr):
--
Stack dump:
0. Program arguments: build/default/./bin/llc -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals
1. Running pass 'Function Pass Manager' on module '<stdin>'.
2. Running pass 'WebAssembly Assembly Printer' on function '@call_memcpy'
FileCheck error: '-' is empty.
FileCheck command line: build/default/./bin/FileCheck src/test/CodeGen/WebAssembly/global.ll
The problem is in lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp. There’s an array declared:
545 static const char *
Fix to web assembly lib call list
Summary:
Revision 307796 caused an internal build break in WebAssembly bots in the form of a
crash. ex:
Here's the crash dump from one of the failing tests:
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/llc < /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll
--
Exit Code: 2
Command Output (stderr):
--
Stack dump:
0. Program arguments: build/default/./bin/llc -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals
1. Running pass 'Function Pass Manager' on module '<stdin>'.
2. Running pass 'WebAssembly Assembly Printer' on function '@call_memcpy'
FileCheck error: '-' is empty.
FileCheck command line: build/default/./bin/FileCheck src/test/CodeGen/WebAssembly/global.ll
The problem is in lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp. There’s an array declared:
static const char *
RuntimeLibcallNames[RTLIB::UNKNOWN_LIBCALL] = {
That is defining a runtime lib call name for each entry in the enum RTLIB:Libcall from include/llvm/CodeGen/RuntimeLibcalls.h.
Revision 307796 added entries to the enum, but didn’t add entries to the RuntimeLibcallNames array, which caused a crash when attempting
to access past the end of the array.
This patch fixes the issue by adding the element atomic memmove to the WebAssembly arrays.
Reviewed by: reames
llvm-svn: 307831
Petr Hosek [Wed, 12 Jul 2017 19:15:51 +0000 (19:15 +0000)]
[Driver] Update Fuchsia driver path handling
Several improvements to the Fuchsia driver:
* Search for C++ library headers and libraries in directories that
are part of the toolchain distribution rather than sysroot.
* Use LLVM support utlities to construct paths to make sure the driver
is also usable on Windows for cross-compiling.
* Change the driver to inherit directly from ToolChain rather than
Generic_GCC since we don't need any of the GCC related multilib logic.
Differential Revision: https://reviews.llvm.org/D32613
llvm-svn: 307830
Reid Kleckner [Wed, 12 Jul 2017 18:49:43 +0000 (18:49 +0000)]
Re-land "[PDB] Use a more appropriate message for a fatal error"
This re-commits r307726 with valid line table relocations.
llvm-svn: 307829
Jakub Kuderski [Wed, 12 Jul 2017 18:42:16 +0000 (18:42 +0000)]
[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
Reid Kleckner [Wed, 12 Jul 2017 18:23:06 +0000 (18:23 +0000)]
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
George Karpenkov [Wed, 12 Jul 2017 18:17:34 +0000 (18:17 +0000)]
[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
George Karpenkov [Wed, 12 Jul 2017 18:16:09 +0000 (18:16 +0000)]
[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
George Karpenkov [Wed, 12 Jul 2017 18:14:19 +0000 (18:14 +0000)]
[libFuzzer] Do not use LLVM ostream in tests
Differential Revision: https://reviews.llvm.org/D35312
llvm-svn: 307824
Adrian McCarthy [Wed, 12 Jul 2017 18:10:02 +0000 (18:10 +0000)]
Temporary fix to green up the build bots on behalf of zturner who's on vacation.
llvm-svn: 307823
Alexey Bataev [Wed, 12 Jul 2017 18:09:32 +0000 (18:09 +0000)]
[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
Sanjay Patel [Wed, 12 Jul 2017 17:56:46 +0000 (17:56 +0000)]
[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
Rafael Espindola [Wed, 12 Jul 2017 17:49:17 +0000 (17:49 +0000)]
Bring back InVersionScript.
We were producing bogus warnings without it.
llvm-svn: 307820
Sanjay Patel [Wed, 12 Jul 2017 17:44:50 +0000 (17:44 +0000)]
[x86] add tests for improving sbb transforms; NFC
We're subtracting X from X the hard way...
llvm-svn: 307819
Yan Wang [Wed, 12 Jul 2017 17:43:36 +0000 (17:43 +0000)]
[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
Justin Bogner [Wed, 12 Jul 2017 17:32:32 +0000 (17:32 +0000)]
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
Kuba Mracek [Wed, 12 Jul 2017 17:30:54 +0000 (17:30 +0000)]
On Darwin, start building the TSan dylib for the iOS simulator.
llvm-svn: 307816
Kuba Mracek [Wed, 12 Jul 2017 17:11:53 +0000 (17:11 +0000)]
Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before the return).
llvm-svn: 307815
Singapuram Sanjay Srivallabh [Wed, 12 Jul 2017 16:46:19 +0000 (16:46 +0000)]
[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
Alex Lorenz [Wed, 12 Jul 2017 16:41:49 +0000 (16:41 +0000)]
[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
Haojian Wu [Wed, 12 Jul 2017 16:38:59 +0000 (16:38 +0000)]
[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
George Burgess IV [Wed, 12 Jul 2017 16:30:37 +0000 (16:30 +0000)]
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
Chih-Hung Hsieh [Wed, 12 Jul 2017 16:27:00 +0000 (16:27 +0000)]
[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
Chih-Hung Hsieh [Wed, 12 Jul 2017 16:25:40 +0000 (16:25 +0000)]
[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
Simon Dardis [Wed, 12 Jul 2017 16:23:57 +0000 (16:23 +0000)]
[mips][mt][5/7] Add support for fork and yield instructions.
Reviewers: slthakur, atanasyan
Differential Revision: https://reviews.llvm.org/D35252
llvm-svn: 307808
Rafael Espindola [Wed, 12 Jul 2017 16:14:00 +0000 (16:14 +0000)]
Add back a CHECK line.
I accidentally removed it in r307730.
Thanks to Martin Storsjö for noticing!
llvm-svn: 307801
Siddharth Bhat [Wed, 12 Jul 2017 15:32:30 +0000 (15:32 +0000)]
[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
Evandro Menezes [Wed, 12 Jul 2017 15:30:59 +0000 (15:30 +0000)]
[CodeGen] Add dependency printer
Add SDep printer to make debugging sessions more productive.
Differential revision: https://reviews.llvm.org/D35144
llvm-svn: 307799
Kostya Kortchinsky [Wed, 12 Jul 2017 15:29:08 +0000 (15:29 +0000)]
[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
Davide Italiano [Wed, 12 Jul 2017 15:26:06 +0000 (15:26 +0000)]
[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
Daniel Neilson [Wed, 12 Jul 2017 15:25:26 +0000 (15:25 +0000)]
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
Krasimir Georgiev [Wed, 12 Jul 2017 15:21:43 +0000 (15:21 +0000)]
[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
George Rimar [Wed, 12 Jul 2017 14:50:25 +0000 (14:50 +0000)]
[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
Simon Dardis [Wed, 12 Jul 2017 14:48:27 +0000 (14:48 +0000)]
[mips][mt][4/7] Add IAS support for dvpe, evpe instructions.
Reviewers: slthakur, atanasyan
Differential Revision: https://reviews.llvm.org/D35251
llvm-svn: 307793
George Rimar [Wed, 12 Jul 2017 13:54:42 +0000 (13:54 +0000)]
[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
Gabor Horvath [Wed, 12 Jul 2017 13:43:35 +0000 (13:43 +0000)]
[clang-tidy] Add new modernize use unary assert check
Patch by: Lilla Barancsuk
Differential Revision: https://reviews.llvm.org/D35257
llvm-svn: 307791
Simon Pilgrim [Wed, 12 Jul 2017 13:41:13 +0000 (13:41 +0000)]
[X86][SSE] Fix file check prefix warning breaking buildbots
llvm-svn: 307790
Kamil Rytarowski [Wed, 12 Jul 2017 13:24:46 +0000 (13:24 +0000)]
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
John Brawn [Wed, 12 Jul 2017 13:23:10 +0000 (13:23 +0000)]
[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
Alexander Kornienko [Wed, 12 Jul 2017 13:13:41 +0000 (13:13 +0000)]
[clang-tidy] add_new_check.py updates ReleaseNotes.rst now
llvm-svn: 307787
Dmitry Vyukov [Wed, 12 Jul 2017 12:54:38 +0000 (12:54 +0000)]
tsan: remove some clock-related stats
The stats are too dependent on implementation
and won't be relevant in future.
llvm-svn: 307786
Dmitry Vyukov [Wed, 12 Jul 2017 12:50:36 +0000 (12:50 +0000)]
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
Dmitry Vyukov [Wed, 12 Jul 2017 12:45:20 +0000 (12:45 +0000)]
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
Simon Pilgrim [Wed, 12 Jul 2017 12:44:10 +0000 (12:44 +0000)]
[X86][SSE] Add 512-bit (iX bitcast(vXi1)) test cases
Improves test coverage for pre-AVX512 targets as well
llvm-svn: 307783
Petr Pavlu [Wed, 12 Jul 2017 12:38:31 +0000 (12:38 +0000)]
[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
Dmitry Vyukov [Wed, 12 Jul 2017 12:36:44 +0000 (12:36 +0000)]
tsan: s/-1/kInvalidTid/
llvm-svn: 307781
Dmitry Vyukov [Wed, 12 Jul 2017 12:34:12 +0000 (12:34 +0000)]
tsan: give debug names to dense allocators
Improves crash message on dense alloc overflow.
Allows to understand what alloc overflowed.
llvm-svn: 307780
Simon Dardis [Wed, 12 Jul 2017 12:33:40 +0000 (12:33 +0000)]
[mips][mt] Add missing files from last commit
llvm-svn: 307779
Dmitry Vyukov [Wed, 12 Jul 2017 12:28:23 +0000 (12:28 +0000)]
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
Dmitry Vyukov [Wed, 12 Jul 2017 12:25:03 +0000 (12:25 +0000)]
tsan: add another test for clock growth
llvm-svn: 307777
Dmitry Vyukov [Wed, 12 Jul 2017 12:23:31 +0000 (12:23 +0000)]
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
Hiroshi Inoue [Wed, 12 Jul 2017 12:16:22 +0000 (12:16 +0000)]
fix typo in document; NFC
llvm-svn: 307775
Simon Dardis [Wed, 12 Jul 2017 11:57:44 +0000 (11:57 +0000)]
[mips][mt][3/7] Add IAS support for emt, dmt instructions.
Reviewers: slthakur, atanasyan
Differential Revision: https://reviews.llvm.org/D35250
llvm-svn: 307774
Ravitheja Addepally [Wed, 12 Jul 2017 11:54:17 +0000 (11:54 +0000)]
Fixing Android builder
llvm-svn: 307773
Florian Hahn [Wed, 12 Jul 2017 11:52:28 +0000 (11:52 +0000)]
[Linker] Add directives to support mixing ARM/Thumb module-level inline asm.
Summary:
By prepending `.text .thumb .balign 2` to the module-level inline
assembly from a Thumb module, the assembler will generate the assembly
from that module as Thumb, even if the destination module uses an ARM
triple. Similar directives are used for module-level inline assembly in
ARM modules.
The alignment and instruction set are reset based on the target triple
before emitting the first function label.
Reviewers: olista01, tejohnson, echristo, t.p.northover, rafael
Reviewed By: echristo
Subscribers: aemerson, javed.absar, eraman, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D34622
llvm-svn: 307772
Alex Lorenz [Wed, 12 Jul 2017 11:35:11 +0000 (11:35 +0000)]
[libclang] Support for querying whether an enum is scoped
This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).
Patch by Johann Klähn!
Differential Revision: https://reviews.llvm.org/D35187
llvm-svn: 307771
Alex Lorenz [Wed, 12 Jul 2017 11:34:14 +0000 (11:34 +0000)]
Revert r307769 (Forgot to mention the name of the contributor).
llvm-svn: 307770
Alex Lorenz [Wed, 12 Jul 2017 11:31:37 +0000 (11:31 +0000)]
[libclang] Support for querying whether an enum is scoped
This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).
Differential Revision: https://reviews.llvm.org/D35187
llvm-svn: 307769
Ravitheja Addepally [Wed, 12 Jul 2017 11:15:34 +0000 (11:15 +0000)]
Adding Support for Error Strings in Remote Packets
Summary:
This patch adds support for sending strings along with
error codes in the reply packets. The implementation is
based on the feedback recieved in the lldb-dev mailing
list. The patch also adds an extra packet for the client
to query if the server has the capability to provide
strings along with error replys.
Reviewers: labath, jingham, sas, lldb-commits, clayborg
Reviewed By: labath, clayborg
Differential Revision: https://reviews.llvm.org/D34945
llvm-svn: 307768
George Rimar [Wed, 12 Jul 2017 11:09:46 +0000 (11:09 +0000)]
[ELF] - Fix handling of weak symbols from static library when using version script.
When version script was used, binding opf undefined weak symbols sometimes
was calculated as STB_LOCAL, making them non-preemtible what
broke correct relocations handling logic for them.
Fixes PR33738.
Differential revision: https://reviews.llvm.org/D35263
llvm-svn: 307767
Diana Picus [Wed, 12 Jul 2017 10:31:16 +0000 (10:31 +0000)]
[ARM] GlobalISel: Simplify inst selector code. NFC
Refactor CmpHelper into something simpler. It was overkill to use
templates for this - instead, use a simple CmpConstants structure to
hold the opcodes and other constants that are different when selecting
int / float / double comparisons. Also, extract some of the helpers that
were in CmpHelper into ARMInstructionSelector and make use of some of
them when selecting other things than just compares.
llvm-svn: 307766
Siddharth Bhat [Wed, 12 Jul 2017 09:42:05 +0000 (09:42 +0000)]
[Polly] [Tests] Update `lit.cfg` uses of `lit.util.capture` to `subprocess.check_output`
- `lit.util.capture` was removed in `r306625`.
- Replace `lit.util.capture` to `subprocess.check_output` as LLVM did.
- LLVM revision of this change: `https://reviews.llvm.org/D35088`.
Differential Revision: https://reviews.llvm.org/D35255
llvm-svn: 307765
Chandler Carruth [Wed, 12 Jul 2017 09:08:11 +0000 (09:08 +0000)]
[PM] Fix a silly bug in my recent update to the CG update logic.
I used the wrong variable to update. This was even covered by a unittest
I wrote, and the comments for the unittest were correct (if confusing)
but the test itself just matched the buggy behavior. =[
llvm-svn: 307764
Diana Picus [Wed, 12 Jul 2017 09:01:54 +0000 (09:01 +0000)]
[ARM] GlobalISel: Select s64 G_FCMP
Very similar to how we select s32 G_FCMP, the only thing that is
different is the exact opcodes that we use.
llvm-svn: 307763
Serge Guelton [Wed, 12 Jul 2017 08:03:44 +0000 (08:03 +0000)]
Have Module::createRNG return a unique_ptr
Instead of a raw pointer, this makes memory management safer.
llvm-svn: 307762
Michael Zuckerman [Wed, 12 Jul 2017 08:01:44 +0000 (08:01 +0000)]
[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess.
Adding base test for AVX512
llvm-svn: 307761
John McCall [Wed, 12 Jul 2017 07:44:17 +0000 (07:44 +0000)]
Expose some type-conversion functions as part of the IRGen ABI.
Patch by Benoit Vey!
llvm-svn: 307760
Matthias Gehre [Wed, 12 Jul 2017 07:04:19 +0000 (07:04 +0000)]
CFG: Add CFGElement for automatic variables that leave the scope
Summary:
This mimics the implementation for the implicit destructors. The
generation of this scope leaving elements is hidden behind
a flag to the CFGBuilder, thus it should not affect existing code.
Currently, I'm missing a test (it's implicitly tested by the clang-tidy
lifetime checker that I'm proposing).
I though about a test using debug.DumpCFG, but then I would
have to add an option to StaticAnalyzer/Core/AnalyzerOptions
to enable the scope leaving CFGElement,
which would only be useful to that particular test.
Any other ideas how I could make a test for this feature?
Reviewers: krememek, jordan_rose
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15031
llvm-svn: 307759
Craig Topper [Wed, 12 Jul 2017 06:49:58 +0000 (06:49 +0000)]
[X86] Synchronize the ProcessorFeatures enum used by getHostCPUName with the enum in libgcc and soon compiler-rt.
This adds all the feature bits libgcc has. They will soon be added to compiler-rt as well. This adds a second 32 bit feature variable to hold the bits that are needed by getHostCPUName that are not in libgcc. libgcc had already used 31 of the 32 bits in the existing variable and we needed 3 bits so at minimum 2 bits would spill over. I chose to move all 3.
llvm-svn: 307758
Craig Topper [Wed, 12 Jul 2017 06:49:57 +0000 (06:49 +0000)]
[X86] Sync ProcessorTypes and ProcessorSubtypes enums used by getHostCPUName with the version proposed to for compiler-rt's cpu_model.c
This keeps the starting entries in the enums in sync with what's in gcc and in review D35214 for compiler-rt.
llvm-svn: 307757
Craig Topper [Wed, 12 Jul 2017 06:49:56 +0000 (06:49 +0000)]
[X86] Cleanup the switches in getHostCPUName to remove impossible combinations.
llvm-svn: 307756
Craig Topper [Wed, 12 Jul 2017 06:49:55 +0000 (06:49 +0000)]
[X86] Remove 'barcelona' string from getHostCPUName. Use 'amdfam10' instead. The x86 backend doesn't distinguish.
llvm-svn: 307755
Mikael Holmen [Wed, 12 Jul 2017 06:19:10 +0000 (06:19 +0000)]
[MemoryBuiltins] Allow truncation in visitAllocaInst()
Summary:
Solves PR33689.
If the pointer size is less than the size of the type used for the array
size in an alloca (the <ty> type below) then we could trigger the assert in
the PR. In that example we have pointer size i16 and <ty> is i32.
<result> = alloca [inalloca] <type> [, <ty> <NumElements>] [, align <alignment>]
Handle the situation by allowing truncation as well as zero extension in
ObjectSizeOffsetVisitor::visitAllocaInst().
Also, we now detect overflow in visitAllocaInst(), similar to how it was
already done in visitCallSite().
Reviewers: craig.topper, rnk, george.burgess.iv
Reviewed By: george.burgess.iv
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D35003
llvm-svn: 307754
Vitaly Buka [Wed, 12 Jul 2017 04:34:17 +0000 (04:34 +0000)]
Revert "[PDB] Use a more appropriate message for a fatal error"
Revert "[PDB] Tweak bad type index error handling"
check-lld with asan detects use-after-poison.
This reverts commits r307733 and r307726.
llvm-svn: 307752
Ben Craig [Wed, 12 Jul 2017 01:45:13 +0000 (01:45 +0000)]
Fix unrepresentable enum for clang-cl unstable ABI
When using LIBCXX_ABI_UNSTABLE=YES, clang-cl gave the following warning:
P:\llvm_master\src\llvm\projects\libcxx\include\string(683,51):
warning: enumerator value is not representable in the underlying type
'int' [-Wmicrosoft-enum-value]
Fixed by switching from enums to static const size_type.
https://reviews.llvm.org/D35174
llvm-svn: 307751
Rui Ueyama [Wed, 12 Jul 2017 01:43:01 +0000 (01:43 +0000)]
Remove redundant newline.
llvm-svn: 307750
Eric Fiselier [Wed, 12 Jul 2017 01:38:35 +0000 (01:38 +0000)]
Remove <__refstring> header; Move it into source directory.
The libc++ <__refstring> headers has no real reason why it should
be a public header that libc++ ships. The only reason it was in the include
directory was because libc++abi needed it to build the library.
However keeping <__refstring> a header had other problems, like requiring its
dependancies to also be in the headers. For that reason this patch
moves it into the source directory.
To work around libc++abi's need for this header a duplicated copy was added
to libc++abi in r307748. While duplicating the code is an unfortunate solution
it's the best solution that's currently possible.
In the future I would like to start a discussion on the mailing lists about
making libc++abi build as a sub-project of libc++, requiring the libc++ sources
always be present.
llvm-svn: 307749
Eric Fiselier [Wed, 12 Jul 2017 01:34:21 +0000 (01:34 +0000)]
Remove dependancy on __refstring header; use local copy instead.
This patch removes the dependancy on libc++'s __refstring header,
which was only a header in the first place so that libc++abi could
build library code using it, and not because libc++ needed it in
the headers.
This patch allows libc++ to stop shipping <__refstring> publicaly
at the cost of duplicating it across projects. Ideally libc++abi
would always require the libc++ sources when building, but that's
a separate discussion I plan to start on the mailing lists shortly.
llvm-svn: 307748
Matthias Braun [Wed, 12 Jul 2017 01:16:50 +0000 (01:16 +0000)]
Specify complete target triple in test
This should fix the problems on the greendragon build.
llvm-svn: 307747
Eric Fiselier [Wed, 12 Jul 2017 01:16:33 +0000 (01:16 +0000)]
Revert "[libc++] Refactoring __sync_* builtins; NFC (Reland)"
This reverts commit r307595. The commit had some issues that needed
to first be addressed in review.
llvm-svn: 307746
Don Hinton [Wed, 12 Jul 2017 01:15:46 +0000 (01:15 +0000)]
Fix minor typo introduced in r276404
Summary:
A space was added between '-' and 'help' when emitting help output.
See https://reviews.llvm.org/D22621 for details.
Reviewers: MaggieYi, vsk
Reviewed By: vsk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35283
llvm-svn: 307745
Peter Collingbourne [Wed, 12 Jul 2017 00:39:12 +0000 (00:39 +0000)]
LowerTypeTests: When importing functions skip definitions where the summary contains a decl.
This normally indicates mixed CFI + non-CFI compilation, and will
result in us treating the function in the same way as a function
defined outside of the LTO unit.
Part of PR33752.
Differential Revision: https://reviews.llvm.org/D35281
llvm-svn: 307744
Richard Trieu [Wed, 12 Jul 2017 00:38:27 +0000 (00:38 +0000)]
[ODRHash] Revert r307720 to fix buildbot.
llvm-svn: 307743
Jakub Kuderski [Wed, 12 Jul 2017 00:29:16 +0000 (00:29 +0000)]
[Dominators][NFC] Remove extra semicolon...
to silence a gcc warning.
llvm-svn: 307742
Sam Clegg [Wed, 12 Jul 2017 00:24:54 +0000 (00:24 +0000)]
[WebAssembly] Expose the offset of each data segment
Summary:
This allows tools like lld that process relocations
to apply data relocation correctly. This information
is required because relocation are stored as section
offset.
Subscribers: jfb, dschuff, jgravelle-google, aheejin
Differential Revision: https://reviews.llvm.org/D35234
llvm-svn: 307741
Konstantin Zhuravlyov [Wed, 12 Jul 2017 00:15:53 +0000 (00:15 +0000)]
Fix unused variable warnings
Differential Revision: https://reviews.llvm.org/D35280
llvm-svn: 307740
Vitaly Buka [Wed, 12 Jul 2017 00:14:05 +0000 (00:14 +0000)]
[tsan] Update test to r307338
r307338 enabled new optimization reducing number of operation in tested functions.
There is no any performance regression detectable with TsanRtlTest DISABLED_BENCH.Mop* tests.
llvm-svn: 307739
Rafael Espindola [Tue, 11 Jul 2017 23:56:10 +0000 (23:56 +0000)]
Simplify interface now that we don't need to pass IsPCRel. NFC.
llvm-svn: 307734
Reid Kleckner [Tue, 11 Jul 2017 23:44:51 +0000 (23:44 +0000)]
[PDB] Use a more appropriate message for a fatal error
llvm-svn: 307733
Reid Kleckner [Tue, 11 Jul 2017 23:41:41 +0000 (23:41 +0000)]
[codeview] Change readobj symbol dumping format
Avoid duplicating DictScope with hand-written names everywhere. Print
the S_-prefixed symbol kind for every record. This should make it easier
to search for certain kinds of records when debugging PDB linking.
llvm-svn: 307732
Petr Hosek [Tue, 11 Jul 2017 23:41:15 +0000 (23:41 +0000)]
[CMake] Support multi-target runtimes build
This changes adds support for building runtimes for multiple
different targets using LLVM runtimes directory.
The implementation follow the model used already by the builtins
build which already supports this option. To specify the runtimes
targets to be built, use the LLVM_RUNTIME_TARGETS variable, where
the valuae is the list of targets to build runtimes for. To pass
a per target variable to the runtimes build, you can set
RUNTIMES_<target>_<variable> where <variable> will be passed to the
runtimes build for <target>.
Each runtime target (except for the default one) will be installed
into lib/<target> subdirectory. Build targets will be suffixed with
the target name.
Differential Revision: https://reviews.llvm.org/D32816
llvm-svn: 307731
Rafael Espindola [Tue, 11 Jul 2017 23:18:25 +0000 (23:18 +0000)]
Fully fix the movw/movt addend.
The issue is not if the value is pcrel. It is whether we have a
relocation or not.
If we have a relocation, the static linker will select the upper
bits. If we don't have a relocation, we have to do it.
llvm-svn: 307730