Commit Graph

454883 Commits

Author SHA1 Message Date
Jessica Clarke
2be973e9d8 workflows: Don't try and run llvm-bugs in forks
Most forks won't have an LLVM_BUGS_KEY secret, so Mailgun will error out
with a missing key, and if forks do happen to have such a secret then we
still don't want to be getting emails to LLVM's mailing lists for
downstream forks.

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D146235
2023-03-16 16:47:07 +00:00
Peiming Liu
5da8f30d63 [mlir][sparse] add test cases for sparse tensor slices on COO tensors
Reviewed By: aartbik, bixia

Differential Revision: https://reviews.llvm.org/D146074
2023-03-16 16:43:56 +00:00
Arthur Eubanks
60ebe901eb [HWAsan] Fix returned PreservedAnalyses
Initialization modifies the module.
2023-03-16 09:42:09 -07:00
Arthur Eubanks
4b0b1052a5 [FunctionImport] Fix returned PreservedAnalyses 2023-03-16 09:42:09 -07:00
Arthur Eubanks
c0cb758ebd [Annotation2Metadata] Fix returned PreservedAnalyses 2023-03-16 09:42:09 -07:00
David Spickett
0b958fe411 [flang] Make tests depend on llvm-readobj not llvm-readelf
d4320cb2a5 fixed a regular build
issue by making the flang tests depend on llvm-readelf.

Turns out llvm-readelf is a symlink to llvm-readobj and for
whatever reason, doesn't have the right exports at the moment
to be picked up in a standalone build.

https://lab.llvm.org/buildbot/#/builders/175/builds/26448

Maybe we should fix that, but for now, just require llvm-readobj
instead.
2023-03-16 16:39:22 +00:00
Arthur Eubanks
ac44122513 [AMDGPUCtorDtorLowering] Fix returned PreservedAnalyses 2023-03-16 09:36:17 -07:00
Mikhail R. Gadelha
185ea867eb [RISCV] Fix missing addi in test to validate lower inline asm m with offset 2023-03-16 13:30:53 -03:00
Wei Wang
013f6d23e6 [Coroutines] Add remarks in CoroSplit and CoroElide passes
Add remarks to show frame size and alignment.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D146175
2023-03-16 09:21:35 -07:00
Valentin Clement
1d837cf2cf
[flang] Do not try to rebox for assumed type
Just use conversion from assuemd type to assumed type
because a rebox needs more information that are not available
with assumed type.

Also use `isAssumedType` instead of `isBoxNone` since assumed
type can have sequence information.

Depends on D146207

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D146209
2023-03-16 17:16:45 +01:00
Anshil Gandhi
a5455e32b3 [AMDGPUUnifyDivergentExitNodes] Add NewPM support
Meanwhile, use UniformityAnalysis instead of LegacyDivergenceAnalysis to collect divergence info.

Reviewed By: arsenm, sameerds

Differential Revision: https://reviews.llvm.org/D141355
2023-03-16 16:13:29 +00:00
Mikhail R. Gadelha
4bbee03d8a [RISCV] Added tests to validate lower inline asm m and A with offsets 2023-03-16 13:12:39 -03:00
Valentin Clement
b52e97415f
[flang] Embox argument for assumed type dummy argument to !fir.box<none>
When passing an argument to an assumed type dummy argument, embox
it directly to a !fir.box<none> box.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D146207
2023-03-16 17:10:54 +01:00
Nikita Popov
c3a6bea759 [LICM] Add additional single thread promotion test (NFC) 2023-03-16 16:58:43 +01:00
Luke Lau
b9238abe05 [RISCV] Enable interleaved access vectorization
The loop vectorizer supports generating interleaved loads and stores via
shuffle patterns for fixed length vectors.
This enables it for RISC-V, since interleaved shuffle patterns can be
lowered to vlseg/vsseg in https://reviews.llvm.org/D145022

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D145155
2023-03-16 15:48:55 +00:00
Luke Lau
4e1ba0c518 [RISCV] Don't accidentally match deinterleave masks as interleaves
Consider a shuffle mask of <0, 2>:
This is one of two deinterleave masks to deinterleave a vector of 4
elements with factor 2.
Unfortunately, this is also technically an interleave mask, where
two subvectors of length 1 at indexes 0 and 2 will be interleaved.
This is because a mask can interleave non-contiguous subvectors:
e.g. <0, 6, 4, 1, 7, 5> on a vector of size 8:

```
<0 1 2 3 4 5 6 7> indices
 ^ ^     ^ ^ ^ ^
 0 0     2 2 1 1  deinterleaved subvector
```

This means that deinterleaving shuffles can accidentally be costed as
interleaves.
And it's incorrect in the context of interleaves, because the
only interleave shuffles we model at the moment are single permutation
shuffles, i.e. we are interleaving the first vector below and ignoring
the second:

shufflevector <2 x i32> %v0, <2 x i32> poison, <2 x i32> <i32 0, i32 2>

A mask of <0, 2> interleaves across both vectors.

The fix here is to set NumInputElts correctly: We were setting it to
twice the mask length, i.e. using both input vectors. But in fact we're
actually only using the first vector here, and isInterleaveMask actually
already has logic to ensure that the mask indices stay within the bounds
of the input vectors.

This lacks a test case due to how we're unable to test deinterleave
shuffles (because they are length changing), but is covered in the tests
in D145155

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D146176
2023-03-16 15:48:51 +00:00
Alex Bradbury
7d10b47450 [RISCV][MC][NFC] Refactor RISCVAsmPrinter::PrintAsmMemoryOperand to use early return 2023-03-16 15:02:53 +00:00
Diego Caballero
6d68ef4e38 [mlir][Vector] Canonicalize create_mask(transpose)
When applying vector masking we may create a mask and then transpose it.
Transpositions are extremely expensive so this patch introduces a new
canonicalization pattern that remove the tranpose operation and create a
new transposed mask.

Differential Revision: https://reviews.llvm.org/D146193
2023-03-16 14:35:52 +00:00
Simon Pilgrim
ef10f98643 [TLI] getMemValueType - break apart if-else chain and use auto with dyn_cast (style). NFC.
More closely matches getValueType
2023-03-16 14:33:04 +00:00
Mahesh Ravishankar
809e3d8c98 [mlir][TilingInterface] Modify TilingInterface methods to better return the state of the transformed IR.
Currently the `getTiledImplementation` and `generateResultTileValue`
return just `SmallVector<Operation *>` and `FailureOr<Value>`.

- For `getTiledImplementation` returning empty implies tiling wasnt
  done. There is also an implicit assumption that the tiled operation
  results correspond to the tiled values of the result of the original
  operation. This cannot handle cases where the tiled implementation
  might use multiple operations to compute the tiled value for the
  results of the untiled operation. Sometimes, the tiled operation
  might not directly give the tiled values, and might require casts,
  etc to get a replacement.
- For `generateResultTileValue`, it is assumed that the op defining
  the returned `Value` is the operation that represents the tiled
  computation. Again presence of casts, etc violate this.

Instead make these methods return
```
struct TilingResult {
  SmallVector<Operation *> tiledOps;
  SmallVector<Value> tiledValues;
};
```

The `tiledOps` represent the operations generated that are relevant
for subsequent transformations. The `tiledValues` represent the tiled
values for the results of the original operation. This better
transmits the state of the transformed IR.

As a consequence the following methods also return `FailureOr<TilingResult>`
- `tensor::replaceExtractSliceWithTiledProducer`
- `tensor::bubbleUpPadSlice`

Differential Revision: https://reviews.llvm.org/D145133
2023-03-16 14:29:03 +00:00
Jakub Kuderski
a586c55100 [mlir][vector] Add mask fold test for gather lowering
Check that `scf.if` checks are folded when the mask is all set / not
set.

This to address post-commit feedback for
https://reviews.llvm.org/D145942.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D146144
2023-03-16 10:16:15 -04:00
Joseph Huber
a704c312f1 [libc] Add missing dependencies to RISC-V startup implementation
Summary:
Just like the last patch, the threads and envrion dependencies were
missing. This lead to linker failures when building the tests.
2023-03-16 09:13:18 -05:00
Simon Pilgrim
9ed434a96e [TLI] Bring isZExtFree declarations together. NFC.
Don't spread them out over the header.
2023-03-16 14:12:15 +00:00
Tim Northover
2d690684f6 Recommit DwarfEHPrepare: insert extra unwind paths for stack protector to instrument
This is a mitigation patch for
https://bugs.chromium.org/p/llvm/issues/detail?id=30, where existing stack
protection is skipped if a function is returned through by an unwinder rather
than the normal call/return path. The recent patch D139254 added the ability to
instrument a visible unwind path, at least in the IR case (I'm working on the
SelectionDAG instrumentation too) but there are still invisible unwinds it
can't reach.

So this patch adds logic to DwarfEHPrepare that goes through a function,
converting any call that might throw into an invoke to a simple resume cleanup,
and adding cleanup clauses to existing landingpads that lack them. Obviously we
don't really want to do this if it's wasted effort, so I also exposed
requiresStackProtector from the actual StackProtector code to skip the extra
paths if they won't be used.

Changes:
  * Move test to AArch64 directory as it relies on target presence.
  * Re-add Dominator-tree maintenance. Accidentally cherry-picked wrong patch.
  * Skip adding paths on Windows EH functions.

https://reviews.llvm.org/D143637
2023-03-16 13:43:17 +00:00
Michael Platings
60bbf271b5 [ARM][NFC] Use FPUKind enum instead of unsigned
Also rename some FPUID variables to FPUKind now it's clear that's what
they are.

Differential Revision: https://reviews.llvm.org/D146141
2023-03-16 13:38:10 +00:00
Nikita Popov
531e06668b [ValueTracking] Return ConstantRange for intrinsic ranges (NFC)
Instead of setting Lower and Upper, return a ConstantRange.
Should do this for the others as well.
2023-03-16 14:25:28 +01:00
Nikita Popov
a7a8e237e8 [InstCombine] Add more vscale icmp tests (NFC)
In particular cover cases where vscale_range entries are larger
than the vscale bitwidth.
2023-03-16 14:25:27 +01:00
Maya Amrami
fbf719b868 [mlir] Fix legal/illegal ops in TosaToTensor & TosaToLinalg
tosa.reshape and tosa.concat were moved from TosaToLinalg to TosaToTensor
(D145119 & D145952). So now they are legal after applying TosaToLinalg patterns,
and illegal after applying TosaToTensor patterns.

This includes D146174 (thanks @ramiro050!)

Reviewed By: krzysz00

Differential Revision: https://reviews.llvm.org/D146213
2023-03-16 15:15:38 +02:00
Joseph Huber
501a8724bd [libc] Add missing environ dependency to AArch64 startup implementation
Summary:
Just like the last patch, this dependency was missing. This lead to
linker failures when building the tests.
2023-03-16 08:06:14 -05:00
Joseph Huber
2389f00019 [libc] Add missing threads dependency to AArch64 startup implementation
Summary:
The changes in D146184 made the integration tests use the inhereted
dependencies from the startup code like a normal target. For the AArch64
target this resulted in the threads depenency not being pulled in
because it was not present in the original code.
2023-03-16 08:00:14 -05:00
Joseph Huber
f62523032d [libc] Inherit integration test dependencies from the startup target
All integration tests rely on the startup code to be run. Currently we
manually include a few of these dependencies that are relevant for the
Linux target. This patch changes this to make the integration test's
dependencies include all the dependencies of the startup code. This
simplifies the code and makes it easier to support different targets.
The changes here cause the integration test to be dependent on more
targets than previously necessary, but it should be fine.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D146184
2023-03-16 07:33:22 -05:00
Adrian Kuegel
bece599dff [llvm][Bazel] Include .inc files in tblgen target.
Differential Revision: https://reviews.llvm.org/D146220
2023-03-16 13:32:37 +01:00
Simon Pilgrim
6bc0e362d7 [DAG] TargetLowering::ShrinkDemandedOp - move SmallVTBits iterator inside for loop. NFC 2023-03-16 12:12:33 +00:00
Simon Pilgrim
7aa7393aab [DAG] TargetLowering::ShrinkDemandedOp - pull out repeated getValueType calls. NFC 2023-03-16 12:12:33 +00:00
Haojian Wu
1f5fdc22a2 [clang] Fix a UsingTemplate regression after 3e78fa8602
TemplateName::getAsTemplateDecl() returns the underlying TemplateDecl
for a UsingTemplate kind template name. We should respect that in the
Profile method otherwise we might desugar the template name unexpectedly
(e.g. for template argument deduction with deduciton guides).

Differential Revision: https://reviews.llvm.org/D146202
2023-03-16 12:59:26 +01:00
Tim Northover
e4b352a0b9 Revert "DwarfEHPrepare: insert extra unwind paths for stack protector to instrument"
It's caused more failures than are trivially fixable.

This reverts commit 203b6f31bb.
2023-03-16 11:55:53 +00:00
Tim Northover
203b6f31bb DwarfEHPrepare: insert extra unwind paths for stack protector to instrument
This is a mitigation patch for
https://bugs.chromium.org/p/llvm/issues/detail?id=30, where existing stack
protection is skipped if a function is returned through by an unwinder rather
than the normal call/return path. The recent patch D139254 added the ability to
instrument a visible unwind path, at least in the IR case (I'm working on the
SelectionDAG instrumentation too) but there are still invisible unwinds it
can't reach.

So this patch adds logic to DwarfEHPrepare that goes through a function,
converting any call that might throw into an invoke to a simple resume cleanup,
and adding cleanup clauses to existing landingpads that lack them. Obviously we
don't really want to do this if it's wasted effort, so I also exposed
requiresStackProtector from the actual StackProtector code to skip the extra
paths if they won't be used.

https://reviews.llvm.org/D143637
2023-03-16 11:32:45 +00:00
Tim Northover
79b3f0823e StackProtector: expose RequiresStackProtector publicly. NFC. 2023-03-16 11:32:45 +00:00
Matt Arsenault
8e009348e8 clang: Use ptrmask for pointer alignment
Avoid using ptrtoint/inttoptr.
2023-03-16 07:16:41 -04:00
Frederic Cambus
245f26a430 [docs] Document "PGO" (Profile-Guided Optimization) in the lexicon. 2023-03-16 12:14:44 +01:00
Bing1 Yu
ca4c533182 [RFC][X86][MemFold] Upgrade the mechanism of auto-generated Memory Folding Table
1. Align ManualMapSet with X86MemoryFoldTableEntry instead of using UnfoldStrategy
2. ManualMapSet able to update the existing record in auto-generated MemFold table

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D142084
2023-03-16 18:44:04 +08:00
Nikita Popov
07136a314d [InstCombine] Add additional vscale icmp tests (NFC)
The existing tests don't test the precise range bounds implied
by the vscale_range attribute.
2023-03-16 11:36:42 +01:00
Nikita Popov
16d9488cca [SCEV] Add additional tests for vscale (NFC) 2023-03-16 11:05:49 +01:00
Hans Wennborg
7a85aa918c Emit const globals with constexpr destructor as constant LLVM values
This follows 2b4fa53 which made Clang not emit destructor calls for such
objects. However, they would still not get emitted as constants since
CodeGenModule::isTypeConstant() returns false if the destructor is
constexpr. This change adds a param to make isTypeConstant() ignore the
dtor, allowing the caller to check it instead.

Fixes Issue #61212

Differential revision: https://reviews.llvm.org/D145369
2023-03-16 11:02:27 +01:00
OCHyams
44e03d6488 [Assignment Tracking] Allow salvaging with variadic expressions [4/x]
Allow the value-component of a dbg.assign to be salvaged using a variadic
DIExpression.

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D145915
2023-03-16 09:55:15 +00:00
OCHyams
47b99b7fc0 [Assignment Tracking] Do not convert variadic locations to kill locations [3/x]
Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D145914
2023-03-16 09:55:15 +00:00
OCHyams
7d89437455 [Assignment Tracking][NFC] Use RawLocationWrapper in VarLocInfo [2/x]
Use RawLocationWrapper rather than a Value to represent the location operand(s)
so that it's possible to represent multiple location
operands. AssignmentTrackingAnalysis still converts variadic debug intrinsics
to kill locations so this patch is NFC.

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D145911
2023-03-16 09:55:15 +00:00
OCHyams
af9e52208d [DebugInfo][NFC] Add RawLocationWrapper to wrap location operand metadata [1/x]
RawLocationWrapper wraps the location operand of a debug intrinsic which may be
either (wrapped in MetadataAsValue) a DIArgList, ValueAsMetadata, or an empty
MDTuple. This class lets us avoid duplicating location handling code in a later
patch in this stack.

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D145909
2023-03-16 09:55:14 +00:00
Shao-Ce SUN
d4320cb2a5 [flang] Fix build error caused by missing llvm-readelf
Fix build error in D145883. Thanks @awarzynski!

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D146204
2023-03-16 17:47:33 +08:00
Nikita Popov
fdbcd76999 [ConstantsTest] Fix unused variable warning (NFC) 2023-03-16 10:43:13 +01:00