Tom Stellard [Wed, 24 Jun 2015 17:03:50 +0000 (17:03 +0000)]
prepare-builtins: Fix build with LLVM 3.7
llvm-svn: 240552
Chaoren Lin [Wed, 24 Jun 2015 16:41:39 +0000 (16:41 +0000)]
Remove xfail for TestDisassembleBreakpoint.
LLGS no longer returns trap code in memory.
llvm-svn: 240551
Ed Maste [Wed, 24 Jun 2015 16:39:22 +0000 (16:39 +0000)]
Remove SetResumeState from POSIXThread::RefreshStateAfterStop
With the removal of ProcessLinux in r240543 this code is used only on
FreeBSD. FreeBSD isn't affected by whichever issue originally prompted
the addition of SetResumeState, so just remove it.
As discussed on the mailing list (and mentioned in a FIXME comment)
it shouldn't be called there.
llvm-svn: 240550
Ed Maste [Wed, 24 Jun 2015 16:24:56 +0000 (16:24 +0000)]
Remove empty ProcessPOSIX::StopAllThreads
The removal of ProcessLinux in r240543 left only an empty
StopAllThreads (it's not needed on FreeBSD), so just remove it too.
llvm-svn: 240549
Daniel Jasper [Wed, 24 Jun 2015 16:01:02 +0000 (16:01 +0000)]
clang-format: [JS] Support regex literals containing quotes (' and ").
llvm-svn: 240548
Ed Maste [Wed, 24 Jun 2015 15:27:35 +0000 (15:27 +0000)]
Remove unused variable
llvm-svn: 240547
Ewan Crawford [Wed, 24 Jun 2015 15:14:26 +0000 (15:14 +0000)]
Proper handling of QNonStop packet response.
Turn non-stop mode off if reply to QNonStop packet isn't an OK.
llvm-svn: 240546
Douglas Katzman [Wed, 24 Jun 2015 15:10:30 +0000 (15:10 +0000)]
Express Driver::GetFilePath more concisely.
llvm-svn: 240545
Rafael Espindola [Wed, 24 Jun 2015 14:48:54 +0000 (14:48 +0000)]
Don't get confused with sections whose section number is reserved.
It is perfectly possible for SHNDX to contain indexes that have the same value
as reserved st_shndx values.
llvm-svn: 240544
Pavel Labath [Wed, 24 Jun 2015 14:43:20 +0000 (14:43 +0000)]
Remove old local-only linux debugging code
Summary:
Currently, the local-only path fails about 50% of the tests, which means that: a) nobody is using
it; and b) the remote debugging path is much more stable. This commit removes the local-only
linux debugging code (ProcessLinux) and makes remote-loopback the only way to debug local
applications (the same architecture as OSX). The ProcessPOSIX code is moved to the FreeBSD
directory, which is now the only user of this class. Hopefully, FreeBSD will soon move to the new
architecture as well and then this code can be removed completely.
Test Plan: Test suite passes via remote stub.
Reviewers: emaste, vharron, ovyalov, clayborg
Subscribers: tberghammer, emaste, lldb-commits
Differential Revision: http://reviews.llvm.org/D10661
llvm-svn: 240543
Simon Pilgrim [Wed, 24 Jun 2015 13:52:25 +0000 (13:52 +0000)]
[X86][AVX] Added full set of 256-bit vector shift tests.
llvm-svn: 240542
Dmitry Vyukov [Wed, 24 Jun 2015 13:27:56 +0000 (13:27 +0000)]
asan: fix 32-bit build
llvm-svn: 240541
Daniel Sanders [Wed, 24 Jun 2015 13:25:57 +0000 (13:25 +0000)]
Eliminate additional redundant copies of Triple objects. NFC.
Subscribers: rafael, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D10654
llvm-svn: 240540
Dmitry Vyukov [Wed, 24 Jun 2015 13:04:12 +0000 (13:04 +0000)]
tsan: don't print external PCs in reports
They are meaningless.
llvm-svn: 240539
Pawel Bylica [Wed, 24 Jun 2015 12:49:42 +0000 (12:49 +0000)]
Fix instruction scheduling live register tracking
Summary:
This patch fixes PR23405 (https://llvm.org/bugs/show_bug.cgi?id=23405).
During a node unscheduling an entry in LiveRegGens can be replaced with a new value. That corrupts the live reg tracking and LiveReg* structure is not cleared as should be during unscheduling. Problematic condition that enforces Gen replacement is `I->getSUnit()->getHeight() < LiveRegGens[I->getReg()]->getHeight()`. This condition should be checked only if LiveRegGen was set in current node unscheduling.
Test Plan: Regression test included.
Reviewers: hfinkel, atrick
Reviewed By: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9993
llvm-svn: 240538
Tamas Berghammer [Wed, 24 Jun 2015 12:31:25 +0000 (12:31 +0000)]
Fix location of symbol size calculation in ObjectFileELF
Bug introduced by r240533
llvm-svn: 240537
Aaron Ballman [Wed, 24 Jun 2015 12:11:04 +0000 (12:11 +0000)]
Silencing some Sphinx warnings about duplicate explicit target names.
llvm-svn: 240536
Dmitry Vyukov [Wed, 24 Jun 2015 11:51:41 +0000 (11:51 +0000)]
tsan: fix unbounded memory consumption for large mallocs
This happens only in corner cases, but we observed this on a real app.
See the test for description of the exact scenario that lead to unbounded memory consumption.
llvm-svn: 240535
Pawel Bylica [Wed, 24 Jun 2015 11:49:44 +0000 (11:49 +0000)]
[llvm-stress] Simple refactoring and better style. NFC.
llvm-svn: 240534
Tamas Berghammer [Wed, 24 Jun 2015 11:27:32 +0000 (11:27 +0000)]
Improve instruction emulation based stack unwinding on ARM
* Add and fix the emulation of several instruction.
* Disable frame pointer usage on Android.
* Specify return address register for the unwind plan instead of explict
tracking the value of RA.
* Replace prologue detection heuristics (unreliable in several cases)
with a logic to follow the branch instructions and restore the CFI
value based on them. The target address for a branch should have the
same CFI as the source address (if they are in the same function).
* Handle symbols in ELF files where the symbol size is not specified
with calcualting their size based on the next symbol (already done
in MachO files).
* Fix architecture in FuncUnwinders with filling up the inforamtion
missing from the object file with the architecture of the target.
* Add code to read register wehn the value is set to "IsSame" as it
meanse the value of a register in the parent frame is the same as the
value in the current frame.
Differential revision: http://reviews.llvm.org/D10447
llvm-svn: 240533
Alexey Bataev [Wed, 24 Jun 2015 11:01:36 +0000 (11:01 +0000)]
[OPENMP] Codegen for 'depend' clause (OpenMP 4.0).
If task directive has associated 'depend' clause then function kmp_int32 __kmpc_omp_task_with_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_task_t * new_task, kmp_int32 ndeps, kmp_depend_info_t *dep_list,kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called instead of __kmpc_omp_task().
If this directive has associated 'if' clause then also before a call of kmpc_omp_task_begin_if0() a function void __kmpc_omp_wait_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, kmp_depend_info_t *dep_list, kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called.
Array sections are not supported yet.
llvm-svn: 240532
Zoran Jovanovic [Wed, 24 Jun 2015 10:32:16 +0000 (10:32 +0000)]
[mips][microMIPS] Implement BREAK, EHB and EI instructions
http://reviews.llvm.org/D10090
llvm-svn: 240531
Chandler Carruth [Wed, 24 Jun 2015 10:24:30 +0000 (10:24 +0000)]
Remove a limited and somewhat questionable DenseMapInfo specialization
for StringRef now that the core DenseMap library provides this facility.
llvm-svn: 240530
Rafael Espindola [Wed, 24 Jun 2015 10:20:30 +0000 (10:20 +0000)]
Change how symbol sizes are handled in lib/Object.
COFF and MachO only define symbol sizes for common symbols. Reflect that
in the class hierarchy by having a method for common symbols only in the base
and a general one in ELF.
This avoids the need of using a magic value for the size, which had a few
problems
* Most callers didn't check for it.
* The ones that did could not tell the magic value from a file actually having
that value.
llvm-svn: 240529
Chandler Carruth [Wed, 24 Jun 2015 10:06:29 +0000 (10:06 +0000)]
[ADT] Teach DenseMap to support StringRef keys.
While often you want to use something specialized like StringMap, when
the strings already have persistent storage a normal densemap over them
can be more efficient.
This can't go into StringRef.h because of really obnoxious header chains
from the hashing code to the endian detection code to CPU feature
detection code to StringMap.
llvm-svn: 240528
Ed Schouten [Wed, 24 Jun 2015 08:44:38 +0000 (08:44 +0000)]
Make support for thread-unsafe C functions optional.
One of the aspects of CloudABI is that it aims to help you write code
that is thread-safe out of the box. This is very important if you want
to write libraries that are easy to reuse. For CloudABI we decided to
not provide the thread-unsafe functions. So far this is working out
pretty well, as thread-unsafety issues are detected really early on.
The following patch adds a knob to libc++,
_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable
thread-unsafe functions that can easily be avoided in practice. The
following functions are not thread-safe:
- <clocale>: locale handles should be preferred over setlocale().
- <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over
their non-restartable counterparts.
- <ctime>: asctime(), ctime(), gmtime() and localtime() are not
thread-safe. The first two are also deprecated by POSIX.
Differential Revision: http://reviews.llvm.org/D8703
Reviewed by: marshall
llvm-svn: 240527
Justin Bogner [Wed, 24 Jun 2015 07:03:07 +0000 (07:03 +0000)]
Hexagon: Paper over the undefined behaviour introduced by r238692
This stops shifting a 32-bit value by such absurd amounts as 96 and
120. We do this by dropping a call to the function that was doing this
entirely, which rather surprisingly doesn't break *any* tests.
I've also added an assert in the misbehaving function to prove that
it's no longer being called with completely invalid arguments.
This change looks pretty bogus and we should probably be reverting
r238692 instead, but this is hard to do with the number of follow ups
that have happened since. It can't be any worse than the undefined
behaviour that was happening before though.
llvm-svn: 240526
NAKAMURA Takumi [Wed, 24 Jun 2015 06:40:09 +0000 (06:40 +0000)]
MILexer.cpp: Try to fix a warning. [-Wsign-compare]
llvm-svn: 240525
Craig Topper [Wed, 24 Jun 2015 06:19:19 +0000 (06:19 +0000)]
[TableGen] Restore the use of the TheInit field in Record to cache the Record's DefInit. I broke this when I fixed memory leaks recently. Remove the DenseMap that mapped Record's to DefInit.
llvm-svn: 240524
Bob Wilson [Wed, 24 Jun 2015 06:07:41 +0000 (06:07 +0000)]
Do not treat ARM _MoveToCoprocessor* intrinsics as MSBuiltins.
Those builtins are now handled via ad-hoc code in clang with r240522 to
deal with reordering the arguments to fix PR22560.
llvm-svn: 240523
Bob Wilson [Wed, 24 Jun 2015 06:05:20 +0000 (06:05 +0000)]
Move the special-case check from r240462 into ARM-specific code.
This fixes a serious bug in r240462: checking the BuiltinID for
ARM::BI_MoveToCoprocessor* in EmitBuiltinExpr() ignores the fact that
each target has an overlapping range of the BuiltinID values. That check
can trigger for builtins from other targets, leading to very bad
behavior.
Part of the reason I did not implement r240462 this way to begin with is
the special handling of the last argument for Neon builtins. In this
change, I have factored out the check to see which builtins have that
extra argument into a new HasExtraNeonArgument() function. There is still
some awkwardness in having to check for those builtins in two separate
places, i.e., once to see if the extra argument is present and once to
generate the appropriate IR, but this seems much cleaner than my previous
patch.
llvm-svn: 240522
Justin Bogner [Wed, 24 Jun 2015 06:00:53 +0000 (06:00 +0000)]
Hexagon: Avoid left shifting negative values (it's UB)
Found by ubsan.
llvm-svn: 240521
Justin Bogner [Wed, 24 Jun 2015 05:59:19 +0000 (05:59 +0000)]
SystemZ: Rephrase this allOnes calculation to avoid UB
This allOnes function hits undefined behaviour if Count is greater
than 64, but we can avoid that and simplify the calculation by just
saturating if such a value is passed in.
This comes up under ubsan becauseRxSBGOperands is sometimes created
with values that are 128 bits wide. Somebody more familiar with this
code should probably look into whether that's expected, as a 64 bit
mask may or may not be appropriate for such types.
llvm-svn: 240520
Rui Ueyama [Wed, 24 Jun 2015 04:36:52 +0000 (04:36 +0000)]
COFF: Initial implementation of Identical COMDAT Folding.
Identical COMDAT Folding (ICF) is an optimization to reduce binary
size by merging COMDAT sections that contain the same metadata,
actual data and relocations. MSVC link.exe and many other linkers
have this feature. LLD achieves on per with MSVC in terms produced
binary size with this patch.
This technique is pretty effective. For example, LLD's size is
reduced from 64MB to 54MB by enaling this optimization.
The algorithm implemented in this patch is extremely inefficient.
It puts all COMDAT sections into a set to identify duplicates.
Time to self-link with/without ICF are 3.3 and 320 seconds,
respectively. So this option roughly makes LLD 100x slower.
But it's okay as I wanted to achieve correctness first.
LLD is still able to link itself with this optimization.
I'm going to make it more efficient in followup patches.
Note that this optimization is *not* entirely safe. C/C++ require
different functions have different addresses. If your program
relies on that property, your program wouldn't work with ICF.
However, it's not going to be an issue on Windows because MSVC
link.exe turns ICF on by default. As long as your program works
with default settings (or not passing /opt:noicf), your program
would work with LLD too.
llvm-svn: 240519
Tobias Grosser [Wed, 24 Jun 2015 04:13:29 +0000 (04:13 +0000)]
Add support for srem instruction
Remainder operations with constant divisor can be modeled as quasi-affine
expression. This patch adds support for detecting and modeling them. We also
add a test that ensures they are correctly code generated.
This patch was extracted from a larger patch contributed by Johannes Doerfert
in http://reviews.llvm.org/D5293
llvm-svn: 240518
Alexey Bataev [Wed, 24 Jun 2015 03:35:38 +0000 (03:35 +0000)]
Proper changing/restoring for CapturedStmtInfo, NFC.
Added special RAII class for proper values changing/restoring in CodeGenFunction::CapturedStmtInfo.
llvm-svn: 240517
Rafael Espindola [Wed, 24 Jun 2015 03:19:35 +0000 (03:19 +0000)]
Don't repeat name in comments.
llvm-svn: 240516
Peter Collingbourne [Wed, 24 Jun 2015 00:12:36 +0000 (00:12 +0000)]
COFF: Remove unused field SectionChunk::SectionIndex.
llvm-svn: 240512
Peter Collingbourne [Wed, 24 Jun 2015 00:12:34 +0000 (00:12 +0000)]
COFF: Add some error checking to SymbolTable::addCombinedLTOObject().
llvm-svn: 240511
Ahmed Bougacha [Wed, 24 Jun 2015 00:07:16 +0000 (00:07 +0000)]
[X86] Don't generate vbroadcasti128 for v4i64 splats from memory.
We used to erroneously match:
(v4i64 shuffle (v2i64 load), <0,0,0,0>)
Whereas vbroadcasti128 is more like:
(v4i64 shuffle (v2i64 load), <0,1,0,1>)
This problem doesn't exist for vbroadcastf128, which kept matching
the intrinsic after r231182. We should perhaps re-introduce the
intrinsic here as well, but that's a separate issue still being
discussed.
While there, add some proper vbroadcastf128 tests. We don't currently
match those, like for loading vbroadcastsd/ss on AVX (the reg-reg
broadcasts where added in AVX2).
Fixes PR23886.
llvm-svn: 240488
Peter Collingbourne [Wed, 24 Jun 2015 00:05:50 +0000 (00:05 +0000)]
COFF: Ignore debug symbols.
Differential Revision: http://reviews.llvm.org/D10675
llvm-svn: 240487
Pete Cooper [Wed, 24 Jun 2015 00:05:07 +0000 (00:05 +0000)]
Remove unused GlobalVariable::replaceUsesOfWithOnConstant. NFC.
The only caller of this method is Value::replaceAllUsesWith which
explicitly checks that we are not a GlobalValue. So replace the
body with an unreachable to ensure that we never call it.
The unreachable itself is moved to GlobalValue not GlobalVariable
as that is the base class of all the globals we don't want to call
this method on.
Note, this patch is short lived as i'll soon refactor all callers
of this method.
llvm-svn: 240486
Ahmed Bougacha [Wed, 24 Jun 2015 00:03:48 +0000 (00:03 +0000)]
[X86] update_llc_test_checks vector-shuffle-*. NFC.
Some of them had gone stale.
llvm-svn: 240485
Rui Ueyama [Wed, 24 Jun 2015 00:00:52 +0000 (00:00 +0000)]
COFF: Add names for logging/debugging to COMDAT chunks.
Chunks are basically unnamed chunks of bytes, and we don't like
to give them names. However, for logging or debugging, we want to
know symbols names of functions for COMDAT chunks. (For example,
we want to print out "we have removed unreferenced COMDAT section
which contains a function FOOBAR.")
This patch is to do that.
llvm-svn: 240484
Rui Ueyama [Tue, 23 Jun 2015 23:56:39 +0000 (23:56 +0000)]
COFF: Make link order compatible with MSVC link.exe.
Previously, we added files in directive sections to the symbol
table as we read the sections, so the link order was depth-first.
That's not compatible with MSVC link.exe nor the old LLD.
This patch is to queue files so that new files are added to the
end of the queue and processed last. Now addFile() doesn't parse
files nor resolve symbols. You need to call run() to process
queued files.
llvm-svn: 240483
Alex Lorenz [Tue, 23 Jun 2015 23:42:28 +0000 (23:42 +0000)]
MIR Serialization: Serialize immediate machine operands.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10573
llvm-svn: 240481
Sanjay Patel [Tue, 23 Jun 2015 23:26:22 +0000 (23:26 +0000)]
fix typo; NFC
llvm-svn: 240480
Richard Smith [Tue, 23 Jun 2015 23:13:31 +0000 (23:13 +0000)]
Fix test failure if this value doesn't end up named %0.
llvm-svn: 240479
Sanjay Patel [Tue, 23 Jun 2015 23:05:08 +0000 (23:05 +0000)]
don't repeat function names in comments; NFC
llvm-svn: 240478
Petar Jovanovic [Tue, 23 Jun 2015 22:52:19 +0000 (22:52 +0000)]
Add "-mcpu=" option to llvm-rtdyld
This patch adds the -mcpu= option to llvm-rtdyld. With this option, one
can test relocations for different types of CPUs (e.g. Mips64r6).
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D10503
llvm-svn: 240477
Douglas Katzman [Tue, 23 Jun 2015 22:43:50 +0000 (22:43 +0000)]
Use range-based loops when handling OPT_print_search_dirs.
llvm-svn: 240476
Alex Lorenz [Tue, 23 Jun 2015 22:39:23 +0000 (22:39 +0000)]
MIR Parser: Use correct source locations for machine instruction diagnostics.
This commit translates the source locations for MIParser diagnostics from
the locations in the machine instruction string to the locations in the
MIR file.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10574
llvm-svn: 240474
Peter Collingbourne [Tue, 23 Jun 2015 22:26:48 +0000 (22:26 +0000)]
Update SafeStack TODO in the safestack.cc
This patch clarifies the TODO note at the top of safestack.cc and brings
it more in sync with what we (the CPI team) actually plan to work on in
the future.
Patch by Volodymyr Kuznetsov!
Differential Revision: http://reviews.llvm.org/D10600
llvm-svn: 240473
Peter Collingbourne [Tue, 23 Jun 2015 22:24:45 +0000 (22:24 +0000)]
SafeStack documentation improvements
This patch makes the following improvements to the SafeStack documentation:
Explicitly states the security guarantees of the SafeStack
Clarifies which of the security guarantees are probabilistic
Re-orders security limitations to put the most severe ones first
Explains how `__attribute__((no_sanitize("safe-stack")))` works and how to use it safely
Explains that SafeStack should be combined with a forward-edge protection mechanism, such as CPI, IFCC or others
Multiple readability and stylistic improvements
Patch by Volodymyr Kuznetsov!
Differential Revision: http://reviews.llvm.org/D10598
llvm-svn: 240472
Pete Cooper [Tue, 23 Jun 2015 21:55:11 +0000 (21:55 +0000)]
Devirtualize Constant::destroyConstant.
This reorganizes destroyConstant and destroyConstantImpl.
Now there is only destroyConstant in Constant itself, while
subclasses are required to implement destroyConstantImpl.
destroyConstantImpl no longer calls delete but is instead only
responsible for removing the constant from any maps in which it
is contained.
Reviewed by Duncan Exon Smith.
llvm-svn: 240471
Chris Bieneman [Tue, 23 Jun 2015 21:39:57 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.
Darwin doesn't have _Unwind_VRS_Get, instead use _Unwind_GetIP directly.
Note: this change does not enable building for iOS, as there are more changes to come.
Reviewers: kubabrecka, bogner, samsonov
Reviewed By: samsonov
Subscribers: samsonov, llvm-commits
Differential Revision: http://reviews.llvm.org/D10516
llvm-svn: 240470
Chris Bieneman [Tue, 23 Jun 2015 21:39:54 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.
This change ifdefs out headers and functionality that aren't available on iOS, and adds support for iOS and the iOS simulator to as an.
Note: this change does not enable building for iOS, as there are more changes to come.
Reviewers: glider, kubabrecka, bogner, samsonov
Reviewed By: samsonov
Subscribers: samsonov, zaks.anna, llvm-commits
Differential Revision: http://reviews.llvm.org/D10515
llvm-svn: 240469
Chris Bieneman [Tue, 23 Jun 2015 21:39:52 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.
This change ifdefs out headers and functionality that aren't available on iOS.
Note: this change does not enable building for iOS, as there are more changes to come.
Reviewers: glider, kubabrecka, bogner, samsonov
Reviewed By: samsonov
Subscribers: samsonov, llvm-commits
Differential Revision: http://reviews.llvm.org/D10514
llvm-svn: 240468
Chris Bieneman [Tue, 23 Jun 2015 21:39:49 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.
This change does the following:
- Don't include crt_externs on iOS (it isn't available)
- Support ARM thread state objects
Note: this change does not enable building for iOS, as there are more changes to come.
Reviewers: glider, kubabrecka, bogner, samsonov
Reviewed By: samsonov
Subscribers: samsonov, aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D10510
llvm-svn: 240467
Greg Clayton [Tue, 23 Jun 2015 21:27:50 +0000 (21:27 +0000)]
Implement the "qSymbol" packet in order to be able to read queue information in debugserver and return the info in the stop reply packets.
A "qSymbol::" is sent when shared libraries have been loaded by hooking into the Process::ModulesDidLoad() function from within ProcessGDBRemote. This function was made virtual so that the ProcessGDBRemote version is called, which then first calls the Process::ModulesDidLoad(), and then it queries for any symbol lookups that the remote GDB server might want to do.
This allows debugserver to request the "dispatch_queue_offsets" symbol so that it can read the queue name, queue kind and queue serial number and include this data as part of the stop reply packet. Previously each thread would have to do 3 memory reads in order to read the queue name.
This is part of reducing the number of packets that are sent between LLDB and the remote GDB server.
<rdar://problem/
21494354>
llvm-svn: 240466
Simon Pilgrim [Tue, 23 Jun 2015 21:18:15 +0000 (21:18 +0000)]
[X86][SSE] Added full set of 128-bit vector shift tests.
Removed some old duplicate tests.
llvm-svn: 240465
Benjamin Kramer [Tue, 23 Jun 2015 21:15:15 +0000 (21:15 +0000)]
[Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.
This is consistent with all other classes in Tools.h.
llvm-svn: 240464
Bob Wilson [Tue, 23 Jun 2015 21:10:24 +0000 (21:10 +0000)]
Improve error handling for PR22560.
The ARM _MoveToCoprocessor and _MoveFromCoprocessor builtins require
integer constants for most arguments, but clang was not checking that.
With this change, we now report meaningful errors instead of crashing
in the backend.
llvm-svn: 240463
Bob Wilson [Tue, 23 Jun 2015 21:10:15 +0000 (21:10 +0000)]
PR22560: Fix argument order for ARM _MoveToCoprocessor builtins.
The Microsoft-extension _MoveToCoprocessor and _MoveToCoprocessor2
builtins take the register value to be moved as the first argument,
but the corresponding mcr and mcr2 LLVM intrinsics expect that value
to be the third argument. Handle this as a special case, while still
leaving those intrinsics as generic MSBuiltins. I considered the
alternative of handling these in EmitARMBuiltinExpr, but that does
not work well for the follow-up change that I'm going to make to improve
the error handling for PR22560 -- we need the GetBuiltinType() checks
for ICEArguments, and the ARM version of that code is only used for
Neon intrinsics where the last argument is special and not
checked in the normal way.
llvm-svn: 240462
Jim Ingham [Tue, 23 Jun 2015 21:02:45 +0000 (21:02 +0000)]
Fix the handling of the run lock in cases where you needed to run
a hand-called function from the private state thread. The problem
was that on the way out of the private state thread, we try to drop
the run lock. That is appropriate for the main private state thread,
but not the secondary private state thread. Only the thread that
spawned them can know whether this is an appropriate thing to do or
not.
<rdar://problem/
21375352>
llvm-svn: 240461
Alexey Samsonov [Tue, 23 Jun 2015 21:00:08 +0000 (21:00 +0000)]
Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.
Currently some users of this function do this explicitly, and all the
rest forget to do this.
ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.
This is another change relevant to PR23837.
llvm-svn: 240460
Evgeniy Stepanov [Tue, 23 Jun 2015 20:57:26 +0000 (20:57 +0000)]
Pass 2 more variables to lit tests.
Pass ADB and ADB_SERIAL environment variables to lit tests.
This would allow running Android tests in compiler-rt when
there is more than one device attached to the host.
llvm-svn: 240459
Tobias Grosser [Tue, 23 Jun 2015 20:55:05 +0000 (20:55 +0000)]
Replace srem by function call in nonaffine test cases
This makes the test cases nonaffine even if Polly some days gains support for
the srem instruction, an instruction which is currently not modeled but which
can clearly be modeled statically. A call to a function without definition
will always remain non-affine, as there is just insufficient static information
for it to be modeled more precisely.
llvm-svn: 240458
Tobias Grosser [Tue, 23 Jun 2015 20:55:01 +0000 (20:55 +0000)]
Add git patch files to .gitignore
llvm-svn: 240457
Marshall Clow [Tue, 23 Jun 2015 20:48:55 +0000 (20:48 +0000)]
Mark a couple of features as 'in progress'
llvm-svn: 240456
Douglas Katzman [Tue, 23 Jun 2015 20:42:09 +0000 (20:42 +0000)]
Pedantically rename all Tool subclasses to be nouns, not verbs. NFC
Classes in Tools.h inherit ultimately from Tool, which is a noun,
but subclasses of Tool were named for their operation, such as "Compile",
wherein the constructor call "Compile(args...)" could be misconstrued
as actually causing a compile to happen.
Likewise various other methods were not harmonious with their effect,
in that "BuildLinker()" returned a "new namespace::Link(...)"
instead of a "new namespace::Linker(...)" which it now does.
Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names.
And there is no particulary great way to name the "Lipo-er" and a few others.
Differential Revision: http://reviews.llvm.org/D10595
llvm-svn: 240455
Lang Hames [Tue, 23 Jun 2015 20:35:31 +0000 (20:35 +0000)]
[lld] Add MachO thread-local storage support.
This allows LLD to correctly link MachO objects that use thread-local storage.
Differential Revision: http://reviews.llvm.org/D10578
llvm-svn: 240454
David Majnemer [Tue, 23 Jun 2015 20:34:18 +0000 (20:34 +0000)]
[MS ABI] Account for the virtual inheritance quirk when mangling
Virtual inheritance member pointers are always relative to the vbindex,
even when the member pointer doesn't point into a virtual base. This is
corrected by adjusting the non-virtual offset backwards from the vbptr
back to the top of the most derived class. While we performed this
adjustment when manifesting member pointers as constants or when
performing conversions, we didn't perform the adjustment when mangling
them.
llvm-svn: 240453
Justin Bogner [Tue, 23 Jun 2015 20:29:09 +0000 (20:29 +0000)]
InstrProf: Fix a crash when an implicit def appears in a macro
llvm-svn: 240452
Jim Ingham [Tue, 23 Jun 2015 20:26:45 +0000 (20:26 +0000)]
Remove a few uses of lldb.target, which is not valid
in a scripted command.
llvm-svn: 240451
Pirama Arumuga Nainar [Tue, 23 Jun 2015 20:24:53 +0000 (20:24 +0000)]
Fix incorrect truncation at the overflow boundary
Summary:
This patch fixes incorrect truncation when the input wider value is
exactly 2^dstBits. For that value, the overflow to infinity is not
correctly handled. The fix is to replace a strict '>' with '>='.
Currently,
__truncdfsf2(
340282366900000000000000000000000000000.0) returns infinity
__truncdfsf2(
340282366920938463463374607431768211456.0) returns 0
__truncdfsf2(
400000000000000000000000000000000000000.0) returns infinity
Likewise, __truncdfhf2 and __truncsfhf2 (and consequently gnu_f2h_ieee)
are discontinuous at 65536.0.
This patch adds tests for all three cases, along with adding a missing
header include to fp_test.h.
Reviewers: joerg, ab, srhines
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10594
llvm-svn: 240450
Jay Foad [Tue, 23 Jun 2015 20:17:45 +0000 (20:17 +0000)]
[msan] Mark one test as only supported on x86
Summary: This test uses x86 intrinsics, so it can't work on other platforms.
Reviewers: garious, eugenis, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10652
llvm-svn: 240449
Sanjoy Das [Tue, 23 Jun 2015 20:09:03 +0000 (20:09 +0000)]
Revert "[FaultMaps] Move FaultMapParser to Object/"
This reverts commit r240364 (git
c49542e5bb186). The issue r240364 was
trying to fix was fixed independently in r240362.
llvm-svn: 240448
Peter Collingbourne [Tue, 23 Jun 2015 20:02:31 +0000 (20:02 +0000)]
COFF: Fix null pointer dereference.
llvm-svn: 240447
Benjamin Kramer [Tue, 23 Jun 2015 19:55:04 +0000 (19:55 +0000)]
[MachO] Initialize all fields of NormalizedFile.
The ObjectFileYAML.roundTrip serializes a default-constructed
NormalizedFile to YAML, triggering uninitialized memory reads.
While there use in-class member initializers.
llvm-svn: 240446
Benjamin Kramer [Tue, 23 Jun 2015 19:54:57 +0000 (19:54 +0000)]
Add missing dependencies for the CMake shared lld build.
llvm-svn: 240445
Dawn Perchik [Tue, 23 Jun 2015 19:21:44 +0000 (19:21 +0000)]
Fix FIXME comments in MiBreakTestCase.test_lldbmi_break_insert_settings as suggested by abidh (MI)
llvm-svn: 240444
Kaelyn Takata [Tue, 23 Jun 2015 19:13:17 +0000 (19:13 +0000)]
Make the typo resolution in r240441 apply to all function calls.
Regular function calls (such as to cabs()) run into the same problem
with handling dependent exprs, not just builtins with custom type
checking.
Fixes PR23775.
llvm-svn: 240443
Steven Wu [Tue, 23 Jun 2015 18:56:48 +0000 (18:56 +0000)]
Adding the missing LTO API to lto.exports
Summary:
lto_codegen_set_should_embed_uselists is introduced in r235943 but not
added to lto.exports. Add to export list to expose the API.
Reviewers: dexonsmith
Subscribers: rafael, llvm-commits
Differential Revision: http://reviews.llvm.org/D10658
llvm-svn: 240442
Kaelyn Takata [Tue, 23 Jun 2015 18:42:21 +0000 (18:42 +0000)]
Ensure delayed typos have been corrected in calls to builtins before
checking those calls when not in C++ mode, since those code paths can't
handle dependent exprs.
Fixes PR23740.
llvm-svn: 240441
Dawn Perchik [Tue, 23 Jun 2015 18:35:31 +0000 (18:35 +0000)]
Add support for displaying the language in the frame-format string.
Enable ${language} to be specified in the frame-format string to see
the current frame's compile unit language in "frame info".
Test Plan:
debug a C++ program, run to main, and run the lldb commands:
settings set frame-format "frame lang=${language}\n"
frame info
you should see:
frame lang=c++
test case added in:
./dotest.py --executable lldb -f SettingsCommandTestCase.test_set_frame_format
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10561
llvm-svn: 240440
Rafael Espindola [Tue, 23 Jun 2015 18:34:25 +0000 (18:34 +0000)]
Don't pass a 32 bit value to "%08" PRIx64.
Should fix the arm bots.
llvm-svn: 240439
Mark Heffernan [Tue, 23 Jun 2015 18:26:50 +0000 (18:26 +0000)]
This change fixes three bugs in loop unswitching. This change causes an 81% speed-up on a benchmark that is based on EigenConvolutionKernel2D from Eigen3, where the lack of loop unswitching blocks hoisting of loads out of a nested loop (see bug 23816 for how loop unswitching and load hoisting are related).
Change 1: Unswitching on trivial conditions should always happen regardless of the computed unswitching cost, as really the cost is zero. While there is code to make that happen, the logic that checks the unswitching cost against a threshold was moved to an earlier point (revision 147935) than the point where trivial unswitching is detected, so trivial unswitching is currently blocked by the cost threshold. This change fixes that.
Change 2: Before revision 147935 (from 2012-01-11), the threshold parameter was a per-loop threshold. So an unswitching happened only if the cost of the unswitching was less than the threshold. In an indirect way (and I believe unintentionally), the logic for this since then has been that the threshold is an over-all budget across all loops for all loop unswitching done by a given LoopUnswitch loop pass object. So if an unswitching with cost 100 happens in one function, that in effect reduces the threshold from 100 to 0 for the loops even in another function. This persists for the lifetime of that loop pass object. This makes no difference for most small examples but it is important for large examples. This revision fixes that.
Change 3: The cost is currently calculated as std::min(NumInstructions, 5 * NumBlocks). So a loop with 2 blocks and a million instructions will have an unswitching cost of 10. I changed this to just NumInstructions, as it were before revision 147935, though I'm open to e.g. instead replacing std::min with std::max.
I've tried to make the change minimally invasive while staying with what I think was the original intent of the code.
Submitted on behalf of broune@.
llvm-svn: 240438
Artem Belevich [Tue, 23 Jun 2015 18:22:17 +0000 (18:22 +0000)]
[NVPTX] Added missing test case for llvm.nvvm.sqrt.f NVPTX intrinsic
Differential Revision: http://reviews.llvm.org/D10663
llvm-svn: 240437
Alex Lorenz [Tue, 23 Jun 2015 18:22:10 +0000 (18:22 +0000)]
ADT: Add a string APSInt constructor.
This commit moves the APSInt initialization code that's used by
the LLLexer class into a new APSInt constructor that constructs
APSInts from strings.
This change is useful for MIR Serialization, as it would allow
the MILexer class to use the same APSInt initialization as
LLexer when parsing immediate machine operands.
llvm-svn: 240436
Oleksiy Vyalov [Tue, 23 Jun 2015 18:21:55 +0000 (18:21 +0000)]
Mark SBFrame::GetFunctionName and SBFrame::IsInlined as const.
llvm-svn: 240435
Ben Langmuir [Tue, 23 Jun 2015 18:20:23 +0000 (18:20 +0000)]
Use AddString/ReadString instead of doing it manually NFC
llvm-svn: 240434
Ben Langmuir [Tue, 23 Jun 2015 18:20:18 +0000 (18:20 +0000)]
[Modules] Consider -fmodule-feature in module hash and when loading
Any extra features from -fmodule-feature are part of the module hash and
need to get validated on load. Also print them with -module-file-info.
llvm-svn: 240433
Jim Grosbach [Tue, 23 Jun 2015 18:20:13 +0000 (18:20 +0000)]
Driver: Pass -I options to cc1as for .include search paths.
llvm-svn: 240432
Rafael Espindola [Tue, 23 Jun 2015 18:04:54 +0000 (18:04 +0000)]
Pass -m to the linker in this test.
Fixes the test on a ppc host.
llvm-svn: 240431
Aaron Ballman [Tue, 23 Jun 2015 17:31:30 +0000 (17:31 +0000)]
Adding a title to appease the sphinx build bot.
llvm-svn: 240430
Pavel Labath [Tue, 23 Jun 2015 17:15:14 +0000 (17:15 +0000)]
Fix build breakage after llvm r240426
Test Plan: It builds, tests pass.
Reviewers: tstellarAMD, rafael
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10660
llvm-svn: 240429
Aaron Ballman [Tue, 23 Jun 2015 17:14:51 +0000 (17:14 +0000)]
AttributeReference.rst is automatically generated by a server-side process currently. To cut down on accidental commits to this file that are not properly reflected in AttrDocs.td (such as r215806 - r215808), this file now contains nothing but a comment explaining the current state of affairs.
llvm-svn: 240428
Alex Lorenz [Tue, 23 Jun 2015 17:10:10 +0000 (17:10 +0000)]
AsmParser: Extend the API to make the global value and metadata node slot mappings publicly accessible.
This commit creates a new structure called 'SlotMapping' in the AsmParser library.
This structure can be passed into the public parsing APIs from the AsmParser library
in order to extract the data structures that map from slot numbers to unnamed global
values and metadata nodes.
This change is useful for MIR Serialization, as the MIR Parser has to lookup the
unnamed global values and metadata nodes by their slot numbers.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10551
llvm-svn: 240427
Tom Stellard [Tue, 23 Jun 2015 16:41:57 +0000 (16:41 +0000)]
ELF: Fix defintion of STT_LOOS and STT_HIOS.
Reviewers: chandlerc, Bigcheese, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10647
llvm-svn: 240426