platform/upstream/llvm.git
8 years agoFix another reference to in-source builds
Jonathan Roelofs [Fri, 23 Oct 2015 17:42:51 +0000 (17:42 +0000)]
Fix another reference to in-source builds

llvm-svn: 251127

8 years agoFixup this testcase after r251120.
Adrian Prantl [Fri, 23 Oct 2015 17:25:17 +0000 (17:25 +0000)]
Fixup this testcase after r251120.
I accidentally tested r251120 with assertions disabled.

llvm-svn: 251126

8 years ago[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev
Artyom Skrobov [Fri, 23 Oct 2015 17:19:19 +0000 (17:19 +0000)]
[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev

llvm-svn: 251125

8 years ago[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev
Artyom Skrobov [Fri, 23 Oct 2015 17:19:02 +0000 (17:19 +0000)]
[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev

llvm-svn: 251124

8 years ago[ARM CodeGen] @llvm.debugtrap call may be removed when restoring callee saved registers
Oleg Ranevskyy [Fri, 23 Oct 2015 17:17:59 +0000 (17:17 +0000)]
[ARM CodeGen] @llvm.debugtrap call may be removed when restoring callee saved registers

Summary:
When ARMFrameLowering::emitPopInst generates a "pop" instruction to restore the callee saved registers, it checks if the LR register is among them. If so, the function may decide to remove the basic block's terminator and replace it with a "pop" to the PC register instead of LR.

This leads to a problem when the block's terminator is preceded by a "llvm.debugtrap" call. The MI iterator points to the trap in such a case, which is also a terminator. If the function decides to restore LR to PC, it erroneously removes the trap.

Reviewers: asl, rengolin

Subscribers: aemerson, jfb, rengolin, dschuff, llvm-commits

Differential Revision: http://reviews.llvm.org/D13672

llvm-svn: 251123

8 years agoTest commit: fix typo in comment.
Oleg Ranevskyy [Fri, 23 Oct 2015 17:10:44 +0000 (17:10 +0000)]
Test commit: fix typo in comment.

llvm-svn: 251122

8 years agoAdd from __future__ import print_function everywhere.
Zachary Turner [Fri, 23 Oct 2015 17:04:29 +0000 (17:04 +0000)]
Add from __future__ import print_function everywhere.

Apparently there were tons of instances I missed last time, I
guess I accidentally ran 2to3 non-recursively.  This should be
every occurrence of a print statement fixed to use a print function
as well as from __future__ import print_function being added to
every file.

After this patch print statements will stop working everywhere in
the test suite, and the print function should be used instead.

llvm-svn: 251121

8 years agoModule Debugging: Emit module debug info for types inside of Objective-C
Adrian Prantl [Fri, 23 Oct 2015 17:02:22 +0000 (17:02 +0000)]
Module Debugging: Emit module debug info for types inside of Objective-C
containers.

rdar://problem/23196170

llvm-svn: 251120

8 years agoFix Clang-tidy modernize-use-override warnings in source/Plugins/ObjectContainer...
Eugene Zelenko [Fri, 23 Oct 2015 16:56:07 +0000 (16:56 +0000)]
Fix Clang-tidy modernize-use-override warnings in source/Plugins/ObjectContainer and ObjectFile; other minor fixes.

llvm-svn: 251119

8 years agoELF2: Do not apply 0xffff bit mask to uint16_t return values. NFC.
Rui Ueyama [Fri, 23 Oct 2015 16:54:58 +0000 (16:54 +0000)]
ELF2: Do not apply 0xffff bit mask to uint16_t return values. NFC.

llvm-svn: 251118

8 years ago[llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.
Davide Italiano [Fri, 23 Oct 2015 16:52:22 +0000 (16:52 +0000)]
[llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.

Reported by: mikael.holmen at ericsson.com

llvm-svn: 251117

8 years agoRemove a redundant check. NFC
Adrian Prantl [Fri, 23 Oct 2015 16:51:32 +0000 (16:51 +0000)]
Remove a redundant check. NFC

llvm-svn: 251116

8 years ago[StaticAnalyzer] Use llvm::utostr and not to_string.
Davide Italiano [Fri, 23 Oct 2015 16:43:18 +0000 (16:43 +0000)]
[StaticAnalyzer] Use llvm::utostr and not to_string.

The latter seems unsupported (at least) on MinGW and FreeBSD (where
I hit this failure). We can't have nice things.

llvm-svn: 251115

8 years agoStyle fix.
Rui Ueyama [Fri, 23 Oct 2015 16:13:27 +0000 (16:13 +0000)]
Style fix.

llvm-svn: 251114

8 years ago[CodeGen] Mark setjmp/catchret MBBs address-taken
Joseph Tremoulet [Fri, 23 Oct 2015 15:06:05 +0000 (15:06 +0000)]
[CodeGen] Mark setjmp/catchret MBBs address-taken

Summary:
This ensures that BranchFolding (and similar) won't remove these blocks.

Also allow AsmPrinter::EmitBasicBlockStart to process MBBs which are
address-taken but do not have BBs that are address-taken, since otherwise
its call to getAddrLabelSymbolTableToEmit would fail an assertion on such
blocks.  I audited the other callers of getAddrLabelSymbolTableToEmit
(and getAddrLabelSymbol); they all have BBs known to be address-taken
except for the call through getAddrLabelSymbol from
WinException::create32bitRef; that call is actually now unreachable, so
I've removed it and updated the signature of create32bitRef.

This fixes PR25168.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: pgavlin, llvm-commits

Differential Revision: http://reviews.llvm.org/D13774

llvm-svn: 251113

8 years ago[BasicAA] Bugfix for r251016
James Molloy [Fri, 23 Oct 2015 14:17:03 +0000 (14:17 +0000)]
[BasicAA] Bugfix for r251016

If the loaded type sizes don't match the element type of the sequential type, all bets are off and the addresses may, indeed, overlap.

Surprisingly, this just got caught in one test, on one builder, out of the 30+ builders testing this change. Congratulations go to http://lab.llvm.org:8011/builders/clang-aarch64-lnt/builds/5205.

llvm-svn: 251112

8 years agoFix arm lldb-server on aarch64 device
Tamas Berghammer [Fri, 23 Oct 2015 13:36:31 +0000 (13:36 +0000)]
Fix arm lldb-server on aarch64 device

* Use PTRACE_GETVFPREGS/PTRACE_SETVFPREGS to access the floating point
  registers instead of the old PTRACE_GETFPREGS/PTRACE_SETFPREGS. The
  new call is available since armv5.
* Work around a kernel issue in PTRACE_POKEUSER with reading out the full
  register set, modifying the neccessary value and then writing it back.

llvm-svn: 251111

8 years ago[AST] Plug a memory leak when promoting a single ParentMap entry to a vector.
Benjamin Kramer [Fri, 23 Oct 2015 13:24:18 +0000 (13:24 +0000)]
[AST] Plug a memory leak when promoting a single ParentMap entry to a vector.

Found by asan!

llvm-svn: 251110

8 years agoTry to fix MSVC build after r251105
Tamas Berghammer [Fri, 23 Oct 2015 10:53:31 +0000 (10:53 +0000)]
Try to fix MSVC build after r251105

llvm-svn: 251109

8 years agoRevert "[AArch64]Merge halfword loads into a 32-bit load"
James Molloy [Fri, 23 Oct 2015 10:41:38 +0000 (10:41 +0000)]
Revert "[AArch64]Merge halfword loads into a 32-bit load"

This reverts commit r250719. This introduced a codegen fault in SPEC2000.gcc, when compiled for Cortex-A53.

llvm-svn: 251108

8 years agoDisable the strict-aliasing warnings produced by gcc
Tamas Berghammer [Fri, 23 Oct 2015 10:34:53 +0000 (10:34 +0000)]
Disable the strict-aliasing warnings produced by gcc

GCC produce a lot of strict-aliasing warning for the LLDB codebase
what makes reading the compile output very difficult. This change
disable these warnings to reduce the noise as we already ignore them.

We should consider re-enabling the warning if we fix all (or most)
strict-aliasing violation first.

Differential revision: http://reviews.llvm.org/D13981

llvm-svn: 251107

8 years agoRe-commit "Make dwarf parsing multi-threaded"
Tamas Berghammer [Fri, 23 Oct 2015 10:34:49 +0000 (10:34 +0000)]
Re-commit "Make dwarf parsing multi-threaded"

Re-commit the change after fixing a lot of race condition in LLDB
exposed by this change

Loading the debug info from a large application is the slowest task
LLDB do. This CL makes most of the dwarf parsing code multi-threaded.

As a result the speed of "attach; backtrace; exit;" when the inferior
is an LLDB with full debug info increased by a factor of 2.

Differential revision: http://reviews.llvm.org/D13662

llvm-svn: 251106

8 years agoFix race conditions in Core/Timer
Tamas Berghammer [Fri, 23 Oct 2015 10:34:29 +0000 (10:34 +0000)]
Fix race conditions in Core/Timer

The Timer class already had some support for multi-threaded access
but it still contained several race conditions. This CL fixes them
in preparation of adding multi-threaded dwarf parsing (and other
multi-threaded parts later).

Differential revision: http://reviews.llvm.org/D13940

llvm-svn: 251105

8 years agoFix the build when building with LLDB_DISABLE_PYTHON.
Aidan Dodds [Fri, 23 Oct 2015 10:27:16 +0000 (10:27 +0000)]
Fix the build when building with LLDB_DISABLE_PYTHON.

llvm-svn: 251104

8 years agoMake isExpensiveToCopy() tri-state.
Manuel Klimek [Fri, 23 Oct 2015 10:00:50 +0000 (10:00 +0000)]
Make isExpensiveToCopy() tri-state.

This allows returning "don't know" for dependent types.

llvm-svn: 251103

8 years agoEnable the libc++ tests on linux
Pavel Labath [Fri, 23 Oct 2015 09:17:30 +0000 (09:17 +0000)]
Enable the libc++ tests on linux

Summary:
The list of loaded modules which skip_if_library_missing is depending on is not available on
linux until after we run the target. This causes the tests to be wrongfully skipped. This commit
moves the skip call after the run command.

Reviewers: granata.enrico, tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13985

llvm-svn: 251102

8 years ago[AST] Re-add TypeLocs and NestedNameSpecifierLocs to the ParentMap.
Benjamin Kramer [Fri, 23 Oct 2015 09:04:55 +0000 (09:04 +0000)]
[AST] Re-add TypeLocs and NestedNameSpecifierLocs to the ParentMap.

This relands r250831 after some fixes to shrink the ParentMap overall
with one addtional tweak: nodes with pointer identity (e.g. Decl* and
friends) can be store more efficiently so I put them in a separate map.
All other nodes (so far only TypeLoc and NNSLoc) go in a different map
keyed on DynTypedNode. This further uglifies the code but significantly
reduces memory overhead.

Overall this change still make ParentMap significantly larger but it's
nowhere as bad as before. I see about 25 MB over baseline (pre-r251008)
on X86ISelLowering.cpp. If this becomes an issue we could consider
splitting the maps further as DynTypedNode is still larger (32 bytes)
than a single TypeLoc (16 bytes) but I didn't want to introduce even
more complexity now.

Differential Revision: http://reviews.llvm.org/D14011

llvm-svn: 251101

8 years agoUse proper output directory when naminging the libc++ output
Eric Fiselier [Fri, 23 Oct 2015 07:04:24 +0000 (07:04 +0000)]
Use proper output directory when naminging the  libc++ output

llvm-svn: 251100

8 years ago[SCEV] Get rid of an unnecessary lambda; NFC
Sanjoy Das [Fri, 23 Oct 2015 06:57:21 +0000 (06:57 +0000)]
[SCEV] Get rid of an unnecessary lambda; NFC

llvm-svn: 251099

8 years ago[mips][microMIPS] Implement SHLL.PH, SHLL_S.PH, SHLL.QB, SHLLV.PH, SHLLV_S.PH, SHLLV...
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

8 years ago[SCEV] Fix a latent bug in `getPreStartForExtend`
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

8 years ago[AVR] Add ELF constants to headers
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

8 years ago[lld][MachO] Prune unused EH frames.
Lang Hames [Fri, 23 Oct 2015 05:39:16 +0000 (05:39 +0000)]
[lld][MachO] Prune unused EH frames.

llvm-svn: 251095

8 years agoSupport, IR: silence -Wunused-parameter
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

8 years agoAdd more intrumentation/runtime helper interfaces (NFC)
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

8 years agoRemove some tabs that snuck into debugserver-entitlements.plist, etc.
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

8 years agoUpstreaming the apple internal changes that accumulated during the
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

8 years agoELF2: Improve Target::relocateOne().
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

8 years ago[LangRef] Fix the doc for operand bundles
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

8 years agoAdd arm64 FreeBSD ProcessMonitor register context
Ed Maste [Fri, 23 Oct 2015 01:10:42 +0000 (01:10 +0000)]
Add arm64 FreeBSD ProcessMonitor register context

llvm-svn: 251088

8 years agoSLPVectorizer: AllSameOpcode* starts "true" only for instructions
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

8 years agoFix one more place where we were using the old
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

8 years agoSLPVectorizer: refactor reorderInputsAccordingToOpcode (NFC)
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

8 years agoLog information about sections that didn't make it into the target's memory.
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

8 years agoFixed a typo in r251080.
Sean Callanan [Fri, 23 Oct 2015 00:37:54 +0000 (00:37 +0000)]
Fixed a typo in r251080.

llvm-svn: 251083

8 years ago[lldb-mi] display summary for simple types + refactor (use lldb formatting for all...
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

8 years ago[CodeGen] Remove usage of NDEBUG in header.
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

8 years agoSummary provider for char.
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

8 years ago[msan] Re-submit test for process_vm_readv.
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

8 years ago[libFuzzer] use the indirect caller-callee counter as an independent search heuristic
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

8 years ago[msan] Temporarily remove a failing test to fix the bot.
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

8 years agoELF2: SymbolBody::repl() never returns a nullptr.
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

8 years ago[libFuzzer] more refactoring the code that checks the coverage. NFC
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

8 years ago[libFuzzer] refactoring the code that checks the coverage. NFC
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

8 years ago[cmake] Fix cmake build on OSX after r250335 for older versions of cmake
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

8 years agoUse newly introduced interfaces in LLVM (NFC)
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

8 years ago[sanitizer-coverage] introduce __sanitizer_get_total_unique_caller_callee_pairs
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

8 years agoMinor bug fix in Profile Name Prefix interface
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

8 years ago[libFuzzer] remove the deprecated 'tokens' feature
Kostya Serebryany [Thu, 22 Oct 2015 21:48:09 +0000 (21:48 +0000)]
[libFuzzer] remove the deprecated 'tokens' feature

llvm-svn: 251069

8 years agoELF2: Keep .eh_frame even if they are not live.
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

8 years agoLoopPass: Remove redoLoop, it isn't used. NFC
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

8 years agoFix Clang-tidy modernize-use-override warnings in include/lldb/Disassembler and Opera...
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

8 years agoDont required CMake 3 to install a linker script
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

8 years agoLoopPass: Simplify the API for adding a new loop. NFC
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

8 years agoOnly disable linker script when LIBCXX_CXX_ABI_LIBNAME is none
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

8 years agoDisable linker scripts when the ABI library is not specified or is none.
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

8 years ago[SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
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

8 years agoPython 3 porting - Wrap returns from map() in list()
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

8 years ago[msan] Intercept process_vm_readv/writev.
Evgeniy Stepanov [Thu, 22 Oct 2015 20:35:42 +0000 (20:35 +0000)]
[msan] Intercept process_vm_readv/writev.

llvm-svn: 251059

8 years agoAdd helper functions and remove hard coded references to instProf related name/name...
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

8 years ago[Sink] Don't check BB.empty()
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

8 years ago[ASan] Enable instrumentation of dynamic allocas by default.
Alexey Samsonov [Thu, 22 Oct 2015 20:07:28 +0000 (20:07 +0000)]
[ASan] Enable instrumentation of dynamic allocas by default.

llvm-svn: 251056

8 years agoUpdate every test to import `lldb_shared`.
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

8 years agoFix Clang-tidy modernize-use-override warnings in some files in include/lldb/Interpre...
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

8 years ago[SCEV] Remove a test case added in r249168
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

8 years ago[SCEV] Commute zero extends through <nuw> additions
Sanjoy Das [Thu, 22 Oct 2015 19:57:38 +0000 (19:57 +0000)]
[SCEV] Commute zero extends through <nuw> additions

llvm-svn: 251052

8 years ago[SCEV] Opportunistically interpret unsigned constraints as signed
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

8 years ago[SCEV] Teach SCEV some axioms about non-wrapping arithmetic
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

8 years ago[SCEV] Commute sign extends through nsw additions
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

8 years ago[SCEV] Mark AddExprs as nsw or nuw if legal
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

8 years agoRemove special case logic for finding 3rd party libs
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

8 years agoMove third party libraries to lldb/third_party
Zachary Turner [Thu, 22 Oct 2015 19:55:01 +0000 (19:55 +0000)]
Move third party libraries to lldb/third_party

llvm-svn: 251046

8 years ago[ASan] Minor fixes to dynamic allocas handling:
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

8 years agoSet device_id to host value only in case of adb protocol.
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

8 years agoELF2: Implement --gc-sections.
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

8 years ago[ExecutionEngine] Garbage collect some dead (and unsafe) code.
Davide Italiano [Thu, 22 Oct 2015 18:46:27 +0000 (18:46 +0000)]
[ExecutionEngine] Garbage collect some dead (and unsafe) code.

llvm-svn: 251042

8 years agoDefine weak and __weak to mean ARC-style weak references, even in MRC.
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

8 years ago[IntrinsicEmitter] Remove GET_INTRINSIC_MODREF_BEHAVIOR table
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

8 years agoAvoid storing a second copy of each string in StringTableBuilder.
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

8 years agoAArch64: Disable the latency heuristic
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

8 years agoMachineScheduler: Add a way to disable the 'ReduceLatency' heuristic
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

8 years ago[MS ABI] Don't crash when inheriting from base with trailing empty array member
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

8 years agoRemove the last traces of X86CompilationCallback as it is completely
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

8 years agoAdd support for abstract domain sockets.
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

8 years agoCodeGen: increase bits allocated for LegalizeActions
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

8 years agoChange makeLibCall to take an ArrayRef<SDValue> instead of pointer and size. This...
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

8 years agoAttempt to fix MSVC builds after rL250966.
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

8 years agoFix broken build under MSVC.
Zachary Turner [Thu, 22 Oct 2015 16:42:31 +0000 (16:42 +0000)]
Fix broken build under MSVC.

llvm-svn: 251030

8 years agoUse ArrayRef instead of pointer and size. NFC
Craig Topper [Thu, 22 Oct 2015 16:35:56 +0000 (16:35 +0000)]
Use ArrayRef instead of pointer and size. NFC

llvm-svn: 251029

8 years ago[X86] - Catch extra combine opportunities for redundant imuls.
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