OSDN Git Service

android-x86/external-llvm.git
6 years ago[SystemZ] Add the CoveredBySubRegs bit to GPR64, GPR128 and FPR128 registers.
Jonas Paulsson [Tue, 12 Sep 2017 12:11:29 +0000 (12:11 +0000)]
[SystemZ]  Add the CoveredBySubRegs bit to GPR64, GPR128 and FPR128 registers.

This bit is needed in order for the CalleeSavedRegs list to automatically
include the super registers if all of their subregs are present.

Thanks to Wei Mi for initially indicating this deficiency in the SystemZ
backend.

Review: Ulrich Weigand.
https://bugs.llvm.org/show_bug.cgi?id=34550

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

6 years ago[X86][AVX2] Add additional fp-broadcast/subvector/shuffle scheduling tests
Simon Pilgrim [Tue, 12 Sep 2017 11:17:01 +0000 (11:17 +0000)]
[X86][AVX2] Add additional fp-broadcast/subvector/shuffle scheduling tests

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

6 years ago[X86][AVX] Add vperm2f128 scheduling test
Simon Pilgrim [Tue, 12 Sep 2017 11:10:59 +0000 (11:10 +0000)]
[X86][AVX] Add vperm2f128 scheduling test

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

6 years ago[X86][AVX2] Remove old (unused) intrinsic declarations
Simon Pilgrim [Tue, 12 Sep 2017 11:09:30 +0000 (11:09 +0000)]
[X86][AVX2] Remove old (unused) intrinsic declarations

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

6 years ago[AArch64] ISel: Add some debug messages to LowerBUILDVECTOR. NFC.
Sjoerd Meijer [Tue, 12 Sep 2017 10:24:12 +0000 (10:24 +0000)]
[AArch64] ISel: Add some debug messages to LowerBUILDVECTOR. NFC.

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

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

6 years ago[X86] Lower _mm[256|512]_[mask[z]]_avg_epu[8|16] intrinsics to native llvm IR
Yael Tsafrir [Tue, 12 Sep 2017 07:50:35 +0000 (07:50 +0000)]
[X86] Lower _mm[256|512]_[mask[z]]_avg_epu[8|16] intrinsics to native llvm IR

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

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

6 years ago[LAA] Allow more run-time alias checks by coercing pointer expressions to AddRecExprs
Silviu Baranga [Tue, 12 Sep 2017 07:48:22 +0000 (07:48 +0000)]
[LAA] Allow more run-time alias checks by coercing pointer expressions to AddRecExprs

Summary:
LAA can only emit run-time alias checks for pointers with affine AddRec
SCEV expressions. However, non-AddRecExprs can be now be converted to
affine AddRecExprs using SCEV predicates.

This change tries to add the minimal set of SCEV predicates in order
to enable run-time alias checking.

Reviewers: anemet, mzolotukhin, mkuper, sanjoy, hfinkel

Reviewed By: hfinkel

Subscribers: mssimpso, Ayal, dorit, roman.shirokiy, mzolotukhin, llvm-commits

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

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

6 years ago[ARM] Fix typo when creating ISD::SUB nodes
Roger Ferrer Ibanez [Tue, 12 Sep 2017 07:42:28 +0000 (07:42 +0000)]
[ARM] Fix typo when creating ISD::SUB nodes

In D35192, I accidentally introduced a typo when creating ISD::SUB nodes,
giving them two values instead of one.

This fails when the merge_values combiner finds one of these nodes.

This change fixes PR34564.

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

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

6 years ago[ARM] Use ADDCARRY / SUBCARRY
Roger Ferrer Ibanez [Tue, 12 Sep 2017 07:40:09 +0000 (07:40 +0000)]
[ARM] Use ADDCARRY / SUBCARRY

This is a preparatory step for D34515 and also is being recommitted as its
first version caused PR34045.

This change:
 - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
 - lowering is done by first converting the boolean value into the carry flag
   using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
   using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
   operations does the actual addition.
 - for subtraction, given that ISD::SUBCARRY second result is actually a
   borrow, we need to invert the value of the second operand and result before
   and after using ARMISD::SUBE. We need to invert the carry result of
   ARMISD::SUBE to preserve the semantics.
 - given that the generic combiner may lower ISD::ADDCARRY and
   ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
   as well otherwise i64 operations now would require branches. This implies
   updating the corresponding test for unsigned.
 - add new combiner to remove the redundant conversions from/to carry flags
   to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
 - fixes PR34045

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

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

6 years ago[X86] Add an extra instruction to TruncAssertSext.ll to prevent the 'or' from being...
Craig Topper [Tue, 12 Sep 2017 03:50:44 +0000 (03:50 +0000)]
[X86] Add an extra instruction to TruncAssertSext.ll to prevent the 'or' from being narrowed so that the movl is really required to avoid a miscompile.

If we allow the OR to be narrowed then the upper bits really are zero and we can't tell if the zeroing movl was removed on purpose.

While here regenerate the test with update_llc_test_checks.py

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

6 years agoRemove unneccessary string copies from method invocations.
Vlad Tsyrklevich [Tue, 12 Sep 2017 02:27:39 +0000 (02:27 +0000)]
Remove unneccessary string copies from method invocations.

Summary:
Change string parameter 'File' to be passed by const-reference to
reduce copies.

Patch by Mitch Phillips

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: Eugene.Zelenko, llvm-commits

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

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

6 years ago[X86] Rename TruncAssertZext.ll test to TruncAssertSext.ll. Since its testing AssertSext.
Craig Topper [Tue, 12 Sep 2017 01:30:10 +0000 (01:30 +0000)]
[X86] Rename TruncAssertZext.ll test to TruncAssertSext.ll. Since its testing AssertSext.

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

6 years ago[X86] Fix typo in comment. NFC
Craig Topper [Tue, 12 Sep 2017 01:30:09 +0000 (01:30 +0000)]
[X86] Fix typo in comment. NFC

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

6 years agoUpdate testcases that are XFAILed on Darwin for llvm-dwarfdump changes.
Adrian Prantl [Tue, 12 Sep 2017 01:20:29 +0000 (01:20 +0000)]
Update testcases that are XFAILed on Darwin for llvm-dwarfdump changes.

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

6 years agoFix broken links to the Itanium CXX ABI
Vlad Tsyrklevich [Tue, 12 Sep 2017 00:19:11 +0000 (00:19 +0000)]
Fix broken links to the Itanium CXX ABI

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

6 years agoRevert r312898 "[ARM] Use ADDCARRY / SUBCARRY"
Hans Wennborg [Mon, 11 Sep 2017 23:52:02 +0000 (23:52 +0000)]
Revert r312898 "[ARM] Use ADDCARRY / SUBCARRY"

It caused PR34564.

> This is a preparatory step for D34515 and also is being recommitted as its
> first version caused PR34045.
>
> This change:
>  - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
>  - lowering is done by first converting the boolean value into the carry flag
>    using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
>    using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
>    operations does the actual addition.
>  - for subtraction, given that ISD::SUBCARRY second result is actually a
>    borrow, we need to invert the value of the second operand and result before
>    and after using ARMISD::SUBE. We need to invert the carry result of
>    ARMISD::SUBE to preserve the semantics.
>  - given that the generic combiner may lower ISD::ADDCARRY and
>    ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
>    as well otherwise i64 operations now would require branches. This implies
>    updating the corresponding test for unsigned.
>  - add new combiner to remove the redundant conversions from/to carry flags
>    to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
>  - fixes PR34045
>
> Differential Revision: https://reviews.llvm.org/D35192

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

6 years agobpf: add " ll" in the LD_IMM64 asmstring
Yonghong Song [Mon, 11 Sep 2017 23:43:35 +0000 (23:43 +0000)]
bpf: add " ll" in the LD_IMM64 asmstring

This partially revert previous fix in commit f5858045aa0b
("bpf: proper print imm64 expression in inst printer").

In that commit, the original suffix "ll" is removed from
LD_IMM64 asmstring. In the customer print method, the "ll"
suffix is printed if the rhs is an immediate. For example,
"r2 = 5ll" => "r2 = 5ll", and "r3 = varll" => "r3 = var".

This has an issue though for assembler. Since assembler
relies on asmstring to do pattern matching, it will not
be able to distiguish between "mov r2, 5" and
"ld_imm64 r2, 5" since both asmstring is "r2 = 5".
In such cases, the assembler uses 64bit load for all
"r = <val>" asm insts.

This patch adds back " ll" suffix for ld_imm64 with one
additional space for "#reg = #global_var" case.

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@312978 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate testcases that are XFAILed on Darwin for llvm-dwarfdump changes.
Adrian Prantl [Mon, 11 Sep 2017 23:40:44 +0000 (23:40 +0000)]
Update testcases that are XFAILed on Darwin for llvm-dwarfdump changes.

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

6 years ago[llvm-cov] Try to fix a test on Windows
Vedant Kumar [Mon, 11 Sep 2017 23:32:30 +0000 (23:32 +0000)]
[llvm-cov] Try to fix a test on Windows

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

This looks like another stderr redirection issue.

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

6 years agollvm-dwarfdump: Make -brief the default and add a -verbose option instead.
Adrian Prantl [Mon, 11 Sep 2017 23:05:20 +0000 (23:05 +0000)]
llvm-dwarfdump: Make -brief the default and add a -verbose option instead.

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

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

6 years ago[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Mon, 11 Sep 2017 23:00:48 +0000 (23:00 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

6 years agollvm-dwarfdump: Replace -debug-dump=sect option with individual options.
Adrian Prantl [Mon, 11 Sep 2017 22:59:45 +0000 (22:59 +0000)]
llvm-dwarfdump: Replace -debug-dump=sect option with individual options.

As discussed on llvm-dev in
http://lists.llvm.org/pipermail/llvm-dev/2017-September/117301.html
this changes the command line interface of llvm-dwarfdump to match the
one used by the dwarfdump utility shipping on macOS. In addition to
being shorter to type this format also has the advantage of allowing
more than one section to be specified at the same time.

In a nutshell, with this change

  $ llvm-dwarfdump --debug-dump=info
  $ llvm-dwarfdump --debug-dump=apple-objc

becomes

  $ dwarfdump --debug-info --apple-objc

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

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

6 years ago[llvm-cov] Allow hiding instantiation/region coverage from summary tables
Eli Friedman [Mon, 11 Sep 2017 22:56:20 +0000 (22:56 +0000)]
[llvm-cov] Allow hiding instantiation/region coverage from summary tables

Region coverage is difficult to explain without going deep into how
coverage is implemented. Instantiation coverage is easier to explain,
but probably not useful in most cases (templates don't exist in C, and
most C++ code contains relatively few templates).

This patch adds the options "-show-region-summary" and
"-show-instantiation-summary" to allow hiding those columns.
"-show-instantiation-summary" is turned off by default.

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

6 years agoLowerTypeTests: Add import/export support for targets without absolute symbol constants.
Peter Collingbourne [Mon, 11 Sep 2017 22:49:10 +0000 (22:49 +0000)]
LowerTypeTests: Add import/export support for targets without absolute symbol constants.

The rationale is the same as for r312967.

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

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

6 years agoWholeProgramDevirt: Add import/export support for targets without absolute symbol...
Peter Collingbourne [Mon, 11 Sep 2017 22:34:42 +0000 (22:34 +0000)]
WholeProgramDevirt: Add import/export support for targets without absolute symbol constants.

Not all targets support the use of absolute symbols to export
constants. In particular, ARM has a wide variety of constant encodings
that cannot currently be relocated by linkers. So instead of exporting
the constants using symbols, export them directly in the summary.
The values of the constants are left as zeroes on targets that support
symbolic exports.

This may result in more cache misses when targeting those architectures
as a result of arbitrary changes in constant values, but this seems
somewhat unavoidable for now.

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

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

6 years ago[llvm-cov] Don't attach exec counts to lines which start a skipped region
Vedant Kumar [Mon, 11 Sep 2017 21:31:32 +0000 (21:31 +0000)]
[llvm-cov] Don't attach exec counts to lines which start a skipped region

These lines by definition don't have an execution count.

This is the final part of the fix for:
https://bugs.llvm.org/show_bug.cgi?id=34166

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

6 years ago[InstSimplify] fix some test names; NFC
Sanjay Patel [Mon, 11 Sep 2017 20:38:31 +0000 (20:38 +0000)]
[InstSimplify] fix some test names; NFC

Too much division...the quotient is the answer.

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

6 years ago[InstSimplify] add tests for possible sdiv/srem simplifications; NFC
Sanjay Patel [Mon, 11 Sep 2017 19:42:41 +0000 (19:42 +0000)]
[InstSimplify] add tests for possible sdiv/srem simplifications; NFC

As noted in PR34517, the handling of signed div/rem is not on par with
unsigned div/rem. Signed is harder to reason about, but it should be
possible to handle at least some of these using the same technique that
we use for unsigned: use icmp logic to see if there's a relationship
between the quotient and divisor.

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

6 years agoAMDGPU: Allow coldcc calls
Matt Arsenault [Mon, 11 Sep 2017 18:54:20 +0000 (18:54 +0000)]
AMDGPU: Allow coldcc calls

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

6 years ago[mips][microMIPS] add lapc instruction
Petar Jovanovic [Mon, 11 Sep 2017 18:34:04 +0000 (18:34 +0000)]
[mips][microMIPS] add lapc instruction

Implement LAPC instruction for mips32r6, mips64r6 and micromips32r6.

Patch by Milos Stojanovic.

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

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

6 years agoUnmerge GEPs to reduce register pressure on IndirectBr edges.
Hiroshi Yamauchi [Mon, 11 Sep 2017 17:52:08 +0000 (17:52 +0000)]
Unmerge GEPs to reduce register pressure on IndirectBr edges.

Summary:
GEP merging can sometimes increase the number of live values and register
pressure across control edges and cause performance problems particularly if the
increased register pressure results in spills.

This change implements GEP unmerging around an IndirectBr in certain cases to
mitigate the issue. This is in the CodeGenPrepare pass (after all the GEP
merging has happened.)

With this patch, the Python interpreter loop runs faster by ~5%.

Reviewers: sanjoy, hfinkel

Reviewed By: hfinkel

Subscribers: eastig, junbuml, llvm-commits

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

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

6 years ago[AMDGPU] Produce madak and madmk from the two-address pass
Stanislav Mekhanoshin [Mon, 11 Sep 2017 17:13:57 +0000 (17:13 +0000)]
[AMDGPU] Produce madak and madmk from the two-address pass

These two instructions are normally selected, but when the
two address pass converts mac into mad we end up with the
mad where we could have one of these.

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

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

6 years ago[X86] Remove portions of r275950 that are no longer needed with i1 not being a legal...
Craig Topper [Mon, 11 Sep 2017 16:16:48 +0000 (16:16 +0000)]
[X86] Remove portions of r275950 that are no longer needed with i1 not being a legal type

Summary:
r275950 added support for turning (trunc (X >> N) to i1) into BT(X, N). But that's no longer necessary now that i1 isn't legal.

This patch removes the support for that, but preserves some of the refactorings done in that commit.

Reviewers: guyblank, RKSimon, spatel, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[SelectionDAG] Remove a check for type being a vector type after calling getShiftAmou...
Craig Topper [Mon, 11 Sep 2017 16:15:39 +0000 (16:15 +0000)]
[SelectionDAG] Remove a check for type being a vector type after calling getShiftAmountTy. NFCI

getShiftAmountTy already returns the vector type when called for vectors.

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

6 years agoX86 Tests: More AVX512 conversions tests. NFC
Zvi Rackover [Mon, 11 Sep 2017 15:54:38 +0000 (15:54 +0000)]
X86 Tests: More AVX512 conversions tests. NFC

Adding more tests for AVX512 fp<->int conversions that were missing.

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

6 years ago[ScalarEvolution] Refactor forgetLoop() to improve performance
Marcello Maggioni [Mon, 11 Sep 2017 15:44:20 +0000 (15:44 +0000)]
[ScalarEvolution] Refactor forgetLoop() to improve performance

forgetLoop() has pretty bad performance because it goes over
the same instructions over and over again in particular when
nested loop are involved.
The refactoring changes the function to a not-recursive function
and reusing the allocation for data-structures and the Visited
set.

NFCI

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

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

6 years agoFix typo
Matt Arsenault [Mon, 11 Sep 2017 15:23:22 +0000 (15:23 +0000)]
Fix typo

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

6 years ago[X86][SSE] Add support for X86ISD::PACKSS to ComputeNumSignBitsForTargetNode
Simon Pilgrim [Mon, 11 Sep 2017 14:03:47 +0000 (14:03 +0000)]
[X86][SSE] Add support for X86ISD::PACKSS to ComputeNumSignBitsForTargetNode

Helps improve combineLogicBlendIntoPBLENDV support by allowing us to peek into through PACKSS truncations of vector comparison results.

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

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

6 years ago[AMDGPU] exp should not be in WQM mode
Tim Renouf [Mon, 11 Sep 2017 13:55:39 +0000 (13:55 +0000)]
[AMDGPU] exp should not be in WQM mode

A mrt exp with vm=1 must be in exact (non-WQM) mode, as it also exports
the exec mask as the valid mask to determine which pixels to render.

This commit marks any exp as needing to be in exact mode.

Actually, if there are multiple mrt exps, only one needs to have vm=1,
and only that one needs to be in exact mode. But that is an optimization
for another day.

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

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

6 years ago[TableGen] Ensure that __lsan_is_turned_off isn't removed by DCE in llvm-tblgen
Francis Ricci [Mon, 11 Sep 2017 13:50:39 +0000 (13:50 +0000)]
[TableGen] Ensure that __lsan_is_turned_off isn't removed by DCE in llvm-tblgen

Summary:
Since asan is linked dynamically on Darwin, the weak interface symbol
is removed by -Wl,-dead_strip.

Reviewers: kcc, compnerd, aaron.ballman

Subscribers: llvm-commits

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

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

6 years ago[InstSimplify] reorder methods; NFC
Sanjay Patel [Mon, 11 Sep 2017 13:34:27 +0000 (13:34 +0000)]
[InstSimplify] reorder methods; NFC

I'm trying to refactor some shared code for integer div/rem,
but I keep having to scroll through fdiv. The FP ops have
nothing in common with the integer ops, so I'm moving FP
below everything else.

While here, improve a couple of comments and fix some formatting.

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

6 years ago[X86][SSE] Add further test cases showing failure to compute sign bits through PACKSS
Simon Pilgrim [Mon, 11 Sep 2017 12:18:43 +0000 (12:18 +0000)]
[X86][SSE] Add further test cases showing failure to compute sign bits through PACKSS

Suggested in D37680

Note: had to drop AVX512VL tests as there is an infinite loop in the new tests that needs further investigation (not relevant to D37680).

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

6 years ago[X86][SKX][KNL] Updating several CodeGen tests to use the attr flag instead of mcpu...
Gadi Haber [Mon, 11 Sep 2017 11:26:20 +0000 (11:26 +0000)]
[X86][SKX][KNL] Updating several CodeGen tests to use the attr flag instead of mcpu flag

NFC.
 Updated 3 Codegen regression tests to use the -mattr flag instead of the -mcpu flags as follows:
 Instead of -mcpu=skx use -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq
 Instead of -mcpu=knl use -mattr=+avx512f

Reviewers: delena
Revision: https://reviews.llvm.org/D37674

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

6 years ago[ARM] Enable the use of SVC anywhere in an IT block
Andre Vieira [Mon, 11 Sep 2017 11:11:17 +0000 (11:11 +0000)]
[ARM] Enable the use of SVC anywhere in an IT block

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

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

6 years ago[Interleved][Stride 3]Adding test for case the VF=64 target with AVX512.
Michael Zuckerman [Mon, 11 Sep 2017 10:57:15 +0000 (10:57 +0000)]
[Interleved][Stride 3]Adding test for case the VF=64 target with AVX512.

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

6 years ago[X86][SSE] Add test showing failure to compute sign bits through PACKSS
Simon Pilgrim [Mon, 11 Sep 2017 10:50:03 +0000 (10:50 +0000)]
[X86][SSE] Add test showing failure to compute sign bits through PACKSS

Prevents combineLogicBlendIntoPBLENDV from merging to PBLENDV

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

6 years ago[AVR] Enable the '__do_copy_data' function
Dylan McKay [Mon, 11 Sep 2017 10:32:51 +0000 (10:32 +0000)]
[AVR] Enable the '__do_copy_data' function

Also enables '__do_clear_bss'.

These functions are automaticalled called by the CRT if they are
declared.

We need these to be called otherwise RAM will start completely
uninitialised, even though we need to copy RAM variables from progmem to
RAM.

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

6 years ago[GlobalISel][X86] G_ANYEXT support.
Igor Breger [Mon, 11 Sep 2017 09:41:13 +0000 (09:41 +0000)]
[GlobalISel][X86] G_ANYEXT support.

Summary: G_ANYEXT support

Reviewers: zvi, delena

Reviewed By: delena

Subscribers: rovka, kristof.beyls, llvm-commits

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

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

6 years agoFixed a typo in llvm-cov/deferred-region.cpp test.
Ilya Biryukov [Mon, 11 Sep 2017 09:22:44 +0000 (09:22 +0000)]
Fixed a typo in llvm-cov/deferred-region.cpp test.

Input redirection was using `2&>1` instead of `2>&1`.

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

6 years agoAMDGPU: trivial comment change
Tim Renouf [Mon, 11 Sep 2017 08:31:32 +0000 (08:31 +0000)]
AMDGPU: trivial comment change

... to check commit access for new committer.

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

6 years ago[ARM] Use ADDCARRY / SUBCARRY
Roger Ferrer Ibanez [Mon, 11 Sep 2017 07:38:05 +0000 (07:38 +0000)]
[ARM] Use ADDCARRY / SUBCARRY

This is a preparatory step for D34515 and also is being recommitted as its
first version caused PR34045.

This change:
 - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
 - lowering is done by first converting the boolean value into the carry flag
   using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
   using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
   operations does the actual addition.
 - for subtraction, given that ISD::SUBCARRY second result is actually a
   borrow, we need to invert the value of the second operand and result before
   and after using ARMISD::SUBE. We need to invert the carry result of
   ARMISD::SUBE to preserve the semantics.
 - given that the generic combiner may lower ISD::ADDCARRY and
   ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
   as well otherwise i64 operations now would require branches. This implies
   updating the corresponding test for unsigned.
 - add new combiner to remove the redundant conversions from/to carry flags
   to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
 - fixes PR34045

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

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

6 years agoFixed a bug in splitting Scatter operation in the Type Legalizer.
Elena Demikhovsky [Mon, 11 Sep 2017 06:18:15 +0000 (06:18 +0000)]
Fixed a bug in splitting Scatter operation in the Type Legalizer.
After the split of the Scatter operation, the order of the new instructions is well defined - Lo goes before Hi. Otherwise the semantic of Scatter (from LSB to MSB) is broken.
I'm chaining 2 nodes to prevent reordering.

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

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

6 years ago[ORC] Kill off a dead typedef.
Lang Hames [Mon, 11 Sep 2017 01:09:46 +0000 (01:09 +0000)]
[ORC] Kill off a dead typedef.

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

6 years agoUse llvm_unreachable for unknown TargetCostKind.
Simon Pilgrim [Sun, 10 Sep 2017 18:42:23 +0000 (18:42 +0000)]
Use llvm_unreachable for unknown TargetCostKind.

TargetTransformInfo::getInstructionCost's switch covers all TargetCostKind cases so we shouldn't return for a default case.

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

6 years ago[X86][SSE] Tidyup + clang-format combineX86ShuffleChain call. NFCI.
Simon Pilgrim [Sun, 10 Sep 2017 18:18:45 +0000 (18:18 +0000)]
[X86][SSE] Tidyup + clang-format combineX86ShuffleChain call. NFCI.

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

6 years ago[X86][SSE] Move combineTo call out of combineX86ShufflesConstants. NFCI.
Simon Pilgrim [Sun, 10 Sep 2017 18:10:49 +0000 (18:10 +0000)]
[X86][SSE] Move combineTo call out of combineX86ShufflesConstants. NFCI.

Move 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@312886 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstSimplify] refactor udiv/urem code and add tests; NFCI
Sanjay Patel [Sun, 10 Sep 2017 17:55:08 +0000 (17:55 +0000)]
[InstSimplify] refactor udiv/urem code and add tests; NFCI

This removes some duplicated code and makes it easier to support signed div/rem
in a similar way if we want to do that. Note that the existing comments were not
accurate - we don't need a constant divisor to simplify; icmp simplification does
more than that. But as the added tests show, it could go even further.

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

6 years ago[X86][SSE] Move combineTo call out of combineX86ShuffleChain. NFCI.
Simon Pilgrim [Sun, 10 Sep 2017 14:06:41 +0000 (14:06 +0000)]
[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

6 years agoAdded a test that demonstrates a ug in Scatter scheduling.
Elena Demikhovsky [Sun, 10 Sep 2017 13:20:42 +0000 (13:20 +0000)]
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

6 years ago[X86][X86AsmParser] adding const on InlineAsmIdentifierInfo in CreateMemForInlineAsm...
Coby Tayree [Sun, 10 Sep 2017 12:21:24 +0000 (12:21 +0000)]
[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

6 years agoRevert "adding autoUpgrade support to broadcast[f|i]32x2 intrinsics"
Uriel Korach [Sun, 10 Sep 2017 09:07:21 +0000 (09:07 +0000)]
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

6 years agoadding autoUpgrade support to broadcast[f|i]32x2 intrinsics
Uriel Korach [Sun, 10 Sep 2017 08:40:13 +0000 (08:40 +0000)]
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

6 years agoTest commit
Uriel Korach [Sun, 10 Sep 2017 08:31:22 +0000 (08:31 +0000)]
Test commit

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

6 years ago[SCEV] Re-arrange public and private sections to be contiguous; NFC
Sanjoy Das [Sun, 10 Sep 2017 03:54:22 +0000 (03:54 +0000)]
[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

6 years ago[X86] Add v2i4 store test case (PR20012)
Simon Pilgrim [Sat, 9 Sep 2017 20:28:50 +0000 (20:28 +0000)]
[X86] Add v2i4 store test case (PR20012)

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

6 years ago[X86] Add v2i2 test case (PR20011)
Simon Pilgrim [Sat, 9 Sep 2017 20:22:35 +0000 (20:22 +0000)]
[X86] Add v2i2 test case (PR20011)

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

6 years ago[X86][FMA] Regenerate FMA tests
Simon Pilgrim [Sat, 9 Sep 2017 19:25:59 +0000 (19:25 +0000)]
[X86][FMA] Regenerate FMA tests

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

6 years agoMerge isKnownNonNull into isKnownNonZero
Nuno Lopes [Sat, 9 Sep 2017 18:23:11 +0000 (18:23 +0000)]
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

6 years ago[X86][SSE] i32 vector multiplications test cases from PR6399
Simon Pilgrim [Sat, 9 Sep 2017 18:18:17 +0000 (18:18 +0000)]
[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

6 years ago[X86][MOVBE] Fix typo in MOVBE scheduling test names
Simon Pilgrim [Sat, 9 Sep 2017 17:52:44 +0000 (17:52 +0000)]
[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

6 years ago[X86] Don't disable slow INC/DEC if optimizing for size
Craig Topper [Sat, 9 Sep 2017 17:11:59 +0000 (17:11 +0000)]
[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

6 years ago[CMake] Update GetSVN.cmake to handle repo
MinSeong Kim [Sat, 9 Sep 2017 14:17:52 +0000 (14:17 +0000)]
[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

6 years ago[DivRemPairs] split tests per target to account for bots that don't build for all...
Sanjay Patel [Sat, 9 Sep 2017 14:10:59 +0000 (14:10 +0000)]
[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

6 years ago[DivRempairs] add a pass to optimize div/rem pairs (PR31028)
Sanjay Patel [Sat, 9 Sep 2017 13:38:18 +0000 (13:38 +0000)]
[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

6 years agoCoverageMappingTest.cpp: Suppress warnings. [-Wdocumentation]
NAKAMURA Takumi [Sat, 9 Sep 2017 06:19:53 +0000 (06:19 +0000)]
CoverageMappingTest.cpp: Suppress warnings. [-Wdocumentation]

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

6 years ago[X86] Call removeDeadNode when we're done doing custom isel for mul, div and test
Craig Topper [Sat, 9 Sep 2017 05:57:20 +0000 (05:57 +0000)]
[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

6 years ago[X86] Use ReplaceNode instead of ReplaceUses when converting X86ISD::SHRUNKBLEND...
Craig Topper [Sat, 9 Sep 2017 05:57:19 +0000 (05:57 +0000)]
[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

6 years ago[sanitizer-coverage] call appendToUsed once per module, not once per function (which...
Kostya Serebryany [Sat, 9 Sep 2017 05:30:13 +0000 (05:30 +0000)]
[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

6 years ago[SLP] Fix buildbots, NFC.
Alexey Bataev [Sat, 9 Sep 2017 02:08:45 +0000 (02:08 +0000)]
[SLP] Fix buildbots, NFC.

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

6 years agoRegAllocFast: Fix warning; NFC
Matthias Braun [Sat, 9 Sep 2017 01:16:59 +0000 (01:16 +0000)]
RegAllocFast: Fix warning; NFC

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

6 years agoRegAllocFast: Cleanup; NFC
Matthias Braun [Sat, 9 Sep 2017 00:52:46 +0000 (00:52 +0000)]
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

6 years agoRegAllocFast: Move vector to class level to avoid reallocation; NFC
Matthias Braun [Sat, 9 Sep 2017 00:52:45 +0000 (00:52 +0000)]
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

6 years agoRegAllocFast: Remove write-only set; NFC
Matthias Braun [Sat, 9 Sep 2017 00:52:42 +0000 (00:52 +0000)]
RegAllocFast: Remove write-only set; NFC

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

6 years agoPPC: Don't select lxv/stxv for insufficiently aligned stack slots.
Kyle Butt [Sat, 9 Sep 2017 00:37:56 +0000 (00:37 +0000)]
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

6 years agobpf: fix test failures due to previous bpf change of assembly code syntax
Yonghong Song [Sat, 9 Sep 2017 00:11:13 +0000 (00:11 +0000)]
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

6 years ago[AMDGPU] Remove unused function. NFCI.
Davide Italiano [Fri, 8 Sep 2017 23:54:11 +0000 (23:54 +0000)]
[AMDGPU] Remove unused function. NFCI.

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

6 years ago[TargetTransformInfo] Remove the extra "default" in a switch that all enum values...
Guozhi Wei [Fri, 8 Sep 2017 23:34:28 +0000 (23:34 +0000)]
[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

6 years agobpf: proper print imm64 expression in inst printer
Yonghong Song [Fri, 8 Sep 2017 23:32:38 +0000 (23:32 +0000)]
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

6 years ago[TargetTransformInfo] Add a new public interface getInstructionCost
Guozhi Wei [Fri, 8 Sep 2017 22:29:17 +0000 (22:29 +0000)]
[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

6 years ago[CMake][runtimes] Use the same configuration for non-target and "default" target
Petr Hosek [Fri, 8 Sep 2017 22:26:50 +0000 (22:26 +0000)]
[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

6 years agoMigrate llvm-symbolizer tests to not use %T
David Blaikie [Fri, 8 Sep 2017 21:10:01 +0000 (21:10 +0000)]
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

6 years ago[llvm-cov] Use portable output redirection in a test
Vedant Kumar [Fri, 8 Sep 2017 20:24:23 +0000 (20:24 +0000)]
[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

6 years ago[llvm-cov] Try to appease a Windows bot
Vedant Kumar [Fri, 8 Sep 2017 20:18:17 +0000 (20:18 +0000)]
[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

6 years agoAMDGPU: Start using !con operator
Matt Arsenault [Fri, 8 Sep 2017 19:09:13 +0000 (19:09 +0000)]
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

6 years ago[llvm-cov] Disable name-compression in a test binary
Vedant Kumar [Fri, 8 Sep 2017 19:08:39 +0000 (19:08 +0000)]
[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

6 years agoAMDGPU: Recompute scc liveness
Matt Arsenault [Fri, 8 Sep 2017 18:51:26 +0000 (18:51 +0000)]
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

6 years ago[Coverage] Build sorted and unique segments
Vedant Kumar [Fri, 8 Sep 2017 18:44:50 +0000 (18:44 +0000)]
[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

6 years ago[llvm-cov] Fix a lifetime issue
Vedant Kumar [Fri, 8 Sep 2017 18:44:49 +0000 (18:44 +0000)]
[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

6 years ago[Coverage] Define LineColPair for convenience. NFC.
Vedant Kumar [Fri, 8 Sep 2017 18:44:48 +0000 (18:44 +0000)]
[Coverage] Define LineColPair for convenience. NFC.

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

6 years ago[Coverage] Report errors when reading malformed source regions
Vedant Kumar [Fri, 8 Sep 2017 18:44:47 +0000 (18:44 +0000)]
[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