platform/upstream/llvm.git
9 years agoFix the x86-upgrade-avx2-vbroadcast.ll test by commenting the CHECK lines
Filipe Cabecinhas [Wed, 4 Mar 2015 00:49:12 +0000 (00:49 +0000)]
Fix the x86-upgrade-avx2-vbroadcast.ll test by commenting the CHECK lines

llvm-svn: 231187

9 years agoRegisterCoalescer: Gracefully continue if subrange merging fails.
Matthias Braun [Wed, 4 Mar 2015 00:43:50 +0000 (00:43 +0000)]
RegisterCoalescer: Gracefully continue if subrange merging fails.

There is a known bug where the register coalescer fails to merge
subranges when multiple ranges end up in the "overflow" bit 32 of the
lanemasks. A proper fix for this is complicated so for now this is a
workaround which lets the register coalescer drop the subregister
liveness information (we just loose some precision by that) and
continue.

llvm-svn: 231186

9 years agoDrop the "eh_" from eh_func_begin and eh_func_end.
Rafael Espindola [Wed, 4 Mar 2015 00:27:43 +0000 (00:27 +0000)]
Drop the "eh_" from eh_func_begin and eh_func_end.

They will be used for more than eh tables.

llvm-svn: 231185

9 years agoRevert "unique_ptrify LiveRange::segmentSet"
David Blaikie [Wed, 4 Mar 2015 00:15:02 +0000 (00:15 +0000)]
Revert "unique_ptrify LiveRange::segmentSet"

Apparently something does care about ordering of LiveIntervals... so
revert all that stuff (r231175, r231176, r231177) & take some time to
re-evaluate.

llvm-svn: 231184

9 years ago[RewriteStatepointsForGC] Fix a relocation bug w.r.t values defined by invoke instruc...
Philip Reames [Wed, 4 Mar 2015 00:13:52 +0000 (00:13 +0000)]
[RewriteStatepointsForGC] Fix a relocation bug w.r.t values defined by invoke instructions

RewriteStatepointsForGC pass emits an alloca for each GC pointer which will be relocated. It then inserts stores after def and all relocations, and inserts loads before each use as well. In the end, mem2reg is used to update IR with relocations in SSA form.

However, there is a problem with inserting stores for values defined by invoke instructions. The code didn't expect a def was a terminator instruction, and inserting instructions after these terminators resulted in malformed IR.

This patch fixes this problem by handling invoke instructions as a special case. If the def is an invoke instruction, the store will be inserted at the beginning of the normal destination block. Since return value from invoke instruction does not dominate the unwind destination block, no action is needed there.

Patch by: Chen Li
Differential Revision: http://reviews.llvm.org/D7923

llvm-svn: 231183

9 years agoRemove 'llvm.x86.avx2.vbroadcasti128' intrinsic.
Juergen Ributzka [Wed, 4 Mar 2015 00:13:25 +0000 (00:13 +0000)]
Remove 'llvm.x86.avx2.vbroadcasti128' intrinsic.

The intrinsic is no longer generated by the front-end. Remove the intrinsic and
auto-upgrade it to a vector shuffle.

Reviewed by Nadav

This is related to rdar://problem/18742778.

llvm-svn: 231182

9 years agoDocument the LLVM "thunk" attribute added back in r226708
Reid Kleckner [Wed, 4 Mar 2015 00:08:56 +0000 (00:08 +0000)]
Document the LLVM "thunk" attribute added back in r226708

llvm-svn: 231181

9 years agoTry fixing configure+make build on FreeBSD after r230963
Ed Maste [Wed, 4 Mar 2015 00:06:26 +0000 (00:06 +0000)]
Try fixing configure+make build on FreeBSD after r230963

llvm-svn: 231180

9 years agoTypePrinter print __restrict if not in C99 mode
Jacques Pienaar [Tue, 3 Mar 2015 23:58:09 +0000 (23:58 +0000)]
TypePrinter print __restrict if not in C99 mode

restrict is a keyword in C99 but not in C++ while clang accepts __restrict for C++ code. Modify the TypePrinter to print __restrict when not processing C99 code.

Printing restrict in C++ was problematic as printing the argument of
  int f(int * __restrict a) { ... }
resulted in
  int *restrict a
which is incorrect.

http://reviews.llvm.org/D8048

llvm-svn: 231179

9 years agoUpdate twoaddr-coalesce-3.ll to run on darwin and linux machines:
Eric Christopher [Tue, 3 Mar 2015 23:56:20 +0000 (23:56 +0000)]
Update twoaddr-coalesce-3.ll to run on darwin and linux machines:

a) Default relocation model differences,
b) Different numbers of # in comments

llvm-svn: 231178

9 years agoAdd missing header include
David Blaikie [Tue, 3 Mar 2015 23:54:35 +0000 (23:54 +0000)]
Add missing header include

llvm-svn: 231177

9 years agoRecommit r231168: unique_ptrify LiveRange::segmentSet
David Blaikie [Tue, 3 Mar 2015 23:53:03 +0000 (23:53 +0000)]
Recommit r231168: unique_ptrify LiveRange::segmentSet

GCC 4.7's libstdc++ doesn't have std::map::emplace, but it does have
std::unordered_map::emplace, and the use case here doesn't appear to
need ordering. The container has been changed in a separate/precursor
patch, and now this patch should hopefully build cleanly even with
GCC 4.7.

Original commit message:
This makes LiveRange non-copyable, and LiveInterval is already
non-movable (due to the explicit dtor), so now it's non-copyable and
non-movable.

Fix the one case where we were relying on the (deprecated in C++11)
implicit copy ctor of LiveInterval (which happened to work because the
ctor created an object with a null segmentSet, so double-deleting the
null pointer was fine).

llvm-svn: 231176

9 years agoChange LiveStackAnalysis::SS2IntervalMap from std::map to std::unordered_map
David Blaikie [Tue, 3 Mar 2015 23:53:00 +0000 (23:53 +0000)]
Change LiveStackAnalysis::SS2IntervalMap from std::map to std::unordered_map

This use case doesn't appear to benefit from ordering, and
std::unordered_map has the advantage that it supports emplace (the
LiveInterval values really shouldn't be copyable or movable & they won't
be in a near-future patch).

llvm-svn: 231175

9 years ago[asan] more fixes for x32, patches by H.J. Lu
Kostya Serebryany [Tue, 3 Mar 2015 23:46:40 +0000 (23:46 +0000)]
[asan] more fixes for x32, patches by H.J. Lu

llvm-svn: 231174

9 years agoRevert "unique_ptrify LiveRange::segmentSet"
David Blaikie [Tue, 3 Mar 2015 23:44:07 +0000 (23:44 +0000)]
Revert "unique_ptrify LiveRange::segmentSet"

GCC 4.7 *shakes fist* (doesn't have std::map::emplace... )

This reverts commit r231168.

llvm-svn: 231173

9 years agoMove TargetLibraryInfo data from two files into one common .def file.
Jan Wen Voung [Tue, 3 Mar 2015 23:41:58 +0000 (23:41 +0000)]
Move TargetLibraryInfo data from two files into one common .def file.

Summary:
This makes it more obvious that the enum definition and the
"StandardName" array is in sync. Mechanically refactored w/ a
python script.

Test Plan: still compiles

Subscribers: llvm-commits

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

llvm-svn: 231172

9 years ago[asan] attempting to fix the windows build
Kostya Serebryany [Tue, 3 Mar 2015 23:38:24 +0000 (23:38 +0000)]
[asan] attempting to fix the windows build

llvm-svn: 231171

9 years agoTry to unbreak the Windows buildbots.
Filipe Cabecinhas [Tue, 3 Mar 2015 23:36:57 +0000 (23:36 +0000)]
Try to unbreak the Windows buildbots.

llvm-svn: 231170

9 years agoFix errors building on linux.
Zachary Turner [Tue, 3 Mar 2015 23:36:51 +0000 (23:36 +0000)]
Fix errors building on linux.

llvm-svn: 231169

9 years agounique_ptrify LiveRange::segmentSet
David Blaikie [Tue, 3 Mar 2015 23:30:40 +0000 (23:30 +0000)]
unique_ptrify LiveRange::segmentSet

This makes LiveRange non-copyable, and LiveInterval is already
non-movable (due to the explicit dtor), so now it's non-copyable and
non-movable.

Fix the one case where we were relying on the (deprecated in C++11)
implicit copy ctor of LiveInterval (which happened to work because the
ctor created an object with a null segmentSet, so double-deleting the
null pointer was fine).

llvm-svn: 231168

9 years ago[sanitizer/coverage] Add AFL-style coverage counters (search heuristic for fuzzing).
Kostya Serebryany [Tue, 3 Mar 2015 23:27:02 +0000 (23:27 +0000)]
[sanitizer/coverage] Add AFL-style coverage counters (search heuristic for fuzzing).

Introduce -mllvm -sanitizer-coverage-8bit-counters=1
which adds imprecise thread-unfriendly 8-bit coverage counters.

The run-time library maps these 8-bit counters to 8-bit bitsets in the same way
AFL (http://lcamtuf.coredump.cx/afl/technical_details.txt) does:
counter values are divided into 8 ranges and based on the counter
value one of the bits in the bitset is set.
The AFL ranges are used here: 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+.

These counters provide a search heuristic for single-threaded
coverage-guided fuzzers, we do not expect them to be useful for other purposes.

Depending on the value of -fsanitize-coverage=[123] flag,
these counters will be added to the function entry blocks (=1),
every basic block (=2), or every edge (=3).

Use these counters as an optional search heuristic in the Fuzzer library.
Add a test where this heuristic is critical.

llvm-svn: 231166

9 years agoRemove subtarget dependence in pass pipeline setup for AArch64.
Eric Christopher [Tue, 3 Mar 2015 23:22:40 +0000 (23:22 +0000)]
Remove subtarget dependence in pass pipeline setup for AArch64.

llvm-svn: 231165

9 years agoWinEH: Remove vestigial EH object
Reid Kleckner [Tue, 3 Mar 2015 23:20:30 +0000 (23:20 +0000)]
WinEH: Remove vestigial EH object

Ultimately, we'll need to leave something behind to indicate which
alloca will hold the exception, but we can figure that out when it comes
time to emit the __CxxFrameHandler3 catch handler table.

llvm-svn: 231164

9 years agoAccidental semicolon in python.
Chaoren Lin [Tue, 3 Mar 2015 23:14:27 +0000 (23:14 +0000)]
Accidental semicolon in python.

llvm-svn: 231163

9 years agoSymbolizer refactoring: Unify access to symbolizer tools from POSIXSymbolizer
Kuba Brecka [Tue, 3 Mar 2015 23:13:02 +0000 (23:13 +0000)]
Symbolizer refactoring: Unify access to symbolizer tools from POSIXSymbolizer

Reviewed at http://reviews.llvm.org/D8029

llvm-svn: 231162

9 years agoDon't #include FormatManager.h from Debugger.h
Zachary Turner [Tue, 3 Mar 2015 23:11:11 +0000 (23:11 +0000)]
Don't #include FormatManager.h from Debugger.h

Debugger.h is a huge file that gets included everywhere, and
FormatManager.h brings in a ton of unnecessary stuff and doesn't
even use anything from it in the header.

llvm-svn: 231161

9 years ago[analyzer] unix.Malloc: preserve AllocaRegion bound to __builtin_alloca().
Anton Yartsev [Tue, 3 Mar 2015 22:58:46 +0000 (22:58 +0000)]
[analyzer] unix.Malloc: preserve AllocaRegion bound to __builtin_alloca().

Binding __builtin_alloca() return value to the symbolic value kills previous binding to a AllocaRegion established by the core.BuiltinFunctions checker. Other checkers may rely upon this information. Rollback handling of __builtin_alloca() to the way prior to r229850.

llvm-svn: 231160

9 years agoRemove unnecessary platform specific code from TestGlobalVariables.
Chaoren Lin [Tue, 3 Mar 2015 22:46:20 +0000 (22:46 +0000)]
Remove unnecessary platform specific code from TestGlobalVariables.

llvm-svn: 231159

9 years agoLangRef: Clarify select's semantics with vector arguments
David Majnemer [Tue, 3 Mar 2015 22:45:47 +0000 (22:45 +0000)]
LangRef: Clarify select's semantics with vector arguments

llvm-svn: 231158

9 years agoFix FreeBSD build after r231145
Ed Maste [Tue, 3 Mar 2015 22:44:18 +0000 (22:44 +0000)]
Fix FreeBSD build after r231145

llvm-svn: 231157

9 years agoInstCombine: Ensure select condition types are identical before merging
David Majnemer [Tue, 3 Mar 2015 22:40:36 +0000 (22:40 +0000)]
InstCombine: Ensure select condition types are identical before merging

Selection conditions may be vectors or scalars.  Make sure InstCombine
doesn't indiscriminately assume that a select which is value dependent
on another select have identical select condition types.

This fixes PR22773.

llvm-svn: 231156

9 years agoMoving WinEH outlining tests to an architecture neutral location
Andrew Kaylor [Tue, 3 Mar 2015 22:33:39 +0000 (22:33 +0000)]
Moving WinEH outlining tests to an architecture neutral location

llvm-svn: 231155

9 years agoAvoid copying LiveInterval, this could lead to a double-delete
David Blaikie [Tue, 3 Mar 2015 22:25:48 +0000 (22:25 +0000)]
Avoid copying LiveInterval, this could lead to a double-delete

llvm-svn: 231154

9 years agoImplement our own future and use that for FileArchive::preload().
Rui Ueyama [Tue, 3 Mar 2015 22:19:46 +0000 (22:19 +0000)]
Implement our own future and use that for FileArchive::preload().

std::promise and std::future in old version of libstdc++ are buggy.
I think that's the reason why LLD tests were flaky on Ubuntu 13
buildbots until we disabled file preloading.

In this patch, I implemented very simple future and used that in
FileArchive. Compared to std::promise and std::future, it lacks
many features, but should serve our purpose.

http://reviews.llvm.org/D8025

llvm-svn: 231153

9 years agoDebugInfo: Remove useless test
Duncan P. N. Exon Smith [Tue, 3 Mar 2015 22:18:24 +0000 (22:18 +0000)]
DebugInfo: Remove useless test

This test doesn't provide any value (it just checks that the frontend
produces exactly one compile unit), and it certainly isn't doing what
the comment says.  Noticed via IRC review of my update to it in r231083.

llvm-svn: 231152

9 years ago[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent.
Alexey Samsonov [Tue, 3 Mar 2015 22:15:44 +0000 (22:15 +0000)]
[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent.

llvm-svn: 231151

9 years ago[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
Alexey Samsonov [Tue, 3 Mar 2015 22:15:35 +0000 (22:15 +0000)]
[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.

-fsanitize=shift is now a group that includes both these checks, so
exisiting users should not be affected.

This change introduces two new UBSan kinds that sanitize only left-hand
side and right-hand side of shift operation. In practice, invalid
exponent value (negative or too large) tends to cause more portability
problems, including inconsistencies between different compilers, crashes
and inadequeate results on non-x86 architectures etc. That is,
-fsanitize=shift-exponent failures should generally be addressed first.

As a bonus, this change simplifies CodeGen implementation for emitting left
shift (separate checks for base and exponent are now merged by the
existing generic logic in EmitCheck()), and LLVM IR for these checks
(the number of basic blocks is reduced).

llvm-svn: 231150

9 years ago[Sanitizers] Use uint64_t for bitmask of enabled sanitizers.
Alexey Samsonov [Tue, 3 Mar 2015 22:15:32 +0000 (22:15 +0000)]
[Sanitizers] Use uint64_t for bitmask of enabled sanitizers.

The total number of sanitizers and sanitizer groups will soon
reach 32.

llvm-svn: 231149

9 years agoFix a problem where the TwoAddressInstructionPass which generate redundant register...
Eric Christopher [Tue, 3 Mar 2015 22:03:03 +0000 (22:03 +0000)]
Fix a problem where the TwoAddressInstructionPass which generate redundant register moves in a loop.

From:
int M, total;
void foo() {
int i;
for (i = 0; i < M; i++) {
  total = total + i / 2;
}
}

This is the kernel loop:

.LBB0_2: # %for.body

=>This Inner Loop Header: Depth=1
movl %edx, %esi
movl %ecx, %edx
shrl $31, %edx
addl %ecx, %edx
sarl %edx
addl %esi, %edx
incl %ecx
cmpl %eax, %ecx
jl .LBB0_2
--------------------------
The first mov insn "movl %edx, %esi" could be removed if we change "addl %esi, %edx" to "addl %edx, %esi".

The IR before TwoAddressInstructionPass is:
BB#2: derived from LLVM BB %for.body

Predecessors according to CFG: BB#1 BB#2
    %vreg3<def> = COPY %vreg12<kill>; GR32:%vreg3,%vreg12
    %vreg2<def> = COPY %vreg11<kill>; GR32:%vreg2,%vreg11
    %vreg7<def,tied1> = SHR32ri %vreg3<tied0>, 31, %EFLAGS<imp-def,dead>; GR32:%vreg7,%vreg3
    %vreg8<def,tied1> = ADD32rr %vreg3<tied0>, %vreg7<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg8,%vreg3,%vreg7
    %vreg9<def,tied1> = SAR32r1 %vreg8<kill,tied0>, %EFLAGS<imp-def,dead>; GR32:%vreg9,%vreg8
    %vreg4<def,tied1> = ADD32rr %vreg9<kill,tied0>, %vreg2<kill>, %EFLAGS<imp-def,dead>; GR32:%vreg4,%vreg9,%vreg2
    %vreg5<def,tied1> = INC64_32r %vreg3<kill,tied0>, %EFLAGS<imp-def,dead>; GR32:%vreg5,%vreg3
    CMP32rr %vreg5, %vreg0, %EFLAGS<imp-def>; GR32:%vreg5,%vreg0
    %vreg11<def> = COPY %vreg4; GR32:%vreg11,%vreg4
    %vreg12<def> = COPY %vreg5<kill>; GR32:%vreg12,%vreg5
    JL_4 <BB#2>, %EFLAGS<imp-use,kill>
Now TwoAddressInstructionPass will choose vreg9 to be tied with vreg4. However, it doesn't see that there is copy from vreg4 to vreg11 and another copy from vreg11 to vreg2 inside the loop body. To remove those copies, it is necessary to choose vreg2 to be tied with vreg4 instead of vreg9. This code pattern commonly appears when there is reduction operation in a loop.

So check for a reversed copy chain and if we encounter one then we can commute the add instruction so we can avoid a copy.

Patch by Wei Mi.
http://reviews.llvm.org/D7806

llvm-svn: 231148

9 years agoRemove getDataLayout() from Instruction/GlobalValue/BasicBlock/Function
Mehdi Amini [Tue, 3 Mar 2015 22:01:13 +0000 (22:01 +0000)]
Remove getDataLayout() from Instruction/GlobalValue/BasicBlock/Function

Summary:
This does not conceptually belongs here. Instead provide a shortcut
getModule() that provides access to the DataLayout.

Reviewers: chandlerc, echristo

Reviewed By: echristo

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231147

9 years agoFix the build broken in r231142
David Blaikie [Tue, 3 Mar 2015 21:56:11 +0000 (21:56 +0000)]
Fix the build broken in r231142

I removed the copy ctor, thinking that'd be the end of it - these
iterators should be perfectly assignable even from disjoint ranges (as
any iterator would be) - exkcept that the member was const.

Unconstify it.

llvm-svn: 231146

9 years agoFurther reduce the header footprint of Process.h
Zachary Turner [Tue, 3 Mar 2015 21:51:25 +0000 (21:51 +0000)]
Further reduce the header footprint of Process.h

No functional change here, only deletes unnecessary headers
and moves one function's body from the .h file to the .cpp.

llvm-svn: 231145

9 years agoDAGCombiner::LoadedSlice: Remove explicit copy ctor in favor of the Rule of Zero
David Blaikie [Tue, 3 Mar 2015 21:50:47 +0000 (21:50 +0000)]
DAGCombiner::LoadedSlice: Remove explicit copy ctor in favor of the Rule of Zero

This way, the copy assignment operator can be used without hitting the
deprecated case in C++11.

llvm-svn: 231144

9 years agoRewriteStatepointsForGC::PhiState: Remove explicit copy ctor in favor of the Rule...
David Blaikie [Tue, 3 Mar 2015 21:49:07 +0000 (21:49 +0000)]
RewriteStatepointsForGC::PhiState: Remove explicit copy ctor in favor of the Rule of Zero

The assertion was just checking a class invariant that's pretty easy to
verify by inspection (no mutating operations, and the two non-copy ctors
already ensure the state is maintained) so remove the explicit copy ctor
in favor of the default, thus allowing the use of the default copy
assignment operator without hitting the C++11 deprecation here.

llvm-svn: 231143

9 years agoCFG::SuccessorIterator: Remove explicit copy assignment, as the default is fine
David Blaikie [Tue, 3 Mar 2015 21:45:54 +0000 (21:45 +0000)]
CFG::SuccessorIterator: Remove explicit copy assignment, as the default is fine

There's no reason to disallow assigning an iterator from one range to an
iterator that previously iterated over a disjoint range. This then
follows the Rule of Zero, allowing implicit copy construction to be used
without hitting the case that's deprecated in C++11.

llvm-svn: 231142

9 years agoCFG::SuccessorIterator::SuccessorProxy:: Expliictly default copy construction as...
David Blaikie [Tue, 3 Mar 2015 21:44:06 +0000 (21:44 +0000)]
CFG::SuccessorIterator::SuccessorProxy:: Expliictly default copy construction as it is deprecated in C++11 in the presence of explicit copy assignment.

See r231099 for similar issues & details in [Small]BitVector.

llvm-svn: 231141

9 years agoTeach ComputeNumSignBits about signed divisions.
Nadav Rotem [Tue, 3 Mar 2015 21:39:02 +0000 (21:39 +0000)]
Teach ComputeNumSignBits about signed divisions.

http://reviews.llvm.org/D8028
rdar://20023136

llvm-svn: 231140

9 years agoFix -Wcast-qual warning.
Rui Ueyama [Tue, 3 Mar 2015 21:38:38 +0000 (21:38 +0000)]
Fix -Wcast-qual warning.

llvm-svn: 231139

9 years agoRemove the explicit SDNodeIterator::operator= in favor of the implicit default
David Blaikie [Tue, 3 Mar 2015 21:26:17 +0000 (21:26 +0000)]
Remove the explicit SDNodeIterator::operator= in favor of the implicit default

There doesn't seem to be any need to assert that iterator assignment is
between iterators over the same node - if you want to reuse an iterator
variable to iterate another node, that's perfectly acceptable. Just
don't mix comparisons between iterators into disjoint sequences, as
usual.

llvm-svn: 231138

9 years agoMove mix from math to common
Aaron Watry [Tue, 3 Mar 2015 21:25:08 +0000 (21:25 +0000)]
Move mix from math to common

It has been part of the common functions since 1.0

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 231137

9 years agoRevert "Remove the explicit SDNodeIterator::operator= in favor of the implicit default"
David Blaikie [Tue, 3 Mar 2015 21:18:16 +0000 (21:18 +0000)]
Revert "Remove the explicit SDNodeIterator::operator= in favor of the implicit default"

Accidentally committed a few more of these cleanup changes than
intended. Still breaking these out & tidying them up.

This reverts commit r231135.

llvm-svn: 231136

9 years agoRemove the explicit SDNodeIterator::operator= in favor of the implicit default
David Blaikie [Tue, 3 Mar 2015 21:17:08 +0000 (21:17 +0000)]
Remove the explicit SDNodeIterator::operator= in favor of the implicit default

There doesn't seem to be any need to assert that iterator assignment is
between iterators over the same node - if you want to reuse an iterator
variable to iterate another node, that's perfectly acceptable. Just
don't mix comparisons between iterators into disjoint sequences, as
usual.

llvm-svn: 231135

9 years agoRemove the explicit SUnitIterator::operator= as the default is just fine
David Blaikie [Tue, 3 Mar 2015 21:17:00 +0000 (21:17 +0000)]
Remove the explicit SUnitIterator::operator= as the default is just fine

There doesn't seem to be any need to assert that iterator assignment is
between iterators over the same node - if you want to reuse an iterator
variable to iterate another node, that's perfectly acceptable. Just
don't mix comparisons between iterators into disjoint sequences, as
usual.

llvm-svn: 231134

9 years agoRemove LatencyPriorityQueue::dump because it relies on an implicit copy ctor which...
David Blaikie [Tue, 3 Mar 2015 21:16:56 +0000 (21:16 +0000)]
Remove LatencyPriorityQueue::dump because it relies on an implicit copy ctor which is deprecated in C++11 (due to the presence of a user-declare dtor in the base class)

This type could be made copyable (= default a protected copy ctor in the
base class, and preferably make the derived class final to avoid risks
of providing a slicing copy operation to further derived classes) but it
seemed easier to avoid that complexity for a dump function that I assume
(by symmetry with ResourcePriorityQueue's dump, which was actively
buggy) not often used.

llvm-svn: 231133

9 years agoCorrectly handle -pass-remarks in the gold plugin.
Rafael Espindola [Tue, 3 Mar 2015 21:11:13 +0000 (21:11 +0000)]
Correctly handle -pass-remarks in the gold plugin.

llvm-svn: 231132

9 years agoDon't #include ClangPersistentVariables.h from Process.h
Zachary Turner [Tue, 3 Mar 2015 21:05:17 +0000 (21:05 +0000)]
Don't #include ClangPersistentVariables.h from Process.h

Nothing from this header file was even being referenced in
Process.h anyway, so it was a completely unnecessary include.

llvm-svn: 231131

9 years ago[X86][ELF] Correct relocation for DWARF TLS references
Paul Robinson [Tue, 3 Mar 2015 21:01:27 +0000 (21:01 +0000)]
[X86][ELF] Correct relocation for DWARF TLS references
Previously we had only Linux using DTPOFF for these; all X86 ELF
targets should. Fixes a side issue mentioned in PR21077.

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

llvm-svn: 231130

9 years agoremove enum value names from comments; NFC
Sanjay Patel [Tue, 3 Mar 2015 20:58:35 +0000 (20:58 +0000)]
remove enum value names from comments; NFC

llvm-svn: 231129

9 years agoAdd support for SunOS function/data sections and associated
Eric Christopher [Tue, 3 Mar 2015 20:54:29 +0000 (20:54 +0000)]
Add support for SunOS function/data sections and associated
section gc.

Patch by Bill Rushmore.

llvm-svn: 231128

9 years agounique_ptrify ResourcePriorityQueue::ResourceModel
David Blaikie [Tue, 3 Mar 2015 20:49:08 +0000 (20:49 +0000)]
unique_ptrify ResourcePriorityQueue::ResourceModel

llvm-svn: 231127

9 years agoRemove ResourcePriorityQueue::dump as it relies on copying a non-copyable type which...
David Blaikie [Tue, 3 Mar 2015 20:49:05 +0000 (20:49 +0000)]
Remove ResourcePriorityQueue::dump as it relies on copying a non-copyable type which would result in a double-delete

llvm-svn: 231126

9 years ago[ADT] fail-fast iterators for DenseMap
Sanjoy Das [Tue, 3 Mar 2015 20:46:45 +0000 (20:46 +0000)]
[ADT] fail-fast iterators for DenseMap

This patch was landed in r231035 and reverted because it was buggy.
This is fixed version of the same change.

Summary:
This patch is an attempt at making `DenseMapIterator`s "fail-fast".
Fail-fast iterators that have been invalidated due to insertion into
the host `DenseMap` deterministically trip an assert (in debug mode)
on access, instead of non-deterministically hitting memory corruption
issues.

Reviewers: dexonsmith, dberlin, ruiu, chandlerc

Reviewed By: chandlerc

Subscribers: yaron.keren, chandlerc, llvm-commits

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

llvm-svn: 231125

9 years agoFix program name in "clang -help"
Sumanth Gundapaneni [Tue, 3 Mar 2015 20:43:12 +0000 (20:43 +0000)]
Fix program name in "clang -help"

With out this patch,
"clang -help" prints "USAGE: clang-3 [options] <inputs>".
It should either print
USAGE: clang [options] <inputs>
or

USAGE: clang-3.7 [options] <inputs>
With this patch, on Linux, it prints
USAGE: clang-3.7 [options] <inputs>

On Windows, it prints
USAGE: clang.exe [options] <inputs>

llvm-svn: 231124

9 years agouse bool operator shortcut; NFC
Sanjay Patel [Tue, 3 Mar 2015 20:41:27 +0000 (20:41 +0000)]
use bool operator shortcut; NFC

llvm-svn: 231123

9 years agoFixing problem with field initialization order
Andrew Kaylor [Tue, 3 Mar 2015 20:22:09 +0000 (20:22 +0000)]
Fixing problem with field initialization order

llvm-svn: 231122

9 years agoFix PR22762. When emitting a DWARF expression check whether this is the
Adrian Prantl [Tue, 3 Mar 2015 20:12:52 +0000 (20:12 +0000)]
Fix PR22762. When emitting a DWARF expression check whether this is the
frame register before checking if there is a DWARF register number for it.

Thanks to H.J. Lu for diagnosing this and providing the testcase!

llvm-svn: 231121

9 years ago[TestGlobalVariables] LD_LIBRARY_PATH should be process working directory.
Chaoren Lin [Tue, 3 Mar 2015 20:11:48 +0000 (20:11 +0000)]
[TestGlobalVariables] LD_LIBRARY_PATH should be process working directory.

Summary:
The inferior can load the library now, but the remote test is still failing
because of a module loading problem in LLDB.

Reviewers: ovyalov, sivachandra, clayborg

Subscribers: lldb-commits

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

llvm-svn: 231120

9 years agoAllow declaration of map and multimap iterator with incomplete mapped type. Patch...
Eric Fiselier [Tue, 3 Mar 2015 20:10:01 +0000 (20:10 +0000)]
Allow declaration of map and multimap iterator with incomplete mapped type. Patch from eugenis

llvm-svn: 231119

9 years ago[PowerPC]Activate "vector bool long long" (and alternate spellings) as a valid type...
Bill Seurer [Tue, 3 Mar 2015 20:08:43 +0000 (20:08 +0000)]
[PowerPC]Activate "vector bool long long" (and alternate spellings) as a valid type for Altivec support for Power.

There are two test case updates for very basic testing. While I was editing cxx-altivec.cpp I also updated it to better match some other changes in altivec.c.

Note: "vector bool long" was not also added because its use is considered deprecated.

http://reviews.llvm.org/D7235

llvm-svn: 231118

9 years agoOutline cleanup handlers for native Windows C++ exception handling
Andrew Kaylor [Tue, 3 Mar 2015 20:00:16 +0000 (20:00 +0000)]
Outline cleanup handlers for native Windows C++ exception handling

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

llvm-svn: 231117

9 years agoAdd the following 64-bit vector integer arithmetic instructions added in POWER8:
Kit Barton [Tue, 3 Mar 2015 19:55:45 +0000 (19:55 +0000)]
Add the following 64-bit vector integer arithmetic instructions added in POWER8:

vaddudm
vsubudm
vmulesw
vmulosw
vmuleuw
vmulouw
vmuluwm
vmaxsd
vmaxud
vminsd
vminud
vcmpequd
vcmpequd.
vcmpgtsd
vcmpgtsd.
vcmpgtud
vcmpgtud.
vrld
vsld
vsrd
vsrad

Phabricator review: http://reviews.llvm.org/D7959

llvm-svn: 231115

9 years agoDeltaAlgorithm: Provide protected default copy ctor for use by test derived class.
David Blaikie [Tue, 3 Mar 2015 19:53:04 +0000 (19:53 +0000)]
DeltaAlgorithm: Provide protected default copy ctor for use by test derived class.

Without this, use of this copy ctor is deprecated in C++11 due to the
presence of a user-declared dtor.

Marking the class final is just a little extra security that there are
no further derived classes that may then end up using the intermediate
base class's copy assignment operator and cause slicing to occur.

I didn't bother marking the other (non-test) base class final, since it
has reference members so it won't have any implicit assignment operators
anyway. Open to ideas on that, though.

We probably want a warning about use of a slicing assignment operator,
then I wouldn't worry so much about marking the class as final.

llvm-svn: 231114

9 years agoRemove explicit no-op dtor in favor of the implicit dtor so as not to disable/depreca...
David Blaikie [Tue, 3 Mar 2015 19:53:02 +0000 (19:53 +0000)]
Remove explicit no-op dtor in favor of the implicit dtor so as not to disable/deprecate the copy operations.

llvm-svn: 231113

9 years agoRemove no-op dtor so that use of the implicit copy ctor/assignment operator are not...
David Blaikie [Tue, 3 Mar 2015 19:52:59 +0000 (19:52 +0000)]
Remove no-op dtor so that use of the implicit copy ctor/assignment operator are not deprecated.

llvm-svn: 231112

9 years agoAdd a comment above findRepresentativeClass explaining why it's
Eric Christopher [Tue, 3 Mar 2015 19:47:14 +0000 (19:47 +0000)]
Add a comment above findRepresentativeClass explaining why it's
where it is so that future generations can understand.

llvm-svn: 231111

9 years agoRemove explicit copy ctor in favor of the implicit one so that the use of the copy...
David Blaikie [Tue, 3 Mar 2015 19:29:14 +0000 (19:29 +0000)]
Remove explicit copy ctor in favor of the implicit one so that the use of the copy assignment operator is not deprecated.

llvm-svn: 231110

9 years agoRemove explicit copy assignment operator in favor of the implicit/default to avoid...
David Blaikie [Tue, 3 Mar 2015 19:29:13 +0000 (19:29 +0000)]
Remove explicit copy assignment operator in favor of the implicit/default to avoid disabling/deprecating the implicit copy ctor.

llvm-svn: 231109

9 years agoRemove explicit copy ctor in favor of the default so as not to disable/deprecate...
David Blaikie [Tue, 3 Mar 2015 19:29:11 +0000 (19:29 +0000)]
Remove explicit copy ctor in favor of the default so as not to disable/deprecate the implicit copy assignment operator

llvm-svn: 231108

9 years agoReduce header footprint of Target.h
Zachary Turner [Tue, 3 Mar 2015 19:23:09 +0000 (19:23 +0000)]
Reduce header footprint of Target.h

This continues the effort to reduce header footprint and improve
build speed by removing clang and other unnecessary headers
from Target.h.  In one case, some headers were included solely
for the purpose of declaring a nested class in Target, which was
not needed by anybody outside the class.  In this case the
definition and implementation of the nested class were isolated
in the .cpp file so the header could be removed.

llvm-svn: 231107

9 years agoSplit catch IRgen into ItaniumCXXABI and MicrosoftCXXABI
Reid Kleckner [Tue, 3 Mar 2015 19:21:04 +0000 (19:21 +0000)]
Split catch IRgen into ItaniumCXXABI and MicrosoftCXXABI

Use llvm.eh.begincatch for Microsoft-style catches.

This moves lots of CGException code into ItaniumCXXABI. Sorry for the
blame pain.

llvm-svn: 231105

9 years agounique_ptrify FullDependenceAnalysis::DV
David Blaikie [Tue, 3 Mar 2015 19:20:18 +0000 (19:20 +0000)]
unique_ptrify FullDependenceAnalysis::DV

Making this type a little harder to abuse (see workaround relating to
use of the implicit copy ctor in the prior commit)

llvm-svn: 231104

9 years agoFullDependenceAnalysis: Avoid using the (deprecated in C++11) copy ctor
David Blaikie [Tue, 3 Mar 2015 19:20:16 +0000 (19:20 +0000)]
FullDependenceAnalysis: Avoid using the (deprecated in C++11) copy ctor

llvm-svn: 231103

9 years agoRemove some explicit copy assignment operators is favor of implicit ones, as their...
David Blaikie [Tue, 3 Mar 2015 19:20:13 +0000 (19:20 +0000)]
Remove some explicit copy assignment operators is favor of implicit ones, as their presence makes the use of the implicit copy ctor deprecated in C++11

llvm-svn: 231102

9 years agoFix TestQuoting on remote targets.
Chaoren Lin [Tue, 3 Mar 2015 19:10:39 +0000 (19:10 +0000)]
Fix TestQuoting on remote targets.

Summary: Needed to transfer stdout.txt to host before reading.

Reviewers: ovyalov, clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 231101

9 years agoFix PR22750: non-determinism causes assertion failure in DWARF generation
Dario Domizioli [Tue, 3 Mar 2015 18:40:53 +0000 (18:40 +0000)]
Fix PR22750: non-determinism causes assertion failure in DWARF generation

The cause of the issue is the interaction of two factors:
1) When generating a DW_TAG_imported_declaration DIE which imports another
   imported declaration, the code in AsmPrinter/DwarfCompileUnit.cpp
   asserts that the second imported declaration must already have a DIE.
2) There is a non-determinism in the order in which imported declarations
   within the same scope are processed.
Because of the non-determinism (2), it is possible that an imported
declaration is processed before another one it depends on, breaking the
assumption in (1).

The source of the non-determinism is that the imported declaration
DIDescriptors are sorted by scope in DwarfDebug::beginModule(); however that
sort is not a stable_sort, therefore the order of the declarations within
the same scope is not preserved. The attached patch changes the std::sort to
a std::stable_sort and it fixes the problem.

Test omitted due to it being non-deterministic and depending on the
implementation of std::sort.

llvm-svn: 231100

9 years ago[Small]BitVector::reference: Explicitly default copy construction as it is deprecated...
David Blaikie [Tue, 3 Mar 2015 18:39:00 +0000 (18:39 +0000)]
[Small]BitVector::reference: Explicitly default copy construction as it is deprecated in C++11 in the presence of explicit copy assignment.

I tried making these private & friended to the BitVector, but that
didn't work - there's one use of BitVector::reference in Clang that
actually copies it into a local variable & uses it from there, rather
than just using the result of op[] in a temporary expression.

Whether or not this is desired is debatable (we could just fix that one
use in Clang) & it's not clear which way the C++ standard falls on this
for std::bitset's reference type (it has the same bug at least in
libstdc++, but Clang's -Wdeprecated doesn't flag it, because it's in a
standard header)

While it was only BitVector::reference's copy ctor that was referenced
by user code, I made SmallBitVector::reference's copy ctor public too,
for consistency.

llvm-svn: 231099

9 years agoDisable the right RUN line
Reid Kleckner [Tue, 3 Mar 2015 18:36:38 +0000 (18:36 +0000)]
Disable the right RUN line

llvm-svn: 231098

9 years agoDon't #include ClangASTContext.h from Module.h
Zachary Turner [Tue, 3 Mar 2015 18:34:26 +0000 (18:34 +0000)]
Don't #include ClangASTContext.h from Module.h

This is part of a larger effort to reduce header file footprints.
Combined, these patches reduce the build time of LLDB locally by
over 30%.  However, they touch many files and make many changes,
so will be submitted in small incremental pieces.

Reviewed By: Greg Clayton
Differential Revision: http://reviews.llvm.org/D8022

llvm-svn: 231097

9 years agoDisabled the other test from r231086 (like in r231087) since it also had problems
Filipe Cabecinhas [Tue, 3 Mar 2015 18:32:38 +0000 (18:32 +0000)]
Disabled the other test from r231086 (like in r231087) since it also had problems

llvm-svn: 231096

9 years agoAvoid explicitly declaring the copy assignment operator, as this unnecessarily makes...
David Blaikie [Tue, 3 Mar 2015 18:29:27 +0000 (18:29 +0000)]
Avoid explicitly declaring the copy assignment operator, as this unnecessarily makes the copy ctor deprecated in C++11

llvm-svn: 231095

9 years agoTwine: Explicitly default the copy ctor as it's otherwise deprecated in C++11 by...
David Blaikie [Tue, 3 Mar 2015 18:29:25 +0000 (18:29 +0000)]
Twine: Explicitly default the copy ctor as it's otherwise deprecated in C++11 by the presence of a user-declared copy assignment operator.

llvm-svn: 231094

9 years agoDenseMapIterator: Avoid explicitly declaring the copy ctor as this makes the copy...
David Blaikie [Tue, 3 Mar 2015 18:29:23 +0000 (18:29 +0000)]
DenseMapIterator: Avoid explicitly declaring the copy ctor as this makes the copy assignment operator deprecated in C++11

llvm-svn: 231093

9 years agoSupport __attribute__((availability)) on Android.
Dan Albert [Tue, 3 Mar 2015 18:28:38 +0000 (18:28 +0000)]
Support __attribute__((availability)) on Android.

Reviewers: srhines

Reviewed By: srhines

Subscribers: cfe-commits

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

llvm-svn: 231092

9 years agoDon't force -pie for Android.
Dan Albert [Tue, 3 Mar 2015 18:24:57 +0000 (18:24 +0000)]
Don't force -pie for Android.

Summary:
There is no -no-pie flag that can override this, so making it default
to being on for Android means it is no longer possible to create
non-PIE executables on Android. While current versions of Android
support (and the most recent requires) PIE, ICS and earlier versions
of Android cannot run PIE executables, so this needs to be optional.

Reviewers: srhines

Reviewed By: srhines

Subscribers: thakis, volkalexey, cfe-commits

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

llvm-svn: 231091

9 years agoMake Triple::getOSVersion make sense for Android.
Dan Albert [Tue, 3 Mar 2015 18:23:51 +0000 (18:23 +0000)]
Make Triple::getOSVersion make sense for Android.

Reviewers: srhines

Reviewed By: srhines

Subscribers: llvm-commits

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

llvm-svn: 231090

9 years agoUpdate Polly tests for the great metadata schema change
David Blaikie [Tue, 3 Mar 2015 18:17:26 +0000 (18:17 +0000)]
Update Polly tests for the great metadata schema change

llvm-svn: 231089

9 years ago80-column fixup.
Eric Christopher [Tue, 3 Mar 2015 17:54:39 +0000 (17:54 +0000)]
80-column fixup.

llvm-svn: 231088

9 years agoDisable a Clang test until the begincatch change lands
Reid Kleckner [Tue, 3 Mar 2015 17:51:26 +0000 (17:51 +0000)]
Disable a Clang test until the begincatch change lands

llvm-svn: 231087

9 years agoMake llvm.eh.begincatch use an outparam
Reid Kleckner [Tue, 3 Mar 2015 17:41:09 +0000 (17:41 +0000)]
Make llvm.eh.begincatch use an outparam

Ultimately, __CxxFrameHandler3 needs us to put a stack offset in a
table, and it will take responsibility for copying the exception object
into that slot. Modelling the exception object as an SSA value returned
by begincatch isn't going to work in general, so make it use an output
parameter.

Reviewers: andrew.w.kaylor

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

llvm-svn: 231086

9 years ago[AArch64] When combining constant mul of -3, prefer (sub x, (shl x, N)).
Chad Rosier [Tue, 3 Mar 2015 17:31:01 +0000 (17:31 +0000)]
[AArch64] When combining constant mul of -3, prefer (sub x, (shl x, N)).

This change only effects codegen when the constant is -3.

llvm-svn: 231085