Sanjoy Das [Fri, 23 Oct 2015 06:57:21 +0000 (06:57 +0000)]
[SCEV] Get rid of an unnecessary lambda; NFC
llvm-svn: 251099
Zlatko Buljan [Fri, 23 Oct 2015 06:39:29 +0000 (06:39 +0000)]
[mips][microMIPS] Implement SHLL.PH, SHLL_S.PH, SHLL.QB, SHLLV.PH, SHLLV_S.PH, SHLLV.QB, SHLLV_S.W, SHLL_S.W, SHRA.QB and SHRA_R.QB instructions
Differential Revision: http://reviews.llvm.org/D13929
llvm-svn: 251098
Sanjoy Das [Fri, 23 Oct 2015 06:33:47 +0000 (06:33 +0000)]
[SCEV] Fix a latent bug in `getPreStartForExtend`
I could not come up a way to test this -- I think this bug is latent
today, and will not actually result in a miscompile.
In `getPreStartForExtend`, SCEV constructs `PreStart` as a sum of all of
`SA`'s operands except `Op`. It also uses `SA`'s no-wrap flags, and
this is problematic because removing an element from an add expression
can make it signed-wrap. E.g. if `SA` was `(127 + 1 + -1)`, then it
could safely be `<nsw>` (since `sext(127) + sext(1) + sext(-1)` ==
`sext(127 + 1 + -1)`), but `(127 + 1)` (== `PreStart` if `Op` is `-1`)
is not `<nsw>`.
Transferring `<nuw>` from `SA` to `PreStart` is safe, as far as I can
tell.
llvm-svn: 251097
Dylan McKay [Fri, 23 Oct 2015 06:05:55 +0000 (06:05 +0000)]
[AVR] Add ELF constants to headers
Also adds a 'trivial' ELF file. This was generated by assembling
and linking a file with the symbol main which contains a single
return instruction.
llvm-svn: 251096
Lang Hames [Fri, 23 Oct 2015 05:39:16 +0000 (05:39 +0000)]
[lld][MachO] Prune unused EH frames.
llvm-svn: 251095
Saleem Abdulrasool [Fri, 23 Oct 2015 05:26:03 +0000 (05:26 +0000)]
Support, IR: silence -Wunused-parameter
If this is used outside of LLVM with -Werror, this would cause a failure.
llvm-svn: 251094
Xinliang David Li [Fri, 23 Oct 2015 04:22:58 +0000 (04:22 +0000)]
Add more intrumentation/runtime helper interfaces (NFC)
This patch converts the remaining references to literal
strings for names of profile runtime entites (such as
profile runtime hook, runtime hook use function, profile
init method, register function etc).
Also added documentation for all the new interfaces.
llvm-svn: 251093
Jason Molenda [Fri, 23 Oct 2015 02:54:21 +0000 (02:54 +0000)]
Remove some tabs that snuck into debugserver-entitlements.plist, etc.
llvm-svn: 251092
Jason Molenda [Fri, 23 Oct 2015 02:49:51 +0000 (02:49 +0000)]
Upstreaming the apple internal changes that accumulated during the
previous release. Most of the diffs are duplication in the xcode
project file caused by adding a "debugserver-mini" target. Jim
Ingham added support for a new SPI needed to request app launches
on iOS. Greg Clayton added code to indicate the platform of the
binary (macosx, ios, watchos, tvos) based on Mach-O load commands.
Jason Molenda added code so debugserver will identify when it is
running on a tvos/watchos device to lldb.
llvm-svn: 251091
Rui Ueyama [Fri, 23 Oct 2015 02:40:46 +0000 (02:40 +0000)]
ELF2: Improve Target::relocateOne().
relocateOne is a function to apply a relocation. Previously, that
function took a pointer to Elf_Rel or Elf_Rela in addition to other
information that can be derived from the relocation entry. This patch
simplifies the parameter list. The new parameters, P or SA, are used
in the ELF spec to describe each relocation. These names make
relocateOne look like a mechanical, direct translation of the ELF spec.
llvm-svn: 251090
Sanjoy Das [Fri, 23 Oct 2015 01:28:05 +0000 (01:28 +0000)]
[LangRef] Fix the doc for operand bundles
I accidentally messed this up after a merge conflict in a previous
commit.
llvm-svn: 251089
Ed Maste [Fri, 23 Oct 2015 01:10:42 +0000 (01:10 +0000)]
Add arm64 FreeBSD ProcessMonitor register context
llvm-svn: 251088
Mehdi Amini [Fri, 23 Oct 2015 01:04:45 +0000 (01:04 +0000)]
SLPVectorizer: AllSameOpcode* starts "true" only for instructions
r251085 wasn't as NFC as intended...
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 251087
Jason Molenda [Fri, 23 Oct 2015 00:59:31 +0000 (00:59 +0000)]
Fix one more place where we were using the old
name of the xpc service.
<rdar://problem/
23223624>
llvm-svn: 251086
Mehdi Amini [Fri, 23 Oct 2015 00:46:17 +0000 (00:46 +0000)]
SLPVectorizer: refactor reorderInputsAccordingToOpcode (NFC)
This is intended to simplify the changes needed to solve PR25247.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 251085
Sean Callanan [Fri, 23 Oct 2015 00:39:09 +0000 (00:39 +0000)]
Log information about sections that didn't make it into the target's memory.
llvm-svn: 251084
Sean Callanan [Fri, 23 Oct 2015 00:37:54 +0000 (00:37 +0000)]
Fixed a typo in r251080.
llvm-svn: 251083
Dawn Perchik [Fri, 23 Oct 2015 00:23:53 +0000 (00:23 +0000)]
[lldb-mi] display summary for simple types + refactor (use lldb formatting for all cases)
Previously, lldb did not use type summaries for simple types with no children
(like function pointers). This patch enables MI to use lldb type summaries for
evaluation of all types of objects, so MI own formatters are no longer needed.
Patch from evgeny.leviant@gmail.com
Reviewed by: abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13799
llvm-svn: 251082
Davide Italiano [Fri, 23 Oct 2015 00:17:40 +0000 (00:17 +0000)]
[CodeGen] Remove usage of NDEBUG in header.
Moreover, this seems unused.
llvm-svn: 251081
Dawn Perchik [Fri, 23 Oct 2015 00:02:56 +0000 (00:02 +0000)]
Summary provider for char.
This patch enables type summary for 'char' type. Given:
char c = 'h';
Before this patch, c evaluates as:
(char) $0 = 'h'
After this patch, we get:
(char) $0 = 104 'h'
This change allows the formatting of character types in MI to be removed
and replaced with that in lldb, and can be useful when evaluating
non-printable characters.
Patch from evgeny.leviant@gmail.com
Reviewed by: granata.enrico
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13657
llvm-svn: 251080
Evgeniy Stepanov [Fri, 23 Oct 2015 00:00:22 +0000 (00:00 +0000)]
[msan] Re-submit test for process_vm_readv.
Includes a workaround for glibc < 2.15, which does not provide the
function under test.
llvm-svn: 251079
Kostya Serebryany [Thu, 22 Oct 2015 23:55:39 +0000 (23:55 +0000)]
[libFuzzer] use the indirect caller-callee counter as an independent search heuristic
llvm-svn: 251078
Evgeniy Stepanov [Thu, 22 Oct 2015 23:40:06 +0000 (23:40 +0000)]
[msan] Temporarily remove a failing test to fix the bot.
The test requires a newer glibc version that the one on the bot.
llvm-svn: 251077
Rui Ueyama [Thu, 22 Oct 2015 23:10:25 +0000 (23:10 +0000)]
ELF2: SymbolBody::repl() never returns a nullptr.
So we can use dyn_cast instead of dyn_cast_or_null here.
llvm-svn: 251076
Kostya Serebryany [Thu, 22 Oct 2015 22:56:45 +0000 (22:56 +0000)]
[libFuzzer] more refactoring the code that checks the coverage. NFC
llvm-svn: 251075
Kostya Serebryany [Thu, 22 Oct 2015 22:50:47 +0000 (22:50 +0000)]
[libFuzzer] refactoring the code that checks the coverage. NFC
llvm-svn: 251074
Dawn Perchik [Thu, 22 Oct 2015 22:48:52 +0000 (22:48 +0000)]
[cmake] Fix cmake build on OSX after r250335 for older versions of cmake
Reviewed by: sas
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13995
llvm-svn: 251073
Xinliang David Li [Thu, 22 Oct 2015 22:25:11 +0000 (22:25 +0000)]
Use newly introduced interfaces in LLVM (NFC)
Replaced references to raw strings in instrumentation
and coverage code.
llvm-svn: 251072
Kostya Serebryany [Thu, 22 Oct 2015 22:06:41 +0000 (22:06 +0000)]
[sanitizer-coverage] introduce __sanitizer_get_total_unique_caller_callee_pairs
llvm-svn: 251071
Xinliang David Li [Thu, 22 Oct 2015 21:51:09 +0000 (21:51 +0000)]
Minor bug fix in Profile Name Prefix interface
Exposed in uses by clang FE.
llvm-svn: 251070
Kostya Serebryany [Thu, 22 Oct 2015 21:48:09 +0000 (21:48 +0000)]
[libFuzzer] remove the deprecated 'tokens' feature
llvm-svn: 251069
Rui Ueyama [Thu, 22 Oct 2015 21:42:05 +0000 (21:42 +0000)]
ELF2: Keep .eh_frame even if they are not live.
.eh_frame sections need to be preserved if they refer to live sections.
So the liveness relation is reverse for eh_frame sections. For now,
we simply preserve all .eh_frame sections. Thanks Rafael for pointing
this out. .jcr are kept for the same reason.
llvm-svn: 251068
Justin Bogner [Thu, 22 Oct 2015 21:31:34 +0000 (21:31 +0000)]
LoopPass: Remove redoLoop, it isn't used. NFC
In r251064 I removed a logically unreachable call to `redoLoop`, and
now there aren't any callers of this API at all. Remove the needless
complexity.
llvm-svn: 251067
Eugene Zelenko [Thu, 22 Oct 2015 21:24:37 +0000 (21:24 +0000)]
Fix Clang-tidy modernize-use-override warnings in include/lldb/Disassembler and OperatingSystem; other minor fixes.
Second attempt which should work for MSVC.
llvm-svn: 251066
Eric Fiselier [Thu, 22 Oct 2015 21:24:01 +0000 (21:24 +0000)]
Dont required CMake 3 to install a linker script
llvm-svn: 251065
Justin Bogner [Thu, 22 Oct 2015 21:21:32 +0000 (21:21 +0000)]
LoopPass: Simplify the API for adding a new loop. NFC
The insertLoop() API is only used to add new loops, and has confusing
ownership semantics. Simplify it by replacing it with addLoop().
llvm-svn: 251064
Eric Fiselier [Thu, 22 Oct 2015 20:54:27 +0000 (20:54 +0000)]
Only disable linker script when LIBCXX_CXX_ABI_LIBNAME is none
llvm-svn: 251063
Eric Fiselier [Thu, 22 Oct 2015 20:50:07 +0000 (20:50 +0000)]
Disable linker scripts when the ABI library is not specified or is none.
llvm-svn: 251062
Chen Li [Thu, 22 Oct 2015 20:48:38 +0000 (20:48 +0000)]
[SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
Summary: Currently SimplifyResume can convert an invoke instruction to a call instruction if its landing pad is trivial. In practice we could have several invoke instructions with trivial landing pads and share a common rethrow block, and in the common rethrow block, all the landing pads join to a phi node. The patch extends SimplifyResume to check the phi of landing pad and their incoming blocks. If any of them is trivial, remove it from the phi node and convert the invoke instruction to a call instruction.
Reviewers: hfinkel, reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13718
llvm-svn: 251061
Zachary Turner [Thu, 22 Oct 2015 20:39:59 +0000 (20:39 +0000)]
Python 3 porting - Wrap returns from map() in list()
Under Python 2 this has no effect, since map() returns a list.
In Python 3 map() returns an iterable, so wrapping in a list is
necessary to keep the same semantics.
llvm-svn: 251060
Evgeniy Stepanov [Thu, 22 Oct 2015 20:35:42 +0000 (20:35 +0000)]
[msan] Intercept process_vm_readv/writev.
llvm-svn: 251059
Xinliang David Li [Thu, 22 Oct 2015 20:32:12 +0000 (20:32 +0000)]
Add helper functions and remove hard coded references to instProf related name/name-prefixes
This is a clean up patch that defines instr prof section and variable
name prefixes in a common header with access helper functions.
clang FE change will be done as a follow up once this patch is in.
Differential Revision: http://reviews.llvm.org/D13919
llvm-svn: 251058
David Majnemer [Thu, 22 Oct 2015 20:29:08 +0000 (20:29 +0000)]
[Sink] Don't check BB.empty()
As an invariant, BasicBlocks cannot be empty when passed to a transform.
This is not the case for MachineBasicBlocks and the Sink pass was ported
from the MachineSink pass which would explain the check's existence.
llvm-svn: 251057
Alexey Samsonov [Thu, 22 Oct 2015 20:07:28 +0000 (20:07 +0000)]
[ASan] Enable instrumentation of dynamic allocas by default.
llvm-svn: 251056
Zachary Turner [Thu, 22 Oct 2015 20:06:20 +0000 (20:06 +0000)]
Update every test to import `lldb_shared`.
This is necessary in order to allow third party modules to be
located under lldb/third_party rather than under the test
folder directly.
Since we're already touching every test file anyway, we also
go ahead and delete the unittest2 import and main block wherever
possible. The ability to run a test as a standalone file has
already been broken for some time, and if we decide we want this
back, we should use unittest instead of unittest2.
A few places could not have the import of unittest2 removed,because
they depend on the unittest2.expectedFailure or skip decorators.
Removing all those was orthogonal in spirit to the purpose of this
CL, so the import of unittest2 remains in those files that were
using it for its test decorators. Those can be addressed
separately.
llvm-svn: 251055
Eugene Zelenko [Thu, 22 Oct 2015 19:59:21 +0000 (19:59 +0000)]
Fix Clang-tidy modernize-use-override warnings in some files in include/lldb/Interpreter and Host; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13602
llvm-svn: 251054
Sanjoy Das [Thu, 22 Oct 2015 19:57:41 +0000 (19:57 +0000)]
[SCEV] Remove a test case added in r249168
The test case wasn't testing what it was commented to be testing; and
when I tried to fix the test I noticed that SCEV does not support the
simplification that the test was supposed to test.
This change removes the test case to avoid confusion.
llvm-svn: 251053
Sanjoy Das [Thu, 22 Oct 2015 19:57:38 +0000 (19:57 +0000)]
[SCEV] Commute zero extends through <nuw> additions
llvm-svn: 251052
Sanjoy Das [Thu, 22 Oct 2015 19:57:34 +0000 (19:57 +0000)]
[SCEV] Opportunistically interpret unsigned constraints as signed
Summary:
An unsigned comparision is equivalent to is corresponding signed version
if both the operands being compared are positive. Teach SCEV to use
this fact when profitable.
Reviewers: atrick, hfinkel, reames, nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13687
llvm-svn: 251051
Sanjoy Das [Thu, 22 Oct 2015 19:57:29 +0000 (19:57 +0000)]
[SCEV] Teach SCEV some axioms about non-wrapping arithmetic
Summary:
- A s< (A + C)<nsw> if C > 0
- A s<= (A + C)<nsw> if C >= 0
- (A + C)<nsw> s< A if C < 0
- (A + C)<nsw> s<= A if C <= 0
Right now `C` needs to be a constant, but we can later generalize it to
be a non-constant if needed.
Reviewers: atrick, hfinkel, reames, nlewycky
Subscribers: sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D13686
llvm-svn: 251050
Sanjoy Das [Thu, 22 Oct 2015 19:57:25 +0000 (19:57 +0000)]
[SCEV] Commute sign extends through nsw additions
Summary: Depends on D13613.
Reviewers: atrick, hfinkel, reames, nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13685
llvm-svn: 251049
Sanjoy Das [Thu, 22 Oct 2015 19:57:19 +0000 (19:57 +0000)]
[SCEV] Mark AddExprs as nsw or nuw if legal
Summary:
This uses `ScalarEvolution::getRange` and not potentially control
dependent `nsw` and `nuw` bits on the arithmetic instruction.
Reviewers: atrick, hfinkel, nlewycky
Subscribers: llvm-commits, sanjoy
Differential Revision: http://reviews.llvm.org/D13613
llvm-svn: 251048
Zachary Turner [Thu, 22 Oct 2015 19:55:18 +0000 (19:55 +0000)]
Remove special case logic for finding 3rd party libs
llvm-svn: 251047
Zachary Turner [Thu, 22 Oct 2015 19:55:01 +0000 (19:55 +0000)]
Move third party libraries to lldb/third_party
llvm-svn: 251046
Alexey Samsonov [Thu, 22 Oct 2015 19:51:59 +0000 (19:51 +0000)]
[ASan] Minor fixes to dynamic allocas handling:
* Don't instrument promotable dynamic allocas:
We already have a test that checks that promotable dynamic allocas are
ignored, as well as static promotable allocas. Make sure this test will
still pass if/when we enable dynamic alloca instrumentation by default.
* Handle lifetime intrinsics before handling dynamic allocas:
lifetime intrinsics may refer to dynamic allocas, so we need to emit
instrumentation before these dynamic allocas would be replaced.
Differential Revision: http://reviews.llvm.org/D12704
llvm-svn: 251045
Oleksiy Vyalov [Thu, 22 Oct 2015 19:17:32 +0000 (19:17 +0000)]
Set device_id to host value only in case of adb protocol.
llvm-svn: 251044
Rui Ueyama [Thu, 22 Oct 2015 18:49:53 +0000 (18:49 +0000)]
ELF2: Implement --gc-sections.
Section garbage collection is a feature to remove unused sections
from outputs. Unused sections are sections that cannot be reachable
from known GC-root symbols or sections. Naturally the feature is
implemented as a mark-sweep garbage collector.
In this patch, I added Live bit to InputSectionBase. If and only
if Live bit is on, the section will be written to the output.
Starting from GC-root symbols or sections, a new function, markLive(),
visits all reachable sections and sets their Live bits. Writer then
ignores sections whose Live bit is off, so that such sections are
excluded from the output.
This change has small negative impact on performance if you use
the feature because making sections means more work. The time to
link Clang changes from 0.356s to 0.386s, or +8%.
It reduces Clang size from 57,764,984 bytes to 55,296,600 bytes.
That is 4.3% reduction.
http://reviews.llvm.org/D13950
llvm-svn: 251043
Davide Italiano [Thu, 22 Oct 2015 18:46:27 +0000 (18:46 +0000)]
[ExecutionEngine] Garbage collect some dead (and unsafe) code.
llvm-svn: 251042
John McCall [Thu, 22 Oct 2015 18:38:17 +0000 (18:38 +0000)]
Define weak and __weak to mean ARC-style weak references, even in MRC.
Previously, __weak was silently accepted and ignored in MRC mode.
That makes this a potentially source-breaking change that we have to
roll out cautiously. Accordingly, for the time being, actual support
for __weak references in MRC is experimental, and the compiler will
reject attempts to actually form such references. The intent is to
eventually enable the feature by default in all non-GC modes.
(It is, of course, incompatible with ObjC GC's interpretation of
__weak.)
If you like, you can enable this feature with
-Xclang -fobjc-weak
but like any -Xclang option, this option may be removed at any point,
e.g. if/when it is eventually enabled by default.
This patch also enables the use of the ARC __unsafe_unretained qualifier
in MRC. Unlike __weak, this is being enabled immediately. Since
variables are essentially __unsafe_unretained by default in MRC,
the only practical uses are (1) communication and (2) changing the
default behavior of by-value block capture.
As an implementation matter, this means that the ObjC ownership
qualifiers may appear in any ObjC language mode, and so this patch
removes a number of checks for getLangOpts().ObjCAutoRefCount
that were guarding the processing of these qualifiers. I don't
expect this to be a significant drain on performance; it may even
be faster to just check for these qualifiers directly on a type
(since it's probably in a register anyway) than to do N dependent
loads to grab the LangOptions.
rdar://9674298
llvm-svn: 251041
Igor Laevsky [Thu, 22 Oct 2015 18:35:34 +0000 (18:35 +0000)]
[IntrinsicEmitter] Remove GET_INTRINSIC_MODREF_BEHAVIOR table
There is no need to generate separate table for intrinsics mod ref behaviour.
It can now be determined purely from function attributes.
Differential Revision: http://reviews.llvm.org/D13917
llvm-svn: 251040
Rafael Espindola [Thu, 22 Oct 2015 18:32:06 +0000 (18:32 +0000)]
Avoid storing a second copy of each string in StringTableBuilder.
This was only use in the extremely uncommon case of @@@ symbols on ELF.
llvm-svn: 251039
Matthias Braun [Thu, 22 Oct 2015 18:07:38 +0000 (18:07 +0000)]
AArch64: Disable the latency heuristic
It turned out not to improve any of our benchmarks but occasionally led
to increased register pressure and spilling.
Only enabling for the Cyclone CPU as the results on the cortex CPUs
give mixed results.
Differential Revision: http://reviews.llvm.org/D13708
llvm-svn: 251038
Matthias Braun [Thu, 22 Oct 2015 18:07:31 +0000 (18:07 +0000)]
MachineScheduler: Add a way to disable the 'ReduceLatency' heuristic
llvm-svn: 251037
David Majnemer [Thu, 22 Oct 2015 18:04:22 +0000 (18:04 +0000)]
[MS ABI] Don't crash when inheriting from base with trailing empty array member
We got this right for Itanium but not MSVC because CGRecordLayoutBuilder
was checking if the base's size was zero when it should have been
checking the non-virtual size.
This fixes PR21040.
llvm-svn: 251036
Eric Christopher [Thu, 22 Oct 2015 17:55:35 +0000 (17:55 +0000)]
Remove the last traces of X86CompilationCallback as it is completely
unused.
llvm-svn: 251035
Oleksiy Vyalov [Thu, 22 Oct 2015 17:50:33 +0000 (17:50 +0000)]
Add support for abstract domain sockets.
http://reviews.llvm.org/D13970
llvm-svn: 251034
Tim Northover [Thu, 22 Oct 2015 17:20:48 +0000 (17:20 +0000)]
CodeGen: increase bits allocated for LegalizeActions
The array handling CondCodes only allocated 2 bits to describe the
desired action for each type. The new addition of a "LibCall" option
overflowed this and caused corruption for Custom actions.
No in-tree targets have a Custom CondCodeAction, so unfortunately it
can't be tested.
llvm-svn: 251033
Craig Topper [Thu, 22 Oct 2015 17:05:00 +0000 (17:05 +0000)]
Change makeLibCall to take an ArrayRef<SDValue> instead of pointer and size. This removes the need to pass a hardcoded size in many places. NFC
llvm-svn: 251032
Eugene Zelenko [Thu, 22 Oct 2015 17:01:20 +0000 (17:01 +0000)]
Attempt to fix MSVC builds after rL250966.
Differential Revision: http://reviews.llvm.org/D13968
llvm-svn: 251031
Zachary Turner [Thu, 22 Oct 2015 16:42:31 +0000 (16:42 +0000)]
Fix broken build under MSVC.
llvm-svn: 251030
Craig Topper [Thu, 22 Oct 2015 16:35:56 +0000 (16:35 +0000)]
Use ArrayRef instead of pointer and size. NFC
llvm-svn: 251029
Zia Ansari [Thu, 22 Oct 2015 16:14:45 +0000 (16:14 +0000)]
[X86] - Catch extra combine opportunities for redundant imuls.
When we fold "mul ((add x, c1), c1)" -> "add ((mul x, c2), c1*c2)", we bail if (add x, c1) has multiple
users which would result in an extra add instruction.
In such cases, this patch adds a check to see if we can eliminate a multiply instruction in exchange for the extra add.
I also added the capability of doing the existing optimization with non-splatted vectors (splatted also works).
Differential Revision: http://reviews.llvm.org/D13740
llvm-svn: 251028
Bill Schmidt [Thu, 22 Oct 2015 15:53:44 +0000 (15:53 +0000)]
[PPC] Fix PR24686 by failing assembly for an invalid relocation
PR24686 identifies a problem where a relocation expression is invalid
when not all of the symbols in the expression can be locally
resolved. This causes the compiler to request a PC-relative half16ds
relocation, which is nonsensical for PowerPC. This patch recognizes
this situation and ensures we fail the assembly cleanly.
Test case provided by Anton Blanchard.
llvm-svn: 251027
Benjamin Kramer [Thu, 22 Oct 2015 15:45:54 +0000 (15:45 +0000)]
Unbreak the shared cmake build. libToolingCore now depends on libAST.
llvm-svn: 251026
Craig Topper [Thu, 22 Oct 2015 15:35:21 +0000 (15:35 +0000)]
Disable trigraph and escaped newline expansion on all types of raw string literals not just ASCII type.
llvm-svn: 251025
Rafael Espindola [Thu, 22 Oct 2015 15:26:35 +0000 (15:26 +0000)]
Avoid hash lookups when finalizing StringTableBuilder. NFC.
llvm-svn: 251024
Rafael Espindola [Thu, 22 Oct 2015 15:15:44 +0000 (15:15 +0000)]
Use array_pod_sort. NFC.
llvm-svn: 251023
Benjamin Kramer [Thu, 22 Oct 2015 15:04:10 +0000 (15:04 +0000)]
[Tooling] Add a utility function to replace one nested name with another.
One problem in clang-tidy and other clang tools face is that there is no
way to lookup an arbitrary name in the AST, that's buried deep inside Sema
and might not even be what the user wants as the new name may be freshly
inserted and not available in the AST.
A common use case for lookups is replacing one nested name with another
while minimizing namespace qualifications, so replacing 'ns::foo' with
'ns::bar' will use just 'bar' if we happen to be inside the namespace 'ns'.
This adds a little helper utility for exactly that use case.
Differential Revision: http://reviews.llvm.org/D13931
llvm-svn: 251022
Manuel Klimek [Thu, 22 Oct 2015 14:54:50 +0000 (14:54 +0000)]
Switch check_clang_tidy to argparse and add a -resource-dir argument.
-resource-dir can be used to inject non-standard resource dirs via the
lit site config.
llvm-svn: 251021
Pirama Arumuga Nainar [Thu, 22 Oct 2015 14:15:00 +0000 (14:15 +0000)]
Fix incorrect target triple in fp16-promote.ll
Summary:
Hyphens were missing from the triple, causing it to be parsed
incorrectly. This patch updates the triple and makes necessary
changes to the expected output.
Patch is from Vinicius Tinti.
Reviewers: ab, tinti
Subscribers: srhines, llvm-commits
Differential Revision: http://reviews.llvm.org/D13792
llvm-svn: 251020
Daniel Sanders [Thu, 22 Oct 2015 14:01:52 +0000 (14:01 +0000)]
[mips][mips16] Fix typo in FileCheck directive.
llvm-svn: 251019
Asaf Badouh [Thu, 22 Oct 2015 14:01:16 +0000 (14:01 +0000)]
[X86][AVX512] extend vcvtph2ps to support xmm/ymm and sae versions
Differential Revision: http://reviews.llvm.org/D13945
llvm-svn: 251018
James Molloy [Thu, 22 Oct 2015 13:44:26 +0000 (13:44 +0000)]
[GlobalsAA] Loosen an overly conservative bailout
Instead of bailing out when we see loads, analyze them. If we can prove that the loaded-from address must escape, then we can conclude that a load from that address must escape too and therefore cannot alias a non-addr-taken global.
When checking if a Value can alias a non-addr-taken global, if the Value is a LoadInst of a non-global, recurse instead of bailing.
If we can follow a trail of loads up to some base that is captured, we know by inference that all the loads we followed are also captured.
llvm-svn: 251017
James Molloy [Thu, 22 Oct 2015 13:28:18 +0000 (13:28 +0000)]
[BasicAA] Non-equal indices in a GEP of a SequentialType don't overlap
If the final indices of two GEPs can be proven to not be equal, and
the GEP is of a SequentialType (not a StructType), then the two GEPs
do not alias.
llvm-svn: 251016
Angel Garcia Gomez [Thu, 22 Oct 2015 13:23:46 +0000 (13:23 +0000)]
Don't use "auto" on loops over fundamental types in modernize-loop-convert.
Summary: using "auto" on a loop that iterates over ints is kind of an overkill. Use the real type name instead.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13982
llvm-svn: 251015
Gabor Horvath [Thu, 22 Oct 2015 13:23:18 +0000 (13:23 +0000)]
Attempt to fix build bot test failures.
llvm-svn: 251014
Angel Garcia Gomez [Thu, 22 Oct 2015 13:20:49 +0000 (13:20 +0000)]
Correctly print the type in modernize-make-unique.
Summary: Take into account the current LangOptions the check has to add back the template argument.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13983
llvm-svn: 251013
James Molloy [Thu, 22 Oct 2015 13:18:42 +0000 (13:18 +0000)]
[ValueTracking] Add a new predicate: isKnownNonEqual()
isKnownNonEqual(A, B) returns true if it can be determined that A != B.
At the moment it only knows two facts, that a non-wrapping add of nonzero to a value cannot be that value:
A + B != A [where B != 0, addition is nsw or nuw]
and that contradictory known bits imply two values are not equal.
This patch also hooks this up to InstSimplify; InstSimplify had a peephole for the first fact but not the second so this teaches InstSimplify a new trick too (alas no measured performance impact!)
llvm-svn: 251012
Gabor Horvath [Thu, 22 Oct 2015 11:53:04 +0000 (11:53 +0000)]
[analyzer] Bug identification
This patch adds hashes to the plist and html output to be able to identfy bugs
for suppressing false positives or diff results against a baseline. This hash
aims to be resilient for code evolution and is usable to identify bugs in two
different snapshots of the same software. One missing piece however is a
permanent unique identifier of the checker that produces the warning. Once that
issue is resolved, the hashes generated are going to change. Until that point
this feature is marked experimental, but it is suitable for early adoption.
Differential Revision: http://reviews.llvm.org/D10305
Original patch by: Bence Babati!
llvm-svn: 251011
Manuel Klimek [Thu, 22 Oct 2015 11:31:44 +0000 (11:31 +0000)]
Add %check_clang_tidy and %clang_tidy_diff.
With this, site specific lit configs can inject parameters into the
test scripts if they need site specific parameters.
Next up: enable check_clang_tidy to take a resource dir to enable
non-standard locations for builtin includes.
llvm-svn: 251010
Benjamin Kramer [Thu, 22 Oct 2015 11:26:35 +0000 (11:26 +0000)]
[AST] Remove redundant template keywords.
GCC complains about them, clang does not.
llvm-svn: 251009
Benjamin Kramer [Thu, 22 Oct 2015 11:21:40 +0000 (11:21 +0000)]
[AST] Store Decl* and Stmt* directly into the ParentMap.
These are by far the most common types to be parents in the AST so it makes
sense to optimize for them. Put them directly into the value of the map.
This currently saves 32 bytes per parent in the map and a pointer
indirection at the cost of some additional complexity in the code.
Sadly this means we cannot return an ArrayRef from getParents anymore, add
a proxy class that can own a single DynTypedNode and otherwise behaves
exactly the same as ArrayRef.
For example on a random large file (X86ISelLowering.cpp) this reduces the
size of the parent map by 24 MB.
Differential Revision: http://reviews.llvm.org/D13976
llvm-svn: 251008
Tamas Berghammer [Thu, 22 Oct 2015 11:14:37 +0000 (11:14 +0000)]
Make SymbolFileDWARF::GetCachedSectionData thread safe
Differential revision: http://reviews.llvm.org/D13942
llvm-svn: 251007
Tamas Berghammer [Thu, 22 Oct 2015 11:14:31 +0000 (11:14 +0000)]
Fix some race condition in ConstString around Mangled name handling
Differential revision: http://reviews.llvm.org/D13941
llvm-svn: 251006
Angel Garcia Gomez [Thu, 22 Oct 2015 09:48:23 +0000 (09:48 +0000)]
Make string constants in the modernize module static.
Summary: Add static to global variables, if they are not in an anonymous namespace.
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D13975
llvm-svn: 251005
Pavel Labath [Thu, 22 Oct 2015 09:34:40 +0000 (09:34 +0000)]
[AppleObjCRuntime] Don't bother looking for the runtime on non-apple targets
Summary:
This short-circuits the GetObjCVersion function to avoid iterating through target modules on
non-apple targets. This function is called on every Process::IsDynamicValue call, so this
overhead is not negligible.
Reviewers: clayborg, jingham
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13948
llvm-svn: 251004
Ewan Crawford [Thu, 22 Oct 2015 09:01:05 +0000 (09:01 +0000)]
[RenderScript] Support for mips64 runtime hook
Previously we could not hook the RS runtime on mips64 architectures.
Patch implements ABI specific code for inspecting function arguments.
Author: Dean De Leo, dean@codeplay.com
llvm-svn: 251003
Igor Kudrin [Thu, 22 Oct 2015 08:58:03 +0000 (08:58 +0000)]
Fix the buildbot.
test/elf2/gnu-hash-table.s requires ppc target support to run.
llvm-svn: 251002
Manuel Klimek [Thu, 22 Oct 2015 08:31:46 +0000 (08:31 +0000)]
Fix add_llvm_external_project.
r250835 unintentionally discarded the optional parameter to the
add_llvm_external_project() macro that may point to a path when the said
path is different from ${name}. This should fix it by passing ${ARGN} on
to add_llvm_subdirectory(). The problem manifests itself with e.g.
add_llvm_external_project(clang-tools-extra extra) from
clang/tools/CMakeLists.txt
Patch by Luchesar V. Iliev.
llvm-svn: 251001
Igor Kudrin [Thu, 22 Oct 2015 08:21:35 +0000 (08:21 +0000)]
[ELF2] Add support for GNU Hash section
This patch implements --hash-style command line switch.
* By default, or with "sysv" or "both" parameters, the linker generates
a standard ELF hash section.
* With "gnu" or "both", it produces a GNU-style hash section.
That section requires the symbols in the dynamic symbol table section, which
are referenced in the GNU hash section, to be placed after not hashed ones and
to be sorted to correspond the order of hash buckets in the GNU Hash section.
The division function, as well as estimations for the section's parameters,
are just the first rough attempt and the subjects for further adjustments.
Differential Revision: http://reviews.llvm.org/D13815
llvm-svn: 251000