OSDN Git Service

android-x86/external-llvm.git
7 years ago[NFC] Use stdin for some tests instead of positional argument.
Nikolai Bozhenov [Thu, 29 Jun 2017 14:51:54 +0000 (14:51 +0000)]
[NFC] Use stdin for some tests instead of positional argument.

Summary: Otherwise unexpected matches with the path to the tests might happen.

Reviewers: rengolin, spatel, efriedma, RKSimon

Reviewed By: spatel

Subscribers: n.bozhenov, javed.absar, llvm-commits

Patch by Andrei Elovikov <andrei.elovikov@intel.com>

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

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

7 years agoRestore original intent of memset instcombine test
Daniel Neilson [Thu, 29 Jun 2017 14:21:28 +0000 (14:21 +0000)]
Restore original intent of memset instcombine test

Summary:
The original intent of test/Transforms/InstCombine/memset.ll was to test for lowering of llvm.memset into stores when the size of the memset is 1, 2, 4, or 8. Sometime between then and now the test has stopped testing for that, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memset calls's being eliminated due to their pointer args being undef; so it is not testing for conversion of llvm.memset into store instructions at all.

This change alters the test to verify that store instructions are created, and moves the target of the memset to an arg of the proc to avoid it being eliminated as unused.

Reviewers: anna, efriedma

Reviewed By: efriedma

Subscribers: efriedma, llvm-commits

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

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

7 years agoExplicitly check for presence of correct results in instcombine memmove test
Daniel Neilson [Thu, 29 Jun 2017 14:17:50 +0000 (14:17 +0000)]
Explicitly check for presence of correct results in instcombine memmove test

Summary:
Rather than testing for expected results, test/Transforms/InstCombine/memmove.ll is testing for the absence of calls to llvm.memmove.

In the case of test3, the test has stopped testing for materialization of loads/stores, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of load/store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memmove calls being eliminated due to a pointer arg being undef; so it is not testing for conversion of llvm.memmove into load/store instructions at all.

Reviewers: eli.friedman, anna, efriedma

Reviewed By: efriedma

Subscribers: efriedma, llvm-commits

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

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

7 years ago[PowerPC] fix potential verification error on __tls_get_addr
Hiroshi Inoue [Thu, 29 Jun 2017 14:13:38 +0000 (14:13 +0000)]
[PowerPC] fix potential verification error on __tls_get_addr

This patch fixes a verification error with -verify-machineinstrs while expanding __tls_get_addr by not creating ADJCALLSTACKUP and ADJCALLSTACKDOWN if there is another ADJCALLSTACKUP in this basic block since nesting ADJCALLSTACKUP/ADJCALLSTACKDOWN is not allowed.

Here, ADJCALLSTACKUP and ADJCALLSTACKDOWN are created as a fence for instruction scheduling to avoid _tls_get_addr is scheduled before mflr in the prologue (https://bugs.llvm.org//show_bug.cgi?id=25839). So if another ADJCALLSTACKUP exists before _tls_get_addr, we do not need to create a new ADJCALLSTACKUP.

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

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

7 years ago[DWARF] - Fix message reporting about broken relocation.
George Rimar [Thu, 29 Jun 2017 14:05:18 +0000 (14:05 +0000)]
[DWARF] - Fix message reporting about broken relocation.

Because of mistake introduced in r306517,
wrong variable ("name" instead of "Name") was used
in error message.
As a result it reported section name instead of
relocation name.

This file still needs cleanup to match LLVM coding style
and more tests I think.

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

7 years agoRevert "r306529 - [X86] Correct dwarf unwind information in function epilogue"
Daniel Jasper [Thu, 29 Jun 2017 13:58:24 +0000 (13:58 +0000)]
Revert "r306529 - [X86] Correct dwarf unwind information in function epilogue"

I am 99% sure that this breaks the PPC ASAN build bot:
http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/3112/steps/64-bit%20check-asan/logs/stdio

If it doesn't go back to green, we can recommit (and fix the original
commit message at the same time :) ).

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

7 years ago[TBAA] Remove metadata keyword from IR examples in comments (NFC).
Florian Hahn [Thu, 29 Jun 2017 13:55:23 +0000 (13:55 +0000)]
[TBAA] Remove metadata keyword from IR examples in comments (NFC).

The metadata keyword has been removed from the IR.

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

7 years ago[TargetTransformInfo, API] Add a list of operands to TTI::getUserCost
Evgeny Astigeevich [Thu, 29 Jun 2017 13:42:12 +0000 (13:42 +0000)]
[TargetTransformInfo, API] Add a list of operands to TTI::getUserCost

The changes are a result of discussion of https://reviews.llvm.org/D33685.
It solves the following problem:

1. We can inform getGEPCost about simplified indices to help it with
   calculating the cost. But getGEPCost does not take into account the
   context which GEPs are used in.
2. We have getUserCost which can take the context into account but we cannot
   inform about simplified indices.

With the changes getUserCost will have access to additional information
as getGEPCost has.

The one parameter getUserCost is also provided.

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

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

7 years agoRecommit "[Support] Add RetryAfterSignal helper function"
Pavel Labath [Thu, 29 Jun 2017 13:15:31 +0000 (13:15 +0000)]
Recommit "[Support] Add RetryAfterSignal helper function"

The difference from the previous version is the use of decltype, as the
implementation of std::result_of in libc++ did not work correctly for
variadic function like open(2).

Original summary:
This function retries an operation if it was interrupted by a signal
(failed with EINTR). It's inspired by the TEMP_FAILURE_RETRY macro in
glibc, but I've turned that into a template function. I've also added a
fail-value argument, to enable the function to be used with e.g.
fopen(3), which is documented to fail for any reason that open(2) can
fail (which includes EINTR).

The main user of this function will be lldb, but there were also a
couple of uses within llvm that I could simplify using this function.

Reviewers: zturner, silvas, joerg

Subscribers: mgorny, llvm-commits

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

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

7 years ago[GlobalISel][X86] Support vector type G_MERGE_VALUES selection.
Igor Breger [Thu, 29 Jun 2017 12:08:28 +0000 (12:08 +0000)]
[GlobalISel][X86] Support vector type G_MERGE_VALUES selection.

Summary:
Support vector type G_MERGE_VALUES selection. For now G_MERGE_VALUES marked as legal for any type, so nothing to do in legalizer.
Split from https://reviews.llvm.org/D33665

Reviewers: qcolombet, t.p.northover, zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, kristof.beyls, guyblank, llvm-commits

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

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

7 years ago[X86][SSE] Dropped -mcpu from palignr tests
Simon Pilgrim [Thu, 29 Jun 2017 11:13:39 +0000 (11:13 +0000)]
[X86][SSE] Dropped -mcpu from palignr tests

Use triple and attribute only for consistency

Add AVX tests as well

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

7 years ago[X86][SSE] Regenerate shuffle test with update_llc_test_checks.py
Simon Pilgrim [Thu, 29 Jun 2017 11:11:37 +0000 (11:11 +0000)]
[X86][SSE] Regenerate shuffle test with update_llc_test_checks.py

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

7 years ago[X86][SSE] Dropped -mcpu from vector shift tests
Simon Pilgrim [Thu, 29 Jun 2017 11:09:53 +0000 (11:09 +0000)]
[X86][SSE] Dropped -mcpu from vector shift tests

Use triple and attribute only for consistency

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

7 years ago[X86][SSE] Dropped -mcpu from zero insertion tests
Simon Pilgrim [Thu, 29 Jun 2017 11:08:11 +0000 (11:08 +0000)]
[X86][SSE] Dropped -mcpu from zero insertion tests

Use triple and attribute only for consistency

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

7 years ago[LLVM][X86][Goldmont] Adding new target-cpu: Goldmont
Michael Zuckerman [Thu, 29 Jun 2017 10:00:33 +0000 (10:00 +0000)]
[LLVM][X86][Goldmont] Adding new target-cpu: Goldmont

[LLVM SIDE]
Connecting the GoldMont processor to his feature.

Reviewers:
1. igorb
2. zvi
3. delena
4. RKSimon
5. craig.topper

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

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

7 years agoTest commit
NAKAMURA Takumi [Thu, 29 Jun 2017 09:46:01 +0000 (09:46 +0000)]
Test commit

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

7 years ago[SLPVectorizer] Introducing getTreeEntry() helper function [NFC]
Dinar Temirbulatov [Thu, 29 Jun 2017 08:46:18 +0000 (08:46 +0000)]
[SLPVectorizer] Introducing getTreeEntry() helper function [NFC]

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

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

7 years ago[ARM] Add tGPRwithpc register class and use it for TBB/THH
Florian Hahn [Thu, 29 Jun 2017 08:45:31 +0000 (08:45 +0000)]
[ARM] Add tGPRwithpc register class and use it for TBB/THH

Summary:
TBB and THH allow using a Thumb GPR or the PC as destination operand.
A few machine verifier failures where due to those instructions not
expecting PC as destination operand.

Add -verify-machineinstrs to test/CodeGen/ARM/jump-table-tbh.ll to add
test coverage even if expensive checks are disabled.

Reviewers: MatzeB, t.p.northover, jmolloy

Reviewed By: MatzeB

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

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

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

7 years ago[BinaryFormat] Identify AArch64 COFF files
Martin Storsjo [Thu, 29 Jun 2017 06:30:56 +0000 (06:30 +0000)]
[BinaryFormat] Identify AArch64 COFF files

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

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

7 years ago[X86] Adding shuffle tests demonstrating missed vcompress opportunities. NFC
Zvi Rackover [Thu, 29 Jun 2017 06:22:01 +0000 (06:22 +0000)]
[X86] Adding shuffle tests demonstrating missed vcompress opportunities. NFC

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

7 years ago[lit] Re-apply: Fix some convoluted logic around Unicode encoding, and de-duplicate...
David L. Jones [Thu, 29 Jun 2017 04:37:35 +0000 (04:37 +0000)]
[lit] Re-apply: Fix some convoluted logic around Unicode encoding, and de-duplicate across modules that used it.

(Take 2: this patch re-applies r306625, which was reverted in r306629. This
patch includes only trivial fixes.)

In Python2 and Python3, the various (non-)?Unicode string types are sort of
spaghetti. Python2 has unicode support tacked on via the 'unicode' type, which
is distinct from 'str' (which are bytes). Python3 takes the "unicode-everywhere"
approach, with 'str' representing a Unicode string.

Both have a 'bytes' type. In Python3, it is the only way to represent raw bytes.
However, in Python2, 'bytes' is an alias for 'str'. This leads to interesting
problems when an interface requires a precise type, but has to run under both
Python2 and Python3.

The previous logic appeared to be correct in all cases, but went through more
layers of indirection than necessary. This change does the necessary conversions
in one shot, with documentation about which paths might be taken in Python2 or
Python3.

Changes from r306625: some tests just print binary outputs, so in those cases,
fall back to str() in Python3. For googletests, add one missing call to
to_string().

(Tested by verifying the visible breakage with Python3. Verified that everything
works in py2 and py3.)

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

7 years agollvm-profdata: Indirect infrequently used fields to reduce memory usage
David Blaikie [Thu, 29 Jun 2017 02:51:58 +0000 (02:51 +0000)]
llvm-profdata: Indirect infrequently used fields to reduce memory usage

Examining a large profile example, it seems relatively few records have
non-empty IndirectCall and MemOP data, so indirecting these through a
unique_ptr (non-null only when they are non-empty) Reduces memory usage
on this particular example from 14GB to 10GB according to valgrind's
massif.

I suspect it'd still be worth moving InstrProfWriter to its own data
structure that had Counts and the indirected IndirectCall+MemOP, and did
not include the Name, Hash, or Error fields. This would reduce the size
of this dominant data structure by half of this new, lower amount.
(Name(2), Hash(1), Error(1) ~= Counts(vector, 3), ValueProfData
(unique_ptr, 1))
-> From code review feedback, might actually refactor InstrProfRecord
itself to have a sub-struct with all the counts, and use that from
InstrProfWriter, rather than InstrProfWriter owning its own data
structure for this.

Reviewers: davidxl

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

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

7 years agoRevert "[lit] Fix some convoluted logic around Unicode encoding, and de-duplicate...
David L. Jones [Thu, 29 Jun 2017 02:22:49 +0000 (02:22 +0000)]
Revert "[lit] Fix some convoluted logic around Unicode encoding, and de-duplicate across modules that used it."

This reverts r306625.

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

7 years agoFix spelling: uncode -> unicode.
David L. Jones [Thu, 29 Jun 2017 01:03:56 +0000 (01:03 +0000)]
Fix spelling: uncode -> unicode.

Remember kids: there is no 'I' in str or bytes, but there is ALWAYS an
'I' in unicode.

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

7 years ago[lit] Fix some convoluted logic around Unicode encoding, and de-duplicate across...
David L. Jones [Thu, 29 Jun 2017 01:03:55 +0000 (01:03 +0000)]
[lit] Fix some convoluted logic around Unicode encoding, and de-duplicate across modules that used it.

Summary:
In Python2 and Python3, the various (non-)?Unicode string types are sort of
spaghetti. Python2 has unicode support tacked on via the 'unicode' type, which
is distinct from 'str' (which are bytes). Python3 takes the "unicode-everywhere"
approach, with 'str' representing a Unicode string.

Both have a 'bytes' type. In Python3, it is the only way to represent raw bytes.
However, in Python2, 'bytes' is an alias for 'str'. This leads to interesting
problems when an interface requires a precise type, but has to run under both
Python2 and Python3.

The previous logic appeared to be correct in all cases, but went through more
layers of indirection than necessary. This change does the necessary conversions
in one shot, with documentation about which paths might be taken in Python2 or
Python3.

Reviewers: zturner, modocache

Subscribers: llvm-commits, sanjoy

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

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

7 years ago[lit] Remove dead code not referenced in the LLVM SVN repo.
David L. Jones [Thu, 29 Jun 2017 01:01:03 +0000 (01:01 +0000)]
[lit] Remove dead code not referenced in the LLVM SVN repo.

Summary:
This change removes the intermediate 'FileBasedTest' format from lit. This
format is only ever used by the ShTest format, so the logic can be moved into
ShTest directly.

In order to better clarify what the TestFormat subclasses do, I fleshed out the
TestFormat base class with Python's notion of abstract methods, using
@abc.abstractmethod. This gives a convenient way to document the expected
interface, without the risk of instantiating an abstract class (that's what
ABCMeta does -- it raises an exception if you try to instantiate a class which
has abstract methods, but not if you instantiate a subclass that implements
them).

Reviewers: zturner, modocache

Subscribers: sanjoy, llvm-commits

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

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

7 years agoRevert "Replace trivial use of external rc.exe by writing our own .res file."
Eric Beckmann [Thu, 29 Jun 2017 00:17:26 +0000 (00:17 +0000)]
Revert "Replace trivial use of external rc.exe by writing our own .res file."

This reverts commit d4c7e9fc63c10dbab0c30186ef8575474a704496.

This is done in order to address the failure of CrWinClangLLD etc. bots.
These throw an error of "side-by-side configuration is incorrect" during
compilation, which sounds suspiciously related to these manifest
changes.

Revert "Switch external cvtres.exe for llvm's own resource library."

This reverts commit 71fe8ef283a9dab9a3f21432c98466cbc23990d1.

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

7 years ago[InstCombine] In visitXor, use m_Not on the instruction itself instead of looking...
Craig Topper [Thu, 29 Jun 2017 00:07:08 +0000 (00:07 +0000)]
[InstCombine] In visitXor, use m_Not on the instruction itself instead of looking for all ones in Op1. This is consistent with 3 other not checks before this one. NFCI

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

7 years ago[CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Thu, 29 Jun 2017 00:05:44 +0000 (00:05 +0000)]
[CodeView] 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@306616 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] Retain TBAA when narrowing memory accesses
Keno Fischer [Wed, 28 Jun 2017 23:36:40 +0000 (23:36 +0000)]
[InstCombine] Retain TBAA when narrowing memory accesses

Summary:
As discussed on the mailing list it is legal to propagate TBAA to loads/stores
from/to smaller regions of a larger load tagged with TBAA. Do so for
(load->extractvalue)=>(gep->load) and similar foldings.

Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D31954

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

7 years ago[NFC] Remove multiple semicolons
Mandeep Singh Grang [Wed, 28 Jun 2017 23:15:16 +0000 (23:15 +0000)]
[NFC] Remove multiple semicolons

Reviewers: bogner, whitequark, mgrang

Reviewed By: mgrang

Subscribers: llvm-commits

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

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

7 years agoIntroduce symbol cache to PDB NativeSession
Adrian McCarthy [Wed, 28 Jun 2017 22:47:40 +0000 (22:47 +0000)]
Introduce symbol cache to PDB NativeSession

Instead of creating symbols directly in the findChildren methods of the native
symbol implementations, they will rely on the NativeSession to act as a factory
for these types.  This lets NativeSession cache the NativeRawSymbols in its
new symbol cache and makes that cache the source of unique IDs for the symbols.

Right now, this affects only NativeCompilandSymbols.  There's no external
change yet, so I think the existing tests are still sufficient.  Coming soon
are patches to extend this to built-in types and enums.

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

7 years agoRevert "Make OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and...
Xin Tong [Wed, 28 Jun 2017 22:35:54 +0000 (22:35 +0000)]
Revert "Make OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and catch mistakes"

This reverts commit 50ec560f05dcb8a1be18be442660d0305bc7de25.

It catches some bug in NewGVN it seems. I am in middle of something and will not be able to investigate
Revert for now.

http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/6268

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

7 years agoMake OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and catch...
Xin Tong [Wed, 28 Jun 2017 22:12:22 +0000 (22:12 +0000)]
Make OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and catch mistakes

Summary: Make OrderedInstructions and OrderedBasicBlock use AssertingVH to try and catch mistakes

Reviewers: efriedma

Subscribers: llvm-commits

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

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

7 years agoAMDGPU: Remove SITypeRewriter
Matt Arsenault [Wed, 28 Jun 2017 21:38:50 +0000 (21:38 +0000)]
AMDGPU: Remove SITypeRewriter

This was an old workaround for using v16i8 in some old intrinsics
for resource descriptors.

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

7 years ago[lit] Remove dead code (not referenced anywhere), and clarify some function names.
David L. Jones [Wed, 28 Jun 2017 21:14:13 +0000 (21:14 +0000)]
[lit] Remove dead code (not referenced anywhere), and clarify some function names.

Summary:
The dead code seems to be unreferenced, according to textual search across the
LLVM SVN repo.

The clarification part of this change alters the name of a module-level function
so that it is different from the name of the class-methods that call it.
Currently, there are no erroneous references, but stylistically (c.f. PEP-8),
internal "helper" functions should generally be named accordingly by prepending
an underscore. (I also chose to add '_impl', which isn't necessary, but helps me
at least to mentally disambiguate the interface and implementation functions.)

Reviewers: zturner, modocache

Subscribers: sanjoy, llvm-commits

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

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

7 years agoFix a typo.
Eric Christopher [Wed, 28 Jun 2017 21:10:31 +0000 (21:10 +0000)]
Fix a typo.

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

7 years agoFold fneg and fabs like multiplications
Stanislav Mekhanoshin [Wed, 28 Jun 2017 20:25:50 +0000 (20:25 +0000)]
Fold fneg and fabs like multiplications

Given no NaNs and no signed zeroes it folds:

(fmul X, (select (fcmp X > 0.0), -1.0, 1.0)) -> (fneg (fabs X))
(fmul X, (select (fcmp X > 0.0), 1.0, -1.0)) -> (fabs X)

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

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

7 years ago[InstCombine] add tests for icmp with bitreversed ops; NFC
Sanjay Patel [Wed, 28 Jun 2017 20:02:35 +0000 (20:02 +0000)]
[InstCombine] add tests for icmp with bitreversed ops; NFC

This is similar enough to bswap that we might as well handle them together in one patch.

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

7 years ago[AArch64] Make assert messages uniform and general [NFC]
Mandeep Singh Grang [Wed, 28 Jun 2017 19:37:38 +0000 (19:37 +0000)]
[AArch64] Make assert messages uniform and general [NFC]

Summary: Make assert messages related to Darwin, ELF and COFF uniform.

Reviewers: rnk, ruiu, compnerd, t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, aemerson, rengolin, javed.absar, llvm-commits, kristof.beyls

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

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

7 years ago[AArch64][Falkor] Attempt to fix Windows buildbots
Geoff Berry [Wed, 28 Jun 2017 19:36:10 +0000 (19:36 +0000)]
[AArch64][Falkor] Attempt to fix Windows buildbots

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

7 years agoReuse existing variables. NFC.
Rafael Espindola [Wed, 28 Jun 2017 19:26:37 +0000 (19:26 +0000)]
Reuse existing variables. NFC.

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

7 years agoBreak up long lines, NFC
Krzysztof Parzyszek [Wed, 28 Jun 2017 18:59:18 +0000 (18:59 +0000)]
Break up long lines, NFC

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

7 years ago[AArch64][Falkor] Try to avoid exhausting HW prefetcher resources when unrolling.
Geoff Berry [Wed, 28 Jun 2017 18:53:09 +0000 (18:53 +0000)]
[AArch64][Falkor] Try to avoid exhausting HW prefetcher resources when unrolling.

Reviewers: t.p.northover, mcrosier

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

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

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

7 years agoReuse existing variable. NFC.
Rafael Espindola [Wed, 28 Jun 2017 18:24:02 +0000 (18:24 +0000)]
Reuse existing variable. NFC.

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

7 years ago[Dominators] Move helper functions into SemiNCAInfo
Jakub Kuderski [Wed, 28 Jun 2017 18:15:45 +0000 (18:15 +0000)]
[Dominators] Move helper functions into SemiNCAInfo

Summary: Helper functions (DFSPass, ReverseDFSPass, Eval) need SemiNCAInfo anyway, so it's simpler to have them there as member functions. This also makes them simpler by removing template boilerplate.

Reviewers: dberlin, sanjoy, chandlerc

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

7 years ago[BBVectorize][X86] Regenerate simple tests
Simon Pilgrim [Wed, 28 Jun 2017 18:08:40 +0000 (18:08 +0000)]
[BBVectorize][X86] Regenerate simple tests

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

7 years ago[InstCombine] Remove 64-bit bit width restriction from m_ConstantInt(uint64_t*&)
Craig Topper [Wed, 28 Jun 2017 18:07:29 +0000 (18:07 +0000)]
[InstCombine] Remove 64-bit bit width restriction from m_ConstantInt(uint64_t*&)

I think we only need to make sure the value fits in 64-bits not that bit width is 64-bit.

This helps places that use this for shift amounts since the shift amount needs to be the same bitwidth as the LHS, but can't be larger than the bit width.

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

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

7 years ago[Dominators] Move SemiNCAInfo and helper functions out of DominatorTreeBase
Jakub Kuderski [Wed, 28 Jun 2017 18:00:36 +0000 (18:00 +0000)]
[Dominators] Move SemiNCAInfo and helper functions out of DominatorTreeBase

Summary:
This moves SemiNCAInfo from DeminatorTreeBase to GenericDomTreeConstruction. It also put helper functions used during tree constructions in the same file.

The point of this change is to further clean up DominatorTreeBase and make it easier to construct and verify (in future patches).

Reviewers: dberlin, sanjoy, chandlerc

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

7 years ago[LV] Fix PR33613 - retain order of insertelement per part
Ayal Zaks [Wed, 28 Jun 2017 17:59:33 +0000 (17:59 +0000)]
[LV] Fix PR33613 - retain order of insertelement per part

r306381 caused PR33613, by reversing the order in which insertelements were
generated per unroll part. This patch fixes PR33613 by retraining this order,
placing each set of insertelements per part immediately after the last scalar
being packed for this part. Includes a test case derived from PR33613.

Reference: https://bugs.llvm.org/show_bug.cgi?id=33613
Differential Revision: https://reviews.llvm.org/D34760

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

7 years ago[Dominators] Move IDoms out of DominatorTreeBase and put them in SNCAInfo
Jakub Kuderski [Wed, 28 Jun 2017 17:56:09 +0000 (17:56 +0000)]
[Dominators] Move IDoms out of DominatorTreeBase and put them in SNCAInfo

Summary: The temporary IDoms map was used only during DomTree calculation. We can move it to SNCAInfo so that it's no longer a DominatorTreeBase member.

Reviewers: sanjoy, dberlin, chandlerc

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

7 years agoFix PR33625.
Rafael Espindola [Wed, 28 Jun 2017 17:56:07 +0000 (17:56 +0000)]
Fix PR33625.

We were failing to convert this expression to pcrel.

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

7 years ago[Dominators] Move InfoRec outside of DominatorTreeBase
Jakub Kuderski [Wed, 28 Jun 2017 17:43:54 +0000 (17:43 +0000)]
[Dominators] Move InfoRec outside of DominatorTreeBase

Summary:
The InfoRec struct is used only during tree construction, so there is no point having it as a DominatorTreeBase member.

This patch moves it into the Calculate function instead and makes it pass it to its helper functions.

Reviewers: sanjoy, dberlin, chandlerc

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

7 years ago[BBVectorize] Regenerate simple tests
Simon Pilgrim [Wed, 28 Jun 2017 17:40:20 +0000 (17:40 +0000)]
[BBVectorize] Regenerate simple tests

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

7 years agoDon't repeat name in comment and format. NFC.
Rafael Espindola [Wed, 28 Jun 2017 17:23:13 +0000 (17:23 +0000)]
Don't repeat name in comment and format. NFC.

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

7 years agoAnother test commit.
Chih-Hung Hsieh [Wed, 28 Jun 2017 17:12:51 +0000 (17:12 +0000)]
Another test commit.

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

7 years ago[LoopUnroll] Fix bug in computeUnrollCount causing it to not honor MaxCount
Geoff Berry [Wed, 28 Jun 2017 17:01:15 +0000 (17:01 +0000)]
[LoopUnroll] Fix bug in computeUnrollCount causing it to not honor MaxCount

Reviewers: sanjoy, anna, reames, apilipenko, igor-laevsky, mkuper

Subscribers: mcrosier, llvm-commits, mzolotukhin

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

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

7 years ago[InstCombine] add tests for icmp with bswapped operands; NFC
Sanjay Patel [Wed, 28 Jun 2017 16:56:45 +0000 (16:56 +0000)]
[InstCombine] add tests for icmp with bswapped operands; NFC

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

7 years ago[Dominators] Move number to node mapping out of DominatorTreeBase
Jakub Kuderski [Wed, 28 Jun 2017 16:54:34 +0000 (16:54 +0000)]
[Dominators] Move number to node mapping out of DominatorTreeBase

Summary: Number to node mapping in DominatorTreeBase is used only during calculation, so there is no point keeping is as a member variable. This patch moves this mapping to Calculate function and passes it to helper functions. It also makes the name more descriptive.

Reviewers: sanjoy, dberlin, davide, chandlerc

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

7 years ago[InstCombine] use local variable to reduce code; NFCI
Sanjay Patel [Wed, 28 Jun 2017 16:39:06 +0000 (16:39 +0000)]
[InstCombine] use local variable to reduce code; NFCI

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

7 years agoRangify loops, formatting changes, use bool instead of unsigned, NFC
Krzysztof Parzyszek [Wed, 28 Jun 2017 16:02:00 +0000 (16:02 +0000)]
Rangify loops, formatting changes, use bool instead of unsigned, NFC

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

7 years agoDon't repeat names and reformat. NFC.
Rafael Espindola [Wed, 28 Jun 2017 16:00:16 +0000 (16:00 +0000)]
Don't repeat names and reformat. NFC.

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

7 years ago[LoopUnroll] Pass SCEV to getUnrollingPreferences hook. NFCI.
Geoff Berry [Wed, 28 Jun 2017 15:53:17 +0000 (15:53 +0000)]
[LoopUnroll] Pass SCEV to getUnrollingPreferences hook.  NFCI.

Reviewers: sanjoy, anna, reames, apilipenko, igor-laevsky, mkuper

Subscribers: jholewinski, arsenm, mzolotukhin, nemanjai, nhaehnle, javed.absar, mcrosier, llvm-commits

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

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

7 years agoMissed a check for UndefVI in r306466
Krzysztof Parzyszek [Wed, 28 Jun 2017 15:46:16 +0000 (15:46 +0000)]
Missed a check for UndefVI in r306466

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

7 years ago[globalisel][tablegen] Post-commit review nits for r306388. NFC
Daniel Sanders [Wed, 28 Jun 2017 15:16:03 +0000 (15:16 +0000)]
[globalisel][tablegen] Post-commit review nits for r306388. NFC

One early exit and a missing assert string.

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

7 years ago[AArch64] AArch64CondBrTuningPass generates wrong branch instructions
Alexandros Lamprineas [Wed, 28 Jun 2017 15:09:11 +0000 (15:09 +0000)]
[AArch64] AArch64CondBrTuningPass generates wrong branch instructions

Some conditional branch instructions generated by this pass are checking
the wrong condition code. The instructions TBZ and TBNZ are transformed
into B.GE and B.LT instead of B.PL and B.MI respectively. They should
only be checking the Negative bit.

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

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

7 years agoDon't repeat name in comments. 80 columns. NFC.
Rafael Espindola [Wed, 28 Jun 2017 14:59:30 +0000 (14:59 +0000)]
Don't repeat name in comments. 80 columns. NFC.

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

7 years ago[ARM] Improve if-conversion for M-class CPUs without branch predictors
John Brawn [Wed, 28 Jun 2017 14:11:15 +0000 (14:11 +0000)]
[ARM] Improve if-conversion for M-class CPUs without branch predictors

The current heuristic in isProfitableToIfCvt assumes we have a branch predictor,
and so gives the wrong answer in some cases when we don't. This patch adds a
subtarget feature to indicate that a subtarget has no branch predictor, and
changes the heuristic in isProfitableToiIfCvt when it's present. This gives a
slight overall improvement in a set of embedded benchmarks on Cortex-M4 and
Cortex-M33.

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

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

7 years ago[X86] Added BSWAP tests for illegal i64/i128/i256 'wide' scalar integers
Simon Pilgrim [Wed, 28 Jun 2017 14:07:50 +0000 (14:07 +0000)]
[X86] Added BSWAP tests for illegal i64/i128/i256 'wide' scalar integers

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

7 years ago[X86][SSE] Dropped -mcpu from vector bswap tests
Simon Pilgrim [Wed, 28 Jun 2017 13:59:15 +0000 (13:59 +0000)]
[X86][SSE] Dropped -mcpu from vector bswap tests

Use triple and attribute only for consistency

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

7 years ago[globalisel][tablegen] Multiple 80-col corrections.
Daniel Sanders [Wed, 28 Jun 2017 13:50:04 +0000 (13:50 +0000)]
[globalisel][tablegen] Multiple 80-col corrections.

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

7 years ago[X86][LLVM][test]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess...
Michael Zuckerman [Wed, 28 Jun 2017 13:42:45 +0000 (13:42 +0000)]
[X86][LLVM][test]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess test.

Exapnding the test to include AVX target.
Adding base tast (to trunk) for Store strid=4 vf=32.

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

7 years agoCreate inliner params based on size and opt levels.
Easwaran Raman [Wed, 28 Jun 2017 13:33:49 +0000 (13:33 +0000)]
Create inliner params based on size and opt levels.

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

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

7 years agoAdd zero-length check to memcpy/memset load store loop expansion
Teresa Johnson [Wed, 28 Jun 2017 13:07:37 +0000 (13:07 +0000)]
Add zero-length check to memcpy/memset load store loop expansion

Summary:
I was testing using this expansion logic in other cases besides
NVPTX, and found some runtime failures due to the lack of a check
for a zero length memcpy/memset before the loop. There is already
such a check in the memmove expansion code though.

Reviewers: hfinkel

Subscribers: jholewinski, wdng, llvm-commits

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

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

7 years ago[GlobalISel][X86] Test G_CONSTANT i32 0 TableGen'erated selection.NFC.
Igor Breger [Wed, 28 Jun 2017 12:43:21 +0000 (12:43 +0000)]
[GlobalISel][X86] Test G_CONSTANT i32 0 TableGen'erated selection.NFC.

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

7 years agoRevert r306528
Nikolai Bozhenov [Wed, 28 Jun 2017 12:15:13 +0000 (12:15 +0000)]
Revert r306528

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

7 years ago[GlobalISel][X86] Support bitwise operations : G_AND, G_OR, G_XOR
Igor Breger [Wed, 28 Jun 2017 11:39:04 +0000 (11:39 +0000)]
[GlobalISel][X86] Support bitwise operations : G_AND, G_OR, G_XOR

Summary: Support G_AND, G_OR, G_XOR for i8/i16/i32/i64. Selection done via TableGen'erated code.

Reviewers: zvi, guyblank, aymanmus, m_zuckerman

Reviewed By: aymanmus

Subscribers: rovka, kristof.beyls, llvm-commits

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

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

7 years agoReverting commit 306414 on behalf of @gadi.haber
Michael Zuckerman [Wed, 28 Jun 2017 11:23:31 +0000 (11:23 +0000)]
Reverting commit 306414 on behalf of @gadi.haber

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

7 years ago[X86][AVX2] Dropped -mcpu from avx2 arithmetic/intrinsics tests
Simon Pilgrim [Wed, 28 Jun 2017 10:54:54 +0000 (10:54 +0000)]
[X86][AVX2] Dropped -mcpu from avx2 arithmetic/intrinsics tests

Use triple and attribute only for consistency

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

7 years ago[X86] Correct dwarf unwind information in function epilogue
Petar Jovanovic [Wed, 28 Jun 2017 10:21:17 +0000 (10:21 +0000)]
[X86] Correct dwarf unwind information in function epilogue

CFI instructions that set appropriate cfa offset and cfa register are now
inserted in emitEpilogue() in X86FrameLowering.

Majority of the changes in this patch:

1. Ensure that CFI instructions do not affect code generation.
2. Enable maintaining correct information about cfa offset and cfa register
in a function when basic blocks are reordered, merged, split, duplicated.

These changes are target independent and described below.

Changed CFI instructions so that they:

1. are duplicable
2. are not counted as instructions when tail duplicating or tail merging
3. can be compared as equal

Add information to each MachineBasicBlock about cfa offset and cfa register
that are valid at its entry and exit (incoming and outgoing CFI info). Add
support for updating this information when basic blocks are merged, split,
duplicated, created. Add a verification pass (CFIInfoVerifier) that checks
that outgoing cfa offset and register of predecessor blocks match incoming
values of their successors.

Incoming and outgoing CFI information is used by a late pass
(CFIInstrInserter) that corrects CFA calculation rule for a basic block if
needed. That means that additional CFI instructions get inserted at basic
block beginning to correct the rule for calculating CFA. Having CFI
instructions in function epilogue can cause incorrect CFA calculation rule
for some basic blocks. This can happen if, due to basic block reordering,
or the existence of multiple epilogue blocks, some of the blocks have wrong
cfa offset and register values set by the epilogue block above them.

Patch by Violeta Vukobrat.

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

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

7 years ago[ValueTracking] Enabling existing ValueTracking patch by default.
Nikolai Bozhenov [Wed, 28 Jun 2017 10:08:08 +0000 (10:08 +0000)]
[ValueTracking] Enabling existing ValueTracking patch by default.

The original patch was an improvement to IR ValueTracking on non-negative
integers. It has been checked in to trunk (D18777, r284022). But was disabled by
default due to performance regressions.
Perf impact has improved. The patch would be enabled by default.

Reviewers: reames

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

Patch by: Olga Chupina <olga.chupina@intel.com>

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

7 years ago[InstCombine] Canonicalize clamp of float types to minmax in fast mode.
Nikolai Bozhenov [Wed, 28 Jun 2017 09:26:20 +0000 (09:26 +0000)]
[InstCombine] Canonicalize clamp of float types to minmax in fast mode.

Summary:
This commit allows matchSelectPattern to recognize clamp of float
arguments in the presence of FMF the same way as already done for
integers.

This case is a little different though. With integers, given the
min/max pattern is recognized, DAGBuilder starts selecting MIN/MAX
"automatically". That is not the case for float, because for them only
full FMINNAN/FMINNUM/FMAXNAN/FMAXNUM ISD nodes exist and they do care
about NaNs. On the other hand, some backends (e.g. X86) have only
FMIN/FMAX nodes that do not care about NaNS and the former NAN/NUM
nodes are illegal thus selection is not happening. So I decided to do
such kind of transformation in IR (InstCombiner) instead of
complicating the logic in the backend.

Reviewers: spatel, jmolloy, majnemer, efriedma, craig.topper

Reviewed By: efriedma

Subscribers: hiraditya, javed.absar, n.bozhenov, llvm-commits

Patch by Andrei Elovikov <andrei.elovikov@intel.com>

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

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

7 years agoAdd tests to document current InstCombine behavior for clamp pattern.
Nikolai Bozhenov [Wed, 28 Jun 2017 09:22:58 +0000 (09:22 +0000)]
Add tests to document current InstCombine behavior for clamp pattern.

Summary:
This commit adds the tests for clamp pattern as a prerequisite of
D33186 to make the impact of that fix more clear and also to document
current behavior.

Reviewers: spatel, jmolloy

Reviewed By: spatel

Subscribers: n.bozhenov, llvm-commits

Patch by Andrei Elovikov <andrei.elovikov@intel.com>

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

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

7 years ago[DebugInfo] - Removed trailing whitespaces. NFC.
George Rimar [Wed, 28 Jun 2017 08:26:57 +0000 (08:26 +0000)]
[DebugInfo] - Removed trailing whitespaces. NFC.

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

7 years agoRecommit "[ELF] - Add ability for DWARFContextInMemory to exit early when any error...
George Rimar [Wed, 28 Jun 2017 08:21:19 +0000 (08:21 +0000)]
Recommit "[ELF] - Add ability for DWARFContextInMemory to exit early when any error happen."

With fix in include folder character case:
#include "llvm/Codegen/AsmPrinter.h" -> #include "llvm/CodeGen/AsmPrinter.h"

Original commit message:

Change introduces error reporting policy for DWARFContextInMemory.
New callback provided by client is able to handle error on it's
side and return Halt or Continue.

That allows to either keep current behavior when parser prints all errors
but continues parsing object or implement something very different, like
stop parsing on a first error and report an error in a client style.

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

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

7 years ago[ARM] Make -mcpu=generic schedule for an in-order core (Cortex-A8).
Kristof Beyls [Wed, 28 Jun 2017 07:07:03 +0000 (07:07 +0000)]
[ARM] Make -mcpu=generic schedule for an in-order core (Cortex-A8).

The benchmarking summarized in
http://lists.llvm.org/pipermail/llvm-dev/2017-May/113525.html showed
this is beneficial for a wide range of cores.

As is to be expected, quite a few small adaptations are needed to the
regressions tests, as the difference in scheduling results in:
- Quite a few small instruction schedule differences.
- A few changes in register allocation decisions caused by different
 instruction schedules.
- A few changes in IfConversion decisions, due to a difference in
 instruction schedule and/or the estimated cost of a branch mispredict.

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

7 years agoRevert r306512 "[ELF] - Add ability for DWARFContextInMemory to exit early when any...
George Rimar [Wed, 28 Jun 2017 07:06:17 +0000 (07:06 +0000)]
Revert r306512 "[ELF] - Add ability for DWARFContextInMemory to exit early when any error happen."

It broke BB:

[13/106] 13 0.022 Generating VCSRevision.h
[25/106] 24 1.209 Building CXX object unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o
FAILED: unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o
/home/bb/bin/g++  -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_GLOBAL_ISEL -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests/DebugInfo/DWARF -I../llvm-project/llvm/unittests/DebugInfo/DWARF -Iinclude -I../llvm-project/llvm/include -I../llvm-project/llvm/utils/unittest/googletest/include -I../llvm-project/llvm/utils/unittest/googlemock/include -fPIC -fvisibility-inlines-hidden -m32 -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O3    -UNDEBUG  -Wno-variadic-macros -fno-exceptions -fno-rtti -MD -MT unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o -MF unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o.d -o unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o -c ../llvm-project/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
../llvm-project/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:18:37: fatal error: llvm/Codegen/AsmPrinter.h: No such file or directory
 #include "llvm/Codegen/AsmPrinter.h"
                                     ^
compilation terminated.

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

7 years ago[ELF] - Add ability for DWARFContextInMemory to exit early when any error happen.
George Rimar [Wed, 28 Jun 2017 06:57:20 +0000 (06:57 +0000)]
[ELF] - Add ability for DWARFContextInMemory to exit early when any error happen.

Change introduces error reporting policy for DWARFContextInMemory.
New callback provided by client is able to handle error on it's
side and return Halt or Continue.

That allows to either keep current behavior when parser prints all errors
but continues parsing object or implement something very different, like
stop parsing on a first error and report an error in a client style.

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

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

7 years ago[InstCombine] Add test case demonstrating that we don't handle icmp eq (trunc (lshr...
Craig Topper [Wed, 28 Jun 2017 06:45:36 +0000 (06:45 +0000)]
[InstCombine] Add test case demonstrating that we don't handle icmp eq (trunc (lshr(X, cst1)), cst->icmp (and X, mask), cst when the shift type is larger than 64-bits. NFC

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

7 years agoRevert r306508 "[InstCombine] Add test case demonstrating that we don't handle icmp...
Craig Topper [Wed, 28 Jun 2017 06:43:58 +0000 (06:43 +0000)]
Revert r306508 "[InstCombine] Add test case demonstrating that we don't handle icmp eq (trunc (lshr(X, cst1)), cst->icmp (and X, mask), cst when the shift type is larger than 64-bits. NFC"

I accidentally had a extra change in there.

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

7 years ago[InstCombine] Add test case demonstrating that we don't handle icmp eq (trunc (lshr...
Craig Topper [Wed, 28 Jun 2017 06:42:48 +0000 (06:42 +0000)]
[InstCombine] Add test case demonstrating that we don't handle icmp eq (trunc (lshr(X, cst1)), cst->icmp (and X, mask), cst when the shift type is larger than 64-bits. NFC

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

7 years agoAdd missing library dependency to fix build break in llvm-lto2
Hiroshi Inoue [Wed, 28 Jun 2017 06:14:30 +0000 (06:14 +0000)]
Add missing library dependency to fix build break in llvm-lto2

error message
CMakeFiles/llvm-lto2.dir/llvm-lto2.cpp.o: In function `dumpSymtab(int, char**)':
llvm-lto2.cpp:(.text._ZL10dumpSymtabiPPc+0x238): undefined reference to `llvm::getBitcodeFileContents(llvm::MemoryBufferRef)'
collect2: error: ld returned 1 exit status

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

7 years ago[IRCE][NFC] Better get SCEV for 1 in calculateSubRanges
Max Kazantsev [Wed, 28 Jun 2017 04:57:45 +0000 (04:57 +0000)]
[IRCE][NFC] Better get SCEV for 1 in calculateSubRanges

A slightly more efficient way to get constant, we avoid resolving in getSCEV and excessive
invocations, and we don't create a ConstantInt if 'true' branch is taken.

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

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

7 years agoRevert "[DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI."
Nirav Dave [Wed, 28 Jun 2017 03:20:04 +0000 (03:20 +0000)]
Revert "[DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI."

This reverts commit r306498 which appears to cause a compilrt-rt test failures

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

7 years ago[AMDGPU] Add pattern for v_alignbit_b32 with immediate
Stanislav Mekhanoshin [Wed, 28 Jun 2017 02:52:39 +0000 (02:52 +0000)]
[AMDGPU] Add pattern for v_alignbit_b32 with immediate

If immediate in shift is less than 32 we can use alignbit too.

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

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

7 years agoAllow to truncate left shift with non-constant shift amount
Stanislav Mekhanoshin [Wed, 28 Jun 2017 02:37:11 +0000 (02:37 +0000)]
Allow to truncate left shift with non-constant shift amount

That is pretty common for clang to produce code like
(shl %x, (and %amt, 31)). In this situation we can still perform
trunc (shl) into shl (trunc) conversion given the known value
range of shift amount.

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

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

7 years ago[DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI.
Nirav Dave [Wed, 28 Jun 2017 02:09:50 +0000 (02:09 +0000)]
[DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI.

Pull FrameIndex comparision reasoning from DAGCombiner::isAlias to
general BaseIndexOffset.

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

7 years agoInlining: Don't re-map simplified cloned instructions.
Kyle Butt [Wed, 28 Jun 2017 01:41:25 +0000 (01:41 +0000)]
Inlining: Don't re-map simplified cloned instructions.

When simplifying an instruction that has been re-mapped, it should never
simplify to an instruction in the original function. In the edge case
where we are inlining a function into itself, the existing code led to
incorrect behavior. Replace the incorrect code with an assert verifying
that we never expect simplification to produce an instruction in the old
function, unless the functions are the same.

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

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

7 years ago[TableGen] Improve Debug Output for --debug-only=subtarget-emitter NFCI
Joel Jones [Wed, 28 Jun 2017 00:06:40 +0000 (00:06 +0000)]
[TableGen] Improve Debug Output for --debug-only=subtarget-emitter NFCI

Add headers for each section of output, with white space and "+++" to
improve readability.

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

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

7 years agoAdd missing library dependency.
Peter Collingbourne [Wed, 28 Jun 2017 00:05:27 +0000 (00:05 +0000)]
Add missing library dependency.

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