]> granicus.if.org Git - llvm/log
llvm
5 years ago[lit] Leverage argparse features to remove some code
Julian Lettner [Thu, 10 Oct 2019 18:03:37 +0000 (18:03 +0000)]
[lit] Leverage argparse features to remove some code

Reviewed By: rnk, serge-sans-paille

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

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

5 years agoFix test to avoid check-not matching the temp file absolute path
Reid Kleckner [Thu, 10 Oct 2019 18:01:27 +0000 (18:01 +0000)]
Fix test to avoid check-not matching the temp file absolute path

Fix for PR43636

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

5 years ago[lit] Move argument parsing/validation to separate file
Julian Lettner [Thu, 10 Oct 2019 17:58:38 +0000 (17:58 +0000)]
[lit] Move argument parsing/validation to separate file

Reviewed By: serge-sans-paille

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

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

5 years agoUnbreak llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast buildbot.
Greg Clayton [Thu, 10 Oct 2019 17:52:33 +0000 (17:52 +0000)]
Unbreak  llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast buildbot.

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

5 years ago[DAGCombiner] fold select-of-constants to shift
Sanjay Patel [Thu, 10 Oct 2019 17:52:02 +0000 (17:52 +0000)]
[DAGCombiner] fold select-of-constants to shift

This reverses the scalar canonicalization proposed in D63382.

Pre: isPowerOf2(C1)
%r = select i1 %cond, i32 C1, i32 0
=>
%z = zext i1 %cond to i32
%r = shl i32 %z, log2(C1)

https://rise4fun.com/Alive/Z50

x86 already tries to fold this pattern, but it isn't done
uniformly, so we still see a diff. AArch64 probably should
enable the TLI hook to benefit too, but that's a follow-on.

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

5 years agoUnbreak windows buildbots.
Greg Clayton [Thu, 10 Oct 2019 17:49:33 +0000 (17:49 +0000)]
Unbreak windows buildbots.

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

5 years agogn build: restore tablegen restat optimization after r373664
Nico Weber [Thu, 10 Oct 2019 17:47:18 +0000 (17:47 +0000)]
gn build: restore tablegen restat optimization after r373664

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

5 years ago[lit] Extend internal diff to support -U
Joel E. Denny [Thu, 10 Oct 2019 17:40:12 +0000 (17:40 +0000)]
[lit] Extend internal diff to support -U

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff -U1 file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-U` as a command-line option.  This patch adds `-U`
support.

Reviewed By: rnk

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

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

5 years agogn build: merge r374381 more (effectively a no-op)
Nico Weber [Thu, 10 Oct 2019 17:40:00 +0000 (17:40 +0000)]
gn build: merge r374381 more (effectively a no-op)

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

5 years ago[lit] Extend internal diff to support `-` argument
Joel E. Denny [Thu, 10 Oct 2019 17:39:57 +0000 (17:39 +0000)]
[lit] Extend internal diff to support `-` argument

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option.  This patch adds support for
`-` to mean stdin.

Reviewed By: probinson, rnk

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

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

5 years ago[lit] Clean up internal diff's encoding handling
Joel E. Denny [Thu, 10 Oct 2019 17:39:41 +0000 (17:39 +0000)]
[lit] Clean up internal diff's encoding handling

As suggested by rnk at D67643#1673043, instead of reading files
multiple times until an appropriate encoding is found, read them once
as binary, and then try to decode what was read.

For python >= 3.5, don't fail when attempting to decode the
`diff_bytes` output in order to print it.

Finally, add some tests for encoding handling.

Reviewed By: rnk

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

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

5 years ago[lit] Make internal diff work in pipelines
Joel E. Denny [Thu, 10 Oct 2019 17:39:24 +0000 (17:39 +0000)]
[lit] Make internal diff work in pipelines

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
 # RUN: not diff file1 file2 | FileCheck %s
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.  A
follow-up patch will implement `-` to mean stdin.

Reviewed By: probinson, stella.stamenova

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

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

5 years agogn build: Merge r374381
GN Sync Bot [Thu, 10 Oct 2019 17:14:20 +0000 (17:14 +0000)]
gn build: Merge r374381

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

5 years agoAdd GsymCreator and GsymReader.
Greg Clayton [Thu, 10 Oct 2019 17:10:11 +0000 (17:10 +0000)]
Add GsymCreator and GsymReader.

This patch adds the ability to create GSYM files with GsymCreator, and read them with GsymReader. Full testing has been added for both new classes.

This patch differs from the original patch https://reviews.llvm.org/D53379 in that is uses a StringTableBuilder class from llvm instead of a custom version. Support for big and little endian files has been added. If the endianness matches the current host, we use efficient extraction for the header, address table and address info offset tables.

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

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

5 years ago[dsymutil] Move CommonSymbols.clear() in resetParserState.
Jonas Devlieghere [Thu, 10 Oct 2019 16:37:38 +0000 (16:37 +0000)]
[dsymutil] Move CommonSymbols.clear() in resetParserState.

This seems like a more natural place to clear the vector, especially
since this method is clearing other data structures as well.

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

5 years ago[ARM] VQSUB instruction
David Green [Thu, 10 Oct 2019 16:34:30 +0000 (16:34 +0000)]
[ARM] VQSUB instruction

Same as VQADD, VQSUB can be selected from llvm.ssub.sat intrinsics.

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

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

5 years ago[Codegen] Alter the default promotion for saturating adds and subs
David Green [Thu, 10 Oct 2019 16:04:49 +0000 (16:04 +0000)]
[Codegen] Alter the default promotion for saturating adds and subs

The default promotion for the add_sat/sub_sat nodes currently does:
   1. ANY_EXTEND iN to iM
   2. SHL by M-N
   3. [US][ADD|SUB]SAT
   4. L/ASHR by M-N
If the promoted add_sat or sub_sat node is not legal, this can produce code
that effectively does a lot of shifting (and requiring large constants to be
materialised) just to use the overflow flag. It is simpler to just do the
saturation manually, using the higher bitwidth addition and a min/max against
the saturating bounds. That is what this patch attempts to do.

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

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

5 years agoFix assertions disabled builds after rL374367
Kadir Cetinkaya [Thu, 10 Oct 2019 16:04:45 +0000 (16:04 +0000)]
Fix assertions disabled builds after rL374367

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

5 years ago[DAGCombiner] reduce code duplication; NFC
Sanjay Patel [Thu, 10 Oct 2019 15:38:29 +0000 (15:38 +0000)]
[DAGCombiner] reduce code duplication; NFC

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

5 years ago[Alignment][NFC] Use llv::Align in GISelKnownBits
Guillaume Chatelet [Thu, 10 Oct 2019 15:38:22 +0000 (15:38 +0000)]
[Alignment][NFC] Use llv::Align in GISelKnownBits

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[BPF] Remove relocation for patchable externs
Yonghong Song [Thu, 10 Oct 2019 15:33:09 +0000 (15:33 +0000)]
[BPF] Remove relocation for patchable externs

Previously, patchable extern relocations are introduced to patch
external variables used for multi versioning in
compile once, run everywhere use case. The load instruction
will be converted into a move with an patchable immediate
which can be changed by bpf loader on the host.

The kernel verifier has evolved and is able to load
and propagate constant values, so compiler relocation
becomes unnecessary. This patch removed codes related to this.

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

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

5 years ago[AMDGPU] Fixed dpp_combine.mir with expensive checks. NFC.
Stanislav Mekhanoshin [Thu, 10 Oct 2019 15:28:52 +0000 (15:28 +0000)]
[AMDGPU] Fixed dpp_combine.mir with expensive checks. NFC.

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

5 years agoFix Wdocumentation warnings. NFCI.
Simon Pilgrim [Thu, 10 Oct 2019 15:25:16 +0000 (15:25 +0000)]
Fix Wdocumentation warnings. NFCI.

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

5 years ago[MCA] Show aggregate over Average Wait times for the whole snippet (PR43219)
Roman Lebedev [Thu, 10 Oct 2019 14:46:21 +0000 (14:46 +0000)]
[MCA] Show aggregate over Average Wait times for the whole snippet (PR43219)

Summary:
As disscused in https://bugs.llvm.org/show_bug.cgi?id=43219,
i believe it may be somewhat useful to show //some// aggregates
over all the sea of statistics provided.

Example:
```
Average Wait times (based on the timeline view):
[0]: Executions
[1]: Average time spent waiting in a scheduler's queue
[2]: Average time spent waiting in a scheduler's queue while ready
[3]: Average time elapsed from WB until retire stage

      [0]    [1]    [2]    [3]
0.     3     1.0    1.0    4.7       vmulps     %xmm0, %xmm1, %xmm2
1.     3     2.7    0.0    2.3       vhaddps    %xmm2, %xmm2, %xmm3
2.     3     6.0    0.0    0.0       vhaddps    %xmm3, %xmm3, %xmm4
       3     3.2    0.3    2.3       <total>
```
I.e. we average the averages.

Reviewers: andreadb, mattd, RKSimon

Reviewed By: andreadb

Subscribers: gbedwell, arphaman, llvm-commits

Tags: #llvm

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

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

5 years agoRevert "[FileCheck] Implement --ignore-case option."
Dmitri Gribenko [Thu, 10 Oct 2019 14:27:14 +0000 (14:27 +0000)]
Revert "[FileCheck] Implement --ignore-case option."

This reverts commit r374339. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066

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

5 years agoRevert "[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj)."
Dmitri Gribenko [Thu, 10 Oct 2019 14:26:54 +0000 (14:26 +0000)]
Revert "[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj)."

This reverts commit r374343. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066

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

5 years agoRevert "Fix OCaml/core.ml fneg check"
Dmitri Gribenko [Thu, 10 Oct 2019 14:16:58 +0000 (14:16 +0000)]
Revert "Fix OCaml/core.ml fneg check"

This reverts commit r374346. It attempted to fix OCaml tests, but is
does not actually fix them.

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

5 years ago[X86] combineFMA - Convert to use isNegatibleForFree/GetNegatedExpression.
Simon Pilgrim [Thu, 10 Oct 2019 14:14:12 +0000 (14:14 +0000)]
[X86] combineFMA - Convert to use isNegatibleForFree/GetNegatedExpression.

Split off from D67557.

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

5 years agoFix OCaml/core.ml fneg check (try 2)
Simon Pilgrim [Thu, 10 Oct 2019 14:13:55 +0000 (14:13 +0000)]
Fix OCaml/core.ml fneg check (try 2)

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

5 years agoRevert "[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator"
Dmitri Gribenko [Thu, 10 Oct 2019 14:13:54 +0000 (14:13 +0000)]
Revert "[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator"

This reverts commit r374240. It broke OCaml tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19014

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

5 years ago[X86] combineFMADDSUB - Convert to use isNegatibleForFree/GetNegatedExpression.
Simon Pilgrim [Thu, 10 Oct 2019 13:46:44 +0000 (13:46 +0000)]
[X86] combineFMADDSUB - Convert to use isNegatibleForFree/GetNegatedExpression.

Split off from D67557, fixes the compile time regression mentioned in rL372756

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

5 years agoRevert "[test] Use system locale for mri-utf8.test"
Thomas Preud'homme [Thu, 10 Oct 2019 13:39:12 +0000 (13:39 +0000)]
Revert "[test] Use system locale for mri-utf8.test"

This reverts commit r374318 / b6f1d1fa0e3ee0e25f22414bf97c05276b934507.

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

5 years agoRevert "[AMDGPU] Run `unreachable-mbb-elimination` after isel to clean up PHIs."
Jay Foad [Thu, 10 Oct 2019 13:34:31 +0000 (13:34 +0000)]
Revert "[AMDGPU] Run `unreachable-mbb-elimination` after isel to clean up PHIs."

Summary:
This has been superseded by "[AMDGPU]: PHI Elimination hooks added for custom COPY insertion."

This reverts the code changes from commit 53f967f2bdb6aa7b08596880c3689d1ecad6f0ff
but keeps the test case.

Reviewers: hliao, arsenm, tpr, dstuttard

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoFix OCaml/core.ml fneg check
Simon Pilgrim [Thu, 10 Oct 2019 13:29:47 +0000 (13:29 +0000)]
Fix OCaml/core.ml fneg check

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

5 years ago[DAG][X86] Add isNegatibleForFree/GetNegatedExpression override placeholders. NFCI.
Simon Pilgrim [Thu, 10 Oct 2019 13:29:35 +0000 (13:29 +0000)]
[DAG][X86] Add isNegatibleForFree/GetNegatedExpression override placeholders. NFCI.

Continuing to undo the rL372756 reversion.

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

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

5 years ago[llvm-readelf] - Do not enter an infinite loop when printing histogram.
George Rimar [Thu, 10 Oct 2019 13:26:26 +0000 (13:26 +0000)]
[llvm-readelf] - Do not enter an infinite loop when printing histogram.

This is similar to D68086.
We are entering an infinite loop when dumping a histogram for a specially crafted
.hash section with a loop in a chain.

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

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

5 years ago[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).
Kai Nacke [Thu, 10 Oct 2019 13:24:00 +0000 (13:24 +0000)]
[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).

The command `od -t x` is used to dump data in hex format.
The LIT tests assumes that the hex characters are in lowercase.
However, there are also platforms which use uppercase letter.

To solve this issue the tests are updated to use the new
`--ignore-case` option of FileCheck.

Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson

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

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

5 years ago[DAGCombine] Match more patterns for half word bswap
Amaury Sechet [Thu, 10 Oct 2019 13:20:10 +0000 (13:20 +0000)]
[DAGCombine] Match more patterns for half word bswap

Summary: It ensures that the bswap is generated even when a part of the subtree already matches a bswap transform.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[FileCheck] Implement --ignore-case option.
Kai Nacke [Thu, 10 Oct 2019 13:15:41 +0000 (13:15 +0000)]
[FileCheck] Implement --ignore-case option.

The FileCheck utility is enhanced to support a `--ignore-case`
option. This is useful in cases where the output of Unix tools
differs in case (e.g. case not specified by Posix).

Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay

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

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

5 years ago[LV][NFC] Factor out calculation of "best" estimated trip count.
Florian Hahn [Thu, 10 Oct 2019 13:07:01 +0000 (13:07 +0000)]
[LV][NFC] Factor out calculation of "best" estimated trip count.

This is just small refactoring to minimize changes in upcoming patch.
In the next path I'm going to introduce changes into heuristic for vectorization of "tiny trip count" loops.

Patch by Evgeniy Brevnov <evgueni.brevnov@gmail.com>

Reviewers: hsaito, Ayal, fhahn, reames

Reviewed By: hsaito

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

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

5 years agoMinidumpYAML: Add support for the memory info list stream
Pavel Labath [Thu, 10 Oct 2019 13:05:46 +0000 (13:05 +0000)]
MinidumpYAML: Add support for the memory info list stream

Summary:
The implementation is fairly straight-forward and uses the same patterns
as the existing streams. The yaml form does not attempt to preserve the
data in the "gaps" that can be created by setting a larger-than-required
header or entry size in the stream header, because the existing consumer
(lldb) does not make use of the information in the gap in any way, and
attempting to preserve that would make the implementation more
complicated.

Reviewers: amccarth, jhenderson, clayborg

Subscribers: llvm-commits, lldb-commits, markmentovai, zturner, JosephTremoulet

Tags: #llvm

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

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

5 years ago[ARM] VQADD instructions
David Green [Thu, 10 Oct 2019 13:05:04 +0000 (13:05 +0000)]
[ARM] VQADD instructions

This selects MVE VQADD from the vector llvm.sadd.sat or llvm.uadd.sat
intrinsics.

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

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

5 years ago[AArch64][x86] add tests for (v)select bit magic; NFC
Sanjay Patel [Thu, 10 Oct 2019 12:53:24 +0000 (12:53 +0000)]
[AArch64][x86] add tests for (v)select bit magic; NFC

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

5 years ago[Alignment][NFC] Make VectorUtils uas llvm::Align
Guillaume Chatelet [Thu, 10 Oct 2019 12:35:04 +0000 (12:35 +0000)]
[Alignment][NFC] Make VectorUtils uas llvm::Align

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, rogfer01, llvm-commits

Tags: #llvm

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

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

5 years ago[ADR] ArrayRefTest: disable SizeTSizedOperations test - it's UB.
Roman Lebedev [Thu, 10 Oct 2019 12:22:33 +0000 (12:22 +0000)]
[ADR] ArrayRefTest: disable SizeTSizedOperations test - it's UB.

This test is not defined.

FAIL: LLVM-Unit :: ADT/./ADTTests/ArrayRefTest.SizeTSizedOperations (178 of 33926)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/ArrayRefTest.SizeTSizedOperations' FAILED ********************
Note: Google Test filter = ArrayRefTest.SizeTSizedOperations
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ArrayRefTest
[ RUN      ] ArrayRefTest.SizeTSizedOperations
/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32: runtime error: applying non-zero offset 9223372036854775806 to null pointer
    #0 0x5ae8dc in llvm::ArrayRef<char>::slice(unsigned long, unsigned long) const /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32
    #1 0x5ae44c in (anonymous namespace)::ArrayRefTest_SizeTSizedOperations_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/unittests/ADT/ArrayRefTest.cpp:85:3
    #2 0x928a96 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2474:5
    #3 0x929793 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #4 0x92a152 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #5 0x9319d2 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #6 0x931416 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4257:10
    #7 0x920ac3 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #8 0x920ac3 in main /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50:10
    #9 0x7f66135b72e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #10 0x472c19 in _start (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/unittests/ADT/ADTTests+0x472c19)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32 in

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

5 years agoFix -Wparentheses warning. NFCI.
Simon Pilgrim [Thu, 10 Oct 2019 12:21:52 +0000 (12:21 +0000)]
Fix -Wparentheses warning. NFCI.

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

5 years ago[Mips] Fix 374055
Mirko Brkusanin [Thu, 10 Oct 2019 12:02:14 +0000 (12:02 +0000)]
[Mips] Fix 374055

EXPENSIVE_CHECKS build was failing on new test.
This is fixed by marking $ra register as undef.
Test now has -verify-machineinstrs to check for operand flags.

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

5 years ago[test] Use system locale for mri-utf8.test
Thomas Preud'homme [Thu, 10 Oct 2019 11:48:30 +0000 (11:48 +0000)]
[test] Use system locale for mri-utf8.test

Summary:
llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be
installed for its last RUN line to work. If not installed, the unicode
string gets encoded (interpreted) as ascii which fails since the most
significant byte is non zero. This commit changes the test to only rely
on the system being able to encode the pound sign in its default
encoding (e.g. UTF-16 for Microsoft Windows) by always opening the file
via input/output redirection. This avoids forcing a given locale to be
present and supported. A Byte Order Mark is also added to help
recognizing the encoding of the file and its endianness.

Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

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

5 years ago[IfCvt][ARM] Optimise diamond if-conversion for code size
Oliver Stannard [Thu, 10 Oct 2019 09:58:28 +0000 (09:58 +0000)]
[IfCvt][ARM] Optimise diamond if-conversion for code size

Currently, the heuristics the if-conversion pass uses for diamond if-conversion
are based on execution time, with no consideration for code size. This adds a
new set of heuristics to be used when optimising for code size.

This is mostly target-independent, because the if-conversion pass can
see the code size of the instructions which it is removing. For thumb,
there are a few passes (insertion of IT instructions, selection of
narrow branches, and selection of CBZ instructions) which are run after
if conversion and affect these heuristics, so I've added target hooks to
better predict the code-size effect of a proposed if-conversion.

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

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

5 years ago[UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour
Roman Lebedev [Thu, 10 Oct 2019 09:25:02 +0000 (09:25 +0000)]
[UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

Summary:
Quote from http://eel.is/c++draft/expr.add#4:
```
4     When an expression J that has integral type is added to or subtracted
      from an expression P of pointer type, the result has the type of P.
(4.1) If P evaluates to a null pointer value and J evaluates to 0,
      the result is a null pointer value.
(4.2) Otherwise, if P points to an array element i of an array object x with n
      elements ([dcl.array]), the expressions P + J and J + P
      (where J has the value j) point to the (possibly-hypothetical) array
      element i+j of x if 0≤i+j≤n and the expression P - J points to the
      (possibly-hypothetical) array element i−j of x if 0≤i−j≤n.
(4.3) Otherwise, the behavior is undefined.
```

Therefore, as per the standard, applying non-zero offset to `nullptr`
(or making non-`nullptr` a `nullptr`, by subtracting pointer's integral value
from the pointer itself) is undefined behavior. (*if* `nullptr` is not defined,
i.e. e.g. `-fno-delete-null-pointer-checks` was *not* specified.)

To make things more fun, in C (6.5.6p8), applying *any* offset to null pointer
is undefined, although Clang front-end pessimizes the code by not lowering
that info, so this UB is "harmless".

Since rL369789 (D66608 `[InstCombine] icmp eq/ne (gep inbounds P, Idx..), null -> icmp eq/ne P, null`)
LLVM middle-end uses those guarantees for transformations.
If the source contains such UB's, said code may now be miscompiled.
Such miscompilations were already observed:
* https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190826/687838.html
* https://github.com/google/filament/pull/1566

Surprisingly, UBSan does not catch those issues
... until now. This diff teaches UBSan about these UB's.

`getelementpointer inbounds` is a pretty frequent instruction,
so this does have a measurable impact on performance;
I've addressed most of the obvious missing folds (and thus decreased the performance impact by ~5%),
and then re-performed some performance measurements using my [[ https://github.com/darktable-org/rawspeed | RawSpeed ]] benchmark:
(all measurements done with LLVM ToT, the sanitizer never fired.)
* no sanitization vs. existing check: average `+21.62%` slowdown
* existing check vs. check after this patch: average `22.04%` slowdown
* no sanitization vs. this patch: average `48.42%` slowdown

Reviewers: vsk, filcab, rsmith, aaron.ballman, vitalybuka, rjmccall, #sanitizers

Reviewed By: rsmith

Subscribers: kristof.beyls, nickdesaulniers, nikic, ychen, dtzWill, xbolva00, dberris, arphaman, rupprecht, reames, regehr, llvm-commits, cfe-commits

Tags: #clang, #sanitizers, #llvm

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

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

5 years ago[update_cc_test_checks] Support 'clang | opt | FileCheck'
Simon Tatham [Thu, 10 Oct 2019 08:25:34 +0000 (08:25 +0000)]
[update_cc_test_checks] Support 'clang | opt | FileCheck'

Some clang lit tests use a pipeline of the form

// RUN: %clang [args] -O0 %s | opt [specific optimizations] | FileCheck %s

to make the expected test output depend on as few optimization phases
as possible, for stability. But when you write a RUN line of this
form, you lose the ability to use update_cc_test_checks.py to
automatically generate the expected output, because it only supports
two-stage pipelines consisting of '%clang | FileCheck' (or %clang_cc1).

This change extends the set of supported RUN lines so that pipelines
with an invocation of `opt` in the middle can still be automatically
handled.

To implement it, I've adjusted `get_function_body()` so that it can
cope with an arbitrary sequence of intermediate pipeline commands. But
the code that decides which RUN lines to consider is more
conservative: it only adds clang | opt | FileCheck to the set of
supported lines, because I didn't want to accidentally include some
other kind of line that doesn't output IR at all.

(Also in this commit is the minimal change to make this script work at
all, after r373912 added an extra parameter to `add_ir_checks`.)

Reviewers: MaskRay, xbolva00

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Use SGPR_128 instead of SReg_128 for vregs
Matt Arsenault [Thu, 10 Oct 2019 07:11:33 +0000 (07:11 +0000)]
AMDGPU: Use SGPR_128 instead of SReg_128 for vregs

SGPR_128 only includes the real allocatable SGPRs, and SReg_128 adds
the additional non-allocatable TTMP registers. There's no point in
allocating SReg_128 vregs. This shrinks the size of the classes
regalloc needs to consider, which is usually good.

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

5 years ago[X86] Add test case for trunc_packus_v16i32_v16i8 with avx512vl+avx512bw and prefer...
Craig Topper [Thu, 10 Oct 2019 06:25:00 +0000 (06:25 +0000)]
[X86] Add test case for trunc_packus_v16i32_v16i8 with avx512vl+avx512bw and prefer-vector-width=256 and min-legal-vector-width=256. NFC

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

5 years ago[Attributor][NFC] clang format
Johannes Doerfert [Thu, 10 Oct 2019 05:34:21 +0000 (05:34 +0000)]
[Attributor][NFC] clang format

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

5 years ago[Attributor] Handle `null` differently in capture and alias logic
Johannes Doerfert [Thu, 10 Oct 2019 05:33:21 +0000 (05:33 +0000)]
[Attributor] Handle `null` differently in capture and alias logic

Summary:
`null` in the default address space (=AS 0) cannot be captured nor can
it alias anything. We make this clear now as it can be important for
callbacks and other cases later on. In addition, this patch improves the
debug output for noalias deduction.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Merge r374277
GN Sync Bot [Thu, 10 Oct 2019 04:29:49 +0000 (04:29 +0000)]
gn build: Merge r374277

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

5 years agoReland "[TextAPI] Introduce TBDv4"
Cyndy Ishida [Thu, 10 Oct 2019 04:24:44 +0000 (04:24 +0000)]
Reland "[TextAPI] Introduce TBDv4"

Original Patch broke for compilations w/ gcc and exposed asan fail.
This reland repairs those bugs.

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

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

5 years ago[PowerPC] add testcase for ppc loop instr form prep - NFC
Chen Zheng [Thu, 10 Oct 2019 03:00:15 +0000 (03:00 +0000)]
[PowerPC] add testcase for ppc loop instr form prep - NFC

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

5 years agogn build: (manually) merge r374271
Nico Weber [Thu, 10 Oct 2019 02:48:47 +0000 (02:48 +0000)]
gn build: (manually) merge r374271

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

5 years ago[codeview] Try to avoid emitting .cv_loc with line zero
Reid Kleckner [Thu, 10 Oct 2019 01:06:01 +0000 (01:06 +0000)]
[codeview] Try to avoid emitting .cv_loc with line zero

Summary:
Visual Studio doesn't like it while stepping. It kicks you out of the
source view of the file being stepped through and tries to fall back to
the disassembly view.

Fixes PR43530

The fix is incomplete, because it's possible to have a basic block with
no source locations at all. In this case, we don't emit a .cv_loc, but
that will result in wrong stepping behavior in the debugger if the
layout predecessor of the location-less BB has an unrelated source
location. We could try harder to find a valid location that dominates or
post-dominates the current BB, but in general it's a dataflow problem,
and one still might not exist. I left a FIXME about this.

As an alternative, we might want to consider having the middle-end check
if its emitting codeview and get it to stop using line zero.

Reviewers: akhuang

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoConservatively add volatility and atomic checks in a few places
Philip Reames [Wed, 9 Oct 2019 23:43:33 +0000 (23:43 +0000)]
Conservatively add volatility and atomic checks in a few places

As background, starting in D66309, I'm working on support unordered atomics analogous to volatile flags on normal LoadSDNode/StoreSDNodes for X86.

As part of that, I spent some time going through usages of LoadSDNode and StoreSDNode looking for cases where we might have missed a volatility check or need an atomic check. I couldn't find any cases that clearly miscompile - i.e. no test cases - but a couple of pieces in code loop suspicious though I can't figure out how to exercise them.

This patch adds defensive checks and asserts in the places my manual audit found. If anyone has any ideas on how to either a) disprove any of the checks, or b) hit the bug they might be fixing, I welcome suggestions.

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

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

5 years agogn build: Merge r374245
GN Sync Bot [Wed, 9 Oct 2019 23:10:49 +0000 (23:10 +0000)]
gn build: Merge r374245

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

5 years ago[WebAssembly] Fix tests missed in rL374235
Thomas Lively [Wed, 9 Oct 2019 23:06:38 +0000 (23:06 +0000)]
[WebAssembly] Fix tests missed in rL374235

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

5 years agoAMDGPU: Don't fold copies to physregs
Matt Arsenault [Wed, 9 Oct 2019 22:51:42 +0000 (22:51 +0000)]
AMDGPU: Don't fold copies to physregs

In a future patch, this will help cleanup m0 handling.

The register coalescer handles copies from a register that
materializes an immediate, but doesn't handle move immediates
itself. The virtual register uses will often be allocated to the same
register, so there end up being no real copy.

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

5 years agoAMDGPU/GlobalISel: Fix crash on wide constant load with VGPR pointer
Matt Arsenault [Wed, 9 Oct 2019 22:44:49 +0000 (22:44 +0000)]
AMDGPU/GlobalISel: Fix crash on wide constant load with VGPR pointer

This was ignoring the register bank of the input pointer, and
isUniformMMO seems overly aggressive.

This will now conservatively assume a VGPR in cases where the incoming
bank hasn't been determined yet (i.e. is from a loop phi).

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

5 years agoAMDGPU: Relax register classes used
Matt Arsenault [Wed, 9 Oct 2019 22:44:48 +0000 (22:44 +0000)]
AMDGPU: Relax register classes used

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

5 years agoAMDGPU: Fix typos
Matt Arsenault [Wed, 9 Oct 2019 22:44:47 +0000 (22:44 +0000)]
AMDGPU: Fix typos

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

5 years agoGlobalISel: Implement fewerElementsVector for G_BUILD_VECTOR
Matt Arsenault [Wed, 9 Oct 2019 22:44:43 +0000 (22:44 +0000)]
GlobalISel: Implement fewerElementsVector for G_BUILD_VECTOR

Turn it into a G_CONCAT_VECTORS of G_BUILD_VECTOR.

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

5 years agogn build: (manually) merge r374219
Nico Weber [Wed, 9 Oct 2019 22:22:36 +0000 (22:22 +0000)]
gn build: (manually) merge r374219

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

5 years ago[GISel] Refactor and split PatternMatchTest. NFC
Marcello Maggioni [Wed, 9 Oct 2019 22:10:10 +0000 (22:10 +0000)]
[GISel] Refactor and split PatternMatchTest. NFC

Split the ConstantFold part into a separate file and
make it use the fixture GISelMITest.

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

5 years ago[InstCombine] Fix PR43617
Evandro Menezes [Wed, 9 Oct 2019 22:03:23 +0000 (22:03 +0000)]
[InstCombine] Fix PR43617

Check for `nullptr` before inspecting composite function.

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

5 years ago[AMDGPU] Fixed dpp combine of VOP1
Stanislav Mekhanoshin [Wed, 9 Oct 2019 22:02:58 +0000 (22:02 +0000)]
[AMDGPU] Fixed dpp combine of VOP1

If original instruction did not have source modifiers they were
not added to the new DPP instruction as well, even if needed.

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

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

5 years ago[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator
Cameron McInally [Wed, 9 Oct 2019 21:52:15 +0000 (21:52 +0000)]
[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator

Also update Clang to call Builder.CreateFNeg(...) for UnaryMinus.

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

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

5 years ago[WebAssembly] Make returns variadic
Thomas Lively [Wed, 9 Oct 2019 21:42:08 +0000 (21:42 +0000)]
[WebAssembly] Make returns variadic

Summary:
This is necessary and sufficient to get simple cases of multiple
return working with multivalue enabled. More complex cases will
require block and loop signatures to be generalized to potentially be
type indices as well.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

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

5 years ago[SampleFDO] Add indexing for function profiles so they can be loaded on demand
Wei Mi [Wed, 9 Oct 2019 21:36:03 +0000 (21:36 +0000)]
[SampleFDO] Add indexing for function profiles so they can be loaded on demand
in ExtBinary format

Currently for Text, Binary and ExtBinary format profiles, when we compile a
module with samplefdo, even if there is no function showing up in the profile,
we have to load all the function profiles from the profile input. That is a
waste of compile time.

CompactBinary format profile has already had the support of loading function
profiles on demand. In this patch, we add the support to load profile on
demand for ExtBinary format. It will work no matter the sections in ExtBinary
format profile are compressed or not. Experiment shows it reduces the time to
compile a server benchmark by 30%.

When profile remapping and loading function profiles on demand are both used,
extra work needs to be done so that the loading on demand process will take
the name remapping into consideration. It will be addressed in a follow-up
patch.

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

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

5 years agollvm-dwarfdump: Support multiple debug_loclists contributions
David Blaikie [Wed, 9 Oct 2019 21:25:28 +0000 (21:25 +0000)]
llvm-dwarfdump: Support multiple debug_loclists contributions

Also fixing the incorrect "offset" field being computed/printed for each
location list.

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

5 years ago[Docs] Adds section for Additional Topics on Reference page
DeForest Richards [Wed, 9 Oct 2019 21:09:09 +0000 (21:09 +0000)]
[Docs] Adds section for Additional Topics on Reference page

Adds a new section for Additional Topics on the Reference documentation page. Also moves Support Library topic to User Guides page.

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

5 years ago[System Model] [TTI] Define AMDGPUTTIImpl::getST and AMDGPUTTIImpl::getTLI
Vitaly Buka [Wed, 9 Oct 2019 20:48:54 +0000 (20:48 +0000)]
[System Model] [TTI] Define AMDGPUTTIImpl::getST and AMDGPUTTIImpl::getTLI

To fix "infinite recursion" warning.

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

5 years ago[System Model] [TTI] Fix virtual destructor warning
Vitaly Buka [Wed, 9 Oct 2019 20:48:52 +0000 (20:48 +0000)]
[System Model] [TTI] Fix virtual destructor warning

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

5 years ago[Docs] Adds Documentation links to sidebar
DeForest Richards [Wed, 9 Oct 2019 20:26:13 +0000 (20:26 +0000)]
[Docs] Adds Documentation links to sidebar

Adds links to Getting Started/Tutorials, User Guides, and Reference documentation pages to sidebar. Also adds a new section for LLVM IR on the Reference documentation page.

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

5 years ago[ConstProp] add tests for extractelement with undef index; NFC
Sanjay Patel [Wed, 9 Oct 2019 20:14:17 +0000 (20:14 +0000)]
[ConstProp] add tests for extractelement with undef index; NFC

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

5 years ago[AMDGPU] Use math constants defined in MathExtras (NFC)
Evandro Menezes [Wed, 9 Oct 2019 20:00:43 +0000 (20:00 +0000)]
[AMDGPU] Use math constants defined in MathExtras (NFC)

Use the the new math constants in `MathExtras.h`.

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

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

5 years ago[Support] Add mathematical constants
Evandro Menezes [Wed, 9 Oct 2019 19:58:01 +0000 (19:58 +0000)]
[Support] Add mathematical constants

Add own version of the mathematical constants from the upcoming C++20 `std::numbers`.

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

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

5 years ago[System Model] [TTI] Update cache and prefetch TTI interfaces
David Greene [Wed, 9 Oct 2019 19:51:48 +0000 (19:51 +0000)]
[System Model] [TTI] Update cache and prefetch TTI interfaces

Re-apply 9fdfb045ae8b/r365676 with fixes for PPC and Hexagon.  This involved
moving defaults from TargetTransformInfoImplBase to MCSubtargetInfo.

Rework the TTI cache and software prefetching APIs to prepare for the
introduction of a general system model.  Changes include:

- Marking existing interfaces const and/or override as appropriate
- Adding comments
- Adding BasicTTIImpl interfaces that delegate to a subtarget
  implementation
- Moving the default TargetTransformInfoImplBase implementation to a default
  MCSubtarget implementation

Only a handful of targets use these interfaces currently: AArch64, Hexagon, PPC
and SystemZ.  AArch64 already has a custom subtarget implementation, so its
custom TTI implementation is migrated to use the new facilities in BasicTTIImpl
to invoke its custom subtarget implementation.  The custom TTI implementations
continue to exist for the other targets with this change.  They are not moved
over to subtarget-based implementations.

The end goal is to have the default subtarget implementation defer to the system
model defined by the target.  With this change, the default MCSubtargetInfo
implementation essentially returns the defaults TargetTransformInfoImplBase used
to return.  Existing users of TTI defaults will hit the defaults now in
MCSubtargetInfo.  Targets that define their own custom TTI implementations won't
use the BasicTTIImpl implementations that route to the subtarget.

Once system models are in place for the targets that use these interfaces, their
custom TTI implementations can be removed.

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

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

5 years agoDebugInfo: Shot in the dark attempt to fix ubsan error from r374122
David Blaikie [Wed, 9 Oct 2019 18:37:13 +0000 (18:37 +0000)]
DebugInfo: Shot in the dark attempt to fix ubsan error from r374122

(specifying an underlying type for the enum might also be suitable - but
this seems better/as good, since there's a clear expectation this can
contain values other than the actual enumerators of this enum)

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

5 years ago[lit] Refactor ProgressDisplay
Julian Lettner [Wed, 9 Oct 2019 18:23:30 +0000 (18:23 +0000)]
[lit] Refactor ProgressDisplay

Move progress display to separate file.  Simplify some code paths.
Decouple from other components via progress callback.  Remove unused
`_Display` class.

Reviewed By: serge-sans-paille

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

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

5 years ago[InstCombine] add another test for gep inbounds; NFC
Sanjay Patel [Wed, 9 Oct 2019 17:52:26 +0000 (17:52 +0000)]
[InstCombine] add another test for gep inbounds; NFC

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

5 years ago[WebAssembly] Add builtin and intrinsic for v8x16.swizzle
Thomas Lively [Wed, 9 Oct 2019 17:45:47 +0000 (17:45 +0000)]
[WebAssembly] Add builtin and intrinsic for v8x16.swizzle

Summary:
This clang builtin and corresponding LLVM intrinsic are necessary to
expose the exact semantics of the underlying WebAssembly instruction
to users. LLVM produces a poison value if the dynamic swizzle indices
are greater than the vector size, but the WebAssembly instruction sets
the corresponding output lane to zero. Users who depend on this
behavior can safely use this builtin.

Depends on D68527.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering
Thomas Lively [Wed, 9 Oct 2019 17:39:19 +0000 (17:39 +0000)]
[WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering

Summary:
Adds the new v8x16.swizzle SIMD instruction as specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#swizzling-using-variable-indices.
In addition to adding swizzles as a candidate lowering in
LowerBUILD_VECTOR, also rewrites and simplifies the lowering to
minimize the number of replace_lanes necessary rather than trying to
minimize code size. This leads to more uses of v128.const instead of
splats, which is expected to increase performance.

The new code will be easier to tune once V8 implements all the vector
construction operations, and it will also be easier to add new
candidate instructions in the future if necessary.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

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

5 years ago[FPEnv][NFC] Change test to conform to strictfp attribute rules.
Kevin P. Neal [Wed, 9 Oct 2019 17:24:56 +0000 (17:24 +0000)]
[FPEnv][NFC] Change test to conform to strictfp attribute rules.

In particular, the function definition is not marked strictfp despite
containing a function marked strictfp. Also, if any function call is marked
strictfp then all function calls in that function must be marked.

This change to move the one strictfp call to a new properly marked function
meets all the new rules.

Tested with a stricter version of D68233.

Reviewed by: spatel
Approved by: spatel
Differential Revision: https://reviews.llvm.org/D68713

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

5 years ago[SLP] respect target register width for GEP vectorization (PR43578)
Sanjay Patel [Wed, 9 Oct 2019 16:32:49 +0000 (16:32 +0000)]
[SLP] respect target register width for GEP vectorization (PR43578)

We failed to account for the target register width (max vector factor)
when vectorizing starting from GEPs. This causes vectorization to
proceed to obviously illegal widths as in:
https://bugs.llvm.org/show_bug.cgi?id=43578

For x86, this also means that SLP can produce rogue AVX or AVX512
code even when the user specifies a narrower vector width.

The AArch64 test in ext-trunc.ll appears to be better using the
narrower width. I'm not exactly sure what getelementptr.ll is trying
to do, but it's testing with "-slp-threshold=-18", so I'm not worried
about those diffs. The x86 test is an over-reduction from SPEC h264;
this patch appears to restore the perf loss caused by SLP when using
-march=haswell.

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

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

5 years ago[AArch64] Ensure no tagged memory is left in the unallocated portion of the
Momchil Velikov [Wed, 9 Oct 2019 16:31:50 +0000 (16:31 +0000)]
[AArch64] Ensure no tagged memory is left in the unallocated portion of the
stack

This patch makes sure that if we tag some memory, we untag that memory before
the function returns/throws via any exit, reachable from the tag operation. For
that we place the untag operation either at:

  a) the lifetime end call for the alloca, if that call post-dominates the
     lifetime start call (where the tag operation is placed), or it (the
     lifetime end call) dominates all reachable exits, otherwise
  b) at the reachable exits

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

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

5 years ago[NFC] Remove files got accidentally upload in llvm-svn 374179
Jason Liu [Wed, 9 Oct 2019 16:24:25 +0000 (16:24 +0000)]
[NFC] Remove files got accidentally upload in llvm-svn 374179

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

5 years ago[AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to Sectio...
Jason Liu [Wed, 9 Oct 2019 16:19:39 +0000 (16:19 +0000)]
[AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to SectionOrLength.

Summary:
According the the XCOFF document,
If
Then
XTY_SD
x_scnlen contains the csect length.
XTY_LD
x_scnlen contains the symbol table index of the containing csect.
XTY_CM
x_scnlen contains the csect length.
XTY_ER
x_scnlen contains 0.

Change the SectionLen member name to SectionOrLength is more reasonable.

Authored By: DiggerLin

Reviewed By: hubert.reinterpretcast

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

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

5 years agoRe-land "[dsymutil] Fix handling of common symbols in multiple object files."
Jonas Devlieghere [Wed, 9 Oct 2019 16:19:13 +0000 (16:19 +0000)]
Re-land "[dsymutil] Fix handling of common symbols in multiple object files."

The original patch got reverted because it hit a long-standing legacy
issue on Windows that prevents files from being named `com`. Thanks
Kristina & Jeremy for pointing this out.

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

5 years ago[MemorySSA] Make the use of moveAllAfterMergeBlocks consistent.
Alina Sbirlea [Wed, 9 Oct 2019 15:54:24 +0000 (15:54 +0000)]
[MemorySSA] Make the use of moveAllAfterMergeBlocks consistent.

Summary:
The rule for the moveAllAfterMergeBlocks API si for all instructions
from `From` to have been moved to `To`, while keeping the CFG edges (and
block terminators) unchanged.
Update all the callsites for moveAllAfterMergeBlocks to follow this.

Pending follow-up: since the same behavior is needed everytime, merge
all callsites into one. The common denominator may be the call to
`MergeBlockIntoPredecessor`.

Resolves PR43569.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

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

5 years agoFix Wdocumentation unknown parameter warning. NFCI.
Simon Pilgrim [Wed, 9 Oct 2019 14:26:09 +0000 (14:26 +0000)]
Fix Wdocumentation unknown parameter warning. NFCI.

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

5 years ago[llvm-exegesis] Ensure that ExecutableFunction are aligned.
Clement Courbet [Wed, 9 Oct 2019 14:25:08 +0000 (14:25 +0000)]
[llvm-exegesis] Ensure that ExecutableFunction are aligned.

Summary: Experiments show that this is the alignment we get (for ELF+Linux), but let's ensure that we have it.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years agoAdd and adjust saturating tests. NFC
David Green [Wed, 9 Oct 2019 14:17:38 +0000 (14:17 +0000)]
Add and adjust saturating tests. NFC

This adds some extra testing to the existing [su][add/sub]_sat X86 and AArch64
tests and adds equivalent tests for ARM.

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

5 years ago[LV] Emitting SCEV checks with OptForSize
Sjoerd Meijer [Wed, 9 Oct 2019 13:19:41 +0000 (13:19 +0000)]
[LV] Emitting SCEV checks with OptForSize

When optimising for size and SCEV runtime checks need to be emitted to check
overflow behaviour, the loop vectorizer can run in this assert:

  LoopVectorize.cpp:2699: void llvm::InnerLoopVectorizer::emitSCEVChecks(
  llvm::Loop *, llvm::BasicBlock *): Assertion `!BB->getParent()->hasOptSize()
  && "Cannot SCEV check stride or overflow when opt

We should not generate predicates while optimising for size because
code will be generated for predicates such as these SCEV overflow runtime
checks.

This should fix PR43371.

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

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