OSDN Git Service

android-x86/external-llvm.git
5 years ago[NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py
Jinsong Ji [Tue, 12 Mar 2019 17:55:32 +0000 (17:55 +0000)]
[NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py

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

5 years agoTest commit: add a blank line in test case ppc64-dq-expr.s
Jason Liu [Tue, 12 Mar 2019 17:33:07 +0000 (17:33 +0000)]
Test commit: add a blank line in test case ppc64-dq-expr.s

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

5 years ago[yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names
James Henderson [Tue, 12 Mar 2019 17:00:25 +0000 (17:00 +0000)]
[yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names

Prior to this change, the "Symbol" field of a relocation would always be
assumed to be a symbol name, and if no such symbol existed, the
relocation would reference index 0. This confused me when I tried to use
a literal symbol index in the field: since "0x1" was not a known symbol
name, the symbol index was set as 0. This change falls back to treating
unknown symbol names as integers, and emits an error if the name is not
found and the string is not an integer.

Note that the Symbol field is optional, so if a relocation doesn't
reference a symbol, it shouldn't be specified. The new error required a
number of test updates.

Reviewed by: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D58510

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

5 years ago[SDAG] Expand pow2 mulo using shifts
Nikita Popov [Tue, 12 Mar 2019 16:57:25 +0000 (16:57 +0000)]
[SDAG] Expand pow2 mulo using shifts

Expand MULO with constant power of two operand into a shift. The
overflow is checked with (x << shift) >> shift == x, where the right
shift will be logical for umulo and arithmetic for smulo (with
exception for multiplications by signed_min).

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

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

5 years ago[X86] Arrange more CPU features to inherit from earlier CPUs. NFCI
Craig Topper [Tue, 12 Mar 2019 16:35:30 +0000 (16:35 +0000)]
[X86] Arrange more CPU features to inherit from earlier CPUs. NFCI

This makes SandyBridge inherit back to Westmere/Nehalem.

Make bdver1-4 inherit from each other and btver2 inherit from btver1.

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

5 years agoRegenerate sign_extend.ll test.
Simon Pilgrim [Tue, 12 Mar 2019 16:00:59 +0000 (16:00 +0000)]
Regenerate sign_extend.ll test.

This will change as part of the fix for the regressions in D58017.

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

5 years ago[DAGCombine] Pull out repeated demanded bitmask generation. NFCI.
Simon Pilgrim [Tue, 12 Mar 2019 15:58:28 +0000 (15:58 +0000)]
[DAGCombine] Pull out repeated demanded bitmask generation. NFCI.

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

5 years ago[Docs] Add note about legacy PM to Ch4 of tutorial
Kristina Brooks [Tue, 12 Mar 2019 15:44:18 +0000 (15:44 +0000)]
[Docs] Add note about legacy PM to Ch4 of tutorial

Add a note about legacy FunctionPassManager to the LLVM tutorial.

It seems to confuse some people, worth adding a warning to the tutorial
to elaborate and suggest using `llvm::legacy::FunctionPassManager` for
now. Not a perfect solution but hopefully will avoid confusion
in the meantime.

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

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

5 years ago[llvm-cxxfilt]Add test to show that empty lines can be handled
James Henderson [Tue, 12 Mar 2019 15:42:38 +0000 (15:42 +0000)]
[llvm-cxxfilt]Add test to show that empty lines can be handled

I recently discovered a bug in llvm-cxxfilt introduced in r353743 but
was fixed later incidentally due to r355031. Specifically, llvm-cxxfilt
was attempting to call .back() on an empty string any time there was a
new line in the input. This was causing a crash in my debug builds only.
This patch simply adds a test that explicitly tests that llvm-cxxfilt
handles empty lines correctly. It may pass under release builds under
the broken behaviour, but it fails at least in debug builds.

Reviewed by: mattd

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

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

5 years ago[FileCheck]Remove assertions that prevent matching an empty string at file start...
James Henderson [Tue, 12 Mar 2019 15:37:34 +0000 (15:37 +0000)]
[FileCheck]Remove assertions that prevent matching an empty string at file start before CHECK-NEXT/SAME

This patch removes two assertions that were preventing writing of a test
that checked an empty line followed by some text. For example:

CHECK: {{^$}}
CHECK-NEXT: foo()

The assertion was because the current location the CHECK-NEXT was
scanning from was the start of the buffer. A similar issue occurred with
CHECK-SAME. These assertions don't protect against anything, as there is
already an error check that checks that CHECK-NEXT/EMPTY/SAME don't
appear first in the checks, and the following code works fine if the
pointer is at the start of the input.

Reviewed by: probinson, thopre, jdenny
Differential Revision: https://reviews.llvm.org/D58784

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

5 years agoCodeGenPrep: preserve inbounds attribute when sinking GEPs.
Tim Northover [Tue, 12 Mar 2019 15:22:23 +0000 (15:22 +0000)]
CodeGenPrep: preserve inbounds attribute when sinking GEPs.

Targets can potentially emit more efficient code if they know address
computations never overflow. For example ILP32 code on AArch64 (which only has
64-bit address computation) can ignore the possibility of overflow with this
extra information.

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

5 years ago[format] \t => ' '
Liang Zou [Tue, 12 Mar 2019 14:48:32 +0000 (14:48 +0000)]
[format] \t => '  '

Summary:
1. \t => '  '
2. test commit access

Reviewers: Higuoxing, liangdzou

Reviewed By: Higuoxing, liangdzou

Subscribers: kristina, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-readobj] Print symbol version when dumping relocations (PR31564)
Xing GUO [Tue, 12 Mar 2019 14:30:13 +0000 (14:30 +0000)]
[llvm-readobj] Print symbol version when dumping relocations (PR31564)

Summary: This helps resolve https://bugs.llvm.org/show_bug.cgi?id=31564

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[SimplifyLibCalls] Simplify optimizePuts
Fangrui Song [Tue, 12 Mar 2019 14:20:22 +0000 (14:20 +0000)]
[SimplifyLibCalls] Simplify optimizePuts

The code might intend to replace puts("") with putchar('\n') even if the
return value is used. It failed because use_empty() was used to guard
the whole block. While returning '\n' (putchar('\n')) is technically
correct (puts is only required to return a nonnegative number on
success), doing this looks weird and there is really little benefit to
optimize puts whose return value is used. So don't do that.

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

5 years ago[NFC][PowerPC]Assert when trying to generate directmove below P8.
Jinsong Ji [Tue, 12 Mar 2019 14:01:29 +0000 (14:01 +0000)]
[NFC][PowerPC]Assert when trying to generate directmove below P8.

This was found when we generated COPY from G8RC to F8RC in
EmitInstrWithCustomInserter without checking proper architecture,
we silently generated mtvsrd, which require P8 and up.

This is a NFC patch to add assert when we call copyPhysReg, in case
someone accidentally generate COPY between G8RC to F8RC for P7 and
below.

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

5 years ago[XRay][docs] Fix option name
Fangrui Song [Tue, 12 Mar 2019 13:44:42 +0000 (13:44 +0000)]
[XRay][docs] Fix option name

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

5 years ago[llvm-objcopy] Remove unneeded checks. NFC
Eugene Leviant [Tue, 12 Mar 2019 12:41:06 +0000 (12:41 +0000)]
[llvm-objcopy] Remove unneeded checks. NFC

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

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

5 years agoRevert rL355906: [SLP] Remove redundancy of performing operand reordering twice:...
Simon Pilgrim [Tue, 12 Mar 2019 11:51:59 +0000 (11:51 +0000)]
Revert rL355906: [SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

Reverted due to buildbot failures that I don't have time to track down.

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

5 years agoTry to fix SLPVectorizer BoUpSLP::BoEdgeInfo::dump visibility on non-debug builds
Simon Pilgrim [Tue, 12 Mar 2019 11:31:06 +0000 (11:31 +0000)]
Try to fix SLPVectorizer BoUpSLP::BoEdgeInfo::dump visibility on non-debug builds

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

5 years ago[ARM][NFC] Delete original smlad tests
Sam Parker [Tue, 12 Mar 2019 11:06:15 +0000 (11:06 +0000)]
[ARM][NFC] Delete original smlad tests

Because I don't understand svn.

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

5 years ago[ARM][NFC] Move smlad tests
Sam Parker [Tue, 12 Mar 2019 11:01:11 +0000 (11:01 +0000)]
[ARM][NFC] Move smlad tests

Created a test/CodeGen/ARM/ParallelDSP folder.

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

5 years ago[SLP] Remove redundancy of performing operand reordering twice: once in buildTree...
Simon Pilgrim [Tue, 12 Mar 2019 10:51:51 +0000 (10:51 +0000)]
[SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

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

5 years ago[SimplifyLibCalls] Fix comments about fputs, memchr, and s[n]printf. NFC
Fangrui Song [Tue, 12 Mar 2019 10:31:52 +0000 (10:31 +0000)]
[SimplifyLibCalls] Fix comments about fputs, memchr, and s[n]printf. NFC

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

5 years ago[CGP] Fix UB when GEP is bound to trivial PHINode
Eugene Leviant [Tue, 12 Mar 2019 10:10:29 +0000 (10:10 +0000)]
[CGP] Fix UB when GEP is bound to trivial PHINode

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

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

5 years ago[AMDGPU] Add support for immediate operand for S_ENDPGM
David Stuttard [Tue, 12 Mar 2019 09:52:58 +0000 (09:52 +0000)]
[AMDGPU] Add support for immediate operand for S_ENDPGM

Summary:
Add support for immediate operand in S_ENDPGM

Change-Id: I0c56a076a10980f719fb2a8f16407e9c301013f6

Reviewers: alexshap

Subscribers: qcolombet, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, eraman, arphaman, Petar.Avramovic, llvm-commits

Tags: #llvm

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

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

5 years ago[TTI] Enable analysis of clib functions in getIntrinsicCosts. NFCI.
Sjoerd Meijer [Tue, 12 Mar 2019 09:48:02 +0000 (09:48 +0000)]
[TTI] Enable analysis of clib functions in getIntrinsicCosts. NFCI.

This is addressing the issue that we're not modeling the cost of clib functions
in TTI::getIntrinsicCosts and thus we're basically addressing this fixme:

// FIXME: This is wrong for libc intrinsics.

To enable analysis of clib functions, we not only need an intrinsic ID and
formal arguments, but also the actual user of that function so that we can e.g.
look at alignment and values of arguments. So, this is the initial plumbing to
pass the user of an intrinsinsic on to getCallCosts, which queries
getIntrinsicCosts.

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

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

5 years ago[TableGen] Allow 2^63-1 and 2^63-2 as int literals.
Simon Tatham [Tue, 12 Mar 2019 09:28:19 +0000 (09:28 +0000)]
[TableGen] Allow 2^63-1 and 2^63-2 as int literals.

These two values correspond to the 'Empty' and 'Tombstone' special
keys defined by DenseMapInfo<int64_t>, which means that neither one
can be used as a key in DenseMap<int64_t, anything>. Hence, if you try
to use either of those values as an int literal, IntInit::get() fails
an assertion when it tries to insert them into its static cache of
int-literal objects.

Fixed by replacing the DenseMap with a std::map, which doesn't intrude
on the space of legal values of the key type.

Reviewers: nhaehnle, hfinkel, javedabsar, efriedma

Reviewed By: efriedma

Subscribers: fhahn, efriedma, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[RISCV] Add test cases for the lp64 ABI
Alex Bradbury [Tue, 12 Mar 2019 09:26:53 +0000 (09:26 +0000)]
[RISCV] Add test cases for the lp64 ABI

These are closely modeled on similar tests for the ilp32 ABI. Like those
tests, we group together tests that should be common cross lp64, lp64+lp64f,
and lp64+lp64f+lp64d ABIs.

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

5 years agoFix git-llvm crashing when trying to remove directory while cleaning
Raphael Isemann [Tue, 12 Mar 2019 07:40:54 +0000 (07:40 +0000)]
Fix git-llvm crashing when trying to remove directory while cleaning

Summary:
I'm trying to push D59198 but it seems that `git-llvm push` can't handle the fact
that I add a new directory in the patch:

```
> git llvm push -n
Pushing 1 commit:
  e7c0a9bd136 Correctly look up declarations in inline namespaces
Traceback (most recent call last):
  File "llvm/utils/git-svn//git-llvm", line 431, in <module>
    args.func(args)
  File "llvm/utils/git-svn//git-llvm", line 385, in cmd_push
    clean_svn(svn_root)
  File "llvm/utils/git-svn//git-llvm", line 201, in clean_svn
    os.remove(os.path.join(svn_repo, filename))
IsADirectoryError: [Errno 21] Is a directory: '.git/llvm-upstream-svn/lldb/trunk/packages/Python/lldbsuite/test/expression_command/inline-namespace'
```

This patch just uses shutil to delete the directory instead of trying to use `os.remove`
which only works for files.

Reviewers: mehdi_amini, jlebar

Reviewed By: jlebar

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoVery minor typo. NFC
Kristina Brooks [Tue, 12 Mar 2019 07:08:19 +0000 (07:08 +0000)]
Very minor typo. NFC

Typo `we we're` => `we were` in the pass EarlyCSE

Patch by liangdzou (Liang ZOU)

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

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

5 years agollvm-objcopy: Remove unused field. NFCI.
Peter Collingbourne [Tue, 12 Mar 2019 02:17:01 +0000 (02:17 +0000)]
llvm-objcopy: Remove unused field. NFCI.

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

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

5 years agoReland "Relax constraints for reduction vectorization"
Sanjoy Das [Tue, 12 Mar 2019 01:31:44 +0000 (01:31 +0000)]
Reland "Relax constraints for reduction vectorization"

Change from original commit: move test (that uses an X86 triple) into the X86
subdirectory.

Original description:
Gating vectorizing reductions on *all* fastmath flags seems unnecessary;
`reassoc` should be sufficient.

Reviewers: tvvikram, mkuper, kristof.beyls, sdesmalen, Ayal

Reviewed By: sdesmalen

Subscribers: dcaballe, huntergr, jmolloy, mcrosier, jlebar, bixia, llvm-commits

Tags: #llvm

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

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

5 years agoAdd Swift enumerator value for CodeView::SourceLanguage
Nathan Lanza [Mon, 11 Mar 2019 23:27:59 +0000 (23:27 +0000)]
Add Swift enumerator value for CodeView::SourceLanguage

Summary:
Swift now generates PDBs for debugging on Windows. llvm and lldb
need a language enumerator value too properly handle the output
emitted by swiftc.

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years agoHexagon RDF: Replace function template (plus explicit specializations) with non-templ...
David Blaikie [Mon, 11 Mar 2019 23:10:33 +0000 (23:10 +0000)]
Hexagon RDF: Replace function template (plus explicit specializations) with non-template overloads

For the design in question, overloads seem to be a much simpler and less subtle solution.

This removes ODR issues, and errors of the kind where code that uses the
specialization in question will accidentally and erroneously specialize
the primary template. This only "works" by accident; the program is
ill-formed NDR.

(Found with -Wundefined-func-template.)

Patch by Thomas Köppe!

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

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

5 years agoRevert "Relax constraints for reduction vectorization"
Sanjoy Das [Mon, 11 Mar 2019 22:37:31 +0000 (22:37 +0000)]
Revert "Relax constraints for reduction vectorization"

This reverts commit r355868.  Breaks hexagon.

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

5 years ago[X86] Remove ProcModel and ProcFeatures tablegen classes. Move all feature lists...
Craig Topper [Mon, 11 Mar 2019 22:29:00 +0000 (22:29 +0000)]
[X86] Remove ProcModel and ProcFeatures tablegen classes. Move all feature lists into a ProcessorFeatures class.

ProcFeatures was a class that just concatenated two feature lists together and gave it a name. We used it to inherit features between CPUs.

ProcModel took a two CPU feature lists and concatenated them before deferring to ProcessorModel. This was to allow inherited features and specific features to be passed to each CPU.

Both of these allowed for only very rigid CPU inheritance rules.

With this patch we now store all of the lists we were using for inheritance in one object and do any list oncatenation we want there. Then we just pass whatever list we want from this class into the ProcessorModel class for each CPU.

Hopefully this gives us more flexibility to build up feature lists in whatever ways we think make sense. Perhaps untangling ISA flags and tuning flags.

I've only touched the CPUs that were directly affected by the removal of the ProcModel and ProcFeatures classes. We should move more of the feature lists into ProcessorFeatures.

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

5 years agoRecommit "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"
Jessica Paquette [Mon, 11 Mar 2019 22:18:01 +0000 (22:18 +0000)]
Recommit "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"

After r355865, we should be able to safely select G_EXTRACT_VECTOR_ELT without
running into any problematic intrinsics.

Also add a fix for lane copies, which don't support index 0.

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

5 years agoRemove ASan asm instrumentation.
Evgeniy Stepanov [Mon, 11 Mar 2019 21:50:10 +0000 (21:50 +0000)]
Remove ASan asm instrumentation.

Summary: It is incomplete and has no users AFAIK.

Reviewers: pcc, vitalybuka

Subscribers: srhines, kubamracek, mgorny, krytarowski, eraman, hiraditya, jdoerfert, #sanitizers, llvm-commits, thakis

Tags: #sanitizers, #llvm

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

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

5 years ago[RISCV] Do a sign-extension in a compare-and-swap of 32 bit in RV64A
Alex Bradbury [Mon, 11 Mar 2019 21:41:22 +0000 (21:41 +0000)]
[RISCV] Do a sign-extension in a compare-and-swap of 32 bit in RV64A

AtomicCmpSwapWithSuccess is legalised into an AtomicCmpSwap plus a comparison.
This requires an extension of the value which, by default, is a
zero-extension. When we later lower AtomicCmpSwap into a PseudoCmpXchg32 and then expanded in
RISCVExpandPseudoInsts.cpp, the lr.w instruction does a sign-extension.

This mismatch of extensions causes the comparison to fail when the compared
value is negative. This change overrides TargetLowering::getExtendForAtomicOps
for RISC-V so it does a sign-extension instead.

Differential Revision: https://reviews.llvm.org/D58829
Patch by Ferran Pallarès Roca.

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

5 years agoRelax constraints for reduction vectorization
Sanjoy Das [Mon, 11 Mar 2019 21:36:41 +0000 (21:36 +0000)]
Relax constraints for reduction vectorization

Summary:
Gating vectorizing reductions on *all* fastmath flags seems unnecessary;
`reassoc` should be sufficient.

Reviewers: tvvikram, mkuper, kristof.beyls, sdesmalen, Ayal

Reviewed By: sdesmalen

Subscribers: dcaballe, huntergr, jmolloy, mcrosier, jlebar, bixia, llvm-commits

Tags: #llvm

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

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

5 years ago[RISCV] Allow fp as an alias of s0
Alex Bradbury [Mon, 11 Mar 2019 21:35:26 +0000 (21:35 +0000)]
[RISCV] Allow fp as an alias of s0

The RISC-V Assembly Programmer's Manual defines fp as another alias of x8.
However, our tablegen rules only recognise s0. This patch adds fp as another
alias of x8. GCC also accepts fp.

Differential Revision: https://reviews.llvm.org/D59209
Patch by Ferran Pallarès Roca.

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

5 years ago[GlobalISel][AArch64] Always fall back on aarch64.neon.addp.*
Jessica Paquette [Mon, 11 Mar 2019 20:51:17 +0000 (20:51 +0000)]
[GlobalISel][AArch64] Always fall back on aarch64.neon.addp.*

Overloaded intrinsics aren't necessarily safe for instruction selection. One
such intrinsic is aarch64.neon.addp.*.

This is a temporary workaround to ensure that we always fall back on that
intrinsic. Eventually this will be replaced with a proper solution.

https://bugs.llvm.org/show_bug.cgi?id=40968

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

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

5 years ago[RISCV][NFC] Convert some MachineBaiscBlock::iterator(MI) to MI.getIterator()
Alex Bradbury [Mon, 11 Mar 2019 20:43:29 +0000 (20:43 +0000)]
[RISCV][NFC] Convert some MachineBaiscBlock::iterator(MI) to MI.getIterator()

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

5 years agoRemove esan.
Nico Weber [Mon, 11 Mar 2019 20:23:40 +0000 (20:23 +0000)]
Remove esan.

It hasn't seen active development in years, and it hasn't reached a
state where it was useful.

Remove the code until someone is interested in working on it again.

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

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

5 years ago[SDAG][AArch64] Legalize VECREDUCE
Nikita Popov [Mon, 11 Mar 2019 20:22:13 +0000 (20:22 +0000)]
[SDAG][AArch64] Legalize VECREDUCE

Fixes https://bugs.llvm.org/show_bug.cgi?id=36796.

Implement basic legalizations (PromoteIntRes, PromoteIntOp,
ExpandIntRes, ScalarizeVecOp, WidenVecOp) for VECREDUCE opcodes.
There are more legalizations missing (esp float legalizations),
but there's no way to test them right now, so I'm not adding them.

This also includes a few more changes to make this work somewhat
reasonably:

 * Add support for expanding VECREDUCE in SDAG. Usually
   experimental.vector.reduce is expanded prior to codegen, but if the
   target does have native vector reduce, it may of course still be
   necessary to expand due to legalization issues. This uses a shuffle
   reduction if possible, followed by a naive scalar reduction.
 * Allow the result type of integer VECREDUCE to be larger than the
   vector element type. For example we need to be able to reduce a v8i8
   into an (nominally) i32 result type on AArch64.
 * Use the vector operand type rather than the scalar result type to
   determine the action, so we can control exactly which vector types are
   supported. Also change the legalize vector op code to handle
   operations that only have vector operands, but no vector results, as
   is the case for VECREDUCE.
 * Default VECREDUCE to Expand. On AArch64 (only target using VECREDUCE),
   explicitly specify for which vector types the reductions are supported.

This does not handle anything related to VECREDUCE_STRICT_*.

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

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

5 years agogn build: Merge r355777
Nico Weber [Mon, 11 Mar 2019 19:30:13 +0000 (19:30 +0000)]
gn build: Merge r355777

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

5 years agogn build: Merge r355835
Nico Weber [Mon, 11 Mar 2019 19:14:22 +0000 (19:14 +0000)]
gn build: Merge r355835

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

5 years agogn build: Merge r355834
Nico Weber [Mon, 11 Mar 2019 19:11:15 +0000 (19:11 +0000)]
gn build: Merge r355834

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

5 years ago[RegAlloc] Avoid compile time regression with multiple copy hints.
Jonas Paulsson [Mon, 11 Mar 2019 19:00:37 +0000 (19:00 +0000)]
[RegAlloc]  Avoid compile time regression with multiple copy hints.

As a fix for https://bugs.llvm.org/show_bug.cgi?id=40986 ("excessive compile
time building opencollada"), this patch makes sure that no phys reg is hinted
more than once from getRegAllocationHints().

This handles the case were many virtual registers are assigned to the same
physreg. The previous compile time fix (r343686) in weightCalcHelper() only
made sure that physical/virtual registers are passed no more than once to
addRegAllocationHint().

Review: Dimitry Andric, Quentin Colombet
https://reviews.llvm.org/D59201

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

5 years ago[coroutines][PR40979] Ignore unreachable uses across suspend points
Brian Gesiak [Mon, 11 Mar 2019 18:31:28 +0000 (18:31 +0000)]
[coroutines][PR40979] Ignore unreachable uses across suspend points

Summary:
Depends on https://reviews.llvm.org/D59069.

https://bugs.llvm.org/show_bug.cgi?id=40979 describes a bug in which the
-coro-split pass would assert that a use was across a suspend point from
a definition. Normally this would mean that a value would "spill" across
a suspend point and thus need to be stored in the coroutine frame. However,
in this case the use was unreachable, and so it would not be necessary
to store the definition on the frame.

To prevent the assert, simply remove unreachable basic blocks from a
coroutine function before computing spills. This avoids the assert
reported in PR40979.

Reviewers: GorNishanov, tks2103

Reviewed By: GorNishanov

Subscribers: EricWF, jdoerfert, llvm-commits, lewissbaker

Tags: #llvm

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

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

5 years agoDetect malformed LC_LINKER_COMMANDs in Mach-O binaries
Michael Trent [Mon, 11 Mar 2019 18:29:25 +0000 (18:29 +0000)]
Detect malformed LC_LINKER_COMMANDs in Mach-O binaries

Summary:
llvm-objdump can be tricked into reading beyond valid memory and
segfaulting if LC_LINKER_COMMAND strings are not null terminated. libObject
does have code to validate the integrity of the LC_LINKER_COMMAND struct,
but this validator improperly assumes linker command strings are null
terminated.

The solution is to report an error if a string extends beyond the end of
the LC_LINKER_COMMAND struct.

Reviewers: lhames, pete

Reviewed By: pete

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Extend widening comparison test.
Simon Pilgrim [Mon, 11 Mar 2019 18:08:20 +0000 (18:08 +0000)]
[X86] Extend widening comparison test.

Ensure we test both v2i16 unary and binary comparisons.

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

5 years ago[NFC][PowerPC] Add comment for PPCAsmPrinter::printOperand
Jinsong Ji [Mon, 11 Mar 2019 17:57:49 +0000 (17:57 +0000)]
[NFC][PowerPC] Add comment for PPCAsmPrinter::printOperand

Patch by Yi-Hong Lyu

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

5 years ago[DAG] FoldSetCC - reuse valuetype + ensure its simple.
Simon Pilgrim [Mon, 11 Mar 2019 17:56:18 +0000 (17:56 +0000)]
[DAG] FoldSetCC - reuse valuetype + ensure its simple.

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

5 years ago[Utils] Extract EliminateUnreachableBlocks (NFC)
Brian Gesiak [Mon, 11 Mar 2019 17:51:57 +0000 (17:51 +0000)]
[Utils] Extract EliminateUnreachableBlocks (NFC)

Summary:
Extract the functionality of eliminating unreachable basic blocks
within a function, previously encapsulated within the
-unreachableblockelim pass, and make it available as a function within
BlockUtils.h. No functional change intended other than making the logic
reusable.

Exposing this logic makes it easier to implement
https://reviews.llvm.org/D59068, which fixes coroutines bug
https://bugs.llvm.org/show_bug.cgi?id=40979.

Reviewers: mkazantsev, wmi, davidxl, silvas, davide

Reviewed By: davide

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[DAG] Move SetCC NaN handling into FoldSetCC
Simon Pilgrim [Mon, 11 Mar 2019 17:43:10 +0000 (17:43 +0000)]
[DAG] Move SetCC NaN handling into FoldSetCC

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

5 years agoUse bitset for assembler predicates
Stanislav Mekhanoshin [Mon, 11 Mar 2019 17:04:35 +0000 (17:04 +0000)]
Use bitset for assembler predicates

AMDGPU target run out of Subtarget feature flags hitting the limit of 64.
AssemblerPredicates uses at most uint64_t for their representation.
At the same time CodeGen has exhausted this a long time ago and switched
to a FeatureBitset with the current limit of 192 bits.

This patch completes transition to the bitset for feature bits extending
it to asm matcher and MC code emitter.

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

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

5 years ago[TableGen] Replace a dyn_cast with isa to avoid an unused variable warning introduced...
Craig Topper [Mon, 11 Mar 2019 16:51:37 +0000 (16:51 +0000)]
[TableGen] Replace a dyn_cast with isa to avoid an unused variable warning introduced in r355785. NFC

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

5 years ago[AMDGPU] Mark enum types in SIDefines.h as unsigned
Stanislav Mekhanoshin [Mon, 11 Mar 2019 16:49:32 +0000 (16:49 +0000)]
[AMDGPU] Mark enum types in SIDefines.h as unsigned

MSVC issues some warnings about signed/unsigned comparison.

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

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

5 years ago[SimplifyCFG] Retain debug info when threading jumps with critical edges
Jeremy Morse [Mon, 11 Mar 2019 16:23:59 +0000 (16:23 +0000)]
[SimplifyCFG] Retain debug info when threading jumps with critical edges

Fixes bug 38023: https://bugs.llvm.org/show_bug.cgi?id=38023

The SimplifyCFG pass will perform jump threading in some cases where
doing so is trivial and would simplify the CFG. When folding a series
of blocks with redundant conditional branches into an unconditional "critical
edge" block, it does not keep the debug location associated with the previous
conditional branch.

This patch fixes the bug described by copying the debug info from the
old conditional branch to the new unconditional branch instruction, and
adds a regression test for the SimplifyCFG pass that covers this case.

Patch by Stephen Tozer!

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

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

5 years ago[yaml2obj] - Simplify. NFC.
George Rimar [Mon, 11 Mar 2019 16:10:02 +0000 (16:10 +0000)]
[yaml2obj] - Simplify. NFC.

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

5 years ago[DAG] TargetLowering::SimplifySetCC - call FoldSetCC early to handle constant/commute...
Simon Pilgrim [Mon, 11 Mar 2019 15:01:31 +0000 (15:01 +0000)]
[DAG] TargetLowering::SimplifySetCC - call FoldSetCC early to handle constant/commute folds.

Noticed while looking at PR40800 (and also D57921)

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

5 years ago[MIPS][microMIPS] Add a pattern to match TruncIntFP
Petar Jovanovic [Mon, 11 Mar 2019 14:13:31 +0000 (14:13 +0000)]
[MIPS][microMIPS] Add a pattern to match TruncIntFP

A pattern needed to match TruncIntFP was missing. This was causing multiple
tests from llvm test suite to fail during compilation for micromips.

Patch by Mirko Brkusanin.

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

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

5 years ago[CGP] Limit distance between overflow math and cmp
Sam Parker [Mon, 11 Mar 2019 13:19:46 +0000 (13:19 +0000)]
[CGP] Limit distance between overflow math and cmp

Inserting an overflowing arithmetic intrinsic can increase register
pressure by producing two values at a point where only one is needed,
while the second use maybe several blocks away. This increase in
pressure is likely to be more detrimental on performance than
rematerialising one of the original instructions.

So, check that the arithmetic and compare instructions are no further
apart than their immediate successor/predecessor.

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

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

5 years ago[JumpThreading] Retain debug info when replacing branch instructions
Jeremy Morse [Mon, 11 Mar 2019 11:48:57 +0000 (11:48 +0000)]
[JumpThreading] Retain debug info when replacing branch instructions

Fixes bug 37966: https://bugs.llvm.org/show_bug.cgi?id=37966

The Jump Threading pass will replace certain conditional branch
instructions with unconditional branches when it can prove that only one
branch can occur. Prior to this patch, it would not carry the debug
info from the old instruction to the new one.

This patch fixes the bug described by copying the debug info from the
conditional branch instruction to the new unconditional branch
instruction, and adds a regression test for the Jump Threading pass that
covers this case.

Patch by Stephen Tozer!

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

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

5 years ago[llvm-objcopy] - Fix --compress-debug-sections when there are relocations.
George Rimar [Mon, 11 Mar 2019 11:01:24 +0000 (11:01 +0000)]
[llvm-objcopy] - Fix --compress-debug-sections when there are relocations.

When --compress-debug-sections is given,
llvm-objcopy removes the uncompressed sections and adds compressed to the section list.
This makes all the pointers to old sections to be outdated.

Currently, code already has logic for replacing the target sections of the relocation
sections. But we also have to update the relocations by themselves.

This fixes https://bugs.llvm.org/show_bug.cgi?id=40885.

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

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

5 years ago[MIPS GlobalISel] Silence uninitialized variable warning
Benjamin Kramer [Mon, 11 Mar 2019 10:39:15 +0000 (10:39 +0000)]
[MIPS GlobalISel] Silence uninitialized variable warning

The control flow here cannot ever use the uninitialized value, but it's
too hard for the compiler to figure that out. Clang warns:

llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2600:28: error: variable 'CarrySum' is used uninitialized whenever 'for' loop exits because its condition is false [-Werror,-Wsometimes-uninitialized]
      for (unsigned i = 2; i < Factors.size(); ++i)
                           ^~~~~~~~~~~~~~~~~~
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2604:26: note: uninitialized use occurs here
    CarrySumPrevDstIdx = CarrySum;
                         ^~~~~~~~
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2600:28: note: remove the condition if it is always true
      for (unsigned i = 2; i < Factors.size(); ++i)
                           ^~~~~~~~~~~~~~~~~~
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2583:22: note: initialize the variable 'CarrySum' to silence this warning
    unsigned CarrySum;
                     ^
                      = 0

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

5 years ago[MIPS GlobalISel] NarrowScalar G_UMULH
Petar Avramovic [Mon, 11 Mar 2019 10:08:44 +0000 (10:08 +0000)]
[MIPS GlobalISel] NarrowScalar G_UMULH

NarrowScalar G_UMULH in LegalizerHelper
using multiplyRegisters helper function.
NarrowScalar G_UMULH for MIPS32.

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

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

5 years ago[MIPS GlobalISel] NarrowScalar G_MUL
Petar Avramovic [Mon, 11 Mar 2019 10:00:17 +0000 (10:00 +0000)]
[MIPS GlobalISel] NarrowScalar G_MUL

Narrow Scalar G_MUL for MIPS32.
Revisit NarrowScalar implementation in LegalizerHelper.
Introduce new helper function multiplyRegisters.
It performs generic multiplication of values held in multiple registers.
Generated instructions use only types NarrowTy and i1.
Destination can be same or two times size of the source.

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

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

5 years agoAttempt to fix build errors caused by r355812
Pavel Labath [Mon, 11 Mar 2019 09:23:30 +0000 (09:23 +0000)]
Attempt to fix build errors caused by r355812

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

5 years ago[Support/Endian] Add support for endian-specific enums
Pavel Labath [Mon, 11 Mar 2019 09:06:18 +0000 (09:06 +0000)]
[Support/Endian] Add support for endian-specific enums

Summary:
Binary formats often include various enumerations or bitsets, but using
endian-specific types for accessing them is tricky because they
currently only support integral types. This is particularly true for
scoped enums (enum class), as these are not implicitly convertible to
integral types, and so one has to perform two casts just to read the
enum value.

This fixes that support by adding first-class support for enumeration
types to endian-specific types. The support for them was already almost
working -- all I needed to do was overload getSwappedBytes for
enumeration types (which casts the enum to its underlying type and performs the
conversion there). I also add some convenience template aliases to simplify
declaring endian-specific enums.

Reviewers: Bigcheese, zturner

Subscribers: kristina, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Enable sse2_cvtsd2ss intrinsic to use an EVEX encoded instruction.
Craig Topper [Mon, 11 Mar 2019 06:01:04 +0000 (06:01 +0000)]
[X86] Enable sse2_cvtsd2ss intrinsic to use an EVEX encoded instruction.

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

5 years ago[X86] Remove apparently unneeded patterns for storing a bitcasted extractelement.
Craig Topper [Mon, 11 Mar 2019 06:01:02 +0000 (06:01 +0000)]
[X86] Remove apparently unneeded patterns for storing a bitcasted extractelement.

I suspect if this pattern was seen, DAG combine would just change the type of the store to eliminate the bitcast.

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

5 years ago[X86] Use 'UseAVX' in place of 'HasAVX, NoAVX512'. NFC
Craig Topper [Mon, 11 Mar 2019 06:01:00 +0000 (06:01 +0000)]
[X86] Use 'UseAVX' in place of 'HasAVX, NoAVX512'. NFC

They mean the same thing, but 'HasAVX, NoAVX512' only appears in this one place. Every other place uses UseAVX.

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

5 years ago[X86] Add SCALAR_SINT_TO_FP/SCALAR_UINT_TO_FP ISD opcodes without rounding mode.
Craig Topper [Mon, 11 Mar 2019 04:37:01 +0000 (04:37 +0000)]
[X86] Add SCALAR_SINT_TO_FP/SCALAR_UINT_TO_FP ISD opcodes without rounding mode.

After this we no longer need to match FROUND_CURRENT or FROUND_NO_EXC during isel so I remove those.

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

5 years ago[X86] Split SCALEF(S) ISD opcodes into a version without rounding mode.
Craig Topper [Mon, 11 Mar 2019 04:36:59 +0000 (04:36 +0000)]
[X86] Split SCALEF(S) ISD opcodes into a version without rounding mode.

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

5 years ago[X86] Split RCP28/RSQRT/GETEXP/EXP2 ISD opcodes into SAE and current direction nodes...
Craig Topper [Mon, 11 Mar 2019 04:36:57 +0000 (04:36 +0000)]
[X86] Split RCP28/RSQRT/GETEXP/EXP2 ISD opcodes into SAE and current direction nodes. Remove rounding mode operand.

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

5 years ago[X86] Rename _RND versions of RANGE/REDUCE/GETMANT/RDNSCALE ISD opcodes to _SAE....
Craig Topper [Mon, 11 Mar 2019 04:36:55 +0000 (04:36 +0000)]
[X86] Rename _RND versions of RANGE/REDUCE/GETMANT/RDNSCALE ISD opcodes to _SAE. Remove SAE operand.

No need to explicitly store it and match it during isel.

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

5 years ago[X86] Rename X86ISD::CVTPH2PS_RND to CVTPH2PS_SAE. Remove SAE operand.
Craig Topper [Mon, 11 Mar 2019 04:36:53 +0000 (04:36 +0000)]
[X86] Rename X86ISD::CVTPH2PS_RND to CVTPH2PS_SAE. Remove SAE operand.

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

5 years ago[X86] Rename the CVTT*_RND ISD nodes to _SAE and remove the SAE operand. Split VFPROU...
Craig Topper [Mon, 11 Mar 2019 04:36:51 +0000 (04:36 +0000)]
[X86] Rename the CVTT*_RND ISD nodes to _SAE and remove the SAE operand. Split VFPROUNDS_RND/VFPEXT(S)_RND into versions without rounding operand.

For VFPEXT(S) we only need current rounding mode and an SAE version. Neither need extra operand.

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

5 years ago[X86] Rename X86ISD::CMPM_RND and X86ISD::FSETCCM_RND to _SAE instead of _RND. Remove...
Craig Topper [Mon, 11 Mar 2019 04:36:49 +0000 (04:36 +0000)]
[X86] Rename X86ISD::CMPM_RND and X86ISD::FSETCCM_RND to _SAE instead of _RND. Remove rounding operand.

The operand could only be the SAE encoding so no need to include it.

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

5 years ago[X86] Split the VFIXUPIMM/VFIXUPIMMS nodes into a current rounding mode and SAE ISD...
Craig Topper [Mon, 11 Mar 2019 04:36:47 +0000 (04:36 +0000)]
[X86] Split the VFIXUPIMM/VFIXUPIMMS nodes into a current rounding mode and SAE ISD opcode.

Remove matching of FROUND_CURRENT and FROUND_NO_EXC for these nodes from isel table.

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

5 years ago[X86] Begin removing matching of FROUND_CURRENT and FROUND_NO_EXC from isel tables.
Craig Topper [Mon, 11 Mar 2019 04:36:44 +0000 (04:36 +0000)]
[X86] Begin removing matching of FROUND_CURRENT and FROUND_NO_EXC from isel tables.

Instead I plan to have dedicated nodes for FROUND_CURRENT and FROUND_NO_EXC.

This patch starts with FADDS/FSUBS/FMULS/FDIVS/FMAXS/FMINS/FSQRTS.

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

5 years ago[PowerPC] Remove the override of isMachineVerifierClean() to open machine verifier
Zi Xuan Wu [Mon, 11 Mar 2019 03:31:09 +0000 (03:31 +0000)]
[PowerPC] Remove the override of isMachineVerifierClean() to open machine verifier
After fix all asserts found by machine verifier in PowerPC target with following patches,
we can activate machine verifier as default.

rL293769, rL348566, rL349030, rL349029, rL350113, rL350111,
rL350799, rL350165, rL355378, rL352174, rL354762, rL350115

It's also found in PR#27456, https://bugs.llvm.org/show_bug.cgi?id=27456

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

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

5 years agoAdd test case for add to sub post legalization. NFC
Amaury Sechet [Mon, 11 Mar 2019 01:25:48 +0000 (01:25 +0000)]
Add test case for add to sub post legalization. NFC

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

5 years ago[X86] Remove unneeded isel patterns from VCVTSI2SDZ and VCVTUSI2SDZ. NFC
Craig Topper [Mon, 11 Mar 2019 01:20:38 +0000 (01:20 +0000)]
[X86] Remove unneeded isel patterns from VCVTSI2SDZ and VCVTUSI2SDZ. NFC

We had patterns using X86ISD::SCALAR_SINT_TO_FP_RND/SCALAR_UINT_TO_FP_RND for
these instructions. There's nothing to round. Instead, we use a regular
sint_to_fp/uint_to_fp and a movsd as the pattern for these.

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

5 years ago[X86] Remove VCVTSI2SDZrrb_Int as it shouldn't exist.
Craig Topper [Mon, 11 Mar 2019 01:20:37 +0000 (01:20 +0000)]
[X86] Remove VCVTSI2SDZrrb_Int as it shouldn't exist.

This would convert a signed 32-bit integer to double precision with rounding. But there's nothing to round.

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

5 years agoRemove redundant extractBooleanFlip argument. NFC
Amaury Sechet [Mon, 11 Mar 2019 00:37:01 +0000 (00:37 +0000)]
Remove redundant extractBooleanFlip argument. NFC

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

5 years ago[x86] add x86-specific opcodes to extractelement scalarization list
Sanjay Patel [Sun, 10 Mar 2019 18:56:21 +0000 (18:56 +0000)]
[x86] add x86-specific opcodes to extractelement scalarization list

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

5 years ago[CGP] fix comments; NFC
Sanjay Patel [Sun, 10 Mar 2019 18:42:30 +0000 (18:42 +0000)]
[CGP] fix comments; NFC

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

5 years ago[X86] Remove unused variable. NFC
Craig Topper [Sun, 10 Mar 2019 17:36:41 +0000 (17:36 +0000)]
[X86] Remove unused variable. NFC

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

5 years ago[X86] Make lowering of intrinsics with rounding mode stricter so that only valid...
Craig Topper [Sun, 10 Mar 2019 17:20:45 +0000 (17:20 +0000)]
[X86] Make lowering of intrinsics with rounding mode stricter so that only valid rounding modes are lowered. Update tests accordingly

Many of our tests were not using valid rounding mode immediates. Clang verifies this in the frontend when it creates the intrinsics from builtins, but the backend would still lower invalid immediates.

With this change we will now leave them as intrinsics if the immediate is invalid. This will cause an isel selection failure.

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

5 years ago[X86] Remove dead code from the handler for INTR_TYPE_SCALAR_MASK_RM.
Craig Topper [Sun, 10 Mar 2019 17:20:42 +0000 (17:20 +0000)]
[X86] Remove dead code from the handler for INTR_TYPE_SCALAR_MASK_RM.

The code in here handles nodes with 6 or 7 operands. But only the 6 operand case is ever used these days.

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

5 years ago[AArch64] Add tests for saddsat/ssubsat; NFC
Nikita Popov [Sun, 10 Mar 2019 12:21:36 +0000 (12:21 +0000)]
[AArch64] Add tests for saddsat/ssubsat; NFC

Signed versions of the existing unsigned tests.

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

5 years ago[TableGen] Make CheckImmAllOnesVMatcher and CheckImmAllZerosVMatcher contradictory...
Craig Topper [Sun, 10 Mar 2019 06:44:09 +0000 (06:44 +0000)]
[TableGen] Make CheckImmAllOnesVMatcher and CheckImmAllZerosVMatcher contradictory matchers.

This improves X86 factoring a little bit.

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

5 years agoRecommit r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAll...
Craig Topper [Sun, 10 Mar 2019 05:21:52 +0000 (05:21 +0000)]
Recommit r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZerosV/immAllOnesV. Remove bitcasts from X86 patterns that are no longer necessary."

Includes a fix to emit a CheckOpcode for build_vector when immAllZerosV/immAllOnesV is used as a pattern root. This means it can't be used to look through bitcasts when used as a root, but that's probably ok. This extra CheckOpcode will ensure that the first match in the isel table will be a SwitchOpcode which is needed by the caching optimization in the ISel Matcher.

Original commit message:

Previously we had build_vector PatFrags that called ISD::isBuildVectorAllZeros/Ones. Internally the ISD::isBuildVectorAllZeros/Ones look through bitcasts, but we aren't able to take advantage of that in isel. Instead of we have to canonicalize the types of the all zeros/ones build_vectors and insert bitcasts. Then we have to pattern match those exact bitcasts.

By emitting specific matchers for these 2 nodes, we can make isel look through any bitcasts without needing to explicitly match them. We should also be able to remove the canonicalization to vXi32 from lowering, but I've left that for a follow up.

This removes something like 40,000 bytes from the X86 isel table.

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

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

5 years ago[runtime] Use --strip-all rather than --strip-sections
Petr Hosek [Sun, 10 Mar 2019 04:26:54 +0000 (04:26 +0000)]
[runtime] Use --strip-all rather than --strip-sections

We need to preserve section headers for shared libraries.

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

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

5 years ago[git-llvm] Only use --force-interactive when supported
Shoaib Meenai [Sun, 10 Mar 2019 01:34:42 +0000 (01:34 +0000)]
[git-llvm] Only use --force-interactive when supported

The --force-interactive option was introduced in SVN 1.8, and trying to
pass it to older SVN clients causes an error; CentOS 7 includes SVN 1.7,
for example, so this makes `git llvm` not usable out of the box. Older
clients would be interactive by default anyway [1], so just don't pass
the option if it's not supported.

An alternative would be to check the version instead of checking the
help text, but I think directly detecting the presence of the option is
more direct.

[1] http://svn.apache.org/viewvc?view=revision&revision=1424037

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

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

5 years ago[ValueTracking] Move constant range computation into ValueTracking; NFC
Nikita Popov [Sat, 9 Mar 2019 21:17:42 +0000 (21:17 +0000)]
[ValueTracking] Move constant range computation into ValueTracking; NFC

InstructionSimplify currently has some code to determine the constant
range of integer instructions for some simple cases. It is used to
simplify icmps.

This change moves the relevant code into ValueTracking as
llvm::computeConstantRange(), so it can also be reused for other
purposes.

In particular this is with the optimization of overflow checks in
mind (ref D59071), where constant ranges cover some cases that
known bits don't.

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

5 years ago[ARM] Use non-constant operand in umulo-32.ll; NFC
Nikita Popov [Sat, 9 Mar 2019 13:43:21 +0000 (13:43 +0000)]
[ARM] Use non-constant operand in umulo-32.ll; NFC

Currently the store+load is folded and both operands of the umulo
end up being constants. To avoid this getting folded away entirely,
make sure at least one operand is non-constant.

Also remove some allocas which don't seem relevant to the test.

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