OSDN Git Service

android-x86/external-llvm.git
6 years ago[AArch64] Improve macro fusion test case
Evandro Menezes [Thu, 22 Feb 2018 23:32:06 +0000 (23:32 +0000)]
[AArch64] Improve macro fusion test case

Improve a vector in the test case for the fusion of address generation and
loads or stores.  Otherwise, NFC.

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

6 years agoFix llvm-pdbutil to handle new built-in types
Adrian McCarthy [Thu, 22 Feb 2018 23:16:56 +0000 (23:16 +0000)]
Fix llvm-pdbutil to handle new built-in types

Summary:
The built-in PDB types enum has been extended to include char16_t and char32_t.
llvm-pdbutil was hitting an llvm_unreachable because it didn't know about these
new values.  The new values are not yet in the DIA documentation, but are
listed in the cvconst.h header that comes as part of the DIA SDK.

Reviewers: asmith, zturner, rnk

Subscribers: stella.stamenova, llvm-commits, sanjoy

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

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

6 years agoUpdate comment for whether or not we can optimize an alias - we're
Eric Christopher [Thu, 22 Feb 2018 23:12:11 +0000 (23:12 +0000)]
Update comment for whether or not we can optimize an alias - we're
checking the alias and not the aliasee. If the alias can be interposed
then we shouldn't do anything.

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

6 years agoFix the build of the wasm backend.
Benjamin Kramer [Thu, 22 Feb 2018 22:29:27 +0000 (22:29 +0000)]
Fix the build of the wasm backend.

toString conflicts with llvm::toString here. Yay for overly generic
function names.

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

6 years ago[InstrTypes] add frem and fneg with FMF creators
Sanjay Patel [Thu, 22 Feb 2018 21:46:13 +0000 (21:46 +0000)]
[InstrTypes] add frem and fneg with FMF creators

The more popular opcodes were added at r325730, but we
should have everything here for symmetry. I think both
of these can be used in InstCombine already, but I'll
make those changes as separate clean-ups for InstCombine.

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

6 years ago[DWARFv5] Turn an assert into a diagnostic. Hand-coded assembler files
Paul Robinson [Thu, 22 Feb 2018 21:03:33 +0000 (21:03 +0000)]
[DWARFv5] Turn an assert into a diagnostic. Hand-coded assembler files
should not trigger assertions.

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

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

6 years ago[ThinLTO/gold] Perform cache pruning when cache directory specified
Teresa Johnson [Thu, 22 Feb 2018 20:57:05 +0000 (20:57 +0000)]
[ThinLTO/gold] Perform cache pruning when cache directory specified

Summary:
As pointed out in the review for D37993, for consistency with other
linkers, gold plugin should perform cache pruning whenever there is a
cache directory specified, which will use the default cache policy.

Reviewers: pcc

Subscribers: llvm-commits, inglorion

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

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

6 years ago[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCo...
Craig Topper [Thu, 22 Feb 2018 20:51:26 +0000 (20:51 +0000)]
[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCodeLegal. Update callers to use one or the other.

isCondCodeLegal internally checked Legal or Custom which is misleading. Though no targets set any cond code action to Custom today.

So I've renamed isCondCodeLegal to isCondCodeLegalOrCustom and added a real isCondCodeLegal that only checks Legal.

I've changed legalization code to use isCondCodeLegalOrCustom and left things reachable via DAG combine as isCondCodeLegal. I've also changed some places that called getCondCodeAction and compared to Legal to just use isCondCodeLegal.

I'm looking at trying to keep SETCC all the way to isel for the AVX512 integer comparisons and I suspect I'll need to make some condition codes Custom to stop DAG combine from changing things post LegalizeOps. Prior to this only Expand stopped DAG combine, but that causes LegalizeOps to try to swap operands or invert rather than calling our Custom handler.

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

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

6 years ago[PDB] Add missing override to silence buildbots
Aaron Smith [Thu, 22 Feb 2018 20:28:40 +0000 (20:28 +0000)]
[PDB] Add missing override to silence buildbots

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

6 years ago[X86] Make the subus special case in LowerVSETCC self contained
Craig Topper [Thu, 22 Feb 2018 20:24:18 +0000 (20:24 +0000)]
[X86] Make the subus special case in LowerVSETCC self contained

Previously this code overrode the flags and opcode used by the later code in LowerVSETCC. This makes the code difficult to read and follow.

This patch moves all the SUBUS code into its own function and makes it responsible for creating its own SDNodes on success.

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

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

6 years ago[PDB] Fix buildbot failure from missing include for DIAEnumLineNumbers
Aaron Smith [Thu, 22 Feb 2018 20:00:07 +0000 (20:00 +0000)]
[PDB] Fix buildbot failure from missing include for DIAEnumLineNumbers

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

6 years agoRevert "[DebugInfo][FastISel] Fix dropping dbg.value()"
Sander de Smalen [Thu, 22 Feb 2018 19:53:59 +0000 (19:53 +0000)]
Revert "[DebugInfo][FastISel] Fix dropping dbg.value()"

This patch reverts r325440 and r325438 because it triggers an
assertion in SelectionDAGBuilder.cpp. Also having debug enabled
may unintentionally affect code-gen. The patch is reverted until
we find a better solution.

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

6 years ago[PDB] Implement more find methods for PDB symbols
Aaron Smith [Thu, 22 Feb 2018 19:47:43 +0000 (19:47 +0000)]
[PDB] Implement more find methods for PDB symbols

Summary:
Add additional find methods on PDB raw symbols.

findChildrenByAddr()
findChildrenByVA()
findInlineFramesByAddr()
findInlineFramesByVA()
findInlineLines()
findInlineLinesByAddr()
findInlineLinesByRVA()
findInlineLinesByVA()

Reviewers: zturner, llvm-commits

Reviewed By: zturner

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

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

6 years ago[ThinLTO] Represent relative BF using a scaled representation .
Easwaran Raman [Thu, 22 Feb 2018 19:44:08 +0000 (19:44 +0000)]
[ThinLTO] Represent relative BF using a scaled representation .

Summary:
The current integer representation of relative block frequency prevents
representing relative block frequencies below 1. This change uses a 8 of
the 29 bits to represent the decimal part by using a fixed scale of -8.

Reviewers: tejohnson, davidxl

Subscribers: mehdi_amini, inglorion, llvm-commits

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

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

6 years agoFix DataFlowSanitizer instrumentation pass to take parameter position changes into...
Peter Collingbourne [Thu, 22 Feb 2018 19:09:07 +0000 (19:09 +0000)]
Fix DataFlowSanitizer instrumentation pass to take parameter position changes into account for custom functions.

When DataFlowSanitizer transforms a call to a custom function, the
new call has extra parameters. The attributes on parameters must be
updated to take the new position of each parameter into account.

Patch by Sam Kerner!

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

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

6 years ago[ThinLTO] Always create linked objects file for --thinlto-index-only=
Vitaly Buka [Thu, 22 Feb 2018 19:06:15 +0000 (19:06 +0000)]
[ThinLTO] Always create linked objects file for --thinlto-index-only=

Summary:
ThinLTO indexing may decide to skip all objects. If we don't write something to
the list build system may consider this as failure or linker can reuse a file
from the previews build.

Reviewers: pcc, tejohnson

Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits

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

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

6 years ago[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on...
Vitaly Buka [Thu, 22 Feb 2018 19:06:05 +0000 (19:06 +0000)]
[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on the stack

Reviewers: tejohnson, pcc

Subscribers: inglorion, llvm-commits

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

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

6 years ago[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.
Matt Morehouse [Thu, 22 Feb 2018 19:00:17 +0000 (19:00 +0000)]
[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

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

6 years ago[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separ...
Daniel Neilson [Thu, 22 Feb 2018 18:55:59 +0000 (18:55 +0000)]
[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separately

Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
AlignmentFromAssumptions pass to cease using the old getAlignment()/setAlignment API of
MemoryIntrinsic in favour of getting/setting source & dest specific alignments through
the new API. This allows us to simplify some of the code in this pass and also be more
aggressive about setting the source and destination alignments separately.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

Reviewers: hfinkel, bollu, reames

Reviewed By: reames

Subscribers: reames, llvm-commits

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

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

6 years ago[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h
Simon Pilgrim [Thu, 22 Feb 2018 18:45:13 +0000 (18:45 +0000)]
[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h

This allows us to improve vector constant matching in more DAG code (backends, TargetLowering etc.).

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

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

6 years ago[MC] Don't crash on modulo by zero (PR35650)
Simon Pilgrim [Thu, 22 Feb 2018 18:06:48 +0000 (18:06 +0000)]
[MC] Don't crash on modulo by zero (PR35650)

Extension to D12776, handle modulo by zero in the same way we handle divide by zero.

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

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

6 years ago[IRBuilder] add creators for FP with FMF; NFCI
Sanjay Patel [Thu, 22 Feb 2018 17:33:20 +0000 (17:33 +0000)]
[IRBuilder] add creators for FP with FMF; NFCI

Also, add a helper for the constant folder to reduce duplication.

It seems out-of-place for and/or to be doing simplifications here?
Otherwise, I could have used the helper on those opcodes too.

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

6 years ago[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441
Simon Pilgrim [Thu, 22 Feb 2018 16:29:08 +0000 (16:29 +0000)]
[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441

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

6 years ago[DEBUGINFO] Do not output labels for empty macinfo sections.
Alexey Bataev [Thu, 22 Feb 2018 16:20:30 +0000 (16:20 +0000)]
[DEBUGINFO] Do not output labels for empty macinfo sections.

Summary:
If there is no debug info for macros, do not emit labels for empty
macinfo sections.

Reviewers: probinson, echristo

Subscribers: aprantl, llvm-commits, JDevlieghere

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

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

6 years agoTableGen: Add strict assertions to sanity check earlier type checking
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:12 +0000 (15:27 +0000)]
TableGen: Add strict assertions to sanity check earlier type checking

Summary:
Both of these errors should have been caught by type-checking during
parsing.

Change-Id: I891087936fd1a91d21bcda57c256e3edbe12b94d

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Allow implicit casting between string and code
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:03 +0000 (15:27 +0000)]
TableGen: Allow implicit casting between string and code

Summary:
Perhaps the distinction between the two should be removed entirely
in the long term, and the [{ ... }] syntax should just be a convenient
way of writing multi-line strings.

In the meantime, a lot of existing .td files are quite relaxed about
string vs. code, and this change allows switching on more consistent
type checks without breaking those.

Change-Id: If85e3e04469e41b58e2703b62ac0032d2711713c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Fix type of resolved and converted lists
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:45 +0000 (15:26 +0000)]
TableGen: Fix type of resolved and converted lists

Summary:
There are no new test cases, but a subsequent patch will introduce
assertions that would be triggered by existing test cases without this
fix.

Change-Id: I6a82d4b311b012aff3932978ae86f6a2dcfbf725

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Fix type deduction for !foreach
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:35 +0000 (15:26 +0000)]
TableGen: Fix type deduction for !foreach

Summary:
In the case of !foreach(id, input-list, transform) where the type of
input-list is list<A> and the type of transform is B, we now correctly
deduce list<B> as the type of the !foreach.

Change-Id: Ia19dd65eecc5991dd648280ba6a15f6a20fd61de

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Generalize type deduction for !listconcat
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:28 +0000 (15:26 +0000)]
TableGen: Generalize type deduction for !listconcat

Summary:
This way, it should work even with complex operands.

Change-Id: Iaccf5bbb50bd5882a0ba5d59689e4381315fb361

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Add some more helpful error messages
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:21 +0000 (15:26 +0000)]
TableGen: Add some more helpful error messages

Summary: Some fairly simple changes to start with.

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

Change-Id: I0c92731b36d309c6edfcae42595ae1a70cc051c9

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

6 years agoAMDGPU: Stop using .NAME in .td files
Nicolai Haehnle [Thu, 22 Feb 2018 15:25:11 +0000 (15:25 +0000)]
AMDGPU: Stop using .NAME in .td files

Summary:
.NAME is a bit of an odd duck, in that we should really treat it like
a template argument, but we currently don't, and so when and where
NAME is initialized and how is pretty inconsistent. Best to just avoid
using it as a field of already instantiated records, and use cast to
string instead.

Change-Id: I5a0c202401cede3d5c3827ab9c7858ea48b29108

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[RISCV] Implement c.lui immediate operand constraint
Shiva Chen [Thu, 22 Feb 2018 15:02:28 +0000 (15:02 +0000)]
[RISCV] Implement c.lui immediate operand constraint

Implement c.lui immediate constraint to [1, 31] and [0xfffe0, 0xfffff].
The RISC-V ISA describes the constraint as [1, 63], with that value
being loaded in to bits 17-12 of the destination register and sign extended
from bit 17. Therefore, this 6-bit immediate can represent values in the
ranges [1, 31] and [0xfffe0, 0xfffff].

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

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

6 years ago[FunctionAttrs][ArgumentPromotion][GlobalOpt] Disable some optimisations passes for...
Luke Cheeseman [Thu, 22 Feb 2018 14:42:08 +0000 (14:42 +0000)]
[FunctionAttrs][ArgumentPromotion][GlobalOpt] Disable some optimisations passes for naked functions

- Fix for bug 36078.
- Prevent the functionattrs, function-attrs, globalopt and argpromotion passes
  from changing naked functions.
- These passes can perform some alterations to the functions that should not be
  applied. An example is removing parameters that are seemingly not used because
  they are only referenced in the inline assembly. Another example is marking
  the function as fastcc.

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

6 years ago[InstCombine] add fmul multi-use test; NFC
Sanjay Patel [Thu, 22 Feb 2018 14:27:16 +0000 (14:27 +0000)]
[InstCombine] add fmul multi-use test; NFC

Also, rename tests to make their intent clearer.

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

6 years ago[mips] Generate memory dependencies for byVal arguments
Stefan Maksimovic [Thu, 22 Feb 2018 13:40:42 +0000 (13:40 +0000)]
[mips] Generate memory dependencies for byVal arguments

There were no memory dependencies made between stores generated
when lowering formal arguments and loads generated when
call lowering byVal arguments which made the Post-RA scheduler
place a load before a matching store.

Make the fixed object stored to mutable so that the load
instructions can have their memory dependencies added

Set the frame object as isAliased which clears the underlying
objects vector in ScheduleDAGInstrs::buildSchedGraph().
This results in addition of all stores as dependenies for loads.

This problem appeared when passing a byVal parameter
coupled with a fastcc function call.

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

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

6 years agoSyndicate duplicate code between CallInst and InvokeInst
Serge Guelton [Thu, 22 Feb 2018 13:30:32 +0000 (13:30 +0000)]
Syndicate duplicate code between CallInst and InvokeInst

NFC intended, syndicate common code to a parametric base class. Part of the original problem is that InvokeInst is a TerminatorInst, unlike CallInst. the problem is solved by introducing a parametrized class paramtertized by its base.

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

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

6 years agoFix Wdocumentation warning - remove param tag for old argument
Simon Pilgrim [Thu, 22 Feb 2018 13:28:42 +0000 (13:28 +0000)]
Fix Wdocumentation warning - remove param tag for old argument

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

6 years ago[RISCV][NFC] Make logic in RISCVMCCodeEmitter::getImmOpValue more defensive
Alex Bradbury [Thu, 22 Feb 2018 13:24:25 +0000 (13:24 +0000)]
[RISCV][NFC] Make logic in RISCVMCCodeEmitter::getImmOpValue more defensive

As pointed out by @sabuasal in a comment on D23568, the logic in
RISCVMCCodeEmitter::getImmOpValue could be more defensive. Although with the
current instruction definitions it is always the case that `VK_RISCV_LO` is
always used with either an I- or S-format instruction, this may not always be
the case in the future. Add a check to ensure we will get an assertion in
debug builds if that changes.

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

6 years ago[SLPVectorizer][X86] Add load extend tests (PR36091)
Simon Pilgrim [Thu, 22 Feb 2018 12:19:34 +0000 (12:19 +0000)]
[SLPVectorizer][X86] Add load extend tests (PR36091)

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

6 years ago[mips] Regenerate tests for D38128 (NFC)
Simon Dardis [Thu, 22 Feb 2018 11:53:01 +0000 (11:53 +0000)]
[mips] Regenerate tests for D38128 (NFC)

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

6 years ago[dsymutil] Remove \brief from comments. NFC
Jonas Devlieghere [Thu, 22 Feb 2018 11:43:43 +0000 (11:43 +0000)]
[dsymutil] Remove \brief from comments. NFC

With autobrief enabled, these server no purpose anymore. Most of them
were already removed but this makes everything consistent.

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

6 years ago[dsymutil] Fix typos and formatting. NFC.
Jonas Devlieghere [Thu, 22 Feb 2018 11:32:51 +0000 (11:32 +0000)]
[dsymutil] Fix typos and formatting. NFC.

Some over-due gardening: this fixes a bunch of typos and makes the
formatting consistent with LLVM's style guide.

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

6 years agoRecommit: [ARM] f16 constant pool fix
Sjoerd Meijer [Thu, 22 Feb 2018 10:43:57 +0000 (10:43 +0000)]
Recommit: [ARM] f16 constant pool fix

This recommits r325754; the modified and failing test case
actually didn't need any modifications.

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

6 years ago[dsymutil] Replace PATH_MAX in SmallString with fixed value.
Jonas Devlieghere [Thu, 22 Feb 2018 09:42:10 +0000 (09:42 +0000)]
[dsymutil] Replace PATH_MAX in SmallString with fixed value.

Apparently the Windows bots don't know this define, so just going with a
sensible default.

Failing builds:
  http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/19179
  http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/19263

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

6 years ago[ARM] Fix issue with large xor constants.
David Green [Thu, 22 Feb 2018 09:38:57 +0000 (09:38 +0000)]
[ARM] Fix issue with large xor constants.

Fixup to rL325573 for large xor constants.

Thanks to Eli Friedman for the catch.

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

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

6 years ago[dsymutil] Be smarter in caching calls to realpath
Jonas Devlieghere [Thu, 22 Feb 2018 09:20:40 +0000 (09:20 +0000)]
[dsymutil] Be smarter in caching calls to realpath

Calling realpath is expensive but necessary to perform the uniqueing in
dsymutil. Although we already cached the results for every individual
file in the line table, we had reports of it taking 40 seconds of a 3.5
minute link.

This patch adds a second level of caching. When we do have to call
realpath, we cache its result for its parents path. We didn't replace
the existing caching, because it's fast (indexed) and saves us from
reading the line table for entries we've already seen.

For WebkitCore this results in a decrease of 11% in linking time: from
85.79 to 76.11 seconds (average over 3 runs).

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

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

6 years agoRevert r325754 and r325755 (f16 literal pool) because buildbots were unhappy.
Sjoerd Meijer [Thu, 22 Feb 2018 08:41:55 +0000 (08:41 +0000)]
Revert r325754 and r325755 (f16 literal pool) because buildbots were unhappy.

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

6 years agoAdded a test that I forgot to svn add in my previous commit r325754.
Sjoerd Meijer [Thu, 22 Feb 2018 08:20:50 +0000 (08:20 +0000)]
Added a test that I forgot to svn add in my previous commit r325754.

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

6 years ago[ARM] f16 constant pool fix
Sjoerd Meijer [Thu, 22 Feb 2018 08:16:05 +0000 (08:16 +0000)]
[ARM] f16 constant pool fix

This is a follow up of r325012, that allowed half types in constant pools.
Proper alignment was enforced when a big basic block was split up, but not when
a CPE was placed before/after a block; the successor block had the wrong
alignment.

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

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Thu, 22 Feb 2018 07:48:29 +0000 (07:48 +0000)]
[NFC] fix trivial typos in comments

"a a" -> "a"

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

6 years ago[DAGCombiner] Add two calls to isVector before making calls to getVectorElementType...
Craig Topper [Thu, 22 Feb 2018 07:05:27 +0000 (07:05 +0000)]
[DAGCombiner] Add two calls to isVector before making calls to getVectorElementType/getVectorNumElements to avoid an assert.

We looked through a BITCAST, but the bitcast might be a from a scalar type rather than a vector.

I don't have a test case. I stumbled onto it while prototyping another change that isn't ready yet.

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

6 years ago[SampleProf] NFC. Expose reusable functionality in SampleProfile.
Mircea Trofin [Thu, 22 Feb 2018 06:42:57 +0000 (06:42 +0000)]
[SampleProf] NFC. Expose reusable functionality in SampleProfile.

Summary:
Exposing getOffset and findFunctionSamples as members of
SampleProfile. They are intimately tied to design choices of the
sample profile format - using offsets instead of line numbers, and
traversing inlined functions stack, respectively.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

6 years ago[SCEV][NFC] Factor out common logic into a separate method
Max Kazantsev [Thu, 22 Feb 2018 06:27:32 +0000 (06:27 +0000)]
[SCEV][NFC] Factor out common logic into a separate method

SCEV has multiple occurences of code when we need to prove some predicate on
every iteration of a loop and do it with invocations of couple `isLoopEntryGuardedByCond`,
`isLoopBackedgeGuardedByCond`. This patch factors out these two calls into a separate
method. It is a preparation step to extend this logic: it is not the only way how we can prove
such conditions.

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

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

6 years ago[PowerPC] Do not produce invalid CTR loop with an FRem
Nemanja Ivanovic [Thu, 22 Feb 2018 03:02:41 +0000 (03:02 +0000)]
[PowerPC] Do not produce invalid CTR loop with an FRem

An FRem instruction inside a loop should prevent the loop from being converted
into a CTR loop since this is not an operation that is legal on any PPC
subtarget. This will always be a call to a library function which means the
loop will be invalid if this instruction is in the body.

Fixes PR36292.

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

6 years ago[Utils] Avoid a hash table lookup in salvageDI, NFC
Vedant Kumar [Thu, 22 Feb 2018 01:29:41 +0000 (01:29 +0000)]
[Utils] Avoid a hash table lookup in salvageDI, NFC

According to the current coverage report salvageDebugInfo() is called
5.12 million times during testing and almost always returns early.

The early return depends on LocalAsMetadata::getIfExists returning null,
which involves a DenseMap lookup in an LLVMContextImpl. We can probably
speed this up by simply checking the IsUsedByMD bit in Value.

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

6 years ago[X86][MMX] Generlize MMX_MOVD64rr combines to accept v4i16/v8i8 build vectors as...
Simon Pilgrim [Wed, 21 Feb 2018 23:07:30 +0000 (23:07 +0000)]
[X86][MMX] Generlize MMX_MOVD64rr combines to accept v4i16/v8i8 build vectors as well as v2i32

Also handle both cases where the lower 32-bits of the MMX is undef or zero extended.

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

6 years agobpf: disable DwarfUsesRelocationsAcrossSections
Yonghong Song [Wed, 21 Feb 2018 22:59:14 +0000 (22:59 +0000)]
bpf: disable DwarfUsesRelocationsAcrossSections

The pahole does not work with BPF backend properly:

  -bash-4.2$ cat test.c
  struct test_t {
    int a;
    int b;
  };
  int test(struct test_t *s) {
    return s->a;
  }
  -bash-4.2$ clang -g -O2 -target bpf -c test.c
  -bash-4.2$ pahole test.o
  struct clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) {
          clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /*     0     4 */
          clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /*     4     4 */

          /* size: 8, cachelines: 1, members: 2 */
          /* last cacheline: 8 bytes */
  };
  -bash-4.2$

The reason is that BPF backend is not yet implemented in elfutils backend
  https://github.com/threatstack/elfutils/tree/master/backends
and pahole depends on elfutils for dwarf parsing and resolving relocation.

More specifically, the unsupported relocation in .debug_info for type/member name
against symbol table caused the incorrect result above. The following is
the raw .rel.debug_info for the above example,
  Hex dump of section '.rel.debug_info':
    0x00000000 06000000 00000000 0a000000 0b000000 ................
    0x00000010 0c000000 00000000 0a000000 01000000 ................
    0x00000020 12000000 00000000 0a000000 02000000 ................
    0x00000030 16000000 00000000 0a000000 0e000000 ................
    0x00000040 1a000000 00000000 0a000000 03000000 ................
               ----------------- -------- --------
                reloc location     type   symtab index

  Hex dump of section '.debug_info':
    0x00000000 7b000000 04000000 00000801 00000000 {...............
    0x00000010 0c000000 00000000 00000000 00000000 ................
    0x00000020 00000000 00001000 00000200 00000000 ................

Based on "type", the proper value will be extracted from symbol table
and filled in .debug_info so later on .debug_info can be properly
resolved against debug strings.

There are two ways to fix this problem. One is to fix elfutils by adding
BPF support which is desirable. This could take a long time and won't work
with already deployed pahole. For a short term workaround, we can disable
dwarf cross-section relation which specifically avoids debug_info and
symbol table cross relocation. This should help any dwarf-related tool
which has not implement BPF specific relocations yet.

Now .rel.debug_info does not have any relocation for symbol table and
.debug_info itself contains necessary relocation information by itself.
  Hex dump of section '.debug_info':
    0x00000000 7b000000 04000000 00000801 00000000 {...............
    0x00000010 0c003700 00000000 00003e00 00000000 ..7.......>.....
    0x00000020 00000000 00001000 00000200 00000000 ................
  location 0xc has 0, 0x12 has 0x37, 0x1a has 0x3e in place which
  will be used in relocation resolution. Here, the values of 0, 0x37 and 0x3e
  are offset in .debug_str section.
Please note the difference between two above .debug_info dumps.

With the fix, pahole works properly with BPF backend:
  -bash-4.2$ clang -O2 -g -target bpf -c test.c
  -bash-4.2$ pahole test.o
  struct test_t {
          int                        a;                    /*     0     4 */
          int                        b;                    /*     4     4 */

          /* size: 8, cachelines: 1, members: 2 */
          /* last cacheline: 8 bytes */
  };

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325735 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add some random FMF to tests so we know it's not dropped; NFC
Sanjay Patel [Wed, 21 Feb 2018 22:48:28 +0000 (22:48 +0000)]
[InstCombine] add some random FMF to tests so we know it's not dropped; NFC

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

6 years agoResubmit r325107 (case folding DJB hash)
Pavel Labath [Wed, 21 Feb 2018 22:36:31 +0000 (22:36 +0000)]
Resubmit r325107 (case folding DJB hash)

The issue was that the has function was generating different results depending
on the signedness of char on the host platform. This commit fixes the issue by
explicitly using an unsigned char type to prevent sign extension and
adds some extra tests.

The original commit message was:

This patch implements a variant of the DJB hash function which folds the
input according to the algorithm in the Dwarf 5 specification (Section
6.1.1.4.5), which in turn references the Unicode Standard (Section 5.18,
"Case Mappings").

To achieve this, I have added a llvm::sys::unicode::foldCharSimple
function, which performs this mapping. The implementation of this
function was generated from the CaseMatching.txt file from the Unicode
spec using a python script (which is also included in this patch). The
script tries to optimize the function by coalescing adjecant mappings
with the same shift and stride (terms I made up). Theoretically, it
could be made a bit smarter and merge adjecant blocks that were
interrupted by only one or two characters with exceptional mapping, but
this would save only a couple of branches, while it would greatly
complicate the implementation, so I deemed it was not worth it.

Since we assume that the vast majority of the input characters will be
US-ASCII, the folding hash function has a fast-path for handling these,
and only whips out the full decode+fold+encode logic if we encounter a
character outside of this range. It might be possible to implement the
folding directly on utf8 sequences, but this would also bring a lot of
complexity for the few cases where we will actually need to process
non-ascii characters.

Reviewers: JDevlieghere, aprantl, probinson, dblaikie

Subscribers: mgorny, hintonda, echristo, clayborg, vleschuk, llvm-commits

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

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

6 years ago[Hexagon] Add TargetRegisterInfo::getPointerRegClass() override
Tobias Edler von Koch [Wed, 21 Feb 2018 22:27:07 +0000 (22:27 +0000)]
[Hexagon] Add TargetRegisterInfo::getPointerRegClass() override

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

6 years ago[InstCombine] add and use Create*FMF functions; NFC
Sanjay Patel [Wed, 21 Feb 2018 22:18:55 +0000 (22:18 +0000)]
[InstCombine] add and use Create*FMF functions; NFC

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

6 years ago[X86][MMX] Add MMX_MOVD64rr build vector tests showing undef elements in the lower...
Simon Pilgrim [Wed, 21 Feb 2018 22:10:48 +0000 (22:10 +0000)]
[X86][MMX] Add MMX_MOVD64rr build vector tests showing undef elements in the lower half

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

6 years ago[ORC] Switch to shared_ptr ownership for SymbolSources in VSOs.
Lang Hames [Wed, 21 Feb 2018 21:55:57 +0000 (21:55 +0000)]
[ORC] Switch to shared_ptr ownership for SymbolSources in VSOs.

This makes it easy to free a SymbolSource (and any related
resources) when the last reference in a VSO is dropped.

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

6 years ago[ORC] Switch from a StringMap to an internal VSO in RTDyldObjectLinkingLayer.
Lang Hames [Wed, 21 Feb 2018 21:55:54 +0000 (21:55 +0000)]
[ORC] Switch from a StringMap to an internal VSO in RTDyldObjectLinkingLayer.

This is a first step towards switching to VSOs as the primary symbol tables in
ORC.

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

6 years ago[ORC] Switch RTDyldObjectLinkingLayer to take a unique_ptr<MemoryBuffer> rather
Lang Hames [Wed, 21 Feb 2018 21:55:49 +0000 (21:55 +0000)]
[ORC] Switch RTDyldObjectLinkingLayer to take a unique_ptr<MemoryBuffer> rather
than a shared ObjectFile/MemoryBuffer pair.

There's no need to pre-parse the buffer into an ObjectFile before passing it
down to the linking layer, and moving the parsing into the linking layer allows
us remove the parsing code at each call site.

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

6 years ago[AArch64] fix IR names to not be 'tmp' because that gives the CHECK script problems
Sanjay Patel [Wed, 21 Feb 2018 20:48:14 +0000 (20:48 +0000)]
[AArch64] fix IR names to not be 'tmp' because that gives the CHECK script problems

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

6 years ago[AArch64] add SLP test for matmul (PR36280); NFC
Sanjay Patel [Wed, 21 Feb 2018 20:34:16 +0000 (20:34 +0000)]
[AArch64] add SLP test for matmul (PR36280); NFC

This is a slight reduction of one of the benchmarks
that suffered with D43079. Cost model changes should
not cause this test to remain scalarized.

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

6 years agoRevert "[IRMover] Implement name based structure type mapping"
Rafael Espindola [Wed, 21 Feb 2018 20:12:18 +0000 (20:12 +0000)]
Revert "[IRMover] Implement name based structure type mapping"

This reverts commit r325686.

There was a misunderstanding and this has not been approved yet.

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

6 years agoFix a memory leak and a cross module reference.
Rafael Espindola [Wed, 21 Feb 2018 19:55:11 +0000 (19:55 +0000)]
Fix a memory leak and a cross module reference.

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

6 years ago[hwasan] Fix inline instrumentation.
Evgeniy Stepanov [Wed, 21 Feb 2018 19:52:23 +0000 (19:52 +0000)]
[hwasan] Fix inline instrumentation.

This patch changes hwasan inline instrumentation:

Fixes address untagging for shadow address calculation (use 0xFF instead of 0x00 for the top byte).
Emits brk instruction instead of hlt for the kernel and user space.
Use 0x900 instead of 0x100 for brk immediate (0x100 - 0x800 are unavailable in the kernel).
Fixes and adds appropriate tests.

Patch by Andrey Konovalov.

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

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

6 years agoasan: add kernel inline instrumentation test (retry)
Vedant Kumar [Wed, 21 Feb 2018 19:40:55 +0000 (19:40 +0000)]
asan: add kernel inline instrumentation test (retry)

Add a test that checks that kernel inline instrumentation works.

Patch by Andrey Konovalov!

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

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

6 years ago[X86][MMX] Run MMX bitcast test on 32 and 64-bit targets
Simon Pilgrim [Wed, 21 Feb 2018 18:52:16 +0000 (18:52 +0000)]
[X86][MMX] Run MMX bitcast test on 32 and 64-bit targets

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

6 years agoHandle IMAGE_REL_AMD64_ADDR32NB in RuntimeDyldCOFF
Frederich Munch [Wed, 21 Feb 2018 17:18:20 +0000 (17:18 +0000)]
Handle IMAGE_REL_AMD64_ADDR32NB in RuntimeDyldCOFF

Summary:
IMAGE_REL_AMD64_ADDR32NB relocations are currently set to zero in all cases.
This patch sets the relocation to the correct value when possible and shows an error when not.

Reviewers: enderby, lhames, compnerd

Reviewed By: compnerd

Subscribers: LepelTsmok, compnerd, martell, llvm-commits

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

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

6 years ago[LV] Fix test checks, NFC
Alexey Bataev [Wed, 21 Feb 2018 16:48:23 +0000 (16:48 +0000)]
[LV] Fix test checks, NFC

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

6 years ago[X86][MMX] Regenerate MMX MASKMOV test
Simon Pilgrim [Wed, 21 Feb 2018 16:38:08 +0000 (16:38 +0000)]
[X86][MMX] Regenerate MMX MASKMOV test

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

6 years ago[Hexagon] Return true in enableMultipleCopyHints().
Jonas Paulsson [Wed, 21 Feb 2018 16:37:45 +0000 (16:37 +0000)]
[Hexagon]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: Krzysztof Parzyszek

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

6 years ago[X86][MMX] Regenerate MMX arithmetic tests
Simon Pilgrim [Wed, 21 Feb 2018 16:37:10 +0000 (16:37 +0000)]
[X86][MMX] Regenerate MMX arithmetic tests

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

6 years ago[X86] LowerBITCAST - pull out repeated calls to getOperand(0). NFCI.
Simon Pilgrim [Wed, 21 Feb 2018 16:35:40 +0000 (16:35 +0000)]
[X86] LowerBITCAST - pull out repeated calls to getOperand(0). NFCI.

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

6 years ago[SLP] Fix test checks, NFC.
Alexey Bataev [Wed, 21 Feb 2018 15:32:58 +0000 (15:32 +0000)]
[SLP] Fix test checks, NFC.

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

6 years ago[Sparc] Include __tls_get_addr in symbol table for TLS calls to it
Jonas Devlieghere [Wed, 21 Feb 2018 15:25:26 +0000 (15:25 +0000)]
[Sparc] Include __tls_get_addr in symbol table for TLS calls to it

Global Dynamic and Local Dynamic call relocations only implicitly
reference __tls_get_addr; there is no connection in the ELF file between
the relocations and the symbol other than the specification for the
relocations' semantics. However, it still needs to be in the symbol
table despite the lack of explicit references to the symbol table entry,
since it needs to be bound at link time for these relocations, otherwise
any objects will fail to link.

For details, see https://sourceware.org/bugzilla/show_bug.cgi?id=22832.

Path by: James Clarke (jrtc27)

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

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

6 years ago[SCEV] Temporarily disable loop versioning for the purpose
Silviu Baranga [Wed, 21 Feb 2018 15:20:32 +0000 (15:20 +0000)]
[SCEV] Temporarily disable loop versioning for the purpose
of turning SCEVUnknowns of PHIs into AddRecExprs.

This feature is now hidden behind the -scev-version-unknown flag.

Fixes PR36032 and PR35432.

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

6 years ago[IRMover] Implement name based structure type mapping
Eugene Leviant [Wed, 21 Feb 2018 15:13:48 +0000 (15:13 +0000)]
[IRMover] Implement name based structure type mapping

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

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

6 years ago[X86][MMX] Regenerate MMX PSUB commutation test
Simon Pilgrim [Wed, 21 Feb 2018 15:07:47 +0000 (15:07 +0000)]
[X86][MMX] Regenerate MMX PSUB commutation test

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

6 years ago[X86] Regenerate GPR:XMM bitcast test
Simon Pilgrim [Wed, 21 Feb 2018 15:05:47 +0000 (15:05 +0000)]
[X86] Regenerate GPR:XMM bitcast test

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

6 years agoAMDGPU: Do not combine loads/store across physreg defs
Nicolai Haehnle [Wed, 21 Feb 2018 13:31:35 +0000 (13:31 +0000)]
AMDGPU: Do not combine loads/store across physreg defs

Summary:
Since this pass operates on machine SSA form, this should only really
affect M0 in practice.

Fixes various piglit variable-indexing/vs-varying-array-mat4-index-*

Change-Id: Ib2a1dc3a8d7b08225a8da49a86f533faa0986aa8
Fixes: r317751 ("AMDGPU: Merge S_BUFFER_LOAD_DWORD_IMM into x2, x4")

Reviewers: arsenm, mareko, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[AMDGPU][MC] Added lds support for MUBUF instructions
Dmitry Preobrazhensky [Wed, 21 Feb 2018 13:13:48 +0000 (13:13 +0000)]
[AMDGPU][MC] Added lds support for MUBUF instructions

See bug 28234: https://bugs.llvm.org/show_bug.cgi?id=28234

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

Reviewers: vpykhtin, artem.tamazov, arsenm

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

6 years ago[X86][MMX] Add PR29222 test case
Simon Pilgrim [Wed, 21 Feb 2018 12:06:27 +0000 (12:06 +0000)]
[X86][MMX] Add PR29222 test case

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

6 years ago[X86][MMX] Add some MMX build vector tests
Simon Pilgrim [Wed, 21 Feb 2018 12:01:30 +0000 (12:01 +0000)]
[X86][MMX] Add some MMX build vector tests

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

6 years agoRISCV: Add COFF address space
Martell Malone [Wed, 21 Feb 2018 06:42:38 +0000 (06:42 +0000)]
RISCV: Add COFF address space

PE spec defines and reserves to following for RISCV

IMAGE_FILE_MACHINE_RISCV32  0x5032
IMAGE_FILE_MACHINE_RISCV64  0x5064
IMAGE_FILE_MACHINE_RISCV128 0x5128

https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx

Reviewers: asb, rnk, compnerd

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

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

6 years ago[BDCE] Salvage debug info from dying insts
Vedant Kumar [Wed, 21 Feb 2018 01:55:33 +0000 (01:55 +0000)]
[BDCE] Salvage debug info from dying insts

This results in 15 additional unique source variables in a stage2 build
of FileCheck (at '-Os -g'), with a negligible increase in the size of
the .debug_loc section.

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

6 years agorevert r325515: [TTI CostModel] change default cost of FP ops to 1 (PR36280)
Sanjay Patel [Wed, 21 Feb 2018 01:42:52 +0000 (01:42 +0000)]
revert r325515: [TTI CostModel] change default cost of FP ops to 1 (PR36280)

There are too many perf regressions resulting from this, so we need to
investigate (and add tests for) targets like ARM and AArch64 before
trying to reinstate.

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

6 years ago[lit] Fix a problem with spaces in the python path by adding quotes around it
Aaron Smith [Wed, 21 Feb 2018 00:41:30 +0000 (00:41 +0000)]
[lit] Fix a problem with spaces in the python path by adding quotes around it

These are the last tests left to fix after D43265.

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

6 years ago[X86] Disable CLWB for Cannon Lake
Craig Topper [Wed, 21 Feb 2018 00:15:48 +0000 (00:15 +0000)]
[X86] Disable CLWB for Cannon Lake

Cannon Lake does not support CLWB, therefore it
does not include all features listed under SKX anymore.

Instead, enumerate all SKX features with the exception of CLWB.

Patch by Gabor Buella

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

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

6 years ago[mips] Spectre variant two mitigation for MIPSR2
Simon Dardis [Wed, 21 Feb 2018 00:06:53 +0000 (00:06 +0000)]
[mips] Spectre variant two mitigation for MIPSR2

This patch provides mitigation for CVE-2017-5715, Spectre variant two,
which affects the P5600 and P6600. It implements the LLVM part of
-mindirect-jump=hazard. It is _not_ enabled by default for the P5600.

The migitation strategy suggested by MIPS for these processors is to use
hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard
barrier variants of the 'jalr' and 'jr' instructions respectively.

These instructions impede the execution of instruction stream until
architecturally defined hazards (changes to the instruction stream,
privileged registers which may affect execution) are cleared. These
instructions in MIPS' designs are not speculated past.

These instructions are used with the attribute +use-indirect-jump-hazard
when branching indirectly and for indirect function calls.

These instructions are defined by the MIPS32R2 ISA, so this mitigation
method is not compatible with processors which implement an earlier
revision of the MIPS ISA.

Performance benchmarking of this option with -fpic and lld using
-z hazardplt shows a difference of overall 10%~ time increase
for the LLVM testsuite. Certain benchmarks such as methcall show a
substantially larger increase in time due to their nature.

Reviewers: atanasyan, zoran.jovanovic

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

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

6 years ago[InstCombine] C / -X --> -C / X
Sanjay Patel [Wed, 21 Feb 2018 00:01:45 +0000 (00:01 +0000)]
[InstCombine] C / -X --> -C / X

We already do this in DAGCombiner, but it should
also be good to eliminate the fsub use in IR.

This is similar to rL325648.

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

6 years ago[InstCombine] -X / C --> X / -C for FP
Sanjay Patel [Tue, 20 Feb 2018 23:51:16 +0000 (23:51 +0000)]
[InstCombine] -X / C --> X / -C for FP

We already do this in DAGCombiner, but it should
also be good to eliminate the fsub use in IR.

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

6 years ago[InstCombine] add tests for fdiv with negated op and constant op; NFC
Sanjay Patel [Tue, 20 Feb 2018 23:34:43 +0000 (23:34 +0000)]
[InstCombine] add tests for fdiv with negated op and constant op; NFC

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

6 years agoRevert "[AMDGPU] Increased vector length for global/constant loads."
Konstantin Zhuravlyov [Tue, 20 Feb 2018 23:30:21 +0000 (23:30 +0000)]
Revert "[AMDGPU] Increased vector length for global/constant loads."

https://reviews.llvm.org/rL325518

It breaks following OpenCL conformance tests:
  - Basic - parameter_types
  - Basic - vload_private

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

6 years ago[PatternMatch] allow vector matches with m_FNeg
Sanjay Patel [Tue, 20 Feb 2018 23:29:05 +0000 (23:29 +0000)]
[PatternMatch] allow vector matches with m_FNeg

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

6 years ago[DSE] Don't DSE stores that subsequent memmove calls read from
Sanjoy Das [Tue, 20 Feb 2018 23:19:34 +0000 (23:19 +0000)]
[DSE] Don't DSE stores that subsequent memmove calls read from

Summary:
We used to remove the first memmove in cases like this:

  memmove(p, p+2, 8);
  memmove(p, p+2, 8);

which is incorrect.  Fix this by changing isPossibleSelfRead to what was most
likely the intended behavior.

Historical note: the buggy code was added in https://reviews.llvm.org/rL120974
to address PR8728.

Reviewers: rsmith

Subscribers: mcrosier, llvm-commits, jlebar

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

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