Commit Graph

475375 Commits

Author SHA1 Message Date
Jim Ingham
df93c4ffdf Remove some raciness from the TestProcessAttach.test_run_then_attach_wait_interrupt
command.

We were reading the command output right after sending the interrupt, but
sometimes that wasn't long enough for the command result text to have been emitted.
I added a poll for the state change to eStateExited, and then added a bit more sleep
to give the command a chance to complete.
2023-09-20 13:08:40 -07:00
Alexey Bataev
7705342122 [SLP]Do not gather node, if the instruction, that does not require
scheduling, is previously vectorized.

If the main node was vectorized already, but does not require
scheduling, we still can try to vectorize it in this new node instead of
gathering.
2023-09-20 12:52:37 -07:00
Richard Smith
1aadd4766e Remove #include that the cp-to-llvm script added.
This is a short-term fix to make the buildbots happy. We should also fix
the script.
2023-09-20 12:42:34 -07:00
Richard Smith
4b163e343c Implement mangling rules for C++20 concepts and requires-expressions.
This implements proposals from:

- https://github.com/itanium-cxx-abi/cxx-abi/issues/24: mangling for
  constraints, requires-clauses, requires-expressions.
- https://github.com/itanium-cxx-abi/cxx-abi/issues/31: requires-clauses and
  template parameters in a lambda expression are mangled into the <lambda-sig>.
- https://github.com/itanium-cxx-abi/cxx-abi/issues/47 (STEP 3): mangling for
  template argument is prefixed by mangling of template parameter declaration
  if it's not "obvious", for example because the template parameter is
  constrained (we already implemented STEP 1 and STEP 2).

This changes the manglings for a few cases:

- Functions and function templates with constraints.
- Function templates with template parameters with deduced types:
  `typename<auto N> void f();`
- Function templates with template template parameters where the argument has a
  different template-head:
  `template<template<typename...T>> void f(); f<std::vector>();`

In each case where a mangling changed, the change fixes a mangling collision.

Note that only function templates are affected, not class templates or variable
templates, and only new constructs (template parameters with deduced types,
constrained templates) and esoteric constructs (templates with template
template parameters with non-matching template template arguments, most of
which Clang still does not accept by default due to
`-frelaxed-template-template-args` not being enabled by default), so the risk
to ABI stability from this change is relatively low. Nonetheless,
`-fclang-abi-compat=17` can be used to restore the old manglings for cases
which we could successfully but incorrectly mangle before.

Fixes #48216, #49884, #61273

Reviewed By: erichkeane, #libc_abi

Differential Revision: https://reviews.llvm.org/D147655
2023-09-20 12:38:15 -07:00
Piotr Zegar
5d95d27e50
[clang-tidy] Fix support for typedefs in readability-identifier-naming (#66835)
Typedef rename were not properly handled when typedef were used behind
pointer, or as a part of function type. Additionally because entire
function were passed as an source-range, when function started with
macro, such change were not marked for a fix.

Removed workaround and used proper TypedefTypeLoc instead.

Fixes #55156, #54699
2023-09-20 21:29:54 +02:00
Piotr Zegar
33aa095a8b [clang-tidy][NFC] Add release notes entry for D127036
Add release notes entry describing change in
bugprone-undefined-memory-manipulation check.
2023-09-20 18:56:00 +00:00
Fabian Wolff
6780d53f41 [clang-tidy] Warn about arrays in bugprone-undefined-memory-manipulation
Adds basic support for arrays to non-trivial types.

Fixes #55579

Differential Revision: https://reviews.llvm.org/D127036
2023-09-20 18:56:00 +00:00
Fangrui Song
08b10afc1e [bazel] Port D149368 mlir openmp 2023-09-20 11:53:59 -07:00
Louis Dionne
0740b7e3e2 [libc++abi][NFC] Remove mentions of LIBCXXABI_SHARED_LIBRARIES
LIBCXXABI_SHARED_LIBRARIES doesn't exist anymore, so this always expanded
to nothing at all.
2023-09-20 14:52:02 -04:00
Aiden Grossman
3dc2f2618b
[MLGO] Move MBB Profile Dump test to Generic (#66856)
This patch moves the MBB Profile Dump to ./llvm/test/CodeGen/Generic
from ./llvm/test/CodeGen/MlRegAlloc as the profile dump doesn't have
anything to do with the ML guided register allocation heuristic.
2023-09-20 11:50:33 -07:00
Fangrui Song
9f4c9b90c9 Revert D155711 "[SimplifyCFG] Hoist common instructions on Switch."
This reverts commit 96ea48ff5d.

The change may cause Verifier.cpp error
"musttail call must precede a ret with an optional bitcast"
2023-09-20 11:49:20 -07:00
Andrew Gozillon
76916669b9 [MLIR][OpenMP] Initial Lowering of Declare Target for Data
This patch adds initial lowering for DeclareTargetAttr on
GlobalOp's utilising registerTargetGlobalVariable
and getAddrOfDeclareTargetVar from the
OMPIRBuilder.

It also adds initial processing of declare target map
operands, populating the combinedInfo that the
OMPIRBuilder requires to generate kernels and
it's kernel argument structure.

The combination of these additions allows simple mapping
of declare target globals to Target regions, as such a simple
runtime test showcasing this and testing it has been added.

The patch currently does not factor in filtering
based on device_type clauses (e.g. no emission of
globals for device if host specified), this will come in
a future iteration. And for the moment it's only been
tested with 1-D arrays and basic fortran data types,
more complex types (such as user defined derived
types from Fortran, allocatables or Fortran pointers)
may need further work.

reviewers: kiranchandramohan, skatrak

Differential Revision: https://reviews.llvm.org/D149368
2023-09-20 13:31:15 -05:00
Alexey Bataev
03feab7499 [SLP][NFC]Add a test with the reused main op instruction, NFC. 2023-09-20 11:28:59 -07:00
Noah Goldstein
6d6314ba64 [DAGCombiner] Extend combineFMulOrFDivWithIntPow2 to work for non-splat float vecs
Do so by extending `matchUnaryPredicate` to also work for
`ConstantFPSDNode` types then encapsulate the constant checks in a
lambda and pass it to `matchUnaryPredicate`.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D154868
2023-09-20 13:28:24 -05:00
Noah Goldstein
47c642f9a0 [DAGCombiner] Fold IEEE fmul/fdiv by Pow2 to add/sub of exp
Note: This is moving D154678 which previously implemented this in
InstCombine. Concerns where brought up that this was de-canonicalizing
and really targeting a codegen improvement, so placing in DAGCombiner.

This implements:

```
(fmul C, (uitofp Pow2))
    -> (bitcast_to_FP (add (bitcast_to_INT C), Log2(Pow2) << mantissa))
(fdiv C, (uitofp Pow2))
    -> (bitcast_to_FP (sub (bitcast_to_INT C), Log2(Pow2) << mantissa))
```
The motivation is mostly fdiv where 2^(-p) is a fairly common
expression.

The patch is intentionally conservative about the transform, only
doing so if we:
    1) have IEEE floats
    2) C is normal
    3) add/sub of max(Log2(Pow2)) stays in the min/max exponent
       bounds.

Alive2 can't realistically prove this, but did test float16/float32
cases (within the bounds of the above rules) exhaustively.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D154805
2023-09-20 13:28:24 -05:00
Noah Goldstein
32a46919a2 [AMDGPU] Add tests for folding fmul/fdiv by Pow2 to add/sub of exp; NFC
Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D159405
2023-09-20 13:28:24 -05:00
Noah Goldstein
6ec53b4567 [X86] Add tests for folding fmul/fdiv by Pow2 to add/sub of exp; NFC
Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D154804
2023-09-20 13:28:24 -05:00
annamthomas
9cfc7ff168
[LiveRange] Verify Other LiveRange in Join API (#66809)
The LiveRange::join API takes in two live ranges. We should verify the
LiveRange passed in to the Join API as well.
2023-09-20 13:58:16 -04:00
Fangrui Song
903a7e487b [bazel] Port 4fbb5f9350 2023-09-20 10:22:26 -07:00
Guillot Tony
624c130578 [Clang][C] Fixed a bug where we reject an _Atomic qualified integer in a switch statment
We are currently rejecting an _Atomic qualified integer in a switch statment.
This fixes the issue by doing an Lvalue conversion before trying to match on the type.
Fixes #65557

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D159522
2023-09-20 19:19:02 +02:00
Joseph Huber
3641d18557 [libc][Obvious] Fix incorrect RPC opcode for clearerr
Summary:
This was mistakenly using the opcode for `ferror` which wasn't noticed
because tests using this weren't yet activated. This patch fixes this
mistake.
2023-09-20 11:54:35 -05:00
Alexey Bataev
ebed4692f8 [SLP]Fix a crash when trying to find operand with re-vectorized main
instruction.

Need to check if the operand scalars are vectorized in the a different
vector node, if the main instruction is already gets vectorized in other
vector node.
2023-09-20 09:54:15 -07:00
Oleksandr "Alex" Zinenko
a590ff589c
[mlir] regenerate linalg named ops yaml (#65475)
The Linalg named ops specification went out of sync with the OpDSL
description, presumably due to direct manual modifications of the yaml
file.

Additionally, the unsigned division has been generating the signed
scalar instruction, which is now fixed.
2023-09-20 18:53:29 +02:00
Oleksandr "Alex" Zinenko
4fbb5f9350
[mlir] introduce transform.loop.forall_to_for (#65474)
Add a straightforward sequentialization transform from `scf.forall` to a
nest of `scf.for` in absence of results and expose it as a transform op.
This is helpful in combination with other transform ops, particularly
fusion, that work best on parallel-by-construction `scf.forall` but
later need to target sequential `for` loops.
2023-09-20 18:53:08 +02:00
Nicolas Vasilache
f557986d0e
[mlir] Bazel fixes for 1b8b556443 (#66929) 2023-09-20 18:52:41 +02:00
Aart Bik
3e4a8c2c7d
[mlir][sparse] remove most bufferization.alloc_tensor ops from sparse (#66847)
The only ones left need actual deprecation in bufferization module.
2023-09-20 09:51:08 -07:00
Brad Smith
a009fa79a4
[Driver] Some improvements for path handling on NetBSD (#66863)
- Make use of concat macro with various paths
- Replace usage of = with SysRoot
2023-09-20 12:50:37 -04:00
Sirish Pande
cc3491fd45
[SelectionDAG] [NFC] Add pre-commit test for PR66701. (#66796)
[SelectionDAG] [NFC] Add pre-commit test for PR66701.

Co-authored-by: Sirish Pande <sirish.pande@amd.com>
2023-09-20 11:37:18 -05:00
David Green
46a1908c26 [AArch64] Add some tests for setcc known bits fold. NFC 2023-09-20 17:36:01 +01:00
Vladislav Dzhidzhoev
b8e9450acb Cleanup fallback NOT checks 2023-09-20 18:22:54 +02:00
Vladislav Dzhidzhoev
fb8f59156f [AArch64][GlobalISel] Adopt dup(load) -> LD1R patterns from SelectionDAG
Follow-up of #65630.
2023-09-20 18:22:54 +02:00
Alex Voicu
de018f5ca4
[clang][CodeGen] The eh_typeid_for intrinsic needs special care too (#65699)
This change is symmetric with the one reviewed in
<https://reviews.llvm.org/D157452> and handles the exception handling
specific intrinsic, which slipped through the cracks, in the same way,
by inserting an address-space cast iff RTTI is in a non-default AS.
2023-09-20 17:12:19 +01:00
Fangrui Song
0de0b6dded
[ELF] Postpone "unable to move location counter backward" error (#66854)
The size of .ARM.exidx may shrink across `assignAddress` calls. It is
possible
that the initial iteration has a larger location counter, causing
`__code_size =
__code_end - .; osec : { . += __code_size; }` to report an error, while
the error would
have been suppressed for subsequent `assignAddress` iterations.

Other sections like .relr.dyn may change sizes across `assignAddress`
calls as
well. However, their initial size is zero, so it is difficiult to
trigger a
similar error.

Similar to https://reviews.llvm.org/D152170, postpone the error
reporting.
Fix #66836. While here, add more information to the error message.
2023-09-20 09:06:45 -07:00
Scott Linder
434907e474
[NFC][AsmPrinter] Refactor FrameIndexExprs as a std::set (#66433)
This avoids the need for a mutable member to implement deferred sorting,
and some bespoke code to maintain a SmallVector as a set.

The performance impact seems to be negligible in some small tests, and
so seems acceptable to greatly simplify the code.

An old FIXME and accompanying workaround are dropped. It is ostensibly
dead-code within the current codebase.
2023-09-20 12:05:05 -04:00
Fangrui Song
309d1c43bd [ELF][test] Add a test to demonstrate #66836 2023-09-20 09:04:41 -07:00
Simon Pilgrim
ad762f2a9f [X86] Regenerate pr39098.ll 2023-09-20 16:58:00 +01:00
Simon Pilgrim
2ec697b4c7 [AMDGPU] Regenerate always-uniform.ll 2023-09-20 16:58:00 +01:00
Slava Zakharin
69d9ad1cee
[flang][hlfir] Fixed cleanup code placement indeterminism in OrderedAssignments. (#66811)
I had to remove test3() case in 73086dab9e
to fix the buildbots. This patch brings it back with proper fix.
2023-09-20 08:34:11 -07:00
Natalie Chouinard
47a377d5e0 [SPIRV] Fix OpConstant float and double printing
Print OpConstant floats as formatted decimal floating points, with
special case exceptions to print infinity and NaN as hexfloats.

This change follows from the fixes in
https://github.com/llvm/llvm-project/pull/66686 to correct how
constant values are printed generally.

Differential Revision: https://reviews.llvm.org/D159376
2023-09-20 15:26:41 +00:00
Nico Weber
2ed813ff26 [gn] Add dummy build file for VETests
sync_source_lists_from_cmake.py checks that every unittest in CMake
also exists in the GN build. 4f330b7f75 added VETests, but the GN
build doesn't include the VE target. So add a dummy target for this
to placate the check.
2023-09-20 11:08:36 -04:00
David Spickett
fdc265be26 [lldb][AArch64] Invalidate cached VG value before reconfiguring SVE registers
This fixes 46b961f36b.

Prior to the SME changes the steps were:
* Invalidate all registers.
* Update value of VG and use that to reconfigure the registers.
* Invalidate all registers again.

With the changes for SME I removed the initial invalidate thinking
that it didn't make sense to do if we were going to invalidate them
all anyway after reconfiguring.

Well the reason it made sense was that it forced us to get the
latest value of vg which we needed to reconfigure properly.

Not doing so caused a test failure on our Graviton bot which has SVE
(https://lab.llvm.org/buildbot/#/builders/96/builds/45722). It was
flaky and looping it locally would always fail within a few minutes.
Presumably it was using an invalid value of vg, which caused some offsets
to be calculated incorrectly.

To fix this I've invalided vg in AArch64Reconfigure just before we read
it. This is the same as the fix I have in review for SME's svg register.

Pushing this directly to fix the ongoing test failure.
2023-09-20 16:05:34 +01:00
Nicolas Vasilache
1b8b556443
[mlir][Vector] Add fastmath flags to vector.reduction (#66905)
This revision pipes the fastmath attribute support through the
vector.reduction op. This seemingly simple first step already requires
quite some genuflexions, file and builder reorganization. In the
process, retire the boolean reassoc flag deep in the LLVM dialect
builders and just use the fastmath attribute.

During conversions, templated builders for predicated intrinsics are
partially cleaned up. In the future, to finalize the cleanups, one
should consider adding fastmath to the VPIntrinsic ops.
2023-09-20 16:57:20 +02:00
Fraser Cormack
ebefe83c09 [NFC] Fix spelling 'constanst' -> 'constants' 2023-09-20 15:33:03 +01:00
Joe Nash
2c0f2b510c
[AMDGPU] Convert tests rotr.ll and rotl.ll to be auto-generated (#66828)
and add GFX11 coverage. NFC
2023-09-20 10:32:04 -04:00
Hans Wennborg
700f683f9d Revert "[clang] Don't inherit dllimport/dllexport to exclude_from_explicit_instantiation members during explicit instantiation (#65961)"
This uncovered a problem with virtual methods and
exclude_from_explicit_instantiation, see
https://github.com/llvm/llvm-project/issues/66909

Reverting until that's fixed.

> This is a continuation of https://reviews.llvm.org/D155713
>
> Fixes https://github.com/llvm/llvm-project/issues/40363

This reverts commit 84216d1735.
2023-09-20 16:31:12 +02:00
Walter Erquinigo
96b1784ac8
[lldb-vscode] Use auto summaries whenever variables don't have a summary (#66551)
Auto summaries were only being used when non-pointer/reference variables
didn't have values nor summaries. Greg pointed out that it should be
better to simply use auto summaries when the variable doesn't have a
summary of its own, regardless of other conditions.

This led to code simplification and correct visualization of auto
summaries for pointer/reference types, as seen in this screenshot.

<img width="310" alt="Screenshot 2023-09-19 at 7 04 55 PM"
src="https://github.com/llvm/llvm-project/assets/1613874/d356d579-13f2-487b-ae3a-f3443dce778f">
2023-09-20 10:23:41 -04:00
Alex Bradbury
feb5c5779c [VE] Add TargetParser to CMakeLists.txt for VE unittest
This fixes the -DBUILD_SHARED_LIBS=True build, which broke after #66730.
2023-09-20 15:22:10 +01:00
Luís Marques
40d4837037
Warn on align directive with non-zero fill value in virtual sections (#66792)
This patch warns when an align directive with a non-zero fill value is
used in a virtual section. The fill value is also set to zero,
preventing an assertion in `MCAssembler::writeSectionData` for the case
of `MCFragment::FT_Align` from tripping.
2023-09-20 15:17:50 +01:00
Benjamin Maxwell
2f11ce5579
[mlir][VectorOps] Extend vector.constant_mask to support 'all true' scalable dims (#66638)
This extends `vector.constant_mask` so that mask dim sizes that
correspond to a scalable dimension are treated as if they're implicitly
multiplied by vscale. Currently this is limited to mask dim sizes of 0
or the size of the dim/vscale. This allows constant masks to represent
all true and all false scalable masks (and some variations):

```
// All true scalable mask
%mask = vector.constant_mask [8] : vector<[8]xi1>

// All false scalable mask
%mask = vector.constant_mask [0] : vector<[8]xi1>

// First two scalable rows
%mask = vector.constant_mask [2,4] : vector<4x[4]xi1>
```
2023-09-20 14:54:42 +01:00
Louis Dionne
e3b166229f [libc++] Sort available features before printing them
This makes it easier to compare the features available in two adjacent
runs of lit.
2023-09-20 09:53:07 -04:00