platform/upstream/llvm.git
8 years agoFix bug in using shadow decl checking: a using shadow decl should not conflict
Richard Smith [Sat, 27 Feb 2016 02:36:43 +0000 (02:36 +0000)]
Fix bug in using shadow decl checking: a using shadow decl should not conflict
with a prior UsingDecl -- those should not even really be found by the lookup
here, except that we use the same lookup results for two different checks, and
the other check needs them.

This happens to work in *almost all* cases, because either the lookup results
list the UsingDecl first (and the NonTag result gets replaced by something
else) or because the problematic declaration is a function (which causes us to
use different logic to detect conflicts). This can also be triggered from a
state only reachable through modules (where the name lookup results can contain
multiple UsingDecls in the same scope).

llvm-svn: 262105

8 years ago[sancov] print_coverage_points command.
Mike Aizatsky [Sat, 27 Feb 2016 02:21:44 +0000 (02:21 +0000)]
[sancov] print_coverage_points command.

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

llvm-svn: 262104

8 years ago[sancov] do not instrument nodes that are full pre-dominators
Mike Aizatsky [Sat, 27 Feb 2016 02:10:27 +0000 (02:10 +0000)]
[sancov] do not instrument nodes that are full pre-dominators

Summary:
Without tree pruning clang has 2,667,552 points.
Wiht only dominators pruning: 1,515,586.
With both dominators & predominators pruning: 1,340,534.

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

llvm-svn: 262103

8 years ago[libFuzzer] speedup path coverage handling
Kostya Serebryany [Sat, 27 Feb 2016 01:50:16 +0000 (01:50 +0000)]
[libFuzzer] speedup path coverage handling

llvm-svn: 262102

8 years agoUpdate the fine-grain dependences analysis test case.
Hongbin Zheng [Sat, 27 Feb 2016 01:50:01 +0000 (01:50 +0000)]
Update the fine-grain dependences analysis test case.

llvm-svn: 262101

8 years agoEnable llvm's isa/cast/dyn_cast on MemAccInst.
Hongbin Zheng [Sat, 27 Feb 2016 01:49:58 +0000 (01:49 +0000)]
Enable llvm's isa/cast/dyn_cast on MemAccInst.

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

llvm-svn: 262100

8 years agoMinor code cleanup. NFC.
Junmo Park [Sat, 27 Feb 2016 01:10:43 +0000 (01:10 +0000)]
Minor code cleanup. NFC.

llvm-svn: 262096

8 years ago[InstCombine] Be more conservative about removing stackrestore
Reid Kleckner [Sat, 27 Feb 2016 00:53:54 +0000 (00:53 +0000)]
[InstCombine] Be more conservative about removing stackrestore

We ended up removing a save/restore pair around an inalloca call,
leading to a miscompile in Chromium.

llvm-svn: 262095

8 years ago[OpenMP] Fix parsing of delete map clause modifier in C++ mode.
Samuel Antao [Sat, 27 Feb 2016 00:01:58 +0000 (00:01 +0000)]
[OpenMP] Fix parsing of delete map clause modifier in C++ mode.

Summary: The map modifier 'delete' is parser in c++ mode as a delete keyword, which requires special handling in the map clause parsing.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

llvm-svn: 262094

8 years agoRevert r262092, caught LLD tests
Paul Robinson [Fri, 26 Feb 2016 23:44:10 +0000 (23:44 +0000)]
Revert r262092, caught LLD tests

llvm-svn: 262093

8 years ago[FileCheck] Abort if -NOT is combined with another suffix.
Paul Robinson [Fri, 26 Feb 2016 23:34:02 +0000 (23:34 +0000)]
[FileCheck] Abort if -NOT is combined with another suffix.
Combinations of suffixes that look useful actually are ignored;
complaining about them will avoid mistakes.

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

llvm-svn: 262092

8 years agoFix a bug in isVectorReductionOp() in SelectionDAGBuilder.cpp that may cause assertio...
Cong Hou [Fri, 26 Feb 2016 23:25:30 +0000 (23:25 +0000)]
Fix a bug in isVectorReductionOp() in SelectionDAGBuilder.cpp that may cause assertion failure on AArch64.

llvm-svn: 262091

8 years agoMake LLDB safer to use with respect to the global destructor chain.
Greg Clayton [Fri, 26 Feb 2016 23:20:08 +0000 (23:20 +0000)]
Make LLDB safer to use with respect to the global destructor chain.

llvm-svn: 262090

8 years ago[X86] Move an encoding test from CodeGen to MC. NFC.
Ahmed Bougacha [Fri, 26 Feb 2016 23:00:03 +0000 (23:00 +0000)]
[X86] Move an encoding test from CodeGen to MC. NFC.

llvm-svn: 262089

8 years ago[X86] Delete old redundant test. NFC.
Ahmed Bougacha [Fri, 26 Feb 2016 23:00:00 +0000 (23:00 +0000)]
[X86] Delete old redundant test. NFC.

llvm-svn: 262088

8 years ago[X86] Fix a stale comment. NFC.
Ahmed Bougacha [Fri, 26 Feb 2016 22:59:57 +0000 (22:59 +0000)]
[X86] Fix a stale comment. NFC.

llvm-svn: 262087

8 years ago[X86] Remove the unused SDTX86atomicBinary. NFC.
Ahmed Bougacha [Fri, 26 Feb 2016 22:59:41 +0000 (22:59 +0000)]
[X86] Remove the unused SDTX86atomicBinary. NFC.

llvm-svn: 262086

8 years ago[LVI] Extend select handling to catch min/max/clamp idioms
Philip Reames [Fri, 26 Feb 2016 22:53:59 +0000 (22:53 +0000)]
[LVI] Extend select handling to catch min/max/clamp idioms

Most of this is fairly straight forward. Add handling for min/max via existing matcher utility and ConstantRange routines.  Add handling for clamp by exploiting condition constraints on inputs.

Note that I'm only handling two constant ranges at this point. It would be reasonable to consider treating overdefined as a full range if the instruction is typed as an integer, but that should be a separate change.

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

llvm-svn: 262085

8 years ago[libFuzzer] add -print_final_stats=1 flag
Kostya Serebryany [Fri, 26 Feb 2016 22:42:23 +0000 (22:42 +0000)]
[libFuzzer] add -print_final_stats=1 flag

llvm-svn: 262084

8 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Fri, 26 Feb 2016 22:28:50 +0000 (22:28 +0000)]
Strip trailing whitespace. NFCI.

llvm-svn: 262083

8 years agoFix Clang-tidy modernize-use-nullptr warnings in remaining files in source/Plugins...
Eugene Zelenko [Fri, 26 Feb 2016 22:26:21 +0000 (22:26 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in remaining files in source/Plugins/ABI; other minor fixes.

llvm-svn: 262082

8 years agoRegister value is not necessarily scalar.
Chaoren Lin [Fri, 26 Feb 2016 22:12:35 +0000 (22:12 +0000)]
Register value is not necessarily scalar.

Reviewers: aidan.dodds, mamai

Subscribers: lldb-commits

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

llvm-svn: 262081

8 years ago[ConstantRange] Add umin/smin operators
Philip Reames [Fri, 26 Feb 2016 22:08:18 +0000 (22:08 +0000)]
[ConstantRange] Add umin/smin operators

This was split off from http://reviews.llvm.org/D17184.

Reviewed by: Sanjoy

llvm-svn: 262080

8 years ago[PPC] Legalize FNEG on PPC when possible
Kit Barton [Fri, 26 Feb 2016 21:59:44 +0000 (21:59 +0000)]
[PPC] Legalize FNEG on PPC when possible

Currently we always expand ISD::FNEG. For v4f32 and v2f64 vector types VSX has
native support for this opcode

Phabricator: http://reviews.llvm.org/D17647
llvm-svn: 262079

8 years agoFix spelling. NFCI.
Simon Pilgrim [Fri, 26 Feb 2016 21:56:27 +0000 (21:56 +0000)]
Fix spelling. NFCI.

llvm-svn: 262078

8 years ago[x86, InstCombine] transform x86 AVX2 masked stores to LLVM intrinsics
Sanjay Patel [Fri, 26 Feb 2016 21:51:44 +0000 (21:51 +0000)]
[x86, InstCombine] transform x86 AVX2 masked stores to LLVM intrinsics

Replicate everything for integers...because x86.

Continuation of:
http://reviews.llvm.org/rL262064

llvm-svn: 262077

8 years agoReport duplicated symbols in bitcode.
Rafael Espindola [Fri, 26 Feb 2016 21:49:38 +0000 (21:49 +0000)]
Report duplicated symbols in bitcode.

llvm-svn: 262076

8 years ago[libFuzzer] initial implementation of path coverage based on -fsanitize-coverage...
Kostya Serebryany [Fri, 26 Feb 2016 21:33:56 +0000 (21:33 +0000)]
[libFuzzer] initial implementation of path coverage based on -fsanitize-coverage=trace-pc. This does not scale well yet, but already cracks FullCoverageSetTest in seconds

llvm-svn: 262073

8 years agoMake SymbolBodies private.
Rafael Espindola [Fri, 26 Feb 2016 21:31:34 +0000 (21:31 +0000)]
Make SymbolBodies private.

This makes BitcodeFile a bit closer to ObjectFile.

If anyone prefers I can go the other way and delete getSymbols from
ObjectFile.

llvm-svn: 262072

8 years ago[CMake] Only configure Native target in stage 1, configure all in other stages
Chris Bieneman [Fri, 26 Feb 2016 21:23:59 +0000 (21:23 +0000)]
[CMake] Only configure Native target in stage 1, configure all in other stages

This patch causes the 3-stage build pipeline to only build a host compiler in the first stage, and to build all targets for subsequent stages. The host target is determined via the Native target specifier added in r262070.

llvm-svn: 262071

8 years ago[CMake] Allow LLVM_TARGETS_TO_BUILD to accept "Native"
Chris Bieneman [Fri, 26 Feb 2016 21:21:40 +0000 (21:21 +0000)]
[CMake] Allow LLVM_TARGETS_TO_BUILD to accept "Native"

This allows a user to specify "Native" as a target when configuring LLVM. Native will resolve to the LLVM_NATIVE_ARCH, which is the target that supports code generation for the host.

llvm-svn: 262070

8 years agoReapply r262054 with triple fix.
Paul Robinson [Fri, 26 Feb 2016 21:18:34 +0000 (21:18 +0000)]
Reapply r262054 with triple fix.

llvm-svn: 262069

8 years agoPower9] Implement new vsx instructions: compare and conversion
Kit Barton [Fri, 26 Feb 2016 21:11:55 +0000 (21:11 +0000)]
Power9] Implement new vsx instructions: compare and conversion
This change implements the following vsx instructions:

Quad/Double-Precision Compare:
xscmpoqp xscmpuqp
xscmpexpdp xscmpexpqp
xscmpeqdp xscmpgedp xscmpgtdp xscmpnedp
xvcmpnedp(.) xvcmpnesp(.)
Quad-Precision Floating-Point Conversion
xscvqpdp(o) xscvdpqp
xscvqpsdz xscvqpswz xscvqpudz xscvqpuwz xscvsdqp xscvudqp
xscvdphp xscvhpdp xvcvhpsp xvcvsphp
xsrqpi xsrqpix xsrqpxp
28 instructions

Phabricator: http://reviews.llvm.org/D16709
llvm-svn: 262068

8 years ago[CMake] Add the gold plugin before clang
Chris Bieneman [Fri, 26 Feb 2016 21:07:04 +0000 (21:07 +0000)]
[CMake] Add the gold plugin before clang

This is needed to connect dependencies between the LLVMgold plugin and the clang stage-2 builds due to limitations in ExternalProject_Add.

Patch by Mike Edwards

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

llvm-svn: 262067

8 years ago[CMake] Assigning the LTO component to lto.h
Chris Bieneman [Fri, 26 Feb 2016 21:07:02 +0000 (21:07 +0000)]
[CMake] Assigning the LTO component to lto.h

This makes it so lto.h is installed when you run the install-LTO target.

llvm-svn: 262066

8 years ago[CMake] Add BINUTILS_INCDIR to the default passthrough list for multi-stage builds
Chris Bieneman [Fri, 26 Feb 2016 21:04:41 +0000 (21:04 +0000)]
[CMake] Add BINUTILS_INCDIR to the default passthrough list for multi-stage builds

This is needed to build the gold plugin in multi-stage builds.

Patch by Mike Edwards

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

llvm-svn: 262065

8 years ago[x86, InstCombine] transform x86 AVX masked stores to LLVM intrinsics
Sanjay Patel [Fri, 26 Feb 2016 21:04:14 +0000 (21:04 +0000)]
[x86, InstCombine] transform x86 AVX masked stores to LLVM intrinsics

The intended effect of this patch in conjunction with:
http://reviews.llvm.org/rL259392
http://reviews.llvm.org/rL260145

is that customers using the AVX intrinsics in C will benefit from combines when
the store mask is constant:

void mstore_zero_mask(float *f, __m128 v) {
  _mm_maskstore_ps(f, _mm_set1_epi32(0), v);
}

void mstore_fake_ones_mask(float *f, __m128 v) {
  _mm_maskstore_ps(f, _mm_set1_epi32(1), v);
}

void mstore_ones_mask(float *f, __m128 v) {
  _mm_maskstore_ps(f, _mm_set1_epi32(0x80000000), v);
}

void mstore_one_set_elt_mask(float *f, __m128 v) {
  _mm_maskstore_ps(f, _mm_set_epi32(0x80000000, 0, 0, 0), v);
}

...so none of the above will actually generate a masked store for optimized code.

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

llvm-svn: 262064

8 years ago[CMake] Fix a typo in add_compiler_rt_library.
Alexey Samsonov [Fri, 26 Feb 2016 20:59:40 +0000 (20:59 +0000)]
[CMake] Fix a typo in add_compiler_rt_library.

llvm-svn: 262063

8 years ago[x86] refactor to eliminate duplicated code; NFCI
Sanjay Patel [Fri, 26 Feb 2016 20:59:05 +0000 (20:59 +0000)]
[x86] refactor to eliminate duplicated code; NFCI

llvm-svn: 262062

8 years agoFix warning in DwarfCFIException. NFC
Amaury Sechet [Fri, 26 Feb 2016 20:49:07 +0000 (20:49 +0000)]
Fix warning in DwarfCFIException. NFC

llvm-svn: 262061

8 years agoRevert r262054 on one file that fails sometimes.
Paul Robinson [Fri, 26 Feb 2016 20:41:07 +0000 (20:41 +0000)]
Revert r262054 on one file that fails sometimes.

llvm-svn: 262060

8 years agoExtract the method to begin and end a fragment in AsmPrinterHandler in their own...
Amaury Sechet [Fri, 26 Feb 2016 20:30:37 +0000 (20:30 +0000)]
Extract the method to begin and end a fragment in AsmPrinterHandler in their own method. NFC

Summary: This is extracted from D17555

Reviewers: davidxl, reames, sanjoy, MatzeB, pete

Subscribers: llvm-commits

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

llvm-svn: 262058

8 years ago[GlobalISel] Fix a ranlib warning about empty TOC.
Quentin Colombet [Fri, 26 Feb 2016 20:05:02 +0000 (20:05 +0000)]
[GlobalISel] Fix a ranlib warning about empty TOC.

Fixes PR26733

llvm-svn: 262057

8 years ago[dllexport] Sort out emission order of delayed exported classes
Reid Kleckner [Fri, 26 Feb 2016 19:51:02 +0000 (19:51 +0000)]
[dllexport] Sort out emission order of delayed exported classes

Relands r260194 with a fix. If we have a template that transitions from
an extern template to an explicitly instantiated dllexport template, we
would add that class to the delayed exported class list without flushing
it.

For explicit instantiations, we can just flush the list of delayed
classes immediately. We don't have to worry about the bug fixed in
r260194 in this case because explicit instantiations can only occur at
file and namespace scope.

Fixes PR26490.

llvm-svn: 262056

8 years agoMake sure to #include <atomic> for the std::atomic<bool> that was recently added.
Greg Clayton [Fri, 26 Feb 2016 19:41:49 +0000 (19:41 +0000)]
Make sure to #include <atomic> for the std::atomic<bool> that was recently added.

llvm-svn: 262055

8 years agoFix tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
Paul Robinson [Fri, 26 Feb 2016 19:40:34 +0000 (19:40 +0000)]
Fix tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
FileCheck actually doesn't support combo suffixes.

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

llvm-svn: 262054

8 years agoMake sure the Target, Process and Thread GetGlobalProperties() static methods are...
Greg Clayton [Fri, 26 Feb 2016 19:38:18 +0000 (19:38 +0000)]
Make sure the Target, Process and Thread GetGlobalProperties() static methods are thread safe.

<rdar://problem/22595283>

llvm-svn: 262053

8 years agoFix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
Paul Robinson [Fri, 26 Feb 2016 19:34:01 +0000 (19:34 +0000)]
Fix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
FileCheck actually doesn't support combo suffixes.

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

llvm-svn: 262052

8 years agoSymbolFileDWARFDebugMap::FindTypes didn't obey the max_matches flag,
Jim Ingham [Fri, 26 Feb 2016 19:33:11 +0000 (19:33 +0000)]
SymbolFileDWARFDebugMap::FindTypes didn't obey the max_matches flag,
but kept looking through .o files even after it had found as many
matches as were requested.

llvm-svn: 262051

8 years agoSemaCXX: Support templates in availability attributes
Duncan P. N. Exon Smith [Fri, 26 Feb 2016 19:27:00 +0000 (19:27 +0000)]
SemaCXX: Support templates in availability attributes

If the availability context is `FunctionTemplateDecl`, we should look
through it to the `FunctionDecl`.  This prevents a diagnostic in the
following case:

    class C __attribute__((unavailable));
    template <class T> void foo(C&) __attribute__((unavailable));

This adds tests for availability in templates in many other cases, but
that was the only case that failed before this patch.

I added a feature `__has_feature(attribute_availability_in_templates)`
so users can test for this.

rdar://problem/24561029

llvm-svn: 262050

8 years agoFix Sparc 32bit Lowering to rebundle up v2i32 values.
Nirav Dave [Fri, 26 Feb 2016 18:55:22 +0000 (18:55 +0000)]
Fix Sparc 32bit Lowering to rebundle up v2i32 values.

Summary: Fix LowerCall to rebundle v2i32 values after lowering and add testcase

Reviewers: jyknight

Subscribers: llvm-commits, jyknight

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

llvm-svn: 262048

8 years ago[x86, AVX] fold 'isPositive' 256-bit vector integer operations (PR26701)
Sanjay Patel [Fri, 26 Feb 2016 18:42:50 +0000 (18:42 +0000)]
[x86, AVX] fold 'isPositive' 256-bit vector integer operations (PR26701)

This extends the fold introduced with:
http://reviews.llvm.org/rL262036

llvm-svn: 262047

8 years agotsan: revert r262037
Dmitry Vyukov [Fri, 26 Feb 2016 18:26:48 +0000 (18:26 +0000)]
tsan: revert r262037

Broke aarch64 and darwin bots.

llvm-svn: 262046

8 years ago[IR] Optimize bitfield layout of Value for MSVC
Reid Kleckner [Fri, 26 Feb 2016 18:08:59 +0000 (18:08 +0000)]
[IR] Optimize bitfield layout of Value for MSVC

This should save a pointer of padding from all MSVC Value subclasses.

Recall that MSVC will not pack the following bitfields together:
  unsigned Bits : 29;
  unsigned Flag1 : 1;
  unsigned Flag2 : 1;
  unsigned Flag3 : 1;

Add a static_assert because LLVM developers always trip over this
behavior. This regressed in June.

llvm-svn: 262045

8 years ago[x86, AVX] add 256-bit tests
Sanjay Patel [Fri, 26 Feb 2016 18:07:58 +0000 (18:07 +0000)]
[x86, AVX] add 256-bit tests

llvm-svn: 262044

8 years agoremove unused local string in IRForTarget.cpp
Aidan Dodds [Fri, 26 Feb 2016 18:03:06 +0000 (18:03 +0000)]
remove unused local string in IRForTarget.cpp

Committed on behalf of: ldrumm <luke.drummond@codeplay.com>

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

llvm-svn: 262043

8 years agoMinor tweak to match the overall style.
Sunil Srivastava [Fri, 26 Feb 2016 18:01:12 +0000 (18:01 +0000)]
Minor tweak to match the overall style.

llvm-svn: 262042

8 years agoFix bug with register values byte order in expression evaluation.
Aidan Dodds [Fri, 26 Feb 2016 17:40:50 +0000 (17:40 +0000)]
Fix bug with register values byte order in expression evaluation.

The evaluation of expressions containing register values was broken for targets for which endianness differs from host.

Committed on behalf of: mamai <marianne.mailhot.sarrasin@gmail.com>

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

llvm-svn: 262041

8 years agoThe IOHandlerProcessSTDIO is the _only_ IOHandler that gets pushed and popped from...
Greg Clayton [Fri, 26 Feb 2016 17:36:44 +0000 (17:36 +0000)]
The IOHandlerProcessSTDIO is the _only_ IOHandler that gets pushed and popped from functions that are run due to something that is NOT input from the user. All other IOHandler objects result from input from the user. An issue rose up where if a command caused the process to resume and stop and process state changed, where state changed Event objects were broadcast, it would cause the IOHandlerProcessSTDIO to have its IOHandlerProcessSTDIO::Cancel() function called. This used to always write a byte to the control pipe (IOHandlerProcessSTDIO::m_pipe) even if the IOHandlerProcessSTDIO::Run() was never called. What would happen is:

(lldb) command_that_steps_process_thousands_of_times

As the "command_that_steps_process_thousands_of_times" could be a python command that resumed the process thousands of times and in doing so the IOHandlerProcessSTDIO would get pushed when the process resumed, and popped when it stoppped, causing the call to IOHandlerProcessSTDIO::Cancel(). Since the IOHandler thread is currently in IOHandlerEditline::Run() for the command interpreter handling the "command_that_steps_process_thousands_of_times" command, IOHandlerProcessSTDIO::Run() would never get called, even though the IOHandlerProcessSTDIO is on the top of the stack. This caused the command pipe to keep getting 1 bytes written each time the IOHandlerProcessSTDIO::Cancel() was called and eventually we will deadlock since the write buffer is full.

The fix here is to make sure we are in IOHandlerProcessSTDIO::Run() before we write anything to the command pipe, and just call SetIsDone(true) if we are not.

<rdar://problem/22361364>

llvm-svn: 262040

8 years agoIntroduce fine-grain dependence analysis by tagging access functions and schedules...
Hongbin Zheng [Fri, 26 Feb 2016 17:05:24 +0000 (17:05 +0000)]
Introduce fine-grain dependence analysis by tagging access functions and schedules tree with either the id of memory access or memory references.

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

llvm-svn: 262039

8 years ago[CMAKE] Update build on recent Haiku
Renato Golin [Fri, 26 Feb 2016 17:01:45 +0000 (17:01 +0000)]
[CMAKE] Update build on recent Haiku

This patch updates cmake build scripts to build on Haiku. It adds Haiku x86_64 to config.guess.
Please consider reviewing.

Pathc by Jérôme Duval.

llvm-svn: 262038

8 years agotsan: split thread into logical and physical state
Dmitry Vyukov [Fri, 26 Feb 2016 16:57:14 +0000 (16:57 +0000)]
tsan: split thread into logical and physical state

Currently ThreadState holds both logical state (required for race-detection algorithm, user-visible)
and physical state (various caches, most notably malloc cache). Move physical state in a new
Process entity. Besides just being the right thing from abstraction point of view, this solves several
problems:
1. Cache everything on P level in Go. Currently we cache on a mix of goroutine and OS thread levels.
This unnecessary increases memory consumption.
2. Properly handle free operations in Go. Frees are issue by GC which don't have goroutine context.
As the result we could not do anything more than just clearing shadow. For example, we leaked
sync objects and heap block descriptors.
3. This will allow to get rid of libc malloc in Go (now we have Processor context for internal allocator cache).
This in turn will allow to get rid of dependency on libc entirely.
4. Potentially we can make Processor per-CPU in C++ mode instead of per-thread, which will
reduce resource consumption.
The distinction between Thread and Processor is currently used only by Go, C++ creates Processor per OS thread,
which is equivalent to the current scheme.

llvm-svn: 262037

8 years ago[x86, SSE] fold 'isPositive' vector integer operations (PR26701)
Sanjay Patel [Fri, 26 Feb 2016 16:56:03 +0000 (16:56 +0000)]
[x86, SSE] fold 'isPositive' vector integer operations (PR26701)

This is one of the cases shown in:
https://llvm.org/bugs/show_bug.cgi?id=26701

Shift and negate is what InstCombine appears to prefer, so I've started with that pattern.
Note that the 'pcmpeq' instructions are always generating the negative one for the actual
'pcmpgt' comparison in each case (side note: why isn't there an alias mnemonic for that?).

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

llvm-svn: 262036

8 years ago[WinEH] Fix funclet return block clobber mask placement
Reid Kleckner [Fri, 26 Feb 2016 16:53:19 +0000 (16:53 +0000)]
[WinEH] Fix funclet return block clobber mask placement

MBB slot index intervals are half open, not closed. getMBBEndIndex()
returns the slot index of the start of the next block in layout order.
Placing a register mask there is incorrect if the successor of the
funclet return is not laid out after the return. Clang generates IR for
catch bodies before generating the following normal code, so we never
noticed this issue until the D frontend authors filed a bug about it.

Instead, we can put the clobber mask on the last instruction of the
funclet return block. We still aren't using a register mask operand on
the CATCHRET instruction because it would cause PEI to spill all CSRs,
including XMM regs, in the prologue.

Fixes PR26679.

llvm-svn: 262035

8 years agoFix broken buildbots.
Rui Ueyama [Fri, 26 Feb 2016 16:49:54 +0000 (16:49 +0000)]
Fix broken buildbots.

llvm-svn: 262034

8 years agoScopDetect/Info: Add option to disable invariant load hoisting
Tobias Grosser [Fri, 26 Feb 2016 16:43:35 +0000 (16:43 +0000)]
ScopDetect/Info: Add option to disable invariant load hoisting

This is helpful for test case reduction and other experiments.

llvm-svn: 262033

8 years agoScopDetection: Fix mix-up of isLoad and isStore.
Michael Kruse [Fri, 26 Feb 2016 16:40:35 +0000 (16:40 +0000)]
ScopDetection: Fix mix-up of isLoad and isStore.

This was accidentally introduced in r258947.

Thanks to Hongbin Zheng for finding this.

Found-by: etherzhhb
llvm-svn: 262032

8 years agoSimplify. NFC.
Rui Ueyama [Fri, 26 Feb 2016 16:38:39 +0000 (16:38 +0000)]
Simplify. NFC.

Regarding the comment, it is out of context because it describes
what it does not do there. It got too long because it was originally
two different comments that were simply merged together.
The semantics is described in fixAbsoluteSymbols, so we don't need it.

llvm-svn: 262031

8 years agoBasic: fix __USER_LABEL_PREFIX__ on Cygwin
Saleem Abdulrasool [Fri, 26 Feb 2016 16:34:01 +0000 (16:34 +0000)]
Basic: fix __USER_LABEL_PREFIX__ on Cygwin

Adjust the user label prefix for cygwin x86_64.

Resolves PR26744.

llvm-svn: 262030

8 years agoReduce indention. NFC.
Michael Kruse [Fri, 26 Feb 2016 16:08:24 +0000 (16:08 +0000)]
Reduce indention. NFC.

The functions buildAccessMultiDimFixed and buildAccessMultiDimParam were
refactored from buildMemoryAccess. In their own functions, the control
flow can be shortcut and simplified using returns.

Suggested-by: etherzhhb
llvm-svn: 262029

8 years agoAdd new java plugin files to the xcode project
Tamas Berghammer [Fri, 26 Feb 2016 15:47:35 +0000 (15:47 +0000)]
Add new java plugin files to the xcode project

llvm-svn: 262028

8 years agoSimplify. NFC.
Rui Ueyama [Fri, 26 Feb 2016 15:42:06 +0000 (15:42 +0000)]
Simplify. NFC.

llvm-svn: 262027

8 years agoAdd comment on AMDGPU that the difference has no obvious reason.
Rui Ueyama [Fri, 26 Feb 2016 15:39:26 +0000 (15:39 +0000)]
Add comment on AMDGPU that the difference has no obvious reason.

llvm-svn: 262026

8 years agoReduce false positives in printf/scanf format checker
Andy Gibbs [Fri, 26 Feb 2016 15:35:16 +0000 (15:35 +0000)]
Reduce false positives in printf/scanf format checker

Summary:
The printf/scanf format checker is a little over-zealous in handling the conditional operator.  This patch reduces work by not checking code-paths that are never used and reduces false positives regarding uncovered arguments, for example in the code fragment:

printf(minimal ? "%i\n" : "%i: %s\n", code, msg);

Reviewers: rtrieu

Subscribers: cfe-commits

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

llvm-svn: 262025

8 years ago[clang-tidy] Fix an assertion failure in `modernize-use-nullptr` check.
Haojian Wu [Fri, 26 Feb 2016 15:34:35 +0000 (15:34 +0000)]
[clang-tidy] Fix an assertion failure in `modernize-use-nullptr` check.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 262024

8 years agoRevert part of rL262014 as it caused issues on gcc-i386
Tamas Berghammer [Fri, 26 Feb 2016 15:33:32 +0000 (15:33 +0000)]
Revert part of rL262014 as it caused issues on gcc-i386

llvm-svn: 262023

8 years agoFix unsafe dereference.
Rui Ueyama [Fri, 26 Feb 2016 15:13:24 +0000 (15:13 +0000)]
Fix unsafe dereference.

Bound may point to one element beyond the end of the
vector, so *Bound is not safe.

llvm-svn: 262022

8 years agoAdd mips32 software breakpoints into platform::GetSoftwareBreakpointTrapOpcode().
Aidan Dodds [Fri, 26 Feb 2016 15:11:01 +0000 (15:11 +0000)]
Add mips32 software breakpoints into platform::GetSoftwareBreakpointTrapOpcode().

The software breakpoint definitions for mips32 should have been included in my
recent patch that moved the software breakpoint definitions into the base platform
class.

llvm-svn: 262021

8 years ago[ELF] - Implemented linkerscript sections padding.
George Rimar [Fri, 26 Feb 2016 14:48:31 +0000 (14:48 +0000)]
[ELF] - Implemented linkerscript sections padding.

BSD linker scripts contain special cases to add NOP
padding to code sections. Syntax is next:

.init:
 {
   KEEP (*(.init))
 } =0x90909090
(0x90 is NOP)

This patch implements that functionality.

llvm-svn: 262020

8 years agoDescription of symbols is avalable here:
George Rimar [Fri, 26 Feb 2016 14:36:36 +0000 (14:36 +0000)]
Description of symbols is avalable here:
https://docs.oracle.com/cd/E53394_01/html/E54766/u-etext-3c.html

It is said that:
_etext - The address of _etext is the first
location after the last read-only loadable segment.

_edata - The address of _edata is the first
location after the last read-write loadable segment.

_end - If the address of _edata is greater than the address
of _etext, the address of _end is same as the address of _edata.

In real life _end and _edata has different values for that case.
Both gold/bfd set _edata to the end of the last non SHT_NOBITS section.
This patch do the same for consistency.

It should fix the https://llvm.org/bugs/show_bug.cgi?id=26729.

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

llvm-svn: 262019

8 years agoRefactor multiple calls to canBePreempted.
Rafael Espindola [Fri, 26 Feb 2016 14:33:23 +0000 (14:33 +0000)]
Refactor multiple calls to canBePreempted.

llvm-svn: 262018

8 years agoFix some confusion about what can be preempted.
Rafael Espindola [Fri, 26 Feb 2016 14:27:47 +0000 (14:27 +0000)]
Fix some confusion about what can be preempted.

For shared libraries we allow any weak undefined symbol to eventually be
resolved, even if we never see a definition in another .so. This matches
the behavior when handling other undefined symbols in a shared library.

For executables, we require seeing a definition in a .so or resolve it
to zero. This is also similar to how non weak symbols are handled.

llvm-svn: 262017

8 years agoFix address class lookup for absolute symbols
Tamas Berghammer [Fri, 26 Feb 2016 14:21:27 +0000 (14:21 +0000)]
Fix address class lookup for absolute symbols

llvm-svn: 262016

8 years agoAdd a set of new plugins to handle Java debugging
Tamas Berghammer [Fri, 26 Feb 2016 14:21:23 +0000 (14:21 +0000)]
Add a set of new plugins to handle Java debugging

The purpose of these plugins is to make LLDB capable of debugging java
code JIT-ed by the android runtime.

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

llvm-svn: 262015

8 years agoAdd support for DW_OP_push_object_address in dwarf expressions
Tamas Berghammer [Fri, 26 Feb 2016 14:21:10 +0000 (14:21 +0000)]
Add support for DW_OP_push_object_address in dwarf expressions

Additionally fix the type of some dwarf expression where we had a
confusion between scalar and load address types after a dereference.

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

llvm-svn: 262014

8 years agoFixing an issue with the code block so that it does not appear as a list.
Aaron Ballman [Fri, 26 Feb 2016 13:39:38 +0000 (13:39 +0000)]
Fixing an issue with the code block so that it does not appear as a list.

llvm-svn: 262013

8 years agoGiving this attribute documentation group a heading; fixes a documentation generation...
Aaron Ballman [Fri, 26 Feb 2016 13:30:58 +0000 (13:30 +0000)]
Giving this attribute documentation group a heading; fixes a documentation generation error.

llvm-svn: 262012

8 years ago[LLDB][MIPS] Fix TestInferiorAssert.py for MIPS
Sagar Thakur [Fri, 26 Feb 2016 13:30:34 +0000 (13:30 +0000)]
[LLDB][MIPS] Fix TestInferiorAssert.py for MIPS

Patch by Nitesh Jain.

Summary: The debug version of libc.so is require for backtracing which may not be available on all platforms.

Reviewers: ovyalov, clayborg
Subscribers: zturner, lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: http://reviews.llvm.org/D17131
llvm-svn: 262011

8 years agoBlockGenerators: Allow values to be removed from ScalarMap
Tobias Grosser [Fri, 26 Feb 2016 13:27:02 +0000 (13:27 +0000)]
BlockGenerators: Allow values to be removed from ScalarMap

This function is not yet used in Polly, but is useful to external projects that
generate multi-module code using Polly.

llvm-svn: 262010

8 years agoIslAst: Expose run-time check generation as individual function
Tobias Grosser [Fri, 26 Feb 2016 12:59:38 +0000 (12:59 +0000)]
IslAst: Expose run-time check generation as individual function

This allows to construct run-time checks for a scop without having to generate
a full AST. This is currently not taken advantage of in Polly itself, but
external users may benefit from this feature.

llvm-svn: 262009

8 years ago[PM] Finish removing references to fix MSVC builds. Somehow adding base
Chandler Carruth [Fri, 26 Feb 2016 12:30:18 +0000 (12:30 +0000)]
[PM] Finish removing references to fix MSVC builds. Somehow adding base
classes changed whether the decltype of these expressions was
a reference. I'm somewhat horrified why, and there may need to be
a deeper fix on MSVC, but this should at least get the bots a step
further.

llvm-svn: 262008

8 years agoReverting breaking change. Sorry.
Chris Dewhurst [Fri, 26 Feb 2016 12:20:10 +0000 (12:20 +0000)]
Reverting breaking change. Sorry.

llvm-svn: 262007

8 years ago[PM] Speculative patch to try and fix MSVC's compilation.
Chandler Carruth [Fri, 26 Feb 2016 12:17:54 +0000 (12:17 +0000)]
[PM] Speculative patch to try and fix MSVC's compilation.

No idea why r262004 triggered this, but just trying to fix somehow.

llvm-svn: 262006

8 years agoReviewed at reviews.llvm.org/D17133
Chris Dewhurst [Fri, 26 Feb 2016 11:46:47 +0000 (11:46 +0000)]
Reviewed at reviews.llvm.org/D17133

llvm-svn: 262005

8 years ago[PM] Introduce CRTP mixin base classes to help define passes and
Chandler Carruth [Fri, 26 Feb 2016 11:44:45 +0000 (11:44 +0000)]
[PM] Introduce CRTP mixin base classes to help define passes and
analyses in the new pass manager.

These just handle really basic stuff: turning a type name into a string
statically that is nice to print in logs, and getting a static unique ID
for each analysis.

Sadly, the format of passes in anonymous namespaces makes using their
names in tests really annoying so I've customized the names of the no-op
passes to keep tests sane to read.

This is the first of a few simplifying refactorings for the new pass
manager that should reduce boilerplate and confusion.

llvm-svn: 262004

8 years agoInitial test commit only
Chris Dewhurst [Fri, 26 Feb 2016 11:38:24 +0000 (11:38 +0000)]
Initial test commit only

llvm-svn: 262003

8 years agoUpdate to isl-0.16.1-68-g8fad211
Tobias Grosser [Fri, 26 Feb 2016 11:35:12 +0000 (11:35 +0000)]
Update to isl-0.16.1-68-g8fad211

This commit updates to the latest isl development version. There is no specific
feature we need on the Polly side, but we want to ensure test coverage for the
latest isl changes.

llvm-svn: 262001

8 years agoUse relative lines in CHECKs in race_on_mutex.c
Alexander Kornienko [Fri, 26 Feb 2016 11:09:32 +0000 (11:09 +0000)]
Use relative lines in CHECKs in race_on_mutex.c

llvm-svn: 262000

8 years agoTest commit.
Vassil Vassilev [Fri, 26 Feb 2016 10:43:34 +0000 (10:43 +0000)]
Test commit.

llvm-svn: 261999

8 years ago[clang-tidy] Minor change in the doc
Alexander Kornienko [Fri, 26 Feb 2016 10:24:29 +0000 (10:24 +0000)]
[clang-tidy] Minor change in the doc

llvm-svn: 261998