OSDN Git Service

android-x86/external-llvm.git
7 years agoFix the Thumb test for vfloat intrinsics
Pablo Barrio [Mon, 12 Sep 2016 13:14:14 +0000 (13:14 +0000)]
Fix the Thumb test for vfloat intrinsics

Summary:
This test was not testing the intrinsics. A function like this:

define %v4f32 @test_v4f32.floor(%v4f32 %a){
...
        %1 = call %v4f32 @llvm.floor.v4f32(%v4f32 %a)
...
}

is transformed into the following assembly:

_test_v4f32.floor:              @ @test_v4f32.floor
...
        bl _floorf
...

In each function tested, there are two CHECK: one that checked
for the label and another one for the intrinsic that should be used
inside the function (in our case, "floor"). However, although the
first CHECK was matching the label, the second was not matching the
intrinsic, but the second "floor" in the same line as the label.

This is fixed by making the first CHECK match the entire line.

Reviewers: jmolloy, rengolin

Subscribers: rengolin, llvm-commits

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

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

7 years agoDefine a dummy zlib::uncompress when zlib is not available.
Rafael Espindola [Mon, 12 Sep 2016 13:00:51 +0000 (13:00 +0000)]
Define a dummy zlib::uncompress when zlib is not available.

Should fix link errors in some bots when it is used.

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

7 years agoGlobalISel: support translation of global addresses.
Tim Northover [Mon, 12 Sep 2016 12:10:41 +0000 (12:10 +0000)]
GlobalISel: support translation of global addresses.

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

7 years agoGlobalISel: translate GEP instructions.
Tim Northover [Mon, 12 Sep 2016 11:20:22 +0000 (11:20 +0000)]
GlobalISel: translate GEP instructions.

Unlike SDag, we use a separate G_GEP instruction (much simplified, only taking
a single byte offset) to preserve the pointer type information through
selection.

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

7 years agoGlobalISel: disambiguate types when printing MIR
Tim Northover [Mon, 12 Sep 2016 11:20:10 +0000 (11:20 +0000)]
GlobalISel: disambiguate types when printing MIR

Some generic instructions have multiple types. While in theory these always be
discovered by inspecting the single definition of each generic vreg, in
practice those definitions won't always be local and traipsing through a big
function to find them will not be fun.

So this changes MIRPrinter to print out the type of uses as well as defs, if
they're known to be different or not known to be the same.

On the parsing side, we're a little more flexible: provided each register is
given a type in at least one place it's mentioned (and all types are
consistent) we accept the MIR. This doesn't introduce ambiguity but makes
writing tests manually a bit less painful.

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

7 years agoFix WebAssembly broken build related to interface change in r281172.
Eric Liu [Mon, 12 Sep 2016 09:35:59 +0000 (09:35 +0000)]
Fix WebAssembly broken build related to interface change in r281172.

Reviewers: bkramer

Subscribers: jfb, llvm-commits, dschuff

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

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

7 years agoAVX-512: Added a test case that should be optimized in the future. NFC.
Elena Demikhovsky [Mon, 12 Sep 2016 06:26:03 +0000 (06:26 +0000)]
AVX-512: Added a test case that should be optimized in the future. NFC.

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

7 years agollvm/test/CodeGen/AMDGPU/infinite-loop-evergreen.ll REQUIRES +Asserts.
NAKAMURA Takumi [Mon, 12 Sep 2016 04:27:28 +0000 (04:27 +0000)]
llvm/test/CodeGen/AMDGPU/infinite-loop-evergreen.ll REQUIRES +Asserts.

This might not *crash* with -Asserts. I saw it caused infinite loop in the codegen.

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

7 years agoMC: Move MCSection::begin/end to header, NFC
Duncan P. N. Exon Smith [Mon, 12 Sep 2016 00:17:09 +0000 (00:17 +0000)]
MC: Move MCSection::begin/end to header, NFC

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

7 years ago[InstCombine] add helper function for folding {and,or,xor} (cast X), C ; NFCI
Sanjay Patel [Mon, 12 Sep 2016 00:16:23 +0000 (00:16 +0000)]
[InstCombine] add helper function for folding {and,or,xor} (cast X), C ; NFCI

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

7 years ago[InstCombine] regenerate checks
Sanjay Patel [Mon, 12 Sep 2016 00:12:56 +0000 (00:12 +0000)]
[InstCombine] regenerate checks

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

7 years ago[InstCombine] regenerate checks
Sanjay Patel [Mon, 12 Sep 2016 00:08:33 +0000 (00:08 +0000)]
[InstCombine] regenerate checks

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

7 years agoADT: Never allocate nodes in iplist<> and ilist<>
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 23:43:43 +0000 (23:43 +0000)]
ADT: Never allocate nodes in iplist<> and ilist<>

Remove createNode() and any API that depending on it, and add
HasCreateNode to the list of checks for HasObsoleteCustomizations.  Now
an ilist *never* allocates (this was already true for iplist).

This factors out all the differences between iplist and ilist.  I'll aim
to rename both to "owning_ilist" eventually, to call out the interesting
(not exactly intrusive) ownership semantics.  In the meantime, I've left
both names around to reduce code churn.

One of the deleted APIs is the ilist copy constructor.  I've lifted up
and tested iplist::cloneFrom (ala simple_ilist::cloneFrom) as a
replacement.

Users of ilist<> and iplist<> that want the list to allocate nodes have
a few options:
- use std::list;
- use AllocatorList or BumpPtrList (or build a similarly trivial list);
- use cloneFrom (which is explicit at the call site); or
- allocate at the call site.

See r280573, r281177, r281181, and r281182 for examples of what to do if
you're updating out-of-tree code.

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

7 years agoADT: Fix build after r281182
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 22:55:46 +0000 (22:55 +0000)]
ADT: Fix build after r281182

Fix this bot:
  http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/20680

which complained that a typedef of 'iterator_adaptor_base' changed
meaning in AllocatorList::IteratorImpl.  Use 'base_type' there instead.

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

7 years agoADT: Add AllocatorList, and use it for yaml::Token
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 22:40:40 +0000 (22:40 +0000)]
ADT: Add AllocatorList, and use it for yaml::Token

- Add AllocatorList, a non-intrusive list that owns an LLVM-style
  allocator and provides a std::list-like interface (trivially built on
  top of simple_ilist),
- add a typedef (and unit tests) for BumpPtrList, and
- use BumpPtrList for the list of llvm::yaml::Token (i.e., TokenQueueT).

TokenQueueT has no need for the complexity of an intrusive list.  The
only reason to inherit from ilist was to customize the allocator.
TokenQueueT was the only example in-tree of using ilist<> in a truly
non-intrusive way.

Moreover, this removes the final use of the non-intrusive
ilist_traits<>::createNode (after r280573, r281177, and r281181).  I
have a WIP patch that removes this customization point (and the API that
relies on it) that I plan to commit soon.

Note: AllocatorList owns the allocator, which limits the viable API
(e.g., splicing must be on the same list).  For now I've left out
any problematic API.  It wouldn't be hard to split AllocatorList into
two layers: an Impl class that calls DerivedT::getAlloc (via CRTP), and
derived classes that handle Allocator ownership/reference/etc semantics;
and then implement splice with appropriate assertions; but TBH we should
probably just customize the std::list allocators at that point.

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

7 years agoAnalysis: Only allow the move-constructor for IVUsers
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 22:11:37 +0000 (22:11 +0000)]
Analysis: Only allow the move-constructor for IVUsers

Force IVUsers to be moved instead of copied, properly update Parent
pointers in IVStrideUse when IVUsers is moved, and make sure we have
move constructors available in iplist and ilist.

I came across this in a WIP patch that deleted the copy constructors
from ilist.  I was surprised to find that IVUsersAnalysis couldn't be
registered in the new pass manager.

It's not clear to me whether IVUsers was getting moved only when empty,
but if it was being moved when it was non-empty then this fixes a
pointer invalidation bug and should give some sort of speedup.  Note
that the bugfix would be necessary even for a copy constructor.

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

7 years ago[TwoAddressInstruction] When commuting an instruction don't assume that the destinati...
Craig Topper [Sun, 11 Sep 2016 22:10:42 +0000 (22:10 +0000)]
[TwoAddressInstruction] When commuting an instruction don't assume that the destination register is operand 0. Pass it from the caller.

In practice it probably is 0 so this may not be a functional change.

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

7 years ago[ORC] Update examples for header changes in r281171.
Lang Hames [Sun, 11 Sep 2016 21:34:13 +0000 (21:34 +0000)]
[ORC] Update examples for header changes in r281171.

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

7 years agoScalarOpts: Use std::list for Candidates, NFC
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 21:29:34 +0000 (21:29 +0000)]
ScalarOpts: Use std::list for Candidates, NFC

There is nothing intrusive about the Candidate list; use std::list over
llvm::ilist for simplicity.

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

7 years agoScalarOpts: Sort includes, NFC
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 21:04:36 +0000 (21:04 +0000)]
ScalarOpts: Sort includes, NFC

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

7 years agoADT: Remove ilist_iterator::reset(), NFC
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 20:47:27 +0000 (20:47 +0000)]
ADT: Remove ilist_iterator::reset(), NFC

ilist_iterator::reset was unnecessary API, and wasn't any clearer (or
safer) at the call site than constructing a temporary and assigning it
to the iterator.

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

7 years ago[ORC] Fix the RPC unit test for header changes in r281171.
Lang Hames [Sun, 11 Sep 2016 19:12:19 +0000 (19:12 +0000)]
[ORC] Fix the RPC unit test for header changes in r281171.

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

7 years agoCodeGen: Give MachineBasicBlock::reverse_iterator a handle to the current MI
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 18:51:28 +0000 (18:51 +0000)]
CodeGen: Give MachineBasicBlock::reverse_iterator a handle to the current MI

Now that MachineBasicBlock::reverse_instr_iterator knows when it's at
the end (since r281168 and r281170), implement
MachineBasicBlock::reverse_iterator directly on top of an
ilist::reverse_iterator by adding an IsReverse template parameter to
MachineInstrBundleIterator.  This replaces another hard-to-reason-about
use of std::reverse_iterator on list iterators, matching the changes for
ilist::reverse_iterator from r280032 (see the "out of scope" section at
the end of that commit message).  MachineBasicBlock::reverse_iterator
now has a handle to the current node and has obvious invalidation
semantics.

r280032 has a more detailed explanation of how list-style reverse
iterators (invalidated when the pointed-at node is deleted) are
different from vector-style reverse iterators like std::reverse_iterator
(invalidated on every operation).  A great motivating example is this
commit's changes to lib/CodeGen/DeadMachineInstructionElim.cpp.

Note: If your out-of-tree backend deletes instructions while iterating
on a MachineBasicBlock::reverse_iterator or converts between
MachineBasicBlock::iterator and MachineBasicBlock::reverse_iterator,
you'll need to update your code in similar ways to r280032.  The
following table might help:

                  [Old]              ==>             [New]
        delete &*RI, RE = end()                   delete &*RI++
        RI->erase(), RE = end()                   RI++->erase()
      reverse_iterator(I)                 std::prev(I).getReverse()
      reverse_iterator(I)                          ++I.getReverse()
    --reverse_iterator(I)                            I.getReverse()
      reverse_iterator(std::next(I))                 I.getReverse()
                RI.base()                std::prev(RI).getReverse()
                RI.base()                         ++RI.getReverse()
              --RI.base()                           RI.getReverse()
     std::next(RI).base()                           RI.getReverse()

(For more details, have a look at r280032.)

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

7 years ago[ORC] Rename RPCChannel to RPCByteChannel. NFC.
Lang Hames [Sun, 11 Sep 2016 18:41:05 +0000 (18:41 +0000)]
[ORC] Rename RPCChannel to RPCByteChannel. NFC.

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

7 years agoCodeGen: Assert that bundle iterators are valid
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 17:12:28 +0000 (17:12 +0000)]
CodeGen: Assert that bundle iterators are valid

Add an assertion to the MachineInstrBundleIterator from instr_iterator
that the underlying iterator is valid.  This is possible know that we
can check ilist_node::isSentinel (since r281168), and is consistent with
the constructors from MachineInstr* and MachineInstr&.

Avoiding the new assertion in operator== and operator!= requires four
(!!!!) new overloads each.

(As an aside, I'm strongly in favour of:
- making the conversion from instr_iterator explicit;
- making the conversion from pointer explicit;
- making the conversion from reference explicit; and
- removing all the extra overloads of operator== and operator!= except
  const_instr_iterator.

I'm not signing up for that at this point, but being clear about when
something is an MachineInstr-iterator (possibly instr_end()) vs
MachineInstr-bundle-iterator (possibly end()) vs MachineInstr* (possibly
nullptr) vs MachineInstr& (known valid) would surely make code
cleaner... and it would remove a ton of boilerplate from
MachineInstrBundleIterator operators.)

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

7 years agoFix the modules build after r281167
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 17:00:12 +0000 (17:00 +0000)]
Fix the modules build after r281167

Add an #include for <type_traits> to llvm/ADT/ilist_node_options.h to
make it standalone.

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

7 years agoCodeGen: Turn on sentinel tracking for MachineInstr iterators
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 16:38:18 +0000 (16:38 +0000)]
CodeGen: Turn on sentinel tracking for MachineInstr iterators

This is a prep commit before fixing MachineBasicBlock::reverse_iterator
invalidation semantics, ala r281167 for ilist::reverse_iterator.  This
changes MachineBasicBlock::Instructions to track which node is the
sentinel regardless of LLVM_ENABLE_ABI_BREAKING_CHECKS.

There's almost no functionality change (aside from ABI).  However, in
the rare configuration:

    #if !defined(NDEBUG) && !defined(LLVM_ENABLE_ABI_BREAKING_CHECKS)

the isKnownSentinel() assertions in ilist_iterator<>::operator* suddenly
have teeth for MachineInstr.  If these assertions start firing for your
out-of-tree backend, have a look at the suggestions in the commit
message for r279314, and at some of the commits leading up to it that
avoid dereferencing the end() iterator.

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

7 years agoADT: Add sentinel tracking and custom tags to ilists
Duncan P. N. Exon Smith [Sun, 11 Sep 2016 16:20:53 +0000 (16:20 +0000)]
ADT: Add sentinel tracking and custom tags to ilists

This adds two declarative configuration options for intrusive lists
(available for simple_ilist, iplist, and ilist).  Both of these options
affect ilist_node interoperability and need to be passed both to the
node and the list.  Instead of adding a new traits class, they're
specified as optional template parameters (in any order).

The two options:

 1. Pass ilist_sentinel_tracking<true> or ilist_sentinel_tracking<false>
    to control whether there's a bit on ilist_node "prev" pointer
    indicating whether it's the sentinel.  The default behaviour is to
    use a bit if and only if LLVM_ENABLE_ABI_BREAKING_CHECKS.

 2. Pass ilist_tag<TagA> and ilist_tag<TagB> to allow insertion of a
    single node into two different lists (simultaneously).

I have an immediate use-case for (1) ilist_sentinel_tracking: fixing the
validation semantics of MachineBasicBlock::reverse_iterator to match
ilist::reverse_iterator (ala r280032: see the comments at the end of the
commit message there).  I'm adding (2) ilist_tag in the same commit to
validate that the options framework supports expansion.  Justin Bogner
mentioned this might enable a possible cleanup in SelectionDAG, but I'll
leave this to others to explore.  In the meantime, the unit tests and
the comments for simple_ilist and ilist_node have usage examples.

Note that there's a layer of indirection to support optional,
out-of-order, template paramaters.  Internal classes are templated on an
instantiation of the non-variadic ilist_detail::node_options.
User-facing classes use ilist_detail::compute_node_options to compute
the correct instantiation of ilist_detail::node_options.

The comments for ilist_detail::is_valid_option describe how to add new
options (e.g., ilist_packed_int<int NumBits>).

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

7 years ago[AVX512] Fix pattern for vgetmantsd and all other instructions that use same class...
Igor Breger [Sun, 11 Sep 2016 12:38:46 +0000 (12:38 +0000)]
[AVX512] Fix pattern for vgetmantsd and all other instructions that use same class. Fix memory operand size, remove unnecessary pattern.

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

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

7 years agoFixup failing debuginfo test for change in SimplifyCFG.
James Molloy [Sun, 11 Sep 2016 09:13:32 +0000 (09:13 +0000)]
Fixup failing debuginfo test for change in SimplifyCFG.

This reverts this test back to its original pre-r280364 behaviour as we don't sink allocas any more.

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

7 years ago[SimplifyCFG] Be even more conservative in SinkThenElseCodeToEnd
James Molloy [Sun, 11 Sep 2016 09:00:03 +0000 (09:00 +0000)]
[SimplifyCFG] Be even more conservative in SinkThenElseCodeToEnd

This should *actually* fix PR30244. This cranks up the workaround for PR30188 so that we never sink loads or stores of allocas.

The idea is that these should be removed by SROA/Mem2Reg, and any movement of them may well confuse SROA or just cause unwanted code churn. It's not ideal that the midend should be crippled like this, but that unwanted churn can really cause significant regressions in important workloads (tsan).

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

7 years ago[AArch64] Fixup test after r281160
James Molloy [Sun, 11 Sep 2016 08:24:04 +0000 (08:24 +0000)]
[AArch64] Fixup test after r281160

How I missed this locally is beyond me. I suspect llc didn't recompile. This is just changing the CHECK line back to what it was before r280364.

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

7 years ago[SimplifyCFG] Harden up the profitability heuristic for block splitting during sinking
James Molloy [Sun, 11 Sep 2016 08:07:30 +0000 (08:07 +0000)]
[SimplifyCFG] Harden up the profitability heuristic for block splitting during sinking

Exposed by PR30244, we will split a block currently if we think we can sink at least one instruction. However this isn't right - the reason we split predecessors is so that we can sink instructions that otherwise couldn't be sunk because it isn't safe to do so - stores, for example.

So, change the heuristic to only split if it thinks it can sink at least one non-speculatable instruction.

Should fix PR30244.

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

7 years ago[CodeGen] Make the TwoAddressInstructionPass check if the instruction is commutable...
Craig Topper [Sun, 11 Sep 2016 06:00:15 +0000 (06:00 +0000)]
[CodeGen] Make the TwoAddressInstructionPass check if the instruction is commutable before calling findCommutedOpIndices for every operand. Also make sure the operand is a register before each call to save some work on commutable instructions that might have an operand.

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

7 years ago[AVX-512] Add test cases to demonstrate opportunities for commuting vpternlog. Commut...
Craig Topper [Sun, 11 Sep 2016 05:33:43 +0000 (05:33 +0000)]
[AVX-512] Add test cases to demonstrate opportunities for commuting vpternlog. Commuting will be added in a future commit.

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

7 years ago[AVX-512] Add VPTERNLOG to load folding tables.
Craig Topper [Sun, 11 Sep 2016 05:33:40 +0000 (05:33 +0000)]
[AVX-512] Add VPTERNLOG to load folding tables.

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

7 years ago[X86] Side effecting asm in AVX512 integer stack folding test should return 2 x i64...
Craig Topper [Sun, 11 Sep 2016 05:33:38 +0000 (05:33 +0000)]
[X86] Side effecting asm in AVX512 integer stack folding test should return 2 x i64 not 8 x i64.

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

7 years ago[X86] Make a helper method into a static function local to the cpp file.
Craig Topper [Sun, 11 Sep 2016 05:33:35 +0000 (05:33 +0000)]
[X86] Make a helper method into a static function local to the cpp file.

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

7 years agoAdd handling of !invariant.load to PropagateMetadata.
Justin Lebar [Sun, 11 Sep 2016 01:39:08 +0000 (01:39 +0000)]
Add handling of !invariant.load to PropagateMetadata.

Summary:
This will let e.g. the load/store vectorizer propagate this metadata
appropriately.

Reviewers: arsenm

Subscribers: tra, jholewinski, hfinkel, mzolotukhin

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

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

7 years ago[NVPTX] Use ldg for explicitly invariant loads.
Justin Lebar [Sun, 11 Sep 2016 01:39:04 +0000 (01:39 +0000)]
[NVPTX] Use ldg for explicitly invariant loads.

Summary:
With this change (plus some changes to prevent !invariant from being
clobbered within llvm), clang will be able to model the __ldg CUDA
builtin as an invariant load, rather than as a target-specific llvm
intrinsic.  This will let the optimizer play with these loads --
specifically, we should be able to vectorize them in the load-store
vectorizer.

Reviewers: tra

Subscribers: jholewinski, hfinkel, llvm-commits, chandlerc

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

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

7 years ago[CodeGen] Split out the notions of MI invariance and MI dereferenceability.
Justin Lebar [Sun, 11 Sep 2016 01:38:58 +0000 (01:38 +0000)]
[CodeGen] Split out the notions of MI invariance and MI dereferenceability.

Summary:
An IR load can be invariant, dereferenceable, neither, or both.  But
currently, MI's notion of invariance is IR-invariant &&
IR-dereferenceable.

This patch splits up the notions of invariance and dereferenceability at
the MI level.  It's NFC, so adds some probably-unnecessary
"is-dereferenceable" checks, which we can remove later if desired.

Reviewers: chandlerc, tstellarAMD

Subscribers: jholewinski, arsenm, nemanjai, llvm-commits

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

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

7 years agoMCInstrDesc: Flags (uint64_t) was checked using (1 << MCID::XYZ), but this
Sjoerd Meijer [Sat, 10 Sep 2016 20:54:19 +0000 (20:54 +0000)]
MCInstrDesc: Flags (uint64_t) was checked using (1 << MCID::XYZ), but this
should have been (1ULL << MCID::XYZ). Currently this works because enum Flag
has 31 values, but extending it will result in a compile warnings/errors.
This was part of the accepted patch in https://reviews.llvm.org/D23601, but
it was suggested to apply this first as a separate patch.

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

7 years agoIt should also be legal to pass a swifterror parameter to a call as a swifterror
Arnold Schwaighofer [Sat, 10 Sep 2016 19:42:53 +0000 (19:42 +0000)]
It should also be legal to pass a swifterror parameter to a call as a swifterror
argument.

rdar://28233388

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

7 years ago[llvm-cov] Move the 'jump to first unexecuted line' link
Vedant Kumar [Sat, 10 Sep 2016 19:37:26 +0000 (19:37 +0000)]
[llvm-cov] Move the 'jump to first unexecuted line' link

Having it in the same row as the source name is jarring. Move it next to
the "Source" column label.

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

7 years ago[llvm-cov] Minor visual tweaks for html reports
Vedant Kumar [Sat, 10 Sep 2016 19:37:20 +0000 (19:37 +0000)]
[llvm-cov] Minor visual tweaks for html reports

  - Change the location of the 'Region Coverage' column.
  - Use less css and text for some labels.

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

7 years agoInstCombine: Don't combine loads/stores from swifterror to a new type
Arnold Schwaighofer [Sat, 10 Sep 2016 18:14:57 +0000 (18:14 +0000)]
InstCombine: Don't combine loads/stores from swifterror to a new type

This generates invalid IR: the only users of swifterror can be call
arguments, loads, and stores.

rdar://28242257

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

7 years agoAdd an isSwiftError predicate to Value
Arnold Schwaighofer [Sat, 10 Sep 2016 18:14:54 +0000 (18:14 +0000)]
Add an isSwiftError predicate to Value

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

7 years agoADT: Move ilist_node_access to ilist_detail::NodeAccess...
Duncan P. N. Exon Smith [Sat, 10 Sep 2016 16:55:06 +0000 (16:55 +0000)]
ADT: Move ilist_node_access to ilist_detail::NodeAccess...

... and make a few ilist-internal API changes, in preparation for
changing how ilist_node is templated.  The only effect for ilist users
should be changing the friend target from llvm::ilist_node_access to
llvm::ilist_detail::NodeAccess (which is only necessary when they
inherit privately from ilist_node).
- Split out SpecificNodeAccess, which has overloads of getNodePtr and
  getValuePtr that are untemplated.
- Use more typedefs to prevent more changes later.
- Force inheritance to use *NodeAccess (to emphasize that ilist *users*
  shouldn't be doing this).

There should be no functionality change here.

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

7 years agoADT: Use typedefs for ilist_base and ilist_node_base, NFC
Duncan P. N. Exon Smith [Sat, 10 Sep 2016 16:28:52 +0000 (16:28 +0000)]
ADT: Use typedefs for ilist_base and ilist_node_base, NFC

This is a prep commit to minimize changes in a follow-up that is adding
a template parameter to ilist_node_base and ilist_base.

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

7 years ago[InstCombine] clean up foldICmpBinOpEqualityWithConstant / foldICmpIntrinsicWithConst...
Sanjay Patel [Sat, 10 Sep 2016 15:33:39 +0000 (15:33 +0000)]
[InstCombine] clean up foldICmpBinOpEqualityWithConstant / foldICmpIntrinsicWithConstant ; NFC

1. Rename variables to be consistent with related/preceding code (may want to reorganize).
2. Fix comments/formatting.

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

7 years ago[InstCombine] rename and reorganize some icmp folding functions; NFC
Sanjay Patel [Sat, 10 Sep 2016 15:03:44 +0000 (15:03 +0000)]
[InstCombine] rename and reorganize some icmp folding functions; NFC

Everything under foldICmpInstWithConstant() should now be working for
splat vectors via m_APInt matchers. Ie, I've removed all of the FIXMEs
that I added while cleaning that section up. Note that not all of the
associated FIXMEs in the regression tests are gone though, because some
of the tests require earlier folds that are still scalar-only.

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

7 years agoWe also need to pass swifterror in R12 under swiftcc not only under ccc
Arnold Schwaighofer [Sat, 10 Sep 2016 14:16:55 +0000 (14:16 +0000)]
We also need to pass swifterror in R12 under swiftcc not only under ccc

rdar://28190687

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

7 years ago[AMDGPU] Refactor MUBUF/MTBUF instructions
Valery Pykhtin [Sat, 10 Sep 2016 13:09:16 +0000 (13:09 +0000)]
[AMDGPU] Refactor MUBUF/MTBUF instructions

Differential revision: https://reviews.llvm.org/D24295

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

7 years ago[gold/LTO] Add test case for r281134
Teresa Johnson [Sat, 10 Sep 2016 06:18:17 +0000 (06:18 +0000)]
[gold/LTO] Add test case for r281134

Add test case that was supposed to go in with r281134.

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

7 years ago[LTO] Handle null GV in Symbol object
Teresa Johnson [Sat, 10 Sep 2016 06:15:26 +0000 (06:15 +0000)]
[LTO] Handle null GV in Symbol object

Similar to other Symbol methods, have Symbol::getComdat handle
a null GV gracefully.

Fixes PR30326.

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

7 years ago[WebAssembly] Fix typos in comments
Heejin Ahn [Sat, 10 Sep 2016 02:33:47 +0000 (02:33 +0000)]
[WebAssembly] Fix typos in comments

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

7 years ago[libFuzzer] print a failed-merge warning only in the merge mode
Kostya Serebryany [Sat, 10 Sep 2016 02:17:22 +0000 (02:17 +0000)]
[libFuzzer] print a failed-merge warning only in the merge mode

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

7 years agoAMDGPU: Implement is{LoadFrom|StoreTo}FrameIndex
Matt Arsenault [Sat, 10 Sep 2016 01:20:33 +0000 (01:20 +0000)]
AMDGPU: Implement is{LoadFrom|StoreTo}FrameIndex

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

7 years agoAMDGPU: Fix scheduling info for spill pseudos
Matt Arsenault [Sat, 10 Sep 2016 01:20:28 +0000 (01:20 +0000)]
AMDGPU: Fix scheduling info for spill pseudos

These defaulted to Write32Bit. I don't think this actually matters
since these don't exist during scheduling.

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

7 years ago[asan] Add flag to allow lifetime analysis of problematic allocas
Vitaly Buka [Sat, 10 Sep 2016 01:06:11 +0000 (01:06 +0000)]
[asan] Add flag to allow lifetime analysis of problematic allocas

Summary:
Could be useful for comparison when we suspect that alloca was skipped
because of this.

Reviewers: eugenis

Subscribers: llvm-commits

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

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

7 years ago[CodeGen] Rename MachineInstr::isInvariantLoad to isDereferenceableInvariantLoad...
Justin Lebar [Sat, 10 Sep 2016 01:03:20 +0000 (01:03 +0000)]
[CodeGen] Rename MachineInstr::isInvariantLoad to isDereferenceableInvariantLoad.  NFC

Summary:
I want to separate out the notions of invariance and dereferenceability
at the MI level, so that they correspond to the equivalent concepts at
the IR level.  (Currently an MI load is MI-invariant iff it's
IR-invariant and IR-dereferenceable.)

First step is renaming this function.

Reviewers: chandlerc

Subscribers: MatzeB, jfb, llvm-commits

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

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

7 years ago[libFuzzer] don't print help for internal flags
Kostya Serebryany [Sat, 10 Sep 2016 00:35:30 +0000 (00:35 +0000)]
[libFuzzer] don't print help for internal flags

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

7 years ago[libFuzzer] print a visible message if merge fails due to a crash
Kostya Serebryany [Sat, 10 Sep 2016 00:15:41 +0000 (00:15 +0000)]
[libFuzzer] print a visible message if merge fails due to a crash

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

7 years agoRemove dead code in the SelectionDAG headers (NFC)
Vedant Kumar [Sat, 10 Sep 2016 00:05:19 +0000 (00:05 +0000)]
Remove dead code in the SelectionDAG headers (NFC)

I tested this with "ninja check-llvm-codegen" on a Release build with
all architectures enabled, and again with a Debug build on x86.

Found with llvm-cov.

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

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

7 years agoAMDGPU: Fix immediate folding logic when shrinking instructions
Matt Arsenault [Fri, 9 Sep 2016 23:32:53 +0000 (23:32 +0000)]
AMDGPU: Fix immediate folding logic when shrinking instructions

If the literal is being folded into src0, it doesn't matter
if it's an SGPR because it's being replaced with the literal.

Also fixes initially selecting 32-bit versions of some instructions
which also confused commuting.

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

7 years agoInliner: Don't mark swifterror allocas with lifetime markers
Arnold Schwaighofer [Fri, 9 Sep 2016 22:40:27 +0000 (22:40 +0000)]
Inliner: Don't mark swifterror allocas with lifetime markers

This would create a bitcast use which fails the verifier: swifterror values may
only be used by loads, stores, and as function arguments.

rdar://28233244

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

7 years agoX86: Fold tail calls into conditional branches also for 64-bit (PR26302)
Hans Wennborg [Fri, 9 Sep 2016 22:37:27 +0000 (22:37 +0000)]
X86: Fold tail calls into conditional branches also for 64-bit (PR26302)

This extends the optimization in r280832 to also work for 64-bit. The only
quirk is that we can't do this for 64-bit Windows (yet).

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

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

7 years agoAMDGPU: Run LoadStoreVectorizer pass by default
Matt Arsenault [Fri, 9 Sep 2016 22:29:28 +0000 (22:29 +0000)]
AMDGPU: Run LoadStoreVectorizer pass by default

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

7 years ago[libFuzzer] use sizeof() in tests instead of 4 and 8
Kostya Serebryany [Fri, 9 Sep 2016 22:21:16 +0000 (22:21 +0000)]
[libFuzzer] use sizeof() in tests instead of 4 and 8

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

7 years agoLSV: Fix incorrectly increasing alignment
Matt Arsenault [Fri, 9 Sep 2016 22:20:14 +0000 (22:20 +0000)]
LSV: Fix incorrectly increasing alignment

If the unaligned access has a dynamic offset, it may be odd which
would make the adjusted alignment incorrect to use.

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

7 years ago[gold] Test that we handle invalid directory correctly.
Davide Italiano [Fri, 9 Sep 2016 22:14:57 +0000 (22:14 +0000)]
[gold] Test that we handle invalid directory correctly.

I had this test sitting around for a while but always forgot to
commit. Rafael reviewed it a while ago.

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

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

7 years ago[InstCombine] use m_APInt to allow icmp ult X, C folds for splat constant vectors
Sanjay Patel [Fri, 9 Sep 2016 21:59:37 +0000 (21:59 +0000)]
[InstCombine] use m_APInt to allow icmp ult X, C folds for splat constant vectors

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

7 years ago[libFuzzer] one more puzzle for value profile
Kostya Serebryany [Fri, 9 Sep 2016 21:58:42 +0000 (21:58 +0000)]
[libFuzzer] one more puzzle for value profile

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

7 years ago[X86][XOP] Fix VPERMIL2PD mask creation on 32-bit targets
Simon Pilgrim [Fri, 9 Sep 2016 21:47:21 +0000 (21:47 +0000)]
[X86][XOP] Fix VPERMIL2PD mask creation on 32-bit targets

Use getConstVector helper to correctly create v2i64/v4i64 constants on 32-bit targets

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

7 years ago[Hexagon] Fix disassembler crash after r279255
Krzysztof Parzyszek [Fri, 9 Sep 2016 21:45:00 +0000 (21:45 +0000)]
[Hexagon] Fix disassembler crash after r279255

When p0 was added as an explicit operand to the duplex subinstructions,
the disassembler was not updated to reflect this.

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

7 years ago[X86] Regenerate test. NFC.
Michael Kuperstein [Fri, 9 Sep 2016 21:36:17 +0000 (21:36 +0000)]
[X86] Regenerate test. NFC.

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

7 years agoEnable in-tree builds of parallel-libs.
Justin Lebar [Fri, 9 Sep 2016 21:34:12 +0000 (21:34 +0000)]
Enable in-tree builds of parallel-libs.

Summary:
parallel-libs needs its own changes to make this work; these are just
the LLVM changes.

Reviewers: jhen

Subscribers: llvm-commits, beanz, jprice

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

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

7 years agoCreate phi nodes for swifterror values at the end of the phi instructions list
Arnold Schwaighofer [Fri, 9 Sep 2016 21:18:47 +0000 (21:18 +0000)]
Create phi nodes for swifterror values at the end of the phi instructions list

ISel makes assumption about the order of phi nodes.

rdar://28190150

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

7 years ago[NVPTX] Implement llvm.fabs.f32, llvm.max.f32, etc.
Justin Lebar [Fri, 9 Sep 2016 21:07:26 +0000 (21:07 +0000)]
[NVPTX] Implement llvm.fabs.f32, llvm.max.f32, etc.

Summary:
Previously these only worked via NVPTX-specific intrinsics.

This change will allow us to convert these target-specific intrinsics
into the general LLVM versions, allowing existing LLVM passes to reason
about their behavior.

It also gets us some minor codegen improvements as-is, from situations
where we canonicalize code into one of these llvm intrinsics.

Reviewers: majnemer

Subscribers: llvm-commits, jholewinski, tra

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

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

7 years agoARM: move the builtins libcall CC setup
Saleem Abdulrasool [Fri, 9 Sep 2016 20:11:31 +0000 (20:11 +0000)]
ARM: move the builtins libcall CC setup

Move the target specific setup into the target specific lowering setup.  As
pointed out by Anton, the initial change was moving this too high up the stack
resulting in a violation of the layering (the target generic code path setup
target specific bits).  Sink this into the ARM specific setup.  NFC.

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

7 years ago[cmake] Fix a stale comment from an earlier version of r281085. NFC.
Michael Gottesman [Fri, 9 Sep 2016 19:48:22 +0000 (19:48 +0000)]
[cmake] Fix a stale comment from an earlier version of r281085. NFC.

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

7 years ago[cmake] Export gtest/gtest_main and its dependencies via a special build tree only...
Michael Gottesman [Fri, 9 Sep 2016 19:45:34 +0000 (19:45 +0000)]
[cmake] Export gtest/gtest_main and its dependencies via a special build tree only cmake exports file.

Previously, gtest/gtest_main were not exported via cmake. The intention here was
to ensure that users whom are linking against the LLVM install tree would not
get the gtest/gtest_main targets. This prevents downstream projects that link
against the LLVM build tree (i.e. Swift) from getting this dependency
information in their cmake builds. Without such dependency information, linker
issues can result on linux due to LLVMSupport being put before gtest on the
linker command line.

This commit preserves behavior that we want for the install tree, while adding
support for the build tree by:

1. The special casing for gtest/gtest_main in the add_llvm_library code is
removed in favor of a flag called "BUILDTREE_ONLY". If this is set, then the
library is communicating that it is only meant to be exported into the build
tree and is not meant to be installed or exported via the install tree. This
part is just a tweak to remove the special case, the underlying code is the
same.

2. The cmake code that exports cmake targets for the build tree has special code
to import an additional targets file called
LLVMBuildTreeOnlyExports.cmake. Additionally the extra targets are added to the
LLVMConfig.cmake's LLVM_EXPORTED_TARGETS variable. In contrast, the
"installation" cmake file uses the normal LLVM_EXPORTS_TARGETS as before and
does not include the extra exports file. This is implemented by
defining/undefining variables when performing a configure of the build/install
tree LLVMConfig.cmake files.

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

7 years agoAdd a lower level zlib::uncompress.
Rafael Espindola [Fri, 9 Sep 2016 19:32:36 +0000 (19:32 +0000)]
Add a lower level zlib::uncompress.

SmallVectors are convenient, but they don't cover every use case.

In particular, they are fairly large (3 pointers + one element) and
there is no way to take ownership of the buffer to put it somewhere
else.  This patch then adds a lower lever interface that works with
any buffer.

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

7 years agoAMDGPU : Fix mqsad_u32_u8 instruction incorrect data type.
Wei Ding [Fri, 9 Sep 2016 19:31:51 +0000 (19:31 +0000)]
AMDGPU : Fix mqsad_u32_u8 instruction incorrect data type.

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

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

7 years agoAMDGPU/SI: Make sure llvm.amdgcn.implicitarg.ptr() is 8-byte aligned for HSA
Tom Stellard [Fri, 9 Sep 2016 19:28:00 +0000 (19:28 +0000)]
AMDGPU/SI: Make sure llvm.amdgcn.implicitarg.ptr() is 8-byte aligned for HSA

Reviewers: arsenm

Subscribers: arsenm, wdng, nhaehnle, llvm-commits

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

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

7 years ago[pdb] Print out some more info when dumping a raw stream.
Zachary Turner [Fri, 9 Sep 2016 19:00:49 +0000 (19:00 +0000)]
[pdb] Print out some more info when dumping a raw stream.

We have various command line options that print the type of a
stream, the size of a stream, etc but nowhere that it can all be
viewed together.

Since a previous patch introduced the ability to dump the bytes
of a stream, this seems like a good place to present a full view
of the stream's properties including its size, what kind of data
it represents, and the blocks it occupies.  So I added the
ability to print that information to the -stream-data command
line option.

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

7 years ago[llvm-cov] Remove some asserts in the html renderer (NFC)
Vedant Kumar [Fri, 9 Sep 2016 18:44:40 +0000 (18:44 +0000)]
[llvm-cov] Remove some asserts in the html renderer (NFC)

These asserts are making tests fragile. The renderer does not enter an
invalid state when they fail, however, it may spit out a garbled
coverage report because the source text no longer matches the provided
coverage mapping.

Another follow-up to r281072.

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

7 years agoDo not widen load for different variable in GVN.
Dehao Chen [Fri, 9 Sep 2016 18:42:35 +0000 (18:42 +0000)]
Do not widen load for different variable in GVN.

Summary:
Widening load in GVN is too early because it will block other optimizations like PRE, LICM.

https://llvm.org/bugs/show_bug.cgi?id=29110

The SPECCPU2006 benchmark impact of this patch:

Reference: o2_nopatch
(1): o2_patched

           Benchmark             Base:Reference   (1)
-------------------------------------------------------
spec/2006/fp/C++/444.namd                  25.2  -0.08%
spec/2006/fp/C++/447.dealII               45.92  +1.05%
spec/2006/fp/C++/450.soplex                41.7  -0.26%
spec/2006/fp/C++/453.povray               35.65  +1.68%
spec/2006/fp/C/433.milc                   23.79  +0.42%
spec/2006/fp/C/470.lbm                    41.88  -1.12%
spec/2006/fp/C/482.sphinx3                47.94  +1.67%
spec/2006/int/C++/471.omnetpp             22.46  -0.36%
spec/2006/int/C++/473.astar               21.19  +0.24%
spec/2006/int/C++/483.xalancbmk           36.09  -0.11%
spec/2006/int/C/400.perlbench             33.28  +1.35%
spec/2006/int/C/401.bzip2                 22.76  -0.04%
spec/2006/int/C/403.gcc                   32.36  +0.12%
spec/2006/int/C/429.mcf                   41.04  -0.41%
spec/2006/int/C/445.gobmk                 26.94  +0.04%
spec/2006/int/C/456.hmmer                  24.5  -0.20%
spec/2006/int/C/458.sjeng                    28  -0.46%
spec/2006/int/C/462.libquantum            55.25  +0.27%
spec/2006/int/C/464.h264ref               45.87  +0.72%

geometric mean                                   +0.23%

For most benchmarks, it's a wash, but we do see stable improvements on some benchmarks, e.g. 447,453,482,400.

Reviewers: davidxl, hfinkel, dberlin, sanjoy, reames

Subscribers: gberry, junbuml

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

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

7 years agoFix another -Wunused-variable for non-assert build.
Rui Ueyama [Fri, 9 Sep 2016 18:37:08 +0000 (18:37 +0000)]
Fix another -Wunused-variable for non-assert build.

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

7 years ago[llvm-cov] Try to fix the native_separators.c test some more
Vedant Kumar [Fri, 9 Sep 2016 18:34:43 +0000 (18:34 +0000)]
[llvm-cov] Try to fix the native_separators.c test some more

It's still breaking this bot (though, it looks like it always had been):

  http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015

This time, add quotes around llvm-{cov,config} so that lit won't expand
them.

Thanks to Reid for suggesting the patch!

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

7 years ago[pdb] Add command line options for dumping individual streams and blocks
Zachary Turner [Fri, 9 Sep 2016 18:17:52 +0000 (18:17 +0000)]
[pdb] Add command line options for dumping individual streams and blocks

I ran into a situation where I wanted to print out the contents of
page 6 of a PDB as a binary blob, and there was no straightforward
way to do that.

In addition to adding that, this patch also adds the ability to dump
a stream by index as a binary blob, and it will stitch together all
the blocks and dump the whole thing as one seemingly contiguous
sequence of bytes.

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

7 years agoFix -Wunused-variable for non-assert build.
Rui Ueyama [Fri, 9 Sep 2016 18:07:33 +0000 (18:07 +0000)]
Fix -Wunused-variable for non-assert build.

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

7 years ago[pdb] Pass CVRecord's through the visitor as non-const references.
Zachary Turner [Fri, 9 Sep 2016 18:03:39 +0000 (18:03 +0000)]
[pdb] Pass CVRecord's through the visitor as non-const references.

This simplifies a lot of code, and will actually be necessary for
an upcoming patch to serialize TPI record hash values.

The idea before was that visitors should be examining records, not
modifying them.  But this is no longer true with a visitor that
constructs a CVRecord from Yaml.  To handle this until now, we
were doing some fixups on CVRecord objects at a higher level, but
the code is really awkward, and it makes sense to just have the
visitor write the bytes into the CVRecord.  In doing so I uncovered
a few bugs related to `Data` and `RawData` and fixed those.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24362

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

7 years ago[libFuzzer] one more puzzle, value_profile cracks it in a second
Kostya Serebryany [Fri, 9 Sep 2016 18:00:04 +0000 (18:00 +0000)]
[libFuzzer] one more puzzle, value_profile cracks it in a second

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

7 years ago[pdb] Write PDB TPI Stream from Yaml.
Zachary Turner [Fri, 9 Sep 2016 17:46:17 +0000 (17:46 +0000)]
[pdb] Write PDB TPI Stream from Yaml.

This writes the full sequence of type records described in
Yaml to the TPI stream of the PDB file.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24316

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

7 years ago[llvm-cov] Handle native paths correctly in the text index
Vedant Kumar [Fri, 9 Sep 2016 17:37:11 +0000 (17:37 +0000)]
[llvm-cov] Handle native paths correctly in the text index

Treat filenames the same way in the text index as we do in the html
index. This is a follow-up to r281008 (an attempt to unbreak the
native_separators.c test on Windows).

Patch by Maggie Yi!

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

7 years agoMove the ocaml_all target into the Misc folder for cleanliness; NFC.
Aaron Ballman [Fri, 9 Sep 2016 17:30:59 +0000 (17:30 +0000)]
Move the ocaml_all target into the Misc folder for cleanliness; NFC.

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

7 years ago[codeview] Don't assert if the array element type is incomplete
Reid Kleckner [Fri, 9 Sep 2016 17:29:36 +0000 (17:29 +0000)]
[codeview] Don't assert if the array element type is incomplete

This can happen when the frontend knows the debug info will be emitted
somewhere else. Usually this happens for dynamic classes with out of
line constructors or key functions, but it can also happen when modules
are enabled.

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

7 years ago[Bitcode] Add compatibility test for the 3.9 release
Vedant Kumar [Fri, 9 Sep 2016 17:24:31 +0000 (17:24 +0000)]
[Bitcode] Add compatibility test for the 3.9 release

Fork off compatibility.ll for the 3.9 release. The *.bc file in this
commit was produced using a Release build of the release_39 branch.

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

7 years ago[InstCombine] add tests to show pattern matching failures due to commutation
Sanjay Patel [Fri, 9 Sep 2016 16:35:20 +0000 (16:35 +0000)]
[InstCombine] add tests to show pattern matching failures due to commutation

I was looking to fix a bug in getComplexity(), and these cases showed up as
obvious failures. I'm not sure how to find these in general though.

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