Francis Ricci [Tue, 18 Apr 2017 20:56:56 +0000 (20:56 +0000)]
Allow for setting of global platform-specific lsan options in the test suite
Reviewers: kubamracek, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32131
llvm-svn: 300592
Alex Lorenz [Tue, 18 Apr 2017 20:54:23 +0000 (20:54 +0000)]
The SubjectMatchRule enum should not be used as a DenseMap key to avoid
UBSAN 'invalid value' failures
The commit r300556 introduced a UBSAN issue that was caught by
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap. The DenseMap
failed to create an empty/tombstone value as the empty/tombstone values for the
SubjectMatchRule enum were not valid enum constants.
llvm-svn: 300591
Chris Bieneman [Tue, 18 Apr 2017 20:49:09 +0000 (20:49 +0000)]
[CMake] Adding configure-time check for sigaction
Hopefully this will fix the netbsd bot that I broke...
llvm-svn: 300590
Chris Bieneman [Tue, 18 Apr 2017 20:49:05 +0000 (20:49 +0000)]
Writing multi-platform code is hard...
Fixing another error from r300579.
llvm-svn: 300589
Haojian Wu [Tue, 18 Apr 2017 20:47:34 +0000 (20:47 +0000)]
[clang-tidy] Address a few late comments.
llvm-svn: 300588
Chris Bieneman [Tue, 18 Apr 2017 20:37:05 +0000 (20:37 +0000)]
Fix broken windows build.
This is not ideal, but it should get the bot going again. I'll need to revisit this if we want to get signal handling working on Windows.
llvm-svn: 300587
Craig Topper [Tue, 18 Apr 2017 20:17:23 +0000 (20:17 +0000)]
[MemoryBuiltins] Use ImmutableCallSite instead of CallSite to remove a const_cast and const correct. NFCI
llvm-svn: 300585
Daniel Berlin [Tue, 18 Apr 2017 20:15:47 +0000 (20:15 +0000)]
NewGVN: Fix memory congruence verification. The return true should be a return false. Merge the appropriate if statements so it doesn't happen again.
llvm-svn: 300584
Chih-Hung Hsieh [Tue, 18 Apr 2017 20:15:18 +0000 (20:15 +0000)]
[X86] Keep EXTRACT_VECTOR_ELT result type as f128 for Android x86_64.
Android x86_64 target uses f128 type and stores f128 values in %xmm* registers.
SoftenFloatRes_EXTRACT_VECTOR_ELT should not convert result value
from f128 to i128.
Differential Revision: http://reviews.llvm.org/D32102
llvm-svn: 300583
Chris Bieneman [Tue, 18 Apr 2017 20:08:29 +0000 (20:08 +0000)]
Fixing bot failure caused by r300579
llvm-svn: 300582
Casey Carter [Tue, 18 Apr 2017 20:04:39 +0000 (20:04 +0000)]
[test] Silence another unused-typedef warning
llvm-svn: 300581
Chris Bieneman [Tue, 18 Apr 2017 20:01:59 +0000 (20:01 +0000)]
Update DebugServer to support IPv6 over TCP
Summary: This patch adds IPv6 support to debugserver. It follows a similar pattern to the changes proposed for LLDB/Host except that the listen implementation is only with kqueue(2) because debugserver is only supported on Darwin.
Reviewers: jingham, jasonmolenda, clayborg
Reviewed By: clayborg
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D31824
llvm-svn: 300580
Chris Bieneman [Tue, 18 Apr 2017 20:01:52 +0000 (20:01 +0000)]
Update LLDB Host to support IPv6 over TCP
Summary:
This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way.
This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me).
The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call.
This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address.
The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else.
Reviewers: zturner, clayborg
Subscribers: jasonmolenda, labath, lldb-commits, emaste
Differential Revision: https://reviews.llvm.org/D31823
llvm-svn: 300579
Ekaterina Romanova [Tue, 18 Apr 2017 19:44:07 +0000 (19:44 +0000)]
[DOXYGEN] Minor improvements in doxygen comments.
- To be consistent with the rest of the intrinsics headers, I removed the tags <i> .. </i> for marking instruction names in italics in in smmintrin.h.
- Formatting changes to fit into 80 characters.
I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.
llvm-svn: 300578
Craig Topper [Tue, 18 Apr 2017 19:13:27 +0000 (19:13 +0000)]
[APInt] Inline the single word case of lshrInPlace similar to what we do for <<=.
llvm-svn: 300577
Simon Pilgrim [Tue, 18 Apr 2017 19:04:40 +0000 (19:04 +0000)]
[X86][SSE] Add scheduling latency/throughput tests for (most) SSE1 instructions
llvm-svn: 300576
Casey Carter [Tue, 18 Apr 2017 18:44:33 +0000 (18:44 +0000)]
[test] Silence unused parameter/typedef warnings
llvm-svn: 300575
Easwaran Raman [Tue, 18 Apr 2017 18:16:57 +0000 (18:16 +0000)]
[SLP vectorizer] Allow phi node reordering in tryToVectorizeList.
In tryToVectorizeList, under a very limited circumstance (when entered
from tryToVectorizePair), the values may be reordered (swapped) and the
SLP tree is built with the new order. This extends that to the case when
starting from phis in vectorizeChainsInBlock when there are exactly two
phis. The textual order of phi nodes shouldn't really matter. Without
this change, the loop body in the accompnaying test case is fully vectorized
when we swap the orde of the phis but not with this order. While this
doesn't solve the phi-ordering problem in a general way (for more than 2
phis), this is simple fix that piggybacks on an existing mechanism and
is useful in cases like multiplying two complex numbers.
Differential revision: https://reviews.llvm.org/D32065
llvm-svn: 300574
Reid Kleckner [Tue, 18 Apr 2017 17:44:41 +0000 (17:44 +0000)]
Remove unused varible
The Result variable is unused both in Sema::CheckARMBuiltinFunctionCall
and Sema::CheckAArch64BuiltinFunctionCall, remove it.
Patch by Wei-Ren Chen!
Reviewers: craig.topper, rnk
Reviewed By: rnk
Subscribers: aemerson, cfe-commits, rengolin
Differential Revision: https://reviews.llvm.org/D32014
llvm-svn: 300572
Manoj Gupta [Tue, 18 Apr 2017 17:36:10 +0000 (17:36 +0000)]
[AArch64][clang] Pass cpu/arch information to assembler for AArch64.
Summary:
Pass Cpu/Arch options to assembler for AArch64 with no-integrated-as.
This fixes PR20019.
Reviewers: richard.barton.arm, kristof.beyls, rengolin
Reviewed By: rengolin
Subscribers: srhines, pirama, aemerson, rengolin, cfe-commits
Differential Revision: https://reviews.llvm.org/D32132
llvm-svn: 300571
Manoj Gupta [Tue, 18 Apr 2017 17:34:46 +0000 (17:34 +0000)]
Testing commit access.
Summary: Test commit access.
Reviewers: gbiv, george.burgess.iv
Reviewed By: george.burgess.iv
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D32161
llvm-svn: 300570
Alexander Kornienko [Tue, 18 Apr 2017 17:26:00 +0000 (17:26 +0000)]
[clang-tidy] Fix google-explicit-constructor issue with out-of-line conversions
llvm-svn: 300569
Marshall Clow [Tue, 18 Apr 2017 17:22:49 +0000 (17:22 +0000)]
Mark LWG#2788 as complete - we already do this
llvm-svn: 300568
Simon Pilgrim [Tue, 18 Apr 2017 17:18:54 +0000 (17:18 +0000)]
[X86] Use for-range loop. NFCI.
llvm-svn: 300567
Craig Topper [Tue, 18 Apr 2017 17:14:21 +0000 (17:14 +0000)]
[APInt] Use lshrInPlace to replace lshr where possible
This patch uses lshrInPlace to replace code where the object that lshr is called on is being overwritten with the result.
This adds an lshrInPlace(const APInt &) version as well.
Differential Revision: https://reviews.llvm.org/D32155
llvm-svn: 300566
Daniel Berlin [Tue, 18 Apr 2017 17:06:11 +0000 (17:06 +0000)]
NewGVN: Don't waste time value numbering unreachable blocks
llvm-svn: 300565
Jim Ingham [Tue, 18 Apr 2017 16:52:16 +0000 (16:52 +0000)]
Add back code to implement "frame var -a,-l,-g" filters.
r285226 dropped the code that did these checks. I am pretty
sure that was inadvertent, so I added that back in and added
a test for it.
<rdar://problem/
31661252>
llvm-svn: 300564
Haojian Wu [Tue, 18 Apr 2017 16:25:03 +0000 (16:25 +0000)]
Make the test pass on x86_64-win32 target.
llvm-svn: 300563
Martell Malone [Tue, 18 Apr 2017 15:56:24 +0000 (15:56 +0000)]
mingw-w64: enable support for __declspec(selectany)
Add selectany as a GCC spelling for mingw-w64
Reviewers: rnk
Differential revision: https://reviews.llvm.org/D32083
llvm-svn: 300562
Nirav Dave [Tue, 18 Apr 2017 15:36:34 +0000 (15:36 +0000)]
[DAG] Improve store merge candidate pruning.
Remove non-consecutive stores from store merge candidate search as
they cannot be merged and will prevent us from finding subsequent
mergeable store cases.
Reviewers: jyknight, bogner, javed.absar, spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32086
llvm-svn: 300561
Alex Lorenz [Tue, 18 Apr 2017 15:12:34 +0000 (15:12 +0000)]
[ASTPrinter] Print template parameter lists for out-of-line functions
llvm-svn: 300560
Nirav Dave [Tue, 18 Apr 2017 15:12:13 +0000 (15:12 +0000)]
Add base-index-based store merge test
llvm-svn: 300559
Zvi Rackover [Tue, 18 Apr 2017 14:55:43 +0000 (14:55 +0000)]
LoopRerollPass: Prefer Value::hasOneUse() over Value::getNumUses(). NFC.
getNumUses() can be more expensive as it iterates over all list's elements.
llvm-svn: 300558
Gil Rapaport [Tue, 18 Apr 2017 14:43:43 +0000 (14:43 +0000)]
[LV] Cache block mask values
This patch is part of D28975's breakdown.
Add caching for block masks similar to the cache already used for edge masks,
replacing generation per user with reusing the first generated value which
dominates all uses.
Differential Revision: https://reviews.llvm.org/D32054
llvm-svn: 300557
Alex Lorenz [Tue, 18 Apr 2017 14:33:39 +0000 (14:33 +0000)]
Add #pragma clang attribute
This is a recommit of r300539 that was reverted in r300543 due to test failures.
The original commit message is displayed below:
The new '#pragma clang attribute' directive can be used to apply attributes to
multiple declarations. An attribute must satisfy the following conditions to
be supported by the pragma:
- It must have a subject list that's defined in the TableGen file.
- It must be documented.
- It must not be late parsed.
- It must have a GNU/C++11 spelling.
Differential Revision: https://reviews.llvm.org/D30009
llvm-svn: 300556
Martell Malone [Tue, 18 Apr 2017 14:27:36 +0000 (14:27 +0000)]
Driver: Better detection of mingw-gcc
Stop blindly searching for "gcc.exe" on windows.
Stop assuming "/usr" on unix, fixes cross compiling.
Reviewers: mati865, yaron.keren
Subscribers: ismail, rnk
Differential revision: https://reviews.llvm.org/D15005
llvm-svn: 300555
Sanjay Patel [Tue, 18 Apr 2017 14:27:24 +0000 (14:27 +0000)]
[ConstantRange] fix doxygen comment formatting; NFC
llvm-svn: 300554
Nikolai Bozhenov [Tue, 18 Apr 2017 13:29:26 +0000 (13:29 +0000)]
Make globalaa-retained.ll test catching more cases.
Summary:
* Add checks for store. That is needed because GlobalsAA is called
twice in the current pipeline with different sets of Function passes
following it. However, the loads are eliminated using instcombine
which happens everywhere. On the other hand, DeadStoreElimination is
performed only once so by checking for store we'll be able to catch
more cases when GlobalsAA is invalidated unintentionally.
* Add empty function above/below the test so that we don't depend on
the relative order of instcombine/dead-store-elimination and the
pass that invalidates the analysis (inside the same
FunctionPassManager).
Reviewers: kristof.beyls
Reviewed By: kristof.beyls
Subscribers: llvm-commits, n.bozhenov
Differential Revision: https://reviews.llvm.org/D32015
Patch by Andrei Elovikov <andrei.elovikov@intel.com>
llvm-svn: 300553
Nikolai Bozhenov [Tue, 18 Apr 2017 13:25:49 +0000 (13:25 +0000)]
[GVNHoist] Mark GlobalsAA as preserved by GVNHoist.
Reviewers: sebpop, hiraditya
Reviewed By: sebpop
Subscribers: n.bozhenov, llvm-commits
Differential Revision: https://reviews.llvm.org/D32158
Patch by Andrei Elovikov <andrei.elovikov@intel.com>
llvm-svn: 300552
Nirav Dave [Tue, 18 Apr 2017 13:25:19 +0000 (13:25 +0000)]
Add store Merge test.
llvm-svn: 300551
Oliver Stannard [Tue, 18 Apr 2017 13:21:05 +0000 (13:21 +0000)]
[ARM] Add hardware build attributes in assembler
This passes an option to the ARM assembly parser to emit build
attributes for the hardware selected by command line options, when
assembling an assembly file.
This is not enabled for C/C++, as this would result in duplicate build
attribute directives being emitted in each inline assembly block, when
emitting assembly.
This also adds an option to allow disabling this behaviour for assembly
files, for users who were relying on the old behaviour.
Differential revision: https://reviews.llvm.org/D31813
llvm-svn: 300550
Oliver Stannard [Tue, 18 Apr 2017 13:12:36 +0000 (13:12 +0000)]
[ARM,AArch64] Define __ELF__ for arm-none-eabihf and AArch64
This macro is defined for arm-none-eabi as of r266625, but it should also be
defined for eabihf and aarch64.
llvm-svn: 300549
Kamil Rytarowski [Tue, 18 Apr 2017 12:53:35 +0000 (12:53 +0000)]
Introduce FPR and Debug Registers/NetBSD/amd64 support
Summary:
This code offers Debug Registers (80386) model in LLDB/amd64.
This is initial support and has one issue that will be addressed later,
Debug Register trap (TRAP_DBREG) is registered as (TRAP_TRACE)
for unknown reason. On the other hand this works good enough to
move on and leave this bug to be squashed later.
Improve the NativeProcessNetBSD::ReinitializeThreads() function,
stop setting inside it SetStoppedByExec(). This fixes incorrect
stop reason on attaching (SetStoppedBySignal(SIGSTOP)).
This commits also has no functional style improvements from
clang-format.
This code also ships with FXSAVE support on NetBSD.
Demo:
```
$ lldb ./watch
(lldb) target create "./watch"
Current executable set to './watch' (x86_64).
(lldb) b main
Breakpoint 1: where = watch`main + 15 at watch.c:8, address = 0x000000000040087f
(lldb) r
Process 1573 launched: './watch' (x86_64)
Process 1573 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x000000000040087f watch`main(argc=1, argv=0x00007f7fffa12b88) at watch.c:8
5 {
6 int i, j, k;
7
-> 8 for (i = 0; i < 3; i++)
9 for (j = 0; j < 3; j++)
10 for (k = 0; k < 3; k++)
11 printf("Hello world! i=%d j=%d k=%d\n", i, j, k);
(lldb) watch set var i
Watchpoint created: Watchpoint 1: addr = 0x7f7fffa12b4c size = 4 state = enabled type = w
declare @ '/public/lldb_devel/watch.c:6'
watchpoint spec = 'i'
new value: 0
(lldb) c
Process 1573 resuming
Hello world! i=0 j=0 k=0
Hello world! i=0 j=0 k=1
Hello world! i=0 j=0 k=2
Hello world! i=0 j=1 k=0
Hello world! i=0 j=1 k=1
Hello world! i=0 j=1 k=2
Hello world! i=0 j=2 k=0
Hello world! i=0 j=2 k=1
Hello world! i=0 j=2 k=2
Process 1573 stopped
* thread #1, stop reason = trace
frame #0: 0x00000000004008cc watch`main(argc=1, argv=0x00007f7fffa12b88) at watch.c:8
5 {
6 int i, j, k;
7
-> 8 for (i = 0; i < 3; i++)
9 for (j = 0; j < 3; j++)
10 for (k = 0; k < 3; k++)
11 printf("Hello world! i=%d j=%d k=%d\n", i, j, k)
```
FPR (in another program using libm)
```
(lldb) register read --all
General Purpose Registers:
rax = 0x000000000000001c
rbx = 0x00007f7fff1d4fe0
rcx = 0x000000000000000c
rdx = 0x0000000000000002
rdi = 0x0000746711d5b018 __sF + 152
rsi = 0x0000000000000001
rbp = 0x00007f7fff1d3d80
rsp = 0x00007f7fff1d3d60
r8 = 0x00007f7fff1d3470
r9 = 0x0000000000000000
r10 = 0x0000000000000001
r11 = 0x0000000000000202
r12 = 0x00007f7fff1d3da0
r13 = 0x00007d8ad2d88500
r14 = 0x0000000000000002
r15 = 0x00007f7fffa627e0
rip = 0x00000000004009e9 fpr`main + 217 at fpr.c:15
rflags = 0x0000000000000202
cs = 0x0000000000000047
fs = 0x0000000000000000
gs = 0x0000000000000000
ss = 0x000000000000003f
ds = 0x000000000000003f
es = 0x000000000000003f
eax = 0x0000001c
ebx = 0xff1d4fe0
ecx = 0x0000000c
edx = 0x00000002
edi = 0x11d5b018
esi = 0x00000001
ebp = 0xff1d3d80
esp = 0xff1d3d60
r8d = 0xff1d3470
r9d = 0x00000000
r10d = 0x00000001
r11d = 0x00000202
r12d = 0xff1d3da0
r13d = 0xd2d88500
r14d = 0x00000002
r15d = 0xffa627e0
ax = 0x001c
bx = 0x4fe0
cx = 0x000c
dx = 0x0002
di = 0xb018
si = 0x0001
bp = 0x3d80
sp = 0x3d60
r8w = 0x3470
r9w = 0x0000
r10w = 0x0001
r11w = 0x0202
r12w = 0x3da0
r13w = 0x8500
r14w = 0x0002
r15w = 0x27e0
ah = 0x00
bh = 0x4f
ch = 0x00
dh = 0x00
al = 0x1c
bl = 0xe0
cl = 0x0c
dl = 0x02
dil = 0x18
sil = 0x01
bpl = 0x80
spl = 0x60
r8l = 0x70
r9l = 0x00
r10l = 0x01
r11l = 0x02
r12l = 0xa0
r13l = 0x00
r14l = 0x02
r15l = 0xe0
unknown:
fctrl = 0x037f
fstat = 0x0220
ftag = 0x00
fop = 0x0000
fiseg = 0x11e1a52c
fioff = 0x11e1a52c
foseg = 0xff1d3d54
fooff = 0xff1d3d54
mxcsr = 0x00001fa0
mxcsrmask = 0x0000ffff
st0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
st1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
st2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
st3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
st7 = {0xa5 0xdb 0x2d 0xbd 0x93 0xae 0xb9 0xfe 0xfe 0x3f}
mm0 = 0x3fe9d13800000000
mm1 = 0x3e0485fcce89c000
mm2 = 0x3fefd735e0000000
mm3 = 0x0000000000000000
mm4 = 0x3fe0000000000000
mm5 = 0x3fe00000005217f3
mm6 = 0x0000000000000000
mm7 = 0x3fefd735e0000000
xmm0 = {0x00 0x00 0x00 0x00 0x38 0xd1 0xe9 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm1 = {0x00 0xc0 0x89 0xce 0xfc 0x85 0x04 0x3e 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm2 = {0x00 0x00 0x00 0xe0 0x35 0xd7 0xef 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm4 = {0x00 0x00 0x00 0x00 0x00 0x00 0xe0 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm5 = {0xf3 0x17 0x52 0x00 0x00 0x00 0xe0 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm7 = {0x00 0x00 0x00 0xe0 0x35 0xd7 0xef 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm8 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm9 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm10 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm11 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm12 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm13 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm14 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
xmm15 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
dr0 = 0x0000000000000000
dr1 = 0x0000000000000000
dr2 = 0x0000000000000000
dr3 = 0x0000000000000000
dr4 = 0x0000000000000000
dr5 = 0x0000000000000000
dr6 = 0x00000000ffff0ff0
dr7 = 0x0000000000000400
22 registers were unavailable.
```
Sponsored by <The NetBSD Foundation>
Reviewers: labath, emaste, joerg, kettenis
Reviewed By: labath
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D32080
llvm-svn: 300548
Oliver Stannard [Tue, 18 Apr 2017 12:52:35 +0000 (12:52 +0000)]
[ARM] Add hardware build attributes in assembler
In the assembler, we should emit build attributes based on the target
selected with command-line options. This matches the GNU assembler's
behaviour. We only do this for build attributes which describe the
hardware that is expected to be available, not the ones that describe
ABI compatibility.
This is done by moving some of the attribute emission code to
ARMTargetStreamer, so that it can be shared between the assembly and
code-generation code paths. Since the assembler only creates a
MCSubtargetInfo, not an ARMSubtarget, the code had to be changed to
check raw features, and not use the convenience functions in
ARMSubtarget.
If different attributes are later specified using the .eabi_attribute
directive, then they will take precedence, as happens when the same
.eabi_attribute is specified twice.
This must be enabled by an option, because we don't want to do this when
parsing inline assembly. The attributes would match the ones emitted at
the start of the file, so wouldn't actually change the emitted object
file, but the extra directives would be added to every inline assembly
block when emitting assembly, which we'd like to avoid.
The majority of the changes in the build-attributes.ll test are just
re-ordering the directives, because the hardware attributes are now
emitted before the ABI ones. However, I did fix one bug which I spotted:
Tag_CPU_arch_profile was not being emitted for v6M.
Differential revision: https://reviews.llvm.org/D31812
llvm-svn: 300547
Diana Picus [Tue, 18 Apr 2017 12:35:28 +0000 (12:35 +0000)]
[ARM] GlobalISel: Add support for G_SUB
Support G_SUB throughout the GlobalISel pipeline. It is exactly the same
as G_ADD, nothing fancy.
llvm-svn: 300546
NAKAMURA Takumi [Tue, 18 Apr 2017 12:13:30 +0000 (12:13 +0000)]
clang-tools-extra/test/clang-tidy/performance-inefficient-vector-operation.cpp: Appease targeting msvc with -fno-ms-extensions.
FIXME: This may work with -target x86_64-win32.
llvm-svn: 300545
Andrea Di Biagio [Tue, 18 Apr 2017 11:27:58 +0000 (11:27 +0000)]
[SampleProfile] Don't assert when printing the DebugLoc of a branch. NFC.
llvm-svn: 300544
Alex Lorenz [Tue, 18 Apr 2017 10:46:41 +0000 (10:46 +0000)]
Revert r300539 - Add #pragma clang attribute
Some tests fail on the Windows buildbots. I will have to investigate more.
This commit reverts r300539, r300540 and r300542.
llvm-svn: 300543
Alex Lorenz [Tue, 18 Apr 2017 10:17:41 +0000 (10:17 +0000)]
Fix one more 'not all control paths return a value' MSVC warning
The warning was caused by r300539.
llvm-svn: 300542
Andrea Di Biagio [Tue, 18 Apr 2017 10:08:53 +0000 (10:08 +0000)]
[SampleProfile] Skip intrinsic calls when visiting callsites in InlineHotFunctions.
Before this patch, we always called method 'findCalleeFunctionSamples()' on
intrinsic calls. However, intrinsic calls like llvm.dbg.value() are not viable
candidates for obvious reasons.
No functional change intended.
Differential Revision: https://reviews.llvm.org/D32008
llvm-svn: 300541
Alex Lorenz [Tue, 18 Apr 2017 09:59:27 +0000 (09:59 +0000)]
[TableGen] Fix MSVC warning that occurs in TableGen generated function
This should fix the Windows buildbot failure that happened after r300539.
llvm-svn: 300540
Alex Lorenz [Tue, 18 Apr 2017 09:41:47 +0000 (09:41 +0000)]
Add #pragma clang attribute
The new '#pragma clang attribute' directive can be used to apply attributes to
multiple declarations. An attribute must satisfy the following conditions to
be supported by the pragma:
- It must have a subject list that's defined in the TableGen file.
- It must be documented.
- It must not be late parsed.
- It must have a GNU/C++11 spelling.
Differential Revision: https://reviews.llvm.org/D30009
llvm-svn: 300539
Kristof Beyls [Tue, 18 Apr 2017 09:26:36 +0000 (09:26 +0000)]
Revert "[GlobalISel] Support vector-of-pointers in LLT"
This reverts r300535 and r300537.
The newly added tests in test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
produces slightly different code between LLVM versions being built with different compilers.
E.g., dependent on the compiler LLVM is built with, either one of the following
can be produced:
remark: <unknown>:0:0: unable to legalize instruction: %vreg0<def>(p0) = G_EXTRACT_VECTOR_ELT %vreg1, %vreg2; (in function: vector_of_pointers_extractelement)
remark: <unknown>:0:0: unable to legalize instruction: %vreg2<def>(p0) = G_EXTRACT_VECTOR_ELT %vreg1, %vreg0; (in function: vector_of_pointers_extractelement)
Non-determinism like this is clearly a bad thing, so reverting this until
I can find and fix the root cause of the non-determinism.
llvm-svn: 300538
Kristof Beyls [Tue, 18 Apr 2017 08:47:55 +0000 (08:47 +0000)]
Fix gcc build after r300535.
llvm-svn: 300537
Diana Picus [Tue, 18 Apr 2017 08:32:27 +0000 (08:32 +0000)]
[ARM] Check for correct HW div when lowering divmod
For subtargets that use the custom lowering for divmod, e.g. gnueabi,
we used to check if the subtarget has hardware divide and then lower to
a div-mul-sub sequence if true, or to a libcall if false.
However, judging by the usage of hasDivide vs hasDivideInARMMode, it
seems that hasDivide only refers to Thumb. For instance, in the
ARMTargetLowering constructor, the code that specifies whether to use
libcalls for (S|U)DIV looks like this:
bool hasDivide = Subtarget->isThumb() ? Subtarget->hasDivide()
: Subtarget->hasDivideInARMMode();
In the case of divmod for arm-gnueabi, using only hasDivide() to
determine what to do means that instead of lowering to __aeabi_idivmod
to get the remainder, we lower to div-mul-sub and then further lower the
div to __aeabi_idiv. Even worse, if we have hardware divide in ARM but
not in Thumb, we generate a libcall instead of using it (this is not an
issue in practice since AFAICT none of the cores that we support have
hardware divide in ARM but not Thumb).
This patch fixes the code dealing with custom lowering to take into
account the mode (Thumb or ARM) when deciding whether or not hardware
division is available.
Differential Revision: https://reviews.llvm.org/D32005
llvm-svn: 300536
Kristof Beyls [Tue, 18 Apr 2017 08:12:45 +0000 (08:12 +0000)]
[GlobalISel] Support vector-of-pointers in LLT
This fixes PR32471.
As comment 10 on that bug report highlights
(https://bugs.llvm.org//show_bug.cgi?id=32471#c10), there are quite a
few different defendable design tradeoffs that could be made, including
not representing pointers at all in LLT.
I decided to go for representing vector-of-pointer as a concept in LLT,
while keeping the size of the LLT type 64 bits (this is an increase from
48 bits before). My rationale for keeping pointers explicit is that on
some targets probably it's very handy to have the distinction between
pointer and non-pointer (e.g. 68K has a different register bank for
pointers IIRC). If we keep a scalar pointer, it probably is easiest to
also have a vector-of-pointers to keep LLT relatively conceptually clean
and orthogonal, while we don't have a very strong reason to break that
orthogonality. Once we gain more experience on the use of LLT, we can
of course reconsider this direction.
Rejecting vector-of-pointer types in the IRTranslator is also an option
to avoid the crash reported in PR32471, but that is only a very
short-term solution; also needs quite a bit of code tweaks in places,
and is probably fragile. Therefore I didn't consider this the best
option.
llvm-svn: 300535
Haojian Wu [Tue, 18 Apr 2017 07:46:39 +0000 (07:46 +0000)]
[clang-tidy] Add a clang-tidy check for possible inefficient vector operations
Summary:
The "performance-inefficient-vector-operation" check finds vector oprations in
for-loop statements which may cause multiple memory reallocations.
This is the first version, only detects typical for-loop:
```
std::vector<int> v;
for (int i = 0; i < n; ++i) {
v.push_back(i);
}
// or
for (int i = 0; i < v2.size(); ++i) {
v.push_back(v2[i]);
}
```
We can extend it to handle more cases like for-range loop in the future.
Reviewers: alexfh, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: zaks.anna, Eugene.Zelenko, mgorny, cfe-commits, djasper
Differential Revision: https://reviews.llvm.org/D31757
llvm-svn: 300534
Eric Fiselier [Tue, 18 Apr 2017 07:40:22 +0000 (07:40 +0000)]
Emit benchmark tests into the benchmarks build directory, not lib/
llvm-svn: 300533
Leslie Zhai [Tue, 18 Apr 2017 07:28:54 +0000 (07:28 +0000)]
test commit
llvm-svn: 300532
Maxim Ostapenko [Tue, 18 Apr 2017 07:22:26 +0000 (07:22 +0000)]
[sanitizer] Don't include <linux/user.h> in sanitizer_stoptheworld_linux_libcdep.cc on ARM Android
Turned out that adding defined(_arm_) in sanitizer_stoptheworld_linux_libcdep.cc breaks android arm with some toolchains.
.../llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:36:11: fatal error:
'linux/user.h' file not found
# include <linux/user.h> // for pt_regs
^
1 error generated.
Context:
#if SANITIZER_ANDROID && defined(__arm__)
# include <linux/user.h> // for pt_regs
#else
This patch removes corresponding #if SANITIZER_ANDROID && defined(__arm__) and a bit rearranges adjacent сode.
Differential Revision: https://reviews.llvm.org/D32128
llvm-svn: 300531
Eric Fiselier [Tue, 18 Apr 2017 07:17:20 +0000 (07:17 +0000)]
Update google benchmark
llvm-svn: 300530
Eric Fiselier [Tue, 18 Apr 2017 05:30:39 +0000 (05:30 +0000)]
Assert that a valid operator new/delete signature is always found by the coroutine body
llvm-svn: 300529
Eric Fiselier [Tue, 18 Apr 2017 05:08:08 +0000 (05:08 +0000)]
Speculatively attempt to fix bot failures caused by recent coroutine changes.
llvm-svn: 300528
Craig Topper [Tue, 18 Apr 2017 05:02:21 +0000 (05:02 +0000)]
[APInt] Cleanup the reverseBits slow case a little.
Use lshrInPlace. Use single bit extract and operator|=(uint64_t) to avoid a few temporary APInts.
llvm-svn: 300527
Craig Topper [Tue, 18 Apr 2017 04:39:48 +0000 (04:39 +0000)]
[APInt] Make operator<<= shift in place. Improve the implementation of tcShiftLeft and use it to implement operator<<=.
llvm-svn: 300526
Douglas Yung [Tue, 18 Apr 2017 03:25:11 +0000 (03:25 +0000)]
[XRay][compiler-rt] Use emulated TSC when CPU supports rdtscp, but cannot determine the CPU frequency
A problem arises if a machine supports the rdtscp instruction, but the processor
frequency cannot be determined by the function getTSCFrequency(). In this case,
we want to use the emulated TSC instead. This patch implements that by adding a
call to getTSCFrequency() from probeRequiredCPUFeatures(), and the function only
returns true if both the processor supports rdtscp and the CPU frequency can be
determined.
This should fix PR32620.
Reviewers: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32067
llvm-svn: 300525
Eric Fiselier [Tue, 18 Apr 2017 03:12:48 +0000 (03:12 +0000)]
[coroutines] Fix building of new/delete expressions when get_return_object_on_allocation_failure() is present.
Summary:
This patch implements [dcl.fct.def.coroutine]p8:
> The unqualified-id get_return_object_on_allocation_failure is looked up in the scope of
> class P by class member access lookup (3.4.5). If a declaration is found, ..., and if a
> global allocation function is selected, the ::operator new(size_t, nothrow_t) form shall be used.
> [...]
> The allocation function used in this case must have a non-throwing noexcept-specification.
Reviewers: GorNishanov, rsmith, majnemer, aaron.ballman
Reviewed By: GorNishanov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31562
llvm-svn: 300524
Adrian Prantl [Tue, 18 Apr 2017 01:22:01 +0000 (01:22 +0000)]
Debug Info: Remove special-casing of indirect function argument handling.
LLVM has changed the semantics of dbg.declare for describing function
arguments. After this patch a dbg.declare always takes the *address*
of a variable as the first argument, even if the argument is not an
alloca.
https://bugs.llvm.org/show_bug.cgi?id=32382
rdar://problem/
31205000
llvm-svn: 300523
Adrian Prantl [Tue, 18 Apr 2017 01:21:53 +0000 (01:21 +0000)]
PR32382: Fix emitting complex DWARF expressions.
The DWARF specification knows 3 kinds of non-empty simple location
descriptions:
1. Register location descriptions
- describe a variable in a register
- consist of only a DW_OP_reg
2. Memory location descriptions
- describe the address of a variable
3. Implicit location descriptions
- describe the value of a variable
- end with DW_OP_stack_value & friends
The existing DwarfExpression code is pretty much ignorant of these
restrictions. This used to not matter because we only emitted very
short expressions that we happened to get right by accident. This
patch makes DwarfExpression aware of the rules defined by the DWARF
standard and now chooses the right kind of location description for
each expression being emitted.
This would have been an NFC commit (for the existing testsuite) if not
for the way that clang describes captured block variables. Based on
how the previous code in LLVM emitted locations, DW_OP_deref
operations that should have come at the end of the expression are put
at its beginning. Fixing this means changing the semantics of
DIExpression, so this patch bumps the version number of DIExpression
and implements a bitcode upgrade.
There are two major changes in this patch:
I had to fix the semantics of dbg.declare for describing function
arguments. After this patch a dbg.declare always takes the *address*
of a variable as the first argument, even if the argument is not an
alloca.
When lowering a DBG_VALUE, the decision of whether to emit a register
location description or a memory location description depends on the
MachineLocation — register machine locations may get promoted to
memory locations based on their DIExpression. (Future) optimization
passes that want to salvage implicit debug location for variables may
do so by appending a DW_OP_stack_value. For example:
DBG_VALUE, [RBP-8] --> DW_OP_fbreg -8
DBG_VALUE, RAX --> DW_OP_reg0 +0
DBG_VALUE, RAX, DIExpression(DW_OP_deref) --> DW_OP_reg0 +0
All testcases that were modified were regenerated from clang. I also
added source-based testcases for each of these to the debuginfo-tests
repository over the last week to make sure that no synchronized bugs
slip in. The debuginfo-tests compile from source and run the debugger.
https://bugs.llvm.org/show_bug.cgi?id=32382
<rdar://problem/
31205000>
Differential Revision: https://reviews.llvm.org/D31439
llvm-svn: 300522
Evgeniy Stepanov [Tue, 18 Apr 2017 01:08:00 +0000 (01:08 +0000)]
[asan] Fixup for r300483 (which is a fixup for r300473).
Sanitizer Printf() does not know about %lu.
llvm-svn: 300521
George Burgess IV [Tue, 18 Apr 2017 01:04:05 +0000 (01:04 +0000)]
Add const to a const method. NFC
llvm-svn: 300520
Jim Ingham [Tue, 18 Apr 2017 00:44:14 +0000 (00:44 +0000)]
TestStaticVariables still fails on Linux.
llvm-svn: 300519
Davide Italiano [Tue, 18 Apr 2017 00:29:54 +0000 (00:29 +0000)]
[Target] Use hasOneUse() instead of getNumUses().
The latter does a liner scan over a linked list, therefore is
much more expensive.
llvm-svn: 300518
Jim Ingham [Tue, 18 Apr 2017 00:20:59 +0000 (00:20 +0000)]
This test is succeeding on macOS with clang.
llvm-svn: 300517
Billy Robert O'Neal III [Tue, 18 Apr 2017 00:19:50 +0000 (00:19 +0000)]
Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions.
These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way.
Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions.
llvm-svn: 300516
Richard Smith [Mon, 17 Apr 2017 23:44:51 +0000 (23:44 +0000)]
Fix mishandling of escaped newlines followed by newlines or nuls.
Previously, if an escaped newline was followed by a newline or a nul, we'd lex
the escaped newline as a bogus space character. This led to a bunch of
different broken corner cases:
For the pattern "\\\n\0#", we would then have a (horizontal) space whose
spelling ends in a newline, and would decide that the '#' is at the start of a
line, and incorrectly start preprocessing a directive in the middle of a
logical source line. If we were already in the middle of a directive, this
would result in our attempting to process multiple directives at the same time!
This resulted in crashes, asserts, and hangs on invalid input, as discovered by
fuzz-testing.
For the pattern "\\\n" at EOF (with an implicit following nul byte), we would
produce a bogus trailing space character with spelling "\\\n". This was mostly
harmless, but would lead to clang-format getting confused and misformatting in
rare cases. We now produce a trailing EOF token with spelling "\\\n",
consistent with our handling for other similar cases -- an escaped newline is
always part of the token containing the next character, if any.
For the pattern "\\\n\n", this was somewhat more benign, but would produce an
extraneous whitespace token to clients who care about preserving whitespace.
However, it turns out that our lexing for line comments was relying on this bug
due to an off-by-one error in its computation of the end of the comment, on the
slow path where the comment might contain escaped newlines.
llvm-svn: 300515
Peter Collingbourne [Mon, 17 Apr 2017 23:43:49 +0000 (23:43 +0000)]
Object: Shrink the size of irsymtab::Symbol by a word. NFCI.
Instead of storing an UncommonIndex on the Symbol, use a flag bit to store
whether the Symbol has an Uncommon. This shrinks Chromium's .bc files (after
D32061) by about 1%.
Differential Revision: https://reviews.llvm.org/D32070
llvm-svn: 300514
Eric Fiselier [Mon, 17 Apr 2017 23:28:02 +0000 (23:28 +0000)]
Rename coroutine warning when unhandled_exception() is missing
llvm-svn: 300513
Jason Molenda [Mon, 17 Apr 2017 22:52:20 +0000 (22:52 +0000)]
Unify the common code in the ios, tvos, watchos platforms into a single
PlatformRemoveDarwinDevice class, subclassed to those three so they can
provide their specific information.
<rdar://problem/
30159764>
llvm-svn: 300512
Eric Fiselier [Mon, 17 Apr 2017 22:40:44 +0000 (22:40 +0000)]
Revert r300504 - [coroutines] Fix rebuilding of implicit and dependent coroutine statements.
I have no idea what's happening here. The tests that fail on all of the bots
pass on my machine. Further investigation needed.
llvm-svn: 300511
Eric Fiselier [Mon, 17 Apr 2017 22:32:02 +0000 (22:32 +0000)]
Work around GCC 4.9 bug regarding default initialization of const variables
llvm-svn: 300510
Vedant Kumar [Mon, 17 Apr 2017 22:26:10 +0000 (22:26 +0000)]
[ubsan] Skip null checks if they are constant-folded away
The IR builder can constant-fold null checks if the pointer operand
points to a constant. If the "is-non-null" check is folded away to
"true", don't emit the null check + branch.
Testing: check-clang, check-ubsan.
This slightly reduces the amount of null checks we emit when compiling
X86ISelLowering.cpp. Here are the numbers from patched/unpatched clangs
based on r300371.
-------------------------------------
| Setup | # of null checks |
-------------------------------------
| unpatched, -O0 | 25251 |
| patched, -O0 | 23925 | (-5.3%)
-------------------------------------
llvm-svn: 300509
Vedant Kumar [Mon, 17 Apr 2017 22:26:07 +0000 (22:26 +0000)]
[ubsan] Skip null checks on pointers to the start of an alloca
Pointers to the start of an alloca are non-null, so we don't need to
emit runtime null checks for them.
Testing: check-clang, check-ubsan.
This significantly reduces the amount of null checks we emit when
compiling X86ISelLowering.cpp. Here are the numbers from patched /
unpatched clangs based on r300371.
-------------------------------------
| Setup | # of null checks |
-------------------------------------
| unpatched, -O0 | 45439 |
| patched, -O0 | 25251 | (-44.4%)
-------------------------------------
llvm-svn: 300508
Dehao Chen [Mon, 17 Apr 2017 22:23:05 +0000 (22:23 +0000)]
Build SymbolMap in SampleProfileLoader to help matchin function names with suffix.
Summary: If there is suffix added in the function name (e.g. module hash added by thinLTO), we will not be able to find a match in profile as the suffix does not exist in profile. This patch build a map from function name to Function *. The map includes the entry for the stripped function name so that inlineHotFunctions can find the corresponding function to promote/inline.
Reviewers: davidxl, dnovillo, tejohnson
Reviewed By: davidxl
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D31952
llvm-svn: 300507
Haicheng Wu [Mon, 17 Apr 2017 22:22:38 +0000 (22:22 +0000)]
Change the testcase tail-merge-after-mbp.ll to tail-merge-after-mbp.mir
Differential Revision: https://reviews.llvm.org/D32037
llvm-svn: 300506
Craig Topper [Mon, 17 Apr 2017 22:13:00 +0000 (22:13 +0000)]
[SimplifyCFG] Use hasNUses instead of comparing getNumUses to a constant."
The use list is a linked list so getNumUses requires a linear scan through the whole list. hasNUses will stop scanning at N and see if that is the end.
llvm-svn: 300505
Eric Fiselier [Mon, 17 Apr 2017 22:06:13 +0000 (22:06 +0000)]
[coroutines] Fix rebuilding of implicit and dependent coroutine statements.
Summary:
Certain implicitly generated coroutine statements, such as the calls to 'return_value()' or `return_void()` or `get_return_object_on_allocation_failure()`, cannot be built until the promise type is no longer dependent. This means they are not built until after the coroutine body statement has been transformed.
This patch fixes an issue where these statements would never be built for coroutine templates.
It also fixes a small issue where diagnostics about `get_return_object_on_allocation_failure()` were incorrectly suppressed.
Reviewers: rsmith, majnemer, GorNishanov, aaron.ballman
Reviewed By: GorNishanov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31487
llvm-svn: 300504
Craig Topper [Mon, 17 Apr 2017 21:43:43 +0000 (21:43 +0000)]
[APInt] Merge the multiword code from lshrInPlace and tcShiftRight into a single implementation
This merges the two different multiword shift right implementations into a single version located in tcShiftRight. lshrInPlace now calls tcShiftRight for the multiword case.
I retained the memmove fast path from lshrInPlace and used a memset for the zeroing. The for loop is basically tcShiftRight's implementation with the zeroing and the intra-shift of 0 removed.
Differential Revision: https://reviews.llvm.org/D32114
llvm-svn: 300503
Jacob Gravelle [Mon, 17 Apr 2017 21:40:28 +0000 (21:40 +0000)]
[WebAssembly] Fix WebAssemblyOptimizeReturned after r300367
Summary:
Refactoring changed paramHasAttr(1 + i) to paramHasAttr(0), fix that to
paramHasAttr(i).
Add more tests to WebAssemblyOptimizeReturned that catch that
regression.
Reviewers: dschuff
Subscribers: jfb, sbc100, llvm-commits
Differential Revision: https://reviews.llvm.org/D32136
llvm-svn: 300502
Hans Wennborg [Mon, 17 Apr 2017 21:28:36 +0000 (21:28 +0000)]
clang-cl: Support the /Zc:twoPhase[-] command-line option (PR32680)
It sounds like MSVC is adding support for two-phase name lookup in a
future version, enabled by this flag (see bug).
Differential Revision: https://reviews.llvm.org/D32138
llvm-svn: 300501
Benjamin Kramer [Mon, 17 Apr 2017 21:07:26 +0000 (21:07 +0000)]
[SCEV] Fix another unused variable warning in release builds.
llvm-svn: 300500
Wei Mi [Mon, 17 Apr 2017 21:00:45 +0000 (21:00 +0000)]
Fix an unused variable error in rL300494.
llvm-svn: 300499
Kostya Serebryany [Mon, 17 Apr 2017 20:58:21 +0000 (20:58 +0000)]
[libFuzzer] experimental option -cleanse_crash: tries to replace all bytes in a crash reproducer with garbage, while still preserving the crash
llvm-svn: 300498
Benjamin Kramer [Mon, 17 Apr 2017 20:57:40 +0000 (20:57 +0000)]
Revert "Address bugs.llvm.org/pr30994 so that a non-friend can properly replace a friend, and a visible friend can properly replace an invisible friend but not vice verse, and definitions are not replaced. This fixes the two FIXME in SemaTemplate/friend-template.cpp."
This reverts commit r300443. Breaks compiling libc++ with modules in
some configurations.
llvm-svn: 300497
Sylvestre Ledru [Mon, 17 Apr 2017 20:51:50 +0000 (20:51 +0000)]
Add a linker script to version LLVM symbols
Summary:
This patch adds a very simple linker script to version the lib's symbols
and thus trying to avoid crashes if an application loads two different
LLVM versions (as long as they do not share data between them).
Note that we deliberately *don't* make LLVM_5.0 depend on LLVM_4.0:
they're incompatible and the whole point of this patch is
to tell the linker that.
Avoid unexpected crashes when two LLVM versions are used in the same process.
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Author: Lisandro Damían Nicanor Pérez Meyer <lisandro@debian.org>
Author: Sylvestre Ledru <sylvestre@debian.org>
Bug-Debian: https://bugs.debian.org/848368
Reviewers: beanz, rnk
Reviewed By: rnk
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D31524
llvm-svn: 300496
Davide Italiano [Mon, 17 Apr 2017 20:49:50 +0000 (20:49 +0000)]
[InstCombine] Matchers work with both ConstExpr and Instructions.
So, `cast<Instruction>` is not guaranteed to succeed. Change the
code so that we create a new constant and use it in the newly
created instruction, as it's done in other places in InstCombine.
OK'ed by Sanjay/Craig. Fixes PR32686.
llvm-svn: 300495
Wei Mi [Mon, 17 Apr 2017 20:40:05 +0000 (20:40 +0000)]
[SCEV] Add a local cache for getZeroExtendExpr and getSignExtendExpr to prevent
the exponential behavior.
The patch is to fix PR32043. Functions getZeroExtendExpr and getSignExtendExpr
may call themselves recursively more than once. This is potentially a 2^N
complexity behavior. The exponential behavior was not commonly exposed before
because of existing global cache mechnism like UniqueSCEVs or some early return
mechanism when flags FlagNSW or FlagNUW are seen. However, we still have case
which can expose the exponential behavior, like the case in PR32043, so we add
a local cache in getZeroExtendExpr and getSignExtendExpr. If the input of the
functions -- SCEV and type pair have been seen before, we can find the extended
expression directly in the local cache.
Differential Revision: https://reviews.llvm.org/D30350
llvm-svn: 300494
Sanjay Patel [Mon, 17 Apr 2017 20:38:33 +0000 (20:38 +0000)]
[InstSimplify] add/move tests for (icmp X, C1 & icmp X, C2); NFC
We simplify based on range intersection, but we're missing folds.
llvm-svn: 300493
Dehao Chen [Mon, 17 Apr 2017 20:35:32 +0000 (20:35 +0000)]
Update the test to fix the buildbot failure introduced by r300486 (NFC)
llvm-svn: 300492
Francis Ricci [Mon, 17 Apr 2017 20:29:38 +0000 (20:29 +0000)]
Update suspended threads info to be compatible with darwin
Summary:
On Darwin, we need to track thread and tid as separate values.
This patch splits out the implementation of the suspended threads list
to be OS-specific.
Reviewers: glider, kubamracek, kcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31474
llvm-svn: 300491