platform/upstream/llvm.git
4 years ago[lld][test] Expand testing for dynamic-list and export-dynamic
gbreynoo [Wed, 10 Jun 2020 13:06:30 +0000 (14:06 +0100)]
[lld][test] Expand testing for dynamic-list and export-dynamic

- Expanded testing for --dynamic-list and --export-dynamic
- Fixed invalid-dynamic-list.test

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

4 years ago[AArch64][SVE] Change pointer type of struct load/store intrinsics.
Sander de Smalen [Wed, 10 Jun 2020 08:15:13 +0000 (09:15 +0100)]
[AArch64][SVE] Change pointer type of struct load/store intrinsics.

Instead of loading from e.g. `<vscale x 16 x i8>*`, load from element
pointer `i8*`. This is more in line with the other load/store
intrinsics for SVE.

Reviewers: fpetrogalli, c-rhodes, rengolin, efriedma

Reviewed By: efriedma

Tags: #llvm

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

4 years ago[libc++] Translate the enable_filesystem parameter to the DSL
Louis Dionne [Wed, 10 Jun 2020 12:46:49 +0000 (08:46 -0400)]
[libc++] Translate the enable_filesystem parameter to the DSL

4 years ago[lldb/Makefile.rules] Apply CFLAGS_EXTRAS after debug-info mode flags
Pavel Labath [Wed, 10 Jun 2020 11:38:35 +0000 (13:38 +0200)]
[lldb/Makefile.rules] Apply CFLAGS_EXTRAS after debug-info mode flags

This makes it possible to conditionally override some of these flags via
CFLAGS_EXTRAS. It should be NFC right now, but this seems the logical
order in which to apply these things, and I am going to make use of this
in another patch.

4 years ago[yaml2obj] - Introduce a 10 Mb limit of the output by default and a --max-size option.
Georgii Rymar [Fri, 5 Jun 2020 12:50:59 +0000 (15:50 +0300)]
[yaml2obj] - Introduce a 10 Mb limit of the output by default and a --max-size option.

Multiple times we faced an issue of huge outputs due to unexpected behavior
or incorrect test cases. The last one was https://reviews.llvm.org/D80629#2073066.

This patch limits the output to 10 Mb for ELF and introduces the --max-size to change this
limit.

I've tried to keep the implementation non-intrusive.

The current logic we have is that we prepare section content in a buffer first and write
it to the output later. This patch checks the available limit on each writing attempt to this buffer
and stops writing when the limit is reached and raises the internal error flag.
Later, this flag is is checked before the actual writing to a file happens and
an error is reported.

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

4 years ago[libc++] Define the no-exceptions Lit feature using the DSL
Louis Dionne [Wed, 10 Jun 2020 12:03:51 +0000 (08:03 -0400)]
[libc++] Define the no-exceptions Lit feature using the DSL

Instead of using logic in config.py, use the DSL to grab the no-exceptions
user-configurable parameter from the Lit command-line invocation.

4 years ago[libc++] Allow picking Lit parameters from the config
Louis Dionne [Tue, 9 Jun 2020 21:23:41 +0000 (17:23 -0400)]
[libc++] Allow picking Lit parameters from the config

Unlike parameters in litConfig.params, the config isn't shared across
all test suites. For example, if we want to enable exceptions in the
tests for libcxxabi, but not in the tests for libcxx, we can't set the
enable_exceptions parameter in the litConfig object, cause it will be
used by both. Instead, setting it inside the config object solves that
problem.

4 years ago[MLIR][Shape] Make dimension an operand of `get_extent`
Frederik Gossen [Wed, 10 Jun 2020 11:43:30 +0000 (11:43 +0000)]
[MLIR][Shape] Make dimension an operand of `get_extent`

The operation `get_extent` now accepts the dimension as an operand and is no
longer limited to constant dimensions.
A helper function facilitates the common constant use case.

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

4 years ago[analyzer] On-demand parsing capability for CTU
Endre Fülöp [Wed, 10 Jun 2020 06:59:04 +0000 (08:59 +0200)]
[analyzer] On-demand parsing capability for CTU

Summary:
Introduce on-demand parsing of needed ASTs during CTU analysis.
The index-file format is extended, and analyzer-option CTUInvocationList
is added to specify the exact invocations needed to parse the needed
source-files.

Reviewers: martong, balazske, Szelethus, xazax.hun, whisperity

Reviewed By: martong, xazax.hun

Subscribers: gribozavr2, thakis, ASDenysPetrov, ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits

Tags: #clang

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

4 years ago[compiler-rt] [test] Fix NameError when loading lit.cfg.py for crt
Sergej Jaskiewicz [Wed, 10 Jun 2020 10:46:29 +0000 (13:46 +0300)]
[compiler-rt] [test] Fix NameError when loading lit.cfg.py for crt

Summary:
The `execute_external` global variable is defined in [`lit.common.cfg.py`](https://github.com/llvm/llvm-project/blob/fcfb3170a776f89dde4de8ee105c99e10660f455/compiler-rt/test/lit.common.cfg.py#L18-L27) and used here (on lines 23 and 39). However, this variable is not visible in configs that are loaded independently.

Explicitly assign it to the correct value to avoid `NameError`.

Reviewers: compnerd, phosek

Reviewed By: compnerd, phosek

Subscribers: dberris, #sanitizers

Tags: #sanitizers

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

4 years ago[asan] Suppress lint warning in tests
Vitaly Buka [Wed, 10 Jun 2020 10:21:56 +0000 (03:21 -0700)]
[asan] Suppress lint warning in tests

4 years ago[lldb][NFC] Rename ClangExpressionDeclMap::AddThisType and clarify documentation
Raphael Isemann [Wed, 10 Jun 2020 10:22:55 +0000 (12:22 +0200)]
[lldb][NFC] Rename ClangExpressionDeclMap::AddThisType and clarify documentation

4 years ago[VE] Support convert instructions in MC layer
Kazushi (Jam) Marukawa [Wed, 10 Jun 2020 10:22:19 +0000 (12:22 +0200)]
[VE] Support convert instructions in MC layer

Summary:
Add CVTSQ/CVTDQ/CVTQD/CVTQS instructions.  Add regression tests for
them and other convert instructions of asmparser, mccodeemitter, and
disassembler.  In order to add those instructions, support RD operands
in asmparser, mccodeemitter, and disassembler.

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

4 years ago[ARM] MVE vectorizer reduction tests for each reduction type. NFC
David Green [Tue, 9 Jun 2020 15:21:38 +0000 (16:21 +0100)]
[ARM] MVE vectorizer reduction tests for each reduction type. NFC

4 years agoRevert "[Attributor] Split the Attributor::run() into multiple functions."
sstefan1 [Wed, 10 Jun 2020 10:10:49 +0000 (10:10 +0000)]
Revert "[Attributor] Split the Attributor::run() into multiple functions."

This reverts commit 0ee47cc92f510e4f21b584dc265105f4d51776a0.

4 years ago[Attributor] Split the Attributor::run() into multiple functions.
stefan [Wed, 10 Jun 2020 09:48:58 +0000 (09:48 +0000)]
[Attributor] Split the Attributor::run() into multiple functions.

Summary:
This patch splits the Attributor::run() function into multiple functions.

Simple Logic changes to make this possible:
  # Moved iteration count verification earlier.
  # NumFinalAAs get set a little bit later.

Reviewers: jdoerfert, sstefan1, uenoku

Reviewed By: jdoerfert

Subscribers: hiraditya, uenoku, llvm-commits

Tags: #llvm

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

4 years ago[StackSafety] Add info into function summary
Vitaly Buka [Mon, 1 Jun 2020 06:49:57 +0000 (23:49 -0700)]
[StackSafety] Add info into function summary

Summary:
This patch adds optional field into function summary,
implements asm and bitcode serialization. YAML
serialization is omitted and can be added later if
needed.

This patch includes this information into summary only
if module contains at least one sanitize_memtag function.
In a near future MTE is the user of the analysis.
Later if needed we can provede more direct control
on when information is included into summary.

Reviewers: eugenis

Subscribers: hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

4 years ago[FileCheck] Add function call support to numerical expressions.
Paul Walker [Thu, 14 May 2020 10:32:58 +0000 (10:32 +0000)]
[FileCheck] Add function call support to numerical expressions.

This patch extends numerical expressions to allow calls to
predefined functions. These calls can be combined with the
existing numerical operators, which includes nesting calls.

The call syntax is:

  <func>(<args>)

Where <func> is a predefined string literal, currently limited to
one of add, max, min and sub. <arg> is a comma seperated list of
numerical expressions.

Subscribers: arichardson, hiraditya, thopre, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Log rather than assert on bad UTF-8.
Sam McCall [Wed, 10 Jun 2020 04:40:00 +0000 (06:40 +0200)]
[clangd] Log rather than assert on bad UTF-8.

Summary:
I don't love this behavior, but it prevents crashing when indexing boost
headers, and I can't think of a better practical alternative.

Fixes https://reviews.llvm.org/D81530

Based on a patch by AnakinZheng!

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits, AnakinZheng

Tags: #clang

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

4 years ago[DSE,MSSA] Relax post-dom restriction for objs visible after return.
Florian Hahn [Wed, 10 Jun 2020 09:23:37 +0000 (10:23 +0100)]
[DSE,MSSA] Relax post-dom restriction for objs visible after return.

This patch relaxes the post-dominance requirement for accesses to
objects visible after the function returns.

Instead of requiring the killing def to post-dominate the access to
eliminate, the set of 'killing blocks' (= blocks that completely
overwrite the original access) is collected.

If all paths from the access to eliminate and an exit block go through a
killing block, the access can be removed.

To check this property, we first get the common post-dominator block for
the killing blocks. If this block does not post-dominate the access
block, there may be a path from DomAccess to an exit block not involving
any killing block.

Otherwise we have to check if there is a path from the DomAccess to the
common post-dominator, that does not contain a killing block. If there
is no such path, we can remove DomAccess. For this check, we start at
the common post-dominator and then traverse the CFG backwards. Paths are
terminated when we hit a killing block or a block that is not executed
between DomAccess and a killing block according to the post-order
numbering (if the post order number of a block is greater than the one
of DomAccess, the block cannot be in in a path starting at DomAccess).

This gives the following improvements on the total number of stores
after DSE for MultiSource, SPEC2K, SPEC2006:

Tests: 237
Same hash: 206 (filtered out)
Remaining: 31
Metric: dse.NumRemainingStores

Program                                        base      new100    diff
 test-suite...CFP2000/188.ammp/188.ammp.test   3624.00   3544.00   -2.2%
 test-suite...ch/g721/g721encode/encode.test   128.00    126.00    -1.6%
 test-suite.../Benchmarks/Olden/mst/mst.test    73.00     72.00    -1.4%
 test-suite...CFP2006/433.milc/433.milc.test   3202.00   3163.00   -1.2%
 test-suite...000/186.crafty/186.crafty.test   5062.00   5010.00   -1.0%
 test-suite...-typeset/consumer-typeset.test   40460.00  40248.00  -0.5%
 test-suite...Source/Benchmarks/sim/sim.test   642.00    639.00    -0.5%
 test-suite...nchmarks/McCat/09-vor/vor.test   642.00    644.00     0.3%
 test-suite...lications/sqlite3/sqlite3.test   35664.00  35563.00  -0.3%
 test-suite...T2000/300.twolf/300.twolf.test   7202.00   7184.00   -0.2%
 test-suite...lications/ClamAV/clamscan.test   19475.00  19444.00  -0.2%
 test-suite...INT2000/164.gzip/164.gzip.test   2199.00   2196.00   -0.1%
 test-suite...peg2/mpeg2dec/mpeg2decode.test   2380.00   2378.00   -0.1%
 test-suite.../Benchmarks/Bullet/bullet.test   39335.00  39309.00  -0.1%
 test-suite...:: External/Povray/povray.test   36951.00  36927.00  -0.1%
 test-suite...marks/7zip/7zip-benchmark.test   67396.00  67356.00  -0.1%
 test-suite...6/464.h264ref/464.h264ref.test   31497.00  31481.00  -0.1%
 test-suite...006/453.povray/453.povray.test   51441.00  51416.00  -0.0%
 test-suite...T2006/401.bzip2/401.bzip2.test   4450.00   4448.00   -0.0%
 test-suite...Applications/kimwitu++/kc.test   23481.00  23471.00  -0.0%
 test-suite...chmarks/MallocBench/gs/gs.test   6286.00   6284.00   -0.0%
 test-suite.../CINT2000/254.gap/254.gap.test   13719.00  13715.00  -0.0%
 test-suite.../Applications/SPASS/SPASS.test   30345.00  30338.00  -0.0%
 test-suite...006/450.soplex/450.soplex.test   15018.00  15016.00  -0.0%
 test-suite...ications/JM/lencod/lencod.test   27780.00  27777.00  -0.0%
 test-suite.../CINT2006/403.gcc/403.gcc.test   105285.00 105276.00 -0.0%

There might be potential to pre-compute some of the information of which
blocks are on the path to an exit for each block, but the overall
benefit might be comparatively small.

On the set of benchmarks, 15738 times out of 20322 we reach the
CFG check, the CFG check is successful. The total number of iterations
in the CFG check is 187810, so on average we need less than 10 steps in
the check loop. Bumping the threshold in the loop from 50 to 150 gives a
few small improvements, but I don't think they warrant such a big bump
at the moment. This is all pending further tuning in the future.

Reviewers: dmgreen, bryant, asbirlea, Tyker, efriedma, george.burgess.iv

Reviewed By: george.burgess.iv

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

4 years agoRevert "[InstrProfiling] Use !associated metadata for counters, data and values"
Vitaly Buka [Wed, 10 Jun 2020 09:25:47 +0000 (02:25 -0700)]
Revert "[InstrProfiling] Use !associated metadata for counters, data and values"

This reverts commit 69c5ff4668cd4d1bfb6b45d71e15c12e3a23ae05.
This reverts commit 603d58b5e49c76e4a2e5bf1450b71b100a3396ba.
This reverts commit ba10bedf5631eda3a17df428c88451c754633d23.
This reverts commit 39b3c41b65302a969fa5507402976a255a07c158.

4 years agoRevert "[analyzer] On-demand parsing capability for CTU"
Endre Fülöp [Wed, 10 Jun 2020 08:30:10 +0000 (10:30 +0200)]
Revert "[analyzer] On-demand parsing capability for CTU"

This reverts commit 020815fafd15ddac0f2b5539e7766107d7b25ddc.
Reason: PS4 buildbot broke

4 years ago[RISCV] Make visibility of overridden methods in RISCVISelLowering match the parent
Alex Bradbury [Wed, 10 Jun 2020 08:16:09 +0000 (09:16 +0100)]
[RISCV] Make visibility of overridden methods in RISCVISelLowering match the parent

Currently, some fairly arbitrary subset of overriden methods in
RISCVISelLowering are private rather than public (which is the
visibility they have in TargetLowering). I suspect this is a holdover
from too closely copying another backend.

D78545 pointed out this can be difficult for some downstream patches,
and nobody has come forward to suggest a reason for keeping the
visibility as-is.

This commit simply makes all overridden methods match the public
visiblity of the parent.

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

4 years ago[CostModel] Unify Shuffle and InsertElement Costs
Sam Parker [Tue, 9 Jun 2020 08:04:53 +0000 (09:04 +0100)]
[CostModel] Unify Shuffle and InsertElement Costs

Extract the existing code from getInstructionThroughput into
TTImpl::getUserCost. The duplicated code in the AMDGPU backend has
also been removed.

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

4 years ago[CostModel] Unify getArithmeticInstrCost
Sam Parker [Fri, 5 Jun 2020 07:42:03 +0000 (08:42 +0100)]
[CostModel] Unify getArithmeticInstrCost

Add the remaining arithmetic opcodes into the generic implementation
of getUserCost and then call this from getInstructionThroughput. Most
of the backends have been modified to return the base implementation
for cost kinds other RecipThroughput. The outlier here is AMDGPU
which already uses getArithmeticInstrCost for all the cost kinds.
This change means that most of the opcodes can be removed from that
backends implementation of getUserCost.

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

4 years ago[VE] Support host memory access instructions in MC layer
Kazushi (Jam) Marukawa [Wed, 10 Jun 2020 08:01:56 +0000 (10:01 +0200)]
[VE] Support host memory access instructions in MC layer

Summary:
Add LHM/SHM instructions.  Add regression tests for them of asmparser,
mccodeemitter, and disassembler.  In order to add those instructions,
add new decode functions to disassembler, and add new print functions
to instprinter.

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

4 years ago[MS] Copy the symbols assigned to the former instruction when memory folding.
Wang, Pengfei [Wed, 10 Jun 2020 06:52:54 +0000 (14:52 +0800)]
[MS] Copy the symbols assigned to the former instruction when memory folding.

The memory folding raplaced the old instruction without copying the symbols assigned. Which will resulted in built fail due to the lost symbols.

Reviewed by craig.topper

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

4 years ago[SveEmitter] NFC: Add missing ACLE tests
Sander de Smalen [Tue, 9 Jun 2020 14:47:12 +0000 (15:47 +0100)]
[SveEmitter] NFC: Add missing ACLE tests

These ACLE tests were missing in previous patches:
- D79357: [SveEmitter] Add builtins for svdup and svindex
- D78747: [SveEmitter] Add builtins for compares and ReverseCompare flag.
- D76238: [SveEmitter] Implement builtins for contiguous loads/stores

4 years agoRevert "[SPARC] Lower fp16 ops to libcalls"
Eli Friedman [Wed, 10 Jun 2020 07:26:35 +0000 (00:26 -0700)]
Revert "[SPARC] Lower fp16 ops to libcalls"

This reverts commit 28415e588f1c501967a9b596e6651787996f93ff.  It's
causing buildbot failures. (Probably just need to fix the triple for the
test, but I'll look more tomorrow.)

4 years ago[analyzer] On-demand parsing capability for CTU
Endre Fülöp [Wed, 10 Jun 2020 06:59:04 +0000 (08:59 +0200)]
[analyzer] On-demand parsing capability for CTU

Summary:
Introduce on-demand parsing of needed ASTs during CTU analysis.
The index-file format is extended, and analyzer-option CTUInvocationList
is added to specify the exact invocations needed to parse the needed
source-files.

Reviewers: martong, balazske, Szelethus, xazax.hun, whisperity

Reviewed By: martong, xazax.hun

Subscribers: gribozavr2, thakis, ASDenysPetrov, ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits

Tags: #clang

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

4 years ago[gn build] Port 4f03c0b8066
LLVM GN Syncbot [Wed, 10 Jun 2020 06:34:38 +0000 (06:34 +0000)]
[gn build] Port 4f03c0b8066

4 years ago[gn build] Port 075890ca551
LLVM GN Syncbot [Wed, 10 Jun 2020 06:34:37 +0000 (06:34 +0000)]
[gn build] Port 075890ca551

4 years ago[AArch64] Move RegisterBankInfo.cpp/h to GISel.
Amara Emerson [Wed, 10 Jun 2020 06:25:52 +0000 (23:25 -0700)]
[AArch64] Move RegisterBankInfo.cpp/h to GISel.

Missed this file in the recent reorg.

4 years ago[ELF] Fix --thinlto-index-only regression after D79300
Fangrui Song [Wed, 10 Jun 2020 06:08:04 +0000 (23:08 -0700)]
[ELF] Fix --thinlto-index-only regression after D79300

After D79300, we don't rewrite InputFile::mb to an empty buffer.
In thinLTOCreateEmptyIndexFiles(), we should check LazyObjFile::fetched
as well as checking whether mb is a bitcode, otherwise we would overwrite (path + .thinlto.bc) with an empty index.

4 years ago[libc] Add implementations of round and roundf.
Siva Chandra Reddy [Fri, 29 May 2020 06:03:32 +0000 (23:03 -0700)]
[libc] Add implementations of round and roundf.

Reviewers: asteinhauser

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

4 years ago[AArch64] custom lowering for i128 popcount
Shawn Landden [Sun, 7 Jun 2020 14:56:17 +0000 (18:56 +0400)]
[AArch64] custom lowering for i128 popcount

halves the number of CNT instructions generated

4 years ago[JitRunner] add support for i32 and i64 output
Stephen Neuendorffer [Sat, 23 Nov 2019 00:04:44 +0000 (16:04 -0800)]
[JitRunner] add support for i32 and i64 output

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

4 years ago[MLIR] expose applyCmpPredicate
Stephen Neuendorffer [Wed, 27 May 2020 04:11:01 +0000 (21:11 -0700)]
[MLIR] expose applyCmpPredicate

This is useful for manipulating the standard dialect from transformations
outside of the standard dialect.

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

4 years ago[libc] Skip fuzzer as well if its dependent entrypoints are skipped.
Siva Chandra Reddy [Tue, 9 Jun 2020 23:56:50 +0000 (16:56 -0700)]
[libc] Skip fuzzer as well if its dependent entrypoints are skipped.

Reviewers: asteinhauser

Subscribers: mgorny, tschuett, ecnelises, libc-commits

Tags: #libc-project

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

4 years ago[SPARC] Lower fp16 ops to libcalls
LemonBoy [Wed, 10 Jun 2020 02:17:43 +0000 (19:17 -0700)]
[SPARC] Lower fp16 ops to libcalls

The fp16 ops are legalized by extending/chopping them as needed.
The tests are shamelessly stolen from the RISC-V backend.

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

4 years ago[Support][unittest] Fix asan failure after D81156
Fangrui Song [Wed, 10 Jun 2020 00:47:47 +0000 (17:47 -0700)]
[Support][unittest] Fix asan failure after D81156

4 years agoFix variables used only in asserts.
Sterling Augustine [Wed, 10 Jun 2020 00:10:22 +0000 (17:10 -0700)]
Fix variables used only in asserts.

Summary: Fix variables used only in asserts.

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[AArch64][GlobalISel] Select G_ADD_LOW into a MOVaddr pseudo.
Amara Emerson [Tue, 9 Jun 2020 22:14:04 +0000 (15:14 -0700)]
[AArch64][GlobalISel] Select G_ADD_LOW into a MOVaddr pseudo.

This ensures that we match SelectionDAG behaviour by waiting until the expand
pseudos pass to generate ADRP + ADD pairs. Doing this at selection time for the
G_ADD_LOW is fine because by the time we get to selecting the G_ADD_LOW,
previous attempts to fold it into loads/stores must have failed.

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

4 years ago[X86] Assign a feature to tremont, goldmont, goldmont-plus, icelake-client, and icela...
Craig Topper [Tue, 9 Jun 2020 22:25:46 +0000 (15:25 -0700)]
[X86] Assign a feature to tremont, goldmont, goldmont-plus, icelake-client, and icelake for target multiversioning priority.

Without this these CPUs all caused the compiler to assert when
used for multiversioning.

4 years agoMake the diagnostic-missing-prototypes put the suggested `static` in front of `const...
Vy Nguyen [Tue, 9 Jun 2020 01:14:14 +0000 (21:14 -0400)]
Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

Summary:
Consider: `const int* get_foo() {return nullptr;}`
The suggested fix should be `static const int* get_foo(){}`
and not `const static int* get_foo(){}`

Reviewers: gribozavr2

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[libc][NFC] Adjust sinf and cosf around -infinity inputs.
Siva Chandra Reddy [Tue, 9 Jun 2020 23:20:51 +0000 (16:20 -0700)]
[libc][NFC] Adjust sinf and cosf around -infinity inputs.

The current tests verify if the result of -infinity is a quiet NaN with
sign bit set. But, that need not be the case on all platforms. So, just
checking that the result is a quiet NaN and ignoring the sign bit is
good enough.

4 years ago[lldb/Reproducers] Skip test_remove_placeholder_add_real_module with reproducers
Jonas Devlieghere [Tue, 9 Jun 2020 23:17:29 +0000 (16:17 -0700)]
[lldb/Reproducers] Skip test_remove_placeholder_add_real_module with reproducers

Modules are not orphaned and it finds the existing module with the same
UUID from test_partial_uuid_match.

4 years ago[mlir] [VectorOps] Handle 'vector.shape_cast' lowering for all cases
aartbik [Tue, 9 Jun 2020 21:08:51 +0000 (14:08 -0700)]
[mlir] [VectorOps] Handle 'vector.shape_cast' lowering for all cases

Summary:
Even though this operation is intended for 1d/2d conversions currently,
leaving a semantic hole in the lowering prohibits proper testing of this
operation. This CL adds a straightforward reference implementation for the
missing cases.

Reviewers: nicolasvasilache, mehdi_amini, ftynse, reidtatge

Reviewed By: reidtatge

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes

Tags: #mlir

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

4 years agoDon't use a variable that isn't defined
Akira Hatanaka [Tue, 9 Jun 2020 22:53:44 +0000 (15:53 -0700)]
Don't use a variable that isn't defined

The line defining CAPTURE was removed in r302270.

4 years ago[libc][NFC][Obvious] Tidy up some CMake files.
Siva Chandra Reddy [Tue, 9 Jun 2020 22:38:49 +0000 (15:38 -0700)]
[libc][NFC][Obvious] Tidy up some CMake files.

Conditionally adding subdirectories was missed in a few places previously.
This change adds the conditionals. A sub-directory was being added
needlessly in another place. That has been removed.

4 years ago[libc] Skip entrypoints not present in the entrypoints list.
Siva Chandra Reddy [Tue, 9 Jun 2020 07:31:48 +0000 (00:31 -0700)]
[libc] Skip entrypoints not present in the entrypoints list.

Summary:
If a test depends on a skipped entrypoint, then the test is also
skipped. This setup will be useful as we gradually add support for
more operating systems and target architectures.

Reviewers: asteinhauser

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

4 years ago[LoopFusion] Update second loop guard non loop successor phis incoming
Whitney Tsang [Tue, 9 Jun 2020 21:12:51 +0000 (21:12 +0000)]
[LoopFusion] Update second loop guard non loop successor phis incoming
blocks.

Summary: The current LoopFusion forget to update the incoming block of
the phis in second loop guard non loop successor from second loop guard
block to first loop guard block. A test case is provided to better
understand the problem.
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D81421

4 years ago[flang] Fix bug resolving type in type definition
Tim Keith [Tue, 9 Jun 2020 21:14:01 +0000 (14:14 -0700)]
[flang] Fix bug resolving type in type definition

When we encountered a type name in a derived type definition, we were
sometimes finding a component of that name rather than the type from
the enclosing scope. Fix this by introducing `NonDerivedTypeScope()` to
start the search in the right scope.

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

4 years ago[lldb/CMake] Add LLDB_PYTHON_VERSION to use Python 2 with CMake > 3.12
Jonas Devlieghere [Tue, 9 Jun 2020 21:09:42 +0000 (14:09 -0700)]
[lldb/CMake] Add LLDB_PYTHON_VERSION to use Python 2 with CMake > 3.12

In addition to having the default fallback from Python 3 to Python 2, it
should also be possible to build against Python 2 explicitly. This patch
makes that possible by setting LLDB_PYTHON_VERSION. The variable only
has effect with CMake 3.12 or later.

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

4 years ago[SVE] Eliminate calls to default-false VectorType::get() from Scalar
Christopher Tetreault [Tue, 9 Jun 2020 21:00:08 +0000 (14:00 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from Scalar

Reviewers: efriedma, kmclaughlin, sdesmalen, fhahn, bkramer, anna, gchatelet, c-rhodes, david-arm, fpetrogalli

Reviewed By: david-arm

Subscribers: tschuett, hiraditya, rkruppe, psnobl, dantrushin, llvm-commits

Tags: #llvm

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

4 years agoReland [clangd] Resolve driver symlinks, and look up unknown relative drivers in...
Sam McCall [Tue, 9 Jun 2020 20:54:42 +0000 (22:54 +0200)]
Reland [clangd] Resolve driver symlinks, and look up unknown relative drivers in PATH.

This reverts commit f25e3c2d0e8553e6640ca5e0d1933c0e9455bd71.
Added workaround for tempdir being a symlink on mac.

4 years ago[SVE] Eliminate calls to default-false VectorType::get() from FuzzMutate
Christopher Tetreault [Tue, 9 Jun 2020 20:50:36 +0000 (13:50 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from FuzzMutate

Reviewers: efriedma, kmclaughlin, sdesmalen, bogner, chandlerc, c-rhodes, david-arm, fpetrogalli

Reviewed By: c-rhodes

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[NFC][WebAssembly] Add tests for alignment on new SIMD loads
Thomas Lively [Tue, 9 Jun 2020 20:46:12 +0000 (13:46 -0700)]
[NFC][WebAssembly] Add tests for alignment on new SIMD loads

Summary:
The natural alignments for extending and splatting loads had not
previously been tested. It is good to have them tested because they
are non-obvious details in the SIMD spec proposal.

Reviewers: aheejin

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

Tags: #llvm

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

4 years agoAdded test case for the patch D75866 "supporting the visibility attribute for aix...
diggerlin [Tue, 9 Jun 2020 20:28:52 +0000 (16:28 -0400)]
Added test case for the patch D75866 "supporting the visibility attribute for aix assembly"

The test case has been reviewed in the patch D75866

Reviewers: Jason Liu ,hubert.reinterpretcast,James Henderson

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

4 years ago[clang][NFC] Fix and simplify the test added in 8dcc7eecb75b39d723fd6fee566369bf67e43fdf
Bruno Ricci [Tue, 9 Jun 2020 20:11:09 +0000 (21:11 +0100)]
[clang][NFC] Fix and simplify the test added in 8dcc7eecb75b39d723fd6fee566369bf67e43fdf

We only have to create a TypeTraitExpr node with 16 bits worth of
arguments to detect an overflow with the assertion added in the
constructor of TypeTraitExpr. Moreover the static_assert in
original test is pointless since __is_constructible only check
that the corresponding expression is well-formed.

4 years ago[AIX] supporting the visibility attribute for aix assembly
diggerlin [Tue, 9 Jun 2020 20:15:06 +0000 (16:15 -0400)]
[AIX] supporting the visibility attribute for aix assembly

SUMMARY:

in the aix assembly , it do not have .hidden and .protected directive.
in current llvm. if a function or a variable which has visibility attribute, it will generate something like the .hidden or .protected , it can not recognize by aix as.
in aix assembly, the visibility attribute are support in the pseudo-op like
.extern Name [ , Visibility ]
.globl Name [, Visibility ]
.weak Name [, Visibility ]

in this patch, we implement the visibility attribute for the global variable, function or extern function .

for example.

extern __attribute__ ((visibility ("hidden"))) int
  bar(int* ip);
__attribute__ ((visibility ("hidden"))) int b = 0;
__attribute__ ((visibility ("hidden"))) int
  foo(int* ip){
   return (*ip)++;
}
the visibility of .comm linkage do not support , we will have a separate patch for it.
we have the unsupported cases ("default" and "internal") , we will implement them in a a separate patch for it.

Reviewers: Jason Liu ,hubert.reinterpretcast,James Henderson

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

4 years ago[libc++abi] Replace LIBCXXABI_HAS_NO_EXCEPTIONS by TEST_HAS_NO_EXCEPTIONS
Louis Dionne [Tue, 9 Jun 2020 19:47:37 +0000 (15:47 -0400)]
[libc++abi] Replace LIBCXXABI_HAS_NO_EXCEPTIONS by TEST_HAS_NO_EXCEPTIONS

This clarifies the difference between test for exception support in
libc++abi tests and support for exceptions built into libc++abi.
This also removes the rather confusing similarity between the
_LIBCXXABI_NO_EXCEPTIONS and LIBCXXABI_HAS_NO_EXCEPTIONS macros.

Finally, TEST_HAS_NO_EXCEPTIONS is also detected automatically based
on -fno-exceptions, so it doesn't have to be specified explicitly
through Lit's compile_flags.

4 years ago[lldb] Fix and enable Windows minidump tests
Jaroslav Sevcik [Tue, 9 Jun 2020 12:57:44 +0000 (12:57 +0000)]
[lldb] Fix and enable Windows minidump tests

SBFileSpec.fullpath always uses the forward slash to join the directory with the
base name. This causes mismatches when comparing Windows paths with backslashes
in two of the minidump tests. To get around that we just compare the directory
names separately from the filenames.

Reviewed By: labath

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

4 years ago[libc++abi][libunwind] Don't override libc++'s handling of exception features
Louis Dionne [Tue, 9 Jun 2020 19:58:41 +0000 (15:58 -0400)]
[libc++abi][libunwind] Don't override libc++'s handling of exception features

0e04342ae039 simplified exceptions-related configurations for libc++abi
and libunwind by reusing the logic in libc++. However, it missed the fact
that libc++abi and libunwind were overriding libc++'s handling of exceptions.

This commit removes special handling in libc++abi and libunwind to use
the logic in libc++, which is the right one.

4 years ago[HWASan] Add sizeof(global) in report even if symbols missing.
Mitch Phillips [Tue, 9 Jun 2020 18:57:24 +0000 (11:57 -0700)]
[HWASan] Add sizeof(global) in report even if symbols missing.

Summary: Refactor the current global header iteration to be callback-based, and add a feature that reports the size of the global variable during reporting. This allows binaries without symbols to still report the size of the global variable, which is always available in the HWASan globals PT_NOTE metadata.

Reviewers: eugenis, pcc

Reviewed By: pcc

Subscribers: mgorny, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

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

4 years agoRebase.
Mitch Phillips [Mon, 8 Jun 2020 16:19:57 +0000 (09:19 -0700)]
Rebase.

4 years agoremove redundant comment about Android.
Mitch Phillips [Wed, 27 May 2020 16:40:08 +0000 (09:40 -0700)]
remove redundant comment about Android.

4 years agoAddress Peter's comments.
Mitch Phillips [Wed, 27 May 2020 16:38:44 +0000 (09:38 -0700)]
Address Peter's comments.

4 years agoMove DSO dependencies inside the group.
Mitch Phillips [Tue, 26 May 2020 22:06:04 +0000 (15:06 -0700)]
Move DSO dependencies inside the group.

4 years agoPatch up issues with GN builds (pthread / libz)
Mitch Phillips [Tue, 26 May 2020 22:01:34 +0000 (15:01 -0700)]
Patch up issues with GN builds (pthread / libz)

Summary:
Fixes up two small issues with the gn build.

 1 - Ensures that the correct ldflag `-pthread` is provided, not just linking the library.
 2 - Ensures that libraries are linked in the same group as the dependencies. This fixes a problem where system libraries (libc) are involved in a link-order dependency that's not being fulfilled.

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[gn build] Port d5c28c40943
LLVM GN Syncbot [Tue, 9 Jun 2020 19:53:21 +0000 (19:53 +0000)]
[gn build] Port d5c28c40943

4 years ago[X86] Move CPUKind enum from clang to llvm/lib/Support. NFCI
Craig Topper [Tue, 9 Jun 2020 19:18:08 +0000 (12:18 -0700)]
[X86] Move CPUKind enum from clang to llvm/lib/Support. NFCI

Similar to what some other targets have done. This information
could be reused by other frontends so doesn't make sense to live
in clang.

-Rename CK_Generic to CK_None to better reflect its illegalness.
-Move function for translating from string to enum into llvm.
-Call checkCPUKind directly from the string to enum translation
and update CPU kind to CK_None accordinly. Caller will use CK_None
as sentinel for bad CPU.

I'm planning to move all the CPU to feature mapping out next. As
part of that I want to devise a better way to express CPUs inheriting
features from an earlier CPU. Allowing this to be expressed in a
less rigid way than just falling through a switch. Or using gotos
as we've had to do lately.

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

4 years agoAMDGPU/GlobalISel: Add new baseline tests for bitcast legalization
Matt Arsenault [Tue, 9 Jun 2020 19:46:31 +0000 (15:46 -0400)]
AMDGPU/GlobalISel: Add new baseline tests for bitcast legalization

4 years ago[x86] refine conditions for immediate hoisting to save code-size
Sanjay Patel [Tue, 9 Jun 2020 19:43:34 +0000 (15:43 -0400)]
[x86] refine conditions for immediate hoisting to save code-size

As shown in PR46237:
https://bugs.llvm.org/show_bug.cgi?id=46237

The size-savings win for hoisting an 8-bit ALU immediate (intentionally
excluding store constants) requires extreme conditions; it may not even
be possible when including REX prefix bytes on x86-64.

I did draft a version of this patch that included use counts after the
loop, but I suspect that accounting is not working as expected. I think
that is because the number of constant uses are changing as we select
instructions (for example as we transform shl/add into LEA).

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

4 years agoUndo change inadvertently added in 113b0d7d
Erich Keane [Tue, 9 Jun 2020 19:40:37 +0000 (12:40 -0700)]
Undo change inadvertently added in 113b0d7d

4 years agoGlobalISel: Set instr/debugloc before any legalizer action
Matt Arsenault [Mon, 8 Jun 2020 00:57:28 +0000 (20:57 -0400)]
GlobalISel: Set instr/debugloc before any legalizer action

It was annoying enough that every custom lowering needed to set the
insert point, but this was made worse since now these all needed to be
updated to setInstrAndDebugLoc. Consolidate these so every
legalization action has the right insert position by default.

This should fix dropping debug info in every custom AMDGPU
legalization.

4 years ago[NFCI] Clean up exceptions related CMake and Lit options in libc++abi and libunwind
Louis Dionne [Tue, 9 Jun 2020 19:14:13 +0000 (15:14 -0400)]
[NFCI] Clean up exceptions related CMake and Lit options in libc++abi and libunwind

First, libc++abi doesn't need to add the no-exceptions Lit feature itself,
since that is already done in the config.py for libc++, which it reuses.
Specifically, config.enable_exceptions is set based on @LIBCXXABI_ENABLE_EXCEPTIONS@
in libc++abi's lit.cfg.in, and libc++'s config.py handles that correctly.

Secondly, libunwind's LIBUNWIND_ENABLE_EXCEPTIONS is never set (it's
probably a remnant of copy-pasting code between the runtime libraries),
so the library is always built with exceptions disabled (which makes
sense since it implements the runtime support for exceptions).
Conversely, the test suite is always run with exceptions enabled
(not sure why), but that is preserved by the default behavior of
libc++'s config.py.

4 years ago[InstCombine] add tests for diff-of-sums; NFC
Sanjay Patel [Tue, 9 Jun 2020 16:23:36 +0000 (12:23 -0400)]
[InstCombine] add tests for diff-of-sums; NFC

4 years agoPR46255: Fix field diagnostics for C records with anonymous members.
Erich Keane [Tue, 9 Jun 2020 19:19:35 +0000 (12:19 -0700)]
PR46255: Fix field diagnostics for C records with anonymous members.

The ParseStructUnionBody function was separately keeping track of the
field decls for historical reasons, however the "ActOn" functions add
the field to the RecordDecl anyway.

The "ParseStructDeclaration" function, which handles parsing fields
didn't have a way of handling what happens on an anonymous field, and
changing it would alter a large amount of objc code, so I chose instead
to implement this by just filling the FieldDecls vector with the actual
FieldDecls that were successfully added to the recorddecl .

4 years agoGlobalISel: Improve MachineIRBuilder construction
Matt Arsenault [Mon, 8 Jun 2020 01:37:29 +0000 (21:37 -0400)]
GlobalISel: Improve MachineIRBuilder construction

The current relationship between LegalizerHelper and MachineIRBuilder
confuses me, because the LegalizerHelper modifies the MachineIRBuilder
which it does not own. Constructing a LegalizerHelper destroys the
insert point, since the constructor calls setMF, which clears all the
fields. Try to separate these functions, so it's possible to construct
a LegalizerHelper from an existing MachineIRBuilder without losing the
insert point/debug loc.

4 years agoGlobalISel: Move some trivial MIRBuilder methods into the header
Matt Arsenault [Mon, 8 Jun 2020 01:24:34 +0000 (21:24 -0400)]
GlobalISel: Move some trivial MIRBuilder methods into the header

The construction APIs for MachineIRBuilder don't make much sense, and
it's been annoying to sort through it with these trivial functions
separate from the declaration.

4 years agoGlobalISel: Remove redundant check in verifier
Matt Arsenault [Tue, 9 Jun 2020 13:20:57 +0000 (09:20 -0400)]
GlobalISel: Remove redundant check in verifier

This was already checked earlier for all instructions.

4 years agoGlobalISel: Fix double printing new instructions in legalizer
Matt Arsenault [Tue, 9 Jun 2020 12:21:03 +0000 (08:21 -0400)]
GlobalISel: Fix double printing new instructions in legalizer

New instructions were getting printed both in createdInstr, and in the
final printNewInstrs, so it made it look like the same instructions
were created twice. This overall made reading the debug output
harder. Stop printing the initial construction and only print new
instructions in the summary at the end. This avoids printing the less
useful case where instructions are sometimes initially created with no
operands.

I'm not sure this is the correct instance to remove; now the visible
ordering is different. Now you will typically see the one erased
instruction message before all the new instructions in order. I think
this is the more logical view of typical legalization changes,
although it's mechanically backwards from the normal
insert-new-erase-old pattern.

4 years ago[lldb/Reproducers] Also collect ::open and ::fopen
Jonas Devlieghere [Tue, 9 Jun 2020 18:58:22 +0000 (11:58 -0700)]
[lldb/Reproducers] Also collect ::open  and ::fopen

Report files opened trough ::open and ::fopen to the FileCollector.

4 years agoChange filecheck default to dump input on failure
Mehdi Amini [Fri, 27 Mar 2020 23:58:06 +0000 (23:58 +0000)]
Change filecheck default to dump input on failure

Having the input dumped on failure seems like a better
default: I debugged FileCheck tests for a while without knowing
about this option, which really helps to understand failures.

Remove `-dump-input-on-failure` and the environment variable
FILECHECK_DUMP_INPUT_ON_FAILURE which are now obsolete.

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

4 years ago[libc++][CMake] Add CMake caches for commonly supported configurations
Louis Dionne [Tue, 16 Apr 2019 21:12:54 +0000 (17:12 -0400)]
[libc++][CMake] Add CMake caches for commonly supported configurations

This commit adds CMake caches for the various configurations of libc++
that are tested by our build bots.

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

4 years agoAssignment and Inc/Dec operators wouldn't register as a mutation when Implicit Paren...
Tridacnid [Tue, 9 Jun 2020 18:43:48 +0000 (19:43 +0100)]
Assignment and Inc/Dec operators wouldn't register as a mutation when Implicit Paren Casts were present

Add ignoringParenImpCasts to assignment and inc/dec mutation checks in ExprMutationAnalyzer to fix clang-tidy bug PR45490.
https://bugs.llvm.org/show_bug.cgi?id=45490

Reviewed By: njames93, aaron.ballman, gribozavr2

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

4 years ago[libc++] Fix too stringent availability markup for bad_optional_access
Louis Dionne [Tue, 9 Jun 2020 18:08:55 +0000 (14:08 -0400)]
[libc++] Fix too stringent availability markup for bad_optional_access

The availability markup for bad_optional_access marked it as being added
in MacOS 10.14 and aligned releases, however it appears to have been added
in Mac OS 10.13 and aligned releases.

4 years ago[NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with -force-vector-width...
Anh Tuyen Tran [Tue, 9 Jun 2020 18:30:56 +0000 (18:30 +0000)]
[NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with -force-vector-width=1 -force-vector-interleave=4

Summary:
Add -force-vector-width=1 -force-vector-interleave=4 to pr45679-fold-tail-by-masking.ll

Author: anhtuyen (Anh Tuyen Tran)

Reviewers: Ayal (Ayal Zaks)

Reviewed By: Ayal (Ayal Zaks)

Subscribers: rkruppe (Hanna Kruppe), llvm-commits, LLVM

Tag: LLVM

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

4 years ago[ELF] Demote lazy symbols relative to a discarded section to Undefined
Fangrui Song [Tue, 9 Jun 2020 18:25:55 +0000 (11:25 -0700)]
[ELF] Demote lazy symbols relative to a discarded section to Undefined

Fixes PR45594.

In `ObjFile<ELFT>::initializeSymbols()`, for a defined symbol relative to
a discarded section (due to section group rules), it may have been
inserted as a lazy symbol. We need to demote it to an Undefined to
enable the `discarded section` error happened in a later pass.

Add `LazyObjFile::fetched` (if true) and `ArchiveFile::parsed` (if
false) to represent that there is an ongoing lazy symbol fetch and we
should replace the current lazy symbol with an Undefined, instead of
calling `Symbol::resolve` (`Symbol::resolve` should be called if the lazy
symbol was added by an unrelated archive/lazy object).

As a side result, one small issue in start-lib-comdat.s is now fixed.
The hack motivating D51892 will be unsupported: if
`.gnu.linkonce.t.__i686.get_pc_thunk.bx` in an archive is referenced
by another section, this will likely be errored unless the function is
also defined in a regular object file.
(Bringing back rL330869 would error `undefined symbol` instead of the
more relevant `discarded section`.)

Note, glibc i386's crti.o still works (PR31215), because
`.gnu.linkonce.t.__x86.get_pc_thunk.bx` is in crti.o (one of the first
regular object files in a linker command line).

Reviewed By: psmith

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

4 years ago[MachineScheduler] Update available queue on the first mop of a new cycle
David Green [Tue, 9 Jun 2020 16:35:45 +0000 (17:35 +0100)]
[MachineScheduler] Update available queue on the first mop of a new cycle

If a resource can be held for multiple cycles in the schedule model
then an instruction can be placed into the available queue, another
instruction can be scheduled, but the first will not be taken back out if
the two instructions hazard. To fix this make sure that we update the
available queue even on the first MOp of a cycle, pushing available
instructions back into the pending queue if they now conflict.

This happens with some downstream schedules we have around MVE
instruction scheduling where we use ResourceCycles=[2] to show the
instruction executing over two beats. Apparently the test changes here
are OK too.

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

4 years ago[gcov][test] Add mkdir -p %t && cd %t
Fangrui Song [Tue, 9 Jun 2020 18:07:25 +0000 (11:07 -0700)]
[gcov][test] Add mkdir -p %t && cd %t

This allows an alternative lit runner (which does not chdir to %T)
to run within a read-only source tree.

4 years ago[VectorCombine] scalarizeBinop - support an all-constant src vector operand
Simon Pilgrim [Tue, 9 Jun 2020 17:36:14 +0000 (18:36 +0100)]
[VectorCombine] scalarizeBinop - support an all-constant src vector operand

scalarizeBinop currently folds

  vec_bo((inselt VecC0, V0, Index), (inselt VecC1, V1, Index))
  ->
  inselt(vec_bo(VecC0, VecC1), scl_bo(V0,V1), Index)

This patch extends this to account for cases where one of the vec_bo operands is already all-constant and performs similar cost checks to determine if the scalar binop with a constant still makes sense:

  vec_bo((inselt VecC0, V0, Index), VecC1)
  ->
  inselt(vec_bo(VecC0, VecC1), scl_bo(V0,extractelt(V1,Index)), Index)

Fixes PR42174

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

4 years agoChange debuginfo check for addHeapAllocSiteMetadata
Arthur Eubanks [Tue, 9 Jun 2020 16:55:25 +0000 (09:55 -0700)]
Change debuginfo check for addHeapAllocSiteMetadata

Summary:
Move check inside of addHeapAllocSiteMetadata().
Change check to DebugInfo <= DebugLineTablesOnly.

Reviewers: akhuang

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[AArch64] Allow BTI mnemonics in the HINT space with BTI disabled
Daniel Kiss [Tue, 9 Jun 2020 17:56:30 +0000 (19:56 +0200)]
[AArch64] Allow BTI mnemonics in the HINT space with BTI disabled

Summary:
It is important to emit HINT instructions instead of BTI  ones when
BTI is disabled. This allows compatibility with other assemblers
(e.g. GAS).

Still, developers of assembly code will want to write code that is
compatible with both pre- and post-BTI CPUs. They could use HINT
mnemonics, but the new mnemonics are a lot more readable (e.g.
bti c instead of hint #34), and they will result in the same
encodings. So, while LLVM should not *emit* the new mnemonics when
BTI is disabled, this patch will at least make LLVM *accept*
assembly code that uses them.

Reviewers: pbarrio, tamas.petz, ostannard

Reviewed By: pbarrio, ostannard

Subscribers: ostannard, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AArch64][GlobalISel] Select trn1 and trn2
Jessica Paquette [Thu, 4 Jun 2020 18:07:47 +0000 (11:07 -0700)]
[AArch64][GlobalISel] Select trn1 and trn2

Same idea as for zip, uzp, etc. Teach the post-legalizer combiner to recognize
G_SHUFFLE_VECTORs that are trn1/trn2 instructions.

- Add G_TRN1 and G_TRN2
- Port mask matching code from AArch64ISelLowering
- Produce G_TRN1 and G_TRN2 in the post-legalizer combiner
- Select via importer

Add select-trn.mir to test selection.

Add postlegalizer-combiner-trn.mir to test the combine. This is similar to the
existing arm64-trn test.

Note that both of these tests contain things we currently don't legalize.

I figured it would be easier to test these now rather than later, since once
we legalize the G_SHUFFLE_VECTORs, it's not guaranteed that someone will update
the tests.

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

4 years ago[lldb/Interpreter] Support color in CommandReturnObject
Jonas Devlieghere [Tue, 9 Jun 2020 17:21:09 +0000 (10:21 -0700)]
[lldb/Interpreter] Support color in CommandReturnObject

Color the error: and warning: part of the CommandReturnObject output,
similar to how an error is printed from the driver when colors are
enabled.

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

4 years ago[libc++] Avoid UB in year_month_day_last::day() for incorrect months
Louis Dionne [Tue, 9 Jun 2020 16:31:12 +0000 (12:31 -0400)]
[libc++] Avoid UB in year_month_day_last::day() for incorrect months

This effectively implements the resolution of LWG3231, which mandates
that calling year_month_day_last::day() on an invalid year_month_day_last
is unspecified behavior. Before this change, it was undefined behavior.

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

4 years ago[mlir][gpu] Add support for f16 when lowering to nvvm intrinsics
Stephan Herhut [Tue, 9 Jun 2020 15:20:53 +0000 (17:20 +0200)]
[mlir][gpu] Add support for f16 when lowering to nvvm intrinsics

Summary:
The NVVM target only provides implementations for tanh etc. on f32 and
f64 operands. To also support f16, we now insert operations to extend to f32
and truncate back to f16 around the intrinsic call.

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

4 years ago[WebAssembly] Implement prototype SIMD rounding instructions
Thomas Lively [Tue, 9 Jun 2020 17:14:14 +0000 (10:14 -0700)]
[WebAssembly] Implement prototype SIMD rounding instructions

Summary:
As specified in https://github.com/WebAssembly/simd/pull/232. These
instructions are implemented as LLVM intrinsics for now rather than
normal ISel patterns to make these instructions opt-in. Once the
instructions are merged to the spec proposal, the intrinsics will be
replaced with proper ISel patterns.

Reviewers: aheejin

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

Tags: #clang, #llvm

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