platform/upstream/llvm.git
3 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.

3 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

3 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

3 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

3 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`.

3 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.

3 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

3 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

3 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.

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

3 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>
3 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/

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

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

3 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.

3 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

3 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

3 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

3 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

3 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

3 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.

3 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

3 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)

3 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.

3 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.

3 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

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

3 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

3 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

3 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

3 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).

3 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

3 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

3 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

3 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.

3 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

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

3 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

3 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:

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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!

3 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

3 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

3 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

3 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.

3 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.

3 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

3 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

3 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

3 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

3 years agoRevert "[NFC] Regenerate SVE ACLE intrinsics tests"
Usman Nadeem [Thu, 2 Sep 2021 22:43:37 +0000 (15:43 -0700)]
Revert "[NFC] Regenerate SVE ACLE intrinsics tests"

This reverts commit 8749a556da96fb17df1a2e36b860527e557c8c7b.

3 years ago[LoopPredication] Fix MemorySSA crash in predicateLoopExits
Anna Thomas [Thu, 2 Sep 2021 21:26:45 +0000 (17:26 -0400)]
[LoopPredication] Fix MemorySSA crash in predicateLoopExits

The attached testcase crashes without the patch (Not the same accesses
in the same order).

When we move instructions before another instruction, we also need to
update the memory accesses corresponding to it.

Reviewed-By: asbirlea
Differential Revision: https://reviews.llvm.org/D109197

3 years agoFix typo in RISCVMatInt.cpp comments
Alexander Pivovarov [Fri, 3 Sep 2021 01:07:03 +0000 (18:07 -0700)]
Fix typo in RISCVMatInt.cpp comments

3 years ago[mlir][scf] Allow runtime type of iter_args to change
Matthias Springer [Fri, 3 Sep 2021 01:02:43 +0000 (10:02 +0900)]
[mlir][scf] Allow runtime type of iter_args to change

The limitation on iter_args introduced with D108806 is too restricting. Changes of the runtime type should be allowed.

Extends the dim op canonicalization with a simple analysis to determine when it is safe to canonicalize.

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

3 years ago[mlir][python] Simplify python extension loading.
Stella Laurenzo [Fri, 3 Sep 2021 00:37:00 +0000 (00:37 +0000)]
[mlir][python] Simplify python extension loading.

* Now that packaging has stabilized, removes old mechanisms for loading extensions, preferring direct importing.
* Removes _cext_loader.py, _dlloader.py as unnecessary.
* Fixes the path where the CAPI dll is written on Windows. This enables that path of least resistance loading behavior to work with no further drama (see: https://bugs.python.org/issue36085).
* With this patch, `ninja check-mlir` on Windows with Python bindings works for me, modulo some failures that are actually due to a couple of pre-existing Windows bugs. I think this is the first time the Windows Python bindings have worked upstream.
* Downstream changes needed:
  * If downstreams are using the now removed `load_extension`, `reexport_cext`, etc, then those should be replaced with normal import statements as done in this patch.

Reviewed By: jdd, aartbik

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

3 years ago[AMDGPU] Process any power of 2 in optimizeCompareInstr
Stanislav Mekhanoshin [Thu, 2 Sep 2021 19:51:14 +0000 (12:51 -0700)]
[AMDGPU] Process any power of 2 in optimizeCompareInstr

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

3 years ago[Coroutines] Only run verifyFunction in debug mode
Xun Li [Fri, 3 Sep 2021 00:35:01 +0000 (17:35 -0700)]
[Coroutines] Only run verifyFunction in debug mode

verifyFunction can be really slow on large functions. This can significantly slow down compilation in production.
Given that coroutine passes are fairly stable now, we should only run it in debug mode.

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

3 years ago[CSSPGO] Honor preinliner decision for ThinLTO importing
Wenlei He [Wed, 1 Sep 2021 20:47:19 +0000 (13:47 -0700)]
[CSSPGO] Honor preinliner decision for ThinLTO importing

When pre-inliner decision is used for CSSPGO, we should take that into account for ThinLTO importing as well, so post-link sample loader inliner can favor that decision. This is handled by a small tweak in this patch. It also includes a change to transfer preinliner decision when merging context.

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

3 years ago[AMDGPU] Fold immediates in the optimizeCompareInstr
Stanislav Mekhanoshin [Thu, 2 Sep 2021 20:06:26 +0000 (13:06 -0700)]
[AMDGPU] Fold immediates in the optimizeCompareInstr

Peephole works before the first SIFoldOperands so most of
the immediates are in registers.

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

3 years ago[WebAssembly] Rename WrapperPIC -> WrapperREL. NFC
Sam Clegg [Thu, 2 Sep 2021 18:24:53 +0000 (14:24 -0400)]
[WebAssembly] Rename WrapperPIC -> WrapperREL. NFC

This ISD node/wrapper represents am address which is relative to a base
address and therefore lowers to `i32.const` rather than `global.get`.

Use this wrapper type for TLS-relative addresses, paving the way for the
non-REL wrapper to be used to external TLS address once those are
supported.

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

3 years ago[runtimeunroll] Support epilogue unrolling with a parent loop
Philip Reames [Thu, 2 Sep 2021 23:29:20 +0000 (16:29 -0700)]
[runtimeunroll] Support epilogue unrolling with a parent loop

This patch adds support for unrolling inner loops using epilogue unrolling. The basic issue is that the original latch exit block of the inner loop could be outside the outer loop.  When we clone the inner loop and split the latch exit, the cloned blocks need to be in the outer loop.

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

3 years ago[runtimeunroll] Under EXPENSIVE_CHECKS, validate loop info
Philip Reames [Thu, 2 Sep 2021 23:27:45 +0000 (16:27 -0700)]
[runtimeunroll] Under EXPENSIVE_CHECKS, validate loop info

Requested in review comment on D108476

3 years ago[openmp] NFC add bitcode comment
Ron Lieberman [Thu, 2 Sep 2021 23:21:33 +0000 (18:21 -0500)]
[openmp] NFC add bitcode comment

3 years agoReland "Try to unbreak Win build differently after 973519826edb76""
Nico Weber [Thu, 2 Sep 2021 19:09:43 +0000 (12:09 -0700)]
Reland "Try to unbreak Win build differently after 973519826edb76""

Build should be fixed by
https://github.com/llvm/llvm-project/commit/9d22754389

This reverts commit df052e1732ab57f5d9c684ceeaed3ab39073cd9f.

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

3 years ago[Sanitizers] remove empty test case.
David Carlier [Thu, 2 Sep 2021 22:53:38 +0000 (23:53 +0100)]
[Sanitizers] remove empty test case.

3 years ago[ORC] Range check and narrow size value.
Lang Hames [Thu, 2 Sep 2021 22:43:02 +0000 (08:43 +1000)]
[ORC] Range check and narrow size value.

This should fix the build issues in
https://lab.llvm.org/buildbot#builders/171/builds/3149.

3 years ago[gn build] Port dad60f8071d5
LLVM GN Syncbot [Thu, 2 Sep 2021 22:29:41 +0000 (22:29 +0000)]
[gn build] Port dad60f8071d5

3 years ago[ORC] Add EPCGenericJITLinkMemoryManager: memory management via EPC calls.
Lang Hames [Thu, 2 Sep 2021 10:48:58 +0000 (20:48 +1000)]
[ORC] Add EPCGenericJITLinkMemoryManager: memory management via EPC calls.

All ExecutorProcessControl subclasses must provide a JITLinkMemoryManager object
that can be used to allocate memory in the executor process. The
EPCGenericJITLinkMemoryManager class provides an off-the-shelf
JITLinkMemoryManager implementation for JITs that do not need (or cannot
provide) a specialized JITLinkMemoryManager implementation. This simplifies the
process of creating new ExecutorProcessControl implementations.

3 years ago[ORC] Add specialized SPSSerializationTraits for ArrayRef<char>.
Lang Hames [Thu, 2 Sep 2021 10:45:46 +0000 (20:45 +1000)]
[ORC] Add specialized SPSSerializationTraits for ArrayRef<char>.

Deserializing from an SPSSequence<char> to an an ArrayRef<char> will point the
ArrayRef<char> at the input buffer.

3 years ago[ORC] Move callWrapper and callSPSWrapper functions to ExecutorProcessControl.
Lang Hames [Thu, 2 Sep 2021 08:34:27 +0000 (18:34 +1000)]
[ORC] Move callWrapper and callSPSWrapper functions to ExecutorProcessControl.

The ExecutionSession versions now just forward to the implementations in
ExecutorProcessControl.

This allows callWrapper / callSPSWrapper to be used while bootstrapping an
ExecutorProcessControl instance.

3 years ago[GlobalISel] Combine icmp eq/ne x, 0/1 -> x when x == 0 or 1
Jessica Paquette [Thu, 2 Sep 2021 04:55:51 +0000 (21:55 -0700)]
[GlobalISel] Combine icmp eq/ne x, 0/1 -> x when x == 0 or 1

This adds the following combines:

```
x = ... 0 or 1
c = icmp eq x, 1

->

c = x
```

and

```
x = ... 0 or 1
c = icmp ne x, 0

->

c = x
```

When the target's true value for the relevant types is 1.

This showed up in the following situation:

https://godbolt.org/z/M5jKexWTW

SDAG currently supports the `ne` case, but not the `eq` case. This can probably
be further generalized, but I don't feel like thinking that hard right now.

This gives some minor code size improvements across the board on CTMark at
-Os for AArch64. (0.1% for 7zip and pairlocalalign in particular.)

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

3 years agoFully qualify template template parameters when printing
David Blaikie [Thu, 26 Aug 2021 23:54:47 +0000 (16:54 -0700)]
Fully qualify template template parameters when printing

I discovered this quirk when working on some DWARF - AST printing prints
type template parameters fully qualified, but printed template template
parameters the way they were written syntactically, or wholely
unqualified - instead, we should print them consistently with the way we
print type template parameters: fully qualified.

The one place this got weird was for partial specializations like in
ast-print-temp-class.cpp - hence the need for checking for
TemplateNameDependenceScope::DependentInstantiation template template
parameters. (not 100% sure that's the right solution to that, though -
open to ideas)

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

3 years ago[asan] Fixed link error by setting jump symbol to R_X86_64_PLT32.
Kirill Stoimenov [Thu, 2 Sep 2021 19:26:54 +0000 (19:26 +0000)]
[asan] Fixed link error by setting jump symbol to R_X86_64_PLT32.

Fixing this link error:
ld: error: relocation R_X86_64_PC32 cannot be used against symbol __asan_report_load...; recompile with -fPIC

Reviewed By: vitalybuka

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

3 years agoRevert "[CSSPGO] Honor preinliner decision for ThinLTO importing"
Kevin Athey [Thu, 2 Sep 2021 21:09:36 +0000 (14:09 -0700)]
Revert "[CSSPGO] Honor preinliner decision for ThinLTO importing"

This reverts commit a2768b4732a0216dfd346d34e428685f03f10549.

Breaks sanitizer-x86_64-linux-fast buildbot:
https://lab.llvm.org/buildbot/#/builders/5/builds/11334

Log snippet:
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: LLVM :: Transforms/SampleProfile/early-inline.ll (65549 of 78729)
******************** TEST 'LLVM :: Transforms/SampleProfile/early-inline.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/early-inline.ll -instcombine -sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/einline.prof -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/early-inline.ll
--
Exit Code: 2
Command Output (stderr):
--
/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53: runtime error: member call on null pointer of type 'llvm::sampleprof::FunctionSamples'
    #0 0x5a730f8 in shouldInlineCandidate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53
    #1 0x5a730f8 in (anonymous namespace)::SampleProfileLoader::tryInlineCandidate((anonymous namespace)::InlineCandidate&, llvm::SmallVector<llvm::CallBase*, 8u>*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1178:21
    #2 0x5a6cda6 in inlineHotFunctions /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1105:13
    #3 0x5a6cda6 in (anonymous namespace)::SampleProfileLoader::emitAnnotations(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1633:16
    #4 0x5a5fcbe in runOnFunction /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2008:12
    #5 0x5a5fcbe in (anonymous namespace)::SampleProfileLoader::runOnModule(llvm::Module&, llvm::AnalysisManager<llvm::Module>*, llvm::ProfileSummaryInfo*, llvm::CallGraph*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1922:15
    #6 0x5a5de55 in llvm::SampleProfileLoaderPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2038:21
    #7 0x6552a01 in llvm::detail::PassModel<llvm::Module, llvm::SampleProfileLoaderPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
    #8 0x57f807c in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManager.h:526:21
    #9 0x37c8522 in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/NewPMDriver.cpp:489:7
    #10 0x37e7c11 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/opt.cpp:830:12
    #11 0x7fbf4de4009a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #12 0x379e519 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt+0x379e519)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53 in
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/early-inline.ll
--
********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: LLVM :: Transforms/SampleProfile/inline-cold.ll (65643 of 78729)
******************** TEST 'LLVM :: Transforms/SampleProfile/inline-cold.ll' FAILED ********************
Script:
--
: 'RUN: at line 4';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=NOTINLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 5';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -passes=sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=NOTINLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 8';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -sample-profile-inline-size -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=INLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 11';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -passes=sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -sample-profile-inline-size -sample-profile-cold-inline-threshold=9999999 -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=INLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 14';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -passes=sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -sample-profile-inline-size -sample-profile-cold-inline-threshold=-500 -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=NOTINLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
--
Exit Code: 2
Command Output (stderr):
--
/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53: runtime error: member call on null pointer of type 'llvm::sampleprof::FunctionSamples'
    #0 0x5a730f8 in shouldInlineCandidate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53
    #1 0x5a730f8 in (anonymous namespace)::SampleProfileLoader::tryInlineCandidate((anonymous namespace)::InlineCandidate&, llvm::SmallVector<llvm::CallBase*, 8u>*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1178:21
    #2 0x5a6cda6 in inlineHotFunctions /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1105:13
    #3 0x5a6cda6 in (anonymous namespace)::SampleProfileLoader::emitAnnotations(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1633:16
    #4 0x5a5fcbe in runOnFunction /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2008:12
    #5 0x5a5fcbe in (anonymous namespace)::SampleProfileLoader::runOnModule(llvm::Module&, llvm::AnalysisManager<llvm::Module>*, llvm::ProfileSummaryInfo*, llvm::CallGraph*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1922:15
    #6 0x5a5de55 in llvm::SampleProfileLoaderPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2038:21
    #7 0x6552a01 in llvm::detail::PassModel<llvm::Module, llvm::SampleProfileLoaderPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
    #8 0x57f807c in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManager.h:526:21
    #9 0x37c8522 in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/NewPMDriver.cpp:489:7
    #10 0x37e7c11 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/opt.cpp:830:12
    #11 0x7fcd534a209a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #12 0x379e519 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt+0x379e519)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53 in
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=INLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
--
********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
********************
Failed Tests (2):
  LLVM :: Transforms/SampleProfile/early-inline.ll
  LLVM :: Transforms/SampleProfile/inline-cold.ll

3 years ago[Sanitizers] intercept clock_getcpuclockid on FreeBSD, and pthread_getcpuclockid.
David Carlier [Thu, 2 Sep 2021 21:34:23 +0000 (22:34 +0100)]
[Sanitizers] intercept clock_getcpuclockid on FreeBSD, and pthread_getcpuclockid.

Reviewed By: vitalybuka

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

3 years ago[NFC] Regenerate SVE ACLE intrinsics tests
Usman Nadeem [Thu, 2 Sep 2021 21:27:11 +0000 (14:27 -0700)]
[NFC] Regenerate SVE ACLE intrinsics tests

Change-Id: Ic4ec50f9a53fcf58e86104bf19ba229c1dd132d0

3 years ago[flang] Fix scope in which undeclared symbols are created
peter klausler [Wed, 1 Sep 2021 21:03:15 +0000 (14:03 -0700)]
[flang] Fix scope in which undeclared symbols are created

Don't create new symbols in FORALL, implied DO, or other
construct scopes when an undeclared name appears; use the
innermost enclosing program unit's scope.  This clears up
a pending TODO in name resolution, and also exposes (& fixes)
an unnoticed name resolution problem in a module file test.

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

3 years ago[flang] NFC: change non-nullable pointer arguments to references
peter klausler [Wed, 1 Sep 2021 00:16:01 +0000 (17:16 -0700)]
[flang] NFC: change non-nullable pointer arguments to references

Ticking off a Parser TODO: Preprocessor::Directive()'s Prescanner
argument should be a reference, not a pointer.

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

3 years ago[OpenCL] Remove decls for scalar vloada_half and vstorea_half* fns
Stuart Brady [Thu, 12 Aug 2021 15:24:28 +0000 (16:24 +0100)]
[OpenCL] Remove decls for scalar vloada_half and vstorea_half* fns

These functions are not part of the OpenCL C specification.

See https://github.com/KhronosGroup/OpenCL-Docs/issues/648 for a
clarification regarding the vloada_half declarations.

Reviewed By: Anastasia

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

3 years ago[mlir] speed up construction of LLVM IR constants when possible
Alex Zinenko [Thu, 2 Sep 2021 13:01:19 +0000 (15:01 +0200)]
[mlir] speed up construction of LLVM IR constants when possible

The translation to LLVM IR used to construct sequential constants by recurring
down to individual elements, creating constant values for them, and wrapping
them into aggregate constants in post-order. This is highly inefficient for
large constants with known data such as DenseElementsAttr. Use LLVM's
ConstantData for the innermost dimension instead. LLVM does seem to support
data constants for nested sequential constants so the outer dimensions are
still handled recursively. Nevertheless, this speeds up the translation of
large constants with equal dimensions by up to 30x.

Users are advised to rewrite large constants to use flat types before
translating to LLVM IR if more efficiency in translation is necessary. This is
not done automatically as the translation is not aware of the expectations of
the overall compilation flow about type changes and indexing, in particular for
global constants with external linkage.

Reviewed By: silvas

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

3 years ago[NFC] Added testcase for PR40750
Dávid Bolvanský [Thu, 2 Sep 2021 20:43:41 +0000 (22:43 +0200)]
[NFC] Added testcase for PR40750

3 years ago[libc++] Define insert_iterator::iter with ranges::iterator_t.
Arthur O'Dwyer [Thu, 26 Aug 2021 14:55:18 +0000 (10:55 -0400)]
[libc++] Define insert_iterator::iter with ranges::iterator_t.

The `insert_iterator::iter` member is defined as `Container::iterator` but
the standard requires `iter` to be defined in terms of `ranges::iterator_t` as
of C++20. So, if in C++20 or later, define the `iter` member as
`ranges::iterator_t`.

Original patch by Joe Loser!

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

3 years agoFix lldb after D108614
Arthur Eubanks [Thu, 2 Sep 2021 19:58:41 +0000 (12:58 -0700)]
Fix lldb after D108614

3 years ago[MemorySSA] Properly handle liveOnEntry in the walker printer
Arthur Eubanks [Thu, 2 Sep 2021 18:21:05 +0000 (11:21 -0700)]
[MemorySSA] Properly handle liveOnEntry in the walker printer

Reviewed By: asbirlea

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