platform/upstream/llvm.git
8 years agoThe patch adds missing registers and instructions to complete all the registers suppo...
Chris Dewhurst [Sat, 27 Feb 2016 12:49:59 +0000 (12:49 +0000)]
The patch adds missing registers and instructions to complete all the registers supported by the Sparc v8 manual.
These are all co-processor registers, with the exception of the floating-point deferred-trap queue register.
Although these will not be lowered automatically by any instructions, it allows the use of co-processor
instructions implemented by inline-assembly.

Code Reviewed at http://reviews.llvm.org/D17133, with the exception of a very small change in brace placement in SparcInstrInfo.td,
which was formerly causing a problem in the disassembly of the %fq register.

llvm-svn: 262133

8 years ago[X86][AVX] Added AVX1 target shuffle combine tests
Simon Pilgrim [Sat, 27 Feb 2016 12:33:08 +0000 (12:33 +0000)]
[X86][AVX] Added AVX1 target shuffle combine tests

llvm-svn: 262132

8 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Sat, 27 Feb 2016 11:49:16 +0000 (11:49 +0000)]
Strip trailing whitespace. NFCI.

llvm-svn: 262131

8 years ago[PM] Loosen the regex for the proxy template name even further to cope
Chandler Carruth [Sat, 27 Feb 2016 11:07:16 +0000 (11:07 +0000)]
[PM] Loosen the regex for the proxy template name even further to cope
with 'class' keywords in the template arguments and other silliness.

llvm-svn: 262130

8 years ago[PM] Use a boring regex instead of explicitly naming the analysis
Chandler Carruth [Sat, 27 Feb 2016 10:48:14 +0000 (10:48 +0000)]
[PM] Use a boring regex instead of explicitly naming the analysis
manager as some compilers print the typedef name and others print the
"canonical" name of the underlying class template.

This isn't really an important artifact of the test anyways so it seems
fine to just loosen the test assertions here.

llvm-svn: 262129

8 years ago[PM] Provide explicit instantiation declarations and definitions for the
Chandler Carruth [Sat, 27 Feb 2016 10:45:35 +0000 (10:45 +0000)]
[PM] Provide explicit instantiation declarations and definitions for the
PassManager and AnalysisManager template specializations as well.

llvm-svn: 262128

8 years ago[PM] Provide two templates for the two directionalities of analysis
Chandler Carruth [Sat, 27 Feb 2016 10:38:10 +0000 (10:38 +0000)]
[PM] Provide two templates for the two directionalities of analysis
manager proxies and use those rather than repeating their definition
four times.

There are real differences between the two directions: outer AMs are
const and don't need to have invalidation tracked. But every proxy in
a particular direction is identical except for the analysis manager type
and the IR unit they proxy into. This makes them prime candidates for
nice templates.

I've started introducing explicit template instantiation declarations
and definitions as well because we really shouldn't be emitting all this
everywhere. I'm going to go back and add the same for the other
templates like this in a follow-up patch.

I've left the analysis manager as an opaque type rather than using two
IR units and requiring it to be an AnalysisManager template
specialization. I think its important that users retain the ability to
provide their own custom analysis management layer and provided it has
the appropriate API everything should Just Work.

llvm-svn: 262127

8 years agoAMDGPU: Add builtins for recently added intrinsics
Matt Arsenault [Sat, 27 Feb 2016 09:54:43 +0000 (09:54 +0000)]
AMDGPU: Add builtins for recently added intrinsics

llvm-svn: 262126

8 years agoDAGCombiner: Relax sqrt NaN folding check
Matt Arsenault [Sat, 27 Feb 2016 09:38:05 +0000 (09:38 +0000)]
DAGCombiner: Relax sqrt NaN folding check

This is OK for +0 since compares to +/-0 give the same result.

llvm-svn: 262125

8 years agoAMDGPU: Fix broken/confusing predefined macro
Matt Arsenault [Sat, 27 Feb 2016 09:06:26 +0000 (09:06 +0000)]
AMDGPU: Fix broken/confusing predefined macro

amdgcn should not be defining __R600__

llvm-svn: 262124

8 years agoAMDGPU: Fix inconsistent register name for flat_scratch
Matt Arsenault [Sat, 27 Feb 2016 09:06:22 +0000 (09:06 +0000)]
AMDGPU: Fix inconsistent register name for flat_scratch

llvm-svn: 262123

8 years agoAdd __builtin_canonicalize
Matt Arsenault [Sat, 27 Feb 2016 09:06:18 +0000 (09:06 +0000)]
Add __builtin_canonicalize

llvm-svn: 262122

8 years agoAMDGPU: Split vi-insts subtarget feature
Matt Arsenault [Sat, 27 Feb 2016 08:53:55 +0000 (08:53 +0000)]
AMDGPU: Split vi-insts subtarget feature

This will be more useful for marking builtins acceptable for which
subtargets.

llvm-svn: 262121

8 years agoAMDGPU: Add s_sleep intrinsic
Matt Arsenault [Sat, 27 Feb 2016 08:53:52 +0000 (08:53 +0000)]
AMDGPU: Add s_sleep intrinsic

llvm-svn: 262120

8 years agoAMDGPU: Implement readcyclecounter
Matt Arsenault [Sat, 27 Feb 2016 08:53:46 +0000 (08:53 +0000)]
AMDGPU: Implement readcyclecounter

This matches the behavior of the HSAIL clock instruction.
s_realmemtime is used if the subtarget supports it, and falls
back to s_memtime if not.

Also introduces new intrinsics for each of s_memtime / s_memrealtime.

llvm-svn: 262119

8 years agoCodeGen: Avoid implicit conversion in MachineInstrBuilder, NFC
Duncan P. N. Exon Smith [Sat, 27 Feb 2016 07:00:35 +0000 (07:00 +0000)]
CodeGen: Avoid implicit conversion in MachineInstrBuilder, NFC

Avoid another implicit conversion from MachineInstrBundleIterator to
MachineInstr*, this time in MachineInstrBuilder.h (this is in pursuit of
PR26753).

llvm-svn: 262118

8 years agoScopInfo: Drop some debug statements
Tobias Grosser [Sat, 27 Feb 2016 06:59:30 +0000 (06:59 +0000)]
ScopInfo: Drop some debug statements

This debug output distracts from the -debug-only=polly-scops output. As it is
rather verbose and only really needed for debugging the domain construction
I drop this output. The domain construction is meanwhile stable enough to
not require regular debugging.

llvm-svn: 262117

8 years agoCodeGen: Remove implicit iterator to pointer conversions, NFC
Duncan P. N. Exon Smith [Sat, 27 Feb 2016 06:51:00 +0000 (06:51 +0000)]
CodeGen: Remove implicit iterator to pointer conversions, NFC

Remove a couple of implicit conversions from MachineInstrBundleIterator
to MachineInstr*.

llvm-svn: 262116

8 years agoCodeGen: Take MachineInstr& in SlotIndexes and LiveIntervals, NFC
Duncan P. N. Exon Smith [Sat, 27 Feb 2016 06:40:41 +0000 (06:40 +0000)]
CodeGen: Take MachineInstr& in SlotIndexes and LiveIntervals, NFC

Take MachineInstr by reference instead of by pointer in SlotIndexes and
the SlotIndex wrappers in LiveIntervals.  The MachineInstrs here are
never null, so this cleans up the API a bit.  It also incidentally
removes a few implicit conversions from MachineInstrBundleIterator to
MachineInstr* (see PR26753).

At a couple of call sites it was convenient to convert to a range-based
for loop over MachineBasicBlock::instr_begin/instr_end, so I added
MachineBasicBlock::instrs.

llvm-svn: 262115

8 years agoLoopGenerators: Expose some parts of the parallel loop generator
Tobias Grosser [Sat, 27 Feb 2016 06:24:58 +0000 (06:24 +0000)]
LoopGenerators: Expose some parts of the parallel loop generator

Some of this functionality is useful beyond the generation of a normal OpenMP
loop.

llvm-svn: 262114

8 years agoScopInfo: Add function to invalidate ScopArrayInfo object
Tobias Grosser [Sat, 27 Feb 2016 06:04:40 +0000 (06:04 +0000)]
ScopInfo: Add function to invalidate ScopArrayInfo object

In case the underlying basepointer of a ScopArrayInfo object is moved to another
module while the scop is still processed is it necessary to free dependent
ScopArrayInfo objects as they might otherwise be looked accidentally when a
new llvm basepointer value is reassigned the very same memory location as the
llvm value that has been moved earlier.

This function is not yet used in Polly itself, but is useful for external users.

llvm-svn: 262113

8 years ago[instrprof] Use __{start,stop}_SECNAME on PS4 too.
Sean Silva [Sat, 27 Feb 2016 06:01:26 +0000 (06:01 +0000)]
[instrprof] Use __{start,stop}_SECNAME on PS4 too.

Summary:
The PS4 linker seems to handle this fine.

Hi David, it seems that indeed most ELF linkers support
__{start,stop}_SECNAME, as our proprietary linker does as well.

This follows the pattern of r250679 w.r.t. the testing.

Maggie, Phillip, Paul: I've tested this with the PS4 SDK 3.5 toolchain
prerelease and it seems to work fine.

Reviewers: davidxl

Subscribers: probinson, phillip.power, MaggieYi

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

llvm-svn: 262112

8 years ago[sancov] properly initializing pass.
Mike Aizatsky [Sat, 27 Feb 2016 05:50:40 +0000 (05:50 +0000)]
[sancov] properly initializing pass.

llvm-svn: 262111

8 years ago[libFuzzer] don't emit callbacks to sanitizer run-time in -fsanitize-coverage=trace...
Kostya Serebryany [Sat, 27 Feb 2016 05:45:12 +0000 (05:45 +0000)]
[libFuzzer] don't emit callbacks to sanitizer run-time in -fsanitize-coverage=trace-pc mode; update libFuzzer doc for previous commit

llvm-svn: 262110

8 years agoSuppress an uncovered switch warning [NFC]
Philip Reames [Sat, 27 Feb 2016 05:18:30 +0000 (05:18 +0000)]
Suppress an uncovered switch warning [NFC]

llvm-svn: 262109

8 years ago[LICM] Teach LICM how to handle cases where the alias set tracker was
Chandler Carruth [Sat, 27 Feb 2016 04:34:07 +0000 (04:34 +0000)]
[LICM] Teach LICM how to handle cases where the alias set tracker was
merged into a loop that was subsequently unrolled (or otherwise nuked).

In this case it can't merge in the ASTs for any remaining nested loops,
it needs to re-add their instructions dircetly.

The fix is very isolated, but I've pulled the code for merging blocks
into the AST into a single place in the process. The only behavior
change is in the case which would have crashed before.

This fixes a crash reported by Mikael Holmen on the list after r261316
restored much of the loop pass pipelining and allowed us to actually do
this kind of nested transformation sequenc. I've taken that test case
and further reduced it into the somewhat twisty maze of loops in the
included test case. This does in fact trigger the bug even in this
reduced form.

llvm-svn: 262108

8 years ago[libFuzzer] fixing the bot
Kostya Serebryany [Sat, 27 Feb 2016 03:14:23 +0000 (03:14 +0000)]
[libFuzzer] fixing the bot

llvm-svn: 262106

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