platform/upstream/llvm.git
4 years ago[IR] Move CallBase::getOperandBundlesAsDefs out of line, NFC
Reid Kleckner [Sat, 25 Jan 2020 01:24:10 +0000 (17:24 -0800)]
[IR] Move CallBase::getOperandBundlesAsDefs out of line, NFC

Copying operand bundles doesn't need to be inlined, and this template
instantiation shows up in ClangBuildAnalyzer.

4 years ago[lsan] Factor pthread-specific assumptions out of thread tracking code
Roland McGrath [Sat, 25 Jan 2020 00:55:11 +0000 (16:55 -0800)]
[lsan] Factor pthread-specific assumptions out of thread tracking code

This is a small refactoring to prepare for porting LSan to Fuchsia.
Factor out parts of lsan_thread.{cpp,h} that don't apply to Fuchsia.
Since existing supported systems are POSIX-based, the affected code
is moved to lsan_posix.{cpp.h}.

Patch By: mcgrathr

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

4 years ago[lsan] Expose Frontier object to OS-specific LockStuffAndStopTheWorld callback
Roland McGrath [Sat, 25 Jan 2020 00:52:12 +0000 (16:52 -0800)]
[lsan] Expose Frontier object to OS-specific LockStuffAndStopTheWorld callback

This is a small refactoring to prepare for porting LSan to Fuchsia.
On Fuchsia, the system supplies a unified API for suspending threads and
enumerating roots from OS-specific places like thread state and global data
ranges. So its LockStuffAndStopTheWorld implementation will make specific
callbacks for all the OS-specific root collection work before making the
common callback that includes the actual leak-checking logic.

Patch By: mcgrathr

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

4 years ago[GISelKnownBits] Add support for PHIs
Quentin Colombet [Sat, 25 Jan 2020 00:15:43 +0000 (16:15 -0800)]
[GISelKnownBits] Add support for PHIs

Teach the GISelKnowBits analysis how to deal with PHI operations.
PHIs are essentially COPYs happening on edges, so we can just reuse
the code for COPY.

This is NFC COPY-wise has we leave Depth untouched when calling
computeKnownBitsImpl for COPYs, like it was before this patch.
Increasing Depth is however required for PHIs as they may loop back to
themselves and we would end up in an infinite loop if we were not
increasing Depth.

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

4 years ago[sanitizer_common] Implement MemoryMappingLayout for Fuchsia
Roland McGrath [Sat, 25 Jan 2020 00:33:49 +0000 (16:33 -0800)]
[sanitizer_common] Implement MemoryMappingLayout for Fuchsia

This is needed to port lsan to Fuchsia.

Patch By: mcgrathr

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

4 years ago[mlir] [VectorOps] Rewriting of vector.extract/insert_slices to other vector ops
aartbik [Sat, 25 Jan 2020 00:23:54 +0000 (16:23 -0800)]
[mlir] [VectorOps] Rewriting of vector.extract/insert_slices to other vector ops

Summary:
Rewrites the extract/insert_slices operation in terms of
strided_slice/insert_strided_slice ops with intermediate
tuple uses (that should get optimimized away with typical
usage). This is done in a separate "pass" to enable testing
this particular rewriting in isolation.

Reviewers: nicolasvasilache, andydavis1, ftynse

Reviewed By: nicolasvasilache

Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Lit] Change the lldbtest format to behave more like shell test.
Jonas Devlieghere [Sat, 25 Jan 2020 00:11:18 +0000 (16:11 -0800)]
[lldb/Lit] Change the lldbtest format to behave more like shell test.

The current lldbtest format has a number of shortcomings, all related to
how we omit information based on why the test fails. For example, a
successful test would print nothing, even when `-a` is passed to lit.
It's not up to the test format to decide whether to print something or
not, that's handled by lit itself. For other test results we would
sometimes print stdout & stderr, but not always, such as when a timeout
was reached or we couldn't parse the dotest output.

This patch changes the lldbtest format and makes it behave more like
lit. We now always print the dotest invocation, the exit code, the
output to stdout & stderr. If you're used to dealing with ShTests in
lit, this will feel all very familiar.

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

4 years ago[codeview] Prune SimpleTypeSerializer.h headers, NFC
Reid Kleckner [Sat, 25 Jan 2020 00:03:41 +0000 (16:03 -0800)]
[codeview] Prune SimpleTypeSerializer.h headers, NFC

These are left over from when the class was more complicated. Add a
header comment banner to the .cpp file, which was missing.

4 years agoDetect source location overflow due includes
Diogo Sampaio [Fri, 24 Jan 2020 23:56:12 +0000 (23:56 +0000)]
Detect source location overflow due includes

Summary:
As discussed in http://lists.llvm.org/pipermail/cfe-dev/2019-October/063459.html
the overflow of the souce locations (limited to 2^31 chars) can generate all sorts of
weird things (bogus warnings, hangs, crashes, miscompilation and correct compilation).
In debug mode this assert would fail. So it might be a good start, as in PR42301,
to detect the failure and exit with a proper error message.

Reviewers: rsmith, thakis, miyuki

Reviewed By: miyuki

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[libc] Move the implementation of mmap and munmap into a linux specific area.
Siva Chandra Reddy [Tue, 7 Jan 2020 21:46:12 +0000 (13:46 -0800)]
[libc] Move the implementation of mmap and munmap into a linux specific area.

This allows us to get rid of the PAGE_SIZE macro and use EXEC_PAGESIZE
from linux/param.h.

Few other points about this change:
1. The linux syscall functions have been moved into a linux specific area
instead of src/unistd/syscall.h. The Linux syscall function from unistd.h
is a public vararg function. What we have currently are linux speciif internal
overloaded C++ functions. So, moving them to a Linux only area is more
meaningful.
2. The implementations of mmap and munmap are now in a 'linux' directory
within src/sys/mman. The idea here is that platform specific
implementations will live in a platform specific subdirectories like these.
Infrastructure common to a platform will live in the platform's config
directory. For example, the linux syscall implementations live in
config/linux.

Reviewers: abrachet

Tags: #libc-project

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

4 years ago[lldb/debugserver] Implement hardware breakpoints for x86_64 and i386
Jonas Devlieghere [Fri, 24 Jan 2020 23:06:00 +0000 (15:06 -0800)]
[lldb/debugserver] Implement hardware breakpoints for x86_64 and i386

This implements hardware breakpoints for x86_64 and i386 in debugserver.
It's based on Pedro's patch sent to lldb-commits [1] although most of it
is the same as the existing hardware watchpoint implementation.

[1] http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20200113/060327.html

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

4 years ago[lldb/debugserver] Unify the breakpoint/watchpoint interface (NFCI)
Jonas Devlieghere [Fri, 24 Jan 2020 23:03:56 +0000 (15:03 -0800)]
[lldb/debugserver] Unify the breakpoint/watchpoint interface (NFCI)

Unify the interface for enabling and disabling breakpoints with their
watchpoint counterpart. This allows both to go through
DoHardwareBreakpointAction.

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

4 years ago[GWP-ASan] Add names to anonymous mappings.
Mitch Phillips [Fri, 24 Jan 2020 23:01:47 +0000 (15:01 -0800)]
[GWP-ASan] Add names to anonymous mappings.

Summary:
Adds names to anonymous GWP-ASan mappings. This helps Android with debugging
via. /proc/maps, as GWP-ASan-allocated mappings are now easily identifyable.

Reviewers: eugenis, cferris

Reviewed By: eugenis

Subscribers: merge_guards_bot, #sanitizers, llvm-commits, cryptoad, pcc

Tags: #sanitizers, #llvm

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

4 years ago[SelectionDag] Updated FoldConstantArithmetic method signature in preparation for...
@justice_adams (Justice Adams) [Fri, 24 Jan 2020 22:57:43 +0000 (17:57 -0500)]
[SelectionDag] Updated FoldConstantArithmetic method signature in preparation for merge with FoldConstantVectorArithmetic

Updated FoldConstantArithmetic method signature to match that of
FoldConstantVectorArithmetic in preparation for merging the two
functions together

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

This is the first step in combining the various
FoldConstantVectorArithmetic and FoldConstantVectorArithmetic
functions into one FoldConstantArithmetic function.

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

4 years agoclang: Only define OBJC_NEW_PROPERTIES when -x objective-c
Duncan P. N. Exon Smith [Sat, 18 Jan 2020 01:15:02 +0000 (17:15 -0800)]
clang: Only define OBJC_NEW_PROPERTIES when -x objective-c

Since 2009 (in r63846) we've been `#define`-ing OBJC_NEW_PROPERTIES all
the time on Darwin, but this macro only makes sense for `-x objective-c`
and `-x objective-c++`.  Restrict it to those cases (for which there is
already separate logic).

https://reviews.llvm.org/D72970
rdar://problem/10050342

4 years ago[X86] Break the loop in LowerReturn into 2 loops. NFCI
Craig Topper [Fri, 24 Jan 2020 22:35:15 +0000 (14:35 -0800)]
[X86] Break the loop in LowerReturn into 2 loops. NFCI

I believe for STRICT_FP I need to use a STRICT_FP_EXTEND for the extending to f80 for returning f32/f64 in 32-bit mode when SSE is enabled. The STRICT_FP_EXTEND node requires a Chain. I need to get that node onto the chain before any CopyToRegs are emitted. This is because all the CopyToRegs are glued and chained together. So I can't put a STRICT_FP_EXTEND on the chain between the glued nodes without also glueing the STRICT_ FP_EXTEND.

This patch moves all the extend creation to a first pass and then creates the copytoregs and fills out RetOps in a second pass.

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

4 years ago[X86] Make `llc --help` output readable again
Roman Lebedev [Fri, 24 Jan 2020 22:43:16 +0000 (01:43 +0300)]
[X86] Make `llc --help` output readable again

Long `cl::value_desc()` is added right after the flag name,
before `cl::desc()` column. And thus the `cl::desc()` column,
for all flags, is padded to the right,
which makes the output unreadable.

4 years ago[msan] Instrument x86.pclmulqdq* intrinsics.
Evgenii Stepanov [Fri, 24 Jan 2020 19:08:49 +0000 (11:08 -0800)]
[msan] Instrument x86.pclmulqdq* intrinsics.

Summary:
These instructions ignore parts of the input vectors which makes the
default MSan handling too strict and causes false positive reports.

Reviewers: vitalybuka, RKSimon, thakis

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[WebAssembly] Update bleeding-edge CPU features
Heejin Ahn [Fri, 24 Jan 2020 03:32:32 +0000 (19:32 -0800)]
[WebAssembly] Update bleeding-edge CPU features

Summary:
This adds bulk memory and tail call to "bleeding-edge" CPU, since their
implementation in LLVM/clang seems mostly complete.

Reviewers: tlively

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

Tags: #clang

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

4 years ago[WebAssembly] Add reference types target feature
Heejin Ahn [Fri, 24 Jan 2020 03:22:51 +0000 (19:22 -0800)]
[WebAssembly] Add reference types target feature

Summary:
This adds the reference types target feature. This does not enable any
more functionality in LLVM/clang for now, but this is necessary to embed
the info in the target features section, which is used by Binaryen and
Emscripten. It turned out that after D69832 `-fwasm-exceptions` crashed
because we didn't have the reference types target feature.

Reviewers: tlively

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

Tags: #clang, #llvm

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

4 years ago[DAGCombiner] Add combine for (not (strict_fsetcc)) to create a strict_fsetcc with...
Craig Topper [Fri, 24 Jan 2020 21:28:11 +0000 (13:28 -0800)]
[DAGCombiner] Add combine for (not (strict_fsetcc)) to create a strict_fsetcc with the opposite condition.

Unlike the existing code that I modified here, I only handle the
case where the strict_fsetcc has a single use. Not sure exactly
how to handle multiples uses.

Testing this on X86 is hard because we already have a other
combines that get rid of lowered version of the integer setcc that
this xor will eventually become. So this combine really just
saves a bunch of extra nodes being created. Not sure about other
targets.

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

4 years ago[LLDB][NFC] Adding clarifying comment in SymbolFileDWARFDebugMap::DumpClangAST(...)
shafik [Fri, 24 Jan 2020 21:54:25 +0000 (13:54 -0800)]
[LLDB][NFC] Adding clarifying comment in SymbolFileDWARFDebugMap::DumpClangAST(...)

It is not obvious that the code was correct since it would seem as if we want to perform the dump for
each symbol file.

4 years ago[PATCH] [Target] Test commit
Evandro Menezes [Fri, 24 Jan 2020 21:34:41 +0000 (13:34 -0800)]
[PATCH] [Target] Test commit

Modify comment to reflect the current users of `Regisgter.CostPerUse`.

4 years ago[GWP-ASan] enable/disable and fork support.
Evgenii Stepanov [Sat, 11 Jan 2020 00:01:01 +0000 (16:01 -0800)]
[GWP-ASan] enable/disable and fork support.

Summary:
* Implement enable() and disable() in GWP-ASan.
* Setup atfork handler.
* Improve test harness sanity and re-enable GWP-ASan in Scudo.

Scudo_standalone disables embedded GWP-ASan as necessary around fork().
Standalone GWP-ASan sets the atfork handler in init() if asked to. This
requires a working malloc(), therefore GWP-ASan initialization in Scudo
is delayed to the post-init callback.

Test harness changes are about setting up a single global instance of
the GWP-ASan allocator so that pthread_atfork() does not create
dangling pointers.

Test case shamelessly stolen from D72470.

Reviewers: cryptoad, hctim, jfb

Subscribers: mgorny, jfb, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[gn build] Port 8a81daaa8b5
LLVM GN Syncbot [Fri, 24 Jan 2020 21:42:43 +0000 (21:42 +0000)]
[gn build] Port 8a81daaa8b5

4 years ago[AST] Split parent map traversal logic into ParentMapContext.h
Reid Kleckner [Tue, 10 Dec 2019 01:03:47 +0000 (17:03 -0800)]
[AST] Split parent map traversal logic into ParentMapContext.h

The only part of ASTContext.h that requires most AST types to be
complete is the parent map. Nothing in Clang proper uses the ParentMap,
so split it out into its own class. Make ASTContext own the
ParentMapContext so there is still a one-to-one relationship.

After this change, 562 fewer files depend on ASTTypeTraits.h, and 66
fewer depend on TypeLoc.h:
  $ diff -u deps-before.txt deps-after.txt | \
    grep '^[-+] ' | sort | uniq -c | sort -nr | less
      562 -    ../clang/include/clang/AST/ASTTypeTraits.h
      340 +    ../clang/include/clang/AST/ParentMapContext.h
       66 -    ../clang/include/clang/AST/TypeLocNodes.def
       66 -    ../clang/include/clang/AST/TypeLoc.h
       15 -    ../clang/include/clang/AST/TemplateBase.h
  ...
I computed deps-before.txt and deps-after.txt with `ninja -t deps`.

This removes a common and key dependency on TemplateBase.h and
TypeLoc.h.

This also has the effect of breaking the ParentMap RecursiveASTVisitor
instantiation into its own file, which roughly halves the compilation
time of ASTContext.cpp (29.75s -> 17.66s). The new file takes 13.8s to
compile.

I left behind forwarding methods for getParents(), but clients will need
to include a new header to make them work:
  #include "clang/AST/ParentMapContext.h"

I noticed that this parent map functionality is unfortunately duplicated
in ParentMap.h, which only works for Stmt nodes.

Reviewed By: rsmith

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

4 years agoRevert a107f86 "[GlobalsAA] Add back a check to intrinsic_addresstaken.ll to see...
Craig Topper [Fri, 24 Jan 2020 21:02:24 +0000 (13:02 -0800)]
Revert a107f86 "[GlobalsAA] Add back a check to intrinsic_addresstaken.ll to see if the AVX and AVX512 bots still fail for it."

It still fails some buildbots which is what I was trying to test.

4 years agoAMDGPU/GlobalISel: Select wqm, softwqm and wwm intrinsics
Matt Arsenault [Fri, 17 Jan 2020 05:22:23 +0000 (00:22 -0500)]
AMDGPU/GlobalISel: Select wqm, softwqm and wwm intrinsics

4 years agoAMDGPU: Don't error on ds.ordered intrinsic in function
Matt Arsenault [Sun, 5 Jan 2020 19:16:22 +0000 (14:16 -0500)]
AMDGPU: Don't error on ds.ordered intrinsic in function

These should be assumed to be called from a compute context. Also
don't use a 2 entry switch over constants.

4 years ago[gn build] Port 3f8b100e94b
LLVM GN Syncbot [Fri, 24 Jan 2020 21:02:26 +0000 (21:02 +0000)]
[gn build] Port 3f8b100e94b

4 years ago[clang-tidy] Add library for clang-tidy main function
Dmitry Polukhin [Fri, 24 Jan 2020 00:42:14 +0000 (16:42 -0800)]
[clang-tidy] Add library for clang-tidy main function

Summary:
This library allows to create clang-tidy tools with custom checks outside of llvm repo
using prebuilt clang release tarball.

Test Plan:
Checked that clang-tidy works as before. New library exists in istall dir.

Reviewers: smeenai, gribozavr, stephanemoore

Subscribers: mgorny, xazax.hun, cfe-commits

Tags: #clang-tools-extra, #clang

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

4 years agoCorrect NumLoads in clustering
Stanislav Mekhanoshin [Fri, 24 Jan 2020 20:02:54 +0000 (12:02 -0800)]
Correct NumLoads in clustering

Scheduler sends NumLoads argument into shouldClusterMemOps()
one less the actual cluster length. So for 2 instructions
it will pass just 1. Correct this number.

This is NFC for in tree targets.

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

4 years agoTableGen/GlobalISel: Handle non-leaf EXTRACT_SUBREG
Matt Arsenault [Tue, 14 Jan 2020 21:02:02 +0000 (16:02 -0500)]
TableGen/GlobalISel: Handle non-leaf EXTRACT_SUBREG

This previously only handled EXTRACT_SUBREGs from leafs, such as
operands directly in the original output. Handle extracting from a
result instruction.

4 years agoTableGen: Work around assert on Mips register definitions
Matt Arsenault [Wed, 15 Jan 2020 16:21:56 +0000 (11:21 -0500)]
TableGen: Work around assert on Mips register definitions

This would hit the "Biggest class wasn't first" assert in
getMatchingSubClassWithSubRegs in a future patch for EXTRACT_SUBREG
handling.

Mips defines 4 identical register classes (MSA128B, MSA128H, MSA128BW,
MSA128D). These have the same set of registers, and only differ by the
isel type. I believe this is an ill formed way of defining registers,
that probably is just to work around the inconvenience of mixing
different types in a single register class in DAG patterns.

Since these all have the same size, they would all sort to the
beginning, but you would not necessarily get the same super register
at the front as the assert enforces. Breaking the ambiguity by also
sorting by name doesn't work, since each of these register classes all
want to be first. Force sorting of the original register class if the
size is the same.

4 years agoAMDGPU: Don't check constant address space for atomic stores
Matt Arsenault [Fri, 24 Jan 2020 16:11:57 +0000 (11:11 -0500)]
AMDGPU: Don't check constant address space for atomic stores

We define a separate list for storable address spaces. This saves
entry in the matcher table address space list.

4 years agoAMDGPU/GlobalISel: Add selection tests for G_ATOMICRMW_ADD
Matt Arsenault [Fri, 24 Jan 2020 15:44:44 +0000 (10:44 -0500)]
AMDGPU/GlobalISel: Add selection tests for G_ATOMICRMW_ADD

4 years ago[GlobalsAA] Add back a check to intrinsic_addresstaken.ll to see if the AVX and AVX51...
Craig Topper [Fri, 24 Jan 2020 19:52:17 +0000 (11:52 -0800)]
[GlobalsAA] Add back a check to intrinsic_addresstaken.ll to see if the AVX and AVX512 bots still fail for it.

These bots failed for this several months ago and as a result, this
check was removed. If they still fail I'm going to try to see if I
can figure out why.

4 years agoInclude <cstdlib> for std::abort() in clangd
Dimitry Andric [Thu, 23 Jan 2020 09:11:17 +0000 (10:11 +0100)]
Include <cstdlib> for std::abort() in clangd

This fixes a "not a member of 'std'" error with e.g. Fedora 32.

Closes: #105

4 years ago[gn build] Port 555d8f4ef5e
LLVM GN Syncbot [Fri, 24 Jan 2020 19:37:54 +0000 (19:37 +0000)]
[gn build] Port 555d8f4ef5e

4 years agoMake address-space-lambda.cl pass on 32-bit Windows
Hans Wennborg [Fri, 24 Jan 2020 19:34:36 +0000 (20:34 +0100)]
Make address-space-lambda.cl pass on 32-bit Windows

Member functions will have the thiscall attribute on them.

4 years ago[AMDGPU] Bundle loads before post-RA scheduler
Stanislav Mekhanoshin [Mon, 13 Jan 2020 22:54:17 +0000 (14:54 -0800)]
[AMDGPU] Bundle loads before post-RA scheduler

We are relying on atrificial DAG edges inserted by the
MemOpClusterMutation to keep loads and stores together in the
post-RA scheduler. This does not work all the time since it
allows to schedule a completely independent instruction in the
middle of the cluster.

Removed the DAG mutation and added pass to bundle already
clustered instructions. These bundles are unpacked before the
memory legalizer because it does not work with bundles but also
because it allows to insert waitcounts in the middle of a store
cluster.

Removing artificial edges also allows a more relaxed scheduling.

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

4 years ago[PGO] Attach appropriate funclet operand bundles to value profiling instrumentation...
Andy Kaylor [Fri, 24 Jan 2020 19:19:08 +0000 (11:19 -0800)]
[PGO] Attach appropriate funclet operand bundles to value profiling instrumentation calls

Patch by Chris Chrulski

When generating value profiling instrumentation, ensure the call gets the
correct funclet token, otherwise WinEHPrepare will turn the call (and all
subsequent instructions) into unreachable.

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

4 years ago[AMDGPU] Allow narrowing muti-dword loads
Stanislav Mekhanoshin [Tue, 21 Jan 2020 20:49:25 +0000 (12:49 -0800)]
[AMDGPU] Allow narrowing muti-dword loads

Currently BE allows only a little load narrowing because
of the fear it will produce sub-dword ext loads. However,
we can always allow narrowing if we are shrinking one
multi-dword load to another multi-dword load.

In particular we were unable to reduce s_load_dwordx8 into
s_load_dwordx4 if identity shuffle was used to extract
low 4 dwords.

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

4 years agoAllow combining of extract_subvector to extract element
Stanislav Mekhanoshin [Tue, 21 Jan 2020 20:27:13 +0000 (12:27 -0800)]
Allow combining of extract_subvector to extract element

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

4 years agoResubmit: [DA][TTI][AMDGPU] Add option to select GPUDA with TTI
Austin Kerbow [Mon, 20 Jan 2020 15:25:20 +0000 (07:25 -0800)]
Resubmit: [DA][TTI][AMDGPU] Add option to select GPUDA with TTI

Summary:
Enable the new diveregence analysis by default for AMDGPU.

Resubmit with test updates since GPUDA was causing failures on Windows.

Reviewers: rampitec, nhaehnle, arsenm, thakis

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

Tags: #llvm

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

4 years agoSupport Swift calling convention for WebAssembly targets
Yuta Saito [Fri, 24 Jan 2020 18:20:07 +0000 (10:20 -0800)]
Support Swift calling convention for WebAssembly targets

This adds basic support for the Swift calling convention with WebAssembly
targets.

Reviewed By: dschuff

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

4 years ago[DA] Don't propagate from unreachable blocks
Austin Kerbow [Fri, 24 Jan 2020 03:49:20 +0000 (19:49 -0800)]
[DA] Don't propagate from unreachable blocks

Summary: Fixes crash that could occur when a divergent terminator has an unreachable parent.

Reviewers: rampitec, nhaehnle, arsenm

Subscribers: jvesely, wdng, hiraditya, jfb, llvm-commits

Tags: #llvm

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

4 years agoAdd test for spaceship operator to __config
David Zarzycki [Fri, 24 Jan 2020 18:26:53 +0000 (13:26 -0500)]
Add test for spaceship operator to __config

Summary:
The libcxx test suite auto-detects spaceship operator, but __config does not. This means that the libcxx test suite has been broken for over a month when using top-of-tree clang. This also really ought to be fixed before 10.0.

See: bc633a42dd409dbeb456263e3388b8caa4680aa0

Reviewers: chandlerc, mclow.lists, EricWF, ldionne, CaseyCarter

Reviewed By: EricWF

Subscribers: broadwaylamb, hans, dexonsmith, tstellar, llvm-commits, libcxx-commits

Tags: #libc, #llvm

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

4 years agoFix some comment typos. NFC.
Simon Pilgrim [Fri, 24 Jan 2020 18:16:28 +0000 (18:16 +0000)]
Fix some comment typos. NFC.

4 years ago[LoopStrengthReduce] Teach LoopStrengthReduce to preserve MemorySSA is available.
Alina Sbirlea [Fri, 24 Jan 2020 01:00:48 +0000 (17:00 -0800)]
[LoopStrengthReduce] Teach LoopStrengthReduce to preserve MemorySSA is available.

4 years ago[PGO] Early detection regarding whether pgo counter promotion is possible
Andy Kaylor [Fri, 24 Jan 2020 17:05:10 +0000 (09:05 -0800)]
[PGO] Early detection regarding whether pgo counter promotion is possible

Patch by Chris Chrulski

This fixes a problem with the current behavior when assertions are enabled.
A loop that exits to a catchswitch instruction is skipped for the counter
promotion, however this check was being done after the PGOCounterPromoter
tried to collect an insertion point for the exit block. A call to
getFirstInsertionPt() on a block that begins with a catchswitch instruction
triggers an assertion. This change performs a check whether the counter
promotion is possible prior to collecting the ExitBlocks and InsertPts.

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

4 years ago[PatchableFunction] Allow empty entry MachineBasicBlock
Fangrui Song [Thu, 23 Jan 2020 22:46:28 +0000 (14:46 -0800)]
[PatchableFunction] Allow empty entry MachineBasicBlock

Reviewed By: nickdesaulniers

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

4 years agoVerify that clang's max alignment is <= LLVM's max alignment
David Zarzycki [Fri, 24 Jan 2020 17:37:05 +0000 (12:37 -0500)]
Verify that clang's max alignment is <= LLVM's max alignment

Reviewers: lebedev.ri

Reviewed By: lebedev.ri

Subscribers: cfe-commits

Tags: #llvm, #clang

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

4 years ago[ARM] Use reduction intrinsics for larger than legal reductions
David Green [Fri, 24 Jan 2020 14:21:45 +0000 (14:21 +0000)]
[ARM] Use reduction intrinsics for larger than legal reductions

The codegen for splitting a llvm.vector.reduction intrinsic into parts
will be better than the codegen for the generic reductions. This will
only directly effect when vectorization factors are specified by the
user.

Also added tests to make sure the codegen for larger reductions is OK.

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

4 years ago[ELF][PowerPC] Support R_PPC_COPY and R_PPC64_COPY
Fangrui Song [Thu, 23 Jan 2020 07:26:49 +0000 (23:26 -0800)]
[ELF][PowerPC] Support R_PPC_COPY and R_PPC64_COPY

Reviewed By: Bdragon28, jhenderson, grimar, sfertile

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

4 years ago[VE] global variable isel patterns
Kazushi (Jam) Marukawa [Fri, 24 Jan 2020 16:33:57 +0000 (17:33 +0100)]
[VE] global variable isel patterns

Summary: Asm expr fixups, isel patterns and tests for global variables addresses.

Reviewed By: arsenm

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

4 years ago[DebugInfo][LiveDebugValues] Teach Live Debug Values About Meta Instructions
Tom Weaver [Fri, 24 Jan 2020 16:29:05 +0000 (16:29 +0000)]
[DebugInfo][LiveDebugValues] Teach Live Debug Values About Meta Instructions

Previously LiveDebugValues pass would consider meta instructions that 'fiddle' with liveness of registers as register definitions when transfering register defs. This would mean that, for example, a KILL instruction would cause LiveDebugValues to terminate the range of an earlier DBG_VALUE instruction resulting in the none propogation of said DBG_VALUE instructions into later blocks.

This patch adds the check and a helpful comment, fixes a test that previously tested for the broken behaviour by coincidence and adds a test specifically for this.

reviewers: vsk, dstenb, djtodoro

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

4 years ago[analyzer] PthreadLock: Implement dead region cleanup.
Artem Dergachev [Fri, 24 Jan 2020 15:38:57 +0000 (18:38 +0300)]
[analyzer] PthreadLock: Implement dead region cleanup.

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

4 years ago[analyzer] PthreadLock: Implement mutex escaping.
Artem Dergachev [Fri, 24 Jan 2020 15:34:04 +0000 (18:34 +0300)]
[analyzer] PthreadLock: Implement mutex escaping.

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

4 years ago[analyzer] NFC: PthreadLock: Use CallDescriptionMap, modernize.
Artem Dergachev [Fri, 24 Jan 2020 15:23:15 +0000 (18:23 +0300)]
[analyzer] NFC: PthreadLock: Use CallDescriptionMap, modernize.

https://reviews.llvm.org/D37809

4 years ago[analyzer] PthreadLock: Add more XNU rwlock unlock functions.
Artem Dergachev [Fri, 24 Jan 2020 14:53:52 +0000 (17:53 +0300)]
[analyzer] PthreadLock: Add more XNU rwlock unlock functions.

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

4 years ago[analyzer] PthreadLock: Fix return value modeling for XNU lock functions.
Artem Dergachev [Fri, 24 Jan 2020 14:52:41 +0000 (17:52 +0300)]
[analyzer] PthreadLock: Fix return value modeling for XNU lock functions.

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

4 years ago[X86][SSE] combineTargetShuffle - permilps(shufps(load(),x)) --> permilps(shufps...
Simon Pilgrim [Fri, 24 Jan 2020 15:22:56 +0000 (15:22 +0000)]
[X86][SSE] combineTargetShuffle - permilps(shufps(load(),x)) --> permilps(shufps(x,load()))

Moves lowerShuffleWithSHUFPS commutation code from rG30fcd29fe479 to catch cases during combine

4 years ago[Sema] Provide declarations for MaximumAlignment, MaxAlignmentExponent variables
Roman Lebedev [Fri, 24 Jan 2020 15:17:34 +0000 (18:17 +0300)]
[Sema] Provide declarations for MaximumAlignment, MaxAlignmentExponent variables

clang-armv7-linux-build-cache bot is complaining about undefined
references to these variables during linking, so by explicitly
placing them in some TU we should be able to fix that.

4 years ago[llvm-objcopy][COFF] Add support for --set-section-flags
Sergey Dmitriev [Fri, 24 Jan 2020 14:36:09 +0000 (06:36 -0800)]
[llvm-objcopy][COFF] Add support for --set-section-flags

Reviewers: jhenderson, MaskRay, alexshap, rupprecht, mstorsjo

Reviewed By: jhenderson

Subscribers: abrachet, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Remove pesky ;. NFC
Sam McCall [Fri, 24 Jan 2020 15:12:00 +0000 (16:12 +0100)]
[clangd] Remove pesky ;. NFC

4 years ago[clangd] Rename DiagnosticsConsumer -> ClangdServer::Callbacks, and make it optional
Sam McCall [Fri, 24 Jan 2020 13:08:56 +0000 (14:08 +0100)]
[clangd] Rename DiagnosticsConsumer -> ClangdServer::Callbacks, and make it optional

Summary:
This reflects its current function better and avoids confusion with clang::DiagnosticConsumer.

The old name/constructor is left around temporarily for compatibility.
(Metagame: merging with out-of-tree changes is harder than usual this month)

Reviewers: hokein

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[Sema] Introduce MaximumAlignment value, to be used instead of magical constants
Roman Lebedev [Fri, 24 Jan 2020 14:01:27 +0000 (17:01 +0300)]
[Sema] Introduce MaximumAlignment value, to be used instead of magical constants

There is llvm::Value::MaximumAlignment, which is numerically
equivalent to these constants, but we can't use it directly
because we can't include llvm IR headers in clang Sema.
So instead, copy-paste the constant, and fixup the places to use it.

This was initially reviewed in https://reviews.llvm.org/D72998

4 years ago[VE] aligned load/store isel patterns
Kazushi (Jam) Marukawa [Fri, 24 Jan 2020 14:09:08 +0000 (15:09 +0100)]
[VE] aligned load/store isel patterns

Summary:
Aligned load/store isel patterns and tests for
i1/i8/16/32/64 (including extension and truncation) and fp32/64.

Reviewed By: arsenm

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

4 years agoFileCheck [9/12]: Add support for matching formats
Thomas Preud'homme [Tue, 5 Mar 2019 23:20:29 +0000 (23:20 +0000)]
FileCheck [9/12]: Add support for matching formats

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support for selecting a
matching format to match a numeric value against (ie. decimal, hex lower
case letters or hex upper case letters).

This commit allows to select what format a numeric value should be
matched against. The following formats are supported: decimal value,
lower case hex value and upper case hex value. Matching formats impact
both the format of numeric value to be matched as well as the format of
accepted numbers in a definition with empty numeric expression
constraint.

Default for absence of format is decimal value unless the numeric
expression constraint is non null and use a variable in which case the
format is the one used to define that variable. Conclict of format in
case of several variable being used is diagnosed and forces the user to
select a matching format explicitely.

This commit also enables immediates in numeric expressions to be in any
radix known to StringRef's GetAsInteger method, except for legacy
numeric expressions (ie [[@LINE+<offset>]] which only support decimal
immediates.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson

Reviewed By: jhenderson, arichardson

Subscribers: daltenty, MaskRay, hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

4 years ago[Sema] Try 2: Sanity-check alignment requested via `__attribute__((assume_aligned...
Roman Lebedev [Thu, 23 Jan 2020 19:48:57 +0000 (22:48 +0300)]
[Sema] Try 2: Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`

Summary:
For `__builtin_assume_aligned()`, we do validate that the alignment
is not greater than `536870912` (D68824), but we don't do that for
`__attribute__((assume_aligned(N)))` attribute.
I suspect we should.

This was initially committed in a4cfb15d15a8a353fe316f2a9fe1c8c6a6740ef1
but reverted in 210f0882c9e5d6f504b8f29e8a5eae884f812e5c due to
suspicious bot failures.

Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert

Reviewed By: erichkeane

Subscribers: cfe-commits, llvm-commits

Tags: #llvm, #clang

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

4 years ago[PowerPC][Future] Add prefixed instruction paddi to future CPU
Victor Huang [Thu, 23 Jan 2020 20:01:02 +0000 (14:01 -0600)]
[PowerPC][Future] Add prefixed instruction paddi to future CPU

Future CPU will include support for prefixed instructions.
These prefixed instructions are formed by a 4 byte prefix
immediately followed by a 4 byte instruction effectively
making an 8 byte instruction. The new instruction paddi
is a prefixed form of addi.

This patch adds paddi and all of the support required
for that instruction. The majority of the patch deals with
supporting the new prefixed instructions. The addition of
paddi is mainly to allow for testing.

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

4 years ago[lldb][NFC] Cleanup some if conditions in ASTImporterDelegate::Imported
Raphael Isemann [Fri, 24 Jan 2020 11:54:06 +0000 (12:54 +0100)]
[lldb][NFC] Cleanup some if conditions in ASTImporterDelegate::Imported

4 years ago[clangd][Hover] Change arrow in return type back to →
Kadir Cetinkaya [Fri, 24 Jan 2020 10:35:24 +0000 (11:35 +0100)]
[clangd][Hover] Change arrow in return type back to →

Summary:
Currently 🡺 is used in hover response to represent return types, but it
is not widely available. Changing this back to original to support more clients.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[X86][SSE] Add another shufps+shufps test for fold through commutation
Simon Pilgrim [Fri, 24 Jan 2020 12:03:56 +0000 (12:03 +0000)]
[X86][SSE] Add another shufps+shufps test for fold through commutation

4 years ago[X86][SSE] lowerShuffleWithSHUFPS - commute '2*V1+2*V2 elements' mask if it allows...
Simon Pilgrim [Fri, 24 Jan 2020 11:52:47 +0000 (11:52 +0000)]
[X86][SSE] lowerShuffleWithSHUFPS - commute '2*V1+2*V2 elements' mask if it allows a loaded fold

As mentioned on D73023.

4 years ago[Alignment][NFC] Deprecate Align::None()
Guillaume Chatelet [Tue, 21 Jan 2020 14:00:04 +0000 (15:00 +0100)]
[Alignment][NFC] Deprecate Align::None()

Summary:
This is a follow up on https://reviews.llvm.org/D71473#inline-647262.
There's a caveat here that `Align(1)` relies on the compiler understanding of `Log2_64` implementation to produce good code. One could use `Align()` as a replacement but I believe it is less clear that the alignment is one in that case.

Reviewers: xbolva00, courbet, bollu

Subscribers: arsenm, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, jrtc27, atanasyan, jsji, Jim, kerbowa, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[llvm-exegesis][NFC] Simplify code.
Clement Courbet [Fri, 24 Jan 2020 10:42:27 +0000 (11:42 +0100)]
[llvm-exegesis][NFC] Simplify code.

Summary:
What we're redoing already exists in the X86 backend, it's called
`X86II::getOperandBias`.

Reviewers: gchatelet

Subscribers: tschuett, mstojanovic, llvm-commits

Tags: #llvm

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

4 years ago[Sema] Try 2: Attempt to perform call-size-specific `__attribute__((alloc_align(param...
Roman Lebedev [Thu, 23 Jan 2020 19:49:50 +0000 (22:49 +0300)]
[Sema] Try 2: Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

Summary:
`alloc_align` attribute takes parameter number, not the alignment itself,
so given **just** the attribute/function declaration we can't do any
sanity checking for said alignment.

However, at call site, given the actual `Expr` that is passed
into that parameter, we //might// be able to evaluate said `Expr`
as Integer Constant Expression, and perform the sanity checks.
But since there is no requirement for that argument to be an immediate,
we may fail, and that's okay.

However if we did evaluate, we should enforce the same constraints
as with `__builtin_assume_aligned()`/`__attribute__((assume_aligned(imm)))`:
said alignment is a power of two, and is not greater than our magic threshold

This was initially committed in c2a9061ac5166e48fe85ea2b6dbce9457c964958
but reverted in 00756b182398b92abe16559287467079087aa631 because of
suspicious bot failures.

Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[llvm-readelf] - Improve dumping of objects without a section header string table.
Georgii Rymar [Wed, 22 Jan 2020 14:20:07 +0000 (17:20 +0300)]
[llvm-readelf] - Improve dumping of objects without a section header string table.

We have a test/Object/no-section-header-string-table.test which checks
what happens when an object does not have a section header string table.
It does not check the full output though.
Currently our output is different from GNU readelf, because the latter prints
"<no-strings>" instead of a section name, while we print nothing.

This patch fixes this, adds a proper test case and removes the one from test/Object,
as it is not a right folder for llvm-readelf tests.

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

4 years ago[clangd] Show background index status using LSP 3.15 work-done progress notifications
Sam McCall [Wed, 22 Jan 2020 18:41:45 +0000 (19:41 +0100)]
[clangd] Show background index status using LSP 3.15 work-done progress notifications

Summary:
It simply shows the completed/total items on the background queue, e.g.
 indexing: 233/1000
The denominator is reset to zero every time the queue goes idle.

The protocol is fairly complicated here (requires creating a remote "progress"
resource before sending updates). We implement the full protocol, but I've added
an extension allowing it to be skipped to reduce the burden on clients - in
particular the lit test takes this shortcut.

The addition of background index progress to DiagnosticConsumer seems ridiculous
at first glance, but I believe that interface is trending in the direction of
"ClangdServer callbacks" anyway. It's due for a rename, but otherwise actually
fits.

Reviewers: kadircet, usaxena95

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[X86][SSE] Add shufps+shufps test for fold through commutation
Simon Pilgrim [Fri, 24 Jan 2020 11:16:16 +0000 (11:16 +0000)]
[X86][SSE] Add shufps+shufps test for fold through commutation

As mentioned on D73023, lowerShuffleWithSHUFPS should be able to commute the shufps inputs to fold the second arg as it will then permute the shufps result anyway.

4 years ago[lldb/DWARF] Remove a workaround from DebugNamesDWARFIndex
Pavel Labath [Fri, 24 Jan 2020 11:07:00 +0000 (12:07 +0100)]
[lldb/DWARF] Remove a workaround from DebugNamesDWARFIndex

This was needed when asking a compile unit for its dwo component
triggered a infinite recursion if the dwo unit has not been already
parsed.

This has since been fixed.

4 years ago[lldb] Fix nondeterminism in TestCppBitfields
Pavel Labath [Fri, 24 Jan 2020 11:02:43 +0000 (12:02 +0100)]
[lldb] Fix nondeterminism in TestCppBitfields

The test was printing a char[3] variable without a terminating nul. The
memory after that variable (an unnamed bitfield) was not initialized. If
the memory happened to be nonzero, the summary provider for the variable
would run off into the next field.

This is probably not the right behavior (it should stop at the end of
the array), but this is not the purpose of this test. I have filed
pr44649 for this bug, and fixed the test to not depend on this behavior.

4 years ago[NFC][ARM] Add test
Sam Parker [Fri, 24 Jan 2020 10:59:13 +0000 (10:59 +0000)]
[NFC][ARM] Add test

4 years ago[AArch64][SVE] Add intrinsics for FFR manipulation
Kerry McLaughlin [Fri, 24 Jan 2020 09:42:18 +0000 (09:42 +0000)]
[AArch64][SVE] Add intrinsics for FFR manipulation

Summary:
Implements the following intrinsics:
  - llvm.aarch64.sve.setffr
  - llvm.aarch64.sve.rdffr
  - llvm.aarch64.sve.rdffr.z
  - llvm.aarch64.sve.wrffr

Reviewers: sdesmalen, efriedma, dancgr, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[lldb][NFC] Fix formatting in ASTImporterDelegate::ImportImpl
Raphael Isemann [Fri, 24 Jan 2020 10:57:06 +0000 (11:57 +0100)]
[lldb][NFC] Fix formatting in ASTImporterDelegate::ImportImpl

4 years ago[lldb][NFC] Delete unused ClangASTImporter::CompleteDecl
Raphael Isemann [Fri, 24 Jan 2020 10:50:29 +0000 (11:50 +0100)]
[lldb][NFC] Delete unused ClangASTImporter::CompleteDecl

4 years ago[SelectionDAG] rot(x, y) --> x iff ComputeNumSignBits(x) == BitWidth(x)
Simon Pilgrim [Fri, 24 Jan 2020 10:35:19 +0000 (10:35 +0000)]
[SelectionDAG] rot(x, y) --> x iff ComputeNumSignBits(x) == BitWidth(x)

Rotating an 0/-1 value by any amount will always result in the same 0/-1 value

4 years ago[llvm-libc] Add memory function benchmarks
Guillaume Chatelet [Mon, 6 Jan 2020 12:17:04 +0000 (13:17 +0100)]
[llvm-libc] Add memory function benchmarks

Summary:
This patch adds a benchmarking infrastructure for llvm-libc memory functions.

In a nutshell, the code can benchmark small and large buffers for the memcpy, memset and memcmp functions.
It also produces graphs of size vs latency by running targets of the form `render-libc-{memcpy|memset|memcmp}-benchmark-{small|big}`.

The configurations are provided as JSON files and the benchmark also produces a JSON file.
This file is then parsed and rendered as a PNG file via the `render.py` script (make sure to run `pip3 install matplotlib scipy numpy`).
The script can take several JSON files as input and will superimpose the curves if they are from the same host.

TODO:
 - The code benchmarks whatever is available on the host but should be configured to benchmark the -to be added- llvm-libc memory functions.
 - Add a README file with instructions and rationale.
 - Produce scores to track the performance of the functions over time to allow for regression detection.

Reviewers: sivachandra, ckennelly

Subscribers: mgorny, MaskRay, libc-commits

Tags: #libc-project

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

4 years ago[mlir] Use all_of instead of a manual loop in IntrinsicGen. NFC
Alex Zinenko [Fri, 24 Jan 2020 10:27:17 +0000 (11:27 +0100)]
[mlir] Use all_of instead of a manual loop in IntrinsicGen. NFC

This was suggested in post-commit review of D72926.

4 years ago[doc][llvm-objcopy] Remove redundant COFF-specific sub-heading
James Henderson [Fri, 24 Jan 2020 09:49:55 +0000 (09:49 +0000)]
[doc][llvm-objcopy] Remove redundant COFF-specific sub-heading

The sub-heading used to contain the --only-keep-debug switch as that
switch wasn't implemented for ELF at one point. Since the switch is now
in the generic options section, and there are no other options in this
sub-heading, it is pointless and can be deleted.

4 years ago[NFC][ARM] Make some params members instead.
Sam Parker [Fri, 24 Jan 2020 10:17:43 +0000 (10:17 +0000)]
[NFC][ARM] Make some params members instead.

Add MachineLoopInfo and ReachingDefAnalysis as members of
LowOverheadLoop instead of passing them several times to different
methods.

4 years ago[clangd] Errors in TestTU cause test failures unless suppressed with error-ok.
Sam McCall [Wed, 22 Jan 2020 15:38:41 +0000 (16:38 +0100)]
[clangd] Errors in TestTU cause test failures unless suppressed with error-ok.

Summary:
The historic behavior of TestTU is to gather diagnostics and otherwise ignore
them. So if a test has a syntax error, and doesn't assert diagnostics, it
silently misbehaves.
This can be annoying when developing tests, as evidenced by various tests
gaining "assert no diagnostics" where that's not really the point of the test.

This patch aims to make that default behavior. For the first error
(not warning), TestTU will call ADD_FAILURE().

This can be suppressed with a comment containing "error-ok". For now that will
suppress any errors in the TU. We can make this stricter later -verify style.
(-verify itself is hard to reuse because of DiagnosticConsumer interfaces...)
A magic-comment was chosen over a TestTU option because of table-driven tests.

In addition to the behavior change, this patch:
  - adds //error-ok where we're knowingly testing invalid code
    (e.g. for diagnostics, crash-resilience, or token-level tests)
  - fixes a bunch of errors in the checked-in tests, mostly trivial (missing ;)
  - removes a bunch of now-redundant instances of "assert no diagnostics"

Reviewers: kadircet

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

Tags: #clang

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

4 years ago[X86] Add test showing failure to remove vector rotate of allsignbits
Simon Pilgrim [Fri, 24 Jan 2020 10:12:34 +0000 (10:12 +0000)]
[X86] Add test showing failure to remove vector rotate of allsignbits

Rotating an 0/-1 value by any amount will always result in the same 0/-1 value

4 years ago[clang][NFC] Remove redundant cast
Raphael Isemann [Fri, 24 Jan 2020 09:42:26 +0000 (10:42 +0100)]
[clang][NFC] Remove redundant cast

This cast just casts Decl* to Decl*.

4 years ago[Format] Fix 'auto x(T&&, T &&)->F' with PAS_Left.
Sam McCall [Fri, 24 Jan 2020 09:12:25 +0000 (10:12 +0100)]
[Format] Fix 'auto x(T&&, T &&)->F' with PAS_Left.

Summary:
An heuristic targetting `x && x->foo` was targed overly broadly and caused the
last T&& to be treated as a binary operator.

Reviewers: hokein

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[DWARF][test] Test all the call-site realted attrs
Djordje Todorovic [Thu, 23 Jan 2020 13:20:19 +0000 (14:20 +0100)]
[DWARF][test] Test all the call-site realted attrs

Adding the test for the call site encoding in DWARF5 vs GNU extensions.
Some of the attributes were not covered by any test.

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

4 years agoRecommit "[DWARF5][clang]: Added support for DebugInfo generation for auto return...
Awanish Pandey [Thu, 23 Jan 2020 10:36:52 +0000 (16:06 +0530)]
Recommit "[DWARF5][clang]: Added support for DebugInfo generation for auto return type for C++ member functions."

Summary:
This was reverted in e45fcfc3aa57bb237fd4fd694d0c257be66d5482 due to
libcxx build failure. This revision addresses that case.

Original commit message:
    This patch will provide support for auto return type for the C++ member
    functions.

    This patch includes clang side implementation of this feature.

    Patch by: Awanish Pandey <Awanish.Pandey@amd.com>

    Reviewers: dblaikie, aprantl, shafik, alok, SouraVX, jini.susan.george
    Reviewed by: dblaikie

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

4 years ago[WholeProgramDevirt][test] Fix test after D73094
Fangrui Song [Fri, 24 Jan 2020 08:46:18 +0000 (00:46 -0800)]
[WholeProgramDevirt][test] Fix test after D73094