platform/upstream/llvm.git
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

8 years ago[Compiler-rt][MIPS] Defining macros for MIPS archs
Mohit K. Bhakkad [Wed, 9 Mar 2016 07:57:20 +0000 (07:57 +0000)]
[Compiler-rt][MIPS] Defining macros for MIPS archs

Reviewers: samsonov

Subscribers: filcab, jaydeep, sagar, llvm-commits

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

llvm-svn: 263000

8 years agoFix uninitialized member bool. Detected by ASan.
Richard Trieu [Wed, 9 Mar 2016 06:31:25 +0000 (06:31 +0000)]
Fix uninitialized member bool.  Detected by ASan.

llvm-svn: 262999

8 years ago[LoopDataPrefetch] Add stats and debug output
Adam Nemet [Wed, 9 Mar 2016 05:33:21 +0000 (05:33 +0000)]
[LoopDataPrefetch] Add stats and debug output

llvm-svn: 262998

8 years ago[LAA] Improve comment for isStridedPtr
Adam Nemet [Wed, 9 Mar 2016 05:33:19 +0000 (05:33 +0000)]
[LAA] Improve comment for isStridedPtr

llvm-svn: 262997

8 years agoAccept absolute paths in the -fuse-ld option.
Peter Zotov [Wed, 9 Mar 2016 05:18:16 +0000 (05:18 +0000)]
Accept absolute paths in the -fuse-ld option.

This patch extends the -fuse-ld option to accept a full path to an executable
and use it verbatim to invoke the linker. There are generally two reasons
to desire this.

The first reason relates to the sad truth is that Clang is retargetable,
Binutils are not.

While any Clang from a binary distribution is sufficient to compile code
for a wide range of architectures and prefixed BFD linkers (e.g.
installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled
libc's (for non-bare-metal targets) are widely available, including on all
Debian derivatives, it is impossible to use them together because
the -fuse-ld= option allows to specify neither a linker prefix nor
a full path to one.

The second reason is linker development, both when porting existing linkers
to new architectures and when working on a new linker such as LLD.

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

llvm-svn: 262996

8 years ago[WebAssembly] Update comments about irreducible control flow.
Dan Gohman [Wed, 9 Mar 2016 04:17:36 +0000 (04:17 +0000)]
[WebAssembly] Update comments about irreducible control flow.

llvm-svn: 262995

8 years agoUse lto_bool_t instead of a raw `bool` (fixup for r262977).
Sean Silva [Wed, 9 Mar 2016 04:05:28 +0000 (04:05 +0000)]
Use lto_bool_t instead of a raw `bool` (fixup for r262977).

Hopefully this should bring
llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast back to life.

llvm-svn: 262994

8 years agoFix ThinLTO test: depends on the X86 backend
Mehdi Amini [Wed, 9 Mar 2016 04:04:40 +0000 (04:04 +0000)]
Fix ThinLTO test: depends on the X86 backend

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

8 years ago[lto] Avoid duplicate symbol error for appending linkage.
Sean Silva [Wed, 9 Mar 2016 03:42:39 +0000 (03:42 +0000)]
[lto] Avoid duplicate symbol error for appending linkage.

Summary:
Is there any other code needed for correctly handling appending linkage?
Do we need to do something more with @llvm.global_ctors in
SymbolTable.cpp:addBitcodeFile; otherwise the combined bitcode module
won't have all the global ctors.

Reviewers: rafael

Subscribers: Bigcheese, llvm-commits, joker.eph

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

llvm-svn: 262992

8 years ago[index] Add a message for the assertion, NFC.
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:53:12 +0000 (02:53 +0000)]
[index] Add a message for the assertion, NFC.

llvm-svn: 262991

8 years agovoid foo() is not a valid C prototype, one has to write void foo(void)
Mehdi Amini [Wed, 9 Mar 2016 02:36:09 +0000 (02:36 +0000)]
void foo() is not a valid C prototype, one has to write void foo(void)

Remove a warning introduced in r262977

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

8 years agoReturn StringRef instead of a naked char*; NFC
Sanjoy Das [Wed, 9 Mar 2016 02:34:19 +0000 (02:34 +0000)]
Return StringRef instead of a naked char*; NFC

llvm-svn: 262989

8 years ago[IRCE] Reflow comments; NFC
Sanjoy Das [Wed, 9 Mar 2016 02:34:15 +0000 (02:34 +0000)]
[IRCE] Reflow comments; NFC

llvm-svn: 262988

8 years agoFix library dependency for llvm-lto after r262977
Mehdi Amini [Wed, 9 Mar 2016 02:34:13 +0000 (02:34 +0000)]
Fix library dependency for llvm-lto after r262977

It is a transitive dependency, so static build are OK but not build
with individual DSO for each LLVM library.

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

8 years agoLast round of preliminary cleanup in my refactoring of aliases.
Enrico Granata [Wed, 9 Mar 2016 02:27:57 +0000 (02:27 +0000)]
Last round of preliminary cleanup in my refactoring of aliases.

The next step is to actually turn CommandAlias into a full-blown CommandObject citizen.

This is tricky given the current architecture of the CommandInterpreter but I think I have found a reasonable path forward.
The current plan is to make class CommandAlias : public CommandObject, and have all the several GetCommand calls not actually traverse through the alias to the underlying command object
The only times that an alias will be traversed are:
a) execution; when time comes to run an alias, I will just grab the underlying command and options, and make the interpreter execute that according to its current algorithm
b) subcommand traversal; if one has an alias to a multiword command, grabbing a subcommand will see through to the subcommand

Other operations, e.g. command listing, command names, command helps, ..., will all use the alias directly. This will, in turn, lead to the removal of the separate alias dictionary, and just mix user commands and aliases in one map

llvm-svn: 262986

8 years ago[index] libclang: Make sure to treat forward ObjC protocols as ObjCProtocolRef declar...
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:12:46 +0000 (02:12 +0000)]
[index] libclang: Make sure to treat forward ObjC protocols as ObjCProtocolRef declarations, and fix related crash.

rdar://25035376

llvm-svn: 262985

8 years ago[index] Fix assertion hit when indexing re-declarations of built-in functions.
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:12:40 +0000 (02:12 +0000)]
[index] Fix assertion hit when indexing re-declarations of built-in functions.

llvm-svn: 262984

8 years agoAvoid unnecessary qualification.
Sean Silva [Wed, 9 Mar 2016 02:02:26 +0000 (02:02 +0000)]
Avoid unnecessary qualification.

Thanks to Rui for spotting this.

llvm-svn: 262983

8 years ago[WebAssembly] Implement irreducible control flow.
Dan Gohman [Wed, 9 Mar 2016 02:01:14 +0000 (02:01 +0000)]
[WebAssembly] Implement irreducible control flow.

This implements a very simple conservative transformation that doesn't
require more than linear code size growth. There's room for much more
optimization in this space.

llvm-svn: 262982

8 years agoFix GOLD plugin build after r262976
Mehdi Amini [Wed, 9 Mar 2016 01:55:15 +0000 (01:55 +0000)]
Fix GOLD plugin build after r262976

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