6 years ago[Sparc] Fix handling of double incoming arguments on sparc little-endian.
James Y Knight [Tue, 15 Dec 2015 19:23:12 +0000 (19:23 +0000)]
[Sparc] Fix handling of double incoming arguments on sparc little-endian.

On SparcV8, doubles get passed in two 32-bit integer registers. The call
code was already handling endianness correctly, but the incoming
argument code was not -- it got the two halves in opposite order.

Also remove some dead code in LowerFormalArguments_32 to handle
less-than-32bit values, which can't actually happen.

Finally, add some test cases for the 32-bit calling convention, cribbed
from the 64abi.ll test, and run for both big and little-endian.

llvm-svn: 255668

6 years agoUnsupport test that should not be run on Hexagon
Krzysztof Parzyszek [Tue, 15 Dec 2015 19:14:24 +0000 (19:14 +0000)]
Unsupport test that should not be run on Hexagon

llvm-svn: 255667

6 years ago[Docs] Fix Unexpected indentation errors.
Akira Hatanaka [Tue, 15 Dec 2015 19:11:48 +0000 (19:11 +0000)]
[Docs] Fix Unexpected indentation errors.

llvm-svn: 255665

6 years ago[X86] MOVPC32r should only emit CFI adjustments when needed
Michael Kuperstein [Tue, 15 Dec 2015 18:50:32 +0000 (18:50 +0000)]
[X86] MOVPC32r should only emit CFI adjustments when needed

We only want to emit CFI adjustments when actually using DWARF.
This fixes PR25828.

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

llvm-svn: 255664

6 years agoAMDGPU: Add aliases for all VI targets
Tom Stellard [Tue, 15 Dec 2015 18:37:04 +0000 (18:37 +0000)]
AMDGPU: Add aliases for all VI targets

llvm-svn: 255663

6 years agoAMDGPU: Add alias for tonga
Tom Stellard [Tue, 15 Dec 2015 18:37:02 +0000 (18:37 +0000)]
AMDGPU: Add alias for tonga

Patch by: Vedran Mileti

llvm-svn: 255662

6 years agoAMDGPU/SI: Implement AMDGPUTargetTransformInfo::isSourceOfDivergence()
Tom Stellard [Tue, 15 Dec 2015 18:04:38 +0000 (18:04 +0000)]
AMDGPU/SI: Implement AMDGPUTargetTransformInfo::isSourceOfDivergence()

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 255661

6 years ago[SimplifyCFG] allow speculation of exactly one expensive instruction (PR24818)
Sanjay Patel [Tue, 15 Dec 2015 17:38:29 +0000 (17:38 +0000)]
[SimplifyCFG] allow speculation of exactly one expensive instruction (PR24818)

This is the last general step to allow more IR-level speculation with a safety harness in place in CodeGenPrepare.

The intent is to restore the behavior enabled by:

but prevent bad performance such as:

Earlier patches in this sequence:
D12882 (disable SimplifyCFG speculation for expensive instructions)
D13297 (have CGP despeculate expensive ops)
D14630 (have CGP despeculate special versions of cttz/ctlz)

As shown in the test cases, we only have two instructions currently affected: ctz for some x86 and fdiv generally.
Allowing exactly one expensive instruction is a bit of a hack, but it lines up with what is currently implemented
in CGP. If we make the despeculation more general in CGP, we can make the speculation here more liberal.

A follow-up patch will adjust the cost for sqrt and possibly other typically expensive math intrinsics (currently
everything is cheap by default). GPU targets would likely want to override those expensive default costs (just as
they probably should already override the cost of div/rem) because just about any math is cheaper than control-flow
on those targets.

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

llvm-svn: 255660

6 years ago[llvm-profdata] Add support for weighted merge of profile data (2nd try)
Nathan Slingerland [Tue, 15 Dec 2015 17:37:09 +0000 (17:37 +0000)]
[llvm-profdata] Add support for weighted merge of profile data (2nd try)

This change adds support for specifying a weight when merging profile data with the llvm-profdata tool.
Weights are specified by using the --weighted-input=<weight>,<filename> option. Input files not specified
with this option (normal positional list after options) are given a default weight of 1.

Adding support for arbitrary weighting of input profile data allows for relative importance to be placed on the
input data from multiple training runs.

Both sampled and instrumented profiles are supported.

Reviewers: davidxl, dnovillo, bogner, silvas

Subscribers: silvas, davidxl, llvm-commits

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

llvm-svn: 255659

6 years agoAMDGPU: mark ldexp LibCalls as unavailable
Nicolai Hahnle [Tue, 15 Dec 2015 17:24:15 +0000 (17:24 +0000)]
AMDGPU: mark ldexp LibCalls as unavailable

The LibCallSimplifier will turn llvm.exp2.* intrinsics into ldexp* libcalls
which do not make sense with the AMDGPU backend.

In the long run, we'll want an llvm.ldexp.* intrinsic to properly make use of
this optimization, but this works around the problem for now.

See also: http://reviews.llvm.org/D14327 (suggested llvm.ldexp.* implementation)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92709

Reviewers: arsenm, tstellarAMD

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

llvm-svn: 255658

6 years agoAMDGPU/SI: Fix bitcast between v2f32 and f64
Tom Stellard [Tue, 15 Dec 2015 17:11:17 +0000 (17:11 +0000)]
AMDGPU/SI: Fix bitcast between v2f32 and f64

The radeonsi fp64 support can hit these now that some redundant bitcasts
are folded.

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 255657

6 years ago[X86] Smaller code for materializing 32-bit 1 and -1 constants
Hans Wennborg [Tue, 15 Dec 2015 17:10:28 +0000 (17:10 +0000)]
[X86] Smaller code for materializing 32-bit 1 and -1 constants

"movl $-1, %eax" is 5 bytes, "xorl %eax, %eax; decl %eax" is 3 bytes.
This commit makes LLVM use the latter when optimizing for size.

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

llvm-svn: 255656

6 years agoclang-cl: Add an alias for /wd4100
Nico Weber [Tue, 15 Dec 2015 17:07:16 +0000 (17:07 +0000)]
clang-cl: Add an alias for /wd4100

llvm-svn: 255655

6 years agoWebAssembly: update expected torture test failures
JF Bastien [Tue, 15 Dec 2015 17:07:07 +0000 (17:07 +0000)]
WebAssembly: update expected torture test failures

We now have 252 expected failures.

llvm-svn: 255654

6 years ago[Hexagon] Preprocess mapped instructions before lowering to MC
Krzysztof Parzyszek [Tue, 15 Dec 2015 17:05:45 +0000 (17:05 +0000)]
[Hexagon] Preprocess mapped instructions before lowering to MC

llvm-svn: 255653

6 years agoAMDGPU/SI: Add llvm.amdgcn.mbcnt.* intrinsics
Tom Stellard [Tue, 15 Dec 2015 17:02:52 +0000 (17:02 +0000)]
AMDGPU/SI: Add llvm.amdgcn.mbcnt.* intrinsics

These are meant to be used instead of the llvm.SI.tid intrinsic which will
be deprecated at some point.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 255652

6 years agoAMDGPU/SI: Add llvm.amdgcn.v.interp.p[12] intrinsics
Tom Stellard [Tue, 15 Dec 2015 17:02:49 +0000 (17:02 +0000)]
AMDGPU/SI: Add llvm.amdgcn.v.interp.p[12] intrinsics

These are meant to be used instead of the llvm.SI.fs.interp intrinsic which
will be deprecated at some point.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 255651

6 years agoAMDGPU/SI: Add getShaderType() function to Utils/
Tom Stellard [Tue, 15 Dec 2015 16:26:16 +0000 (16:26 +0000)]
AMDGPU/SI: Add getShaderType() function to Utils/

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 255650

6 years agoBitcasts between FP and INT values using direct moves
Nemanja Ivanovic [Tue, 15 Dec 2015 14:50:34 +0000 (14:50 +0000)]
Bitcasts between FP and INT values using direct moves

This patch corresponds to review:

This patch was meant to land in revision 255246, but I accidentally uploaded
the patch that corresponds to http://reviews.llvm.org/D15372 in that revision

Thereby, this patch is the actual Bitcasts using direct moves patch, whereas
http://reviews.llvm.org/rL255246 actually corresponds to

llvm-svn: 255649

6 years ago[Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm
Michael Zuckerman [Tue, 15 Dec 2015 14:35:51 +0000 (14:35 +0000)]
[Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm

add triple to test

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

llvm-svn: 255647

6 years agoFixed mistype in comment. NFC.
George Rimar [Tue, 15 Dec 2015 14:20:57 +0000 (14:20 +0000)]
Fixed mistype in comment. NFC.

llvm-svn: 255646

6 years ago[Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm
Michael Zuckerman [Tue, 15 Dec 2015 14:04:18 +0000 (14:04 +0000)]
[Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm

Clang doesn’t support a use of “this” pointer inside inline asm.
When I tried to compile a class or a struct (see example) with an inline asm that contains "this" pointer.
Clang returns with an error.
This patch fixes that.

error: expected unqualified-id
For example:
struct A {
    void f() {
          __asm mov eax, this
              // error: expected unqualified-id
Differential Revision: http://reviews.llvm.org/D15115

llvm-svn: 255645

6 years ago[x86] adding PKU feature flag
Asaf Badouh [Tue, 15 Dec 2015 13:35:29 +0000 (13:35 +0000)]
[x86] adding PKU feature flag

the feature flag is essential for RDPKRU and WRPKRU instruction
more about the instruction can be found in the SDM rev 56, vol 2 from http://www.intel.com/sdm

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

llvm-svn: 255644

6 years agoDo not try to use i8 and i16 versions of FP_TO_U/SINT soft float library calls
Michael Kuperstein [Tue, 15 Dec 2015 12:55:50 +0000 (12:55 +0000)]
Do not try to use i8 and i16 versions of FP_TO_U/SINT soft float library calls

It appears that neither compiler-rt nor the gnu soft-float libraries actually
implement these conversions. Instead of emitting calls to library functions
that don't exist, handle it similarly to the way we handle i8 -> float and
i16 -> float conversions: call the i32 library function, and adjust the type.

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

llvm-svn: 255643

6 years agoDefine a feature for __float128 support in the PPC back end
Nemanja Ivanovic [Tue, 15 Dec 2015 12:19:34 +0000 (12:19 +0000)]
Define a feature for __float128 support in the PPC back end

This patch corresponds to review:

In preparation for supporting IEEE Quad precision floating point,
this patch simply defines a feature to specify the target supports this.
For now, nothing is done with the target feature, we just don't want
warnings from the Clang FE when a user specifies -mfloat128.
Calling convention and other related work will add to this patch in
the near future.

llvm-svn: 255642

6 years agoMerge ENABLE_THREADS and ENABLE_STD_THREADS markers
Tamas Berghammer [Tue, 15 Dec 2015 12:11:00 +0000 (12:11 +0000)]

Both of these markers are used in the test suit for annotating when a
test needs multi threaded support. Previously they had slightly
different meening but they converged to the point where they are used
interchangably. This CL removes the ENABLE_STD_THREADS one to simplify
the test suite and avoid some confusion.

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

llvm-svn: 255641

6 years ago[OPENMP 4.5] Fix test compatibility with 32 bit mode.
Alexey Bataev [Tue, 15 Dec 2015 11:38:29 +0000 (11:38 +0000)]
[OPENMP 4.5] Fix test compatibility with 32 bit mode.

llvm-svn: 255640

6 years ago[OPENMP 4.5] Codegen for 'hint' clause of 'critical' directive
Alexey Bataev [Tue, 15 Dec 2015 10:55:09 +0000 (10:55 +0000)]
[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

6 years agoImprove the successor list update in TailDuplication.cpp.
Cong Hou [Tue, 15 Dec 2015 10:10:40 +0000 (10:10 +0000)]
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

6 years agoInstCombineLoadStoreAlloca.cpp: Avoid instantiating Twine.
NAKAMURA Takumi [Tue, 15 Dec 2015 09:37:31 +0000 (09:37 +0000)]
InstCombineLoadStoreAlloca.cpp: Avoid instantiating Twine.

llvm-svn: 255637

6 years agoclang/test/Analysis/padding_c.c: Suppress a test incompatible to i686-linux.
NAKAMURA Takumi [Tue, 15 Dec 2015 09:37:01 +0000 (09:37 +0000)]
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

6 years ago[libclang] Add a flag to create the precompiled preamble on the first parse.
Benjamin Kramer [Tue, 15 Dec 2015 09:30:31 +0000 (09:30 +0000)]
[libclang] Add a flag to create the precompiled preamble on the first parse.

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

6 years ago[PassManagerBuilder] Add a few more scalar optimization passes
James Molloy [Tue, 15 Dec 2015 09:24:01 +0000 (09:24 +0000)]
[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

6 years agoMark ThreadPool unittests as unsupported on PowerPC64
Mehdi Amini [Tue, 15 Dec 2015 09:10:28 +0000 (09:10 +0000)]
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

6 years agoThreadPool unittest: add a rough mechanism to mark UNSUPPORTED on a given platform
Mehdi Amini [Tue, 15 Dec 2015 09:10:25 +0000 (09:10 +0000)]
ThreadPool unittest: add a rough mechanism to mark UNSUPPORTED on a given platform

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

6 years agoReapply fixed r255626 that broke buildbot:
George Rimar [Tue, 15 Dec 2015 08:48:39 +0000 (08:48 +0000)]
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

6 years ago[clang-tidy] Check for suspicious string assignments.
Gabor Horvath [Tue, 15 Dec 2015 08:47:20 +0000 (08:47 +0000)]
[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

6 years agoType legalizer for masked gather and scatter intrinsics.
Elena Demikhovsky [Tue, 15 Dec 2015 08:40:41 +0000 (08:40 +0000)]
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

6 years agoRevert of r255626 "[ELF] - refactor of code in RelocationSection<ELFT>::writeTo()"
George Rimar [Tue, 15 Dec 2015 08:39:42 +0000 (08:39 +0000)]
Revert of r255626 "[ELF] - refactor of code in RelocationSection<ELFT>::writeTo()"

as it broke buildbot:
/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

6 years agoAdd a new matcher to match character types.
Gabor Horvath [Tue, 15 Dec 2015 08:35:45 +0000 (08:35 +0000)]
Add a new matcher to match character types.

llvm-svn: 255627

6 years ago[ELF] - refactor of code in RelocationSection<ELFT>::writeTo()
George Rimar [Tue, 15 Dec 2015 08:23:08 +0000 (08:23 +0000)]
[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

6 years ago[OPENMP 4.5] Parsing/sema for 'hint' clause of 'critical' directive.
Alexey Bataev [Tue, 15 Dec 2015 08:19:24 +0000 (08:19 +0000)]
[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

6 years ago[IR] Add classof for GetElementPtrConstantExpr, CompareConstantExpr, InsertValueConst...
Craig Topper [Tue, 15 Dec 2015 06:11:36 +0000 (06:11 +0000)]
[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

6 years agoUse CmpInst::Predicate instead of 'unsigned short' in some places. NFC
Craig Topper [Tue, 15 Dec 2015 06:11:33 +0000 (06:11 +0000)]
Use CmpInst::Predicate instead of 'unsigned short' in some places. NFC

llvm-svn: 255623

6 years ago[ELF][MIPS] Remove applying the redundant bit-mask
Simon Atanasyan [Tue, 15 Dec 2015 06:06:34 +0000 (06:06 +0000)]
[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

6 years agoFix MSVC build with LLVM_ENABLE_THREADS=OFF
Mehdi Amini [Tue, 15 Dec 2015 05:53:41 +0000 (05:53 +0000)]

Follow-up to the ThreadPool implementation.

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

6 years agoLoopUtils: Remove defaults for arguments that are always specified. NFC
Justin Bogner [Tue, 15 Dec 2015 05:52:13 +0000 (05:52 +0000)]
LoopUtils: Remove defaults for arguments that are always specified. NFC

llvm-svn: 255620

6 years ago[LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 instruction sets
Sagar Thakur [Tue, 15 Dec 2015 05:50:55 +0000 (05:50 +0000)]
[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

6 years agoReplace the unit test of BranchProbability::normalizeEdgeWeights() with BranchProbabi...
Cong Hou [Tue, 15 Dec 2015 05:25:27 +0000 (05:25 +0000)]
Replace the unit test of BranchProbability::normalizeEdgeWeights() with BranchProbability::normalizeProbabilities().

BranchProbability::normalizeEdgeWeights() is going to be retired soon.

llvm-svn: 255618

6 years agoFix template parameter pack handling in ThreadPool
Teresa Johnson [Tue, 15 Dec 2015 04:44:02 +0000 (04:44 +0000)]
Fix template parameter pack handling in ThreadPool

Fixes passing of template parameter pack via std::forward and add

llvm-svn: 255617

Weiming Zhao [Tue, 15 Dec 2015 04:42:49 +0000 (04:42 +0000)]

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

6 years agoNFC: Fix typo in comment
Vaivaswatha Nagaraj [Tue, 15 Dec 2015 04:41:10 +0000 (04:41 +0000)]
NFC: Fix typo in comment

llvm-svn: 255615

6 years ago[ShrinkWrapping] Do not choose restore point inside loops.
Quentin Colombet [Tue, 15 Dec 2015 03:28:11 +0000 (03:28 +0000)]
[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.
 while(1) {
   if (...)
   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

6 years ago[WebAssembly] Use an immediate OperandType for offset operands.
Dan Gohman [Tue, 15 Dec 2015 03:21:48 +0000 (03:21 +0000)]
[WebAssembly] Use an immediate OperandType for offset operands.

llvm-svn: 255612

6 years agoTry to let r255604 have an effect.
Nico Weber [Tue, 15 Dec 2015 03:14:19 +0000 (03:14 +0000)]
Try to let r255604 have an effect.

llvm-svn: 255611

6 years agoAdd specific header for MSVC to be able to build with LLVM_ENABLE_THREADS=OFF
Mehdi Amini [Tue, 15 Dec 2015 02:32:03 +0000 (02:32 +0000)]
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

6 years agoFix a bug where language categories would hold on to their caches even after changes
Enrico Granata [Tue, 15 Dec 2015 02:20:48 +0000 (02:20 +0000)]
Fix a bug where language categories would hold on to their caches even after changes

llvm-svn: 255603

6 years ago[WebAssembly] Remove .import printing.
Dan Gohman [Tue, 15 Dec 2015 02:20:44 +0000 (02:20 +0000)]
[WebAssembly] Remove .import printing.

For now, LLVM doesn't know about wasm module imports, so it shouldn't
emit .import directives.

llvm-svn: 255602

6 years agoWebAssembly: test global array indexing
JF Bastien [Tue, 15 Dec 2015 02:02:51 +0000 (02:02 +0000)]
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

6 years agoInstcombine: destructor loads of structs that do not contains padding
Mehdi Amini [Tue, 15 Dec 2015 01:44:07 +0000 (01:44 +0000)]
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

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

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

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

6 years agoMark declarations of externally instantiated functions as inline so GCC doesn't complain.
Eric Fiselier [Tue, 15 Dec 2015 01:41:41 +0000 (01:41 +0000)]
Mark declarations of externally instantiated functions as inline so GCC doesn't complain.

llvm-svn: 255599

6 years agoFix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr warnings...
Eugene Zelenko [Tue, 15 Dec 2015 01:33:19 +0000 (01:33 +0000)]
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

6 years agoAdd NetBSDSignals.cpp to the xcode project file.
Jason Molenda [Tue, 15 Dec 2015 01:26:25 +0000 (01:26 +0000)]
Add NetBSDSignals.cpp to the xcode project file.

llvm-svn: 255597

6 years ago[llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping
Reid Kleckner [Tue, 15 Dec 2015 01:23:55 +0000 (01:23 +0000)]
[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

6 years agoLet operator/ with uint32_t rhs operand be a member of BranchProbability and add...
Cong Hou [Tue, 15 Dec 2015 01:21:14 +0000 (01:21 +0000)]
Let operator/ with uint32_t rhs operand be a member of BranchProbability and add a new operator /=. NFC.

llvm-svn: 255595

6 years ago[asan] try to fix ARM bots
Kostya Serebryany [Tue, 15 Dec 2015 01:05:35 +0000 (01:05 +0000)]
[asan] try to fix ARM bots

llvm-svn: 255594

6 years agoAdd a C++11 ThreadPool implementation in LLVM
Mehdi Amini [Tue, 15 Dec 2015 00:59:19 +0000 (00:59 +0000)]
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:


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

6 years agoWelcome to NetBSD signals
Kamil Rytarowski [Tue, 15 Dec 2015 00:50:19 +0000 (00:50 +0000)]
Welcome to NetBSD signals

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 */

Reviewers: emaste, joerg

Subscribers: lldb-commits

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

llvm-svn: 255592

6 years agoRevert "Add a C++11 ThreadPool implementation in LLVM"
Mehdi Amini [Tue, 15 Dec 2015 00:42:44 +0000 (00:42 +0000)]
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

6 years agoWhen constructing an address range to "step" or "next" through,
Jason Molenda [Tue, 15 Dec 2015 00:40:30 +0000 (00:40 +0000)]
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.


llvm-svn: 255590

6 years agoAdd a C++11 ThreadPool implementation in LLVM
Mehdi Amini [Tue, 15 Dec 2015 00:38:05 +0000 (00:38 +0000)]
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:


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

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

6 years ago[asan] add option: handle_sigill
Kostya Serebryany [Tue, 15 Dec 2015 00:33:45 +0000 (00:33 +0000)]
[asan] add option: handle_sigill

llvm-svn: 255588

6 years ago[PGO] make profile prefix even shorter and more readable
Xinliang David Li [Tue, 15 Dec 2015 00:33:12 +0000 (00:33 +0000)]
[PGO] make profile prefix even shorter and more readable

llvm-svn: 255587

6 years ago[PGO] make profile prefix even shorter and more readable
Xinliang David Li [Tue, 15 Dec 2015 00:32:56 +0000 (00:32 +0000)]
[PGO] make profile prefix even shorter and more readable

llvm-svn: 255586

6 years agoFix various GCC mis-configurations for newer versions.
Eric Fiselier [Tue, 15 Dec 2015 00:32:21 +0000 (00:32 +0000)]
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

6 years agoMake few adjustments after r255542.
Siva Chandra [Tue, 15 Dec 2015 00:26:52 +0000 (00:26 +0000)]
Make few adjustments after r255542.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 255584

6 years ago[X86] Add relaxtion logic for SBB instructions.
Quentin Colombet [Tue, 15 Dec 2015 00:09:23 +0000 (00:09 +0000)]
[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.


llvm-svn: 255583

6 years agosancov: coverage can be reported by multiple functions.
Mike Aizatsky [Mon, 14 Dec 2015 23:55:04 +0000 (23:55 +0000)]
sancov: coverage can be reported by multiple functions.

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

llvm-svn: 255582

6 years agotest infra: catch and print exception info on test runner socket listener
Todd Fiala [Mon, 14 Dec 2015 23:45:38 +0000 (23:45 +0000)]
test infra: catch and print exception info on test runner socket listener

This is the listener's spawned connection, not the listener itself.
(i.e. this is the test runner's receiving side of test event sockets).
A standard socket.error will just issue an INFO statement and continue.
Something other than a socket.error will get an ERROR: printed (and
also continue).

Hopefully this gets us more info and also handles the completely
to-be-expected scenario that the test inferior might go down at
any point.

llvm-svn: 255581

6 years agoFix typos; NFC
Michael Kruse [Mon, 14 Dec 2015 23:41:32 +0000 (23:41 +0000)]
Fix typos; NFC

llvm-svn: 255580

6 years agoYet another missing include.
Rafael Espindola [Mon, 14 Dec 2015 23:39:05 +0000 (23:39 +0000)]
Yet another missing include.

llvm-svn: 255579

6 years agoA better attempt to add a missing include
Rafael Espindola [Mon, 14 Dec 2015 23:34:35 +0000 (23:34 +0000)]
A better attempt to add a missing include

llvm-svn: 255578

6 years agoTrying to fix the build in a bot.
Rafael Espindola [Mon, 14 Dec 2015 23:31:08 +0000 (23:31 +0000)]
Trying to fix the build in a bot.

llvm-svn: 255577

6 years ago[PGO] Shorten profile symbol prefixes
Xinliang David Li [Mon, 14 Dec 2015 23:26:46 +0000 (23:26 +0000)]
[PGO] Shorten profile symbol prefixes

(test case update)
Profile symbols have long prefixes which waste space and creating pressure for linker.
This patch shortens the prefixes to minimal length without losing verbosity.

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

llvm-svn: 255576

6 years ago[PGO] Shorten profile symbol prefixes
Xinliang David Li [Mon, 14 Dec 2015 23:26:27 +0000 (23:26 +0000)]
[PGO] Shorten profile symbol prefixes

Profile symbols have long prefixes which waste space and creating pressure for linker.
This patch shortens the prefixes to minimal length without losing verbosity.

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

llvm-svn: 255575

6 years agoLoopRotate: Convert the methods of LoopRotate to utility functions. NFC
Justin Bogner [Mon, 14 Dec 2015 23:22:48 +0000 (23:22 +0000)]
LoopRotate: Convert the methods of LoopRotate to utility functions. NFC

This moves the actual work to do loop rotation into standalone
functions with the analysis results they need passed in as arguments,
leaving the class itself as a relatively simple shim. This will make
the functions easy to reuse when we're ready to port this
transformation to the new pass manager.

llvm-svn: 255574

6 years agoLoopRotate: Reorder some method implementations. NFC
Justin Bogner [Mon, 14 Dec 2015 23:22:44 +0000 (23:22 +0000)]
LoopRotate: Reorder some method implementations. NFC

This just moves some callers after their callees. My next patch will
convert some of these methods to stand alone functions, and that diff
is more obviously NFC if I move these first. That change, in turn,
will make it much easier to port this pass to the new pass manager
once the loop pass manager is in place.

llvm-svn: 255573

6 years agoUpdate for llvm api change.
Rafael Espindola [Mon, 14 Dec 2015 23:17:07 +0000 (23:17 +0000)]
Update for llvm api change.

llvm-svn: 255572

6 years agoUse diagnostic handler in the LLVMContext
Rafael Espindola [Mon, 14 Dec 2015 23:17:03 +0000 (23:17 +0000)]
Use diagnostic handler in the LLVMContext

This patch converts code that has access to a LLVMContext to not take a
diagnostic handler.

This has a few advantages

* It is easier to use a consistent diagnostic handler in a single program.
* Less clutter since we are not passing a handler around.

It does make it a bit awkward to implement some C APIs that return a
diagnostic string. I will propose new versions of these APIs and
deprecate the current ones.

llvm-svn: 255571

6 years ago[X86] Add relaxtion logic for ADC instructions.
Quentin Colombet [Mon, 14 Dec 2015 23:12:40 +0000 (23:12 +0000)]
[X86] Add relaxtion logic for ADC instructions.

Prior to this patch, we would wrongly stick to the variant with imm8 encoding
even when the relocation could not fit that size.


llvm-svn: 255570

6 years agoFactor out some duplication. NFC.
Pete Cooper [Mon, 14 Dec 2015 23:10:52 +0000 (23:10 +0000)]
Factor out some duplication.  NFC.

llvm-svn: 255569

6 years ago[Test] Addresses failing test when path to make contains spaces
Kate Stone [Mon, 14 Dec 2015 22:59:26 +0000 (22:59 +0000)]
[Test] Addresses failing test when path to make contains spaces

llvm-svn: 255568

6 years agoRemove the multiplier loop.
Zachary Turner [Mon, 14 Dec 2015 22:58:16 +0000 (22:58 +0000)]
Remove the multiplier loop.

This is leading to some kind of subtle issue related to local
functions and closures, so let's just go back to the old way for

llvm-svn: 255567

6 years ago[msan] Intercept ctermid, ctermid_r.
Evgeniy Stepanov [Mon, 14 Dec 2015 22:57:49 +0000 (22:57 +0000)]
[msan] Intercept ctermid, ctermid_r.

llvm-svn: 255566

6 years ago[WebAssembly] Add type prefixes to call instructions
Dan Gohman [Mon, 14 Dec 2015 22:56:51 +0000 (22:56 +0000)]
[WebAssembly] Add type prefixes to call instructions

Add return type information to call and call_indirect instructions. This
allows them to be disambiguated without knowledge of the callee.

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

llvm-svn: 255565

6 years ago[WebAssembly] Implement a new algorithm for placing BLOCK markers
Dan Gohman [Mon, 14 Dec 2015 22:51:54 +0000 (22:51 +0000)]
[WebAssembly] Implement a new algorithm for placing BLOCK markers

Implement a new BLOCK scope placement algorithm which better handles
early-return blocks and early exists from nested scopes.

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

llvm-svn: 255564

6 years ago[WebAssembly] Avoid adding redundant EXPR_STACK uses.
Dan Gohman [Mon, 14 Dec 2015 22:37:23 +0000 (22:37 +0000)]
[WebAssembly] Avoid adding redundant EXPR_STACK uses.

llvm-svn: 255563

6 years agoRevert "Don't create unnecessary PHIs"
Reid Kleckner [Mon, 14 Dec 2015 22:36:57 +0000 (22:36 +0000)]
Revert "Don't create unnecessary PHIs"

This reverts commit r255489.

It causes test failures in Chromium and does not appear to respect the
AlternativeV parameter.

llvm-svn: 255562

6 years agoUpdate paths in libc++ build instructions. Patch from Jonathan Anderson.
Eric Fiselier [Mon, 14 Dec 2015 22:26:28 +0000 (22:26 +0000)]
Update paths in libc++ build instructions. Patch from Jonathan Anderson.

llvm-svn: 255561

6 years agoUpdate how libc++/libc++abi link the tests. Follow up on r255559.
Eric Fiselier [Mon, 14 Dec 2015 22:24:19 +0000 (22:24 +0000)]
Update how libc++/libc++abi link the tests. Follow up on r255559.

llvm-svn: 255560