platform/upstream/llvm.git
2 years ago[clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter
Balazs Benics [Sat, 4 Sep 2021 08:19:57 +0000 (10:19 +0200)]
[clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter

Thank you @martong for acquiring a suitable test case!

Reviewed By: shafik, martong

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

2 years ago[analyzer] SValBuilder should have an easy access to AnalyzerOptions
Balazs Benics [Sat, 4 Sep 2021 08:19:57 +0000 (10:19 +0200)]
[analyzer] SValBuilder should have an easy access to AnalyzerOptions

`SVB.getStateManager().getOwningEngine().getAnalysisManager().getAnalyzerOptions()`
is quite a mouthful and might involve a few pointer indirections to get
such a simple thing like an analyzer option.

This patch introduces an `AnalyzerOptions` reference to the `SValBuilder`
abstract class, while refactors a few cases to use this /simpler/ accessor.

Reviewed By: martong, Szelethus

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

2 years ago[analyzer] Ignore single element arrays in getStaticSize() conditionally
Balazs Benics [Sat, 4 Sep 2021 08:19:57 +0000 (10:19 +0200)]
[analyzer] Ignore single element arrays in getStaticSize() conditionally

Quoting https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html:
> In the absence of the zero-length array extension, in ISO C90 the contents
> array in the example above would typically be declared to have a single
> element.

We should not assume that the size of the //flexible array member// field has
a single element, because in some cases they use it as a fallback for not
having the //zero-length array// language extension.
In this case, the analyzer should return `Unknown` as the extent of the field
instead.

Reviewed By: martong

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

2 years ago[clang] NFC: Fix trivial typo in comments and document
Kazuaki Ishizaki [Sat, 4 Sep 2021 07:25:40 +0000 (12:55 +0530)]
[clang] NFC: Fix trivial typo in comments and document

`the the` -> `the`

Reviewed By: xgupta

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

2 years ago[mlir] create gpu memset op
Loren Maggiore [Sat, 4 Sep 2021 06:03:33 +0000 (08:03 +0200)]
[mlir] create gpu memset op

Create a gpu memset op and corresponding CUDA and ROCm wrappers.

Reviewed By: herhut, lorenrose1013

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

2 years ago[ForceFunctionAttrs] Add const (NFC)
Kazu Hirata [Sat, 4 Sep 2021 05:29:58 +0000 (22:29 -0700)]
[ForceFunctionAttrs] Add const (NFC)

2 years agoFix for commit d8cd7806310c51af912a647a6ca46de62ff13214.
Brad Smith [Sat, 4 Sep 2021 01:20:37 +0000 (21:20 -0400)]
Fix for commit d8cd7806310c51af912a647a6ca46de62ff13214.

2 years ago[clang] OpenBSD does not support C11 atomics or threads.
Brad Smith [Sat, 4 Sep 2021 01:11:32 +0000 (21:11 -0400)]
[clang] OpenBSD does not support C11 atomics or threads.

2 years agoRevert "[AArch64] Implement target hook function to decide folding (mul (add x, c1...
Kevin Athey [Sat, 4 Sep 2021 01:00:50 +0000 (18:00 -0700)]
Revert "[AArch64] Implement target hook function to decide folding (mul (add x, c1), c2)"

This reverts commit 095bea23d048672b0ad785c93263442694a160b9.

Broke buildbot: https://lab.llvm.org/buildbot/#/builders/5/builds/11411

2 years ago[MLIR] Primitive linkage lowering of FuncOp
William S. Moses [Sun, 22 Aug 2021 20:44:17 +0000 (16:44 -0400)]
[MLIR] Primitive linkage lowering of FuncOp

FuncOp always lowers to an LLVM external linkage presently. This makes it impossible to define functions in mlir which are local to the current module. Until MLIR FuncOps have a more formal linkage specification, this commit allows funcop's to have an optionally specified llvm.linkage attribute, whose value will be used as the linkage of the llvm funcop when lowered.

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

Support LLVM linkage

2 years agoSupport linking against OpenMP runtime on OpenBSD.
Brad Smith [Fri, 3 Sep 2021 23:32:31 +0000 (19:32 -0400)]
Support linking against OpenMP runtime on OpenBSD.

2 years ago[AArch64] Implement target hook function to decide folding (mul (add x, c1), c2)
Ben Shi [Fri, 27 Aug 2021 13:31:57 +0000 (21:31 +0800)]
[AArch64] Implement target hook function to decide folding (mul (add x, c1), c2)

Prevent the folding if it leads to worse code.

Reviewed By: dmgreen

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

2 years ago[ORC] Silence a buggy GCC unused argument warning.
Lang Hames [Fri, 3 Sep 2021 22:08:31 +0000 (08:08 +1000)]
[ORC] Silence a buggy GCC unused argument warning.

2 years agoDebugInfo: additional fix missed in bc066e2.
Richard Smith [Fri, 3 Sep 2021 22:14:00 +0000 (15:14 -0700)]
DebugInfo: additional fix missed in bc066e2.

2 years ago[lldb/Plugins] Move member template specialization out of class
Med Ismail Bennani [Fri, 3 Sep 2021 22:03:06 +0000 (22:03 +0000)]
[lldb/Plugins] Move member template specialization out of class

This patch should fix the build failure that surfaced when build llvm
with GCC: https://lab.llvm.org/staging/#/builders/16/builds/10450

GCC complained that I explicitely specialized
 `ScriptedPythonInterface::ExtractValueFromPythonObject` in a
in non-namespace scope, which is tolerated by Clang.

To solve this issue, the specialization were declared out of the class
and implemented in the source file.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years agoOpenBSD also needs execinfo
Brad Smith [Fri, 3 Sep 2021 21:31:26 +0000 (17:31 -0400)]
OpenBSD also needs execinfo

2 years agoMake LLVM Linkage a first class attribute instead of using an integer attribute
Mehdi Amini [Fri, 3 Sep 2021 21:18:39 +0000 (21:18 +0000)]
Make LLVM Linkage a first class attribute instead of using an integer attribute

This makes the IR more readable, in particular when this will be used on
the builtin func outside of the LLVM dialect.

Reviewed By: wsmoses

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

2 years ago[clang] Allow the OpenBSD driver to link the libclang_rt.profile library.
Frederic Cambus [Fri, 3 Sep 2021 20:53:36 +0000 (16:53 -0400)]
[clang] Allow the OpenBSD driver to link the libclang_rt.profile library.

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

2 years agoDebugInfo: Fix a few bot failures for type dumping fixes
David Blaikie [Fri, 3 Sep 2021 21:08:30 +0000 (14:08 -0700)]
DebugInfo: Fix a few bot failures for type dumping fixes

2 years ago[flang] Use CMake to determine endianness.
Michael Kruse [Fri, 3 Sep 2021 19:48:40 +0000 (14:48 -0500)]
[flang] Use CMake to determine endianness.

The preprocessor definitions __BYTE_ORDER__, __ORDER_BIG_ENDIAN__, and
__ORDER_LITTLE_ENDIAN__ are gcc extensions (also supported by clang),
but msvc (and others) do not define them. As a result __BYTE_ORDER__
and __ORDER_BIG_ENDIAN__ both evaluate to 0 by the prepreprocessor,
and __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__, the first `#if` condition
to 1, hence assuming the wrong byte order for x86(_64).

This patch instead uses CMake's TestBigEndian module to determine
target architecture's endianness at configure-time.

Note this also uses the same mechanism for the runtime. If compiling
flang as a cross-compiler, the runtime for the compile-target must be
built separately (Flang does not support the LLVM_ENABLE_RUNTIMES
mechanism yet).

Fixes llvm.org/PR51597

Reviewed By: ijan1, Leporacanthicus

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

2 years ago[libc] fix strtointeger hex prefix parsing
Michael Jones [Wed, 1 Sep 2021 20:09:29 +0000 (20:09 +0000)]
[libc] fix strtointeger hex prefix parsing

Fix edge case where "0x" would be considered a complete hexadecimal
number for purposes of str_end. Now the hexadecimal prefix needs a valid
digit after it, else just the 0 will be counted as the number.

Reviewed By: sivachandra

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

2 years ago[mlir][sparse] add convenience method for sparse tensor setup
Aart Bik [Fri, 3 Sep 2021 18:23:38 +0000 (11:23 -0700)]
[mlir][sparse] add convenience method for sparse tensor setup

This simplifies setting up sparse tensors through C-style data structures.
Useful for runtimes that want to interact with MLIR-generated code
without knowning about all bufferization details (viz. memrefs).

Reviewed By: bixia

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

2 years ago[NFC][OpenMP] Use clang_cc1 to driver tests
Jinsong Ji [Fri, 3 Sep 2021 20:33:47 +0000 (20:33 +0000)]
[NFC][OpenMP] Use clang_cc1 to driver tests

The test driver-fopenmp-extensions.c is failing on platforms that does
not use integrated-as. It can be reproduced using -fno-integrated-as on
Linux too.

bin/clang -c -Xclang -verify=omp -fopenmp      -fopenmp-extensions
-fno-openmp-extensions
../llvm-project/clang/test/OpenMP/driver-fopenmp-extensions.c
-fno-integrated-as
Assembler messages:
Error: can't open /tmp/driver-fopenmp-extensions-8fafe8.s for reading:
No such file or directory
clang-14: error: assembler command failed with exit code 1 (use -v to
see invocation)

The goal of this test is to verify syntax diags only,
so we should use clang_cc1 to test.

Reviewed By: jdenny, ABataev

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

2 years ago[lldb] Adjust parse_frames for unnamed images
Jonas Devlieghere [Fri, 3 Sep 2021 20:23:03 +0000 (13:23 -0700)]
[lldb] Adjust parse_frames for unnamed images

Follow up to 2cbd3b04feaaaff7fab4c6500476839a23180886 which added
support for unnamed images but missed the use case in parse_frames.

2 years ago[libc++] Add an assertion in the subrange constructors with a size hint
Louis Dionne [Fri, 27 Aug 2021 16:04:58 +0000 (12:04 -0400)]
[libc++] Add an assertion in the subrange constructors with a size hint

Those constructors are very easy to misuse -- one could easily think that
the size passed to the constructor is the size of the range to exhibit
from the subrange. Instead, it's a size hint and it's UB to get it wrong.
Hence, when it's cheap to compute the real size of the range, it's cheap
to make sure that the user didn't get it wrong.

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

2 years agoRevert "[Coroutines] [Clang] Look up coroutine component in std namespace first"
Louis Dionne [Fri, 3 Sep 2021 20:01:09 +0000 (16:01 -0400)]
Revert "[Coroutines] [Clang] Look up coroutine component in std namespace first"

This reverts commit 2fbd254aa46b, which broke the libc++ CI. I'm reverting
to get things stable again until we've figured out a way forward.

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

2 years agoDebugInfo: Correct/improve type formatting (pointers to function types especially)
David Blaikie [Fri, 3 Sep 2021 19:18:13 +0000 (12:18 -0700)]
DebugInfo: Correct/improve type formatting (pointers to function types especially)

This does add some extra superfluous whitespace (eg: "int *") intended
to make the Simplified Template Names work easier - this makes the
DIE-based names match more exactly the clang-generated names, so it's
easier to identify cases that don't generate matching names.

(arguably we could change clang to skip that whitespace or add some
fuzzy matching to accommodate differences in certain whitespace - but
this seemed easier and fairly low-impact)

2 years ago[SampleFDO] Fix -Wnon-virtual-dtor
Rong Xu [Fri, 3 Sep 2021 19:19:03 +0000 (12:19 -0700)]
[SampleFDO] Fix -Wnon-virtual-dtor

Make the dtor virtual to fix the warning.

2 years ago[libc++][NFC] Mark values in gdb pretty print comparison functions as live to prevent...
Amy Kwan [Fri, 3 Sep 2021 18:53:57 +0000 (14:53 -0400)]
[libc++][NFC] Mark values in gdb pretty print comparison functions as live to prevent values being optimized out.

It appears when testing LLVM 13 on Power, we run into failures with the
`libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp` test case optimizing
values out.

Despite some the functions in the test already being marked with optnone,
adding the `MarkAsLive()` calls inside of the pretty printer comparison functions
resolves the issues of the values being optimized out.

This patch aims to address https://llvm.org/PR51675.

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

2 years ago[InstCombine] fold (rotate X) eq/ne (0/-1)
Sanjay Patel [Fri, 3 Sep 2021 18:35:10 +0000 (14:35 -0400)]
[InstCombine] fold (rotate X) eq/ne (0/-1)

This generalizes the examples shown in:
https://llvm.org/PR51566

https://alive2.llvm.org/ce/z/V-sEy9

2 years ago[InstCombine] reduce code duplication; NFC
Sanjay Patel [Fri, 3 Sep 2021 18:04:32 +0000 (14:04 -0400)]
[InstCombine] reduce code duplication; NFC

2 years ago[InstCombine] add tests for icmp of rotate (PR51566); NFC
Sanjay Patel [Fri, 3 Sep 2021 16:50:43 +0000 (12:50 -0400)]
[InstCombine] add tests for icmp of rotate (PR51566); NFC

2 years ago[compiler-rt][Profile] Wait for child threads in set-file-object test
David Spickett [Fri, 3 Sep 2021 18:48:06 +0000 (11:48 -0700)]
[compiler-rt][Profile] Wait for child threads in set-file-object test

We've been seeing this test return 31 instead of 32 for the "functions"
line in this test on our AArch64 bots.

One possible cause is some of the children not finishing in time
before the llvm-profdata commands are run, if the machine is heavily loaded.

Wait for all the children to finish before exiting the parent.

Reviewed By: zequanwu

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

2 years ago[clang] fix error recovery ICE on copy elision when returing invalid variable
Matheus Izvekov [Thu, 2 Sep 2021 20:21:51 +0000 (22:21 +0200)]
[clang] fix error recovery ICE on copy elision when returing invalid variable

See PR51708.

Attempting copy elision in dependent contexts with invalid variable,
such as a variable with incomplete type, would cause a crash when attempting
to calculate it's alignment.

The fix is to just skip this optimization on invalid VarDecl, as otherwise this
provides no benefit to error recovery: This functionality does not try to
diagnose anything, it only calculates a flag which will affect where the
variable will be allocated during codegen.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rtrieu

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

2 years ago[AMDGPU] Small cleanup in optimizeCompareInstr. NFC.
Stanislav Mekhanoshin [Fri, 3 Sep 2021 18:21:02 +0000 (11:21 -0700)]
[AMDGPU] Small cleanup in optimizeCompareInstr. NFC.

2 years ago[libc++] Remove _LIBCPP_HAS_NO_LONG_LONG in favour of using_if_exists
Louis Dionne [Tue, 24 Aug 2021 14:30:39 +0000 (10:30 -0400)]
[libc++] Remove _LIBCPP_HAS_NO_LONG_LONG in favour of using_if_exists

_LIBCPP_HAS_NO_LONG_LONG was only defined on FreeBSD. Instead, use the
using_if_exists attribute to skip over declarations that are not available
on the base system. Note that there's an annoying limitation that we can't
conditionally define a function based on whether the base system provides
a function, so for example we still need preprocessor logic to define the
abs() and div() overloads.

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

2 years ago[libc++abi] Remove workarounds for missing -Wno-exceptions on older GCCs
Louis Dionne [Thu, 2 Sep 2021 20:23:36 +0000 (16:23 -0400)]
[libc++abi] Remove workarounds for missing -Wno-exceptions on older GCCs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675 has now been resolved
in GCC 11, so we can remove those workarounds.

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

2 years ago[ARM] Add patterns for store(fptosisat(..))
David Green [Fri, 3 Sep 2021 18:22:11 +0000 (19:22 +0100)]
[ARM] Add patterns for store(fptosisat(..))

As an extension to D107866, this adds store(fptosisat(..)) patterns,
similar to the existing fptosi patterns, to prevent unnecessarily moving
into gpr regs where we can use fp stores directly.

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

2 years ago[gn build] Reformat all files
Nico Weber [Fri, 3 Sep 2021 18:17:26 +0000 (14:17 -0400)]
[gn build] Reformat all files

Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.

2 years ago[NFC][DWARF] Add triple to new TAG test file
Jinsong Ji [Fri, 3 Sep 2021 18:12:46 +0000 (18:12 +0000)]
[NFC][DWARF] Add triple to new TAG test file

The file is requiring x86, but using llc without triple.

This will cause problem on non-x86 platforms, as the default triple will
not be x86.

eg: On PowerPC le, it will emit warnings as:

'x86-64' is not a recognized processor for this target (ignoring
processor)
'+cx8' is not a recognized feature for this target (ignoring feature)
'+fxsr' is not a recognized feature for this target (ignoring feature)
'+mmx' is not a recognized feature for this target (ignoring feature)
'+sse' is not a recognized feature for this target (ignoring feature)
..

On some other platform, it may even crash -- if some of the feature are
with same name (eg: soft-float).

Add the triple as this was the intention test target.

2 years ago[modules] Use `HashBuilder` and `MD5` for the module hash.
Alexandre Rames [Fri, 3 Sep 2021 18:12:27 +0000 (11:12 -0700)]
[modules] Use `HashBuilder` and `MD5` for the module hash.

Per the comments, `hash_code` values "are not stable to save or
persist", so are unsuitable for the module hash, which must persist
across compilations for the implicit module hashes to match. Note that
in practice, today, `hash_code` are stable. But this is an
implementation detail, with a clear `FIXME` indicating we should switch
to a per-execution seed.

The stability of `MD5` also allows modules cross-compilation use-cases.
The `size_t` underlying storage for `hash_code` varying across platforms
could cause mismatching hashes when cross-compiling from a 64bit
target to a 32bit target.

Note that native endianness is still used for the hash computation. So hashes
will differ between platforms of different endianness.

Reviewed By: jansvoboda11

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

2 years ago[flang] Move runtime API headers to flang/include/flang/Runtime
Peter Klausler [Wed, 1 Sep 2021 23:00:53 +0000 (16:00 -0700)]
[flang] Move runtime API headers to flang/include/flang/Runtime

Move the closure of the subset of flang/runtime/*.h header files that
are referenced by source files outside flang/runtime (apart from unit tests)
into a new directory (flang/include/flang/Runtime) so that relative
include paths into ../runtime need not be used.

flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate;
it's not used by the runtime.

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

2 years ago[NFC][CSSPGO] Add end of file newline to test input
Jinsong Ji [Fri, 3 Sep 2021 17:40:01 +0000 (17:40 +0000)]
[NFC][CSSPGO] Add end of file newline to test input

On some platform (eg: AIX), diff will complain about newline.

diff: Missing newline at the end of file
.../llvm/test/tools/llvm-profdata/Inputs/cs-sample.proftext.

2 years ago[gn build] Port b9e57e030560
LLVM GN Syncbot [Fri, 3 Sep 2021 17:37:49 +0000 (17:37 +0000)]
[gn build] Port b9e57e030560

2 years ago[lldb/Plugins] Introduce Scripted Interface Factory
Med Ismail Bennani [Fri, 3 Sep 2021 17:35:02 +0000 (17:35 +0000)]
[lldb/Plugins] Introduce Scripted Interface Factory

This patch splits the previous `ScriptedProcessPythonInterface` into
multiple specific classes:

1. The `ScriptedInterface` abstract class that carries the interface
   instance object and its virtual pure abstract creation method.

2. The `ScriptedPythonInterface` that holds a generic `Dispatch` method that
   can be used by various interfaces to call python methods and also keeps a
   reference to the Python Script Interpreter instance.

3. The `ScriptedProcessInterface` that describes the base Scripted
   Process model with all the methods used in the underlying script.

All these components are used to refactor the `ScriptedProcessPythonInterface`
class, making it more modular.

This patch is also a requirement for the upcoming work on `ScriptedThread`.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years agoRevert "[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire...
Jessica Paquette [Fri, 3 Sep 2021 17:28:07 +0000 (10:28 -0700)]
Revert "[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it"

This reverts commit a375bfb5b729e0f3ca8d5e001f423fa89e74de87.

This was causing a bot to crash:

https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/23380/

2 years ago[libc++][NFC] Remove uses of 'using namespace std;' in the test suite
Louis Dionne [Wed, 1 Sep 2021 20:52:52 +0000 (16:52 -0400)]
[libc++][NFC] Remove uses of 'using namespace std;' in the test suite

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

2 years ago[ARM] Add VFP lowering for fptosi.sat
David Green [Fri, 3 Sep 2021 17:11:08 +0000 (18:11 +0100)]
[ARM] Add VFP lowering for fptosi.sat

This extends D107865 to the VFP insructions, lowering llvm.fptosi.sat
and llvm.fptoui.sat to VCVT instructions that inherently perform the
saturate.

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

2 years agoAdd missing `REQUIRES: asserts` to combine-icmp-to-lhs-known-bits.mir
Jessica Paquette [Fri, 3 Sep 2021 16:25:37 +0000 (09:25 -0700)]
Add missing `REQUIRES: asserts` to combine-icmp-to-lhs-known-bits.mir

2 years ago[lld/mac] Don't assert during thunk insertion if there are undefined symbols
Nico Weber [Wed, 1 Sep 2021 18:28:51 +0000 (14:28 -0400)]
[lld/mac] Don't assert during thunk insertion if there are undefined symbols

We end up calling resolveBranchVA(), which asserts for Undefineds.

As fix, just return early in Writer::run() if there are any diagnostics
after processing relocations (which is where undefined symbol errors are
emitted). This matches what the ELF port does.

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

2 years ago[RISCV] Change how we encode AVL operands in vector pseudoinstructions to use GPRNoX0.
Craig Topper [Fri, 3 Sep 2021 16:05:15 +0000 (09:05 -0700)]
[RISCV] Change how we encode AVL operands in vector pseudoinstructions to use GPRNoX0.

This patch changes the register class to avoid accidentally setting
the AVL operand to X0 through MachineIR optimizations.

There are cases where we really want to use X0, but we can't get that
past the MachineVerifier with the register class as GPRNoX0. So I've
use a 64-bit -1 as a sentinel for X0. All other immediate values should
be uimm5. I convert it to X0 at the earliest possible point in the VSETVLI
insertion pass to avoid touching the rest of the algorithm. In
SelectionDAG lowering I'm using a -1 TargetConstant to hide it from
instruction selection and treat it differently than if the user
used -1. A user -1 should be selected to a register since it doesn't
fit in uimm5.

This is the rest of the changes started in D109110. As mentioned there,
I don't have a failing test from MachineIR optimizations anymore.

Reviewed By: frasercrmck

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

2 years ago[mlir][linalg] Extend tiled_loop to SCF conversion to generate scf.parallel.
Alexander Belyaev [Fri, 3 Sep 2021 15:41:40 +0000 (17:41 +0200)]
[mlir][linalg] Extend tiled_loop to SCF conversion to generate scf.parallel.

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

2 years ago[CMake] Add targets for generating coverage reports
Chris Bieneman [Tue, 31 Aug 2021 19:20:16 +0000 (12:20 -0700)]
[CMake] Add targets for generating coverage reports

This is a pretty small bit of CMake goop to generate code coverage
reports. I always forget the right script invocation and end up
fumbling around too much.

Wouldn't it be great to have targets that "Just Work"?

Well, I thought so.

At present this only really works correctly for LLVM, but I'll extend
it in subsequent patches to work for subprojects.

Reviewed By: phosek

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

2 years ago[clangd] Use the active file's language for hover code blocks
David Goldman [Mon, 23 Aug 2021 17:58:43 +0000 (13:58 -0400)]
[clangd] Use the active file's language for hover code blocks

This helps improve the syntax highlighting for Objective-C code,
although it currently doesn't work well in VS Code with
methods/properties/ivars since we don't currently include the proper
decl context (e.g. class).

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

2 years ago[mlir][sparse] refine heuristic for iteration graph topsort
Aart Bik [Wed, 1 Sep 2021 22:29:52 +0000 (15:29 -0700)]
[mlir][sparse] refine heuristic for iteration graph topsort

The sparse index order must always be satisfied, but this
may give a choice in topsorts for several cases. We broke
ties in favor of any dense index order, since this gives
good locality. However, breaking ties in favor of pushing
unrelated indices into sparse iteration spaces gives better
asymptotic complexity. This revision improves the heuristic.

Note that in the long run, we are really interested in using
ML for ML to find the best loop ordering as a replacement for
such heuristics.

Reviewed By: bixia

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

2 years ago[mlir] Update EmitC documentation
Marius Brehler [Fri, 3 Sep 2021 15:22:24 +0000 (15:22 +0000)]
[mlir] Update EmitC documentation

2 years agoRemove blank from NaN string representation
V Donaldson [Wed, 1 Sep 2021 01:26:58 +0000 (18:26 -0700)]
Remove blank from NaN string representation

Flang front end function DumpHexadecimal generates a string
representation of a REAL value.  When the value is a NaN, the string
contains a blank, as in "NaN 0x7fc00000".  This function is used by
lowering to generate a string that is then passed to llvm Support
function convertFromStringSpecials, which does not expect a blank
in the string.  Remove the blank to allow correct recognition of a
NaN by this llvm function.

Note that function DumpHexadecimal is not exercised by the front end
itself.  This functionality is only exercised by code that is not yet
present in llvm.

2 years ago[CUDA][NFC] Fix wrong assert information
Ben Shi [Fri, 3 Sep 2021 14:33:47 +0000 (22:33 +0800)]
[CUDA][NFC] Fix wrong assert information

Reviewed By: fodinabor

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

2 years ago[lldb] [test] Mark the remaining vfork-follow-child test unsupported (flaky) on aarch64
Michał Górny [Fri, 3 Sep 2021 14:30:25 +0000 (16:30 +0200)]
[lldb] [test] Mark the remaining vfork-follow-child test unsupported (flaky) on aarch64

2 years ago[lldb] [test] Mark vfork-follow-child-* tests unsupported (flaky) on aarch64
Michał Górny [Fri, 3 Sep 2021 14:04:03 +0000 (16:04 +0200)]
[lldb] [test] Mark vfork-follow-child-* tests unsupported (flaky) on aarch64

2 years agoRevert "[NFC] Recommit "Regenerate SVE ACLE intrinsics tests""
Nico Weber [Fri, 3 Sep 2021 13:24:19 +0000 (09:24 -0400)]
Revert "[NFC] Recommit "Regenerate SVE ACLE intrinsics tests""

This reverts commit 91eda9c30f33da6ec6da70b59a5f5da6c6397039.
Breaks tests on macOS, both intel and arm. See e.g.
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8837137028177680097/+/u/package_clang/stdout?format=raw
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8837137028177680081/+/u/package_clang/stdout?format=raw
http://45.33.8.238/macm1/17258/step_7.txt
http://45.33.8.238/mac/35004/step_7.txt

2 years ago[lldb] Support .debug_rnglists.dwo sections in dwp file
Kim-Anh Tran [Fri, 3 Sep 2021 12:57:45 +0000 (14:57 +0200)]
[lldb] Support .debug_rnglists.dwo sections in dwp file

This patch considers the CU index entry
when reading the .debug_rnglists.dwo section.

Reviewed By: jankratochvil

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

2 years agoRevert "[gn build] (manually) port 6fe2beba7d2a (ExceptionTests)"
Nico Weber [Fri, 3 Sep 2021 13:19:11 +0000 (09:19 -0400)]
Revert "[gn build] (manually) port 6fe2beba7d2a (ExceptionTests)"

This reverts commit da47c2719b1094a29427917ddb157c9c716e876d.
6fe2beba7d2a was reverted in 885964046114.

2 years agoRevert "Reland "[clang-repl] Re-implement clang-interpreter as a test case.""
Vassil Vassilev [Fri, 3 Sep 2021 13:17:52 +0000 (13:17 +0000)]
Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test case.""

This reverts commit 6fe2beba7d2a41964af658c8c59dd172683ef739 which fails on
clang-hexagon-elf

2 years ago[gn build] (manually) port 6fe2beba7d2a (ExceptionTests)
Nico Weber [Wed, 1 Sep 2021 12:31:11 +0000 (08:31 -0400)]
[gn build] (manually) port 6fe2beba7d2a (ExceptionTests)

2 years ago[compiler-rt][Profile] Disable test on Arm/AArch64 Linux
David Spickett [Fri, 3 Sep 2021 12:58:09 +0000 (12:58 +0000)]
[compiler-rt][Profile] Disable test on Arm/AArch64 Linux

While a fix for flaky results is being reviewed.

2 years ago[ORC] Static cast more uint64_t to size_t
David Spickett [Fri, 3 Sep 2021 12:27:05 +0000 (12:27 +0000)]
[ORC] Static cast more uint64_t to size_t

These instances don't have an obvious way to fail
nicely so I've just asserted they are within range.

Fixes the Arm 32 bit builds.

2 years agoReland "[clang-repl] Re-implement clang-interpreter as a test case."
Vassil Vassilev [Fri, 3 Sep 2021 09:37:13 +0000 (09:37 +0000)]
Reland "[clang-repl] Re-implement clang-interpreter as a test case."
Original commit message: "
    Original commit message:"
      The current infrastructure in lib/Interpreter has a tool, clang-repl, very
      similar to clang-interpreter which also allows incremental compilation.

      This patch moves clang-interpreter as a test case and drops it as conditionally
      built example as we already have clang-repl in place.

      Differential revision: https://reviews.llvm.org/D107049
    "

    This patch also ignores ppc due to missing weak symbol for __gxx_personality_v0
    which may be a feature request for the jit infrastructure. Also, adds a missing
    build system dependency to the orc jit.
"

Additionally, this patch defines a custom exception type and thus avoids the
requirement to include header <exception>, making it easier to deploy across
systems without standard location of the c++ headers.

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

2 years ago[gn build] Port a375bfb5b729
LLVM GN Syncbot [Fri, 3 Sep 2021 11:51:19 +0000 (11:51 +0000)]
[gn build] Port a375bfb5b729

2 years ago[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function...
Kristóf Umann [Thu, 19 Aug 2021 13:37:02 +0000 (15:37 +0200)]
[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it

D105553 added NoStateChangeFuncVisitor, an abstract class to aid in creating
notes such as "Returning without writing to 'x'", or "Returning without changing
the ownership status of allocated memory". Its clients need to define, among
other things, what a change of state is.

For code like this:

f() {
  g();
}

foo() {
  f();
  h();
}

We'd have a path in the ExplodedGraph that looks like this:

             -- <g> -->
            /          \
         ---     <f>    -------->        --- <h> --->
        /                        \      /            \
--------        <foo>             ------    <foo>     -->

When we're interested in whether f neglected to change some property,
NoStateChangeFuncVisitor asks these questions:

                       ÷×~
                -- <g> -->
           ß   /          \$    @&#*
            ---     <f>    -------->        --- <h> --->
           /                        \      /            \
   --------        <foo>             ------    <foo>     -->

Has anything changed in between # and *?
Has anything changed in between & and *?
Has anything changed in between @ and *?
...
Has anything changed in between $ and *?
Has anything changed in between × and ~?
Has anything changed in between ÷ and ~?
...
Has anything changed in between ß and *?
...
This is a rather thorough line of questioning, which is why in D105819, I was
only interested in whether state *right before* and *right after* a function
call changed, and early returned to the CallEnter location:

if (!CurrN->getLocationAs<CallEnter>())
  return;
Except that I made a typo, and forgot to negate the condition. So, in this
patch, I'm fixing that, and under the same hood allow all clients to decide to
do this whole-function check instead of the thorough one.

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

2 years ago[LoopDeletion] Move ICmpInst handling to getValueOnFirstIteration()
Max Kazantsev [Fri, 3 Sep 2021 09:32:47 +0000 (16:32 +0700)]
[LoopDeletion] Move ICmpInst handling to getValueOnFirstIteration()

As noticed in https://reviews.llvm.org/D105688, it would be great to move
handling of ICmpInst which was in canProveExitOnFirstIteration() to
getValueOnFirstIteration().

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D108978
Reviewed By: reames

2 years ago[GlobalISel] Add convenience constructors to MemDesc
Konstantin Schwarz [Thu, 2 Sep 2021 14:18:26 +0000 (16:18 +0200)]
[GlobalISel] Add convenience constructors to MemDesc

This allows constructing a MemDesc from a MachineMemoryOperand, a pattern that starts to show up more frequently.

Reviewed By: foad

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

2 years ago[X86][SLM] Fix PBLENDVB uops and throughput
Simon Pilgrim [Thu, 2 Sep 2021 17:07:40 +0000 (18:07 +0100)]
[X86][SLM] Fix PBLENDVB uops and throughput

SLM PBLENDVB is just as bad as BLENDVPD/PS - so model it as such, fixing the rr vs rm uops diff as well. The Intel AoM appears to have a copy+paste typo with PBLENDW, it doesn't match Agner or InstLatX64.

Noticed while investigating some of the weird discrepancies reported by the D103695 helper script (SLM had much better vector shift throughputs than it should).

2 years ago[OptTable] Reapply Improve error message output for grouped short options
gbreynoo [Fri, 3 Sep 2021 10:08:39 +0000 (11:08 +0100)]
[OptTable] Reapply Improve error message output for grouped short options

This reapplies 71d7fed3bc2ad6c22729d446526a59fcfd99bd03 which was
reverted by 3e2bd82f02c6cbbfb0544897c7645867f04b3a7e. This change
includes the fix for breaking the sanitizer bots.

As seen in https://bugs.llvm.org/show_bug.cgi?id=48880 the current
implementation for parsing grouped short options can return unclear
error messages. This change fixes the example given in the ticket in
which a flag is incorrectly given an argument. Also when parsing a
group we now keep reading past the first incorrect option and output
errors for all incorrect options in the group.

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

2 years ago[AMDGPU][MC][NFC][DOC] Updated description of registers
Dmitry Preobrazhensky [Fri, 3 Sep 2021 10:09:54 +0000 (13:09 +0300)]
[AMDGPU][MC][NFC][DOC] Updated description of registers

Corrected list of available register tuples to reflect changes introduced by
commits https://reviews.llvm.org/D103672 and https://reviews.llvm.org/D103800

See bug https://bugs.llvm.org/show_bug.cgi?id=51388

2 years ago[OpenCL] Supports optional 64-bit floating point types in C++ for OpenCL 2021
Justas Janickas [Tue, 31 Aug 2021 08:17:38 +0000 (09:17 +0100)]
[OpenCL] Supports optional 64-bit floating point types in C++ for OpenCL 2021

Adds support for a feature macro `__opencl_c_fp64` in C++ for OpenCL
2021 enabling a respective optional core feature from OpenCL 3.0.

This change aims to achieve compatibility between C++ for OpenCL
2021 and OpenCL 3.0.

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

2 years agoRevert "[lldb/lua] Force Lua version to be 5.3"
Siger Yang [Fri, 3 Sep 2021 09:27:13 +0000 (17:27 +0800)]
Revert "[lldb/lua] Force Lua version to be 5.3"

This commit causes buildbot failures if SWIG is available but Lua is
not present.

This reverts commit 7bb42dc6b114f57200abfebaaa01160914be6bba.

2 years ago[hwasan] Support more complicated lifetimes.
Florian Mayer [Wed, 18 Aug 2021 16:19:54 +0000 (17:19 +0100)]
[hwasan] Support more complicated lifetimes.

This is important as with exceptions enabled, non-POD allocas often have
two lifetime ends: the exception handler, and the normal one.

Reviewed By: eugenis

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

2 years ago[gn build] Port 2ed91da0f1f3
LLVM GN Syncbot [Fri, 3 Sep 2021 08:53:21 +0000 (08:53 +0000)]
[gn build] Port 2ed91da0f1f3

2 years ago[JITLink] Add initial Aarch64 support
Stefan Gränitz [Fri, 3 Sep 2021 08:46:40 +0000 (10:46 +0200)]
[JITLink] Add initial Aarch64 support

Set up basic infrastructure for 64-bit ARM architecture support in JITLink. It allows for loading a minimal object file and resolving a single relocation. Advanced features like GOT and PLT handling or relaxations were intentionally left out for the moment.

This patch follows the idea to keep implementations for ARM (32-bit) and Aaarch64 (64-bit) separate, because:
* it might be easier to share code with the MachO "arm64" JITLink backend
* LLVM has individual targets for ARM and Aaarch64 as well

Reviewed By: lhames

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

2 years ago[LoopBoundSplit] Update phi node in exit block
Jingu Kang [Thu, 2 Sep 2021 14:47:24 +0000 (15:47 +0100)]
[LoopBoundSplit] Update phi node in exit block

It fixes https://bugs.llvm.org/show_bug.cgi?id=51700

Differential Revision:

2 years ago[sanitizer_common] Define wordexp_wrde_dooffs for Solaris
Rainer Orth [Fri, 3 Sep 2021 08:02:31 +0000 (10:02 +0200)]
[sanitizer_common] Define wordexp_wrde_dooffs for Solaris

The Solaris buildbots have been broken for some time:

  In file included from /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/compiler-rt/lib/asan/asan_interceptors.cpp:174:
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:4000:19: error: use of undeclared identifier 'wordexp_wrde_dooffs'
          ((flags & wordexp_wrde_dooffs) ? p->we_offs : 0) + p->we_wordc;
                    ^

This was caused by D108646 <https://reviews.llvm.org/D108646>; the fix is
equivalent to D108838 <https://reviews.llvm.org/D108838>.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

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

2 years ago[AArch64][SME] Support NEON vector to GPR integer moves in streaming mode
Cullen Rhodes [Wed, 11 Aug 2021 07:06:34 +0000 (07:06 +0000)]
[AArch64][SME] Support NEON vector to GPR integer moves in streaming mode

A small subset of the NEON instruction set is legal in streaming mode.
This patch adds support for the following vector to integer move
instructions:

  0x00 1110 0000 0001 0010 11xx xxxx xxxx # SMOV W|Xd,Vn.B[0]
  0x00 1110 0000 0010 0010 11xx xxxx xxxx # SMOV W|Xd,Vn.H[0]
  0100 1110 0000 0100 0010 11xx xxxx xxxx # SMOV Xd,Vn.S[0]
  0000 1110 0000 0001 0011 11xx xxxx xxxx # UMOV Wd,Vn.B[0]
  0000 1110 0000 0010 0011 11xx xxxx xxxx # UMOV Wd,Vn.H[0]
  0000 1110 0000 0100 0011 11xx xxxx xxxx # UMOV Wd,Vn.S[0]
  0100 1110 0000 1000 0011 11xx xxxx xxxx # UMOV Xd,Vn.D[0]

Only the zero index variants are legal, all others indexes are illegal.
To support this, new instructions are defined specifically for zero
index which is hardcoded, along an implicit 'VectorIndex0' operand.
Since the index operand is implicit and takes no bits in the encoding,
custom decoding is required to add the operand.

I'm not sure if this is the best approach but the predicate constraint
on a subset of an operand is unusual. Would be interested to hear some
alternatives.

The instructions are predicated on 'HasNEONorStreamingSVE', i.e. they're
enabled by either +neon or +streaming-sve. This follows on from the work
in D106272 to support the subset of SVE(2) instructions that are legal
in streaming mode.

Depends on D107902.

Reviewed By: sdesmalen

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

2 years ago[AArch64][ISel] NFC: DAG.getMachineFunction() -> MF
Cullen Rhodes [Fri, 3 Sep 2021 07:05:59 +0000 (07:05 +0000)]
[AArch64][ISel] NFC: DAG.getMachineFunction() -> MF

Reviewed By: sdesmalen

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

2 years ago[flang] COMMAND_ARGUMENT_COUNT runtime implementation
Diana Picus [Wed, 25 Aug 2021 07:51:48 +0000 (07:51 +0000)]
[flang] COMMAND_ARGUMENT_COUNT runtime implementation

Grab whatever ProgramStart has stored in executionEnvironment.argc and
subtract 1 (based on the assumption that ProgramStart is called with
a C-style argc that counts the command name as an argument).

Spoiler alert: The tests will evolve into fixtures when we implement
GET_COMMAND_ARGUMENT etc.

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

2 years ago[lldb/lua] Force Lua version to be 5.3
Siger Yang [Fri, 3 Sep 2021 03:17:37 +0000 (11:17 +0800)]
[lldb/lua] Force Lua version to be 5.3

Due to CMake cache, find_package in FindLuaAndSwig.cmake
will be ignored. This commit adds EXACT and REQUIRED flags
to it and removes find_package in Lua ScriptInterpreter.

Signed-off-by: Siger Yang <sigeryeung@gmail.com>
Reviewed By: tammela, JDevlieghere

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

2 years ago[flang] Remove *- C++ -* incantation from runtime .cpp files. NFC
Diana Picus [Thu, 2 Sep 2021 08:14:01 +0000 (08:14 +0000)]
[flang] Remove *- C++ -* incantation from runtime .cpp files. NFC

We should only need to spell the language out in .h files.

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

2 years ago[lldb] [test] Mark *fork-follow-child* tests non-Darwin
Michał Górny [Fri, 3 Sep 2021 07:07:53 +0000 (09:07 +0200)]
[lldb] [test] Mark *fork-follow-child* tests non-Darwin

2 years ago[mlir][flang] Do not prevent integer types from being parsed as MLIR keywords
Jean Perier [Fri, 3 Sep 2021 06:16:52 +0000 (08:16 +0200)]
[mlir][flang] Do not prevent integer types from being parsed as MLIR keywords

DialectAsmParser::parseKeyword is rejecting `'i' digit+` while it is
a valid identifier according to mlir/docs/LangRef.md.

Integer types actually used to be TOK_KEYWORD a while back before the
change: https://github.com/llvm/llvm-project/commit/6af866c58d21813fb243906611d02bb2a8ffa43a.

This patch Modifies `isCurrentTokenAKeyword` to return true for tokens that
match integer types too.

The motivation for this change is the parsing of `!fir.type<{` `component-name: component-type,`+ `}>`
type in FIR that represent Fortran derived types. The component-names are
parsed as keywords, and can very well be i32 or any ixxx (which are
valid Fortran derived type component names).

The Quant dialect type parser had to be modified since it relied on `iw` not
being parsed as keywords.

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

2 years ago[flang] Extend common block size to cover equivalence storage
Jean Perier [Fri, 3 Sep 2021 06:12:44 +0000 (08:12 +0200)]
[flang] Extend common block size to cover equivalence storage

The size of common block should be extended to cover any storage
sequence that are storage associated with the common block via
equivalences (8.10.2.2 point 1 (2)).

In symbol size and offset computation, the size of the common block
was not always extended to cover storage association. It was only done
if the "base symbol of an equivalence group"(*) appeared in a common block
statement. Correct this to cover all cases where a symbol appearing in a
common block statement is storage associated.

(*) the base symbol of an equivalence group is the symbol whose storage
starts first in a storage association (if several symbols starts first,
the base symbol is the last one visited by the algorithm going through
the equivalence sets).

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

2 years ago[Test] Missed opt test for D108910
Max Kazantsev [Fri, 3 Sep 2021 04:45:29 +0000 (11:45 +0700)]
[Test] Missed opt test for D108910

We can fold loop phis after we've proved that some exit has EC=0
in IndVars.

Patch by Dmitry Makogon!

2 years agoReformulate OrcJIT tutorial doc to make it more clear.
Yuichi Yoshida [Fri, 3 Sep 2021 04:58:34 +0000 (04:58 +0000)]
Reformulate OrcJIT tutorial doc to make it more clear.

Fixed a minor writing error. The text was hard to understand.

Reviewed By: lhames, mehdi_amini

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

2 years ago[AArch64][GlobalISel] Support for folding G_ROTR as shifted operands.
Amara Emerson [Thu, 2 Sep 2021 23:54:52 +0000 (16:54 -0700)]
[AArch64][GlobalISel] Support for folding G_ROTR as shifted operands.

This allows selection like: eor w0, w1, w2, ror #8

Saves 500 bytes on ClamAV -Os, which is 0.1%.

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

2 years ago[PowerPC] Enable fast-isel on AIX 64 subtarget
Qiu Chaofan [Fri, 3 Sep 2021 03:33:45 +0000 (11:33 +0800)]
[PowerPC] Enable fast-isel on AIX 64 subtarget

This patch basically enables fast-isel for AIX 64-bit subtarget
(previously enabled only for ELF 64). The initial motivation is to
introduce branch folding to AIX generated code for correct debug
behavior. I also saw some compiling time improvement in a few LLVM
test-suite benchmarks. (toast, dbms, cjpeg, burg, etc.)

Reviewed By: jsji

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

2 years agoRevert "[HardwareLoops] Change order of SCEV expression construction for InitLoopCount."
Chen Zheng [Fri, 3 Sep 2021 02:53:31 +0000 (02:53 +0000)]
Revert "[HardwareLoops] Change order of SCEV expression construction for InitLoopCount."

This causes https://bugs.llvm.org/show_bug.cgi?id=51714 and
is not a right patch according to comments in D91724

This reverts commit 42eaf4fe0adef3344adfd9fbccd49f325cb549ef.

2 years agoAMDGPU: Remove FeatureLocalMemorySize0
Matt Arsenault [Fri, 3 Sep 2021 02:33:21 +0000 (22:33 -0400)]
AMDGPU: Remove FeatureLocalMemorySize0

There's no reason to make this an explicit feature, since it's implied
by the lack of a feature with a size.

2 years ago[Coroutines] [Clang] Look up coroutine component in std namespace first
Chuanqi Xu [Fri, 3 Sep 2021 02:22:53 +0000 (10:22 +0800)]
[Coroutines] [Clang] Look up coroutine component in std namespace first

Summary: Now in libcxx and clang, all the coroutine components are
defined in std::experimental namespace.
And now the coroutine TS is merged into C++20. So in the working draft
like N4892, we could find the coroutine components is defined in std
namespace instead of std::experimental namespace.
And the coroutine support in clang seems to be relatively stable. So I
think it may be suitable to move the coroutine component into the
experiment namespace now.

But move the coroutine component into the std namespace may be an break
change. So I planned to split this change into two patch. One in clang
and other in libcxx.

This patch would make clang lookup coroutine_traits in std namespace
first. For the compatibility consideration, clang would lookup in
std::experimental namespace if it can't find definitions in std
namespace and emit a warning in this case. So the existing codes
wouldn't be break after update compiler.

Test Plan: check-clang, check-libcxx

Reviewed By: lxfind

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

2 years ago[RISCV] Add SiFive core S51
Alexander Pivovarov [Tue, 31 Aug 2021 06:23:23 +0000 (23:23 -0700)]
[RISCV] Add SiFive core S51

Add SiFive core s51 as rv64imac RocketModel

Reviewed-By: MaskRay, evandro
Differential Revision: https://reviews.llvm.org/D108886

2 years ago[OMPIRBuilder] Add ordered directive to OMPBuilder
PeixinQiao [Fri, 3 Sep 2021 01:37:58 +0000 (09:37 +0800)]
[OMPIRBuilder] Add ordered directive to OMPBuilder

Add support for ordered directive in the OpenMPIRBuilder.

This patch also modidies clang to use the ordered directive when the
option -fopenmp-enable-irbuilder is enabled.

Also fix one ICE when parsing one canonical for loop with the relational
operator LE or GE in openmp region by replacing unary increment
operation of the expression of the variable "Expr A" minus the variable
"Expr B" (++(Expr A - Expr B)) with binary addition operation of the
experssion of the variable "Expr A" minus the variable "Expr B" and the
expression with constant value "1" (Expr A - Expr B + "1").

Reviewed By: Meinersbur, kiranchandramohan

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

2 years ago[NFC] Recommit "Regenerate SVE ACLE intrinsics tests"
Usman Nadeem [Thu, 2 Sep 2021 22:45:29 +0000 (15:45 -0700)]
[NFC] Recommit "Regenerate SVE ACLE intrinsics tests"

Change-Id: Ida45fc41231cd71709048f2d37f228f14053514e