Commit Graph

415615 Commits

Author SHA1 Message Date
Simon Pilgrim
be1ffda0a5 [InstCombine] visitCallInst - pull out repeated bswap scalar type bitwidth. NFC. 2022-02-18 17:33:11 +00:00
Simon Pilgrim
9415fbbbcf [clangd] getHover - pass FormatStyle argument by const reference
Reported by coverity
2022-02-18 17:27:45 +00:00
Simon Pilgrim
74036dbafd Fix Wdocumentation unknown parameter warning 2022-02-18 17:27:45 +00:00
Nikolas Klauser
3431358333 [libc++] Replace _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI in __filesystem/operations.h 2022-02-18 18:24:09 +01:00
Jez Ng
fd3669c256 [lld-macho] Improve hiding of unnamed_addr symbols
Symbols for which `canBeOmittedFromSymbolTable()` is true should be
treated as private externs. This diff tries to do that by unsetting the
ExportDynamic bit. It seems to mostly work with the FullLTO backend, but
with the ThinLTO backend, the `local_unnamed_addr` symbols still fail to
be properly hidden. Nonetheless, this is a step in the right direction.

I've documented all the remaining differences between our behavior and
LD64's in the lto-internalized-unnamed-addr.ll test.

See also https://discourse.llvm.org/t/mach-o-lto-handling-of-linkonce-odr-unnamed-addr/60015

Reviewed By: #lld-macho, thevinster

Differential Revision: https://reviews.llvm.org/D119767
2022-02-18 12:09:38 -05:00
Jonas Devlieghere
622ea723cc [dsymutil] Make verification test resilient against output ordering
I didn't mean the checks for QUIET-OUTPUT-FAIL, QUIET-INPUT-FAIL and
VERBOSE-INPUT-FAIL to have any specific ordering.
2022-02-18 09:07:25 -08:00
Jonas Devlieghere
e4a03b2689 [lldb] Default initialize CommandOptions fields (NFC)
Make sure all fields are default initialized to the same values.
2022-02-18 09:07:25 -08:00
Sam McCall
47b749e5be [clangd] Tweak --query-driver to ignore slash direction on windows
See https://github.com/clangd/clangd/issues/1022

Differential Revision: https://reviews.llvm.org/D120115
2022-02-18 18:06:36 +01:00
Nathan Sidwell
12c4e65a76 [demangler][NFC] Reformatting
The linter complains about the formatting in subsequent changes.
Fixing that now.

Reviewed By: iains

Differential Revision: https://reviews.llvm.org/D120117
2022-02-18 08:56:01 -08:00
Sanjay Patel
a2963d871e [SDAG] fold sub-of-shift to add-of-shift
This fold is done in IR:
https://alive2.llvm.org/ce/z/jWyFrP

There is an x86 test that shows an improvement
from the added flexibility of using add (commutative).

The other diffs are presumed neutral.

Note that this could also be folded to an 'xor',
but I'm not sure if that would be universally better
(eg, x86 can convert adds more easily into LEA).

This helps prevent regressions from a potential fold for
issue #53829.
2022-02-18 11:55:50 -05:00
Philip Reames
bf296ea6bb [instsimplify] Clarify assumptions about disjoint memory regions [NFC] 2022-02-18 08:51:18 -08:00
Philip Reames
5ecf218eca [instsimplify] Add a comment hinting how compares involving two globals are handled [NFC] 2022-02-18 08:41:30 -08:00
Dave Lee
f20f9f5a32 [lldb] Add llvm_unreachable in RichManglingContext
Add `llvm_unreachable` to prevent warnings/errors in gcc and msvc.

Differential Revision: https://reviews.llvm.org/D119737
2022-02-18 08:38:03 -08:00
Philip Reames
a259e62bb6 [instsimplify] Add a couple more pointer compare folding tests [NFC] 2022-02-18 08:24:06 -08:00
Jay Foad
f510045d82 [CodeGen] Remove unneeded regex escaping in FileCheck patterns. NFC.
Take advantage of D117117 to simplify all {{\[}} to [ and {{\]}} to ].

Differential Revision: https://reviews.llvm.org/D117298
2022-02-18 16:10:56 +00:00
Carlo Bertolli
7b731f4d0b [OpenMP][libomptarget] Delay restore of shadow pointers in structs to after H2D memory copies are completed
When using asynchronous plugin calls, shadow pointer restore could happen before the D2H copy for the entire struct has completed, effectively leaving a device pointer in a host struct.
This patch fixes the problem by delaying restore's to after a synchronization happens (target regions) and by calling early synchronization (target update).

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119968
2022-02-18 10:09:10 -06:00
William S. Moses
670aeece51 [MLIR][OpenMP][SCF] Mark parallel regions as allocation scopes
MLIR has the notion of allocation scopes which specify that stack allocations (e.g. memref.alloca, llvm.alloca) should be freed or equivalently aren't available at the end of the corresponding region.
Currently neither OpenMP parallel nor SCF parallel regions have the notion of such a scope.

This clearly makes sense for an OpenMP parallel as this is implemented in with a new function which outlines the region, and clearly any allocations in that newly outlined function have a lifetime that ends at the return of the function, by definition.

While SCF.parallel doesn't have a guaranteed runtime which it is implemented with, this similarly makes sense for SCF.parallel since otherwise an allocation within an SCF.parallel will needlessly continue to allocate stack memory that isn't cleaned up until the function (or other allocation scope op) which contains the SCF.parallel returns. This means that it is impossible to represent thread or iteration-local memory without causing a stack blow-up. In the case that this stack-blow-up behavior is intended, this can be equivalently represented with an allocation outside of the SCF.parallel with a size equal to the number of iterations.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D119743
2022-02-18 11:06:32 -05:00
Philip Reames
1cf790bd04 [instsimplify] Add pointer compare tests for byval args and globals 2022-02-18 07:50:57 -08:00
Philip Reames
f6510e6d6f [instsimplify] Factor out a helper for alloca bounds checking [NFC]
At the moment, this just groups comments with a reasonably named predicate, but I plan to add other cases to this in the near future.
2022-02-18 07:40:22 -08:00
Simon Pilgrim
6877ec49f7 Fix Wdocumentation unknown parameter warning 2022-02-18 15:38:17 +00:00
Simon Pilgrim
16655a58f2 Fix Wdocumentation unknown parameter warning 2022-02-18 15:38:17 +00:00
Simon Pilgrim
91cf639ac0 Fix Wdocumentation unknown parameter warning 2022-02-18 15:38:16 +00:00
Shilei Tian
68b7b357fd [Clang][OpenMP][Sema] Remove support for floating point values in atomic compare
This is a follow-up patch of D119378.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D119392
2022-02-18 10:24:29 -05:00
Guillaume Chatelet
07f93a1e39 [libc][automemcpy] Discard aggrated samples from JSON
The benchmark framework synthesizes fake "aggregate" Samples representing mean, median and cv.
We're only interested in "iteration" samples.

Differential Revision: https://reviews.llvm.org/D120062
2022-02-18 15:24:13 +00:00
Shilei Tian
ccebf8ac8c [Clang][OpenMP] Add support for compare capture in parser
This patch adds the support for `atomic compare capture` in parser and part of
sema. We don't create an AST node for this because the spec doesn't say `compare`
and `capture` clauses should be used tightly, so we cannot look one more token
ahead in the parser.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D116261
2022-02-18 10:23:59 -05:00
LLVM GN Syncbot
3c84e68ddc [gn build] Port 57baa14d74 2022-02-18 15:11:13 +00:00
Jay Foad
57baa14d74 [AMDGPU] Rename AMDGPUCFGStructurizer to R600MachineCFGStructurizer
Previously the name of the class (AMDGPUCFGStructurizer) did not
match the name of the file (AMDILCFGStructurizer).

Standardize on the name R600MachineCFGStructurizer by analogy with
AMDGPUMachineCFGStructurizer.

Differential Revision: https://reviews.llvm.org/D120128
2022-02-18 15:08:25 +00:00
Simon Pilgrim
707157f248 Revert rGc24e197aaad5333717a27f6e4346f97da84821ed "[clangd] getHover - pass FormatStyle argument by const reference"
There are a number of buildbot build failures on non MSVC compilers
2022-02-18 14:59:57 +00:00
Valentin Clement
be3b40c059
[flang] Lower basic binary operation for scalars
Lower simple binary operation (+, -, *, /) for scalars.

This patch is part of the upstreaming effort from fir-dev branch.

Depends on D120058

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-02-18 15:50:31 +01:00
Simon Pilgrim
c24e197aaa [clangd] getHover - pass FormatStyle argument by const reference
Reported by coverity
2022-02-18 14:45:51 +00:00
Florian Hahn
00ab91b70d
[ConstraintElimination] Remove ConstraintListTy (NFCI).
This patch simplifies constraint handling by removing the
ConstraintListTy wrapper struct and moving the Preconditions directly
into ConstraintTy. This reduces the amount of memory needed for managing
constraints.

The only use case for ConstraintListTy was adding 2 constraints to model
ICMP_EQ conditions. But this can be handled by adding an IsEq flag. When
adding an equality constraint, we need to add the constraint and the
inverted constraint.
2022-02-18 14:35:01 +00:00
Benjamin Kramer
3ce2ee28f0 [mlir][ODS] Infer return types if the operands are variadic but the results are not
Clean up code that worked around this limitation.

Differential Revision: https://reviews.llvm.org/D120119
2022-02-18 15:29:06 +01:00
David Stone
0bff3a9650 Lambdas are not necessarily locals. This resolves DR48250.
Differential Revision: https://reviews.llvm.org/D99134
2022-02-18 06:11:28 -08:00
Sebastian Neubauer
6527b2a4d5 [AMDGPU][NFC] Fix typos
Fix some typos in the amdgpu backend.

Differential Revision: https://reviews.llvm.org/D119235
2022-02-18 15:05:21 +01:00
Florian Hahn
b4670438b3
[ConstraintSystem] Pass ArrayRef instead of full small vector (NFC).
This makes the called functions independent of the container type.
2022-02-18 14:03:09 +00:00
Sebastian Neubauer
1f0aadfa62 [AMDGPU] Fix kill flag on overlapping sgpr copy
Same as on vgpr copies, we cannot kill the source register if it
overlaps with the destination register. Otherwise, the kill of the
source register will also count as a kill for the destination register.

Differential Revision: https://reviews.llvm.org/D120042
2022-02-18 14:36:00 +01:00
Joseph Huber
0136a4401f [OpenMP] Add an option to limit shared memory usage in OpenMPOpt
One of the optimizations performed in OpenMPOpt pushes globalized
variables to static shared memory. This is preferable to keeping the
runtime call in all cases, however if too many variables are pushed to
hared memory the kernel will crash. Since this is an optimization and
not something the user specified explicitly, there should be an option
to limit this optimization in those cases. This path introduces the
`-openmp-opt-shared-limit=` option to limit the amount of bytes that
will be placed in shared memory from HeapToShared.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D120079
2022-02-18 08:35:26 -05:00
Joseph Huber
0870a4f59a [OpenMP] Add flag for disabling thread state in runtime
The runtime uses thread state values to indicate when we use an ICV or
are in nested parallelism. This is done for OpenMP correctness, but it
not needed in the majority of cases. The new flag added is
`-fopenmp-assume-no-thread-state`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D120106
2022-02-18 08:35:05 -05:00
Luo, Yuanke
03ec026eac [X86] Add test cases for sub with select. 2022-02-18 20:53:24 +08:00
Alexey Bataev
b0a0df9809 [SLP]Fix vectorization of the alternate cmp instruction with swapped predicates.
If the alternate cmp instruction is a swapped predicate of the main cmp
instruction, need to generate alternate instruction, not the one with
the swapped predicate. Also, the lane with the alternate opcode should
be selected only, if the corresponding operands are not compatible.

Correctness confirmed:
https://alive2.llvm.org/ce/z/94BG66

Differential Revision: https://reviews.llvm.org/D119855
2022-02-18 04:27:45 -08:00
Simon Moll
f27423027d [VE] Enable v256 fcmp true|false tests
The broadcast patterns for all-true|false masks are available now.
Enable the true|fast fcmp predicate tests that use them.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D119936
2022-02-18 13:26:18 +01:00
Simon Moll
d46e49838e [VE] Fix vmp0 subregister mapping
vmp0 is the all-ones v512i1 register and does not break down into
subregisters.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D120054
2022-02-18 13:17:10 +01:00
Benjamin Kramer
d558540fae [mlir][Vector] Add return type inference for multi_reduction
This subsumes the builder and verifier.
2022-02-18 13:00:42 +01:00
Florian Hahn
3ba42a564a
[MemCpyOpt] Add non-local memcpy test with memory phi. 2022-02-18 11:59:24 +00:00
Nico Weber
0b13c6b88e [gn build] (manually) port 6c99a3469d 2022-02-18 06:56:32 -05:00
Pavel Labath
6c99a3469d [lldb] Add support for a "global" lldbinit file
This patch adds introduces a new kind of an lldbinit file. Unlike the
lldbinit in the home directory (useful for customizing lldb to the needs
of a particular user), or the cwd lldbinit file (useful for
project-specific settings), this file can be used to customize an entire
lldb installation to a particular environment.

The feature is enabled at build time, by setting the
LLDB_GLOBAL_INIT_DIRECTORY variable to a path to a directory which
should contain an "lldbinit" file. Lldb will then load the file at
startup, if it exists, and if automatic init loading has not been
disabled. Relative paths will be resolved (at runtime) relative to the
location of the lldb library (liblldb or LLDB.framework).

The system-wide lldbinit file will be loaded first, before any
$HOME/.lldbinit and $CWD/.lldbinit files are processed, so that those
can override any system-wide settings.

More information can be found on the RFC thread at
<https://discourse.llvm.org/t/rfc-system-wide-lldbinit/59933>.

Differential Revision: https://reviews.llvm.org/D119831
2022-02-18 12:30:22 +01:00
Simon Pilgrim
de2c0a2e61 [X86] combineADC/SBB - pull out repeated getOperand calls. NFC. 2022-02-18 11:21:44 +00:00
Tres Popp
b4e0507ce0 Rename PatternRewriteSet::insert to add
insert is soft deprecated, so remove all references so it's less likely
to be used and can be easily removed in the future.

Differential Revision: https://reviews.llvm.org/D120021
2022-02-18 12:18:41 +01:00
Kadir Cetinkaya
977b1f574f
[clang][ASTReader] Fix memory leak while reading FriendTemplateDecls
Allocate on ASTContext, rather than just on heap, so that template
parameter lists are freed up.

Differential Revision: https://reviews.llvm.org/D120081
2022-02-18 12:16:38 +01:00
Simon Pilgrim
535e7b09c1 [clangd] lookupSiblingsWithinContext - remove unnecessary nullptr check
The DC pointer is always dereferenced after the loop
2022-02-18 11:12:53 +00:00