OSDN Git Service

android-x86/external-llvm.git
6 years agoRe-commit r319490 "XOR the frame pointer with the stack cookie when protecting the...
Hans Wennborg [Tue, 5 Dec 2017 20:22:20 +0000 (20:22 +0000)]
Re-commit r319490 "XOR the frame pointer with the stack cookie when protecting the stack"

The patch originally broke Chromium (crbug.com/791714) due to its failing to
specify that the new pseudo instructions clobber EFLAGS. This commit fixes
that.

> Summary: This strengthens the guard and matches MSVC.
>
> Reviewers: hans, etienneb
>
> Subscribers: hiraditya, JDevlieghere, vlad.tsyrklevich, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D40622

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

6 years ago[X86][AVX512] Tag VPSLLDQ/VPSRLDQ instruction scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 20:16:22 +0000 (20:16 +0000)]
[X86][AVX512] Tag VPSLLDQ/VPSRLDQ instruction scheduler classes

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

6 years agoModify ModRefInfo values using static inline method abstractions [NFC].
Alina Sbirlea [Tue, 5 Dec 2017 20:12:23 +0000 (20:12 +0000)]
Modify ModRefInfo values using static inline method abstractions [NFC].

Summary:
The aim is to make ModRefInfo checks and changes more intuitive
and less error prone using inline methods that abstract the bit operations.

Ideally ModRefInfo would become an enum class, but that change will require
a wider set of changes into FunctionModRefBehavior.

Reviewers: sanjoy, george.burgess.iv, dberlin, hfinkel

Subscribers: nlopes, llvm-commits

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

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

6 years ago[SystemZ] Validate shifted compare value in adjustForTestUnderMask
Ulrich Weigand [Tue, 5 Dec 2017 19:42:07 +0000 (19:42 +0000)]
[SystemZ] Validate shifted compare value in adjustForTestUnderMask

When folding a shift into a test-under-mask comparison, make sure that
there is no loss of precision when creating the shifted comparison
value.  This usually never happens, except for certain always-true
comparisons in unoptimized code.

Fixes PR35529.

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

6 years ago[X86][AVX512] Tag VPTRUNC/VPMOVSX/VPMOVZX instruction scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 19:21:28 +0000 (19:21 +0000)]
[X86][AVX512] Tag VPTRUNC/VPMOVSX/VPMOVZX instruction scheduler classes

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

6 years ago[WebAssembly] Make stack-pointer imports mutable.
Dan Gohman [Tue, 5 Dec 2017 18:29:48 +0000 (18:29 +0000)]
[WebAssembly] Make stack-pointer imports mutable.

This is not currently valid by the wasm spec, however:
 - It replaces doing set_global on an immutable global, which is also
   not valid.
 - It's expected be valid in the near future:
   https://github.com/WebAssembly/threads/blob/master/proposals/threads/Globals.md
 - This only occurs before linking, so a fully linked object will be
   valid.

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

6 years agoSimplify test.
Rafael Espindola [Tue, 5 Dec 2017 18:26:23 +0000 (18:26 +0000)]
Simplify test.

It can use attrib instead of icacls.

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

6 years agoAMDGPU: Fix infinite loop with dbg_value
Matt Arsenault [Tue, 5 Dec 2017 18:23:17 +0000 (18:23 +0000)]
AMDGPU: Fix infinite loop with dbg_value

Surprisingly SIOptimizeExecMaskingPreRA can infinite loop
in some case with DBG_VALUE. Most tests using dbg_value are
run at -O0, so don't run this pass. This seems to only
happen when the value argument is undef.

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

6 years ago[CVP] Remove some {s|u}sub.with.overflow checks.
Joel Galenson [Tue, 5 Dec 2017 18:14:24 +0000 (18:14 +0000)]
[CVP] Remove some {s|u}sub.with.overflow checks.

This uses ConstantRange::makeGuaranteedNoWrapRegion's newly-added handling for subtraction to allow CVP to remove some subtraction overflow checks.

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

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

6 years ago[ConstantRange] Support subtraction in makeGuaranteedNoWrapRegion.
Joel Galenson [Tue, 5 Dec 2017 18:14:23 +0000 (18:14 +0000)]
[ConstantRange] Support subtraction in makeGuaranteedNoWrapRegion.

Previously ConstantRange::makeGuaranteedNoWrapRegion only handled addition.  This adds support for subtraction.

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

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

6 years ago[X86][X87] Tag FCMOV instruction scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 18:01:26 +0000 (18:01 +0000)]
[X86][X87] Tag FCMOV instruction scheduler classes

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

6 years agoTest commit.
Joel Galenson [Tue, 5 Dec 2017 17:59:07 +0000 (17:59 +0000)]
Test commit.

I removed a space at the end of a comment.  NFC.

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

6 years ago[SelectionDAG] Remove the code that handles SETCC with a scalar result type from...
Craig Topper [Tue, 5 Dec 2017 17:37:19 +0000 (17:37 +0000)]
[SelectionDAG] Remove the code that handles SETCC with a scalar result type from vector widening.

There's no such thing as a setcc with vector operands and scalar result. And if we're trying to widen the result we would have to already be looking at a vector result type.

So this patch renames the VSETCC function as the SETCC function and delete the original SETCC function.

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

6 years ago[SelectionDAG] Remove unused method declaration.
Craig Topper [Tue, 5 Dec 2017 17:37:17 +0000 (17:37 +0000)]
[SelectionDAG] Remove unused method declaration.

The method implementation was removed in r318982.

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

6 years ago[WebAssembly] Implement WASM_STACK_POINTER.
Dan Gohman [Tue, 5 Dec 2017 17:23:43 +0000 (17:23 +0000)]
[WebAssembly] Implement WASM_STACK_POINTER.

Use the .stack_pointer directive to implement WASM_STACK_POINTER for
specifying a global variable to be the stack pointer.

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

6 years ago[WebAssembly] Don't emit .import_global for the wasm target.
Dan Gohman [Tue, 5 Dec 2017 17:21:57 +0000 (17:21 +0000)]
[WebAssembly] Don't emit .import_global for the wasm target.

.import_global is used by the ELF-based target and not needed by the wasm
target.

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

6 years ago[PGO] detect infinite loop and form MST properly
Xinliang David Li [Tue, 5 Dec 2017 17:19:41 +0000 (17:19 +0000)]
[PGO] detect  infinite loop and form MST properly

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

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

6 years agoDelete temp file if rename fails.
Rafael Espindola [Tue, 5 Dec 2017 16:40:56 +0000 (16:40 +0000)]
Delete temp file if rename fails.

Without this when lld failed to replace the output file it would leave
the temporary behind. The problem is that the existing logic is

- cancel the delete flag
- rename

We have to cancel first to avoid renaming and then crashing and
deleting the old version. What is missing then is deleting the
temporary file if the rename fails.

This can be an issue on both unix and windows, but I am not sure how
to cause the rename to fail reliably on unix. I think it can be done
on ZFS since it has an ACL system similar to what windows uses, but
adding support for checking that in llvm-lit is probably not worth it.

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

6 years ago[X86][AVX512] Tag VNNIW instruction scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 16:17:21 +0000 (16:17 +0000)]
[X86][AVX512] Tag VNNIW instruction scheduler classes

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

6 years ago[InstCombine] Additional test for PR35354, NFC.
Alexey Bataev [Tue, 5 Dec 2017 16:15:55 +0000 (16:15 +0000)]
[InstCombine] Additional test for PR35354, NFC.

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

6 years ago[X86][AVX512] Drop some default NoItinerary arguments that aren't needed any more
Simon Pilgrim [Tue, 5 Dec 2017 16:10:57 +0000 (16:10 +0000)]
[X86][AVX512] Drop some default NoItinerary arguments that aren't needed any more

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

6 years ago[x86][AVX512] Lowering kunpack intrinsics to LLVM IR
Jina Nahias [Tue, 5 Dec 2017 15:42:56 +0000 (15:42 +0000)]
[x86][AVX512] Lowering kunpack intrinsics to LLVM IR

This patch, together with a matching clang patch (https://reviews.llvm.org/D39719), implements the lowering of X86 kunpack intrinsics to IR.

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

Change-Id: I4088d9428478f9457f6afddc90bd3d66b3daf0a1

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

6 years agoAdd REQUIRES asserts in combine_loads_from_build_pair.ll
Bjorn Pettersson [Tue, 5 Dec 2017 15:26:01 +0000 (15:26 +0000)]
Add REQUIRES asserts in combine_loads_from_build_pair.ll

A fixup of r319771, that was causing buildbot failures.

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

6 years ago[DAGCombine] Move AND nodes to multiple load leaves
Sam Parker [Tue, 5 Dec 2017 15:13:47 +0000 (15:13 +0000)]
[DAGCombine] Move AND nodes to multiple load leaves

Search from AND nodes to find whether they can be propagated back to
loads, so that the AND and load can be combined into a narrow load.
We search through OR, XOR and other AND nodes and all bar one of the
leaves are required to be loads or constants. The exception node then
needs to be masked off meaning that the 'and' isn't removed, but the
loads(s) are narrowed still.

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

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

6 years ago[X86][AVX512] Tag VPMADD52/VPSADBW instruction scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 14:59:40 +0000 (14:59 +0000)]
[X86][AVX512] Tag VPMADD52/VPSADBW instruction scheduler classes

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

6 years ago[DAGCombine] Handle big endian correctly in CombineConsecutiveLoads
Bjorn Pettersson [Tue, 5 Dec 2017 14:50:05 +0000 (14:50 +0000)]
[DAGCombine] Handle big endian correctly in CombineConsecutiveLoads

Summary:
Found out, at code inspection, that there was a fault in
DAGCombiner::CombineConsecutiveLoads for big-endian targets.

A BUILD_PAIR is always having the least significant bits of
the composite value in element 0. So when we are doing the checks
for consecutive loads, for big endian targets, we should check
if the load to elt 1 is at the lower address and the load
to elt 0 is at the higher address.

Normally this bug only resulted in missed oppurtunities for
doing the load combine. I guess that in some rare situation it
could lead to faulty combines, but I've not seen that happen.

Note that this patch actually will trigger load combine for
some big endian regression tests.
One example is test/CodeGen/PowerPC/anon_aggr.ll where we now get
  t76: i64,ch = load<LD8[FixedStack-9]
instead of
  t37: i32,ch = load<LD4[FixedStack-10]>
  t35: i32,ch = load<LD4[FixedStack-9]>
  t41: i64 = build_pair t37, t35
before legalization. Then the legalization will split the LD8
into two loads, so the end result is the same. That should
verify that the transfomation is correct now.

Reviewers: niravd, hfinkel

Reviewed By: niravd

Subscribers: nemanjai, llvm-commits

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

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

6 years ago[X86][AVX512] Add missing scalar CMPSS/CMPSD logic scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 14:34:42 +0000 (14:34 +0000)]
[X86][AVX512] Add missing scalar CMPSS/CMPSD logic scheduler classes

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

6 years agoBail out of a SimplifyCFG switch table opt at undef values.
Mikael Holmen [Tue, 5 Dec 2017 14:14:00 +0000 (14:14 +0000)]
Bail out of a SimplifyCFG switch table opt at undef values.

Summary:
A true or false result is expected from a comparison, but it seems the possibility of undef was overlooked, which could lead to a failed assert. This is fixed by this patch by bailing out if we encounter undef.

The bug is old and the assert has been there since the end of 2014, so it seems this is unusual enough to forego optimization.

Patch by JesperAntonsson.

Reviewers: spatel, eeckstein, hans

Reviewed By: hans

Subscribers: uabelho, llvm-commits

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

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

6 years ago[X86][AVX512] Cleanup bit logic scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 14:04:23 +0000 (14:04 +0000)]
[X86][AVX512] Cleanup bit logic scheduler classes

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

6 years ago[DAGCombine] isLegalNarrowLoad function (NFC)
Sam Parker [Tue, 5 Dec 2017 14:03:51 +0000 (14:03 +0000)]
[DAGCombine] isLegalNarrowLoad function (NFC)

Pull the checks upon the load out from ReduceLoadWidth into their own
function.

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

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

6 years ago[X86][AVX512] Tag scalar CVT and CMP instruction scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 13:49:44 +0000 (13:49 +0000)]
[X86][AVX512] Tag scalar CVT and CMP instruction scheduler classes

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

6 years ago[XRay][docs] Document xray_mode and log registration API.
Dean Michael Berris [Tue, 5 Dec 2017 12:43:12 +0000 (12:43 +0000)]
[XRay][docs] Document xray_mode and log registration API.

This marks certain flags in XRay as deprecated (in particular,
`xray_naive_log=` and `xray_fdr_log=`), and recommends the use of the
`xray_mode=` flag.

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

6 years ago[InstCombine] Don't crash on out of bounds shifts
Igor Laevsky [Tue, 5 Dec 2017 12:18:15 +0000 (12:18 +0000)]
[InstCombine] Don't crash on out of bounds shifts

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

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

6 years ago[X86][AVX512] Tag VPCMP/VPCMPU instruction scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 12:14:36 +0000 (12:14 +0000)]
[X86][AVX512] Tag VPCMP/VPCMPU instruction scheduler classes

Move hardcoded itinerary out to the instruction declarations. Not sure that IIC_SSE_ALU_F32P is the best schedule for integer comparisons, but I'm not going to change it right now.

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

6 years ago[X86][AVX512] Cleanup VPCMP scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 12:02:22 +0000 (12:02 +0000)]
[X86][AVX512] Cleanup VPCMP scheduler classes

Move hardcoded itinerary out to the instruction declarations. Not sure that IIC_SSE_ALU_F32P is the best schedule for integer comparisons, but I'm not going to change it right now.

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

6 years ago[X86][AVX512] Tag VFIXUPIMM instructions scheduler classes
Simon Pilgrim [Tue, 5 Dec 2017 11:46:57 +0000 (11:46 +0000)]
[X86][AVX512] Tag VFIXUPIMM instructions scheduler classes

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

6 years ago[SystemZ] set 'guessInstructionProperties = 0' and set flags as needed.
Jonas Paulsson [Tue, 5 Dec 2017 11:24:39 +0000 (11:24 +0000)]
[SystemZ]  set 'guessInstructionProperties = 0' and set flags as needed.

This has proven a healthy exercise, as many cases of incorrect instruction
flags were corrected in the process. As part of this, IntrWriteMem was added
to several SystemZ instrinsics.

Furthermore, a bug was exposed in TwoAddress with this change (as incorrect
hasSideEffects flags were removed and instructions could now be sunk), and
the test case for that bugfix (r319646) is included here as
test/CodeGen/SystemZ/twoaddr-sink.ll.

One temporary test regression (one extra copy) which will hopefully go away
in upcoming patches for similar cases:
test/CodeGen/SystemZ/vec-trunc-to-i1.ll

Review: Ulrich Weigand.
https://reviews.llvm.org/D40437

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

6 years ago[Regalloc] Generate and store multiple regalloc hints.
Jonas Paulsson [Tue, 5 Dec 2017 10:52:24 +0000 (10:52 +0000)]
[Regalloc]  Generate and store multiple regalloc hints.

MachineRegisterInfo used to allow just one regalloc hint per virtual
register. This patch extends this to a vector of regalloc hints, which is
filled in by common code with sorted copy hints. Such hints will make for
more ID copies that can be removed.

NB! This improvement is currently (and hopefully temporarily) *disabled* by
default, except for SystemZ. The only reason for this is the big impact this
has on tests, which has unfortunately proven unmanageable. It was a long
while since all the tests were updated and just waiting for review (which
didn't happen), but now targets have to enable this themselves
instead. Several targets could get a head-start by downloading the tests
updates from the Phabricator review. Thanks to those who helped, and sorry
you now have to do this step yourselves.

This should be an improvement generally for any target!

The target may still create its own hint, in which case this has highest
priority and is stored first in the vector. If it has target-type, it will
not be recomputed, as per the previous behaviour.

The temporary hook enableMultipleCopyHints() will be removed as soon as all
targets return true.

Review: Quentin Colombet, Ulrich Weigand.
https://reviews.llvm.org/D38128

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

6 years agoFix build bot after r319750 "[Support/TarWriter] - Don't allow TarWriter to add the...
George Rimar [Tue, 5 Dec 2017 10:35:11 +0000 (10:35 +0000)]
Fix build bot after r319750 "[Support/TarWriter] - Don't allow TarWriter to add the same file more than once."

Error was:
error: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]

http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3469/steps/build-unified-tree/logs/stdio
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/7118/steps/build-stage2-compiler/logs/stdio

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

6 years agoRe-commit "[cmake] Enable zlib support on windows"
Pavel Labath [Tue, 5 Dec 2017 10:24:15 +0000 (10:24 +0000)]
Re-commit "[cmake] Enable zlib support on windows"

This recommits r319533 which was broken llvm-config --system-libs
output.  The reason was that I used find_libraries for searching for the
z library.  This returns absolute paths, and when these paths made it
into llvm-config, it made it produce nonsensical flags.  To fix this, I
hand-roll a search for the library in the same way that we search for
the terminfo library a couple of lines below.

This is a bit less flexible than the find_library option, as it does not
allow the user to specify the path to the library at configure time
(which is important on windows, as zlib is unlikely to be found in any
of the standard places cmake searches), but I was able to guide the
build to find it with appropriate values of LIB and INCLUDE environment
variables.

Reviewers: compnerd, rnk, beanz, rafael

Subscribers: llvm-commits, mgorny

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

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

6 years ago[Support/TarWriter] - Don't allow TarWriter to add the same file more than once.
George Rimar [Tue, 5 Dec 2017 10:09:59 +0000 (10:09 +0000)]
[Support/TarWriter] - Don't allow TarWriter to add the same file more than once.

This is for PR35460.

Currently when LLD adds files to TarWriter it may pass the same file
multiple times. For example it happens for clang reproduce file which specifies
archive (.a) files more than once in command line.
Patch makes TarWriter to ignore files with the same path, so it will
add only the first one to archive.

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

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

6 years ago[X86] Fix a bug in handling GRXX subclasses in Domain Reassignment pass
Guy Blank [Tue, 5 Dec 2017 09:08:24 +0000 (09:08 +0000)]
[X86] Fix a bug in handling GRXX subclasses in Domain Reassignment pass

When trying to determine the correct Mask register class corresponding
to a GPR register class, not all register classes were handled.
This caused an assertion to be raised on some scenarios.

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

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

6 years ago[SelectionDAG] Use WidenTargetBoolean in WidenVecRes_MLOAD and WidenVecOp_MSTORE...
Craig Topper [Tue, 5 Dec 2017 08:15:03 +0000 (08:15 +0000)]
[SelectionDAG] Use WidenTargetBoolean in WidenVecRes_MLOAD and WidenVecOp_MSTORE instead of implementing it manually and incorrectly.

The CONCAT_VECTORS operand get its type from getSetCCResultType, but if the mask type and the setcc have different scalar sizes this creates an illegal CONCAT_VECTORS operation. The concat type should be 2x the mask type, and then an extend should be added if needed.

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

6 years agoTest commit, as per the LLVM Developer Policy.
Michael Trent [Tue, 5 Dec 2017 07:50:00 +0000 (07:50 +0000)]
Test commit, as per the LLVM Developer Policy.

Commit message, as per the same policy. I added a blank space to the end
of the file. Excelsior.

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

6 years ago[X86] Use vector widening to support sign extend from i1 when the dest type is not...
Craig Topper [Tue, 5 Dec 2017 06:37:21 +0000 (06:37 +0000)]
[X86] Use vector widening to support sign extend from i1 when the dest type is not 512-bits and vlx is not enabled.

Previously we used a wider element type and truncated. But its more efficient to keep the element type and drop unused elements.

If BWI isn't supported and we have a i16 or i8 type, we'll extend it to be i32 and still use a truncate.

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

6 years agoRevert r319691: [globalisel][tablegen] Split atomic load/store into separate opcode...
Daniel Sanders [Tue, 5 Dec 2017 05:52:07 +0000 (05:52 +0000)]
Revert r319691: [globalisel][tablegen] Split atomic load/store into separate opcode and enable for AArch64.

Some concerns were raised with the direction. Revert while we discuss it and look into an alternative

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

6 years agoDisable detect_leaks in the ASanified build of LLVM when using Apple LLVM. The releas...
Kuba Mracek [Tue, 5 Dec 2017 05:22:02 +0000 (05:22 +0000)]
Disable detect_leaks in the ASanified build of LLVM when using Apple LLVM. The released Apple LLVM versions don't support LSan.

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

6 years ago[X86] Fix a crash if avx512bw and xop are both enabled when the IR contrains a v32i8...
Craig Topper [Tue, 5 Dec 2017 04:47:12 +0000 (04:47 +0000)]
[X86] Fix a crash if avx512bw and xop are both enabled when the IR contrains a v32i8 bitreverse.

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

6 years agoAMDGPU: Fix missing subtarget feature initializer
Matt Arsenault [Tue, 5 Dec 2017 03:15:44 +0000 (03:15 +0000)]
AMDGPU: Fix missing subtarget feature initializer

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

6 years agoAMDGPU: Fix crash when scheduling DBG_VALUE
Matt Arsenault [Tue, 5 Dec 2017 03:09:23 +0000 (03:09 +0000)]
AMDGPU: Fix crash when scheduling DBG_VALUE

This calls handleMove with a DBG_VALUE instruction,
which isn't tracked by LiveIntervals. I'm not sure
this is the correct place to fix this. The generic
scheduler seems to have more deliberate region
selection that skips dbg_value.

The test is also really hard to reduce. I haven't been able
to figure out what exactly causes this particular case to
try moving the dbg_value.

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

6 years ago[X86] Use vector widening to support zero extend from i1 when the dest type is not...
Craig Topper [Tue, 5 Dec 2017 01:45:46 +0000 (01:45 +0000)]
[X86] Use vector widening to support zero extend from i1 when the dest type is not 512-bits and vlx is not enabled.

Previously we used a wider element type and truncated. But its more efficient to keep the element type and drop unused elements.

If BWI isn't supported and we have a i16 or i8 type, we'll extend it to be i32 and still use a truncate.

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

6 years ago[X86] Don't use kunpck for vXi1 concat_vectors if the upper bits are undef.
Craig Topper [Tue, 5 Dec 2017 01:28:06 +0000 (01:28 +0000)]
[X86] Don't use kunpck for vXi1 concat_vectors if the upper bits are undef.

This can be efficiently selected by a COPY_TO_REGCLASS without the need for an extra instruction.

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

6 years ago[X86] Use getZeroVector and remove an unnecessary creation of an APInt before calling...
Craig Topper [Tue, 5 Dec 2017 01:28:04 +0000 (01:28 +0000)]
[X86] Use getZeroVector and remove an unnecessary creation of an APInt before calling getConstant. NFCI

The getConstant function can take care of creating the APInt internally.

getZeroVector will take care of using the correct type for the build vector to avoid re-lowering.

The test change here is because execution domain constraints apparently pass through undef inputs of a zeroing xor. So the different ordering of register allocation here caused the dependency to change.

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

6 years ago[X86] Rearrange some of the code around AVX512 sign/zero extends. NFCI
Craig Topper [Tue, 5 Dec 2017 01:28:00 +0000 (01:28 +0000)]
[X86] Rearrange some of the code around AVX512 sign/zero extends. NFCI

Move the AVX512 code out of LowerAVXExtend. LowerAVXExtend has two callers but one of them pre-checks for AVX-512 so the code is only live from the other caller. So move the AVX-512 checks up to that caller for symmetry.

Move all of the i1 input type code in Lower_AVX512ZeroExend together.

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

6 years ago[cmake] Modernize some conditionals. NFC
Shoaib Meenai [Tue, 5 Dec 2017 01:19:48 +0000 (01:19 +0000)]
[cmake] Modernize some conditionals. NFC

The "x${...}" form was a workaround for CMake versions prior to 3.1,
where the if command would interpret arguments as variables even when
quoted [1]. We can drop the workaround now that our minimum CMake
version is 3.4.

[1] https://cmake.org/cmake/help/v3.1/policy/CMP0054.html

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

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

6 years agoMachineFrameInfo: Cleanup some parameter naming inconsistencies; NFC
Matthias Braun [Tue, 5 Dec 2017 01:18:15 +0000 (01:18 +0000)]
MachineFrameInfo: Cleanup some parameter naming inconsistencies; NFC

Consistently use the same parameter names as the names of the affected
fields. This avoids some unintuitive abbreviations like `isSS`.

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

6 years agoTwoAddressInstructionPass: Trigger -O0 behavior on optnone
Matthias Braun [Tue, 5 Dec 2017 00:56:14 +0000 (00:56 +0000)]
TwoAddressInstructionPass: Trigger -O0 behavior on optnone

While we cannot skip the whole TwoAddressInstructionPass even for -O0
there are some parts of the pass that are currently skipped at -O0 but
not for optnone. Changing this as there is no reason to have those two
hit different code paths here.

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

6 years ago[CMake] Don't use comma as an alternate separator
Petr Hosek [Tue, 5 Dec 2017 00:15:18 +0000 (00:15 +0000)]
[CMake] Don't use comma as an alternate separator

Using comma can break in cases when we're passing flags that already
use comma as a separator.

Fixes PR35504.

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

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

6 years agoAMDGPU/EG: Add a new FeatureFMA and use it to selectively enable FMA instruction
Jan Vesely [Mon, 4 Dec 2017 23:07:28 +0000 (23:07 +0000)]
AMDGPU/EG: Add a new FeatureFMA and use it to selectively enable FMA instruction

Only used by pre-GCN targets
v2: fix predicate setting for FMA_Common

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

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

6 years agoAMDGPU: Disable fp64 support on pre GCN asics
Jan Vesely [Mon, 4 Dec 2017 22:57:29 +0000 (22:57 +0000)]
AMDGPU: Disable fp64 support on pre GCN asics

It's not implemented.
Passing +fp64-fp16-denormal feature enables fp64 even on asics that don't support it

v2: fix hasFP64 query

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

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

6 years ago[msan] Add a fixme note for a minor deficiency.
Evgeniy Stepanov [Mon, 4 Dec 2017 22:50:39 +0000 (22:50 +0000)]
[msan] Add a fixme note for a minor deficiency.

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

6 years agoRevert r319490 "XOR the frame pointer with the stack cookie when protecting the stack"
Hans Wennborg [Mon, 4 Dec 2017 22:21:15 +0000 (22:21 +0000)]
Revert r319490 "XOR the frame pointer with the stack cookie when protecting the stack"

This broke the Chromium build (crbug.com/791714). Reverting while investigating.

> Summary: This strengthens the guard and matches MSVC.
>
> Reviewers: hans, etienneb
>
> Subscribers: hiraditya, JDevlieghere, vlad.tsyrklevich, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D40622
>
> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319490 91177308-0d34-0410-b5e6-96231b3b80d8

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

6 years agoAMDGPU: Fix creating invalid copy when adjusting dmask
Matt Arsenault [Mon, 4 Dec 2017 22:18:27 +0000 (22:18 +0000)]
AMDGPU: Fix creating invalid copy when adjusting dmask

Move the entire optimization to one place. Before it was possible
to adjust dmask without changing the register class of the output
instruction, since they were done in separate places. Fix all
lane sizes and move all of the optimization into the DAG folding.

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

6 years agoAMDGPU: Use return value of MorphNodeTo
Matt Arsenault [Mon, 4 Dec 2017 22:18:22 +0000 (22:18 +0000)]
AMDGPU: Use return value of MorphNodeTo

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

6 years agoAllow similar TargetOpcodes to use inheritance to factor out commonality. NFC.
Daniel Sanders [Mon, 4 Dec 2017 21:40:57 +0000 (21:40 +0000)]
Allow similar TargetOpcodes to use inheritance to factor out commonality. NFC.

Summary:
While implementing atomicrmw in https://reviews.llvm.org/D40092 I found that
inheritance is unusable for all the Generic Opcodes in GlobalISel. This is
because the whole header is included inside a 'let mayLoad = 0, mayStore = 0 ... in'
block. In TableGen, the order of precedence for field assignments is:
  1. Values from classes the record inherits from.
  2. Values from 'let Name=Value in { ... }'
  3. Values from 'let Name=Value;'
As such the 'let mayLoad = 0, mayStore = 0, ... in' surrounding the
'include "GenericOpcodes.td"' was overriding any values provided via inheritance.
We hadn't noticed this before because we were only using 'let Name=Value;' to
specialize opcodes.

Fix this by moving the default values to the lowest precedence. This is
accomplished by moving the values to a common base class
(StandardPseudoInstruction for most TargetOpcodes, and GenericOpcode for
GlobalISel specific TargetOpcodes)

Reviewers: qcolombet

Reviewed By: qcolombet

Subscribers: llvm-commits, igorb

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

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

6 years agoRe-submit r289925 (Update .debug_line section version to match DWARF version)
Paul Robinson [Mon, 4 Dec 2017 21:27:46 +0000 (21:27 +0000)]
Re-submit r289925 (Update .debug_line section version to match DWARF version)

Set the .debug_line version to match the requested DWARF version,
except with a maximum of v4 because we don't support v5 yet.

Previously Chromium had issues with this patch; see PR31407.  Chromium
tool issues have been addressed, so hopefully this will go through
this time.

Patch by Katya Romanova!

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

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

6 years ago[globalisel][tablegen] Tests for r319691
Daniel Sanders [Mon, 4 Dec 2017 21:14:34 +0000 (21:14 +0000)]
[globalisel][tablegen] Tests for r319691

I forgot to 'svn add' the test files.

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

6 years agoDAG: Follow-up to r319692 check the truncates inputs have the same type
Hans Wennborg [Mon, 4 Dec 2017 20:48:50 +0000 (20:48 +0000)]
DAG: Follow-up to r319692 check the truncates inputs have the same type

MatchRotate assumes the types of the types of LHS and RHS are equal,
which is always the case then they come from an OR node, but here
we're getting them from two different TRUNC nodes, so we have to check
the types.

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

6 years agoDAG: Match truncated rotation (PR35487)
Hans Wennborg [Mon, 4 Dec 2017 20:39:57 +0000 (20:39 +0000)]
DAG: Match truncated rotation (PR35487)

If the truncation has been pushed past the or-node, look through it and
truncate afterwards.

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

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

6 years ago[globalisel][tablegen] Split atomic load/store into separate opcode and enable for...
Daniel Sanders [Mon, 4 Dec 2017 20:39:32 +0000 (20:39 +0000)]
[globalisel][tablegen] Split atomic load/store into separate opcode and enable for AArch64.

This patch splits atomics out of the generic G_LOAD/G_STORE and into their own
G_ATOMIC_LOAD/G_ATOMIC_STORE. This is a pragmatic decision rather than a
necessary one. Atomic load/store has little in implementation in common with
non-atomic load/store. They tend to be handled very differently throughout the
backend. It also has the nice side-effect of slightly improving the common-case
performance at ISel since there's no longer a need for an atomicity check in the
matcher table.

All targets have been updated to remove the atomic load/store check from the
G_LOAD/G_STORE path. AArch64 has also been updated to mark
G_ATOMIC_LOAD/G_ATOMIC_STORE legal.

There is one issue with this patch though which also affects the extending loads
and truncating stores. The rules only match when an appropriate G_ANYEXT is
present in the MIR. For example,
  (G_ATOMIC_STORE (G_TRUNC:s16 (G_ANYEXT:s32 (G_ATOMIC_LOAD:s16 X))))
will match but:
  (G_ATOMIC_STORE (G_ATOMIC_LOAD:s16 X))
will not. This shouldn't be a problem at the moment, but as we get better at
eliminating extends/truncates we'll likely start failing to match in some
cases. The current plan is to fix this in a patch that changes the
representation of extending-load/truncating-store to allow the MMO to describe
a different type to the operation.

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

6 years agoMove splitIndirectCriticalEdges() to BasicBlockUtils.h.
Hiroshi Yamauchi [Mon, 4 Dec 2017 20:36:01 +0000 (20:36 +0000)]
Move splitIndirectCriticalEdges() to BasicBlockUtils.h.

Summary:
Move splitIndirectCriticalEdges() from CodeGenPrepare to BasicBlockUtils.h so
that it can be called from other places.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

6 years agoAdd missing triple args to tests
Matthias Braun [Mon, 4 Dec 2017 20:08:28 +0000 (20:08 +0000)]
Add missing triple args to tests

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

6 years ago[ConstantFold] Support vector index when factoring out GEP index into preceding dimen...
Haicheng Wu [Mon, 4 Dec 2017 19:56:33 +0000 (19:56 +0000)]
[ConstantFold] Support vector index when factoring out GEP index into preceding dimensions

Follow-up of r316824. This patch supports the vector type for both current and
previous index when factoring out the current one into the previous one.

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

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

6 years ago[SCEV] Use a "Discovered" set instead of a "Visited" set; NFC
Sanjoy Das [Mon, 4 Dec 2017 19:22:01 +0000 (19:22 +0000)]
[SCEV] Use a "Discovered" set instead of a "Visited" set; NFC

Suggested by Max Kazantsev in https://reviews.llvm.org/D39361

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

6 years ago[SCEV] A different fix for PR33494
Sanjoy Das [Mon, 4 Dec 2017 19:22:00 +0000 (19:22 +0000)]
[SCEV] A different fix for PR33494

Summary:
I don't think rL309080 is the right fix for PR33494 -- caching ExitLimit only
hides the problem[0].  The real issue is that because of how we forget SCEV
expressions ScalarEvolution::getBackedgeTakenInfo, in the test case for PR33494
computing the backedge for any loop invalidates the trip count for every other
loop.  This effectively makes the SCEV cache useless.

I've instead made the SCEV expression invalidation in
ScalarEvolution::getBackedgeTakenInfo less aggressive to fix this issue.

[0]: One way to think about this is that rL309080 essentially augmented the
backedge-taken-count cache with another equivalent exit-limit cache.  The bug
went away because we were explicitly not clearing the exit-limit cache in
getBackedgeTakenInfo.  But instead of doing all of that, we can just avoid
clearing the backedge-taken-count cache.

Reviewers: mkazantsev, mzolotukhin

Subscribers: mcrosier, llvm-commits

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

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

6 years ago[BypassSlowDivision] Improve our handling of divisions by constants
Sanjoy Das [Mon, 4 Dec 2017 19:21:58 +0000 (19:21 +0000)]
[BypassSlowDivision] Improve our handling of divisions by constants

(This reapplies r314253.  r314253 was reverted on r314482 because of a
correctness regression on P100, but that regression was identified to be
something else.)

Summary:
Don't bail out on constant divisors for divisions that can be narrowed without
introducing control flow .  This gives us a 32 bit multiply instead of an
emulated 64 bit multiply in the generated PTX assembly.

Reviewers: jlebar

Subscribers: jholewinski, mcrosier, llvm-commits

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

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

6 years agoMachineVerifier: undef phi arg doesn't need to be live-out from predecessor
Matthias Braun [Mon, 4 Dec 2017 18:57:48 +0000 (18:57 +0000)]
MachineVerifier: undef phi arg doesn't need to be live-out from predecessor

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

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

6 years ago[CodeGen] Unify MBB reference format in both MIR and debug output
Francis Visoiu Mistrih [Mon, 4 Dec 2017 17:18:51 +0000 (17:18 +0000)]
[CodeGen] Unify MBB reference format in both MIR and debug output

As part of the unification of the debug format and the MIR format, print
MBB references as '%bb.5'.

The MIR printer prints the IR name of a MBB only for block definitions.

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g'
* find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g'
* grep -nr 'BB#' and fix

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

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

6 years agoFix function pointer tail calls in armv8-M.base
Pablo Barrio [Mon, 4 Dec 2017 16:55:49 +0000 (16:55 +0000)]
Fix function pointer tail calls in armv8-M.base

Summary:
The compiler fails with the following error message:

fatal error: error in backend: ran out of registers during
register allocation

Tail call optimization for Armv8-M.base fails to meet all the required
constraints when handling calls to function pointers where the
arguments take up r0-r3. This is because the pointer to the
function to be called can only be stored in r0-r3, but these are
all occupied by arguments. This patch makes sure that tail call
optimization does not try to handle this type of calls.

Reviewers: chill, MatzeB, olista01, rengolin, efriedma

Reviewed By: olista01, efriedma

Subscribers: efriedma, aemerson, javed.absar, llvm-commits, kristof.beyls

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

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

6 years agoRevert "[cmake] Enable zlib support on windows"
Pavel Labath [Mon, 4 Dec 2017 16:46:20 +0000 (16:46 +0000)]
Revert "[cmake] Enable zlib support on windows"

This reverts commit r319533 as it broke llvm-config --system-libs output
and everything that depends on it (which is mostly out of tree or
downstream folks, but includes a couple of llvm buildbots as well).

I think I have a fix for this in D40779, but I want someone to look
review it first. In the mean time, I am reverting this change, as it
seems to break a lot of people.

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

6 years ago[AMDGPU] SDWA: add support for PRESERVE into SDWA peephole.
Sam Kolton [Mon, 4 Dec 2017 16:22:32 +0000 (16:22 +0000)]
[AMDGPU] SDWA: add support for PRESERVE into SDWA peephole.

Summary:

Reviewers: arsenm, vpykhtin, rampitec

Subscribers: kzhuravl, wdng, nhaehnle, mgorny, yaxunl, dstuttard, tpr, t-tye

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

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

6 years ago[ARM] CodeGen test
Sam Parker [Mon, 4 Dec 2017 15:14:59 +0000 (15:14 +0000)]
[ARM] CodeGen test

Add another and + load DAG combine test.

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

6 years ago[Loop Predication] Teach LP about reverse loops
Anna Thomas [Mon, 4 Dec 2017 15:11:48 +0000 (15:11 +0000)]
[Loop Predication] Teach LP about reverse loops

Summary:
Currently, we only support predication for forward loops with step
of 1.  This patch enables loop predication for reverse or
countdownLoops, which satisfy the following conditions:
   1. The step of the IV is -1.
   2. The loop has a singe latch as B(X) = X <pred>
latchLimit with pred as s> or u>
   3. The IV of the guard is the decrement
IV of the latch condition (Guard is: G(X) = X-1 u< guardLimit).

This patch was downstream for a while and is the last series of patches
that's from our LP implementation downstream.

Reviewers: apilipenko, mkazantsev, sanjoy

Subscribers: llvm-commits

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

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

6 years ago[NVPTX] Assign valid global names
Jonas Hahnfeld [Mon, 4 Dec 2017 14:19:33 +0000 (14:19 +0000)]
[NVPTX] Assign valid global names

PTX requires that identifiers consist only of [a-zA-Z0-9_$]. The
existing pass already ensured this for globals and this patch adds
the cleanup for functions with local linkage.

However, there was a different problem in the case of collisions
of the adjusted name: The ValueSymbolTable then automatically
appended ".N" with increasing Ns to get a unique name while helping
the ABI demangling. Special case this behavior to omit the dots and
append N directly. This will always give us legal names according
to the PTX requirements.

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

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

6 years ago[NFC][lit] Use proper semantic versioning names for variables
Jonas Devlieghere [Mon, 4 Dec 2017 14:01:34 +0000 (14:01 +0000)]
[NFC][lit] Use proper semantic versioning names for variables

The variable named `minor` was actually pointing to the patch part of
the version. While I was changing this I also made the check for Apple
clang more robust by checking both patch and minor rather than just
minor.

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

6 years agoRevert r319649 - [Asm, ARM] Add fallback diag for multiple invalid operands
Oliver Stannard [Mon, 4 Dec 2017 13:42:22 +0000 (13:42 +0000)]
Revert r319649 - [Asm, ARM] Add fallback diag for multiple invalid operands

This is causing a failure in the llvm-clang-x86_64-expensive-checks-win
buildbot, and I can't reproduce it locally, so reverting until I can work out
what is wrong.

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

6 years agoRevert "[ValueTracking] Pass only a single lambda to computeKnownBitsFromShiftOperato...
Sam McCall [Mon, 4 Dec 2017 12:51:49 +0000 (12:51 +0000)]
Revert "[ValueTracking] Pass only a single lambda to computeKnownBitsFromShiftOperator by using KnownBits struct instead of separate APInts. NFCI"

This reverts commit r319624, which seems to cause a miscompile (breaks the
multistage PPC buildbots)

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

6 years agoAMDGPU: fix missing s_waitcnt
Tim Corringham [Mon, 4 Dec 2017 12:30:49 +0000 (12:30 +0000)]
AMDGPU: fix missing s_waitcnt

Summary:
The pass that inserts s_waitcnt instructions where needed propagated
info used to track dependencies for each block by iterating over the
predecessor blocks. The iteration was terminated when a predecessor
that had not yet been processed was encountered. Any info in blocks
later in the list was therefore not processed, leading to the
possiblility of a required s_waitcnt not being inserted.

The fix is simply to change the "break" to "continue" for the
relevant loops, so that all visited blocks are processed. This
is likely what was intended when the code was written.

There is no test case provided for this fix because:
1) the only example that reproduces this is large and resistant to
being reduced
2) the change is trivial

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

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

6 years ago[Asm, ARM] Add fallback diag for multiple invalid operands
Oliver Stannard [Mon, 4 Dec 2017 12:02:32 +0000 (12:02 +0000)]
[Asm, ARM] Add fallback diag for multiple invalid operands

This adds a "invalid operands for instruction" diagnostic for
instructions where there is an instruction encoding with the correct
mnemonic and which is available for this target, but where multiple
operands do not match those which were provided. This makes it clear
that there is some combination of operands that is valid for the current
target, which the default diagnostic of "invalid instruction" does not.

Since this is a very general error, we only emit it if we don't have a
more specific error.

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

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

6 years ago[TwoAddressInstructionPass] Bugfix in handling of sunk instructions.
Jonas Paulsson [Mon, 4 Dec 2017 10:03:14 +0000 (10:03 +0000)]
[TwoAddressInstructionPass]  Bugfix in handling of sunk instructions.

An instruction returned by TII->convertToThreeAddress() may contain a %noreg
(undef) operand, which is not expected by tryInstructionTransform(). So if
this MI is sunk to a lower point in MBB, it must be skipped when later
encountered.

A new set SunkInstrs is used for this purpose.

Note: there is no test supplied here, as this was triggered on SystemZ while
working on a review of instruction flags. A test case for this bugfix will be
included in the upcoming SystemZ commit.

Review: Quentin Colombet
https://reviews.llvm.org/D40711

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

6 years ago[DAGCombine] Remove isAndLoadExtLoad arguments
Sam Parker [Mon, 4 Dec 2017 09:48:26 +0000 (09:48 +0000)]
[DAGCombine] Remove isAndLoadExtLoad arguments

Both LoadedVT and NarrowLoad are passed as references and neither
of them are used by any of its callers.

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

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

6 years ago[AArch64] Allow using emulated tls on platforms other than ELF
Martin Storsjo [Mon, 4 Dec 2017 09:09:04 +0000 (09:09 +0000)]
[AArch64] Allow using emulated tls on platforms other than ELF

This matches how it is done on X86.

This allows using emulated tls on windows; in MinGW environments,
native tls isn't supported at the moment.

Set the right Data*bitsDirective for windows to match the existing
tests for other platforms. Make parts of the existing tests a regex,
to allow matching .section .rdata for windows, to avoid having to
duplicate the rest of the tests for windows.

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

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

6 years ago[ARM] Allow using emulated tls on platforms other than ELF
Martin Storsjo [Mon, 4 Dec 2017 09:08:55 +0000 (09:08 +0000)]
[ARM] Allow using emulated tls on platforms other than ELF

This matches how it is done on X86.

This allows using emulated tls on windows; in MinGW environments,
native tls isn't supported at the moment.

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

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

6 years ago[X86] Allow VPMAXUQ/VPMAXSQ/VPMINUQ/VPMINSQ to be used with 128/256 bit vectors when...
Craig Topper [Mon, 4 Dec 2017 07:21:01 +0000 (07:21 +0000)]
[X86] Allow VPMAXUQ/VPMAXSQ/VPMINUQ/VPMINSQ to be used with 128/256 bit vectors when AVX512 is enabled.

These instructions can be used by widening to 512-bits and extracting back to 128/256. We do similar to several other instructions already.

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

6 years ago[X86] Don't turn UINT_TO_FP into SINT_TO_FP during lowering.
Craig Topper [Mon, 4 Dec 2017 05:38:44 +0000 (05:38 +0000)]
[X86] Don't turn UINT_TO_FP into SINT_TO_FP during lowering.

We already do this as a DAG combine. The version during lowering can only trigger if known bits changes something that improves known bits analysis. But this means we should be improving known bits analysis to work on the unlowered form instead.

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

6 years ago[SelectionDAG] Teach computeKnownBits some improvements to ISD::SRL with a non-splat...
Craig Topper [Mon, 4 Dec 2017 05:38:42 +0000 (05:38 +0000)]
[SelectionDAG] Teach computeKnownBits some improvements to ISD::SRL with a non-splat constant shift amount.

If we have a non-splat constant shift amount, the minimum shift amount can be used to infer the number of zero upper bits of the result. There's probably a lot more that we can do here, but this
fixes a case where I wanted to infer the sign bit as zero when all the shift amounts are non-zero.

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

6 years ago[X86][AVX512] Tag PH2PS/PS2PH conversion instructions scheduler classes
Simon Pilgrim [Sun, 3 Dec 2017 21:43:54 +0000 (21:43 +0000)]
[X86][AVX512] Tag PH2PS/PS2PH conversion instructions scheduler classes

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

6 years ago[X86][AVX512] Tag packed F2I/I2F/F2F conversion instructions scheduler class
Simon Pilgrim [Sun, 3 Dec 2017 21:16:12 +0000 (21:16 +0000)]
[X86][AVX512] Tag packed F2I/I2F/F2F conversion instructions scheduler class

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

6 years ago[X86][AVX512] Regenerate schedule tests.
Simon Pilgrim [Sun, 3 Dec 2017 21:07:36 +0000 (21:07 +0000)]
[X86][AVX512] Regenerate schedule tests.

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

6 years ago[X86][SSE] Remove unused IIC_SSE_CVT_PI2PS_RR/IIC_SSE_CVT_PI2PS_RM itineraries
Simon Pilgrim [Sun, 3 Dec 2017 20:57:04 +0000 (20:57 +0000)]
[X86][SSE] Remove unused IIC_SSE_CVT_PI2PS_RR/IIC_SSE_CVT_PI2PS_RM itineraries

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