]> granicus.if.org Git - llvm/log
llvm
7 years agoRevert "Turn some C-style vararg into variadic templates"
Diana Picus [Tue, 11 Apr 2017 10:07:12 +0000 (10:07 +0000)]
Revert "Turn some C-style vararg into variadic templates"

This reverts commit r299925 because it broke the buildbots. See e.g.
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/6008

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

7 years ago[SelectionDAG] Check CALLSEQ_BEGIN nodes in DelayForLiveRegs
Sam Parker [Tue, 11 Apr 2017 08:43:32 +0000 (08:43 +0000)]
[SelectionDAG] Check CALLSEQ_BEGIN nodes in DelayForLiveRegs

A fix for the bug reported in PR30911.

The issue arises when multiple CALLSEQ_BEGIN nodes are unscheduled as
the last node to be unscheduled will gain access to the CallResource
register. But when a node is being picked, only CALLSEQ_END nodes are
checked against the CallResource and have their chains evaluated.
This then means that other CALLSEQ_BEGIN nodes can be scheduled
before the existing call sequence has been finalised. This patch adds
a check against the FrameSetup nodes in DelayForLiveRegs to prevent
this from happening.

Differential Revision: https://reviews.llvm.org/D31536

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

7 years agoTurn some C-style vararg into variadic templates
Serge Guelton [Tue, 11 Apr 2017 08:36:52 +0000 (08:36 +0000)]
Turn some C-style vararg into variadic templates

Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.

From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.

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

7 years agoSimplify the code and remove dead code
Sylvestre Ledru [Tue, 11 Apr 2017 08:21:27 +0000 (08:21 +0000)]
Simplify the code and remove dead code

Summary: Fix coverity cid 1374240

Reviewers: dberlin

Reviewed By: dberlin

Differential Revision: https://reviews.llvm.org/D31928

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

7 years ago[IR] Fix a typo in a comment. NFC
Craig Topper [Tue, 11 Apr 2017 06:41:55 +0000 (06:41 +0000)]
[IR] Fix a typo in a comment. NFC

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

7 years ago[InstCombine] Refinement of r299915. Only consider a ConstantVector for Neg if all...
Craig Topper [Tue, 11 Apr 2017 06:32:48 +0000 (06:32 +0000)]
[InstCombine] Refinement of r299915. Only consider a ConstantVector for Neg if all the elements are Undef or ConstantInt.

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

7 years ago[InstCombine] Support weird size element types in dyn_castNegVal.
Craig Topper [Tue, 11 Apr 2017 05:42:47 +0000 (05:42 +0000)]
[InstCombine] Support weird size element types in dyn_castNegVal.

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

7 years ago[LoopUnswitch] Fix a test case
Sanjoy Das [Tue, 11 Apr 2017 04:11:47 +0000 (04:11 +0000)]
[LoopUnswitch] Fix a test case

(h/t to Chandler for pointing this out)

The test in question was not at all testing what it was supposed to
test.  We do not //care// about placing `!make.implicit` in inner
constant branch (since it will be folded away anyway).  We care about
placing `!make.implicit` in the outer branch that switches between
either version of the loop.

Having said that, it is _correct_ to leave behind the `!make.implicit`
in the inner branch, but there is no need to do so.

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

7 years ago[LICM] Hoist fp division from the loops and replace by a reciprocal
Hal Finkel [Tue, 11 Apr 2017 02:22:54 +0000 (02:22 +0000)]
[LICM] Hoist fp division from the loops and replace by a reciprocal

When allowed, we can hoist a division out of a loop in favor of a
multiplication by the reciprocal. Fixes PR32157.

Patch by vit9696!

Differential Revision: https://reviews.llvm.org/D30819

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

7 years ago[PowerPC] multiply-with-overflow might use the CTR register
Hal Finkel [Tue, 11 Apr 2017 02:03:17 +0000 (02:03 +0000)]
[PowerPC] multiply-with-overflow might use the CTR register

Check the legality of ISD::[US]MULO to see whether
Intrinsic::[us]mul_with_overflow will legalize into a function call (and, thus,
will use the CTR register).  Fixes PR32485.

Patch by Tim Neumann!

Differential Revision: https://reviews.llvm.org/D31790

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

7 years ago[bugpoint] Also remove comdat's from externalized GVs
Hal Finkel [Tue, 11 Apr 2017 00:18:42 +0000 (00:18 +0000)]
[bugpoint] Also remove comdat's from externalized GVs

We were removing comdats from externalized functions (function declarations
can't be comdat), but were not doing the same for variable. Failure to do this
would cause bugpoint to fail ("Declaration may not be in a Comdat!").

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

7 years ago[IR] Sink some AttributeListImpl methods out of headers NFC
Reid Kleckner [Tue, 11 Apr 2017 00:16:00 +0000 (00:16 +0000)]
[IR] Sink some AttributeListImpl methods out of headers NFC

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

7 years agoRevert "NewGVN: Don't propagate over phi backedges where undef causes us to have...
Daniel Berlin [Tue, 11 Apr 2017 00:07:26 +0000 (00:07 +0000)]
Revert "NewGVN: Don't propagate over phi backedges where undef causes us to have >1 value."
It's not ready yet this was an accidental commit :(

This reverts r299903

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

7 years agoNewGVN: Don't propagate over phi backedges where undef causes us to have >1 value.
Daniel Berlin [Tue, 11 Apr 2017 00:02:38 +0000 (00:02 +0000)]
NewGVN: Don't propagate over phi backedges where undef causes us to have >1 value.

Fixes PR 32607.

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

7 years agoRemove AttributeSetNode::get(AttributeList, unsigned) and sink constructor
Reid Kleckner [Mon, 10 Apr 2017 23:46:08 +0000 (23:46 +0000)]
Remove AttributeSetNode::get(AttributeList, unsigned) and sink constructor

The getter was equivalent to AttributeList::getAttributes(unsigned),
which seems like a better way to express getting the AttributeSet for a
given index. This static helper was only used in one place anyway.

The constructor doesn't benefit from inlining and doesn't need to be in
a header.

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

7 years agoReland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"
Reid Kleckner [Mon, 10 Apr 2017 23:31:05 +0000 (23:31 +0000)]
Reland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"

This re-lands r299875.

I introduced a bug in Clang code responsible for replacing K&R, no
prototype declarations with a real function definition with a prototype.
The bug was here:

       // Collect any return attributes from the call.
  -    if (oldAttrs.hasAttributes(llvm::AttributeList::ReturnIndex))
  -      newAttrs.push_back(llvm::AttributeList::get(newFn->getContext(),
  -                                                  oldAttrs.getRetAttributes()));
  +    newAttrs.push_back(oldAttrs.getRetAttributes());

Previously getRetAttributes() carried AttributeList::ReturnIndex in its
AttributeList. Now that we return the AttributeSetNode* directly, it no
longer carries that index, and we call this overload with a single node:
  AttributeList::get(LLVMContext&, ArrayRef<AttributeSetNode*>)

That aborted with an assertion on x86_32 targets. I added an explicit
triple to the test and added CHECKs to help find issues like this in the
future sooner.

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

7 years ago[ARM, x86] add tests to show possible improvement for bool math; NFC
Sanjay Patel [Mon, 10 Apr 2017 23:26:31 +0000 (23:26 +0000)]
[ARM, x86] add tests to show possible improvement for bool math; NFC

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

7 years ago[NewGVN] Surround with parens to clarify allegedly ambiguous precedence.
Davide Italiano [Mon, 10 Apr 2017 23:08:35 +0000 (23:08 +0000)]
[NewGVN] Surround with parens to clarify allegedly ambiguous precedence.

This Placates GCC7 with -Werror. Also, clang-format the assertions
while I'm here.

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

7 years ago[MemorySSA] We don't need to compute dominator levels anymore.
Davide Italiano [Mon, 10 Apr 2017 22:44:46 +0000 (22:44 +0000)]
[MemorySSA] We don't need to compute dominator levels anymore.

Differential Revision:  https://reviews.llvm.org/D31818

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

7 years agoCodeGen: BlockPlacement: Don't always tail-duplicate with no other successor.
Kyle Butt [Mon, 10 Apr 2017 22:28:22 +0000 (22:28 +0000)]
CodeGen: BlockPlacement: Don't always tail-duplicate with no other successor.

The math works out where it can actually be counter-productive. The probability
calculations correctly handle the case where the alternative is 0 probability,
rely on those calculations.

Includes a test case that demonstrates the problem.

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

7 years agoCodeGen: BlockPlacement: Minor probability changes.
Kyle Butt [Mon, 10 Apr 2017 22:28:18 +0000 (22:28 +0000)]
CodeGen: BlockPlacement: Minor probability changes.

Qin may be large, and Succ may be more frequent than BB. Take these both into
account when deciding if tail-duplication is profitable.

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

7 years agoCodeGen: BranchFolding: Merge identical blocks, even if they are short.
Kyle Butt [Mon, 10 Apr 2017 22:28:12 +0000 (22:28 +0000)]
CodeGen: BranchFolding: Merge identical blocks, even if they are short.

Merging identical blocks when it doesn't reduce fallthrough. It is common for
the blocks created from critical edge splitting to be identical. We would like
to merge these blocks whenever doing so would not reduce fallthrough.

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

7 years agoAllow DataLayout to specify addrspace for allocas.
Matt Arsenault [Mon, 10 Apr 2017 22:27:50 +0000 (22:27 +0000)]
Allow DataLayout to specify addrspace for allocas.

LLVM makes several assumptions about address space 0. However,
alloca is presently constrained to always return this address space.
There's no real way to avoid using alloca, so without this
there is no way to opt out of these assumptions.

The problematic assumptions include:
- That the pointer size used for the stack is the same size as
  the code size pointer, which is also the maximum sized pointer.

- That 0 is an invalid, non-dereferencable pointer value.

These are problems for AMDGPU because alloca is used to
implement the private address space, which uses a 32-bit
index as the pointer value. Other pointers are 64-bit
and behave more like LLVM's notion of generic address
space. By changing the address space used for allocas,
we can change our generic pointer type to be LLVM's generic
pointer type which does have similar properties.

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

7 years agoGet the TOC save offset off of PPCFrameLowering rather than a separate copy of the...
Eric Christopher [Mon, 10 Apr 2017 22:22:11 +0000 (22:22 +0000)]
Get the TOC save offset off of PPCFrameLowering rather than a separate copy of the same data.

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

7 years agoBitcode: Merge the code for parsing global value module codes in the summary bitcode...
Peter Collingbourne [Mon, 10 Apr 2017 21:17:54 +0000 (21:17 +0000)]
Bitcode: Merge the code for parsing global value module codes in the summary bitcode reader. NFCI.

This code will need to be taught to handle string tables and it's better if
there is only one copy of it.

Differential Revision: https://reviews.llvm.org/D31829

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

7 years agoEmit less compiler optimization remarks in samplepgo to reduce a call to findCalleeFu...
Dehao Chen [Mon, 10 Apr 2017 20:49:16 +0000 (20:49 +0000)]
Emit less compiler optimization remarks in samplepgo to reduce a call to findCalleeFunctionSamples which is going to be refactored.

Summary: Now the SamplePGO support is more stable, we do not need so many verbose optimization remarks emitted.

Reviewers: dnovillo, davidxl

Reviewed By: davidxl

Subscribers: fhahn, llvm-commits

Differential Revision: https://reviews.llvm.org/D31826

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

7 years ago[GVNHoist] Call isGuaranteedToTransferExecutionToSuccessor on each instruction
Geoff Berry [Mon, 10 Apr 2017 20:45:17 +0000 (20:45 +0000)]
[GVNHoist] Call isGuaranteedToTransferExecutionToSuccessor on each instruction

w.r.t. https://bugs.llvm.org/show_bug.cgi?id=32153
The consensus seems to be isGuaranteedToTransferExecutionToSuccessor should be called for each function.

Patch by Aditya Kumar

Differential Revision: https://reviews.llvm.org/D31035

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

7 years agoRevert "[asan] Put ctor/dtor in comdat."
Evgeniy Stepanov [Mon, 10 Apr 2017 20:36:36 +0000 (20:36 +0000)]
Revert "[asan] Put ctor/dtor in comdat."

This reverts commit r299696, which is causing mysterious test failures.

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

7 years agoRevert "[asan] Fix dead stripping of globals on Linux."
Evgeniy Stepanov [Mon, 10 Apr 2017 20:36:30 +0000 (20:36 +0000)]
Revert "[asan] Fix dead stripping of globals on Linux."

This reverts commit r299697, which caused a big increase in object file size.

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

7 years agoRevert "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"
Reid Kleckner [Mon, 10 Apr 2017 20:34:19 +0000 (20:34 +0000)]
Revert "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"

This reverts r299875. A Linux bot came back with a test failure:
http://bb.pgr.jp/builders/test-clang-i686-linux-RA/builds/741/steps/test_clang/logs/Clang%20%3A%3A%20CodeGen__2006-05-19-SingleEltReturn.c

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

7 years agoAdd address space mangling to lifetime intrinsics
Matt Arsenault [Mon, 10 Apr 2017 20:18:21 +0000 (20:18 +0000)]
Add address space mangling to lifetime intrinsics

In preparation for allowing allocas to have non-0 addrspace.

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

7 years ago[IR] Make AttributeSetNode public, avoid temporary AttributeList copies
Reid Kleckner [Mon, 10 Apr 2017 20:18:10 +0000 (20:18 +0000)]
[IR] Make AttributeSetNode public, avoid temporary AttributeList copies

Summary:
AttributeList::get(Fn|Ret|Param)Attributes no longer creates a temporary
AttributeList just to hide the AttributeSetNode type.

I've also added a factory method to create AttributeLists from a
parallel array of AttributeSetNodes. I think this simplifies
construction of AttributeLists when rewriting function prototypes.
Previously we would test if a particular index had attributes, and
conditionally add a temporary attribute list to a vector. Now the
attribute set vector is parallel to the argument vector already that
these passes already construct.

My long term vision is to wrap AttributeSetNode* inside an AttributeSet
type that holds the enum attributes, but that will come in a follow up
change.

I haven't done any performance measurements for this change because
profiling hasn't shown that any of the affected code is hot.

Reviewers: pete, chandlerc, sanjoy, hfinkel

Reviewed By: pete

Subscribers: jfb, llvm-commits

Differential Revision: https://reviews.llvm.org/D31198

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

7 years agoRemove svn:eol-style properties from some files so 'git llvm push' works for them
Reid Kleckner [Mon, 10 Apr 2017 20:16:54 +0000 (20:16 +0000)]
Remove svn:eol-style properties from some files so 'git llvm push' works for them

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

7 years agoFix signed / unsigned comparison warnings.
Zachary Turner [Mon, 10 Apr 2017 20:01:50 +0000 (20:01 +0000)]
Fix signed / unsigned comparison warnings.

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

7 years ago[mips] Use Triple::isLittleEndian to check endianness. NFC
Simon Atanasyan [Mon, 10 Apr 2017 19:42:44 +0000 (19:42 +0000)]
[mips] Use Triple::isLittleEndian to check endianness. NFC

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

7 years ago[InstCombine] improve variable names; NFCI
Sanjay Patel [Mon, 10 Apr 2017 19:38:36 +0000 (19:38 +0000)]
[InstCombine] improve variable names; NFCI

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

7 years ago[InstSimplify] Use cast instead of dyn_cast after isa<> check. NFCI
Craig Topper [Mon, 10 Apr 2017 19:37:10 +0000 (19:37 +0000)]
[InstSimplify] Use cast instead of dyn_cast after isa<> check. NFCI

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

7 years ago[llvm-pdbdump] Display padding bytes on record layout
Zachary Turner [Mon, 10 Apr 2017 19:33:29 +0000 (19:33 +0000)]
[llvm-pdbdump] Display padding bytes on record layout

When dumping classes, show where padding occurs, and at the end of the
class print statistics about how many bytes total of padding exist in a
class.

Since PDB doesn't specifically contain information about padding, we have
to mimic this by sort of reversing a small portion of the record layout
algorithm (e.g. looking at offsets and sizes and trying to determine
whether something is part of the same field or a new field).

Differential Revision: https://reviews.llvm.org/D31800

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

7 years ago[MemCpyOpt] Only replace memcpy with bitcast if address spaces match
Matt Arsenault [Mon, 10 Apr 2017 19:00:25 +0000 (19:00 +0000)]
[MemCpyOpt] Only replace memcpy with bitcast if address spaces match

Patch by James Price

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

7 years agoMemorySSA: Make lifetime starts defs for mustaliased pointers
Daniel Berlin [Mon, 10 Apr 2017 18:46:00 +0000 (18:46 +0000)]
MemorySSA: Make lifetime starts defs for mustaliased pointers

Summary:
While we don't want them aliasing with other pointers, there seems to
be no point in not having them clobber must-aliased'd pointers.

If some day, we split the aliasing and ordering chains, we'd make this
not aliasing but an ordering barrier (IE it doesn't affect it's
memory, but we can't hoist it above it).

Reviewers: hfinkel, george.burgess.iv

Subscribers: Prazek, llvm-commits

Differential Revision: https://reviews.llvm.org/D31865

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

7 years ago[ARM/AArch64] Ensure valid vector element types for interleaved accesses
Matthew Simpson [Mon, 10 Apr 2017 18:34:37 +0000 (18:34 +0000)]
[ARM/AArch64] Ensure valid vector element types for interleaved accesses

This patch refactors and strengthens the type checks performed for interleaved
accesses. The primary functional change is to ensure that the interleaved
accesses have valid element types. The added test cases previously failed
because the element type is f128.

Differential Revision: https://reviews.llvm.org/D31817

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

7 years ago[InstCombine] Use commutable matchers and m_OneUse in visitSub to shorten code. Add...
Craig Topper [Mon, 10 Apr 2017 18:09:25 +0000 (18:09 +0000)]
[InstCombine] Use commutable matchers and m_OneUse in visitSub to shorten code. Add missing test cases.

In one case I removed commute handling for a multiply with a constant since we'll eventually get the constant on the right hand side.

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

7 years agoAMDGPU: Fix crash when disassembling VOP3 mac
Matt Arsenault [Mon, 10 Apr 2017 17:58:06 +0000 (17:58 +0000)]
AMDGPU: Fix crash when disassembling VOP3 mac

The unused dummy src2_modifiers is missing, so it crashes
when trying to print it.

I tried to fully remove src2_modifiers, but there are some
irritations in the places where it is converted to mad since
it starts to require modifying use lists while iterating over
them.

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

7 years ago[Support] Add support for finding unset bits in a BitVector.
Zachary Turner [Mon, 10 Apr 2017 17:18:54 +0000 (17:18 +0000)]
[Support] Add support for finding unset bits in a BitVector.

BitVector had methods for searching for the first and next
set bits, but it did not have analagous methods for finding
the first and next unset bits.  This is useful when your ones
and zeros are grouped together and you want to iterate over
ranges of ones and zeros.

Differential Revision: https://reviews.llvm.org/D31802

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

7 years agoFix line endings.
Zachary Turner [Mon, 10 Apr 2017 17:17:11 +0000 (17:17 +0000)]
Fix line endings.

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

7 years agoRemove eol-style:native from BitVector.h
Zachary Turner [Mon, 10 Apr 2017 17:15:11 +0000 (17:15 +0000)]
Remove eol-style:native from BitVector.h

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

7 years ago[InstCombine] Use m_c_Add to shorten some code. Add testcases for this fold since...
Craig Topper [Mon, 10 Apr 2017 16:59:40 +0000 (16:59 +0000)]
[InstCombine] Use m_c_Add to shorten some code. Add testcases for this fold since they were missing. NFC

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

7 years ago[X86][MMX] Add fast-isel support for MMX non-temporal writes
Simon Pilgrim [Mon, 10 Apr 2017 16:58:07 +0000 (16:58 +0000)]
[X86][MMX] Add fast-isel support for MMX non-temporal writes

Differential Revision: https://reviews.llvm.org/D31754

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

7 years ago[InstCombine] fix matching of or-of-icmps constants (PR32524)
Sanjay Patel [Mon, 10 Apr 2017 16:55:57 +0000 (16:55 +0000)]
[InstCombine] fix matching of or-of-icmps constants (PR32524)

Also, make the same change in and-of-icmps and remove a hack for detecting that case.

Finally, add some FIXME comments because the code duplication here is awful.

This should fix the remaining IR problem noted in:
https://bugs.llvm.org/show_bug.cgi?id=32524

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

7 years agoImproves pretty printing of variable types in llvm-pdbdump
Adrian McCarthy [Mon, 10 Apr 2017 16:43:09 +0000 (16:43 +0000)]
Improves pretty printing of variable types in llvm-pdbdump

* Adds support for pointers to arrays, which was missing
* Adds some tests
* Improves consistency of const and volatile qualifiers
* Eliminates non-composable special case code for arrays and function by using
  a more general recursive approach
* Has a hack for getting the calling convention into the right spot for
  pointer-to-functions

Given the rapid changes happenning in llvm-pdbdump, this may be difficult to
merge.

Differential Revision: https://reviews.llvm.org/D31832

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

7 years ago[InstCombine] Support folding of add instructions with vector constants into select...
Craig Topper [Mon, 10 Apr 2017 16:40:00 +0000 (16:40 +0000)]
[InstCombine] Support folding of add instructions with vector constants into select operations

We currently only fold scalar add of constants into selects. This improves this to support vectors too.

Differential Revision: https://reviews.llvm.org/D31683

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

7 years ago[InstCombine] add test for PR32524; NFC
Sanjay Patel [Mon, 10 Apr 2017 16:28:08 +0000 (16:28 +0000)]
[InstCombine] add test for PR32524; NFC

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

7 years ago[ARM] GlobalISel: Support G_FPOW for float and double
Diana Picus [Mon, 10 Apr 2017 09:27:39 +0000 (09:27 +0000)]
[ARM] GlobalISel: Support G_FPOW for float and double

Legalize to a libcall.

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

7 years ago[InstCombine] Use commutable and/or/xor matchers to simplify some code
Craig Topper [Mon, 10 Apr 2017 07:13:40 +0000 (07:13 +0000)]
[InstCombine] Use commutable and/or/xor matchers to simplify some code

Summary:
This is my first time using the commutable matchers so wanted to make sure I was doing it right.

Are there any other matcher tricks to further shrink this? Can we commute the whole match so we don't have to LHS and RHS separately?

Reviewers: davide, spatel

Reviewed By: davide

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31680

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

7 years ago[SelectionDAG] TargetLowering::SimplifyDemandedBits how to properly calculate KnownZe...
Craig Topper [Mon, 10 Apr 2017 07:06:44 +0000 (07:06 +0000)]
[SelectionDAG] TargetLowering::SimplifyDemandedBits how to properly calculate KnownZero bits for ISD::SETCC and ISD::AssertZExt

Summary:
For SETCC we aren't calculating the KnownZero bits at all. I've copied the code from computeKnownZero over for this.

For AssertZExt we were only setting KnownZero for bits that were demanded. But the upper bits are zero whether they were demanded or not.

I'm interested in fixing this because my belief is the first part of the ISD::AND handling code in SimplifyDemandedBits largely exists because of these two bugs. In that code we go to computeKnownBits for the LHS and optimize a RHS constant. Because computeKnownBits handles SETCC and AssertZExt correctly we get better information sometimes than when we call SimplifyDemandedBits on the LHS later. With these two issues fixed in SimplifyDemandedBits I was able to remove that computeKnownBits call and still pass all X86 tests. I'll submit that change in a separate patch.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31715

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

7 years ago[InstCombine] Make sure we preserve fast math flags when folding fp instructions...
Craig Topper [Mon, 10 Apr 2017 07:00:10 +0000 (07:00 +0000)]
[InstCombine] Make sure we preserve fast math flags when folding fp instructions into phi nodes

Summary: I noticed in the select folding code that we copied fast math flags, but did not do the same for the similar handling in phi nodes. This patch fixes that to do the same thing as select

Reviewers: spatel, davide, majnemer, hfinkel

Reviewed By: davide

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31690

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

7 years ago[InstCombine] use m_c_And and m_c_Xor to handle commuted versions of a transform.
Craig Topper [Mon, 10 Apr 2017 06:53:28 +0000 (06:53 +0000)]
[InstCombine] use m_c_And and m_c_Xor to handle commuted versions of a transform.

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

7 years ago[InstCombine] Add test cases demonstrating missing handling for the commuted version...
Craig Topper [Mon, 10 Apr 2017 06:53:25 +0000 (06:53 +0000)]
[InstCombine] Add test cases demonstrating missing handling for the commuted version of a transform. NFC.

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

7 years ago[InstCombine] Remove unnecessary dyn_cast to BinaryOperator around some matcher check...
Craig Topper [Mon, 10 Apr 2017 06:53:23 +0000 (06:53 +0000)]
[InstCombine] Remove unnecessary dyn_cast to BinaryOperator around some matcher checks in visitXor.

The matchers themselves should be enough.

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

7 years ago[InstCombine] Make the (A|B)^B -> A & ~B transform code consistent with the very...
Craig Topper [Mon, 10 Apr 2017 06:53:21 +0000 (06:53 +0000)]
[InstCombine] Make the (A|B)^B -> A & ~B transform code consistent with the very similar (A&B)^B -> ~A & B code. This should be NFC except for the addition of hasOneUse check.

I think this code is still overly complicated and should use matchers, but first I wanted to make it consistent.

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

7 years ago[InstCombine] Use m_OneUse to shorten some code. NFC
Craig Topper [Mon, 10 Apr 2017 06:53:19 +0000 (06:53 +0000)]
[InstCombine] Use m_OneUse to shorten some code. NFC

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

7 years agoRemove unused method.
Zachary Turner [Mon, 10 Apr 2017 06:30:28 +0000 (06:30 +0000)]
Remove unused method.

This is causing build breaks, but it's unused anyway, so delete
it.

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

7 years agoGeneral usability improvements to generic PDB library.
Zachary Turner [Mon, 10 Apr 2017 06:14:09 +0000 (06:14 +0000)]
General usability improvements to generic PDB library.

1. Added some asserts to make sure concrete symbol types don't
   get constructed with RawSymbols that have an incompatible
   SymTag enum value.
2. Added new forwarding macros that auto-define an Id/Sym method
   pair whenever there is a method that returns a SymIndexId.
   Previously we would just provide one method that returned only
   the SymIndexId and it was up to the caller to use the Session
   object to get a pointer to the symbol.  Now we automatically
   get both the method that returns the Id, as well as a method
   that returns the pointer directly with just one macro.
3. Added some methods for dumping straight to stdout that can
   be used from inside the debugger for diagnostics during a
   debug session.
4. Added a clone() method and a cast<T>() method to PDBSymbol
   that can shorten some usage patterns.

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

7 years ago[SCCP] Resolve indirect branch target when possible.
Xin Tong [Mon, 10 Apr 2017 00:33:25 +0000 (00:33 +0000)]
[SCCP] Resolve indirect branch target when possible.

Summary:
Resolve indirect branch target when possible.
This potentially eliminates more basicblocks and result in better evaluation for phi and other things.

Reviewers: davide, efriedma, sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D30322

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

7 years ago[InstCombine] remove dead cases from icmp pair switches; NFCI
Sanjay Patel [Sun, 9 Apr 2017 21:51:34 +0000 (21:51 +0000)]
[InstCombine] remove dead cases from icmp pair switches; NFCI

"PredicatesFoldable" returns false for signed/unsigned mismatched pairs,
so these cases should never exist. We'll default to 'unreachable' on those
predicate combos instead.

Most of what's left in these switches belongs in InstSimplify (and may
already be there), so there's probably more that can be done to reduce
this code.

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

7 years ago[InstCombine] remove duplicate test; NFC
Sanjay Patel [Sun, 9 Apr 2017 21:45:52 +0000 (21:45 +0000)]
[InstCombine] remove duplicate test; NFC

I moved this test to 'not.ll' in r299824 but accidentally added a copy here.

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

7 years ago[Mem2Reg] Remove AliasSetTracker updating logic from the pass.
Davide Italiano [Sun, 9 Apr 2017 20:47:14 +0000 (20:47 +0000)]
[Mem2Reg] Remove AliasSetTracker updating logic from the pass.

No caller has been passing it for a long time.

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

7 years ago[SimplifyCFG] auto-generate better checks; NFC
Sanjay Patel [Sun, 9 Apr 2017 16:16:32 +0000 (16:16 +0000)]
[SimplifyCFG] auto-generate better checks; NFC

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

7 years ago[InstCombine] auto-generate better checks; NFC
Sanjay Patel [Sun, 9 Apr 2017 15:44:59 +0000 (15:44 +0000)]
[InstCombine] auto-generate better checks; NFC

Also, move a test next to its sibling to eliminate a file with just one test.

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

7 years ago[MemorySSA] Fix use of pointsToConstantMemory in isUseTriviallyOptimizableToLiveOnEntry
Hal Finkel [Sun, 9 Apr 2017 12:57:50 +0000 (12:57 +0000)]
[MemorySSA] Fix use of pointsToConstantMemory in isUseTriviallyOptimizableToLiveOnEntry

In isUseTriviallyOptimizableToLiveOnEntry, pointsToConstantMemory needs to be
called on the load's pointer operand, not on the result of the load (which
might not even be a pointer).

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

7 years ago[InstCombine] Extend some OR combines to support vectors.
Craig Topper [Sun, 9 Apr 2017 06:12:41 +0000 (06:12 +0000)]
[InstCombine] Extend some OR combines to support vectors.

This adds support for these combines for vectors
(X^C)|Y -> (X|Y)^C iff Y&C == 0
Y|(X^C) -> (X|Y)^C iff Y&C == 0

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

7 years ago[InstCombine] Extend a canonicalization check to apply to vector constants too.
Craig Topper [Sun, 9 Apr 2017 06:12:39 +0000 (06:12 +0000)]
[InstCombine] Extend a canonicalization check to apply to vector constants too.

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

7 years ago[InstCombine] Add test cases to show missing support for vectors in an OR combine...
Craig Topper [Sun, 9 Apr 2017 06:12:36 +0000 (06:12 +0000)]
[InstCombine] Add test cases to show missing support for vectors in an OR combine. Also add the commuted versions. NFC

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

7 years ago[InstCombine] Use the SubOne helper function to shorten some code. NFC
Craig Topper [Sun, 9 Apr 2017 06:12:34 +0000 (06:12 +0000)]
[InstCombine] Use the SubOne helper function to shorten some code. NFC

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

7 years ago[InstCombine] rename variable for easier reading; NFC
Craig Topper [Sun, 9 Apr 2017 06:12:31 +0000 (06:12 +0000)]
[InstCombine] rename variable for easier reading; NFC

We usually give constants a 'C' somewhere in the name...

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

7 years agoMC: Remove unused virtual function MCObjectWriter::isWeak. NFC.
Peter Collingbourne [Sat, 8 Apr 2017 23:35:49 +0000 (23:35 +0000)]
MC: Remove unused virtual function MCObjectWriter::isWeak. NFC.

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

7 years agoAMDGPU: Actually write nops for writeNopData
Matt Arsenault [Sat, 8 Apr 2017 21:28:38 +0000 (21:28 +0000)]
AMDGPU: Actually write nops for writeNopData

Before this was just writing 0s, which ends up looking like a
v_cndmask_b32 v0, s0, v0, vcc. Write out an encoded s_nop instead.

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

7 years ago[AsmParser]Emit an error if a macro has two (or more) parameters sharing the same...
Coby Tayree [Sat, 8 Apr 2017 20:29:03 +0000 (20:29 +0000)]
[AsmParser]Emit an error if a macro has two (or more) parameters sharing the same name

Introducing a new error to macro parameters' parsing:
currently, llvm-mc won't complain if a macro have two (or more) named params with the same name.
this behavior is false, as there's no merit in having some params sharing a name.
now, instead of tolerate such a phenomena - emit an appropriate error.

Differential Revision: https://reviews.llvm.org/D31674

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

7 years agoReorganize libLTO C API header lto.h (NFC)
Mehdi Amini [Sat, 8 Apr 2017 19:20:30 +0000 (19:20 +0000)]
Reorganize libLTO C API header lto.h (NFC)

This just makes it easier to follow the Doxygen blocks

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

7 years ago[IR] Inline Type::getScalarType() by using isVectorTy() and getVectorElementType...
Craig Topper [Sat, 8 Apr 2017 05:47:09 +0000 (05:47 +0000)]
[IR] Inline Type::getScalarType() by using isVectorTy() and getVectorElementType() that were already available inline.

Seems to have very little compiled code size impact. But might give a tiny performance boost.

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

7 years ago[AArch64] Refine Falkor Machine Model - Part 3
Balaram Makam [Sat, 8 Apr 2017 03:30:15 +0000 (03:30 +0000)]
[AArch64] Refine Falkor Machine Model - Part 3

  This concludes the refinements to Falkor Machine Model.
  It includes SchedPredicates for immediate zero and LSL Fast.
  Forwarding logic is also modeled for vector multiply and
  accumulate only.

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

7 years ago[coroutines] Make CoroSplit pass deterministic
Gor Nishanov [Sat, 8 Apr 2017 00:49:46 +0000 (00:49 +0000)]
[coroutines] Make CoroSplit pass deterministic

coro-split-after-phi.ll test was flaky due to non-determinism in
the coroutine frame construction that was sorting the spill
vector using a pointer to a def as a part of the key.

The sorting was intended to make sure that spills for the same def
are kept together, however, we populate the vector by processing
defs in order, so the spill entires will end up together anyways.

This change removes spill sorting and restores the determinism
in the test.

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

7 years agogitignore: Ignore .vs folder (VS2017 config files)
Gor Nishanov [Sat, 8 Apr 2017 00:16:58 +0000 (00:16 +0000)]
gitignore: Ignore .vs folder (VS2017 config files)

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

7 years ago[cfi] Take over existing __cfi_check in CrossDSOCFI.
Evgeniy Stepanov [Fri, 7 Apr 2017 23:00:20 +0000 (23:00 +0000)]
[cfi] Take over existing __cfi_check in CrossDSOCFI.

https://reviews.llvm.org/D31796 will emit a dummy __cfi_check in the
frontend.

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

7 years ago[ARM] Prefer BIC over BFC in ARM mode.
Eli Friedman [Fri, 7 Apr 2017 22:01:23 +0000 (22:01 +0000)]
[ARM] Prefer BIC over BFC in ARM mode.

BIC is generally faster, and it can put the output in a different
register from the input.

We already do this in Thumb2 mode; not sure why the equivalent fix
never got applied to ARM mode.

Differential Revision: https://reviews.llvm.org/D31797

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

7 years ago[GlobalISel]: Fix bug where we can report GISelFailure on erased instructions
Aditya Nandakumar [Fri, 7 Apr 2017 21:49:30 +0000 (21:49 +0000)]
[GlobalISel]: Fix bug where we can report GISelFailure on erased instructions

The original instruction might get legalized and erased and expanded
into intermediate instructions and the intermediate instructions might
fail legalization. This end up in reporting GISelFailure on the erased
instruction.
Instead report GISelFailure on the intermediate instruction which failed
legalization.

Reviewed by: ab

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

7 years ago[ConstantFolding] Use Intrinsic::not_intrinsic instead of 0 for readability. NFCI
Craig Topper [Fri, 7 Apr 2017 21:36:32 +0000 (21:36 +0000)]
[ConstantFolding] Use Intrinsic::not_intrinsic instead of 0 for readability. NFCI

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

7 years ago[AArch64] Allow global register asm("x18") or asm("w18") under -ffixed-x18
Petr Hosek [Fri, 7 Apr 2017 20:41:58 +0000 (20:41 +0000)]
[AArch64] Allow global register asm("x18") or asm("w18") under -ffixed-x18

When using -ffixed-x18, the x18 (or w18) register can safely be used
with the "global register variable" GCC extension, but the backend
fails to recognize it.

Patch by Roland McGrath.

Differential Revision: https://reviews.llvm.org/D31793

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

7 years agoNewGVN: Make CongruenceClass a real class in preparation for splitting
Daniel Berlin [Fri, 7 Apr 2017 18:38:09 +0000 (18:38 +0000)]
NewGVN: Make CongruenceClass a real class in preparation for splitting
NewGVN into analysis and eliminator.

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

7 years agoDe-flake a test that is failing due to coroutine spill insertion non-determinism
Reid Kleckner [Fri, 7 Apr 2017 18:02:53 +0000 (18:02 +0000)]
De-flake a test that is failing due to coroutine spill insertion non-determinism

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

7 years ago[Dominators] Simplify a member function. NFCI.
Davide Italiano [Fri, 7 Apr 2017 17:34:37 +0000 (17:34 +0000)]
[Dominators] Simplify a member function. NFCI.

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

7 years agoRevert "[SelectionDAG] Enable target specific vector scalarization of calls and returns"
Simon Dardis [Fri, 7 Apr 2017 17:25:05 +0000 (17:25 +0000)]
Revert "[SelectionDAG] Enable target specific vector scalarization of calls and returns"

This reverts commit r299766. This change appears to have broken the MIPS
buildbots. Reverting while I investigate.

Revert "[mips] Remove usage of debug only variable (NFC)"

This reverts commit r299769. Follow up commit.

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

7 years ago[AMDGPU] Unroll more to eliminate phis and conditions
Stanislav Mekhanoshin [Fri, 7 Apr 2017 16:26:28 +0000 (16:26 +0000)]
[AMDGPU] Unroll more to eliminate phis and conditions

Increase threshold to unroll a loop which contains an "if" statement
whose condition defined by a PHI belonging to the loop. This may help
to eliminate if region and potentially even PHI itself, saving on
both divergence and registers used for the PHI.

Add a small bonus for each of such "if" statements.

Differential Revision: https://reviews.llvm.org/D31693

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

7 years agoUse PMADDWD to expand reduction in a loop
Dehao Chen [Fri, 7 Apr 2017 15:41:52 +0000 (15:41 +0000)]
Use PMADDWD to expand reduction in a loop

Summary:
PMADDWD can help improve 8/16 bit integer mutliply-add operation performance for cases like:

for (int i = 0; i < count; i++)
  a += x[i] * y[i];

Reviewers: wmi, davidxl, hfinkel, RKSimon, zvi, mkuper

Reviewed By: mkuper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31679

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

7 years ago[lit] Try using process pools by default again
Reid Kleckner [Fri, 7 Apr 2017 15:28:32 +0000 (15:28 +0000)]
[lit] Try using process pools by default again

Both pickling errors encountered on clang bots and Darwin compiler-rt
should now be fixed.

This has no impact on testing time on Linux, and on Windows goes from
88s to 63s for 'check'. The tests pass on Mac, but I haven't compared
execution time.

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

7 years ago[GlobalISel] implement narrowing for G_CONSTANT.
Igor Breger [Fri, 7 Apr 2017 14:41:59 +0000 (14:41 +0000)]
[GlobalISel] implement narrowing for G_CONSTANT.

Summary: [GlobalISel] implement narrowing for G_CONSTANT.

Reviewers: bogner, zvi, t.p.northover

Reviewed By: t.p.northover

Subscribers: llvm-commits, dberris, rovka, kristof.beyls

Differential Revision: https://reviews.llvm.org/D31744

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

7 years ago[coroutines] Insert spills of PHI instructions correctly
Gor Nishanov [Fri, 7 Apr 2017 14:16:49 +0000 (14:16 +0000)]
[coroutines] Insert spills of PHI instructions correctly

Summary:
Fix a bug where we were inserting a spill in between the PHIs in the beginning of the block.
Consider this fragment:

```
begin:
  %phi1 = phi i32 [ 0, %entry ], [ 2, %alt ]
  %phi2 = phi i32 [ 1, %entry ], [ 3, %alt ]
  %sp1 = call i8 @llvm.coro.suspend(token none, i1 false)
  switch i8 %sp1, label %suspend [i8 0, label %resume
                                  i8 1, label %cleanup]
resume:
  call i32 @print(i32 %phi1)
```
Unless we are spilling the argument or result of the invoke, we were always inserting the spill immediately following the instruction.
The fix adds a check that if the spilled instruction is a PHI Node, select an appropriate insert point with `getFirstInsertionPt()` that
skips all the PHI Nodes and EH pads.

Reviewers: majnemer, rnk

Reviewed By: rnk

Subscribers: qcolombet, EricWF, llvm-commits

Differential Revision: https://reviews.llvm.org/D31799

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

7 years agoReapply r298620: [LV] Vectorize GEPs
Matthew Simpson [Fri, 7 Apr 2017 14:15:34 +0000 (14:15 +0000)]
Reapply r298620: [LV] Vectorize GEPs

This patch reapplies r298620. The original patch was reverted because of two
issues. First, the patch exposed a bug in InstCombine that caused the Chromium
builds to fail (PR32414). This issue was fixed in r299017. Second, the patch
introduced a bug in the vectorizer's scalars analysis that caused test suite
builds to fail on SystemZ. The scalars analysis was too aggressive and marked a
memory instruction scalar, even though it was going to be vectorized. This
issue has been fixed in the current patch and several new test cases for the
scalars analysis have been added.

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

7 years ago[mips] Remove usage of debug only variable (NFC)
Simon Dardis [Fri, 7 Apr 2017 13:49:12 +0000 (13:49 +0000)]
[mips] Remove usage of debug only variable (NFC)

Fix the lld-x86_64-darwin13 buildbot by removing the declaration of a
debug only variable and instead moving the value into the debug statement.

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

7 years ago[mips][msa] Fix generation of bm(n)zi and bins[lr]i instructions
Petar Jovanovic [Fri, 7 Apr 2017 13:31:36 +0000 (13:31 +0000)]
[mips][msa] Fix generation of bm(n)zi and bins[lr]i instructions

We have two cases here, the first one being the following instruction
selection from the builtin function:
bm(n)zi builtin -> vselect node -> bins[lr]i machine instruction

In case of bm(n)zi having an immediate which has either its high or low bits
set, a bins[lr] instruction can be selected through the selectVSplatMask[LR]
function. The function counts the number of bits set, and that value is
being passed to the bins[lr]i instruction as its immediate, which in turn
copies immediate modulo the size of the element in bits plus 1 as per specs,
where we get the off-by-one-error.

The other case is:
bins[lr]i -> vselect node -> bsel.v

In this case, a bsel.v instruction gets selected with a mask having one bit
less set than required.

Patch by Stefan Maksimovic.

Differential Revision: https://reviews.llvm.org/D30579

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