platform/upstream/llvm.git
17 months ago[lld] Add --lto-debug-pass-manager option
Ellis Hoag [Wed, 31 May 2023 21:02:23 +0000 (14:02 -0700)]
[lld] Add --lto-debug-pass-manager option

Add support for printing the passes run for LTO.

Both ELF and COFF have `--lto-debug-pass-manager` (`-ltodebugpassmanager`) to print the compiler passes run during LTO. This is useful to check that a certain compiler pass is run in a test, e.g., https://reviews.llvm.org/D151589

Reviewed By: #lld-macho, MaskRay, int3

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

17 months ago[clang] Fix crash when passing a braced-init list to a parentehsized aggregate init...
Alan Zhao [Tue, 30 May 2023 23:27:14 +0000 (16:27 -0700)]
[clang] Fix crash when passing a braced-init list to a parentehsized aggregate init expression

The previous code incorrectly assumed that we would never call
warnBracedScalarInit(...) with a EK_ParenAggInitMember. This patch fixes
the bug by warning when a scalar member is initialized via a braced-init
list when performing a parentehsized aggregate initialization. This
behavior is consistent with parentehsized list aggregate initialization.

Fixes #63008

Reviewed By: shafik

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

17 months agoRevert "[2a/3][ASan][libcxx] std::deque annotations"
Vitaly Buka [Wed, 31 May 2023 20:31:49 +0000 (13:31 -0700)]
Revert "[2a/3][ASan][libcxx] std::deque annotations"

This reverts commit 605b9c76e093f6ed713b3fea47cb9726b346edeb.

17 months ago[mlir][spirv] Add printf op from SPIRV OpenCL extension set spec
Dimple Prajapati [Wed, 31 May 2023 20:41:25 +0000 (16:41 -0400)]
[mlir][spirv] Add printf op from SPIRV OpenCL extension set spec

This change adds op to support printf instruction from OpenCL extensions set.
This op helps writing out debug details from SPIRV kernel in a given format.

Patch By: drprajap
Reviewed By: antiagainst, kuhar

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

17 months ago[flang] Add DerivedTypeSpec::VectorTypeAsFortran for PPC vector type
Kelvin Li [Mon, 29 May 2023 20:27:38 +0000 (16:27 -0400)]
[flang] Add DerivedTypeSpec::VectorTypeAsFortran for PPC vector type

VectorTypeAsFortran is added for writing PPC vector types to modules.

Coauthor: @tislam

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

17 months ago[scudo] Release pages of larger block more frequently
Chia-hung Duan [Thu, 25 May 2023 23:08:38 +0000 (23:08 +0000)]
[scudo] Release pages of larger block more frequently

Release pages for large block (size greater than a page) is faster than
the small blocks. Besides, larger blocks are supposed not to be used
so often like smaller blocks which means we may hold several pages used
by large block and rarely get chance to release them if there's no
explicit M_PURGE call. Therefore, relax the release-interval condition
for large block.

This also fixes the assumption that FORCE_ALL should always try page
release.

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

17 months ago[test] Add zero size global test to code-model-elf.ll
Arthur Eubanks [Wed, 31 May 2023 20:03:27 +0000 (13:03 -0700)]
[test] Add zero size global test to code-model-elf.ll

17 months ago[Tooling] Remove unused function setRestoreWorkingDir
Kazu Hirata [Wed, 31 May 2023 19:43:37 +0000 (12:43 -0700)]
[Tooling] Remove unused function setRestoreWorkingDir

The last use was removed by:

  commit 146ec74a8382dc820809d0a2bf4b918d0b5e6603
  Author: Jan Svoboda <jan_svoboda@apple.com>
  Date:   Fri Sep 10 10:24:16 2021 +0200

Once I remove the function, RestoreCWD is always true, so this patch
removes the variable and propagates the constant.

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

17 months ago[X86] Use "l" prefix for data sections under medium/large code model
Arthur Eubanks [Wed, 10 May 2023 20:13:43 +0000 (13:13 -0700)]
[X86] Use "l" prefix for data sections under medium/large code model

And also set the SHF_X86_64_LARGE section flag.

gcc only uses the "l" prefix and SHF_X86_64_LARGE in the medium code model for data larger than -mlarge-data-threshold. But it seems more consistent to use it in the large code model as well in case separate parts of the binary aren't compiled with the large code model and also have a .data/.bss/.rodata section.

Reviewed By: MaskRay, tkoeppe

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

17 months ago[libc++][docs] Add note about RFCs for significant changes
Louis Dionne [Wed, 17 May 2023 18:05:12 +0000 (11:05 -0700)]
[libc++][docs] Add note about RFCs for significant changes

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

17 months ago[libc++] Add a few missing _LIBCPP_HIDE_FROM_ABI annotations
Louis Dionne [Wed, 31 May 2023 19:23:37 +0000 (12:23 -0700)]
[libc++] Add a few missing _LIBCPP_HIDE_FROM_ABI annotations

17 months ago[clang] Allow fp in atomic fetch max/min builtins
Yaxun (Sam) Liu [Fri, 19 May 2023 17:51:29 +0000 (13:51 -0400)]
[clang] Allow fp in atomic fetch max/min builtins

LLVM IR already allows floating point type in atomicrmw.
Update clang atomic fetch max/min builtins to accept
floating point type like we did for fetch add/sub.

Reviewed by: Artem Belevich

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

Fixes: SWDEV-401056

17 months ago[Darwin] Fix more ASAN symbolizer tests
Francis Visoiu Mistrih [Wed, 31 May 2023 19:17:21 +0000 (12:17 -0700)]
[Darwin] Fix more ASAN symbolizer tests

RenderFrame now strips `wrap_`.

17 months ago[clang] NFCI: Use `FileEntryRef` in `VerifyDiagnosticConsumer`
Jan Svoboda [Wed, 31 May 2023 06:11:48 +0000 (23:11 -0700)]
[clang] NFCI: Use `FileEntryRef` in `VerifyDiagnosticConsumer`

This is a prep patch that enables removal of some calls to the deprecated `{File,Directory}Entry::getName()`.

17 months ago[clang] NFCI: Use `FileEntryRef` in `PPDirectives`
Jan Svoboda [Wed, 31 May 2023 06:09:40 +0000 (23:09 -0700)]
[clang] NFCI: Use `FileEntryRef` in `PPDirectives`

This is a prep patch that enables removal of some calls to the deprecated `{File,Directory}Entry::getName()`.

17 months ago[clang] Use the appropriate definition when checking FunctionDecl::isInlineBuiltinDec...
serge-sans-paille [Wed, 31 May 2023 05:57:35 +0000 (07:57 +0200)]
[clang] Use the appropriate definition when checking FunctionDecl::isInlineBuiltinDeclaration

This is a follow-up to https://reviews.llvm.org/D148723 and fixes the
bug reported by @mstorsjo.

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

17 months ago[libc][docs] Update implementation status table for Date and Time Functions.
Tue Ly [Wed, 31 May 2023 15:11:08 +0000 (11:11 -0400)]
[libc][docs] Update implementation status table for Date and Time Functions.

Update implementation status table for Date and Time Functions to include different targets.

Reviewed By: jeffbailey

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

17 months ago[RISCV] Change LdPat and StPat from multiclass to class. NFC
Craig Topper [Wed, 31 May 2023 18:46:52 +0000 (11:46 -0700)]
[RISCV] Change LdPat and StPat from multiclass to class. NFC

These used to contain multiple patterns, but that was simplified
when we moved to using ComplexPattern for load/store address matching.

17 months ago[DAG] Combine insert(shuffle(load), load, 0) into a single load
David Green [Wed, 31 May 2023 18:48:57 +0000 (19:48 +0100)]
[DAG] Combine insert(shuffle(load), load, 0) into a single load

Given an insert of a scalar load into a vector shuffle with mask
u,0,1,2,3,4,5,6 or 1,2,3,4,5,6,7,u (depending on the insert index),
it can be more profitable to convert to a single load and avoid the
shuffles. This adds a DAG combine for it, providing the new load is
still fast.

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

17 months ago[Darwin] Fix ASAN symbolizer tests
Francis Visoiu Mistrih [Wed, 31 May 2023 18:32:13 +0000 (11:32 -0700)]
[Darwin] Fix ASAN symbolizer tests

RenderFrame now strips `wrap_`.

17 months ago[CodeGen] Improve handling -Ofast generated code by ComplexDeinterleaving pass
Igor Kirillov [Mon, 17 Apr 2023 18:24:45 +0000 (18:24 +0000)]
[CodeGen] Improve handling -Ofast generated code by ComplexDeinterleaving pass

Code generated with -Ofast and -O3 -ffp-contract=fast (add
-ffinite-math-only to enable vectorization) can differ significantly.
Code compiled with -O3 can be deinterleaved using patterns as the
instruction order is preserved. However, with the -Ofast flag, there
can be multiple changes in the computation sequence, and even the real
and imaginary parts may not be calculated in parallel.
For more details, refer to
llvm/test/CodeGen/AArch64/complex-deinterleaving-*-fast.ll and
llvm/test/CodeGen/AArch64/complex-deinterleaving-*-contract.ll tests.
This patch implements a more general approach and enables handling most
-Ofast cases.

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

17 months ago[flang][hlfir] Lower structure constructor via AssignOp.
Slava Zakharin [Wed, 31 May 2023 16:06:51 +0000 (09:06 -0700)]
[flang][hlfir] Lower structure constructor via AssignOp.

I tried this patch, first. Some tests failed because of the extra
finalizations for the temporary LHSs: when LHS component is a derived
type with final subprograms, the finalizations might be detected
by counting/printing in the final subprograms and treated as errors
in the tests, because they are not expected.
So I also tried to reuse the StructureConstructor code lowering to FIR
followed by AsExprOp to produce the HLFIR "value". Unfortunately,
this did not resolve the finalization issues, because AsExprOp may
end up being bufferized into AssignOp as well.
So the extra finalizations are inherent problem for AssignOp,
and it has to be resolved separately. Thus, I decided to proceed
with a "cleaner" direct lowering to HLFIR (the initial patch).

I am thinking about adding an extra flag for AssignOp that would
indicate that the LHS is a compiler generated temporary, so we could
use something like AssignTemporary() in HLFIR-to-FIR converter.

Reviewed By: tblah

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

17 months agoRevert "[compiler-rt][CMake] Properly set COMPILER_RT_HAS_LLD"
Arthur Eubanks [Wed, 31 May 2023 18:26:55 +0000 (11:26 -0700)]
Revert "[compiler-rt][CMake] Properly set COMPILER_RT_HAS_LLD"

This reverts commit 395a614d2cb69a431bd11e266021d91503c1d709.

Causes some bots to break, e.g. https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8779560688633165361/overview

17 months agoRevert "[mlir][Vector] Extend xfer drop unit dim patterns"
Diego Caballero [Wed, 31 May 2023 18:07:09 +0000 (18:07 +0000)]
Revert "[mlir][Vector] Extend xfer drop unit dim patterns"

This reverts commit a53cd03deac5e6272e9dae88a90cd51410d312d5.

This commit is exposing some implementation gaps in other patterns.
Reverting for now.

17 months ago[hwasan] RunMallocHooks with orig_size
Jin Xin Ng [Fri, 26 May 2023 18:57:21 +0000 (18:57 +0000)]
[hwasan] RunMallocHooks with orig_size

This matches behaviour of asan. sanitizer_common/TestCases/malloc_hook.cpp
should've caught this- but hwasan was on XFAIL.

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

17 months ago[clang][analyzer][NFC] Use the operator new directly with the `BumpPtrAllocator`
Dmitri Gribenko [Wed, 31 May 2023 18:02:44 +0000 (20:02 +0200)]
[clang][analyzer][NFC] Use the operator new directly with the `BumpPtrAllocator`

Reviewed By: xazax.hun

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

17 months ago[RISCV] Use class and inheritance instead of multiclass for some vector isel patterns...
Craig Topper [Wed, 31 May 2023 17:55:12 +0000 (10:55 -0700)]
[RISCV] Use class and inheritance instead of multiclass for some vector isel patterns. NFC

17 months ago[libcxxabi] copy back std::string_view patches from LLVM
Nick Desaulniers [Wed, 31 May 2023 16:50:35 +0000 (09:50 -0700)]
[libcxxabi] copy back std::string_view patches from LLVM

I made a series of changes to LLVM's demangle in:
- D148348
- D148353
- D148363
- D148375
and so did Fangrui in 3ece37b3fa2c and Ashay in D149061.

I didn't notice the banner about there being two copies of this in tree
and was modifying the downstream versions. Copy these changes back to
the upstream version. Oops!

Reviewed By: MaskRay, #libc_abi, ldionne, phosek

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

17 months ago[mlir][sparse] fix crashes when generation conv_2d_nchw_fchw with Compressed Dense...
Peiming Liu [Wed, 31 May 2023 03:44:56 +0000 (03:44 +0000)]
[mlir][sparse] fix crashes when generation conv_2d_nchw_fchw with Compressed Dense Compressed Dense sparse encoding.

Reviewed By: aartbik

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

17 months ago[lldb] Take StringRef name in GetIndexOfChildMemberWithName (NFC)
Dave Lee [Sun, 28 May 2023 19:08:19 +0000 (12:08 -0700)]
[lldb] Take StringRef name in GetIndexOfChildMemberWithName (NFC)

Change the type of the `name` parameter from `char *` to `StringRef`.

Follow up to D151615.

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

17 months ago[Fuchsia] Add llvm-debuginfod to toolchain
Daniel Thornburgh [Tue, 30 May 2023 21:20:46 +0000 (14:20 -0700)]
[Fuchsia] Add llvm-debuginfod to toolchain

17 months ago[RISCV] Lower extern_weak symbols using the GOT for the medany model
Jessica Clarke [Wed, 31 May 2023 17:30:36 +0000 (18:30 +0100)]
[RISCV] Lower extern_weak symbols using the GOT for the medany model

Such symbols may be undefined at link time and thus resolve to 0, which
may be further than 2GiB away from PC, causing the immediate to be out
of range for PC-relative addressing. Using the GOT avoids this, and is
the approach taken by AArch64.

Reviewed By: asb, MaskRay, arichardson

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

17 months ago[RISCV] Add new lga pseudoinstruction
Jessica Clarke [Wed, 31 May 2023 17:30:27 +0000 (18:30 +0100)]
[RISCV] Add new lga pseudoinstruction

This mirrors lla and is always GOT-relative, allowing an explicit
request to use the GOT without having to expand the instruction. This
then means la is just defined in terms of lla and lga in the assembler,
based on whether PIC is enabled, and at the codegen level we replace la
entirely with lga since we only ever use la there when we want to load
from the GOT (and assert that to be the case).

See https://github.com/riscv-non-isa/riscv-asm-manual/issues/50

Reviewed By: asb, MaskRay

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

17 months ago[RISCV] Add test showing the current extern_weak lowering
Jessica Clarke [Wed, 31 May 2023 17:30:19 +0000 (18:30 +0100)]
[RISCV] Add test showing the current extern_weak lowering

Reviewed By: asb, MaskRay

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

17 months ago[mlir] Avoid folding `index.remu` and `index.rems` for 0 rhs
rikhuijzer [Wed, 31 May 2023 17:45:05 +0000 (10:45 -0700)]
[mlir] Avoid folding `index.remu` and `index.rems` for 0 rhs

As discussed in https://github.com/llvm/llvm-project/issues/59714#issuecomment-1369518768, the folder for the remainder operations should be resillient when the rhs is 0.
The file `IndexOps.cpp` was already checking for multiple divisions by zero, so I tried to stick to the code style from those checks.

Fixes #59714.

As a side note, is it correct that remainder operations are never optimized away? I would expect that the following code

```
func.func @remu_test() -> index {
  %c3 = index.constant 2
  %c0 = index.constant 1
  %0 = index.remu %c3, %c0
  return %0 : index
}
```
would be optimized to
```
func.func @remu_test() -> index {
  return index.constant 0 : index
}
```
when called with `mlir-opt --convert-scf-to-openmp temp.mlir`, but maybe I'm misunderstanding something.

Reviewed By: Mogball

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

17 months ago[flang] CUDA Fortran - part 3/5: declarations checking
Peter Klausler [Sat, 6 May 2023 22:03:39 +0000 (15:03 -0700)]
[flang] CUDA Fortran - part 3/5: declarations checking

Implements checks for CUDA Fortran attributes on objects, types, and
subprograms.  Includes a couple downgrades of existing errors into
warnings that were exposed during testing.

Depends on https://reviews.llvm.org/D150159 &
https://reviews.llvm.org/D150161.

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

17 months ago[ARM][AArch64] Add tests for shuffles load patterns. NFC
David Green [Wed, 31 May 2023 17:42:01 +0000 (18:42 +0100)]
[ARM][AArch64] Add tests for shuffles load patterns. NFC

See D151029

17 months ago[LoadStoreVectorizer] Fix index width != pointer width case
Krzysztof Drewniak [Tue, 30 May 2023 21:01:21 +0000 (21:01 +0000)]
[LoadStoreVectorizer] Fix index width != pointer width case

Fixes https://github.com/llvm/llvm-project/issues/62856

Reviewed By: jlebar

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

17 months agoRevert "[ThinLTO] Disable partial sample profile scaling by default"
Teresa Johnson [Wed, 31 May 2023 16:09:27 +0000 (09:09 -0700)]
Revert "[ThinLTO] Disable partial sample profile scaling by default"

This reverts commit aae8524bcc26cf04729f2bbc02ecb54233a587e4, which was
found to cause a few unexpected benchmark performance differences that
need investigation.

17 months ago[flang] CUDA Fortran - part 2/5: symbols & scopes
Peter Klausler [Sat, 6 May 2023 22:03:39 +0000 (15:03 -0700)]
[flang] CUDA Fortran - part 2/5: symbols & scopes

Add representations of CUDA Fortran data and subprogram attributes
to the symbol table and scopes of semantics.  Set them in name
resolution, and emit them to module files.

Depends on https://reviews.llvm.org/D150159.

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

17 months ago[RISCV][InsertVSETVLI] Relax tail policy more often for vmv.s.x
Luke Lau [Wed, 31 May 2023 17:04:25 +0000 (17:04 +0000)]
[RISCV][InsertVSETVLI] Relax tail policy more often for vmv.s.x

If a vm.s.x pseudo has an undef passthru operand, then we're free to use
whatever tail policy we want for VL > 1. We previously relaxed the tail
policy for this but only when we could also expand the SEW.
This patch changes it to relax the tail policy even if the SEW can't be
expanded and removes a few more toggles, as well as fully moving the
vmv.s.x logic into getDemanded.

17 months ago[RISCV][InsertVSETVLI] Avoid vmv.s.x SEW toggle if at start of block
Luke Lau [Wed, 31 May 2023 14:29:28 +0000 (14:29 +0000)]
[RISCV][InsertVSETVLI] Avoid vmv.s.x SEW toggle if at start of block

vmv.s.x/vfmv.s.f instructions that only write to the first destination
element can use any SEW greater than or equal to its original SEW,
provided that it's writing to an implicit_def operand where we can
clobber the other lanes.

We were already handling this in needVSETVLI, which meant that when
scanning the instructions from top to bottom we could detect this and
avoid the toggle:

vsetivli zero, 4, e64, mf2, ta, ma
li a0, 11
vsetivli zero, 1, e8, mf8, ta, ma
vmv.s.x v0, a0

->
vsetivli zero, 4, e64, mf2, ta, ma
li a0, 11
vmv.s.x v0, a0
The issue that this patch aims to solve is arises when the vmv.s.x is
the first vector instruction in the block and doesn't have any prior
predecessor info:

entry_bb:
li a0, 11
; No previous state here: forced to set VL/VTYPE
vsetivli zero, 1, e8, mf8, ta, ma
vmv.s.x v0, a0
vsetivli zero, 4, e16, mf2, ta, ma
vmerge.vvm v8, v9, v8, v0
doLocalPostpass can work backwards from bottom to top and work out if
an earlier vsetvli can be mutated to avoid a toggle. It uses
DemandedFields and getDemanded for this, which previously didn't take
into account the possibility of going to a larger SEW.

A previous patch consolidated the vmv.s.x logic from needVSETVLI logic
into getDemanded, and this patch removes the gate around it so that
doLocalPostpass can now delete vsetvlis like in the scenario below:

entry_bb:
li a0, 11
; Previous vsetivli mutated: second one deleted
vsetivli zero, 4, e16, mf2, ta, ma
vmv.s.x v0, a0
vmerge.vvm v8, v9, v8, v0

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

17 months ago[RISCV][InsertVSETVLI] Move vmv.s.x SEW check into getDemandedBits. NFC
Luke Lau [Fri, 26 May 2023 12:58:04 +0000 (12:58 +0000)]
[RISCV][InsertVSETVLI] Move vmv.s.x SEW check into getDemandedBits. NFC

This patch restructures the logic that checks if vmv.s.x's SEW can be
expanded into getDemandedBits, so that it can be shared by both the
top-to-bottom and bottom-to-top passes.

It adds a third option for SEW in DemandedFields, that's weaker than
demanded but stronger than not demanded, that states that it the new SEW
must be greater than or equal to the current SEW.

Note that we now need to take care of the order of operands in
areCompatibleVTYPEs as the relation is no longer commutative.

A later patch will remove the gating on the bottom-to-top pass
(dolocalPostpass) and another one will relax the demands on the tail
policy further.

17 months ago[NFC][CLANG] Fix nullptr dereference issue in SetValueDataBasedOnQualType()
Manna, Soumi [Wed, 31 May 2023 17:11:14 +0000 (10:11 -0700)]
[NFC][CLANG] Fix nullptr dereference issue in SetValueDataBasedOnQualType()

This patch uses castAs instead of getAs which will assert if the type doesn't match in SetValueDataBasedOnQualType(clang::Value &, unsigned long long).

Reviewed By: erichkeane

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

17 months agoRevert "[RISCV] Add Zvfhmin extension for clang."
Craig Topper [Wed, 31 May 2023 17:02:12 +0000 (10:02 -0700)]
Revert "[RISCV] Add Zvfhmin extension for clang."

This reverts commit 35a0079238ce9fc36cdc8c6a2895eb5538bf7b4a.

The backend support is not present yet. The intrinsics will crash
the compiler if compiled to assembly or binary.

17 months agoRevert "[RISCV][InsertVSETVLI] Avoid vmv.s.x SEW toggle if at start of block"
Luke Lau [Wed, 31 May 2023 17:14:55 +0000 (18:14 +0100)]
Revert "[RISCV][InsertVSETVLI] Avoid vmv.s.x SEW toggle if at start of block"

This reverts commit 0ba41dd3806e658e67acb63353fd5540f2bf333c.

17 months ago[RISCV][InsertVSETVLI] Avoid vmv.s.x SEW toggle if at start of block
Luke Lau [Wed, 31 May 2023 17:04:25 +0000 (17:04 +0000)]
[RISCV][InsertVSETVLI] Avoid vmv.s.x SEW toggle if at start of block

vmv.s.x and friends that only write to the first destination element can
use any SEW greater than or equal to its original SEW, provided that
it's writing to an implicit_def operand where we can clobber the other
lanes.

We were already handling this in needVSETVLI, which meant that when
scanning the instructions from top to bottom we could detect this and
avoid the toggle:

```
vsetivli zero, 4, e64, mf2, ta, ma
li a0, 11
vsetivli zero, 1, e8, mf8, ta, ma
vmv.s.x v0, a0

->
vsetivli zero, 4, e64, mf2, ta, ma
li a0, 11
vmv.s.x v0, a0

```
The issue that this patch aims to solve is whenever vmv.s.x arises when
the first vector instruction in the block and doesn't have any prior
predecessor info:

```
entry_bb:
li a0, 11
; No previous state here: forced to set VL/VTYPE
vsetivli zero, 1, e8, mf8, ta, ma
vmv.s.x v0, a0
vsetivli zero, 4, e16, mf2, ta, ma
vmerge.vvm v8, v9, v8, v0
```

doLocalPostpass can work backwards from bottom to top and work out if
an earlier vsetvli can be mutated to avoid a toggle. It uses
DemandedFields and getDemanded for this, which previously didn't take
into account the possibility of going to a larger SEW.

This patch adds a third option for SEW in DemandedFields, that's weaker
than demanded but stronger than not demanded, that states that it the
new SEW must be greater than or equal to the current SEW.

We can then use this option to move that vmv.s.x specific logic from
needVSETVLI into getDemanded, making it available for both phase 2 and
3, i.e. we can now mutate the earlier vsetivli going from bottom to top:

```
entry_bb:
li a0, 11
; Previous vsetivli mutated: second one deleted
vsetivli zero, 4, e16, mf2, ta, ma
vmv.s.x v0, a0
vmerge.vvm v8, v9, v8, v0
```

Reviewed By: reames

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

17 months ago[NFC][CLANG] Fix nullptr dereference issue in HandleRISCVRVVVectorBitsTypeAttr()
Manna, Soumi [Wed, 31 May 2023 16:54:51 +0000 (09:54 -0700)]
[NFC][CLANG] Fix nullptr dereference issue in HandleRISCVRVVVectorBitsTypeAttr()

This patch uses castAs instead of getAs which will assert if the type doesn't match in HandleRISCVRVVVectorBitsTypeAttr(clang::QualType &, clang::ParsedAttr &, clang::Sema &)

Reviewed By: erichkeane

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

17 months ago[Demangle] fix deref of std::string_view::end()
Nick Desaulniers [Wed, 31 May 2023 16:44:13 +0000 (09:44 -0700)]
[Demangle] fix deref of std::string_view::end()

In D148546, I replaced much of the use of llvm::StringView w/
std::string_view.  There's one important semantic difference between the
two:

In most STL containers, end() returns an iterator that refers to one
past the end of the container. But llvm::StringView::end() refers to the
last element.

Expressions such as `&*my_std_string_view.end()` produce the failed
assertion:

  include/c++/v1/__iterator/bounded_iter.h:93: assertion
  __in_bounds(__current_) failed: __bounded_iter::operator*: Attempt to
  dereference an out-of-range iterator

This was caught when copying the recent downstream changes back upstream
in D148566, and is reproducible via:

  $ libcxx/utils/ci/run-buildbot generic-debug-mode

when compiled with clang and clang++. The correct way to get the same
value as before without dereferencing invalid iterators is to prefer
`&*my_std_string_view.rbegin() + 1`.

Fix this downstream so that I might copy it back upstream in D148566.

The other instance of `&*my_std_string_view.end()` that I introduced in
D148546 has been fixed already in D149061.

Reviewed By: ashay-github

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

17 months ago[flang] CUDA Fortran - part 1/5: parsing
Peter Klausler [Sat, 6 May 2023 22:03:39 +0000 (15:03 -0700)]
[flang] CUDA Fortran - part 1/5: parsing

Begin upstreaming of CUDA Fortran support in LLVM Flang.

This first patch implements parsing for CUDA Fortran syntax,
including:
 - a new LanguageFeature enum value for CUDA Fortran
 - driver change to enable that feature for *.cuf and *.CUF source files
 - parse tree representation of CUDA Fortran syntax
 - dumping and unparsing of the parse tree
 - the actual parsers for CUDA Fortran syntax
 - prescanning support for !@CUF and !$CUF
 - basic sanity testing via unparsing and parse tree dumps

... along with any minimized changes elsewhere to make these
work, mostly no-op cases in common::visitors instances in
semantics and lowering to allow them to compile in the face
of new types in variant<> instances in the parse tree.

Because CUDA Fortran allows the kernel launch chevron syntax
("call foo<<<blocks, threads>>>()") only on CALL statements and
not on function references, the parse tree nodes for CallStmt,
FunctionReference, and their shared Call were rearranged a bit;
this caused a fair amount of one-line changes in many files.

More patches will follow that implement CUDA Fortran in the symbol
table and name resolution, and then semantic checking.

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

17 months agoFix -u option in dsymutil, to not emit an extra DW_LNE_set_address if the original...
Shubham Sandeep Rastogi [Fri, 26 May 2023 19:05:09 +0000 (12:05 -0700)]
Fix -u option in dsymutil, to not emit an extra DW_LNE_set_address if the original line table was empty

With dsymutil's -u option, only the accelerator tables should be
updated, but with https://reviews.llvm.org/D150554 the -u option will
still re-generate the line table. If the line table was empty, that is,
it was a dummy line table, with no entries in it, dsymutil will always
generate a line table with a DW_LNE_end_sequence, a funky side effect of
this is that when the line table is re-generated, it will always emit a
DW_LNE_set_address first, which will change the line table total size.
This patch addresses this by making sure that if all the line table has
in it is a DW_LNE_end_sequence, it is the same as a dummy entry.

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

17 months ago[gn build] Port 8e728adcfedd
LLVM GN Syncbot [Wed, 31 May 2023 16:33:01 +0000 (16:33 +0000)]
[gn build] Port 8e728adcfedd

17 months ago[MLIR][Linalg] (NFC) Improve RUN command in `generalize-pad-tensor.mlir`
Lorenzo Chelini [Wed, 31 May 2023 15:34:13 +0000 (17:34 +0200)]
[MLIR][Linalg] (NFC) Improve RUN command in `generalize-pad-tensor.mlir`

There is no need to specify any `check-prefix` here.

17 months agoworkflows/release-tasks: Upload lit releases to pypi
Tom Stellard [Wed, 31 May 2023 16:13:04 +0000 (09:13 -0700)]
workflows/release-tasks: Upload lit releases to pypi

Reviewed By: thieta, kwk

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

17 months ago[flang] Fix interpretations of x87 80-bit Inf/NaN
Peter Klausler [Fri, 26 May 2023 15:50:35 +0000 (08:50 -0700)]
[flang] Fix interpretations of x87 80-bit Inf/NaN

Current implementations of x87 80-bit extended precision floating
point interpret 7FFF8000000000000000 as +Inf, not a Nan.  The explicit
MSB in the significand must be set for an infinity.

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

17 months agoclang/openmp: Fix alignment for ThreadID Address variables
Tom Stellard [Wed, 31 May 2023 16:11:07 +0000 (09:11 -0700)]
clang/openmp: Fix alignment for ThreadID Address variables

There are places in the runtime, like __kmp_init_indirect_csptr, which
assume these pointers are aligned to sizeof(void*), so make sure we emit
them with the correct alignment.

Fixes #62668

Reviewed By: jlpeyton

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

17 months ago[compiler-rt][CMake] Properly set COMPILER_RT_HAS_LLD
Arthur Eubanks [Thu, 23 Feb 2023 19:21:33 +0000 (11:21 -0800)]
[compiler-rt][CMake] Properly set COMPILER_RT_HAS_LLD

LLVM_TOOL_LLD_BUILD is a relic of the pre-monorepo times. This causes us to never set COMPILER_RT_HAS_LLD.

Instead, set it from the runtimes build if lld is being built and lld is used as the compiler-rt linker.

Reviewed By: MaskRay

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

17 months ago[flang] Detect output field width overflow for Inf/NaN
Peter Klausler [Thu, 25 May 2023 23:23:22 +0000 (16:23 -0700)]
[flang] Detect output field width overflow for Inf/NaN

The output editing code paths for F and E/D output that handle
IEEE-754 infinities and NaNs fail to check for overflow of the
output field, which should cause the field to be filled with
asterisks instead.  Catch these cases.

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

17 months ago[Sema] Remove unused function getFloat128Identifier
Kazu Hirata [Wed, 31 May 2023 15:59:35 +0000 (08:59 -0700)]
[Sema] Remove unused function getFloat128Identifier

The last use was removed by:

  commit bb1ea2d6139a72340b426e114510c46d938645a6
  Author: Nemanja Ivanovic <nemanja.i.ibm@gmail.com>
  Date:   Mon May 9 08:52:33 2016 +0000

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

17 months agoRevert "[compiler-rt] Avoid memintrinsic calls inserted by the compiler"
Marco Elver [Wed, 31 May 2023 15:57:07 +0000 (17:57 +0200)]
Revert "[compiler-rt] Avoid memintrinsic calls inserted by the compiler"

This reverts commit 4369de7af46605522bf7dbe3bc31d00b0eb4bee6.

Fails on Mac OS with "sanitizer_libc.cpp:109:5: error: aliases are not
supported on darwin".

17 months ago[Clang][SVE2.1] Add clang support for builtins using svcount_t
Caroline Concatto [Wed, 31 May 2023 14:12:08 +0000 (14:12 +0000)]
[Clang][SVE2.1] Add clang support for builtins  using svcount_t

In this patch it is used for the prototype:
  * svptrue_c8 (and _c16/_c32/_c64)

 As described in: https://github.com/ARM-software/acle/pull/257

Patch by: Sander de Smalen <sander.desmalen@arm.com>

Reviewed By: sdesmalen, david-arm

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

17 months ago[flang] Don't fold SIZE()/SHAPE() into expression referencing optional dummy arguments
Peter Klausler [Thu, 25 May 2023 23:01:52 +0000 (16:01 -0700)]
[flang] Don't fold SIZE()/SHAPE() into expression referencing optional dummy arguments

When computing the shape of an expression at compilation time as part of
folding an intrinsic function like SIZE(), don't create an expression that
increases a dependence on the presence of an optional dummy argument.

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

17 months ago[KnownBits] Also test 1-bit values in exhaustive tests (NFC)
Nikita Popov [Wed, 31 May 2023 08:10:47 +0000 (10:10 +0200)]
[KnownBits] Also test 1-bit values in exhaustive tests (NFC)

Similar to what we do with ConstantRanges, also test 1-bit values
in exhaustive tests, as these often expose special conditions.
This would have exposed the assertion failure fixed in D151788
earlier.

17 months ago[RISCV] Fix an unused variable warning
Kazu Hirata [Wed, 31 May 2023 15:45:29 +0000 (08:45 -0700)]
[RISCV] Fix an unused variable warning

 llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp:3793:7:
 error: unused variable 'XLenVT' [-Werror,-Wunused-variable]

17 months ago[X86] X86FixupVectorConstantsPass - use VBROADCASTSS/VBROADCASTSD for integer vector...
Simon Pilgrim [Wed, 31 May 2023 14:33:44 +0000 (15:33 +0100)]
[X86] X86FixupVectorConstantsPass - use VBROADCASTSS/VBROADCASTSD for integer vector loads on AVX1-only targets

Matches behaviour in lowerBuildVectorAsBroadcast

17 months ago[libc++]{CI] Bumps clang-tidy version used.
Mark de Wever [Sun, 28 May 2023 12:23:12 +0000 (14:23 +0200)]
[libc++]{CI] Bumps clang-tidy version used.

The CI can no longer run with clang-tidy 16 increment it to version 17.
Whether permanently moving to the latest development version is being
discussed on Discourse.

Depends on D149455

Reviewed By: #libc, ldionne

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

17 months ago[libc++][test] Prefers the newer clang-tidy version.
Mark de Wever [Fri, 28 Apr 2023 15:38:47 +0000 (17:38 +0200)]
[libc++][test] Prefers the newer clang-tidy version.

Module require Clang 17, since Clang 16 requires the magic # __FILE__
line. Therefore, if available, use clang-tidy 17 too. This change should
be reverted after LLVM 17 is released.

Reviewed By: #libc, ldionne

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

17 months ago[libc++] Gives ignore external linkage.
Mark de Wever [Thu, 25 May 2023 19:59:25 +0000 (21:59 +0200)]
[libc++] Gives ignore external linkage.

A slightly different fix is in D144994.

Reviewed By: #libc, ldionne

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

17 months ago[libc++] Fixes use-after move diagnostic.
Mark de Wever [Tue, 23 May 2023 15:14:20 +0000 (17:14 +0200)]
[libc++] Fixes use-after move diagnostic.

The diagnostic is issued by clang-tidy 17.

This just suppressed the diagnostic. The move operations are non-standard extensions and the class itself is deprecated.

Reviewed By: #libc, ldionne

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

17 months ago[lldb] Override GetVariable in ValueObjectSynthetic (NFC)
Dave Lee [Sat, 20 May 2023 17:05:44 +0000 (10:05 -0700)]
[lldb] Override GetVariable in ValueObjectSynthetic (NFC)

Make `GetVariable` a passthrough function the the underlying value object in `ValueObjectSynthetic`.

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

17 months ago[APInt] Support zero-width extract in extractBitsAsZExtValue()
Nikita Popov [Wed, 31 May 2023 08:16:16 +0000 (10:16 +0200)]
[APInt] Support zero-width extract in extractBitsAsZExtValue()

D111241 added support for extractBits() with zero width. Extend this
to extractBitsAsZExtValue() as well for consistency (in which case
it will always return zero).

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

17 months ago[gn] port 4369de7af466
Nico Weber [Wed, 31 May 2023 15:12:32 +0000 (11:12 -0400)]
[gn] port 4369de7af466

17 months ago[lldb] Take StringRef name in GetChildMemberWithName (NFC)
Dave Lee [Sat, 27 May 2023 04:19:10 +0000 (21:19 -0700)]
[lldb] Take StringRef name in GetChildMemberWithName (NFC)

`GetChildMemberWithName` does not need a `ConstString`. This change makes the function
take a `StringRef` instead, which alleviates the need for callers to construct a
`ConstString`. I don't expect this change to improve performance, only ergonomics.

This is in support of Alex's effort to replace `ConstString` where appropriate.

There are related `ValueObject` functions that can also be changed, if this is accepted.

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

17 months ago[Flang] Move several definitions to IntrinsicCall header for code cleanliness and...
Paul Scoropan [Tue, 30 May 2023 15:07:44 +0000 (15:07 +0000)]
[Flang] Move several definitions to IntrinsicCall header for code cleanliness and reusability

In the future we intend to add support for many PowerPC-specific intrinsics that ideally will exist in a separate new PPCIntrinsicCall file. But first we need to move definitions to the IntrinsicCall header file to increase code cleanliness and readability and to make code reusable for when we add PPCIntrinsicCall.

Reviewed By: vzakhari

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

17 months ago[LV] Use SCEV for uniformity analysis across VF
Florian Hahn [Wed, 31 May 2023 15:00:57 +0000 (16:00 +0100)]
[LV] Use SCEV for uniformity analysis across VF

This patch uses SCEV to check if a value is uniform across a given VF.

The basic idea is to construct SCEVs where the AddRecs of the loop are
adjusted to reflect the version in the vectorized loop (Step multiplied
by VF). We construct a SCEV for the value of the vector lane 0
(offset 0) compare it to the expressions for lanes 1 to the last vector
lane (VF - 1). If they are equal, consider the expression uniform.

While re-writing expressions, we also need to catch expressions we
cannot determine uniformity (e.g. SCEVUnknown).

Reviewed By: Ayal

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

17 months ago[compiler-rt] Avoid memintrinsic calls inserted by the compiler
Marco Elver [Tue, 30 May 2023 09:59:22 +0000 (11:59 +0200)]
[compiler-rt] Avoid memintrinsic calls inserted by the compiler

D135716 introduced -ftrivial-auto-var-init=pattern where supported.
Unfortunately this introduces unwanted memset() for large stack arrays,
as shown by the new tests added for asan and msan (tsan already had this
test).

In general, the problem of compiler-inserted memintrinsic calls
(memset/memcpy/memmove) is not new to compiler-rt, and has been a
problem before.

To avoid introducing unwanted memintrinsic calls, we redefine
memintrinsics as __sanitizer_internal_mem* at the assembly level for
most source files automatically (where sanitizer_common_internal_defs.h
is included).

In few cases, redefining a symbol in this way causes issues for
interceptors, namely the memintrinsic interceptor themselves. For such
source files we have to selectively disable the redefinition.

Other alternatives have been considered, but simply do not work well in
the context of compiler-rt:

1. Linker --wrap:  this does not work because --wrap only
   applies to the final link, and would not apply when building
   sanitizer static libraries.

2. Changing references to memset() via objcopy:  this may work,
   but due to the complexities of the build system, introducing
   such a post-processing step for the right object files (in
   particular object files defining memset cannot be touched)
   seems infeasible.

The chosen solution works well (as shown by the tests). Other libraries
have chosen the same solution where nothing else works (see e.g. glibc's
"symbol-hacks.h").

v2:
- Fix ubsan_minimal build where compiler decides to insert
  memset/memcpy: ubsan_minimal has work without RTSanitizerCommonLibc,
  therefore do not redefine the builtins.
- Fix definition of internal_mem* functions with compilers that want the
  aliased function to already be defined before.
- Fix definition of __sanitizer_internal_mem* functions with compilers
  more pedantic about attribute placement around extern "C".

Reviewed By: vitalybuka, dvyukov

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

17 months ago[TableGen] Add !getdagarg and !getdagname
Michael Liao [Fri, 26 May 2023 16:58:12 +0000 (12:58 -0400)]
[TableGen] Add !getdagarg and !getdagname

- This patch proposes to add `!getdagarg` and `!getdagname` bang
  operators as the inverse operation of `!dag`. They allow us to examine
  arguments of a given dag.

Reviewed By: simon_tatham

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

17 months ago[RISCV] Use v(f)slide1down for shuffle+insert idiom
Philip Reames [Wed, 31 May 2023 14:48:17 +0000 (07:48 -0700)]
[RISCV] Use v(f)slide1down for shuffle+insert idiom

This is a follow up to D151468 which added the vslide1down case as a sub-case of vslide1down matching. This generalizes that code into generic mask matching - specifically to point out the sub-vector insert restriction in the original patch. Since the matching logic is basically the same, go ahead and support vslide1up at the same time.

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

17 months ago[InstCombine] Name instructions in test (NFC)
Nikita Popov [Wed, 31 May 2023 14:39:41 +0000 (16:39 +0200)]
[InstCombine] Name instructions in test (NFC)

17 months ago[Analysis] Remove unused class LegacyAARGetter
Kazu Hirata [Wed, 31 May 2023 14:30:14 +0000 (07:30 -0700)]
[Analysis] Remove unused class LegacyAARGetter

The last use was removed by:

  commit fa6ea7a419f37befbed04368bcb8af4c718facbb
  Author: Arthur Eubanks <aeubanks@google.com>
  Date:   Mon Mar 20 11:18:35 2023 -0700

Once we remove it, createLegacyPMAAResults and createLegacyPMAAResults
become unused, so this patch removes them as well.

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

17 months ago[ELF][RISCV] --wrap=foo: Correctly update st_value(foo)
Fangrui Song [Wed, 31 May 2023 14:19:44 +0000 (07:19 -0700)]
[ELF][RISCV] --wrap=foo: Correctly update st_value(foo)

With --wrap=foo, we may have `d->file != file` for a defined symbol `foo`.
For the object file defining `foo`, its symbol table may not contain
`foo` after `redirectSymbols` changed the `foo` entry to `__wrap_foo` (see D50569).

Therefore, skipping `foo` with the condition `if (!d || d->file != file)` may
cause `__wrap_foo` not to be updated. See `ab.o w.o --wrap=foo` in the new test
(originally reported by D150220).

We could adjust the condition to `if (!d)`, but that would leave many `anchors`
entries if a symbol is referenced by many files. Switch to iterating over
`symtab` instead.

Note: D149735 (actually not NFC) allowed duplicate `anchors` entries and fixed
`a.o bw.o --wrap=foo`.

Reviewed By: jobnoorman

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

17 months ago[flang] use greedy mlir driver for stack arrays pass
Tom Eccles [Wed, 17 May 2023 16:07:41 +0000 (16:07 +0000)]
[flang] use greedy mlir driver for stack arrays pass

In upstream mlir, the dialect conversion infrastructure is used for
lowering from one dialect to another: the passes are of the form
XToYPass. Whereas, transformations within the same dialect tend to use
applyPatternsAndFoldGreedily.

In this case, the full complexity of applyPatternsAndFoldGreedily isn't
needed so we can get away with the simpler applyOpPatternsAndFold.

This change was suggested by @jeanPerier

The old differential revision for this patch was
https://reviews.llvm.org/D150853

Re-applying here fixing the issue which led to the patch being reverted. The
issue was from erasing uses of the allocation operation while still iterating
over those uses (leading to a use-after-free). I have added a regression
test which catches this bug for -fsanitize=address builds, but it is
hard to reliably cause a crash from the use-after-free in normal builds.

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

17 months ago[Headers][doc] Fix typo in avx2intrin.h doc
Paul Robinson [Wed, 31 May 2023 13:43:27 +0000 (06:43 -0700)]
[Headers][doc] Fix typo in avx2intrin.h doc

17 months ago[MLIR] Remove dependency on omp dialect in LLVM dialect.
Jan Sjodin [Tue, 30 May 2023 19:28:12 +0000 (14:28 -0500)]
[MLIR] Remove dependency on omp dialect in LLVM dialect.

This fixes a buildbot failure where the dependency on the omp dialect
in the LLVM dialect caused error. Instead of accessing the interface
defined in the omp dialect we directly access the attributes
instead. To make this work the IsDeviceAttr is removed and replaced
with a BoolAttr instead.

Reviewed By: kiranchandramohan

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

17 months ago[Headers][doc] Add shuffle-like intrinsic descriptions to avx2intrin.h
Paul Robinson [Tue, 30 May 2023 20:30:12 +0000 (13:30 -0700)]
[Headers][doc] Add shuffle-like intrinsic descriptions to avx2intrin.h

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

17 months ago[Test] Move LoopStrengthReduce/pr62563.ll to X86 specific test folder (NFC)
Dmitry Makogon [Wed, 31 May 2023 13:23:19 +0000 (20:23 +0700)]
[Test] Move LoopStrengthReduce/pr62563.ll to X86 specific test folder (NFC)

The test case is X86 specific. Should unblock buildbots after 253e3e2.

17 months ago[ConstraintElim] Move logic to remove stack entry to helper (NFC).
Florian Hahn [Wed, 31 May 2023 13:22:44 +0000 (14:22 +0100)]
[ConstraintElim] Move logic to remove stack entry to helper (NFC).

Preparation for follow-up patch that uses the logic in a separate place.

17 months ago[AA] Fix comparison of AliasResults (PR63019)
Nikita Popov [Wed, 31 May 2023 12:53:44 +0000 (14:53 +0200)]
[AA] Fix comparison of AliasResults (PR63019)

Comparison between two AliasResults implicitly decayed to comparison
of AliasResult::Kind. As a result, MergeAliasResults() ended up
considering two PartialAlias results with different offsets as
equivalent.

Fix this by adding an operator== implementation. To stay
compatible with extensive use of comparisons between AliasResult
and AliasResult::Kind, add an overload for that as well, which
will ignore the offset. In the future, it would probably be a
good idea to remove these implicit decays to AliasResult::Kind
and add dedicated methods to check for specific AliasResult kinds.

Fixes https://github.com/llvm/llvm-project/issues/63019.

17 months ago[GVN] Add test for PR63019 (NFC)
Nikita Popov [Wed, 31 May 2023 12:55:11 +0000 (14:55 +0200)]
[GVN] Add test for PR63019 (NFC)

17 months agoImplement BufferOverlap check for sprint/snprintf
Arnaud Bienner [Wed, 31 May 2023 08:54:27 +0000 (10:54 +0200)]
Implement BufferOverlap check for sprint/snprintf

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

17 months ago[gn build] Port 26bda9e95a9d
LLVM GN Syncbot [Wed, 31 May 2023 12:30:10 +0000 (12:30 +0000)]
[gn build] Port 26bda9e95a9d

17 months ago[GlobalIsel][X86] Legalize G_CTLZ and G_CTPOP for 32-bit
Thorsten Schütt [Thu, 25 May 2023 15:47:00 +0000 (17:47 +0200)]
[GlobalIsel][X86] Legalize G_CTLZ and G_CTPOP for 32-bit

Note that 32-bit support is very limited

Reviewed By: RKSimon

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

17 months ago[gn] port 301eb6b68f3 (AttrTokenKinds.inc)
Nico Weber [Wed, 31 May 2023 12:17:44 +0000 (08:17 -0400)]
[gn] port 301eb6b68f3 (AttrTokenKinds.inc)

17 months ago[mlir] Avoid tensor canonicalizer crash on negative dimensions
rikhuijzer [Wed, 31 May 2023 12:13:08 +0000 (14:13 +0200)]
[mlir] Avoid tensor canonicalizer crash on negative dimensions

Fixes #59703.

Reviewed By: ftynse

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

17 months ago[libc][NFC] Fixing various typos
Guillaume Chatelet [Wed, 31 May 2023 12:06:45 +0000 (12:06 +0000)]
[libc][NFC] Fixing various typos

17 months ago[X86] Replace X32 test check prefix with X86
Simon Pilgrim [Wed, 31 May 2023 12:01:27 +0000 (13:01 +0100)]
[X86] Replace X32 test check prefix with X86

We try to only use X32 for gnux32 triple test cases

17 months ago[X86] Replace X32 test check prefixes with X86
Simon Pilgrim [Wed, 31 May 2023 12:00:23 +0000 (13:00 +0100)]
[X86] Replace X32 test check prefixes with X86

We try to only use X32 for gnux32 triple test cases

17 months ago[mlir][bazel] Disable Transform/test-repro-dump.mlir test in bazel build.
Benjamin Chetioui [Wed, 31 May 2023 11:50:48 +0000 (11:50 +0000)]
[mlir][bazel] Disable Transform/test-repro-dump.mlir test in bazel build.

17 months ago[Test] Add test showing miscompilation in LoopStrengthReduce on min/max expressions...
Dmitry Makogon [Wed, 31 May 2023 11:42:21 +0000 (18:42 +0700)]
[Test] Add test showing miscompilation in LoopStrengthReduce on min/max expressions (NFC)

This is a test case from https://github.com/llvm/llvm-project/issues/62563.

17 months ago[X86] printConstant - fix asm comment issue when broadcasting from a wider constant...
Simon Pilgrim [Wed, 31 May 2023 11:28:17 +0000 (12:28 +0100)]
[X86] printConstant - fix asm comment issue when broadcasting from a wider constant pool entry

In cases where a broadcast op is loading from a constant entry wider than the broadcast element, we were incorrectly printing the entire entry and not just the lower bits referenced by the broadcast.