Martin Storsjö [Wed, 11 May 2022 08:20:38 +0000 (11:20 +0300)]
[libunwind] Don't store a predecremented PC when using SEH
This fixes unwinding in boundary cases on ARM with SEH.
In the case of ARM/Thumb, disp->ControlPc points at the following
instruction, with the thumb bit set. Thus by decrementing 1,
it still points at the next instruction. To achieve the desired
effect of pointing at the previous instruction, one first has to strip
out the thumb bit, then do the decrement by 1 to reach the previous
instruction.
When libcxxabi looks for call site ranges, it already does
`_Unwind_GetIP(context) - 1` (in `scan_eh_tab` in
libcxxabi/src/cxa_personality.cpp), so we shouldn't do the
corresponding `- 1` multiple times.
In the case of libcxxabi on Thumb, `funcStart` (still in `scan_eh_tab`)
may have the thumb bit set. If the program counter address is
decremented both in libunwind (first removing the thumb bit, then
decremented), and then libcxxabi decrements it further, and compares
with a `funcStart` with the thumb bit set, it could point to one byte
before the start of the call site.
Thus: This modification makes libunwind with SEH work with libcxxabi
on Thumb, in settings where libunwind and libcxxabi worked fine with
Dwarf before.
For existing cases with libunwind with SEH (on x86_64 and aarch64),
this modification doesn't break any of my testcases.
Differential Revision: https://reviews.llvm.org/D126869
Martin Storsjö [Tue, 10 May 2022 10:02:59 +0000 (13:02 +0300)]
[libunwind] Remove unused ARM SEH placeholder code
There's no such corresponding code for ARM64 (which has been working
in production for years). The SEH version of the Unwind functions
(e.g. `_Unwind_GetLanguageSpecificData`) doesn't use these fields.
The `_Unwind_ForcedUnwind` function would need these bits though,
but that's not used in normal C++ exception unwinding.
Differential Revision: https://reviews.llvm.org/D126868
Martin Storsjö [Fri, 6 May 2022 21:26:45 +0000 (00:26 +0300)]
[libunwind] Fix SEH unwinding on ARM
Check `__SEH__` when checking if ARM EHABI should be implied,
similarly to
4a3722a2c3dff1fe885cc38bf43d3c095c9851e7 / D126866.
Fix a warning by using the right format specifier (PRIxPTR instead
of PRIx64), and add a double->float cast in a codepath that hasn't
been built so far.
This is enough to make SEH unwinding of itanium ABI exceptions on
ARM mostly work - one specific issue is fixed in a separate follow-up
patch.
Differential Revision: https://reviews.llvm.org/D126867
Martin Storsjö [Fri, 6 May 2022 21:19:05 +0000 (00:19 +0300)]
[builtins] Check __SEH__, when checking if ARM EHABI is implied
ARM EHABI isn't signalled by any specific compiler builtin define,
but is implied by the lack of defines specifying any other
exception handling mechanism, `__USING_SJLJ_EXCEPTIONS__` or
`__ARM_DWARF_EH__`.
As Windows SEH also can be used for unwinding, check for the
`__SEH__` define too, in the same way.
This is the same change as
4a3722a2c3dff1fe885cc38bf43d3c095c9851e7 /
D126866, applied on the compiler-rt builtins gcc_personality_v0
function.
Differential Revision: https://reviews.llvm.org/D126863
Martin Storsjö [Fri, 6 May 2022 21:23:34 +0000 (00:23 +0300)]
[clang] [Headers] Check __SEH__, when checking if ARM EHABI is implied
ARM EHABI isn't signalled by any specific compiler builtin define,
but is implied by the lack of defines specifying any other
exception handling mechanism, `__USING_SJLJ_EXCEPTIONS__` or
`__ARM_DWARF_EH__`.
As Windows SEH also can be used for unwinding, check for the
`__SEH__` define too, in the same way.
This is the same change as
4a3722a2c3dff1fe885cc38bf43d3c095c9851e7 /
D126866, applied on the clang headers.
Differential Revision: https://reviews.llvm.org/D126865
Martin Storsjö [Fri, 6 May 2022 21:37:40 +0000 (00:37 +0300)]
[libcxxabi] Check __SEH__, when checking if ARM EHABI is implied
ARM EHABI isn't signalled by any specific compiler builtin define,
but is implied by the lack of defines specifying any other
exception handling mechanism, `__USING_SJLJ_EXCEPTIONS__` or
`__ARM_DWARF_EH__`.
As Windows SEH also can be used for unwinding, check for the
`__SEH__` define too, in the same way.
Differential Revision: https://reviews.llvm.org/D126866
Martin Storsjö [Sat, 9 Apr 2022 21:32:03 +0000 (00:32 +0300)]
[libcxx] Omit dllimport in public headers in MinGW mode
In MinGW environments, thanks to slightly different code generation
and linker tricks, it's possible to link against a DLL C++ standard
library without dllimport attributes.
This allows using one single set of headers for linking against
either the DLL or a static library, leaving the decision entirely
up to the linking stage (where it can be switched with options like
-static-libstdc++).
This matches how libstdc++ headers work; there's no dllimport attributes
by default (unless the user has defined _GLIBCXX_DLL when including
headers).
This allows using one single set of headers while linking against
either a DLL or a static library, just like on Unix platforms.
This matches how libc++ has been used in MinGW configurations for
years (by first building the DLL, then configuring a static-only
build and installing on top, overwriting the libc++ config file
with one for static linking) by multiple MinGW toolchains, making
the dllimport-less use the de-facto tested configuration in the wild.
This also allows building all of libc++ in one single CMake
configuration, instead of having to do two separate builds on top of
each other.
(Linking against a DLL without dllimport can break if e.g. templates
use inconsistent visibility attributes - in cases where it still
works when using explicit dllimport; such a case was fixed in
948dd664c3ed30dd853df03cb931436f280bad4a / D99932. With this as the
default configuration, we can catch such issues in CI.)
Differential Revision: https://reviews.llvm.org/D125924
Martin Storsjö [Sun, 10 Apr 2022 21:32:11 +0000 (00:32 +0300)]
[libcxx] [test] Don't use header defines for detecting linking against a DLL
In clang-cl/MSVC environments, linking against a DLL C++ standard
library requires having dllimport attributes in the headers; this
has been used for detecting whether the tests link against a DLL,
by looking at the libc++ specific define
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS.
In mingw environments, thanks to slightly different code generation
and a couple linker tricks, it's possible to link against a DLL C++
standard library without dllimport attributes. Therefore, don't
rely on the libc++ specific header define for the detection.
Replace the detection with a runtime test.
Differential Revision: https://reviews.llvm.org/D125922
River Riddle [Sun, 15 May 2022 22:23:35 +0000 (15:23 -0700)]
[mlir] Add documentation for PDLL LSP features and setup
This commit beefs up the documentation for MLIR language servers by
adding proper documentations/examples/etc for the provided PDLL
language server capabilities. Given that this documentation is also used
for the vscode extension, this commit also updates the user facing vscode
extension documentation.
Not that the images referenced in the new documentation are hosted on
the website, and will be commited to mlir-www shortly after this commit
lands.
Differential Revision: https://reviews.llvm.org/D125650
Chris Bieneman [Tue, 10 May 2022 19:58:01 +0000 (14:58 -0500)]
[DirectX] Embed DXIL in LLVM Module
At the end of the codegen pipeline for DXIL we will emit the DXIL into
a global variable in the Module annotated for the "DXIL" section.
This will be used by the MCDXContainerStreamer to emit the DXIL into a
DXContainer DXIL part.
Other parts of the DXContainer will be constructed similarly by
serializing their values into GlobalVariables.
This will allow DXIL to flow into DXContainers through the normal
MCStreamer flow used in the MC layer.
Depends on D122270
Reviewed By: kuhar
Differential Revision: https://reviews.llvm.org/D125334
Jamie Schmeiser [Mon, 6 Jun 2022 19:51:48 +0000 (15:51 -0400)]
[NFC] Change lit test for print-changed=dot-cfg to use regular expression
Summary:
Issue 55761:
Change the lit test for print-changed=dot-cfg to have a regular expression
for the template arguments portion of the name for a pass manager pass.
This part of the name can change because it is based on the name provided
by the compiler, which is implementation-dependent. This mimics the
other change printer tests.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: mgorny (Michal Gorny)
Differential Revision: https://reviews.llvm.org/D126876
Hendrik Greving [Wed, 25 May 2022 15:18:55 +0000 (15:18 +0000)]
[ModuloSchedule] Fix terminator update when peeling.
Fixes a bug of us not correctly updating the terminator of the loop's
preheader, if multiple terminating branch instructions are present.
This is tested through existing tests. The bug itself is hard or not
possible to get exposed with the upstream Hexagon backend, because
the machine pipeliner checks for an existing preheader, which is
defined as a block with only 1 edge into the header.
The condition of this bug is a block into the loop with more than 1
edge, and not every downstream target checks for an existing preheader.
Differential Revision: https://reviews.llvm.org/D126386
Akira Hatanaka [Tue, 17 May 2022 16:37:29 +0000 (09:37 -0700)]
[gmodules] Skip CXXDeductionGuideDecls when visiting FunctionDecls in
DebugTypeVisitor
Differential Revision: https://reviews.llvm.org/D125839
Philip Reames [Mon, 6 Jun 2022 19:44:05 +0000 (12:44 -0700)]
[RISCV] Autogen a test for ease of update
Fangrui Song [Mon, 6 Jun 2022 19:41:21 +0000 (12:41 -0700)]
[docs] Fix style and typo in HowToSetUpLLVMStyleRTTI.rst after D126943
Christopher Bate [Fri, 3 Jun 2022 02:06:24 +0000 (20:06 -0600)]
[mlir][linalg] add conv_2d_nhwc_fhwc named op
This operation should be supported as a named op because
when the operands are viewed as having canonical layouts
with decreasing strides, then the "reduction" dimensions
of the filter (h, w, and c) are contiguous relative to each
output channel. When lowered to a matrix multiplication,
this layout is the simplest to deal with, and thus future
transforms/vectorizations of `conv2d` may find using this
named op convenient.
Differential Revision: https://reviews.llvm.org/D126995
Vy Nguyen [Fri, 3 Jun 2022 20:30:06 +0000 (16:30 -0400)]
[lld-macho] Demangle symbol names in duplicate-symbol error when -demangle is specified
Differential Revision: https://reviews.llvm.org/D127110
Yonghong Song [Wed, 20 Apr 2022 22:07:08 +0000 (15:07 -0700)]
[BPF] Add BTF 64bit enum value support
Current BTF only supports 32-bit value. For example,
enum T { VAL = 0xffffFFFF00000008 };
the generated BTF looks like
.long 16 # BTF_KIND_ENUM(id = 4)
.long
100663297 # 0x6000001
.long 8
.long 18
.long 8
The encoded value is 8 which equals to (uint32_t)0xffffFFFF00000008
and this is incorrect.
This patch introduced BTF_KIND_ENUM64 which permits to encode
64-bit value. The format for each enumerator looks like:
.long name_offset
.long (uint32_t)value # lower-32 bit value
.long value >> 32 # high-32 bit value
We use two 32-bit values to represent a 64-bit value as current
BTF type subsection has 4-byte alignment and gaps are not permitted
in the subsection.
This patch also added support for kflag (the bit 31 of CommonType.Info)
such that kflag = 1 implies the value is signed and kflag = 0
implies the value is unsigned. The kernel UAPI enumerator definition is
struct btf_enum {
__u32 name_off;
__s32 val;
};
so kflag = 0 with unsigned value provides backward compatability.
With this patch, for
enum T { VAL = 0xffffFFFF00000008 };
the generated BTF looks like
.long 16 # BTF_KIND_ENUM64(id = 4)
.long
3187671053 # 0x13000001
.long 8
.long 18
.long 8 # 0x8
.long
4294967295 # 0xffffffff
and the enumerator value and signedness are encoded correctly.
Differential Revision: https://reviews.llvm.org/D124641
LLVM GN Syncbot [Mon, 6 Jun 2022 18:25:14 +0000 (18:25 +0000)]
[gn build] Port
352c395fb685
Chris Bieneman [Tue, 3 May 2022 18:17:15 +0000 (13:17 -0500)]
[ObjectYAML][DX] Add dxcontainer2yaml support
This change finishes fleshing out the ObjectYAML tools to support
converting DXContainer files into yaml representations.
Depends on D124944
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D124945
Michael Kitzan [Wed, 18 May 2022 21:41:48 +0000 (14:41 -0700)]
[GISel] Add new combines for G_ADD
Patch adds new GICombineRules for G_ADD:
G_ADD(x, G_SUB(y, x)) -> y
G_ADD(G_SUB(y, x), x) -> y
Patch additionally adds new combine tests for AArch64 target for
these new rules.
Reviewed by: paquette
Differential Revision: https://reviews.llvm.org/D87936
Christopher Bate [Mon, 6 Jun 2022 04:54:11 +0000 (22:54 -0600)]
[mlir][linalg] fix crash when promoting rank-reducing memref.subviews
This change adds support for promoting `linalg` operation operands that
are produced by rank-reducing `memref.subview` ops.
Differential Revision: https://reviews.llvm.org/D127086
Louis Dionne [Mon, 6 Jun 2022 18:02:41 +0000 (14:02 -0400)]
[libc++][NFC] Move span tests under views.span
Louis Dionne [Mon, 6 Jun 2022 18:02:05 +0000 (14:02 -0400)]
[libc++][NFC] Fix outdated comment in span test
Tue Ly [Mon, 6 Jun 2022 17:30:13 +0000 (13:30 -0400)]
[libc] Fix cmake compatibility issue with list(POP_FRONT).
list(POP_FRONT) is only added to cmake in 3.15, while our base line
version is 3.13
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D127129
Philip Reames [Mon, 6 Jun 2022 17:11:23 +0000 (10:11 -0700)]
[RISCV] Reorganize getShuffleCost to make it more clear what's going on [nfc]
Vasileios Porpodas [Fri, 3 Jun 2022 02:01:57 +0000 (19:01 -0700)]
[SLP][NFC] Precommit test for followup patch that fixes vector phi poison input.
Differential Revision: https://reviews.llvm.org/D126938
Craig Topper [Mon, 6 Jun 2022 16:45:52 +0000 (09:45 -0700)]
[SelectionDAG] Further improve computeKnownBits for (smax X, C) where C is non-negative.
Move the code that was added for D126896 after the normal recursive calls
to computeKnownBits. This allows us to calculate trailing zeros.
Previously we would break out of the switch before the recursive calls.
Louis Dionne [Mon, 6 Jun 2022 16:57:42 +0000 (12:57 -0400)]
[libc++][NFC] Add missing includes
Louis Dionne [Thu, 5 May 2022 16:24:43 +0000 (12:24 -0400)]
[libc++] Avoid creating temporaries in unary expressions involving valarray
Currently, unary expressions involving valarray will create a temporary.
This leads to dangling references in expressions like `-a * b`, because
`-a` is a temporary and the resulting expression will refer to it. This
patch fixes the problem by creating a lazy expression to perform the unary
operation instead of eagerly creating a temporary valarray. This is
permitted by the Standard, which does not specify the exact type of
most expressions involving valarrays.
This is technically an ABI break, however I believe the actual potential
for breakage is very low.
rdar://
90152242
Differential Revision: https://reviews.llvm.org/D125019
Chris Bieneman [Tue, 24 May 2022 16:56:12 +0000 (11:56 -0500)]
Support converting pointers from opaque to typed
Using the pointer type analysis we can re-constitute typed pointers and
populate the correct types in the bitcasts throughout the IR.
This doesn't yet handle all cases, but this should be illustrative as
to the dirction and feasability of
the solution.
Reviewed By: pete
Differential Revision: https://reviews.llvm.org/D122270
Chris Bieneman [Mon, 6 Jun 2022 16:16:16 +0000 (11:16 -0500)]
Fix overflow bug impacting 32-bit testing
This test was failing on 32-bit arm builders due to an interger
overflow. This changes the math to avoid overflow and should resolve
the test failure.
Ivan Kosarev [Mon, 6 Jun 2022 15:46:22 +0000 (16:46 +0100)]
[AMDGPU][GFX9+] Support base+soffset+offset s_atc_probe's.
Resolves part of
https://github.com/llvm/llvm-project/issues/38652
Reviewed By: dp
Differential Revision: https://reviews.llvm.org/D126791
Sanjay Patel [Mon, 6 Jun 2022 15:13:17 +0000 (11:13 -0400)]
[InstCombine] add/move tests for opposite direction shifts; NFC
Ivan Kosarev [Mon, 6 Jun 2022 15:32:16 +0000 (16:32 +0100)]
[AMDGPU][GFX9][GFX10] Support base+soffset+offset s_dcache_discard's.
Resolves part of
https://github.com/llvm/llvm-project/issues/38652
Reviewed By: dp
Differential Revision: https://reviews.llvm.org/D126766
Dmitry Preobrazhensky [Mon, 6 Jun 2022 13:08:16 +0000 (16:08 +0300)]
[AMDGPU][GFX8][DOC][NFC] Update assembler syntax description
Summary of changes:
- Updated MUBUF lds syntax (see https://reviews.llvm.org/D124485).
- Enabled literals with src0 for v_madak*, v_madmk* (see https://reviews.llvm.org/D111067).
- Minor bug fixing.
Alex Brachet [Mon, 6 Jun 2022 14:29:14 +0000 (14:29 +0000)]
Don't warn when 'llvm' isn't found
Joe Nash [Mon, 23 May 2022 14:26:02 +0000 (10:26 -0400)]
[AMDGPU] gfx11 VOP1+VOP2 Instruction MC support
Includes dpp instructions and vop1/vop2 promoted to vop3
Patch 17/N for upstreaming of AMDGPU gfx11 architecture
Depends on D126483
Reviewed By: rampitec, #amdgpu
Differential Revision: https://reviews.llvm.org/D126917
Joe Nash [Wed, 18 May 2022 19:01:20 +0000 (15:01 -0400)]
[AMDGPU] gfx11 vop3dpp instructions
gfx11 adds the ability to use dpp modifiers on vop3 instructions.
This patch adds machine code layer support for that. The MCCodeEmitter
is changed to use APInt instead of uint64_t to support these wider
instructions.
Patch 16/N for upstreaming of AMDGPU gfx11 architecture
Depends on D126475
Reviewed By: rampitec, #amdgpu
Differential Revision: https://reviews.llvm.org/D126483
Louis Dionne [Fri, 3 Jun 2022 19:17:03 +0000 (15:17 -0400)]
[libc++] Remove a bunch of conditionals on _LIBCPP_DEBUG_LEVEL
Instead of providing two different constructors for iterators that
support the debug mode, provide a single constructor but leave the
container parameter unused when the debug mode is not enabled.
This allows simplifying all the call sites to unconditionally pass
the container, which removes a bunch of duplication in the container's
implementation.
Note that this patch does add some complexity to std::span, however
that is only because std::span has the ability to use raw pointers
as iterators instead of __wrap_iter. In retrospect, I believe it was
a mistake to provide that capability, and so it will be removed in a
future patch, along with the complexity added by this patch.
Differential Revision: https://reviews.llvm.org/D126993
Kevin P. Neal [Fri, 3 Jun 2022 18:28:02 +0000 (14:28 -0400)]
[IPSCCP] Switch away from Instruction::isSafeToRemove()
In D115737 I found that I needed to teach Instruction::isSafeToRemove()
about strictfp/constrained intrinsics. It was pointed out that this is
probably the wrong function to use isInstructionTriviallyDead(). It doesn't
make sense to have a "second, worse implementation".
I also believe that the Instruction class is the wrong place for this
functionality. The information about whether or not an instruction can be
removed is in the transform passes and should stay there.
Differential Revision: https://reviews.llvm.org/D118387
Andrzej Warzynski [Mon, 6 Jun 2022 10:03:21 +0000 (10:03 +0000)]
[flang][driver] Remove references to the `flang` bash script
This is a follow-up of https://reviews.llvm.org/D125832
(see also https://reviews.llvm.org/D125788 for more context). It simply
removes any remaining references to the `flang` bash script. Note that
that `flang-to-external-fc` remains intact.
This felt worthwhile mentioning in the release notes, which have not
been updated since LLVM 12 (we are approaching LLVM 15 now). I took the
liberty of removing all of the out-dated content and added a note about
the renaming.
Differential Revision: https://reviews.llvm.org/D127094
Dmitry Preobrazhensky [Mon, 6 Jun 2022 12:50:10 +0000 (15:50 +0300)]
[AMDGPU][GFX7][DOC][NFC] Update assembler syntax description
Summary of changes:
- Updated MUBUF lds syntax (see https://reviews.llvm.org/D124485).
- Enabled literals with src0 of v_madak_f32, v_madmk_f32 (see https://reviews.llvm.org/D111067).
- Corrected LGKM_CNT description.
- Minor bug fixing.
Aaron Ballman [Mon, 6 Jun 2022 11:51:24 +0000 (07:51 -0400)]
Fix a -Wlogical-op-parentheses warning; NFC
This should address bot failures like:
https://lab.llvm.org/buildbot/#/builders/77/builds/18317
LLVM GN Syncbot [Mon, 6 Jun 2022 11:33:45 +0000 (11:33 +0000)]
[gn build] Port
8171586176ee
Nikolas Klauser [Sun, 5 Jun 2022 19:15:16 +0000 (21:15 +0200)]
[libc++][ranges] Implement ranges::binary_search and ranges::{lower, upper}_bound
Reviewed By: Mordante, var-const, ldionne, #libc
Spies: sstefan1, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D121964
Aaron Ballman [Mon, 6 Jun 2022 11:17:35 +0000 (07:17 -0400)]
Allow use of an elaborated type specifier in a _Generic association in C++
Currently, Clang accepts this code in C mode (where the tag is required
to be used) but rejects it in C++ mode thinking that the association is
defining a new type.
void foo(void) {
struct S { int a; };
_Generic(something, struct S : 1);
}
Clang thinks this in C++ because it sees struct S : when parsing the
class specifier and decides that must be a type definition (because the
colon signifies the presence of a base class type). This patch adds a
new declarator context to represent a _Generic association so that we
can distinguish these situations properly.
Fixes #55562
Differential Revision: https://reviews.llvm.org/D126969
David Green [Mon, 6 Jun 2022 10:39:51 +0000 (11:39 +0100)]
[AArch64] Generate ADDP from shuffled add
This adds a fold of add(x, shuffle(x, <1,0,3,2,5,4,...>), into
shuffle(addp(x), <0,0,1,1,2,2,..>. The ADDP instruction takes two
vectors and returns one, adding adjacent pairs. So we match x in a
custom combine as it is lowered from a v8i32. The original code
would be 2 rev64 and 2 add, with the new code being a single addp
with a zip1;zip2 shuffle, producing smaller code.
Differential Revision: https://reviews.llvm.org/D126686
Simon Pilgrim [Mon, 6 Jun 2022 10:31:46 +0000 (11:31 +0100)]
Fix "not all control paths return a value" MSVC warning. NFC.
Nico Weber [Mon, 6 Jun 2022 10:18:13 +0000 (06:18 -0400)]
[gn build] port
f06abbb39380 a bit (create main() functions for GENERATE_DRIVER targets)
Nico Weber [Mon, 6 Jun 2022 09:52:37 +0000 (05:52 -0400)]
[gn build] set LLVM_TOOL_LLVM_DRIVER_BUILD to 0 for now
Nimish Mishra [Mon, 6 Jun 2022 14:47:32 +0000 (20:17 +0530)]
[flang][OpenMP] Added parser support for in_reduction clause
OpenMP 5.0 adds a new clause `in_reduction` on OpenMP directives.
This patch adds parser support for the same.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D124156
Kai Luo [Mon, 6 Jun 2022 09:08:02 +0000 (09:08 +0000)]
[PowerPC] Support huge frame size for PPC64
Support allocation of huge stack frame(>2g) on PPC64.
For ELFv2 ABI on Linux, quoted from the spec 2.2.3.1 General Stack Frame Requirements
> There is no maximum stack frame size defined.
On AIX, XL allows such huge frame.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D107886
Florian Hahn [Mon, 6 Jun 2022 08:38:53 +0000 (09:38 +0100)]
[VPlan] Replace BranchOnCount with BranchOnCond if TC <= UF * VF.
Try to simplify BranchOnCount to `BranchOnCond true` if TC <= UF * VF.
This is an alternative to D121899 which simplifies the VPlan directly
instead of doing so late in code-gen.
The potential benefit of doing this in VPlan is that this may help
cost-modeling in the future. The reason this is done in prepareToExecute
at the moment is that a single plan may be used for multiple VFs/UFs.
There are further simplifications that can be applied as follow ups:
1. Replace inductions with constants
2. Replace vector region with regular block.
Fixes #55354.
Depends on D126679.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D126680
David Spickett [Mon, 6 Jun 2022 08:25:51 +0000 (08:25 +0000)]
Revert "[libcxx] Temporarily skip Arm configs"
This reverts commit
d4220af52723e76973723d3089c6fe2527fd704d.
Linaro bots are back online.
Shao-Ce SUN [Fri, 3 Jun 2022 17:27:15 +0000 (01:27 +0800)]
[RISCV] Use check-prefixes to reduce check lines
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D125083
yanming [Mon, 6 Jun 2022 07:32:12 +0000 (15:32 +0800)]
[NFC][RISCV][format] Blank line between functions, remove unnecessary semicolon.
Kazu Hirata [Mon, 6 Jun 2022 06:53:18 +0000 (23:53 -0700)]
[Scalar] Use llvm::make_early_inc_range (NFC)
yanming [Thu, 2 Jun 2022 04:52:50 +0000 (12:52 +0800)]
[RISCV] Define risc-v's own register class to model FP Register.
The default RegisterClass is not enough to model RISCV Register.
We define risc-v's own register class to model FP Register.
This helps to better estimate the register pressure in the loop-vectorize.
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D126854
Qingyuan Zheng [Mon, 6 Jun 2022 05:58:00 +0000 (01:58 -0400)]
[AST] Fix clang RecursiveASTVisitor for definition of XXXTemplateSpecializationDecl
Fixes https://github.com/clangd/clangd/issues/1132
where clangd's semantic highlighting is missing for symbols of a template
specialization definition. It turns out the visitor didn't traverse the
base classes of Class/Var##TemplateSpecializationDecl, i.e.
CXXRecordDecl/VarDecl. This patch adds them back as what is done in
DEF_TRAVERSE_TMPL_PART_SPEC_DECL.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D126757
Kazu Hirata [Mon, 6 Jun 2022 06:33:50 +0000 (23:33 -0700)]
[PDB] Remove truncate* (NFC)
- truncateQuotedNameFront: The last use was removed on Jul 10, 2017 in
commit
a9d944fd6fd19ac377b5ebea9272676642b7ceaa.
- truncateQuotedNameBack: The last use was removed on Mar 26, 2018 in
commit
7b84b678a993c8a8236868f65d1d4c2b3e29fb3d.
- truncateStringMiddle: The last use was removed on Mar 26, 2018 in
commit
7b84b678a993c8a8236868f65d1d4c2b3e29fb3d.
- truncateStringBack: The last use is in truncateQuotedNameBack being
removed above.
- truncateStringFront: The last use is in truncateQuotedNameFront
being removed above.
Chuanqi Xu [Mon, 6 Jun 2022 06:11:59 +0000 (14:11 +0800)]
[NFC] [Coroutines] Add test for ambiguous allocation functions in
promise_type
Address the post-commit comment in
https://reviews.llvm.org/D125517#inline-1217244
Chris Bieneman [Mon, 6 Jun 2022 04:25:55 +0000 (04:25 +0000)]
LLVM Driver Multicall tool
This patch adds an llvm-driver multicall tool that can combine multiple
LLVM-based tools. The build infrastructure is enabled for a tool by
adding the GENERATE_DRIVER option to the add_llvm_executable CMake
call, and changing the tool's main function to a canonicalized
tool_name_main format (i.e. llvm_ar_main, clang_main, etc...).
As currently implemented llvm-driver contains dsymutil, llvm-ar,
llvm-cxxfilt, llvm-objcopy, and clang (if clang is included in the
build).
llvm-driver can be enabled from builds by setting
LLVM_TOOL_LLVM_DRIVER_BUILD=On.
There are several limitations in the current implementation, which can
be addressed in subsequent patches:
(1) the multicall binary cannot currently properly handle
multi-dispatch tools. This means symlinking llvm-ranlib to llvm-driver
will not properly result in llvm-ar's main being called.
(2) the multicall binary cannot be comprised of tools containing
conflicting cl::opt options as the global cl::opt option list cannot
contain duplicates.
These limitations can be addressed in subsequent patches.
Differential revision: https://reviews.llvm.org/D109977
Brad Smith [Mon, 6 Jun 2022 03:28:53 +0000 (23:28 -0400)]
[BPF] Enable IAS in backend
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D123845
Kazu Hirata [Mon, 6 Jun 2022 03:22:47 +0000 (20:22 -0700)]
[CodeGen] Remove splitCanCauseEvictionChain and its helpers (NFC)
The last use was removed on Mar 7, 2022 in commit
294eca35a00f89dff474044ebd478a7f83ccc310.
jacquesguan [Mon, 6 Jun 2022 02:31:12 +0000 (02:31 +0000)]
[mlir][NFC] Replace some llvm::find with llvm::is_contained.
This patch replaces some llvm::find with llvm::is_contained, it should be more clear.
Differential Revision: https://reviews.llvm.org/D127077
Kazu Hirata [Mon, 6 Jun 2022 02:58:18 +0000 (19:58 -0700)]
[GlobalISel] Remove widenWithUnmerge (NFC)
The last use was removed on Dec 23, 2021 in commit
29f88b93fdbe3e20c35842ca3a6c2a3f1a81cfce.
Kazu Hirata [Mon, 6 Jun 2022 02:51:02 +0000 (19:51 -0700)]
[GlobalISel] Remove valueIsSplit (NFC)
The last use was removed on Jun 27, 2019 in commit
8138996128cd17d78d9d3e6ef7b49987565cb310.
Lian Wang [Thu, 26 May 2022 02:50:42 +0000 (02:50 +0000)]
[LegalizeTypes][VP] Add widen and split support for vp.fptrunc and vp.fpext
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D126439
chenglin.bi [Mon, 6 Jun 2022 02:15:48 +0000 (10:15 +0800)]
[InstCombine] Add more tests for shl+lshr transforms; NFC
chenglin.bi [Mon, 6 Jun 2022 02:08:56 +0000 (10:08 +0800)]
[InstCombine] Fix tests const value for shl+lshr transforms; NFC
chenglin.bi [Mon, 6 Jun 2022 01:59:41 +0000 (09:59 +0800)]
[InstCombine] Add more tests for shl+lshr transforms; NFC
Phoebe Wang [Mon, 6 Jun 2022 00:31:44 +0000 (08:31 +0800)]
[Clang][FP16] Add 4 builtins for _Float16
We are lacking builtins support for `_Float16`. In most cases, we can use other floating-type builtins and truncate them to `_Float16`.
But it's a problem to SNaN, e.g., https://gcc.godbolt.org/z/cqr5nG1jh
This patch adds `__builtin_nansf16` support as well as other 3 ones since they are usually used together.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D127050
Kazu Hirata [Mon, 6 Jun 2022 00:56:40 +0000 (17:56 -0700)]
[clang] Use llvm::is_contained (NFC)
Sanjay Patel [Sun, 5 Jun 2022 21:55:09 +0000 (17:55 -0400)]
[InstCombine] fold mul with masked low bit operand to trunc+select
https://alive2.llvm.org/ce/z/o7rQ5q
This shows an extra instruction in some cases, but that is
caused by an existing canonicalization of trunc -> and+icmp.
Codegen should be better for any target where a multiply is
more costly than the most simple ALU op.
This ends up producing the requested x86 asm from issue #55618,
but it's not the same IR. We are missing a canonicalization
from the negate+mask pattern to the trunc+select created here.
Sanjay Patel [Fri, 3 Jun 2022 19:47:14 +0000 (15:47 -0400)]
[ConstProp] add tests for APFloat truncate miscompile; NFC
issue #55838
Fangrui Song [Sun, 5 Jun 2022 23:06:09 +0000 (16:06 -0700)]
[Driver][test] Remove unneeded -no-canonical-prefixes and -o %t.o
Similar to
980679981fbc311bc07f8cd23e3739fd56c22d2a
owenca [Sat, 4 Jun 2022 19:26:07 +0000 (12:26 -0700)]
[clang-format] Handle attributes for for/while loops
Fixes #55853.
Differential Revision: https://reviews.llvm.org/D127054
Fangrui Song [Sun, 5 Jun 2022 22:11:01 +0000 (15:11 -0700)]
[MC] Change EndOfStatement "unexpected tokens in .xxx directive " to "expected newline"
Fangrui Song [Sun, 5 Jun 2022 21:53:59 +0000 (14:53 -0700)]
[ARM][MC] Change EndOfStatement "unexpected tokens in .xxx directive " to "expected newline"
The directive name is not useful because the next line replicates the error line
which includes the directive. The prevailing style uses "expected newline".
Aditya Kumar [Sun, 5 Jun 2022 21:48:00 +0000 (14:48 -0700)]
[NFC] Make comment consistent with allow|ignore list renamings
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D123640
Fangrui Song [Sun, 5 Jun 2022 21:32:31 +0000 (14:32 -0700)]
[AArch64][MC] Change "unexpected tokens in .xxx directive " to "expected newline"
The directive name is not useful because the next line replicates the error line
which includes the directive. The prevailing style uses "expected newline".
Peter Collingbourne [Sun, 5 Jun 2022 06:42:00 +0000 (23:42 -0700)]
gn build: Fix build when not building the native target.
Differential Revision: https://reviews.llvm.org/D127068
Fangrui Song [Sun, 5 Jun 2022 20:29:49 +0000 (13:29 -0700)]
[bolt] Remove unneeded cl::ZeroOrMore for cl::opt options
Joe Loser [Sat, 4 Jun 2022 16:28:17 +0000 (10:28 -0600)]
[libc++][test] Mark ranges.transform.pass.cpp UNSUPPORTED for AIX
The `ranges.transform.pass.cpp` often times out on CI for AIX (32-bit and 64-bit)
only. Mark the test as `UNSUPPORTED` for `AIX` for now. It should be looked into in
the future.
Differential Revision: https://reviews.llvm.org/D127051
Stella Laurenzo [Sun, 5 Jun 2022 19:30:28 +0000 (12:30 -0700)]
[mlir] Tunnel LLVM_USE_LINKER through to the standalone example build.
When building in debug mode, the link time of the standalone sample is excessive, taking upwards of a minute if using BFD. This at least allows lld to be used if the main invocation was configured that way. On my machine, this gets a standalone test that requires a relink to run in ~13s for Debug mode. This is still a lot, but better than it was. I think we may want to do something about this test: it adds a lot of latency to a normal compile/test cycle and requires a bunch of arg fiddling to exclude.
I think we may end up wanting a `check-mlir-heavy` target that can be used just prior to submit, and then make `check-mlir` just run unit/lite tests. More just thoughts for the future (none of that is done here).
Reviewed By: bondhugula, mehdi_amini
Differential Revision: https://reviews.llvm.org/D126585
Kazu Hirata [Sun, 5 Jun 2022 19:07:14 +0000 (12:07 -0700)]
[llvm] Convert for_each to range-based for loops (NFC)
Kazu Hirata [Sun, 5 Jun 2022 18:49:13 +0000 (11:49 -0700)]
[Sparc] Fix a warning
This patch fixes:
llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp:910:5: error:
default label in switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]
Matheus Izvekov [Sun, 5 Jun 2022 17:00:57 +0000 (19:00 +0200)]
[NFC] Add test cases reported in PR54341
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D127074
Alexey Lapshin [Fri, 3 Jun 2022 11:11:43 +0000 (14:11 +0300)]
[Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef - remove isIndexed().
This patch is extraction from the https://reviews.llvm.org/D126883.
It removes DwarfStringPoolEntryRef::isIndexed() and isIndexed bit
since they are not used.
Differential Revision: https://reviews.llvm.org/D126958
LemonBoy [Sun, 5 Jun 2022 18:06:50 +0000 (14:06 -0400)]
[SPARC][MC] Support more relocation types
This patch introduces support for %hix, %lox, %gdop_hix22, %gdop_lox10 and %gdop.
An extra test is introduced to make sure the fixups are correctly applied.
Reviewed By: dcederman
Differential Revision: https://reviews.llvm.org/D102575
Peter Klausler [Tue, 31 May 2022 21:06:11 +0000 (14:06 -0700)]
[flang][runtime] Use __float128 where possible & needed in runtime
On targets with __float128 available and distinct from long double,
use it to support more kind=16 entry points. This affects mostly
x86-64 targets. This means that more runtime entry points are
defined for lowering to call.
Delete Common/long-double.h and its LONG_DOUBLE macro in favor of
testing the standard macro LDBL_MANT_DIG.
Differential Revision: https://reviews.llvm.org/D127025
Kazu Hirata [Sun, 5 Jun 2022 15:45:11 +0000 (08:45 -0700)]
[Scalar] Remove isValidSingle (NFC)
The last use was removed on Feb 18, 2022 in commit
00ab91b70d21f72af59e4e198c6dc819452405af.
Nathan James [Sun, 5 Jun 2022 11:03:08 +0000 (12:03 +0100)]
[ADT] Add edit_distance_insensitive to StringRef
In some instances its advantageous to calculate edit distances without worrying about casing.
Currently to achieve this both strings need to be converted to the same case first, then edit distance can be calculated.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D126159
Fangrui Song [Sun, 5 Jun 2022 08:07:50 +0000 (01:07 -0700)]
Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options
Fangrui Song [Sun, 5 Jun 2022 07:31:44 +0000 (00:31 -0700)]
Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options
Kazu Hirata [Sun, 5 Jun 2022 07:16:14 +0000 (00:16 -0700)]
[Transforms/Utils] Use predecessors (NFC)
Christian Sigg [Sat, 4 Jun 2022 10:33:42 +0000 (12:33 +0200)]
Recommit: "[MLIR][NVVM] Replace fdiv on fp16 with promoted (fp32) multiplication with reciprocal plus one (conditional) Newton iteration."
This change rolls
bcfc0a9051014437b55ab932d9aca5ecdca6776b forward (i.e., reverting
369ce54bb302f209239b8ebc77ad824add9df089) with fixed CMakeLists.txt.
Fangrui Song [Sun, 5 Jun 2022 06:51:12 +0000 (23:51 -0700)]
Remove unneeded cl::ZeroOrMore for cl::list options
Kazu Hirata [Sun, 5 Jun 2022 05:48:32 +0000 (22:48 -0700)]
Use llvm::less_second (NFC)