Commit Graph

218185 Commits

Author SHA1 Message Date
Alexey Bataev fc57d1601d [OPENMP 4.5] Codegen for 'hint' clause of 'critical' directive
OpenMP 4.5 defines 'hint' clause for 'critical' directive. Patch adds codegen for this clause.

llvm-svn: 255639
2015-12-15 10:55:09 +00:00
Cong Hou 3ba9cf6020 Improve the successor list update in TailDuplication.cpp.
This patch improves a temporary fix in r255530 so that we can normalize
successor list without trigger assertion failures in tail duplication pass.

llvm-svn: 255638
2015-12-15 10:10:40 +00:00
NAKAMURA Takumi ec6b1fcf63 InstCombineLoadStoreAlloca.cpp: Avoid instantiating Twine.
llvm-svn: 255637
2015-12-15 09:37:31 +00:00
NAKAMURA Takumi b4a6884844 clang/test/Analysis/padding_c.c: Suppress a test incompatible to i686-linux.
error: 'warning' diagnostics expected but not seen:
    File clang/test/Analysis/padding_c.c Line 194 (directive at clang/test/Analysis/padding_c.c:193): Excessive padding in 'struct DefaultAttrAlign'
  1 error generated.

llvm-svn: 255636
2015-12-15 09:37:01 +00:00
Benjamin Kramer 5c248d89f3 [libclang] Add a flag to create the precompiled preamble on the first parse.
Summary:
The current default is to create the preamble on the first reparse, aka
second parse. This is useful for clients that do not want to block when
opening a file because serializing the preamble takes a bit of time.
However, this makes the reparse much more expensive and that may be on the
critical path as it's the first interaction a user has with the source code.

YouCompleteMe currently optimizes for the first code interaction by parsing
the file twice when loaded. That's just unnecessarily slow and this flag
helps to avoid that.

Reviewers: doug.gregor, klimek

Subscribers: cfe-commits

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

llvm-svn: 255635
2015-12-15 09:30:31 +00:00
James Molloy 6045cc89bd [PassManagerBuilder] Add a few more scalar optimization passes
This patch does two things:
  1. mem2reg is now run immediately after globalopt. Now that globalopt
     can localize variables more aggressively, it makes sense to lower
     them to SSA form earlier rather than later so they can benefit from
     the full set of optimization passes.

  2. More scalar optimizations are run after the loop optimizations in
     LTO mode. The loop optimizations (especially indvars) can clean up
     scalar code sufficiently to make it worthwhile running more scalar
     passes. I've particularly added SCCP here as it isn't run anywhere
     else in the LTO pass pipeline.

Mem2reg is super cheap and shouldn't affect compilation time at all. The
rest of the added passes are in the LTO pipeline only so doesn't affect
the vast majority of compilations, just the link step.

llvm-svn: 255634
2015-12-15 09:24:01 +00:00
Mehdi Amini 4b8d75b596 Mark ThreadPool unittests as unsupported on PowerPC64
Bots are crashing unexpectingly, see: https://llvm.org/bugs/show_bug.cgi?id=25829

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255633
2015-12-15 09:10:28 +00:00
Mehdi Amini 942e52c70b ThreadPool unittest: add a rough mechanism to mark UNSUPPORTED on a given platform
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255632
2015-12-15 09:10:25 +00:00
George Rimar c7dc0be36a Reapply fixed r255626 that broke buildbot:
[ELF] - refactor of code in RelocationSection<ELFT>::writeTo()

Just a little reformat of 'if' conditions, NFC.

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

Fix was:
* Renamed unsigned Rel; to unsigned Reloc;

llvm-svn: 255631
2015-12-15 08:48:39 +00:00
Gabor Horvath 454564a2d9 [clang-tidy] Check for suspicious string assignments.
It is possible to assign arbitrary integer types to strings.
Sometimes it is the result of missing to_string call or apostrophes.

Reviewers: alexfh

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

llvm-svn: 255630
2015-12-15 08:47:20 +00:00
Elena Demikhovsky 6015f5c823 Type legalizer for masked gather and scatter intrinsics.
Full type legalizer that works with all vectors length - from 2 to 16, (i32, i64, float, double).

This intrinsic, for example
void @llvm.masked.scatter.v2f32(<2 x float>%data , <2 x float*>%ptrs , i32 align , <2 x i1>%mask )
requires type widening for data and type promotion for mask.

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

llvm-svn: 255629
2015-12-15 08:40:41 +00:00
George Rimar b076446368 Revert of r255626 "[ELF] - refactor of code in RelocationSection<ELFT>::writeTo()"
as it broke buildbot: 
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/17836/steps/build_Lld/logs/stdio
/Users/buildslave/as-bldslv9/lld-x86_64-darwin13/llvm.src/tools/lld/ELF/OutputSections.cpp:268:14: error: redefinition of 'Rel'
    unsigned Rel;   ^
/Users/buildslave/as-bldslv9/lld-x86_64-darwin13/llvm.src/tools/lld/ELF/OutputSections.cpp:241:34: note: previous definition is here
  for (const DynamicReloc<ELFT> &Rel : Relocs) {

That compiles fine on my MSVS 2015 thought.

llvm-svn: 255628
2015-12-15 08:39:42 +00:00
Gabor Horvath 009c5d52e3 Add a new matcher to match character types.
llvm-svn: 255627
2015-12-15 08:35:45 +00:00
George Rimar e3556420c1 [ELF] - refactor of code in RelocationSection<ELFT>::writeTo()
Just a little reformat of 'if' conditions, NFC.

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

llvm-svn: 255626
2015-12-15 08:23:08 +00:00
Alexey Bataev 28c75417b2 [OPENMP 4.5] Parsing/sema for 'hint' clause of 'critical' directive.
OpenMP 4.5 adds 'hint' clause to critical directive. Patch adds parsing/semantic analysis for this clause.

llvm-svn: 255625
2015-12-15 08:19:24 +00:00
Craig Topper cc03b49444 [IR] Add classof for GetElementPtrConstantExpr, CompareConstantExpr, InsertValueConstantExpr, and ExtractValueConstantExpr. All but CompareConstantExpr were being used in casts that were erroneously using ConstantExpr::classof due to inheritance. While there use cast<CompareConstantExpr> to simplify code slightly.
I believe in one place we were always casting to ExtractValueConstantExpr when we were trying to choose between ExtractValueConstantExpr and InsertValueConstantExpr because of this. But since they have identical layouts this didn't cause any observable problems.

llvm-svn: 255624
2015-12-15 06:11:36 +00:00
Craig Topper 1c3f28313e Use CmpInst::Predicate instead of 'unsigned short' in some places. NFC
llvm-svn: 255623
2015-12-15 06:11:33 +00:00
Simon Atanasyan 350311974b [ELF][MIPS] Remove applying the redundant bit-mask
The `mipsHigh` return type is `uint16_t` so we do not need to extract
low 16-bits from return value explicitly.

llvm-svn: 255622
2015-12-15 06:06:34 +00:00
Mehdi Amini bebca1c496 Fix MSVC build with LLVM_ENABLE_THREADS=OFF
Follow-up to the ThreadPool implementation.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255621
2015-12-15 05:53:41 +00:00
Justin Bogner 27966e2175 LoopUtils: Remove defaults for arguments that are always specified. NFC
llvm-svn: 255620
2015-12-15 05:52:13 +00:00
Sagar Thakur 40fc2e391a [LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 instruction sets
Patch by Nitesh Jain.

Summary: This Patch will allowed LLDB to debug respective instruction sets binaries.

Reviewers: jaydeep, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan
Differential: http://reviews.llvm.org/D15487
llvm-svn: 255619
2015-12-15 05:50:55 +00:00
Cong Hou 9f69cc024b Replace the unit test of BranchProbability::normalizeEdgeWeights() with BranchProbability::normalizeProbabilities().
BranchProbability::normalizeEdgeWeights() is going to be retired soon.

llvm-svn: 255618
2015-12-15 05:25:27 +00:00
Teresa Johnson f064d62279 Fix template parameter pack handling in ThreadPool
Fixes passing of template parameter pack via std::forward and add
unittest.

llvm-svn: 255617
2015-12-15 04:44:02 +00:00
Weiming Zhao 20447ce00e Bump up MAX_SUBTARGET_FEATURES
Summary:
Currently, ARMGenSubtargetInfo (from ARM.td) is reaching the limit of 96:
  enum : uint64_t {
       ...
       XScale = 95
  };
       
We need to bump the maximum value up to accommodate future changes and/or customized subtarget definitions. 

Reviewers: apazos, t.p.northover

Subscribers: llvm-commits, aemerson

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

llvm-svn: 255616
2015-12-15 04:42:49 +00:00
Vaivaswatha Nagaraj ea7403549d NFC: Fix typo in comment
llvm-svn: 255615
2015-12-15 04:41:10 +00:00
Quentin Colombet b82786e0ff [ShrinkWrapping] Do not choose restore point inside loops.
The post-dominance property is not sufficient to guarantee that a restore point
inside a loop is safe.
E.g.,
 while(1) {
   Save
   Restore
   if (...)
     break;
   use/def CSRs
 }
All the uses/defs of CSRs are dominated by Save and post-dominated
by Restore. However, the CSRs uses are still reachable after
Restore and before Save are executed.

This fixes PR25824

llvm-svn: 255613
2015-12-15 03:28:11 +00:00
Dan Gohman e3d7b58ba6 [WebAssembly] Use an immediate OperandType for offset operands.
llvm-svn: 255612
2015-12-15 03:21:48 +00:00
Nico Weber eb85b9c2a1 Try to let r255604 have an effect.
llvm-svn: 255611
2015-12-15 03:14:19 +00:00
Mehdi Amini 62d003ce54 Add specific header for MSVC to be able to build with LLVM_ENABLE_THREADS=OFF
Follow-up to the ThreadPool library

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255604
2015-12-15 02:32:03 +00:00
Enrico Granata bd5eab8287 Fix a bug where language categories would hold on to their caches even after changes
llvm-svn: 255603
2015-12-15 02:20:48 +00:00
Dan Gohman dcba338188 [WebAssembly] Remove .import printing.
For now, LLVM doesn't know about wasm module imports, so it shouldn't
emit .import directives.

llvm-svn: 255602
2015-12-15 02:20:44 +00:00
JF Bastien 65f0a71f40 WebAssembly: test global array indexing
This case was tested in the linker from code, but not from globals indexing into other globals. The linker currently barfs on this, ncbray volunteered to fix it.

llvm-svn: 255601
2015-12-15 02:02:51 +00:00
Mehdi Amini 1c131b37ed Instcombine: destructor loads of structs that do not contains padding
For non padded structs, we can just proceed and deaggregate them.
We don't want ot do this when there is padding in the struct as to not
lose information about this padding (the subsequents passes would then
try hard to preserve the padding, which is undesirable).

Also update extractvalue.ll and cast.ll so that they use structs with padding.

Remove the FIXME in the extractvalue of laod case as the non padded case is
handled when processing the load, and we don't want to do it on the padded
case.

Patch by: Amaury SECHET <deadalnix@gmail.com>

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255600
2015-12-15 01:44:07 +00:00
Eric Fiselier fd10d98ed0 Mark declarations of externally instantiated functions as inline so GCC doesn't complain.
llvm-svn: 255599
2015-12-15 01:41:41 +00:00
Eugene Zelenko e65b2cf297 Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr warnings in some files in source/Target/.
Simplify smart pointers checks in conditions. Other minor fixes.

llvm-svn: 255598
2015-12-15 01:33:19 +00:00
Jason Molenda 162b68d86f Add NetBSDSignals.cpp to the xcode project file.
llvm-svn: 255597
2015-12-15 01:26:25 +00:00
Reid Kleckner 7c0c0c0501 [llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping
The symbol being printed in this field comes from the main symbol table,
not 0xF1 subsection. Use LinkageName to make that a lot clearer.

llvm-svn: 255596
2015-12-15 01:23:55 +00:00
Cong Hou 750c9e0457 Let operator/ with uint32_t rhs operand be a member of BranchProbability and add a new operator /=. NFC.
llvm-svn: 255595
2015-12-15 01:21:14 +00:00
Kostya Serebryany 48b840dda1 [asan] try to fix ARM bots
llvm-svn: 255594
2015-12-15 01:05:35 +00:00
Mehdi Amini 33a7ea4b9a Add a C++11 ThreadPool implementation in LLVM
This is a very simple implementation of a thread pool using C++11
thread. It accepts any std::function<void()> for asynchronous
execution. Individual task can be synchronize using the returned
future, or the client can block on the full queue completion.

In case LLVM is configured with Threading disabled, it falls back
to sequential execution using std::async with launch:deferred.

This is intended to support parallelism for ThinLTO processing in
linker plugin, but is generic enough for any other uses.

This is a recommit of r255444 ; trying to workaround a bug in the
MSVC 2013 standard library. I think I was hit by:

 http://connect.microsoft.com/VisualStudio/feedbackdetail/view/791185/std-packaged-task-t-where-t-is-void-or-a-reference-class-are-not-movable

Recommit of r255589, trying to please g++ as well.

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

From: mehdi_amini <mehdi_amini@91177308-0d34-0410-b5e6-96231b3b80d8>
llvm-svn: 255593
2015-12-15 00:59:19 +00:00
Kamil Rytarowski cec6b45aec Welcome to NetBSD signals
Summary:
Signals 1-32 are matching the default UNIX platform.

There are platform specific ones above 32.

From the `/usr/include/sys/signal.h` header:

```
#define SIGPWR          32      /* power fail/restart (not reset when caught) */
#ifdef _KERNEL
#define SIGRTMIN        33      /* Kernel only; not exposed to userland yet */
#define SIGRTMAX        63      /* Kernel only; not exposed to userland yet */
#endif
```

Reviewers: emaste, joerg

Subscribers: lldb-commits

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

llvm-svn: 255592
2015-12-15 00:50:19 +00:00
Mehdi Amini 2bc6a5ad84 Revert "Add a C++11 ThreadPool implementation in LLVM"
This reverts commit r255589. Breaks g++

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255591
2015-12-15 00:42:44 +00:00
Jason Molenda 25d5b10b22 When constructing an address range to "step" or "next" through,
find the largest address range (possibly combining multiple 
LineEntry's for this line number) that is contiguous.

This allows lldb's fast-step stepping algorithm to potentially
run for a longer address range than if we have to stop at every
LineEntry indicating a subexpression in the source line.

http://reviews.llvm.org/D15407
<rdar://problem/23270882> 

llvm-svn: 255590
2015-12-15 00:40:30 +00:00
Mehdi Amini ef0ef2860d Add a C++11 ThreadPool implementation in LLVM
This is a very simple implementation of a thread pool using C++11
thread. It accepts any std::function<void()> for asynchronous
execution. Individual task can be synchronize using the returned
future, or the client can block on the full queue completion.

In case LLVM is configured with Threading disabled, it falls back
to sequential execution using std::async with launch:deferred.

This is intended to support parallelism for ThinLTO processing in
linker plugin, but is generic enough for any other uses.

This is a recommit of r255444 ; trying to workaround a bug in the
MSVC 2013 standard library. I think I was hit by:

 http://connect.microsoft.com/VisualStudio/feedbackdetail/view/791185/std-packaged-task-t-where-t-is-void-or-a-reference-class-are-not-movable

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255589
2015-12-15 00:38:05 +00:00
Kostya Serebryany 354bbb2ccd [asan] add option: handle_sigill
llvm-svn: 255588
2015-12-15 00:33:45 +00:00
Xinliang David Li ddbdb1e0be [PGO] make profile prefix even shorter and more readable
llvm-svn: 255587
2015-12-15 00:33:12 +00:00
Xinliang David Li c7018a25c6 [PGO] make profile prefix even shorter and more readable
llvm-svn: 255586
2015-12-15 00:32:56 +00:00
Eric Fiselier 831c112954 Fix various GCC mis-configurations for newer versions.
This patch goes through and enables C++11 and C++14 features for newer GCC's.
The main changes are:

1. Turn on variable templates. (Uses __cpp_variable_templates)
2. Assert atomic<Tp> is trivially copyable (Uses _GNUC_VER >= 501).
3. Turn on trailing return support for GCC. (Uses _GNUC_VER >= 404)
4. XFAIL void_t test for GCC 5.1 and 5.2. Fixed in GCC 6.

llvm-svn: 255585
2015-12-15 00:32:21 +00:00
Siva Chandra a386358c36 Make few adjustments after r255542.
Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 255584
2015-12-15 00:26:52 +00:00
Quentin Colombet 25b43f3624 [X86] Add relaxtion logic for SBB instructions.
Prior to this patch, we would wrongly stick to the variant with imm8 encoding
even when the relocation could not fit that size.

rdar://problem/23785506

llvm-svn: 255583
2015-12-15 00:09:23 +00:00