154126 Commits

Author SHA1 Message Date
Simon Pilgrim
45694861ec [X86][SSE] Move combineTo call out of combineX86ShuffleChain. NFCI.
First step towards making it possible to use the shuffle combines for cases where we don't want to call DCI.CombineTo() with the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 14:06:41 +00:00
Elena Demikhovsky
e38879830d Added a test that demonstrates a ug in Scatter scheduling.
The bug is going to be fixed in an upcomming patch.
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 13:20:42 +00:00
Coby Tayree
3edcac7764 [X86][X86AsmParser] adding const on InlineAsmIdentifierInfo in CreateMemForInlineAsm. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312881 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 12:21:24 +00:00
Uriel Korach
73e68366a4 Revert "adding autoUpgrade support to broadcast[f|i]32x2 intrinsics"
This reverts commit r312879 - An accidental partial commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 09:07:21 +00:00
Uriel Korach
986634ba4e adding autoUpgrade support to broadcast[f|i]32x2 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312879 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 08:40:13 +00:00
Uriel Korach
7e99d39a08 Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 08:31:22 +00:00
Sanjoy Das
2ff7d65548 [SCEV] Re-arrange public and private sections to be contiguous; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 03:54:22 +00:00
Simon Pilgrim
f9d4e1794d [X86] Add v2i4 store test case (PR20012)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 20:28:50 +00:00
Simon Pilgrim
5037d51d6d [X86] Add v2i2 test case (PR20011)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 20:22:35 +00:00
Simon Pilgrim
8b80450d25 [X86][FMA] Regenerate FMA tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 19:25:59 +00:00
Nuno Lopes
fe353a0cbf Merge isKnownNonNull into isKnownNonZero
It now knows the tricks of both functions.
Also, fix a bug that considered allocas of non-zero address space to be always non null

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 18:23:11 +00:00
Simon Pilgrim
a22f9f2405 [X86][SSE] i32 vector multiplications test cases from PR6399
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 18:18:17 +00:00
Simon Pilgrim
ce6571eae6 [X86][MOVBE] Fix typo in MOVBE scheduling test names
Copy+paste is not your friend

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 17:52:44 +00:00
Craig Topper
9080ea8806 [X86] Don't disable slow INC/DEC if optimizing for size
Summary:
Just because INC/DEC is a little slow on some processors doesn't mean we shouldn't prefer it when optimizing for size.

This appears to match gcc behavior.

Reviewers: chandlerc, zvi, RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 17:11:59 +00:00
MinSeong Kim
491dc19ec4 [CMake] Update GetSVN.cmake to handle repo
Summary:
When repo is used with git, 'clang --version' option does not display
the correct revision information (i.e. git hash on TOP) as the following:

clang version 6.0.0 --->
clang version 6.0.0 (clang version) (llvm version)

This is because repo also creates .git/svn folder as git-svn does and
this makes repo with git uses "git svn info" command, which is only for
git-svn, to retrieve its revision information, making null for the info.
To correctly distinguish between git-svn and repo with git, the folder
hierarchy to specify for git-svn should be .git/svn/refs as the "git svn
info" command depends on the revision data in .git/svn/refs. This patch
in turn makes repo with git passes through to the third macro,
get_source_info_git, in  get_source_info function, resulting in correctly
retrieving the revision information for repo with git using "git log ..."
command.

This patch is tested with git, svn, git-svn, and repo with git.

Reviewers: llvm-commits, probinson, rnk

Reviewed By: rnk

Subscribers: rnk, mehdi_amini, beanz, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 14:17:52 +00:00
Sanjay Patel
2d82e741fe [DivRemPairs] split tests per target to account for bots that don't build for all targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 14:10:59 +00:00
Sanjay Patel
193e898f75 [DivRempairs] add a pass to optimize div/rem pairs (PR31028)
This is intended to be a superset of the functionality from D31037 (EarlyCSE) but implemented 
as an independent pass, so there's no stretching of scope and feature creep for an existing pass. 
I also proposed a weaker version of this for SimplifyCFG in D30910. And I initially had almost 
this same functionality as an addition to CGP in the motivating example of PR31028:
https://bugs.llvm.org/show_bug.cgi?id=31028

The advantage of positioning this ahead of SimplifyCFG in the pass pipeline is that it can allow 
more flattening. But it needs to be after passes (InstCombine) that could sink a div/rem and
undo the hoisting that is done here.

Decomposing remainder may allow removing some code from the backend (PPC and possibly others).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 13:38:18 +00:00
NAKAMURA Takumi
23483f0a33 CoverageMappingTest.cpp: Suppress warnings. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 06:19:53 +00:00
Craig Topper
a5d2fa0ce2 [X86] Call removeDeadNode when we're done doing custom isel for mul, div and test
Summary:
Once we've done our custom isel for these nodes, I think we should be calling removeDeadNode to prune them out of the DAG. Table driven isel ultimately either calls morphNodeTo which modifies a node and doesn't leave dead nodes. Or it emits new nodes and then calls removeDeadNode as part of Opc_CompleteMatch.

If you run a simple multiply test case like this through llc with -debug you'll see a umul_lohi node get printed as part of the dump for Instruction Selection ends.

```
define i64 @foo(i64 %a, i64 %b) local_unnamed_addr #0 {
entry:
  %conv = zext i64 %a to i128
  %conv1 = zext i64 %b to i128
  %mul = mul nuw nsw i128 %conv1, %conv
  %shr = lshr i128 %mul, 64
  %conv2 = trunc i128 %shr to i64
  ret i64 %conv2
}
```

Reviewers: RKSimon, spatel, zvi, guyblank, niravd

Reviewed By: niravd

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 05:57:20 +00:00
Craig Topper
97293278fd [X86] Use ReplaceNode instead of ReplaceUses when converting X86ISD::SHRUNKBLEND to ISD::VSELECT during isel.
This ensures that the SHRUNKBLEND node gets erased immediately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 05:57:19 +00:00
Kostya Serebryany
eba4372133 [sanitizer-coverage] call appendToUsed once per module, not once per function (which is too slow)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 05:30:13 +00:00
Alexey Bataev
c2b919492b [SLP] Fix buildbots, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 02:08:45 +00:00
Matthias Braun
8f6af689a2 RegAllocFast: Fix warning; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 01:16:59 +00:00
Matthias Braun
8da30a7fc9 RegAllocFast: Cleanup; NFC
- Use range based for
- Variable names should start with upper case
- Add `const`
- Change class name to match filename
- Fix doxygen comments
- Use MCPhysReg instead of unsigned
- Use references instead of pointers where things cannot be nullptr
- Misc coding style improvements

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 00:52:46 +00:00
Matthias Braun
53da3e9f59 RegAllocFast: Move vector to class level to avoid reallocation; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 00:52:45 +00:00
Matthias Braun
d25fc768a7 RegAllocFast: Remove write-only set; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 00:52:42 +00:00
Kyle Butt
6ece35c79b PPC: Don't select lxv/stxv for insufficiently aligned stack slots.
The lxv/stxv instructions require an offset that is 0 % 16. Previously we were
selecting lxv/stxv for loads and stores to the stack where the offset from the
slot was a multiple of 16, but the stack slot was not 16 or more byte aligned.
When the frame gets lowered these transform to r(1|31) + slot + offset.
If slot is not aligned, slot + offset may not be 0 % 16.
Now we require 16 byte or more alignment for select lxv/stxv to stack slots.

Includes a testcase that shows both sufficiently and insufficiently aligned
stack slots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 00:37:56 +00:00
Yonghong Song
982a89e06c bpf: fix test failures due to previous bpf change of assembly code syntax
Signed-off-by: Yonghong Song <yhs@fb.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 00:11:13 +00:00
Davide Italiano
1546bf0dba [AMDGPU] Remove unused function. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 23:54:11 +00:00
Guozhi Wei
2f597e6a3f [TargetTransformInfo] Remove the extra "default" in a switch that all enum values has been covered.
In function TargetTransformInfo::getInstructionCost, all enum values in the switch statement has been covered, so the default is unnecessary, and may cause error with option -Werror,-Wcovered-switch-default, so remove it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 23:34:28 +00:00
Yonghong Song
f5858045aa bpf: proper print imm64 expression in inst printer
Fixed an issue in printImm64Operand where if the value is
an expression, print out the expression properly. Currently,
it will print
  r1 = <MCOperand Expr:(tx_port)>ll
With the patch, the printout will be
  r1 = tx_port

Suggested-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 23:32:38 +00:00
Guozhi Wei
19969b8b8f [TargetTransformInfo] Add a new public interface getInstructionCost
Current TargetTransformInfo can support throughput cost model and code size model, but sometimes we also need instruction latency cost model in different optimizations. Hal suggested we need a single public interface to query the different cost of an instruction. So I proposed following interface:

  enum TargetCostKind {
    TCK_RecipThroughput, ///< Reciprocal throughput.
    TCK_Latency,         ///< The latency of instruction.
    TCK_CodeSize         ///< Instruction code size.
  };

  int getInstructionCost(const Instruction *I, enum TargetCostKind kind) const;

All clients should mainly use this function to query the cost of an instruction, parameter <kind> specifies the desired cost model.

This patch also provides a simple default implementation of getInstructionLatency.

The default getInstructionLatency provides latency numbers for only small number of instruction classes, those latency numbers are only reasonable for modern OOO processors. It can be extended in following ways:

   Add more detail into this function.
   Add getXXXLatency function and call it from here.
   Implement target specific getInstructionLatency function.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 22:29:17 +00:00
Petr Hosek
9efaebecaa [CMake][runtimes] Use the same configuration for non-target and "default" target
The default host target for builtins and runtimes has special behavior
on some platforms, e.g. on Linux both i386 and x86_64 targets are being
built. Specifying "default" as a target name should lead to the same
behavior, which wasn't the case in the past. This patch unifies the
configuration between the non-target and "default" target to produce the
same behavior by moving the default configuration into a function that
can be used from both paths.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 22:26:50 +00:00
David Blaikie
fe2090ab78 Migrate llvm-symbolizer tests to not use %T
(context around the %T removal here: https://reviews.llvm.org/D35396 )

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 21:10:01 +00:00
Vedant Kumar
1052544a22 [llvm-cov] Use portable output redirection in a test
A follow-up to a test fix (r312825).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 20:24:23 +00:00
Vedant Kumar
7218efc547 [llvm-cov] Try to appease a Windows bot
On a Windows bot, I see a FileCheck error where the source being matched
over no longer exists, i.e it seems like it's FileCheck'ing some stale
output:

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/4747

You can see "// CHECK: [[@LINE]]|{{ +}Marker at 19:3 = 1" in the
FileCheck stderr, but that CHECK line doesn't exist.

Remove the input file to FileCheck before running the test, to try and
appease the bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312825 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 20:18:17 +00:00
Matt Arsenault
75448f1d3b AMDGPU: Start using !con operator
We have a lot of operand definition work essentially producing
every valid permutation of operands to workaround builiding
operand lists based on the instruction features. Apparently tablegen
already has a mostly undocumented operator to concat dags which
simplies this.

Convert one simple place to use this. The BUF instruction definitions
have much more complicated logic that can be totally rewritten now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 19:09:13 +00:00
Vedant Kumar
c9e1ee3ce0 [llvm-cov] Disable name-compression in a test binary
This should fix the lld bot:

The Buildbot has detected a new failure on builder llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast while building cfe.
Full details are available at:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/16993

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 19:08:39 +00:00
Matt Arsenault
fadb61df65 AMDGPU: Recompute scc liveness
The various scalar bit operations set SCC,
so one is erased or moved it needs to be recomputed.
Not sure why the existing tests don't fail on this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:51:26 +00:00
Vedant Kumar
33671ba388 [Coverage] Build sorted and unique segments
A coverage segment contains a starting line and column, an execution
count, and some other metadata. Clients of the coverage library use
segments to prepare line-oriented reports.

Users of the coverage library depend on segments being unique and sorted
in source order. Currently this is not guaranteed (this is why the clang
change which introduced deferred regions was reverted).

This commit documents the "unique and sorted" condition and asserts that
it holds. It also fixes the SegmentBuilder so that it produces correct
output in some edge cases.

Testing: I've added unit tests for some edge cases. I've also checked
that the new SegmentBuilder implementation is fully covered. Apart from
running check-profile and the llvm-cov tests, I've successfully used a
stage1 llvm-cov to prepare a coverage report for an instrumented clang
binary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:50 +00:00
Vedant Kumar
31b24fc041 [llvm-cov] Fix a lifetime issue
This fixes an issue where a std::string was moved to a constructor
which accepted a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:49 +00:00
Vedant Kumar
5d6f66273b [Coverage] Define LineColPair for convenience. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:48 +00:00
Vedant Kumar
55c5795332 [Coverage] Report errors when reading malformed source regions
Each source region has a start and end location. Report an error when
the end location does not precede the begin location.

The old lineExecutionCounts.covmapping test actually had a buggy source
region in it. This commit introduces a regenerated copy of the coverage
and moves the old copy to malformedRegions.covmapping, for a test.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:47 +00:00
Vedant Kumar
2cefdfaa16 [llvm-cov] Unify region marker placement between text/html modes
Make sure that the text and html emitters always emit the same set of
region markers, and avoid emitting redundant markers for line segments
which don't end on the line they start on.

This is related to D35925, and depends on D36014

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:46 +00:00
Chandler Carruth
400e98d4ca [x86] Fix GCC pedantic warnings about default arguments for lambdas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:23:42 +00:00
Craig Topper
403bab200a [X86] Simplify the slow-incdec test and add test cases with optsize.
I think we want to consider using inc/dec with optsize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312804 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 17:33:54 +00:00
Dinar Temirbulatov
996c1871f5 [SLPVectorizer] Add struct InstructionsState that holds information about analysis of vector to be vectorized.
Reviewers: spatel, mzolotukhin, mkuper, hfinkel, RKSimon, filcab, ABataev, davide

Subscribers: llvm-commits, rengolin

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312802 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 17:08:17 +00:00
Wei Mi
9930880cbf Fix a bug for rL312641.
rL312641 Allowed llvm.memcpy/memset/memmove to be tail calls when parent
function return the intrinsics's first argument. However on arm-none-eabi
platform, llvm.memcpy will be expanded to __aeabi_memcpy which doesn't
have return value. The fix is to check the libcall name after expansion
to match "memcpy/memset/memmove" before allowing those intrinsic to be
tail calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 16:44:52 +00:00
Krzysztof Parzyszek
145740999d Preserve existing regs when adding pristines to LivePhysRegs/LiveRegUnits
Differential Revision: https://reviews.llvm.org/D37600


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 16:29:50 +00:00
Alexey Bataev
c95cfa7758 [SLP] Fix the warning about paths not returning the value, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312793 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 14:32:20 +00:00