platform/upstream/llvm.git
8 years agoAMDGPU/SI: Add offset field to ds_permute/ds_bpermute instructions
Tom Stellard [Fri, 29 Apr 2016 14:34:26 +0000 (14:34 +0000)]
AMDGPU/SI: Add offset field to ds_permute/ds_bpermute instructions

Summary:
These instructions can add an immediate offset to the address, like other
ds instructions.

Reviewers: arsenm

Subscribers: arsenm, scchan

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

llvm-svn: 268043

8 years ago[mips][ias] Split expandMemInst between MipsAsmParser and MipsTargetStreamer. Almost...
Daniel Sanders [Fri, 29 Apr 2016 13:43:45 +0000 (13:43 +0000)]
[mips][ias] Split expandMemInst between MipsAsmParser and MipsTargetStreamer. Almost NFC.

Summary:
The portion in MipsAsmParser is responsible for figuring out which expansion to
use, while the portion in MipsTargetStreamer is responsible for emitting it.

This allows us to remove the call to isIntegratedAssemblerRequired() which is
currently ensuring the effect of .cprestore only occurs when writing objects.

The small functional change is that the memory offsets are now correctly
printed as signed values.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 268042

8 years ago[mips][ias] Moved most instruction emission helpers to MipsTargetStreamer. NFC.
Daniel Sanders [Fri, 29 Apr 2016 13:33:12 +0000 (13:33 +0000)]
[mips][ias] Moved most instruction emission helpers to MipsTargetStreamer. NFC.

Summary:
* Moved all the emit*() helpers to MipsTargetStreamer.
* Moved createNop() to MipsTargetStreamer as emitNop() and emitEmptyDelaySlot().
  This instruction has been split to distinguish between the 'nop' instruction
  and the nop used in delay slots which is sometimes a different nop to the
  'nop' instruction (e.g. for short delay slots on microMIPS).
* Moved createAddu() to MipsTargetStreamer as emitAddu().
* Moved createAppropriateDSLL() to MipsTargetStreamer as emitDSLL().

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 268041

8 years ago[ELF] Fixed warning. NFC.
George Rimar [Fri, 29 Apr 2016 13:32:30 +0000 (13:32 +0000)]
[ELF] Fixed warning. NFC.

SymbolTable.cpp:298:36: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
     Sym->Binding = New->isShared() ? STB_GLOBAL : New->Binding;
                                    ^

llvm-svn: 268040

8 years ago[mips] Update tests to account for section size rounding change in r268036.
Daniel Sanders [Fri, 29 Apr 2016 13:21:26 +0000 (13:21 +0000)]
[mips] Update tests to account for section size rounding change in r268036.

llvm-svn: 268039

8 years agocmake: Fix grammar
Tobias Grosser [Fri, 29 Apr 2016 13:03:40 +0000 (13:03 +0000)]
cmake: Fix grammar

llvm-svn: 268038

8 years ago[find-all-symbols] Parallelize the merge step.
Benjamin Kramer [Fri, 29 Apr 2016 12:46:27 +0000 (12:46 +0000)]
[find-all-symbols] Parallelize the merge step.

There is still more parallelism to get here because we synchonize on the
actual uniquing but just doing YAML parsing in parallel already gives a
significant speedup.

Merging all symbols in LLVM+clang+compiler-rt+lld+libc++, 48 cores.
before: 201.55s user 1.47s system 99% cpu 3:23.04 total
after:  276.99s user 7.63s system 838% cpu 33.947 total

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

llvm-svn: 268037

8 years ago[mips][ias] Make section sizes a multiple of the alignment.
Daniel Sanders [Fri, 29 Apr 2016 12:44:07 +0000 (12:44 +0000)]
[mips][ias] Make section sizes a multiple of the alignment.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

llvm-svn: 268036

8 years agoRevert "cmake: Set LINK_POLLY_INTO_TOOLS to ON"
Tobias Grosser [Fri, 29 Apr 2016 12:38:24 +0000 (12:38 +0000)]
Revert "cmake: Set LINK_POLLY_INTO_TOOLS to ON"

This reverts commit r268033 as it breaks some buildbots.

llvm-svn: 268035

8 years agodoc: A source code with Polly does not use a separate module (by default)
Tobias Grosser [Fri, 29 Apr 2016 12:35:46 +0000 (12:35 +0000)]
doc: A source code with Polly does not use a separate module (by default)

llvm-svn: 268034

8 years agocmake: Set LINK_POLLY_INTO_TOOLS to ON
Tobias Grosser [Fri, 29 Apr 2016 12:23:11 +0000 (12:23 +0000)]
cmake: Set LINK_POLLY_INTO_TOOLS to ON

With Polly checked into LLVM it was since a long time possible to compile
clang/opt/bugpoint with Polly support directly linked in, instead of only
providing Polly as a separate loadable module. This commit switches the
default from providing Polly as a module to linking Polly into tools, such
that it becomes unnecessary to load the Polly module when playing with Polly.
Such configuration has shown a lot more convenient for day-to-day Polly use.

This change does not impact the default behavior of any tool, if Polly is not
explicitly enabled when calling clang/opt/bugpoint Polly does not affect
compilation.

This change also does not impact normal LLVM/clang checkouts that do not
contain Polly.

Reviewers: jdoerfert, Meinersbur, sebpop, etherzhhb, zinob, hiraditya

Subscribers: pollydev, llvm-commits

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

llvm-svn: 268033

8 years agoAllow unsigned divisions
Johannes Doerfert [Fri, 29 Apr 2016 11:53:35 +0000 (11:53 +0000)]
Allow unsigned divisions

  After zero-extend operations and unsigned comparisons we now allow
  unsigned divisions. The handling is basically the same as for signed
  division, except the interpretation of the operands. As the divisor
  has to be constant in both cases we can simply interpret it as an
  unsigned value without additional complexity in the representation.
  For the dividend we could choose from the different representation
  schemes introduced for zero-extend operations but for now we will
  simply use an assumption.

llvm-svn: 268032

8 years agoRefactor SCEVAffinator [NFC]
Johannes Doerfert [Fri, 29 Apr 2016 11:52:30 +0000 (11:52 +0000)]
Refactor SCEVAffinator [NFC]

llvm-svn: 268031

8 years agoScopInfo: Add option to control abort on isl errors
Tobias Grosser [Fri, 29 Apr 2016 11:43:20 +0000 (11:43 +0000)]
ScopInfo: Add option to control abort on isl errors

For debugging it is often convenient to not abort at the very first memory
management error. This option allows to control this behavior at run-time.

llvm-svn: 268030

8 years agoRecommit "[MS] Improved implementation of stack pragmas (vtordisp, *_seg)"
Denis Zobnin [Fri, 29 Apr 2016 11:27:00 +0000 (11:27 +0000)]
Recommit "[MS] Improved implementation of stack pragmas (vtordisp, *_seg)"

Slightly updated version, double-checked build and tests.
Improve implementation of MS pragmas that use stack + compatibility fixes.
This patch:
  1. Changes implementation of #pragma vtordisp to use PragmaStack class
     that other stack pragmas use;
  2. Fixes "#pragma vtordisp()" behavior - it shouldn't affect the stack;
  3. Supports "save-restore" of pragma stacks on enter / exit a C++ method
     body, as MSVC does.

TODO:
  1. Change implementation of #pragma pack to use the same approach;
  2. Introduce diagnostics on popping named stack slots, as MSVC does.

Reviewers:
  rnk, thakis

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

llvm-svn: 268029

8 years ago[clang][BuiltIn][AVX512]Adding intrinsics for cmp{ss|sd} instruction set.
Michael Zuckerman [Fri, 29 Apr 2016 11:01:16 +0000 (11:01 +0000)]
[clang][BuiltIn][AVX512]Adding intrinsics for cmp{ss|sd} instruction set.

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

llvm-svn: 268028

8 years ago[FIX] Typo
Johannes Doerfert [Fri, 29 Apr 2016 10:47:07 +0000 (10:47 +0000)]
[FIX] Typo

llvm-svn: 268027

8 years ago[FIX] Prevent division/modulo by zero in parameters -- test case
Johannes Doerfert [Fri, 29 Apr 2016 10:45:39 +0000 (10:45 +0000)]
[FIX] Prevent division/modulo by zero in parameters -- test case

  This commits a test case for r268023.

llvm-svn: 268026

8 years ago[FIX] Unsigned comparisons change invalid domain
Johannes Doerfert [Fri, 29 Apr 2016 10:44:41 +0000 (10:44 +0000)]
[FIX] Unsigned comparisons change invalid domain

  It does not suffice to take a global assumptions for unsigned comparisons but
  we also need to adjust the invalid domain of the statements guarded by such
  an assumption. To this end we allow to specialize the getPwAff call now in
  order to indicate unsigned interpretation.

llvm-svn: 268025

8 years ago[ELF][MIPS] Accept MIPS 64-bit binaries
Simon Atanasyan [Fri, 29 Apr 2016 10:39:17 +0000 (10:39 +0000)]
[ELF][MIPS] Accept MIPS 64-bit binaries

LLD accepts MIPS 64-bit binaries, supports corresponding eulation (-m)
arguments and emits 64-bit specific ELF flags.

llvm-svn: 268024

8 years ago[FIX] Prevent division/modulo by zero in parameters
Johannes Doerfert [Fri, 29 Apr 2016 10:36:58 +0000 (10:36 +0000)]
[FIX] Prevent division/modulo by zero in parameters

  When we materialize parameter SCEVs we did so without considering the
  side effects they might have, e.g., both division and modulo are
  undefined if the right hand side is zero. This is a problem because we
  potentially extended the domain under which we evaluate parameters,
  thus we might have introduced such undefined behaviour. To prevent
  that from happening we will now guard divisions and modulo operations
  in the parameters with a compare and select.

llvm-svn: 268023

8 years agoMake run-find-all-symbols executable.
Benjamin Kramer [Fri, 29 Apr 2016 10:33:11 +0000 (10:33 +0000)]
Make run-find-all-symbols executable.

llvm-svn: 268022

8 years ago[find-all-symbols] Fix racy yaml file writing.
Benjamin Kramer [Fri, 29 Apr 2016 10:16:28 +0000 (10:16 +0000)]
[find-all-symbols] Fix racy yaml file writing.

If multiple find-all-symbols processes access the temporary directory
simultaneously with two files with the same name they would collide and
create a broken yaml file. Fix this by using the safe createUniqueFile
API from LLVM instead.

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

llvm-svn: 268021

8 years ago[OPENMP] Fix detection of explicit data-sharing attributes in templates.
Alexey Bataev [Fri, 29 Apr 2016 09:56:11 +0000 (09:56 +0000)]
[OPENMP] Fix detection of explicit data-sharing attributes in templates.

Fixes a bug with analysis of data-sharing attributes in templates.

llvm-svn: 268020

8 years ago[find-all-symbols] Save absolute file path instead of relative file path in SymbolInfo.
Haojian Wu [Fri, 29 Apr 2016 09:45:09 +0000 (09:45 +0000)]
[find-all-symbols] Save absolute file path instead of relative file path in SymbolInfo.

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 268019

8 years agoImplementation of VlA of GNU C++ extension, by Vladimir Yakovlev.
Alexey Bataev [Fri, 29 Apr 2016 09:39:50 +0000 (09:39 +0000)]
Implementation of VlA of GNU C++ extension, by Vladimir Yakovlev.

This enables GNU C++ extension "Variable length array" by default.
Differential Revision: http://reviews.llvm.org/D18823

llvm-svn: 268018

8 years ago[include-fixer] Add Yaml database integration.
Haojian Wu [Fri, 29 Apr 2016 09:23:38 +0000 (09:23 +0000)]
[include-fixer] Add Yaml database integration.

Reviewers: bkramer

Subscribers: cfe-commits, klimek, djasper

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

llvm-svn: 268017

8 years ago[InstCombine][SSE] Added x86 pshufb undef mask tests
Simon Pilgrim [Fri, 29 Apr 2016 09:13:53 +0000 (09:13 +0000)]
[InstCombine][SSE] Added x86 pshufb undef mask tests

FIXME: We currently don't support folding constant pshufb shuffle masks containing undef elements.
llvm-svn: 268016

8 years agoAMDGPU/SI: Assembler: Unify parsing/printing of operands.
Nikolay Haustov [Fri, 29 Apr 2016 09:02:30 +0000 (09:02 +0000)]
AMDGPU/SI: Assembler: Unify parsing/printing of operands.

Summary:
The goal is for each operand type to have its own parse function and
at the same time share common code for tracking state as different
instruction types share operand types (e.g. glc/glc_flat, etc).

Introduce parseAMDGPUOperand which can parse any optional operand.
DPP and Clamp/OMod have custom handling for now. Sam also suggested
to have class hierarchy for operand types instead of table. This
can be done in separate change.

Remove parseVOP3OptionalOps, parseDS*OptionalOps, parseFlatOptionalOps,
parseMubufOptionalOps, parseDPPOptionalOps.
Reduce number of definitions of AsmOperand's and MatchClasses' by using common base class.
Rename AsmMatcher/InstPrinter methods accordingly.
Print immediate type when printing parsed immediate operand.
Use 'off' if offset/index register is unused instead of skipping it to make it more readable (also agreed with SP3).
Update tests.

Reviewers: tstellarAMD, SamWot, artem.tamazov

Subscribers: qcolombet, arsenm, llvm-commits

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

llvm-svn: 268015

8 years ago[InstCombine][SSE] Regenerated x86 pshufb tests
Simon Pilgrim [Fri, 29 Apr 2016 08:53:35 +0000 (08:53 +0000)]
[InstCombine][SSE] Regenerated x86 pshufb tests

llvm-svn: 268014

8 years ago[Clang][AVX512][Builtin] Adding intrinsics for compress instruction set
Michael Zuckerman [Fri, 29 Apr 2016 08:52:02 +0000 (08:52 +0000)]
[Clang][AVX512][Builtin] Adding intrinsics for compress instruction set

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

llvm-svn: 268013

8 years ago[mips][microMIPS] Fix offsets for LLE, LWE, SBE, SCE and SHE instructions
Zlatko Buljan [Fri, 29 Apr 2016 08:36:54 +0000 (08:36 +0000)]
[mips][microMIPS] Fix offsets for LLE, LWE, SBE, SCE and SHE instructions
Differential Revision: http://reviews.llvm.org/D18645

llvm-svn: 268012

8 years ago[GlobalOpt] Propagate operand bundles
David Majnemer [Fri, 29 Apr 2016 08:07:22 +0000 (08:07 +0000)]
[GlobalOpt] Propagate operand bundles

We neglected to transfer operand bundles for some transforms.  These
were found via inspection, I'll try to come up with some test cases.

llvm-svn: 268011

8 years ago[InstCombine] Propagate operand bundles
David Majnemer [Fri, 29 Apr 2016 08:07:20 +0000 (08:07 +0000)]
[InstCombine] Propagate operand bundles

We neglected to transfer operand bundles for some transforms.  These
were found via inspection, I'll try to come up with some test cases.

llvm-svn: 268010

8 years agoFix PR21428 for long. Buffer was one byte too small in octal formatting case. Rename...
Eric Fiselier [Fri, 29 Apr 2016 07:23:20 +0000 (07:23 +0000)]
Fix PR21428 for long. Buffer was one byte too small in octal formatting case. Rename previously added test

llvm-svn: 268009

8 years ago[DeadArgumentElimination] Propagate operand bundles to promoted call sites
David Majnemer [Fri, 29 Apr 2016 07:22:36 +0000 (07:22 +0000)]
[DeadArgumentElimination] Propagate operand bundles to promoted call sites

We neglected to transfer operand bundles when performing argument
promotion.

llvm-svn: 268008

8 years ago[LoopDist] Add missing RUN line in test from r268006
Adam Nemet [Fri, 29 Apr 2016 07:16:00 +0000 (07:16 +0000)]
[LoopDist] Add missing RUN line in test from r268006

llvm-svn: 268007

8 years ago[LoopDist] Also emit optimization remark on success (-Rpass=)
Adam Nemet [Fri, 29 Apr 2016 07:10:46 +0000 (07:10 +0000)]
[LoopDist] Also emit optimization remark on success (-Rpass=)

The option -Rpass=loop-distribute now reports the loops that were
distributed.

llvm-svn: 268006

8 years ago[LoopDist] Pass 'Function' to main class. NFC
Adam Nemet [Fri, 29 Apr 2016 07:10:39 +0000 (07:10 +0000)]
[LoopDist] Pass 'Function' to main class. NFC

Next patch will add another use for 'Function' inside the class.

llvm-svn: 268005

8 years ago[SLPVectorizer] Add operand bundles to vectorized functions
David Majnemer [Fri, 29 Apr 2016 07:09:51 +0000 (07:09 +0000)]
[SLPVectorizer] Add operand bundles to vectorized functions

SLPVectorizing a call site should result in further propagation of its
bundles.

llvm-svn: 268004

8 years ago[LoopVectorize] Add operand bundles to vectorized functions
David Majnemer [Fri, 29 Apr 2016 07:09:48 +0000 (07:09 +0000)]
[LoopVectorize] Add operand bundles to vectorized functions

Also, do not crash when calculating a cost model for loop-invariant
token values.

llvm-svn: 268003

8 years agoAMDGPU: Stop reporting an addressing mode for unknown addrspace
Matt Arsenault [Fri, 29 Apr 2016 06:25:10 +0000 (06:25 +0000)]
AMDGPU: Stop reporting an addressing mode for unknown addrspace

This was being treated the same as private, which has an immediate
offset. For unknown, it probably means it's for a computation not
actually being used for accessing memory, so it should not have a
nontrivial addressing mode.

llvm-svn: 268002

8 years agoDivergenceAnalysis: Fix crash with unreachable blocks
Matt Arsenault [Fri, 29 Apr 2016 06:17:47 +0000 (06:17 +0000)]
DivergenceAnalysis: Fix crash with unreachable blocks

Unreachable blocks may not be in the dominator tree,
so don't crash on them.

llvm-svn: 268001

8 years ago[ArgumentPromotion] Propagate operand bundles to promoted call sites
David Majnemer [Fri, 29 Apr 2016 04:56:12 +0000 (04:56 +0000)]
[ArgumentPromotion] Propagate operand bundles to promoted call sites

We neglected to transfer operand bundles when performing argument
promotion.

This fixes PR27568.

llvm-svn: 267986

8 years ago[X86] Remove unnecessary header file containing a small class. It was only included...
Craig Topper [Fri, 29 Apr 2016 04:22:28 +0000 (04:22 +0000)]
[X86] Remove unnecessary header file containing a small class. It was only included in one place. Just define the class directly in the cpp file. NFC

llvm-svn: 267985

8 years ago[X86] Include X86MCTargetDesc.h directly in X86Disassembler.cpp instead of duplicatin...
Craig Topper [Fri, 29 Apr 2016 04:22:26 +0000 (04:22 +0000)]
[X86] Include X86MCTargetDesc.h directly in X86Disassembler.cpp instead of duplicating parts of it. NFC

llvm-svn: 267984

8 years agoMove extern C include test into test/libcxx
Eric Fiselier [Fri, 29 Apr 2016 04:19:48 +0000 (04:19 +0000)]
Move extern C include test into test/libcxx

llvm-svn: 267983

8 years agoFix test failures by adding missing include
Eric Fiselier [Fri, 29 Apr 2016 04:18:13 +0000 (04:18 +0000)]
Fix test failures by adding missing include

llvm-svn: 267982

8 years agoFix or move various non-standard tests.
Eric Fiselier [Fri, 29 Apr 2016 04:07:45 +0000 (04:07 +0000)]
Fix or move various non-standard tests.

This patch does the following:

* Remove <__config> includes from some container tests.
* Guards uses of std::launch::any in async tests because it's an extension.
* Move "test/std/extensions" to "test/libcxx/extensions"
* Moves various non-standard tests including those in "sequences/vector",
  "std/localization" and "utilities/meta".

llvm-svn: 267981

8 years ago[PR25281] Remove AAResultsWrapper from preserved analyses of loop vectorizer.
Michael Zolotukhin [Fri, 29 Apr 2016 03:31:25 +0000 (03:31 +0000)]
[PR25281] Remove AAResultsWrapper from preserved analyses of loop vectorizer.

We don't preserve AAResults, because, for one, we don't preserve SCEV-AA.
That fixes PR25281.

llvm-svn: 267980

8 years agoDo not produce broken debug info.
Rui Ueyama [Fri, 29 Apr 2016 03:21:08 +0000 (03:21 +0000)]
Do not produce broken debug info.

r267917 produces corrupted debug info because it didn't apply
relocations to right offsets.

llvm-svn: 267979

8 years agoRemove stale documentation on -no-aa
Sanjoy Das [Fri, 29 Apr 2016 03:01:49 +0000 (03:01 +0000)]
Remove stale documentation on -no-aa

The pass itself was removed in rL247167.

llvm-svn: 267978

8 years agoRegisterPressure: Fix default lanemask for missing regunit intervals
Matthias Braun [Fri, 29 Apr 2016 02:44:54 +0000 (02:44 +0000)]
RegisterPressure: Fix default lanemask for missing regunit intervals

In case of missing live intervals for a physical registers
getLanesWithProperty() would report 0 which was not a safe default in
all situations. Add a parameter to pass in a safe default.
No testcase because in-tree targets do not skip computing register unit
live intervals.

Also cleanup the getXXX() functions to not perform the
RequireLiveIntervals checks anymore so we do not even need to return
safe defaults.

llvm-svn: 267977

8 years agoRegisterPressure: Cannot produce dead (subregister) defs anymore
Matthias Braun [Fri, 29 Apr 2016 02:44:48 +0000 (02:44 +0000)]
RegisterPressure: Cannot produce dead (subregister) defs anymore

With the DetectDeadLanes pass in place we cannot run into situations
anymore where defs suddenly become dead.
Also add a missing check so we do not try to add an undef flag to a
physreg (found by visual inspection, no failing test).

llvm-svn: 267976

8 years ago[Parser] Clear the TemplateParamScope bit of the current scope's flag
Akira Hatanaka [Fri, 29 Apr 2016 02:24:14 +0000 (02:24 +0000)]
[Parser] Clear the TemplateParamScope bit of the current scope's flag
if we are parsing a template specialization.

This commit makes changes to clear the TemplateParamScope bit and set
the TemplateParamParent field of the current scope to null if a template
specialization is being parsed.

Before this commit, Sema::ActOnStartOfLambdaDefinition would check
whether the parent template scope had any decls to determine whether
or not a template specialization was being parsed. This wasn't correct
since it couldn't distinguish between a real template specialization and
a template defintion with an unnamed template parameter (only template
parameters with names are added to the scope's decl list). To fix the
bug, this commit changes the code to check the pointer to the parent
template scope rather than the decl list.

rdar://problem/23440346

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

llvm-svn: 267975

8 years agoFix build by casting to the proper int type.
Ivan Krasin [Fri, 29 Apr 2016 02:09:57 +0000 (02:09 +0000)]
Fix build by casting to the proper int type.

Reviewers: eugenis

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

llvm-svn: 267974

8 years agoMove INVOKE tests into test/libcxx sub-tree.
Eric Fiselier [Fri, 29 Apr 2016 01:52:57 +0000 (01:52 +0000)]
Move INVOKE tests into test/libcxx sub-tree.

Testing the concrete implementation of INVOKE means calling the implementation
specific names `__invoke` and `__invoke_constexpr`. For this reason the test
are non-standard. For this reason it's best if the tests live outside of the
`test/std` directory.

llvm-svn: 267973

8 years ago[OPENMP] Enable correct generation of runtime call when target directive is separated...
Carlo Bertolli [Fri, 29 Apr 2016 01:37:30 +0000 (01:37 +0000)]
[OPENMP] Enable correct generation of runtime call when target directive is separated from teams directive by multiple curly brackets

http://reviews.llvm.org/D18474

This patch fixes a bug in code generation of the correct OpenMP runtime library call in presence of target and teams, when target is separated by teams with multiple curly brackets. The current implementation will not be able to see the teams directive inside target and issue a call to tgt_target instead of the correct one tgt_target_teams.

llvm-svn: 267972

8 years ago[llvm-cov] Don't emit 'nan%' in reports
Vedant Kumar [Fri, 29 Apr 2016 01:31:49 +0000 (01:31 +0000)]
[llvm-cov] Don't emit 'nan%' in reports

llvm-svn: 267971

8 years ago[LoopVectorize] Keep hints from original loop on the vector loop
Hal Finkel [Fri, 29 Apr 2016 01:27:40 +0000 (01:27 +0000)]
[LoopVectorize] Keep hints from original loop on the vector loop

We need to keep loop hints from the original loop on the new vector loop.
Failure to do this meant that, for example:

  void foo(int *b) {
  #pragma clang loop unroll(disable)
    for (int i = 0; i < 16; ++i)
      b[i] = 1;
  }

this loop would be unrolled. Why? Because we'd vectorize it, thus dropping the
hints that unrolling should be disabled, and then we'd unroll it.

llvm-svn: 267970

8 years agoPR27549: fix bug that resulted in us giving a translation-unit-scope variable a
Richard Smith [Fri, 29 Apr 2016 01:23:20 +0000 (01:23 +0000)]
PR27549: fix bug that resulted in us giving a translation-unit-scope variable a
mangled name if it happened to be declared in an 'extern "C++"' context. This
also causes us to use the '_ZL' mangling rather than the '_Z' mangling for
internal-linkage entities that are wrapped in a language linkage construct.

llvm-svn: 267969

8 years agoFix possible test breakage for MinGW
Eric Fiselier [Fri, 29 Apr 2016 01:22:16 +0000 (01:22 +0000)]
Fix possible test breakage for MinGW

llvm-svn: 267968

8 years ago[msan] Tests for vector compare intrinsics.
Evgeniy Stepanov [Fri, 29 Apr 2016 01:20:05 +0000 (01:20 +0000)]
[msan] Tests for vector compare intrinsics.

llvm-svn: 267967

8 years ago[msan] Handle vector compare x86 intrinsics.
Evgeniy Stepanov [Fri, 29 Apr 2016 01:19:52 +0000 (01:19 +0000)]
[msan] Handle vector compare x86 intrinsics.

This handles SSE and SSE2 cmp_* and comiXX_* intrinsics.

llvm-svn: 267966

8 years ago[llvm-pdbdump] Try to appease the ASan bot
David Majnemer [Fri, 29 Apr 2016 01:00:17 +0000 (01:00 +0000)]
[llvm-pdbdump] Try to appease the ASan bot

We didn't check that the file was large enough to hold a super block.

llvm-svn: 267965

8 years ago[X86] Use nested switches to vary the operand to helper functions that were previousl...
Craig Topper [Fri, 29 Apr 2016 00:51:30 +0000 (00:51 +0000)]
[X86] Use nested switches to vary the operand to helper functions that were previously called in multiple cases. This seems to help the inliner reduce code. NFC

llvm-svn: 267964

8 years agoFix get_temp_file_name() to compile on Windows. Patch from STL@microsoft.com
Eric Fiselier [Fri, 29 Apr 2016 00:51:24 +0000 (00:51 +0000)]
Fix get_temp_file_name() to compile on Windows. Patch from STL@microsoft.com

llvm-svn: 267963

8 years agoRemove more names of unreferenced parameters. Patch from STL@microsoft.com
Eric Fiselier [Fri, 29 Apr 2016 00:47:16 +0000 (00:47 +0000)]
Remove more names of unreferenced parameters. Patch from STL@microsoft.com

llvm-svn: 267962

8 years agoAdd a return value for nasty_mutex::operator&. Patch from STL@microsoft.com
Eric Fiselier [Fri, 29 Apr 2016 00:45:46 +0000 (00:45 +0000)]
Add a return value for nasty_mutex::operator&. Patch from STL@microsoft.com

llvm-svn: 267961

8 years ago[ASan] [SystemZ] Mark segv_read_write.c as UNSUPPORTED.
Marcin Koscielnicki [Fri, 29 Apr 2016 00:43:20 +0000 (00:43 +0000)]
[ASan] [SystemZ] Mark segv_read_write.c as UNSUPPORTED.

On s390*-linux, sigcontext just doesn't contain any information that could
be used to recover the type of access, so there's no way to fix this, short
of emulating the faulting instruction.

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

llvm-svn: 267960

8 years agoAdd <string> include for streaming operators. Patch from STL@microsoft.com
Eric Fiselier [Fri, 29 Apr 2016 00:39:40 +0000 (00:39 +0000)]
Add <string> include for streaming operators. Patch from STL@microsoft.com

llvm-svn: 267959

8 years agoAdd proper include for unique_ptr. Patch from STL@microsoft.com
Eric Fiselier [Fri, 29 Apr 2016 00:37:56 +0000 (00:37 +0000)]
Add proper include for unique_ptr. Patch from STL@microsoft.com

llvm-svn: 267958

8 years agoAvoid -Wshadow warnings about constructor parameters named after fields
Reid Kleckner [Fri, 29 Apr 2016 00:37:43 +0000 (00:37 +0000)]
Avoid -Wshadow warnings about constructor parameters named after fields

Usually these parameters are used solely to initialize the field in the
initializer list, and there is no real shadowing confusion.

There is a new warning under -Wshadow called
-Wshadow-field-in-constructor-modified. It attempts to find
modifications of such constructor parameters that probably intended to
modify the field.

It has some false negatives, though, so there is another warning group,
-Wshadow-field-in-constructor, which always warns on this special case.
For users who just want the old behavior and don't care about these fine
grained groups, we have a new warning group called -Wshadow-all that
activates everything.

Fixes PR16088.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 267957

8 years ago[Sema] Fix a crash that occurs when a variable template is initialized
Akira Hatanaka [Thu, 28 Apr 2016 23:50:12 +0000 (23:50 +0000)]
[Sema] Fix a crash that occurs when a variable template is initialized
with a generic lambda.

This patch fixes Sema::InstantiateVariableInitializer to switch to the
context of the variable before instantiating its initializer, which is
necessary to set the correct type for VarTemplateSpecializationDecl.

This is the first part of the patch that was reviewed here:
http://reviews.llvm.org/D19175

rdar://problem/23440346

llvm-svn: 267956

8 years ago[llvm-pdbdump] Restore error messages, handle bad block sizes
David Majnemer [Thu, 28 Apr 2016 23:47:27 +0000 (23:47 +0000)]
[llvm-pdbdump] Restore error messages, handle bad block sizes

We lost the ability to report errors, bring it back.  Also, correctly
validate the block size.

llvm-svn: 267955

8 years agoLiveIntervalAnalysis: Remove LiveVariables requirement
Matthias Braun [Thu, 28 Apr 2016 23:42:51 +0000 (23:42 +0000)]
LiveIntervalAnalysis: Remove LiveVariables requirement

This requirement was a huge hack to keep LiveVariables alive because it
was optionally used by TwoAddressInstructionPass and PHIElimination.
However we have AnalysisUsage::addUsedIfAvailable() which we can use in
those passes.

This re-applies r260806 with LiveVariables manually added to PowerPC to
hopefully not break the stage 2 bots this time.

llvm-svn: 267954

8 years ago[llvm-pdbdump] Correctly read data larger than a block
David Majnemer [Thu, 28 Apr 2016 23:24:23 +0000 (23:24 +0000)]
[llvm-pdbdump] Correctly read data larger than a block

A bug was introduced when the code was refactored which resulted in a
bad memory access.

This fixes PR27565.

llvm-svn: 267953

8 years ago[LoopDist] Emit optimization remarks (-Rpass*)
Adam Nemet [Thu, 28 Apr 2016 23:08:32 +0000 (23:08 +0000)]
[LoopDist] Emit optimization remarks (-Rpass*)

I closely followed the precedents set by the vectorizer:

* With -Rpass-missed, the loop is reported with further details pointing
to -Rpass--analysis.

* -Rpass-analysis reports the details why distribution has failed.

* Regardless of -Rpass*, when distribution fails for a loop where
distribution was forced with the pragma, a warning is produced according
to -Wpass-failed.  In this case the analysis info is also printed even
without -Rpass-analysis.

llvm-svn: 267952

8 years ago[LoopDist] Improve debug messages
Adam Nemet [Thu, 28 Apr 2016 23:08:30 +0000 (23:08 +0000)]
[LoopDist] Improve debug messages

The next patch will start using these for -Rpass-analysis so they won't
be internal-only anymore.

Move the 'Skipping; ' prefix that some of the message are using into the
'fail' function.  We don't want to include this prefix in
the -Rpass-analysis report.

llvm-svn: 267951

8 years ago[LoopDist] Add helper to print debug message when distribution fails. NFC
Adam Nemet [Thu, 28 Apr 2016 23:08:27 +0000 (23:08 +0000)]
[LoopDist] Add helper to print debug message when distribution fails.  NFC

This will form the basis to emit optimization remarks (-Rpass*).

llvm-svn: 267950

8 years ago[Inliner] Preserve llvm.mem.parallel_loop_access metadata
Hal Finkel [Thu, 28 Apr 2016 23:00:04 +0000 (23:00 +0000)]
[Inliner] Preserve llvm.mem.parallel_loop_access metadata

When inlining a call site with llvm.mem.parallel_loop_access metadata, this
metadata needs to be propagated to all cloned memory-accessing instructions.
Otherwise, inlining parts of the loop body will invalidate the annotation.

With this functionality, we now vectorize the following as expected:

  void Body(int *res, int *c, int *d, int *p, int i) {
    res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
  }

  void Test(int *res, int *c, int *d, int *p, int n) {
    int i;

  #pragma clang loop vectorize(assume_safety)
    for (i = 0; i < 1600; i++) {
      Body(res, c, d, p, i);
    }
  }

llvm-svn: 267949

8 years agoDifferential Revision: http://reviews.llvm.org/D19687
Sriraman Tallam [Thu, 28 Apr 2016 22:34:00 +0000 (22:34 +0000)]
Differential Revision: reviews.llvm.org/D19687

Set module flag PIELevel. Simplify code that sets PICLevel flag.

llvm-svn: 267948

8 years agoGuard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros
Eric Fiselier [Thu, 28 Apr 2016 22:28:23 +0000 (22:28 +0000)]
Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros

llvm-svn: 267947

8 years ago[ASan] Reenable __builtin_setjmp test on PowerPC, disable on SystemZ.
Marcin Koscielnicki [Thu, 28 Apr 2016 22:23:19 +0000 (22:23 +0000)]
[ASan] Reenable __builtin_setjmp test on PowerPC, disable on SystemZ.

Since __builtin_setjmp has been fixed by rL267943, the test now works
on PowerPC.  Enable it.

On the other hand, the SystemZ backend doesn't currently support
__builtin_setjmp.  Disable it.

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

llvm-svn: 267946

8 years agoRead discriminators correctly from object file.
Dehao Chen [Thu, 28 Apr 2016 22:09:37 +0000 (22:09 +0000)]
Read discriminators correctly from object file.

Summary:
This is the follow-up patch for http://reviews.llvm.org/D19436
* Update the discriminator reading algorithm to match the assignment algorithm.
* Add test to cover the new algorithm.

Reviewers: dnovillo, echristo, dblaikie

Subscribers: danielcdh, dblaikie, echristo, llvm-commits, joker.eph

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

llvm-svn: 267945

8 years ago[CodeGen] Remove extra ';'
Marcin Koscielnicki [Thu, 28 Apr 2016 21:49:46 +0000 (21:49 +0000)]
[CodeGen] Remove extra ';'

Squashes a -Wpedantic warning.

llvm-svn: 267944

8 years ago[PowerPC] Fix the EH_SjLj_Setup pseudo.
Marcin Koscielnicki [Thu, 28 Apr 2016 21:24:37 +0000 (21:24 +0000)]
[PowerPC] Fix the EH_SjLj_Setup pseudo.

This instruction is just a control flow marker - it should not
actually exist in the object file.  Unfortunately, nothing catches
it before it gets to AsmPrinter.  If integrated assembler is used,
it's considered to be a normal 4-byte instruction, and emitted as
an all-0 word, crashing the program.  With external assembler,
a comment is emitted.

Fixed by setting Size to 0 and handling it in MCCodeEmitter - this
means the comment will still be emitted if integrated assembler
is not used.

This broke an ASan test, which has been disabled for a long time
as a result (see the discussion on D19657).  We can reenable it
once this lands.

llvm-svn: 267943

8 years ago[clang][AVX512][Builtin] Adding intrinsics for the SAD instruction set.
Michael Zuckerman [Thu, 28 Apr 2016 21:21:08 +0000 (21:21 +0000)]
[clang][AVX512][Builtin] Adding intrinsics for the SAD instruction set.

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

llvm-svn: 267942

8 years ago[CMake] Adding another missing include. NFC.
Chris Bieneman [Thu, 28 Apr 2016 21:16:45 +0000 (21:16 +0000)]
[CMake] Adding another missing include. NFC.

This also works fine today, but will break with my upcoming refactoring.

llvm-svn: 267941

8 years agoFix a bug in llvm-objdump for -private-headers printing the LC_CODE_SIGNATURE Mach...
Kevin Enderby [Thu, 28 Apr 2016 21:07:20 +0000 (21:07 +0000)]
Fix a bug in llvm-objdump for -private-headers printing the LC_CODE_SIGNATURE Mach-O load command.

rdar://25985653

llvm-svn: 267940

8 years ago[RDF] Recognize tail calls in graph creation
Krzysztof Parzyszek [Thu, 28 Apr 2016 20:40:08 +0000 (20:40 +0000)]
[RDF] Recognize tail calls in graph creation

llvm-svn: 267939

8 years agoFix warning in PDB code. NFC
Amaury Sechet [Thu, 28 Apr 2016 20:39:39 +0000 (20:39 +0000)]
Fix warning in PDB code. NFC

llvm-svn: 267938

8 years agoLiveIntervalAnalysis: No need to deal with dead subregister defs anymore.
Matthias Braun [Thu, 28 Apr 2016 20:35:26 +0000 (20:35 +0000)]
LiveIntervalAnalysis: No need to deal with dead subregister defs anymore.

The DetectDeadLaneMask already ensures that we have no dead subregister
definitions making the special handling in LiveIntervalAnalysis
unnecessary. This reverts most of r248335.

llvm-svn: 267937

8 years ago[RDF] Improve handling of inline-asm
Krzysztof Parzyszek [Thu, 28 Apr 2016 20:33:33 +0000 (20:33 +0000)]
[RDF] Improve handling of inline-asm

- Keep implicit defs from inline-asm instructions.
- Treat register references from inline-asm as fixed.

llvm-svn: 267936

8 years agoDelete dead variable.
Rafael Espindola [Thu, 28 Apr 2016 20:29:12 +0000 (20:29 +0000)]
Delete dead variable.

llvm-svn: 267935

8 years agoAdd parentheses to silence -Wparentheses warnings.
Zachary Turner [Thu, 28 Apr 2016 20:26:30 +0000 (20:26 +0000)]
Add parentheses to silence -Wparentheses warnings.

llvm-svn: 267934

8 years ago[clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static...
Alexander Kornienko [Thu, 28 Apr 2016 20:20:01 +0000 (20:20 +0000)]
[clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables

Summary:
Variables with static storage duration are zero-initialized per
[stmt.dcl]p4 and [basic.start.init]p2.

Reviewers: sbenza, aaron.ballman

Subscribers: michael_miller, flx, cfe-commits

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

llvm-svn: 267933

8 years ago[RDF] Add option to keep dead phi nodes in DFG
Krzysztof Parzyszek [Thu, 28 Apr 2016 20:17:06 +0000 (20:17 +0000)]
[RDF] Add option to keep dead phi nodes in DFG

Dead phi nodes are needed for code motion (such as copy propagation),
where a new use would be placed in a location that would be dominated
by a dead phi. Such a transformation is not legal for copy propagation,
and the existence of the phi would prevent it, but if the phi is not
there, it may appear to be valid.

llvm-svn: 267932

8 years agoUsed llvm_unreached to quite a VC++ compiler warning.
Adrian McCarthy [Thu, 28 Apr 2016 20:14:44 +0000 (20:14 +0000)]
Used llvm_unreached to quite a VC++ compiler warning.

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

llvm-svn: 267931

8 years ago[CMake] [Darwin] Use libtool instead of ar && ranlib
Chris Bieneman [Thu, 28 Apr 2016 20:14:19 +0000 (20:14 +0000)]
[CMake] [Darwin] Use libtool instead of ar && ranlib

Summary: Using libtool instead of ar and ranlib on Darwin shaves a minute off my clang build. This is because on Darwin libtool is optimized to give hints to the kernel about filesystem interactions that allow it to be faster.

Reviewers: bogner, pete

Subscribers: llvm-commits

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

llvm-svn: 267930