platform/upstream/llvm.git
8 years ago[X86][SSE] Basic combining of unary target shuffles of binary target shuffles.
Simon Pilgrim [Thu, 10 Mar 2016 11:23:51 +0000 (11:23 +0000)]
[X86][SSE] Basic combining of unary target shuffles of binary target shuffles.

This patch reorders the combining of target shuffle masks so that when a unary shuffle takes a binary shuffle as its input but only references one of its inputs it can correctly combine into a unary shuffle mask.

This is starting to encroach on the purpose of resolveTargetShuffleInputs, but I don't want to remove it until we definitely know we won't need it for full binary shuffle combining.

There is a lot more work before we can properly support binary target shuffle masks but this was an easy case to add support for.

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

llvm-svn: 263102

8 years ago[CG] Actually hoist up the generic CallGraphPrinter pass from a weird
Chandler Carruth [Thu, 10 Mar 2016 11:08:44 +0000 (11:08 +0000)]
[CG] Actually hoist up the generic CallGraphPrinter pass from a weird
location in the opt tool to live along side the analysis in LLVM's
libraries.

No functionality changed here, but this will allow me to port the
printer to the new pass manager as well.

llvm-svn: 263101

8 years ago[CG] Rename the DOT printing pass to actually reference "DOT".
Chandler Carruth [Thu, 10 Mar 2016 11:04:40 +0000 (11:04 +0000)]
[CG] Rename the DOT printing pass to actually reference "DOT".

There is another pass by the generic name 'CallGraphPrinter' which is
actually just a call graph printer tucked away inside the opt tool. I'd
like to bring it out and make it follow the same patterns as the rest of
the CallGraph code, but doing so would end up conflicting with the name
of the DOT printing pass. So this makes the DOT printing pass name be
more precise.

No functionality changed here.

llvm-svn: 263100

8 years agoTrack expression language from one place in ClangExpressionParser
Ewan Crawford [Thu, 10 Mar 2016 10:31:08 +0000 (10:31 +0000)]
Track expression language from one place in ClangExpressionParser

The current expression language is currently tracked in a few places within the ClangExpressionParser constructor.
This patch adds a private lldb::LanguageType attribute to the ClangExpressionParser class and tracks the expression language from that one place.

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D17719

llvm-svn: 263099

8 years agoAdd doxygen comments to xmmintrin.h's intrinsics.
Ekaterina Romanova [Thu, 10 Mar 2016 09:37:04 +0000 (09:37 +0000)]
Add doxygen comments to xmmintrin.h's intrinsics.
Only half of the intrinsics in this file is documented here. The patch for the other half will be sent out later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.

llvm-svn: 263098

8 years agoAVX-512: Fixed a bug in shuffle for v64i8 type
Elena Demikhovsky [Thu, 10 Mar 2016 08:32:09 +0000 (08:32 +0000)]
AVX-512: Fixed a bug in shuffle for v64i8 type

Operation SCALAR_TO_VECTOR for v64i8 and v32i16 should be lowered if BW feature is "on".

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

llvm-svn: 263097

8 years ago[opt] Fix description of the -disable-verify flag
Vedant Kumar [Thu, 10 Mar 2016 06:58:53 +0000 (06:58 +0000)]
[opt] Fix description of the -disable-verify flag

llvm-svn: 263096

8 years agoAdd an LLVM_BUILTIN_DEBUGTRAP macro.
Mark Lacey [Thu, 10 Mar 2016 05:15:03 +0000 (05:15 +0000)]
Add an LLVM_BUILTIN_DEBUGTRAP macro.

Summary:
This provides a macro that expands to __builtin_debugtrap() for clang,
and __debugbreak() for MSVC.

It intentionally expands to nothing for compilers that do not support a
similar mechanism that halts the debugger without otherwise crashing the
process.

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

llvm-svn: 263095

8 years ago[lto] Initialize asmparsers.
Sean Silva [Thu, 10 Mar 2016 04:58:52 +0000 (04:58 +0000)]
[lto] Initialize asmparsers.

Summary:
They are needed for inline asm during LTO.

In particular we hit the report_fatal_error on
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:138

    LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target

Reviewers: ruiu, rafael

Subscribers: Bigcheese, llvm-commits, joker.eph

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

llvm-svn: 263094

8 years agoARM: fix arm_neon_intrinsics.c and re-enable.
Tim Northover [Thu, 10 Mar 2016 04:39:45 +0000 (04:39 +0000)]
ARM: fix arm_neon_intrinsics.c and re-enable.

It turns out I'd never actually tested my recent change because it was
gated on long-tests. Failure ensued.

llvm-svn: 263093

8 years agoAdd support for a preserve_most calling convention to the AArch64 backend.
Roman Levenstein [Thu, 10 Mar 2016 04:35:09 +0000 (04:35 +0000)]
Add support for a preserve_most calling convention to the AArch64 backend.

This change adds a support for a preserve_most calling convention to the AArch64 backend, similar to how it was done for X86-64.

There is also a subsequent patch on top of this one to add a tail-calls support for this calling convention.

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

llvm-svn: 263092

8 years agoDisable failing test and fix RUN line.
Richard Trieu [Thu, 10 Mar 2016 04:04:12 +0000 (04:04 +0000)]
Disable failing test and fix RUN line.

See https://llvm.org/bugs/show_bug.cgi?id=26894 for details.  This change
fixes the incorrect flags to Clang and the piping issue.  It also disables
the FileCheck portion of the test, which is currently failing.

llvm-svn: 263091

8 years ago[opt] Only create Verifier passes when requested
Vedant Kumar [Thu, 10 Mar 2016 03:40:14 +0000 (03:40 +0000)]
[opt] Only create Verifier passes when requested

opt adds Verifier passes in AddOptimizationPasses even if
-disable-verify is on. Fix it so that the extra verification occurs
either when (1) -disable-verifier is off, or (2) -verify-each is on.

Thanks to David Jones for pointing out this behavior!

llvm-svn: 263090

8 years ago[SLP] Add -slp-min-reg-size command line option.
Michael Zolotukhin [Thu, 10 Mar 2016 02:49:47 +0000 (02:49 +0000)]
[SLP] Add -slp-min-reg-size command line option.

MinVecRegSize is currently hardcoded to 128; this patch adds a cl::opt
to allow changing it. I tried not to change any existing behavior for the default
case.

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

llvm-svn: 263089

8 years agoAdd an entry in the Release Notes for LLVMContext::discardValueNames()
Mehdi Amini [Thu, 10 Mar 2016 02:18:17 +0000 (02:18 +0000)]
Add an entry in the Release Notes for LLVMContext::discardValueNames()

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

8 years agoFix false positives for for-loop-analysis warning
Steven Wu [Thu, 10 Mar 2016 02:02:48 +0000 (02:02 +0000)]
Fix false positives for for-loop-analysis warning

Summary:
For PseudoObjectExpr, the DeclMatcher need to search only all the semantics
but also need to search pass OpaqueValueExpr for all potential uses for the
Decl.

Reviewers: thakis, rtrieu, rjmccall, doug.gregor

Subscribers: xazax.hun, rjmccall, doug.gregor, cfe-commits

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

llvm-svn: 263087

8 years agoAdd a flag to the LLVMContext to disable name for Value other than GlobalValue
Mehdi Amini [Thu, 10 Mar 2016 01:28:54 +0000 (01:28 +0000)]
Add a flag to the LLVMContext to disable name for Value other than GlobalValue

Summary:
This is intended to be a performance flag, on the same level as clang
cc1 option "--disable-free". LLVM will never initialize it by default,
it will be up to the client creating the LLVMContext to request this
behavior. Clang will do it by default in Release build (just like
--disable-free).

"opt" and "llc" can opt-in using -disable-named-value command line
option.

When performing LTO on llvm-tblgen, the initial merging of IR peaks
at 92MB without this patch, and 86MB after this patch,setNameImpl()
drops from 6.5MB to 0.5MB.
The total link time goes from ~29.5s to ~27.8s.

Compared to a compile-time flag (like the IRBuilder one), it performs
very close. I profiled on SROA and obtain these results:

 420ms with IRBuilder that preserve name
 372ms with IRBuilder that strip name
 375ms with IRBuilder that preserve name, and a runtime flag to strip

Reviewers: chandlerc, dexonsmith, bogner

Subscribers: joker.eph, llvm-commits

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

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

8 years ago[DWARFASTParserClang] Start with member offset of 0 for members of union types.
Siva Chandra [Thu, 10 Mar 2016 01:15:17 +0000 (01:15 +0000)]
[DWARFASTParserClang] Start with member offset of 0 for members of union types.

Summary:
GCC does not emit DW_AT_data_member_location for members of a union.
Starting with a 0 value for member locations helps is reading union types
in such cases.

Reviewers: clayborg

Subscribers: ldrumm, lldb-commits

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

llvm-svn: 263085

8 years ago[gvn] Fix more indenting and formatting in regions of code that will
Chandler Carruth [Thu, 10 Mar 2016 00:58:20 +0000 (00:58 +0000)]
[gvn] Fix more indenting and formatting in regions of code that will
need to be changed for porting to the new pass manager.

Also sink the comment on the ValueTable class back to that class instead
of it dangling on an anonymous namespace.

No functionality changed.

llvm-svn: 263084

8 years ago[gvn] Reformat a chunk of the GVN code that is strangely indented prior
Chandler Carruth [Thu, 10 Mar 2016 00:58:18 +0000 (00:58 +0000)]
[gvn] Reformat a chunk of the GVN code that is strangely indented prior
to restructuring it for porting to the new pass manager.

No functionality changed.

llvm-svn: 263083

8 years ago[PM] Port memdep to the new pass manager.
Chandler Carruth [Thu, 10 Mar 2016 00:55:30 +0000 (00:55 +0000)]
[PM] Port memdep to the new pass manager.

This is a fairly straightforward port to the new pass manager with one
exception. It removes a very questionable use of releaseMemory() in
the old pass to invalidate its caches between runs on a function.
I don't think this is really guaranteed to be safe. I've just used the
more direct port to the new PM to address this by nuking the results
object each time the pass runs. While this could cause some minor malloc
traffic increase, I don't expect the compile time performance hit to be
noticable, and it makes the correctness and other aspects of the pass
much easier to reason about. In some cases, it may make things faster by
making the sets and maps smaller with better locality. Indeed, the
measurements collected by Bruno (thanks!!!) show mostly compile time
improvements.

There is sadly very limited testing at this point as there are only two
tests of memdep, and both rely on GVN. I'll be porting GVN next and that
will exercise this heavily though.

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

llvm-svn: 263082

8 years agoEmitCXXStructorCall -> EmitCXXDestructorCall. NFC.
Alexey Samsonov [Thu, 10 Mar 2016 00:20:37 +0000 (00:20 +0000)]
EmitCXXStructorCall -> EmitCXXDestructorCall. NFC.

This function is only used in Microsoft ABI and only to emit
destructors. Rename/simplify it accordingly.

llvm-svn: 263081

8 years agoRemove unused function arguments. NFC.
Alexey Samsonov [Thu, 10 Mar 2016 00:20:33 +0000 (00:20 +0000)]
Remove unused function arguments. NFC.

llvm-svn: 263080

8 years agoCertain hardware architectures have registers of 256 bits in size
Enrico Granata [Thu, 10 Mar 2016 00:14:29 +0000 (00:14 +0000)]
Certain hardware architectures have registers of 256 bits in size

This patch extends Scalar such that it can support data living in such registers (e.g. float values living in the XMM registers)

llvm-svn: 263079

8 years agoFix SymbolFilePDB for discontiguous functions.
Zachary Turner [Thu, 10 Mar 2016 00:06:26 +0000 (00:06 +0000)]
Fix SymbolFilePDB for discontiguous functions.

Previously line table parsing code assumed that the only gaps would
occur at the end of functions.  In practice this isn't true, so this
patch makes the line table parsing more robust in the face of
functions with non-contiguous byte arrangements.

llvm-svn: 263078

8 years agosanitizer: Fix endianness checks for gcc
Alexey Samsonov [Wed, 9 Mar 2016 23:39:40 +0000 (23:39 +0000)]
sanitizer: Fix endianness checks for gcc

Summary:
__BIG_ENDIAN__ and __LITTLE_ENDIAN__ are not supported by gcc, which
eg. for ubsan Value::getFloatValue will silently fall through to
the little endian branch, breaking display of float values by ubsan.
Use __BYTE_ORDER__ == __ORDER_BIG/LITTLE_ENDIAN__ as the condition
instead, which is supported by both clang and gcc.

Noticed while porting ubsan to s390x.

Patch by Marcin Kościelnicki!

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

llvm-svn: 263077

8 years ago[Modules] Add stdatomic to the list of builtin headers
Ben Langmuir [Wed, 9 Mar 2016 23:31:34 +0000 (23:31 +0000)]
[Modules] Add stdatomic to the list of builtin headers

Since it's provided by the compiler. This allows a system module map
file to declare a module for it.

No test change for cstd.m, since stdatomic.h doesn't function without a
relatively complete stdint.h and stddef.h, which tests using this module
don't provide.

rdar://problem/24931246

llvm-svn: 263076

8 years ago[BasicAA/MDA] Sink aliasing rules for malloc and calloc into BasicAA
Philip Reames [Wed, 9 Mar 2016 23:19:56 +0000 (23:19 +0000)]
[BasicAA/MDA] Sink aliasing rules for malloc and calloc into BasicAA

MemoryDependenceAnalysis had a hard-coded exception to the general aliasing rules for malloc and calloc. The reasoning that applied there is equally valid in BasicAA and clarifies the remaining logic in MDA.

In principal, this can expose slightly more optimization opportunities, but since essentially all of our aliasing aware memory optimization passes go through MDA, this will likely be NFC in practice.

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

llvm-svn: 263075

8 years ago[CGP] Duplicate addressing computation in cold paths if required to sink addressing...
Philip Reames [Wed, 9 Mar 2016 23:13:12 +0000 (23:13 +0000)]
[CGP] Duplicate addressing computation in cold paths if required to sink addressing mode

This patch teaches CGP to duplicate addressing mode computations into cold paths (detected via explicit cold attribute on calls) if required to let addressing mode be safely sunk into the basic block containing each load and store.

In general, duplicating code into cold blocks may result in code growth, but should not effect performance. In this case, it's better to duplicate some code than to put extra pressure on the register allocator by making it keep the address through the entirely of the fast path.

This patch only handles addressing computations, but in principal, we could implement a more general cold cold scheduling heuristic which tries to reduce register pressure in the fast path by duplicating code into the cold path. Getting the profitability of the general case right seemed likely to be challenging, so I stuck to the existing case (addressing computation) we already had.

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

llvm-svn: 263074

8 years agoFix the build
Philip Reames [Wed, 9 Mar 2016 23:07:53 +0000 (23:07 +0000)]
Fix the build

I screwed up rebasing 263072.  This change fixes the build and passes all make check.

llvm-svn: 263073

8 years ago[LICM] Store promotion when memory is thread local
Philip Reames [Wed, 9 Mar 2016 22:59:30 +0000 (22:59 +0000)]
[LICM] Store promotion when memory is thread local

This patch teaches LICM's implementation of store promotion to exploit the fact that the memory location being accessed might be provable thread local. The fact it's thread local weakens the requirements for where we can insert stores since no other thread can observe the write. This allows us perform store promotion even in cases where the store is not guaranteed to execute in the loop.

Two key assumption worth drawing out is that this assumes a) no-capture is strong enough to imply no-escape, and b) standard allocation functions like malloc, calloc, and operator new return values which can be assumed not to have previously escaped.

In future work, it would be nice to generalize this so that it works without directly seeing the allocation site. I believe that the nocapture return attribute should be suitable for this purpose, but haven't investigated carefully. It's also likely that we could support unescaped allocas with similar reasoning, but since SROA and Mem2Reg should destroy those, they're less interesting than they first might seem.

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

llvm-svn: 263072

8 years agoUse %t as the output file name to avoid repetition. NFC.
Sean Silva [Wed, 9 Mar 2016 22:30:09 +0000 (22:30 +0000)]
Use %t as the output file name to avoid repetition. NFC.

llvm-svn: 263071

8 years ago[lto] Add saving the LTO .o file to -save-temps.
Sean Silva [Wed, 9 Mar 2016 22:30:05 +0000 (22:30 +0000)]
[lto] Add saving the LTO .o file to -save-temps.

Summary:
This implements another part of -save-temps.
After this, the only remaining part is dumping the optimized bitcode. But
currently LLD's LTO doesn't have a non-intrusive place to put this.
Eventually we probably will and it will make sense to add it then.

Reviewers: ruiu, rafael

Subscribers: joker.eph, Bigcheese, llvm-commits

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

llvm-svn: 263070

8 years ago[x86] fix cost model inaccuracy for vector memory ops
Sanjay Patel [Wed, 9 Mar 2016 22:23:33 +0000 (22:23 +0000)]
[x86] fix cost model inaccuracy for vector memory ops

The irony of this patch is that one CPU that is affected is AMD Jaguar, and Jaguar
has a completely double-pumped AVX implementation. But getting the cost model to
reflect that is a much bigger problem. The small goal here is simply to improve on
the lie that !AVX2 == SandyBridge.

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

llvm-svn: 263069

8 years ago[WebAssembly] Update known gcc test failures
Derek Schuff [Wed, 9 Mar 2016 22:14:33 +0000 (22:14 +0000)]
[WebAssembly] Update known gcc test failures

llvm-svn: 263068

8 years ago[x86, AVX] optimize masked loads with constant masks
Sanjay Patel [Wed, 9 Mar 2016 22:12:08 +0000 (22:12 +0000)]
[x86, AVX] optimize masked loads with constant masks

Instead of a variable-blend instruction, form a blend with immediate because those are always cheaper.

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

llvm-svn: 263067

8 years agoFix "ninja check-lldb" crash in IRExecutionUnit.cpp
Ted Woodward [Wed, 9 Mar 2016 22:05:17 +0000 (22:05 +0000)]
Fix "ninja check-lldb" crash in IRExecutionUnit.cpp

Summary:
From Adrian McCarthy:

"Running ninja check-lldb now has one crash in a Python process, due to deferencing a null pointer in IRExecutionUnit.cpp:  candidate_sc.symbol is null, which leads to a call with a null this pointer."

Reviewers: zturner, spyffe, amccarth

Subscribers: ted, jingham, lldb-commits

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

llvm-svn: 263066

8 years agoFix test failure on darwin-i386
Xinliang David Li [Wed, 9 Mar 2016 21:45:37 +0000 (21:45 +0000)]
Fix test failure on darwin-i386

llvm-svn: 263065

8 years agoELF: link with BitWriter module
Jan Vesely [Wed, 9 Mar 2016 21:38:04 +0000 (21:38 +0000)]
ELF: link with BitWriter module

Fixes build broken by r263055.

llvm-svn: 263064

8 years agoELF: Remove non-standard ELF features from AMDGPU target.
Rafael Espindola [Wed, 9 Mar 2016 21:37:22 +0000 (21:37 +0000)]
ELF: Remove non-standard ELF features from AMDGPU target.

Patch by Tom Stellard!

llvm-svn: 263063

8 years ago[ValueTracking] Extract isKnownPositive [NFCI]
Philip Reames [Wed, 9 Mar 2016 21:31:47 +0000 (21:31 +0000)]
[ValueTracking] Extract isKnownPositive [NFCI]

Extract out a generic interface from a recently landed patch and document a TODO in case compile time becomes a problem.

llvm-svn: 263062

8 years agoSimplify. NFC.
Rui Ueyama [Wed, 9 Mar 2016 21:15:17 +0000 (21:15 +0000)]
Simplify. NFC.

In this context, MBRef.getBufferIdentifier() == Path.

llvm-svn: 263061

8 years ago[modules] Simplify code logic. NFC.
Davide Italiano [Wed, 9 Mar 2016 21:09:51 +0000 (21:09 +0000)]
[modules] Simplify code logic. NFC.

llvm-svn: 263060

8 years ago[InstCombine] (icmp sgt smin(PosA, B) 0) -> (icmp sgt B 0)
Philip Reames [Wed, 9 Mar 2016 21:05:07 +0000 (21:05 +0000)]
[InstCombine] (icmp sgt smin(PosA, B) 0) -> (icmp sgt B 0)

When checking whether an smin is positive, we can move the comparison to one of the inputs if the other is known positive. If the known positive one is the min, then the other can't be negative. If the other is the min, then we compute the min.

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

llvm-svn: 263059

8 years ago[LLE] Add missing check for unit stride
Adam Nemet [Wed, 9 Mar 2016 20:47:55 +0000 (20:47 +0000)]
[LLE] Add missing check for unit stride

I somehow missed this.  The case in GCC (global_alloc) was similar to
the new testcase except it had an array of structs rather than a two
dimensional array.

Fixes RP26885.

llvm-svn: 263058

8 years agoUpdate for Rui's comments on D18006
Sean Silva [Wed, 9 Mar 2016 20:06:24 +0000 (20:06 +0000)]
Update for Rui's comments on D18006

Somehow I missed them.

llvm-svn: 263057

8 years agoARM & AArch64: fix IR-converted tests.
Tim Northover [Wed, 9 Mar 2016 20:06:10 +0000 (20:06 +0000)]
ARM & AArch64: fix IR-converted tests.

My script was converting %a0 to [[A]]0 if it had seen %a defined before %a0.
Oops.

llvm-svn: 263056

8 years ago[lto] Add beginning of -save-temps option.
Sean Silva [Wed, 9 Mar 2016 20:01:08 +0000 (20:01 +0000)]
[lto] Add beginning of -save-temps option.

Summary:
This is useful for debugging issues with LTO.
The option follows the analogous option in ld64 and the gold plugin (per
Rafael's suggestion).

For starters, this only dumps the combined bitcode file.
In a future patch I will add dumping for the .o file.

The naming of the output follows ld64's convention which is slightly more
consistent IMO (consistent `.lto.<extension>` for all the files).

Reviewers: rafael, ruiu

Subscribers: joker.eph, Bigcheese, llvm-commits

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

llvm-svn: 263055

8 years ago[AArch64] Minor reformatting (NFC).
Evandro Menezes [Wed, 9 Mar 2016 19:56:38 +0000 (19:56 +0000)]
[AArch64] Minor reformatting (NFC).

llvm-svn: 263054

8 years agoNFC fix documentation build by rL263015
Dmitry Polukhin [Wed, 9 Mar 2016 19:39:16 +0000 (19:39 +0000)]
NFC fix documentation build by rL263015

This time I hope it will fix the build for real.

llvm-svn: 263052

8 years ago[PPC] FE support for generating VSX [negated] absolute value instructions
Kit Barton [Wed, 9 Mar 2016 19:28:31 +0000 (19:28 +0000)]
[PPC] FE support for generating VSX [negated] absolute value instructions

Includes new built-in, conversion of built-in to target-independent intrinsic
and update in the header file. Tests are also updated. There is a second part in
the backend for which I will post a separate code-review. BACKEND PART SHOULD BE
COMMITTED FIRST.

Phabricator: http://reviews.llvm.org/D17816
llvm-svn: 263051

8 years ago[llvm-readobj] Enable GNU style section group print
Hemant Kulkarni [Wed, 9 Mar 2016 19:16:13 +0000 (19:16 +0000)]
[llvm-readobj] Enable GNU style section group print

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

llvm-svn: 263050

8 years agoAdd an "offset" option to "break set -n" and "break set -f -l".
Jim Ingham [Wed, 9 Mar 2016 18:59:13 +0000 (18:59 +0000)]
Add an "offset" option to "break set -n" and "break set -f -l".
That way you can set offset breakpoints that will move as the function they are
contained in moves (which address breakpoints can't do...)

I don't align the new address to instruction boundaries yet, so you have to get
this right yourself for now.

<rdar://problem/13365575>

llvm-svn: 263049

8 years agoARM & AArch64: convert asm tests to LLVM IR and restrict optimizations.
Tim Northover [Wed, 9 Mar 2016 18:54:42 +0000 (18:54 +0000)]
ARM & AArch64: convert asm tests to LLVM IR and restrict optimizations.

This is mostly a one-time autoconversion of tests that checked assembly after
"-Owhatever" compiles to only run "opt -mem2reg" and check the assembly. This
should make them much more stable to changes in LLVM so they won't break on
unrelated changes.

"opt -mem2reg" is a compromise designed to increase the readability of tests
that check dataflow, while minimizing dependency on LLVM. Hopefully mem2reg is
stable enough that no surpises will come along.

Should address http://llvm.org/PR26815.

llvm-svn: 263048

8 years agoInstCombine: Restrict computeKnownBits() on all Values to OptLevel > 2
Matthias Braun [Wed, 9 Mar 2016 18:47:11 +0000 (18:47 +0000)]
InstCombine: Restrict computeKnownBits() on all Values to OptLevel > 2

As part of r251146 InstCombine was extended to call computeKnownBits on
every value in the function to determine whether it happens to be
constant. This increases typical compiletime by 1-3% (5% in irgen+opt
time) in my measurements. On the other hand this case did not trigger
once in the whole llvm-testsuite.

This patch introduces the notion of ExpensiveCombines which are only
enabled for OptLevel > 2. I removed the check in InstructionSimplify as
that is called from various places where the OptLevel is not known but
given the rarity of the situation I think a check in InstCombine is
enough.

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

llvm-svn: 263047

8 years agoMachineRegisterInfo: Correct comment
Matthias Braun [Wed, 9 Mar 2016 18:47:05 +0000 (18:47 +0000)]
MachineRegisterInfo: Correct comment

llvm-svn: 263046

8 years ago[lto] Don't lazy load metadata for now.
Sean Silva [Wed, 9 Mar 2016 18:38:40 +0000 (18:38 +0000)]
[lto] Don't lazy load metadata for now.

Summary:
At the very least we hit

    Assertion failed: (((Flags & RF_HaveUnmaterializedMetadata) || Node->isResolved()) && "Unexpected unresolved node"), function MapMetadataImpl, file /Users/Sean/pg/llvm/lib/Transforms/Utils/ValueMapper.cpp, line 375.

on the included test case.

We currently do things like parse the module twice to keep the
implementation minimal. I think it makes sense to add start with eager
loading for similar reasons.

Reviewers: rafael

Subscribers: ruiu, Bigcheese, llvm-commits, joker.eph

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

llvm-svn: 263045

8 years agoThis change adds co-processor condition branching and conditional traps to the Sparc...
Chris Dewhurst [Wed, 9 Mar 2016 18:20:21 +0000 (18:20 +0000)]
This change adds co-processor condition branching and conditional traps to the Sparc back-end.

This will allow inline assembler code to utilize these features, but no automatic lowering is provided, except for the previously provided @llvm.trap, which lowers to "ta 5".

The change also separates out the different assembly language syntaxes for V8 and V9 Sparc. Previously, only V9 Sparc assembly syntax was provided.

The change also corrects the selection order of trap disassembly, allowing, e.g. "ta %g0 + 15" to be rendered, more readably, as "ta 15", ignoring the %g0 register. This is per the sparc v8 and v9 manuals.

Check-in includes many extra unit tests to check this works correctly on both V8 and V9 Sparc processors.

Code Reviewed at http://reviews.llvm.org/D17960.

llvm-svn: 263044

8 years agoUpdate status to mark 2579 complete
Marshall Clow [Wed, 9 Mar 2016 18:09:07 +0000 (18:09 +0000)]
Update status to mark 2579 complete

llvm-svn: 263043

8 years agoImplement LWG#2579: Inconsistency wrt Allocators in basic_string assignment vs. basic...
Marshall Clow [Wed, 9 Mar 2016 18:08:29 +0000 (18:08 +0000)]
Implement LWG#2579: Inconsistency wrt Allocators in basic_string assignment vs. basic_string::assign

llvm-svn: 263042

8 years agoUse an explicit instantiation to work around delayed template parsing for MSVC-built...
Aaron Ballman [Wed, 9 Mar 2016 18:07:17 +0000 (18:07 +0000)]
Use an explicit instantiation to work around delayed template parsing for MSVC-built bots.

llvm-svn: 263041

8 years agoFixed "not all control paths return a value" warning. NFC.
George Rimar [Wed, 9 Mar 2016 18:05:34 +0000 (18:05 +0000)]
Fixed "not all control paths return a value" warning. NFC.

llvm-svn: 263040

8 years ago[ELF] - Issue an error if trying to link object that uses splitstacks.
George Rimar [Wed, 9 Mar 2016 18:01:45 +0000 (18:01 +0000)]
[ELF] - Issue an error if trying to link object that uses splitstacks.

Each object file compiled in split stack mode will have an empty
section with a special name: .note.GNU-split-stack

We don't support this in linker now, so patch just adds an error out for that.

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

llvm-svn: 263039

8 years agoAArch64: remove a couple more tests already covered elsewhere.
Tim Northover [Wed, 9 Mar 2016 18:00:06 +0000 (18:00 +0000)]
AArch64: remove a couple more tests already covered elsewhere.

llvm-svn: 263038

8 years agoadd a test RUN to show unexpected behavior
Sanjay Patel [Wed, 9 Mar 2016 17:53:28 +0000 (17:53 +0000)]
add a test RUN to show unexpected behavior

llvm-svn: 263037

8 years agoImplement LWG#2583: There is no way to supply an allocator for basic_string(str,...
Marshall Clow [Wed, 9 Mar 2016 17:51:43 +0000 (17:51 +0000)]
Implement LWG#2583: There is no way to supply an allocator for basic_string(str, pos)

llvm-svn: 263036

8 years ago[PPC] backend changes to generate xvabs[s,d]p and xvnabs[s,d]p instructions
Kit Barton [Wed, 9 Mar 2016 17:48:01 +0000 (17:48 +0000)]
[PPC] backend changes to generate xvabs[s,d]p and xvnabs[s,d]p instructions

This has to be committed before the FE changes

Phabricator: http://reviews.llvm.org/D17837
llvm-svn: 263035

8 years agoSpeculative fix for this test case (the test doesn't run on my typical build environm...
Aaron Ballman [Wed, 9 Mar 2016 17:34:16 +0000 (17:34 +0000)]
Speculative fix for this test case (the test doesn't run on my typical build environment).

llvm-svn: 263034

8 years agoDon't crash when compiling inline assembler containing .file directives.
Adrian Prantl [Wed, 9 Mar 2016 17:32:56 +0000 (17:32 +0000)]
Don't crash when compiling inline assembler containing .file directives.
Removing the assertion is  safe to do because any module level inline
assembly is always emitted first via AsmPrinter::doInitialization().

http://reviews.llvm.org/D16101
rdar://22690666

llvm-svn: 263033

8 years ago[AArch64] Move helper functions into TII, so they can be reused elsewhere. NFC.
Chad Rosier [Wed, 9 Mar 2016 17:29:48 +0000 (17:29 +0000)]
[AArch64] Move helper functions into TII, so they can be reused elsewhere. NFC.

llvm-svn: 263032

8 years agoReleaseNotes: update 'you may prefer' link to 3.8
Hans Wennborg [Wed, 9 Mar 2016 17:26:46 +0000 (17:26 +0000)]
ReleaseNotes: update 'you may prefer' link to 3.8

llvm-svn: 263031

8 years agoReleaseNotes: update 'you may prefer' link to 3.8
Hans Wennborg [Wed, 9 Mar 2016 17:25:34 +0000 (17:25 +0000)]
ReleaseNotes: update 'you may prefer' link to 3.8

llvm-svn: 263030

8 years agoAdd some more tests for the containers type requirements
Marshall Clow [Wed, 9 Mar 2016 17:19:07 +0000 (17:19 +0000)]
Add some more tests for the containers type requirements

llvm-svn: 263029

8 years agoFix a minor bug in test
Xinliang David Li [Wed, 9 Mar 2016 17:13:18 +0000 (17:13 +0000)]
Fix a minor bug in test

llvm-svn: 263028

8 years agoAdding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator...
Aaron Ballman [Wed, 9 Mar 2016 17:11:51 +0000 (17:11 +0000)]
Adding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr.

Patch by Aleksei Sidorin.

llvm-svn: 263027

8 years ago[AMDGPU] add AMDGPU target support to ELFObjectFile.h header
Valery Pykhtin [Wed, 9 Mar 2016 17:08:19 +0000 (17:08 +0000)]
[AMDGPU] add AMDGPU target support to ELFObjectFile.h header

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

llvm-svn: 263026

8 years agoImplement support for [[maybe_unused]] in C++1z that is based off existing support...
Aaron Ballman [Wed, 9 Mar 2016 16:48:08 +0000 (16:48 +0000)]
Implement support for [[maybe_unused]] in C++1z that is based off existing support for unused, and treat it as an extension pre-C++1z. This also means extending the existing unused attribute so that it can be placed on an enum and enumerator, in addition to the other subjects.

llvm-svn: 263025

8 years ago[AArch64] Minor cleanup/remove redundant code. NFC.
Chad Rosier [Wed, 9 Mar 2016 16:46:48 +0000 (16:46 +0000)]
[AArch64] Minor cleanup/remove redundant code. NFC.

llvm-svn: 263024

8 years agoNFC fix documentation build by rL263015
Dmitry Polukhin [Wed, 9 Mar 2016 16:19:04 +0000 (16:19 +0000)]
NFC fix documentation build by rL263015

llvm-svn: 263023

8 years agoSelectionDAG: Fix a crash on inline asm when output register supports multiple types
Tom Stellard [Wed, 9 Mar 2016 16:02:52 +0000 (16:02 +0000)]
SelectionDAG: Fix a crash on inline asm when output register supports multiple types

Summary:
The code in SelectionDAG did not handle the case where the
register type and output types were different, but had the same size.

Reviewers: arsenm, echristo

Subscribers: llvm-commits

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

llvm-svn: 263022

8 years ago[TII] Allow getMemOpBaseRegImmOfs() to accept negative offsets. NFC.
Chad Rosier [Wed, 9 Mar 2016 16:00:35 +0000 (16:00 +0000)]
[TII] Allow getMemOpBaseRegImmOfs() to accept negative offsets. NFC.

http://reviews.llvm.org/D17967

llvm-svn: 263021

8 years agoSplit locale management out of locale_win32. NFCI
Ben Craig [Wed, 9 Mar 2016 15:49:59 +0000 (15:49 +0000)]
Split locale management out of locale_win32. NFCI

For the locale refactor, the locale management functions (newlocale,
freelocale, uselocale) are needed in a separate header from the various _l
functions. This is because some platforms implement the _l functions in terms
of a locale switcher RAII helper, and the locale switcher RAII helper needs
the locale management functions. This patch helps pave the way by getting all
the functions in the right files, so that later diffs aren't completely
horrible.

Unfortunately, the Windows, Cygwin, and MinGW builds seemed to have
bit-rotted, so I wasn't able to test this completely. I don't think I made
things any worse than they already are though.

http://reviews.llvm.org/D17419

llvm-svn: 263020

8 years ago[OpenMP] Add support for multidimensional array sections in map clause SEMA.
Samuel Antao [Wed, 9 Mar 2016 15:46:05 +0000 (15:46 +0000)]
[OpenMP] Add support for multidimensional array sections in map clause SEMA.

Summary: In some cases it can be proved statically that multidimensional array section refer to contiguous storage and can therefore be allowed in a map clause. This patch adds support for those cases in SEMA.

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

Subscribers: cfe-commits, fraggamuffin, caomhin

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

llvm-svn: 263019

8 years ago[test/sanitizer-common] Linux/sanitizer_set_death_callback_test.cc -> Posix/sanitizer...
Filipe Cabecinhas [Wed, 9 Mar 2016 15:39:49 +0000 (15:39 +0000)]
[test/sanitizer-common] Linux/sanitizer_set_death_callback_test.cc -> Posix/sanitizer_set_death_callback_test.cc

llvm-svn: 263018

8 years ago[test/sanitizer-common] Move getpass.cc from Linux into Posix
Filipe Cabecinhas [Wed, 9 Mar 2016 15:39:43 +0000 (15:39 +0000)]
[test/sanitizer-common] Move getpass.cc from Linux into Posix

llvm-svn: 263017

8 years agoReorganize _LIBCPP_LOCALE__L_EXTENSIONS
Ben Craig [Wed, 9 Mar 2016 15:39:39 +0000 (15:39 +0000)]
Reorganize _LIBCPP_LOCALE__L_EXTENSIONS

Instead of checking _LIBCPP_LOCALE_L_EXTENSIONS all over, instead check it
once, and define the various *_l symbols once. The private redirector symbol
names are all prefixed with _libcpp_* so that they won't conflict with user
symbols, and so they won't conflict with future C library symbols. In
particular, glibc likes providing private symbols such as __locale_t, so we
should follow a different naming pattern (like _libcpp_*) to avoid problems
on that front.

Tested on Linux with glibc. Hoping for the best on OSX and the various BSDs.

http://reviews.llvm.org/D17456

llvm-svn: 263016

8 years ago[GCC] PR23529 Sema part of attrbute abi_tag support
Dmitry Polukhin [Wed, 9 Mar 2016 15:30:53 +0000 (15:30 +0000)]
[GCC] PR23529 Sema part of attrbute abi_tag support

Original patch by Stefan Bühler http://reviews.llvm.org/D12834

Difference between original and this one:
- fixed all comments in original code review
- added more tests, all new diagnostics now covered by tests
- moved abi_tag on re-declaration checks to Sema::mergeDeclAttributes
  where they actually may work as designed
- clang-format + other stylistic changes

Mangle part will be sent for review as a separate patch.

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

llvm-svn: 263015

8 years agoFix build error due to unsigned compare >= 0 in r263008 (NFC)
Teresa Johnson [Wed, 9 Mar 2016 14:58:23 +0000 (14:58 +0000)]
Fix build error due to unsigned compare >= 0 in r263008 (NFC)

Fixes error from building with clang:

/usr/local/google/home/tejohnson/llvm/llvm_15/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp:407:12:
error: comparison of unsigned expression >= 0 is always true
[-Werror,-Wtautological-compare]
  if ((Imm >= 0x000) && (Imm <= 0x0ff)) {
         ~~~ ^  ~~~~~

llvm-svn: 263014

8 years agoSimplify: SHN_ABS is >= SHN_LORESERVE.
Rafael Espindola [Wed, 9 Mar 2016 14:31:18 +0000 (14:31 +0000)]
Simplify: SHN_ABS is >= SHN_LORESERVE.

llvm-svn: 263012

8 years agoReland r262337 "calculate builtin_object_size if arg is a removable pointer"
Petar Jovanovic [Wed, 9 Mar 2016 14:12:47 +0000 (14:12 +0000)]
Reland r262337 "calculate builtin_object_size if arg is a removable pointer"

Original commit message:
 calculate builtin_object_size if argument is a removable pointer

 This patch fixes calculating correct value for builtin_object_size function
 when pointer is used only in builtin_object_size function call and never
 after that.

 Patch by Strahinja Petrovic.

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

Reland the original change with a small modification (first do a null check
and then do the cast) to satisfy ubsan.

llvm-svn: 263011

8 years agoAdd ARM EHABI support to gcc_personality_v0.
Logan Chien [Wed, 9 Mar 2016 13:20:17 +0000 (13:20 +0000)]
Add ARM EHABI support to gcc_personality_v0.

Until now the only exception APIs supported by gcc_personality_v0
are DWARF EH and SJLJ. This adds support for ARM EHABI as well.

This is achieved by
a) changing the function signature on ARM EHABI,
b) unwinding the stack before returning _URC_CONTINUE_UNWIND.

See "Exception Handling ABI for the ARM Architecture" for details
(http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf).

Patch by Timon Van Overveldt.

llvm-svn: 263010

8 years agoUpdate comments following the addition of PredicatedScalarEvolution. NFC.
Silviu Baranga [Wed, 9 Mar 2016 12:39:06 +0000 (12:39 +0000)]
Update comments following the addition of PredicatedScalarEvolution. NFC.

We changed several functions in LoopAccessAnalysis to use PSE instead of
taking SE and a SCEV predicate as arguments, but didn't update the comments.

This also fixes a comment in ScalarEvolution, where we refered to Preds
when the argument name was A.

llvm-svn: 263009

8 years ago[AMDGPU] Assembler: Support DPP instructions.
Sam Kolton [Wed, 9 Mar 2016 12:29:31 +0000 (12:29 +0000)]
[AMDGPU] Assembler: Support DPP instructions.

Supprot DPP syntax as used in SP3 (except several operands syntax).
Added dpp-specific operands in td-files.
Added DPP flag to TSFlags to determine if instruction is dpp in InstPrinter.
Support for VOP2 DPP instructions in td-files.
Some tests for DPP instructions.

ToDo:
  - VOP2bInst:
    - vcc is considered as operand
    - AsmMatcher doesn't apply mnemonic aliases when parsing operands
  - v_mac_f32
  - v_nop
  - disable instructions with 64-bit operands
  - change dpp_ctrl assembler representation to conform sp3

Review: http://reviews.llvm.org/D17804
llvm-svn: 263008

8 years agoFixing wrong header title name.
Michael Zuckerman [Wed, 9 Mar 2016 11:26:45 +0000 (11:26 +0000)]
Fixing wrong header title name.

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

llvm-svn: 263007

8 years ago[AMDGPU] Assembler: Support abs() syntax.
Nikolay Haustov [Wed, 9 Mar 2016 11:03:21 +0000 (11:03 +0000)]
[AMDGPU] Assembler: Support abs() syntax.

Support legacy SP3 abs(v1) syntax. InstPrinter still uses |v1|.
Add tests.

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

llvm-svn: 263006

8 years ago[AMDGPU] Assembler: Fix s_setpc_b64
Nikolay Haustov [Wed, 9 Mar 2016 10:56:19 +0000 (10:56 +0000)]
[AMDGPU] Assembler: Fix s_setpc_b64

s_setpc_b64 has just one 64-bit source which is the address of instruction to jump to.

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

llvm-svn: 263005

8 years agoPacify gcc's parenthesis warning, which doesn't realize that parens don't matter...
Manuel Klimek [Wed, 9 Mar 2016 10:06:45 +0000 (10:06 +0000)]
Pacify gcc's parenthesis warning, which doesn't realize that parens don't matter here.

llvm-svn: 263004

8 years ago[OPENMP 4.5] Codegen for data members in 'linear' clause
Alexey Bataev [Wed, 9 Mar 2016 09:49:09 +0000 (09:49 +0000)]
[OPENMP 4.5] Codegen for data members in 'linear' clause

OpenMP 4.5 allows privatization of non-static data members in OpenMP
constructs. Patch adds proper codegen support for data members in
'linear' clause

llvm-svn: 263003

8 years ago[OPENMP 4.5] Codegen for data members in 'linear' clause.
Alexey Bataev [Wed, 9 Mar 2016 09:49:00 +0000 (09:49 +0000)]
[OPENMP 4.5] Codegen for data members in 'linear' clause.

OpenMP 4.5 allows to use data members in private clauses. Patch adds
codegen support for 'linear' clause.

llvm-svn: 263002

8 years ago[DFSan] Fix test_inet_pton for big endian archs
Mohit K. Bhakkad [Wed, 9 Mar 2016 08:00:37 +0000 (08:00 +0000)]
[DFSan] Fix test_inet_pton for big endian archs

Reviewers: samsonov

Subscribers: ed, jaydeep, sagar, llvm-commits

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

llvm-svn: 263001