oota-llvm.git
8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255643 91177308-0d34-0410-b5e6-96231b3b80d8

8 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:
http://reviews.llvm.org/D15117

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255642 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255638 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255637 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255634 91177308-0d34-0410-b5e6-96231b3b80d8

8 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255633 91177308-0d34-0410-b5e6-96231b3b80d8

8 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255632 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255629 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255624 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255623 91177308-0d34-0410-b5e6-96231b3b80d8

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

Follow-up to the ThreadPool implementation.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255621 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255620 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255618 91177308-0d34-0410-b5e6-96231b3b80d8

8 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
unittest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255617 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoBump up MAX_SUBTARGET_FEATURES
Weiming Zhao [Tue, 15 Dec 2015 04:42:49 +0000 (04:42 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255616 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255615 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255613 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255612 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255611 91177308-0d34-0410-b5e6-96231b3b80d8

8 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255604 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255602 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255601 91177308-0d34-0410-b5e6-96231b3b80d8

8 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
case.

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

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255600 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255596 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255595 91177308-0d34-0410-b5e6-96231b3b80d8

8 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:

 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255593 91177308-0d34-0410-b5e6-96231b3b80d8

8 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255591 91177308-0d34-0410-b5e6-96231b3b80d8

8 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:

 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255589 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255586 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

rdar://problem/23785506

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255583 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255582 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255579 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255578 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255577 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255575 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255574 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255573 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255571 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

rdar://problem/23785506

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255570 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255569 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255565 91177308-0d34-0410-b5e6-96231b3b80d8

8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255564 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255563 91177308-0d34-0410-b5e6-96231b3b80d8

8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255562 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Part 2 to fix x86-64 fp128 calling convention.
Chih-Hung Hsieh [Mon, 14 Dec 2015 22:08:36 +0000 (22:08 +0000)]
[X86] Part 2 to fix x86-64 fp128 calling convention.

Part 1 was submitted in http://reviews.llvm.org/D15134.
Changes in this part:
* X86RegisterInfo.td, X86RecognizableInstr.cpp: Add FR128 register class.
* X86CallingConv.td: Pass f128 values in XMM registers or on stack.
* X86InstrCompiler.td, X86InstrInfo.td, X86InstrSSE.td:
  Add instruction selection patterns for f128.
* X86ISelLowering.cpp:
  When target has MMX registers, configure MVT::f128 in FR128RegClass,
  with TypeSoftenFloat action, and custom actions for some opcodes.
  Add missed cases of MVT::f128 in places that handle f32, f64, or vector types.
  Add TODO comment to support f128 type in inline assembly code.
* SelectionDAGBuilder.cpp:
  Fix infinite loop when f128 type can have
  VT == TLI.getTypeToTransformTo(Ctx, VT).
* Add unit tests for x86-64 fp128 type.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255558 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoadd fast-math-flags to 'call' instructions (PR21290)
Sanjay Patel [Mon, 14 Dec 2015 21:59:03 +0000 (21:59 +0000)]
add fast-math-flags to 'call' instructions (PR21290)

This patch adds optional fast-math-flags (the same that apply to fmul/fadd/fsub/fdiv/frem/fcmp)
to call instructions in IR. Follow-up patches would use these flags in LibCallSimplifier, add
support to clang, and extend FMF to the DAG for calls.

Motivating example:

%y = fmul fast float %x, %x
%z = tail call float @sqrtf(float %y)

We'd like to be able to optimize sqrt(x*x) into fabs(x). We do this today using a function-wide
attribute for unsafe-math, but we really want to trigger on the instructions themselves:

%z = tail call fast float @sqrtf(float %y)

because in an LTO build it's possible that calls with fast semantics have been inlined into a
function with non-fast semantics.

The code changes and tests are based on the recent commits that added "notail":
http://reviews.llvm.org/rL252368

and added FMF to fcmp:
http://reviews.llvm.org/rL241901

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255555 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReordering fields to reduce padding in LLVM. NFC
Ben Craig [Mon, 14 Dec 2015 21:57:05 +0000 (21:57 +0000)]
Reordering fields to reduce padding in LLVM.  NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255554 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Add an assert to sanity-check dead flags.
Dan Gohman [Mon, 14 Dec 2015 21:53:54 +0000 (21:53 +0000)]
[WebAssembly] Add an assert to sanity-check dead flags.

The WebAssemblyStoreResults pass runs before LiveVariables, so it doesn't
expect to have to keep dead flags up to date; check this with an assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255551 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoStart implementing FDE dumping when printing the eh_frame.
Pete Cooper [Mon, 14 Dec 2015 21:49:49 +0000 (21:49 +0000)]
Start implementing FDE dumping when printing the eh_frame.

This code adds some simple decoding of the FDE's in an eh_frame.

There's still more to be done in terms of error handling and verification.

Also, we need to be able to decode the CFI's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255550 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPrint the eh_frame section in MachoDump.
Pete Cooper [Mon, 14 Dec 2015 21:39:27 +0000 (21:39 +0000)]
Print the eh_frame section in MachoDump.

This is the start of work to dump the contents of the eh_frame section.

It currently emits CIE entries.  FDE entries will come later.

It also needs improved error checking which will follow soon.

http://reviews.llvm.org/D15502

Reviewed by Kevin Enderby and Lang Hames.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255546 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Add "const" to function parameters in HexagonInstrInfo
Krzysztof Parzyszek [Mon, 14 Dec 2015 21:32:25 +0000 (21:32 +0000)]
[Hexagon] Add "const" to function parameters in HexagonInstrInfo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255544 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix formatting. NFC.
Diego Novillo [Mon, 14 Dec 2015 20:37:15 +0000 (20:37 +0000)]
Fix formatting. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255541 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Packetizer] Add AliasAnalysis as a parameter to the packetizer
Krzysztof Parzyszek [Mon, 14 Dec 2015 20:35:13 +0000 (20:35 +0000)]
[Packetizer] Add AliasAnalysis as a parameter to the packetizer

This will make the depedence graph more accurate if an alias analysis
is provided. If nullptr is specified in its place, the behavior will
remain as it is currently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255540 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd missing vtable anchor's.
Pete Cooper [Mon, 14 Dec 2015 20:29:16 +0000 (20:29 +0000)]
Add missing vtable anchor's.

The following description is from http://reviews.llvm.org/D15481:

ICmpInst, GetElementPtrInst and PHINode have no anchor functions. This causes the vtable and the type info (if RTTI is enabled in user code) to be emitted in multiple translation units.

Before 3.7, the destructors were the key functions for these nodes, but they have been removed.

There have been discussions about this here: http://lists.llvm.org/pipermail/llvm-dev/2015-August/089010.html and here: http://lists.llvm.org/pipermail/llvm-dev/2015-December/092921.html.

Patch by Visoiu Mistrih Francis

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255538 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Packetizer] Make endPacket virtual
Krzysztof Parzyszek [Mon, 14 Dec 2015 20:12:24 +0000 (20:12 +0000)]
[Packetizer] Make endPacket virtual

This will allow custom handling of packet finalization. The current
definition of endPacket will still perform the default finalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255537 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ConstantFold] Fix bitcast to gep constant folding transform.
David Majnemer [Mon, 14 Dec 2015 19:30:32 +0000 (19:30 +0000)]
[ConstantFold] Fix bitcast to gep constant folding transform.

Make sure to check that the destination type is sized.
A check was present but was incorrectly checking the source type
instead.

Patch by Amaury SECHET!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255536 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSave several std::string constructions using llvm::Twine.
Yaron Keren [Mon, 14 Dec 2015 19:28:40 +0000 (19:28 +0000)]
Save several std::string constructions using llvm::Twine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255535 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agodocs: Correct wording in LangRef relating to available_externally linkage.
Peter Collingbourne [Mon, 14 Dec 2015 19:22:37 +0000 (19:22 +0000)]
docs: Correct wording in LangRef relating to available_externally linkage.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255534 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove the successor probabilities normalization in tail duplication pass.
Cong Hou [Mon, 14 Dec 2015 19:11:54 +0000 (19:11 +0000)]
Remove the successor probabilities normalization in tail duplication pass.

The normalization may cause assertion failures on SystemZ and some out-of-tree
tests. The root cause is that unknown probabilities are materialized into known
ones by calling getSuccProbability(), which is then used to add another
successor to the same MBB which results in mixed known and unknown
probabilities. But currently those mixed probabilities cannot be normalized.

I will compose another patch to fix the root issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255530 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MergeFunctions] Use II instead of CI for InvokeInst; NFC
Sanjoy Das [Mon, 14 Dec 2015 19:11:45 +0000 (19:11 +0000)]
[MergeFunctions] Use II instead of CI for InvokeInst; NFC

Using `CI` is slightly misleading.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255529 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTeach MergeFunctions about operand bundles
Sanjoy Das [Mon, 14 Dec 2015 19:11:40 +0000 (19:11 +0000)]
Teach MergeFunctions about operand bundles

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255528 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTeach haveSameSpecialState about operand bundles
Sanjoy Das [Mon, 14 Dec 2015 19:11:35 +0000 (19:11 +0000)]
Teach haveSameSpecialState about operand bundles

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255527 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd "const" to function arguments in DFAPacketizer
Krzysztof Parzyszek [Mon, 14 Dec 2015 18:54:44 +0000 (18:54 +0000)]
Add "const" to function arguments in DFAPacketizer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255526 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PGO] Value profiling text format reader/writer support
Xinliang David Li [Mon, 14 Dec 2015 18:44:01 +0000 (18:44 +0000)]
[PGO] Value profiling text format reader/writer support

This patch adds the missing functionality in parsable
text format support for value profiling.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255523 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR] Remove terminatepad
David Majnemer [Mon, 14 Dec 2015 18:34:23 +0000 (18:34 +0000)]
[IR] Remove terminatepad

It turns out that terminatepad gives little benefit over a cleanuppad
which calls the termination function.  This is not sufficient to
implement fully generic filters but MSVC doesn't support them which
makes terminatepad a little over-designed.

Depends on D15478.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255522 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFastISel needs to remove dead code when it bails out.
Paul Robinson [Mon, 14 Dec 2015 18:33:18 +0000 (18:33 +0000)]
FastISel needs to remove dead code when it bails out.

When FastISel fails to translate an instruction it hands off code
generation to SelectionDAG. Before it does so, it may have generated
local value instructions to feed phi nodes in successor blocks. These
instructions will then be generated again by SelectionDAG, causing
duplication and less efficient code, including extra spill
instructions.

Patch by Wolfgang Pieb!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255520 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Power PC] llvm soft float support for ppc32
Petar Jovanovic [Mon, 14 Dec 2015 17:57:33 +0000 (17:57 +0000)]
[Power PC] llvm soft float support for ppc32

This is the second in a set of patches for soft float support for ppc32,
it enables soft float operations.

Patch by Strahinja Petrovic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255516 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Use generic bitreverse intrinsic
Matt Arsenault [Mon, 14 Dec 2015 17:25:38 +0000 (17:25 +0000)]
AMDGPU: Use generic bitreverse intrinsic

Also fix bug in vector legalization for bitreverse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255512 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agogetParent() ^ 3 == getModule() ; NFCI
Sanjay Patel [Mon, 14 Dec 2015 17:24:23 +0000 (17:24 +0000)]
getParent() ^ 3 == getModule() ; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255511 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove dead function AArch64TargetLowering::getFunctionAlignment. NFC.
Geoff Berry [Mon, 14 Dec 2015 17:01:10 +0000 (17:01 +0000)]
Remove dead function AArch64TargetLowering::getFunctionAlignment. NFC.

Reviewers: t.p.northover, jmolloy, mcrosier

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255509 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Fix splitting vector loads with existing offsets
Matt Arsenault [Mon, 14 Dec 2015 16:59:40 +0000 (16:59 +0000)]
AMDGPU: Fix splitting vector loads with existing offsets

If the original MMO had an offset, it was dropped.
Also use the correct alignment after adding the new offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255508 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] fold trunc ([lshr] (bitcast vector) ) --> extractelement (PR25543)
Sanjay Patel [Mon, 14 Dec 2015 16:16:54 +0000 (16:16 +0000)]
[InstCombine] fold trunc ([lshr] (bitcast vector) ) --> extractelement (PR25543)

This is a fix for PR25543:
https://llvm.org/bugs/show_bug.cgi?id=25543

The idea is to take the existing fold of:
bitcast ( trunc ( lshr ( bitcast X))) --> extractelement (bitcast X)
( http://reviews.llvm.org/rL112232 )

And break it into less specific transforms so we'll catch more cases such as
the example in the bug report:
bitcast ( trunc ( lshr ( bitcast X))) -->
bitcast ( extractelement (bitcast X)) -->
extractelement (bitcast X)

Enabling patches for this change:
http://reviews.llvm.org/rL255399 (combine bitcasts)
http://reviews.llvm.org/rL255433 (canonicalize extractelement(bitcast X))

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255504 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Subtarget features/default CPU corrections
Krzysztof Parzyszek [Mon, 14 Dec 2015 15:03:54 +0000 (15:03 +0000)]
[Hexagon] Subtarget features/default CPU corrections

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255501 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPC] Early exit loop. NFC.
Chad Rosier [Mon, 14 Dec 2015 14:44:06 +0000 (14:44 +0000)]
[PPC] Early exit loop. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255497 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[sanitizer] [msan] VarArgHelper for AArch64
Adhemerval Zanella [Mon, 14 Dec 2015 14:14:15 +0000 (14:14 +0000)]
[sanitizer] [msan] VarArgHelper for AArch64

This patch add support for variadic argument for AArch64.  All the MSAN
unit tests are not passing as well the signal_stress_test (currently
set as XFAIl for aarch64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255495 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDon't create unnecessary PHIs
James Molloy [Mon, 14 Dec 2015 10:57:01 +0000 (10:57 +0000)]
Don't create unnecessary PHIs

In conditional store merging, we were creating PHIs when we didn't
need to. If the value to be predicated isn't defined in the block
we're predicating, then it doesn't need a PHI at all (because we only
deal with triangles and diamonds, any value not in the predicated BB
must dominate the predicated BB).

This fixes a large code size increase in some benchmarks in a popular embedded benchmark suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255489 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReformat to untabify.
NAKAMURA Takumi [Mon, 14 Dec 2015 07:58:25 +0000 (07:58 +0000)]
Reformat to untabify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255483 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-dwp] Deduplicate type units
David Blaikie [Mon, 14 Dec 2015 07:42:00 +0000 (07:42 +0000)]
[llvm-dwp] Deduplicate type units

It's O(N^2) because it does a simple walk through the existing types to
find duplicates, but that will be fixed in a follow-up commit to use a
mapping data structure of some kind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255482 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-dwp] Remove some unused test code
David Blaikie [Mon, 14 Dec 2015 07:41:56 +0000 (07:41 +0000)]
[llvm-dwp] Remove some unused test code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255481 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Docs] Fix underlines that were too short or too long.
Akira Hatanaka [Mon, 14 Dec 2015 05:15:40 +0000 (05:15 +0000)]
[Docs] Fix underlines that were too short or too long.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255480 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoI Added a triple flag for x86-evenDirective test.
Michael Zuckerman [Sun, 13 Dec 2015 21:12:33 +0000 (21:12 +0000)]
I Added a triple flag for x86-evenDirective test.

Continue of rL255461

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255469 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r255460, which still causes test failures on some platforms.
Cong Hou [Sun, 13 Dec 2015 17:15:38 +0000 (17:15 +0000)]
Revert r255460, which still causes test failures on some platforms.

Further investigation on the failures is ongoing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255463 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][inline asm] support even directive
Michael Zuckerman [Sun, 13 Dec 2015 17:07:23 +0000 (17:07 +0000)]
[X86][inline asm] support even directive

The .even directive aligns content to an evan-numbered address.

In at&t syntax .even
In Microsoft syntax even (without the dot).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255462 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a type issue in r255455. Should not use unsigned type as std::abs()'s template...
Cong Hou [Sun, 13 Dec 2015 17:00:25 +0000 (17:00 +0000)]
Fix a type issue in r255455. Should not use unsigned type as std::abs()'s template type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255461 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring speci...
Cong Hou [Sun, 13 Dec 2015 16:55:46 +0000 (16:55 +0000)]
[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring specific instructions.

(This is the second attempt to check in this patch: REQUIRES: asserts is added
to reg-usage.ll now.)

LoopVectorizationCostModel::calculateRegisterUsage() is used to estimate the
register usage for specific VFs. However, it takes into account many
instructions that won't be vectorized, such as induction variables,
GetElementPtr instruction, etc.. This makes the loop vectorizer too conservative
when choosing VF. In this patch, the induction variables that won't be
vectorized plus GetElementPtr instruction will be added to ValuesToIgnore set
so that their register usage won't be considered any more.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255460 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix line endings
Simon Pilgrim [Sun, 13 Dec 2015 12:49:48 +0000 (12:49 +0000)]
Fix line endings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255459 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReplace <cstdint> by llvm/Support/DataTypes.h for the typedef of uint64_t. NFC.
Cong Hou [Sun, 13 Dec 2015 09:52:14 +0000 (09:52 +0000)]
Replace <cstdint> by llvm/Support/DataTypes.h for the typedef of uint64_t. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255458 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd the missing header file <cstdint> needed by uint64_t
Cong Hou [Sun, 13 Dec 2015 09:32:21 +0000 (09:32 +0000)]
Add the missing header file <cstdint> needed by uint64_t

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255457 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r255454 as it leads to several test failers on buildbots.
Cong Hou [Sun, 13 Dec 2015 09:28:57 +0000 (09:28 +0000)]
Revert r255454 as it leads to several test failers on buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255456 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNormalize MBB's successors' probabilities in several locations.
Cong Hou [Sun, 13 Dec 2015 09:26:17 +0000 (09:26 +0000)]
Normalize MBB's successors' probabilities in several locations.

This patch adds some missing calls to MBB::normalizeSuccProbs() in several
locations where it should be called. Those places are found by checking if the
sum of successors' probabilities is approximate one in MachineBlockPlacement
pass with some instrumented code (not in this patch).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255455 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring speci...
Cong Hou [Sun, 13 Dec 2015 08:44:08 +0000 (08:44 +0000)]
[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring specific instructions.

LoopVectorizationCostModel::calculateRegisterUsage() is used to estimate the
register usage for specific VFs. However, it takes into account many
instructions that won't be vectorized, such as induction variables,
GetElementPtr instruction, etc.. This makes the loop vectorizer too conservative
when choosing VF. In this patch, the induction variables that won't be
vectorized plus GetElementPtr instruction will be added to ValuesToIgnore set
so that their register usage won't be considered any more.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255454 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoARM: only emit EABI attributes on EABI targets
Saleem Abdulrasool [Sun, 13 Dec 2015 05:27:45 +0000 (05:27 +0000)]
ARM: only emit EABI attributes on EABI targets

EABI attributes should only be emitted on EABI targets.  This prevents the
emission of the optimization goals EABI attribute on Windows ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255448 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r255444.
Nico Weber [Sun, 13 Dec 2015 04:14:39 +0000 (04:14 +0000)]
Revert r255444.

It doesn't build on Windows and broke the Windows LLD and LLDB bots:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/27693/steps/build_Lld/logs/stdio
http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/13468/steps/build/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255446 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a C++11 ThreadPool implementation in LLVM
Mehdi Amini [Sat, 12 Dec 2015 22:55:25 +0000 (22:55 +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.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255444 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-objdump/MachoDump] Simplify.
Davide Italiano [Sat, 12 Dec 2015 21:50:11 +0000 (21:50 +0000)]
[llvm-objdump/MachoDump] Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255443 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][AVX512] Added support for VMOVQ shuffle comments
Simon Pilgrim [Sat, 12 Dec 2015 21:46:23 +0000 (21:46 +0000)]
[X86][AVX512] Added support for VMOVQ shuffle comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255442 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPartially fix memcpy / memset / memmove lowering in SelectionDAG construction if...
Manuel Jacob [Sat, 12 Dec 2015 21:33:31 +0000 (21:33 +0000)]
Partially fix memcpy / memset / memmove lowering in SelectionDAG construction if address space != 0.

Summary:
Previously SelectionDAGBuilder asserted that the pointer operands of
memcpy / memset / memmove intrinsics are in address space < 256.  This assert
implicitly assumed the X86 backend, where all address spaces < 256 are
equivalent to address space 0 from the code generator's point of view.  On some
targets (R600 and NVPTX) several address spaces < 256 have a target-defined
meaning, so this assert made little sense for these targets.

This patch removes this wrong assertion and adds extra checks before lowering
these intrinsics to library calls.  If a pointer operand can't be casted to
address space 0 without changing semantics, a fatal error is reported to the
user.

The new behavior should be valid for all targets that give address spaces != 0
a target-specified meaning (NVPTX, R600, X86).  NVPTX lowers big or
variable-sized memory intrinsics before SelectionDAG construction.  All other
memory intrinsics are inlined (the threshold is set very high for this target).
R600 doesn't support memcpy / memset / memmove library calls (previously the
illegal emission of a call to such library function triggered an error
somewhere in the code generator).  X86 now emits inline loads and stores for
address spaces 256 and 257 up to the same threshold that is used for address
space 0 and reports a fatal error otherwise.

I call this a "partial fix" because there are still cases that can't be
lowered.  A fatal error is reported in these cases.

Reviewers: arsenm, theraven, compnerd, hfinkel

Subscribers: hfinkel, llvm-commits, alex

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255441 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PGO] Stop using invalid char in instr variable names.
Xinliang David Li [Sat, 12 Dec 2015 17:28:03 +0000 (17:28 +0000)]
[PGO] Stop using invalid char in instr variable names.

Before the patch, -fprofile-instr-generate compile will fail
if no integrated-as is specified when the file contains
any static functions (the -S output is also invalid).

This is the second try. The fix in this patch is very localized.
Only profile symbol names of profile symbols with internal
linkage are fixed up while initializer of name syms are not
changes. This means there is no format change nor version bump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255434 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] canonicalize (bitcast (extractelement X)) --> (extractelement(bitcast X))
Sanjay Patel [Sat, 12 Dec 2015 16:44:48 +0000 (16:44 +0000)]
[InstCombine] canonicalize (bitcast (extractelement X)) --> (extractelement(bitcast X))

This change was discussed in D15392. It allows us to remove the fold that was added
in:
http://reviews.llvm.org/r255261

...and it will allow us to generalize this fold:
http://reviews.llvm.org/rL112232

while preserving the order of bitcast + extract that it produces and testing shows
is better handled by the backend.

Note that the existing check for "isVectorTy()" wasn't strong enough in general
and specifically because: x86_mmx. It's not a vector, but it's not vectorizable
either. So here we check VectorType::isValidElementType() directly before
proceeding with the transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255433 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][AVX] Tests tidyup
Simon Pilgrim [Sat, 12 Dec 2015 12:52:52 +0000 (12:52 +0000)]
[X86][AVX] Tests tidyup

Cleanup/regenerate some tests for some upcoming patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255432 91177308-0d34-0410-b5e6-96231b3b80d8