platform/upstream/llvm.git
2 years ago[mlir][OpenMP] Added assemblyformat for TargetOp
Shraiysh Vaishay [Fri, 18 Feb 2022 19:44:01 +0000 (01:14 +0530)]
[mlir][OpenMP] Added assemblyformat for TargetOp

This patch removes custom parser/printer for `omp.target` and adds
assemblyformat.

Reviewed By: rriddle

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

2 years ago[mlir][OpenMP] Remove clauses that are not being handled
Shraiysh Vaishay [Fri, 18 Feb 2022 17:47:34 +0000 (23:17 +0530)]
[mlir][OpenMP] Remove clauses that are not being handled

This patch removes the following clauses from OpenMP Dialect:

 - private
 - firstprivate
 - lastprivate
 - shared
 - default
 - copyin
 - copyprivate

The privatization clauses are being handled in the flang frontend. The
data copying clauses are not being handled anywhere for now. Once
we have a better picture of how to handle these clauses in OpenMP
Dialect, we can add these. For the time being, removing unneeded
clauses.

For detailed discussion about this refer to [[ https://discourse.llvm.org/t/rfc-privatisation-in-openmp-dialect/3526 | Privatisation in OpenMP dialect ]]

Reviewed By: kiranchandramohan, clementval

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

2 years ago[instsimplify] Simplify HaveNonOverlappingStorage per review suggestion on D120133...
Philip Reames [Fri, 18 Feb 2022 19:32:28 +0000 (11:32 -0800)]
[instsimplify] Simplify HaveNonOverlappingStorage per review suggestion on D120133 [NFC]

2 years ago[ELF] Change (NOLOAD) section type mismatch error to warning
Fangrui Song [Fri, 18 Feb 2022 19:20:36 +0000 (11:20 -0800)]
[ELF] Change (NOLOAD) section type mismatch error to warning

Making a (NOLOAD) section SHT_PROGBITS is fishy (the user may expect all-zero
content, but the linker does not check that), but some projects (e.g. Linux
kernel https://github.com/ClangBuiltLinux/linux/issues/1597) traditionally rely
on the behavior. Issue a warning to not break them.

2 years ago[ifs] Add --exclude flag
Alex Brachet [Fri, 18 Feb 2022 19:13:55 +0000 (19:13 +0000)]
[ifs] Add --exclude flag

Use to remove certain symbols which match the glob pattern. Can be used with --strip-undefined

Reviewed By: haowei, mcgrathr

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

2 years ago[instsimplify] Assume storage for byval args doesn't overlap allocas, globals, or...
Philip Reames [Fri, 18 Feb 2022 19:06:54 +0000 (11:06 -0800)]
[instsimplify] Assume storage for byval args doesn't overlap allocas, globals, or other byval args

This allows us to discharge many pointer comparisons based on byval arguments.

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

2 years ago[mlir][Presburger] Introduce Domain and Range identifiers in PresburgerSpace
Groverkss [Fri, 18 Feb 2022 18:54:18 +0000 (00:24 +0530)]
[mlir][Presburger] Introduce Domain and Range identifiers in PresburgerSpace

This patch introducing seperating dimensions into two types: Domain and Range.
This allows building relations over PresburgerSpace.

This patch is part of a series of patches to introduce relations in Presburger
library.

Reviewed By: arjunp

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

2 years ago[SLP] Address post commit comment from 2e50760
Philip Reames [Fri, 18 Feb 2022 18:57:08 +0000 (10:57 -0800)]
[SLP] Address post commit comment from 2e50760

2 years ago[docs][NewPM] Remove buildDefaultAAPipeline() in example
Arthur Eubanks [Fri, 18 Feb 2022 18:41:41 +0000 (10:41 -0800)]
[docs][NewPM] Remove buildDefaultAAPipeline() in example

With D113210 we're already using the default AA pipeline by default.

2 years ago[InstCombine] visitCallInst - pull out repeated bswap scalar type bitwidth. NFC.
Simon Pilgrim [Fri, 18 Feb 2022 17:33:11 +0000 (17:33 +0000)]
[InstCombine] visitCallInst - pull out repeated bswap scalar type bitwidth. NFC.

2 years ago[clangd] getHover - pass FormatStyle argument by const reference
Simon Pilgrim [Fri, 18 Feb 2022 17:27:32 +0000 (17:27 +0000)]
[clangd] getHover - pass FormatStyle argument by const reference

Reported by coverity

2 years agoFix Wdocumentation unknown parameter warning
Simon Pilgrim [Fri, 18 Feb 2022 17:16:48 +0000 (17:16 +0000)]
Fix Wdocumentation unknown parameter warning

2 years ago[libc++] Replace _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI in __filesystem...
Nikolas Klauser [Fri, 18 Feb 2022 17:23:51 +0000 (18:23 +0100)]
[libc++] Replace _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI in __filesystem/operations.h

2 years ago[lld-macho] Improve hiding of unnamed_addr symbols
Jez Ng [Fri, 18 Feb 2022 17:03:11 +0000 (12:03 -0500)]
[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

2 years ago[dsymutil] Make verification test resilient against output ordering
Jonas Devlieghere [Fri, 18 Feb 2022 17:05:00 +0000 (09:05 -0800)]
[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.

2 years ago[lldb] Default initialize CommandOptions fields (NFC)
Jonas Devlieghere [Fri, 18 Feb 2022 04:51:01 +0000 (20:51 -0800)]
[lldb] Default initialize CommandOptions fields (NFC)

Make sure all fields are default initialized to the same values.

2 years ago[clangd] Tweak --query-driver to ignore slash direction on windows
Sam McCall [Fri, 18 Feb 2022 12:28:16 +0000 (13:28 +0100)]
[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

2 years ago[demangler][NFC] Reformatting
Nathan Sidwell [Fri, 18 Feb 2022 12:05:06 +0000 (04:05 -0800)]
[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

2 years ago[SDAG] fold sub-of-shift to add-of-shift
Sanjay Patel [Fri, 18 Feb 2022 16:43:03 +0000 (11:43 -0500)]
[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.

2 years ago[instsimplify] Clarify assumptions about disjoint memory regions [NFC]
Philip Reames [Fri, 18 Feb 2022 16:51:18 +0000 (08:51 -0800)]
[instsimplify] Clarify assumptions about disjoint memory regions [NFC]

2 years ago[instsimplify] Add a comment hinting how compares involving two globals are handled...
Philip Reames [Fri, 18 Feb 2022 16:40:58 +0000 (08:40 -0800)]
[instsimplify] Add a comment hinting how compares involving two globals are handled [NFC]

2 years ago[lldb] Add llvm_unreachable in RichManglingContext
Dave Lee [Mon, 14 Feb 2022 18:11:29 +0000 (10:11 -0800)]
[lldb] Add llvm_unreachable in RichManglingContext

Add `llvm_unreachable` to prevent warnings/errors in gcc and msvc.

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

2 years ago[instsimplify] Add a couple more pointer compare folding tests [NFC]
Philip Reames [Fri, 18 Feb 2022 16:18:26 +0000 (08:18 -0800)]
[instsimplify] Add a couple more pointer compare folding tests [NFC]

2 years ago[CodeGen] Remove unneeded regex escaping in FileCheck patterns. NFC.
Jay Foad [Fri, 14 Jan 2022 11:03:21 +0000 (11:03 +0000)]
[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

2 years ago[OpenMP][libomptarget] Delay restore of shadow pointers in structs to after H2D memor...
Carlo Bertolli [Fri, 18 Feb 2022 15:55:49 +0000 (09:55 -0600)]
[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

2 years ago[MLIR][OpenMP][SCF] Mark parallel regions as allocation scopes
William S. Moses [Mon, 14 Feb 2022 18:48:04 +0000 (13:48 -0500)]
[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

2 years ago[instsimplify] Add pointer compare tests for byval args and globals
Philip Reames [Fri, 18 Feb 2022 15:50:57 +0000 (07:50 -0800)]
[instsimplify] Add pointer compare tests for byval args and globals

2 years ago[instsimplify] Factor out a helper for alloca bounds checking [NFC]
Philip Reames [Fri, 18 Feb 2022 15:39:25 +0000 (07:39 -0800)]
[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.

2 years agoFix Wdocumentation unknown parameter warning
Simon Pilgrim [Fri, 18 Feb 2022 15:37:49 +0000 (15:37 +0000)]
Fix Wdocumentation unknown parameter warning

2 years agoFix Wdocumentation unknown parameter warning
Simon Pilgrim [Fri, 18 Feb 2022 15:37:23 +0000 (15:37 +0000)]
Fix Wdocumentation unknown parameter warning

2 years agoFix Wdocumentation unknown parameter warning
Simon Pilgrim [Fri, 18 Feb 2022 15:36:55 +0000 (15:36 +0000)]
Fix Wdocumentation unknown parameter warning

2 years ago[Clang][OpenMP][Sema] Remove support for floating point values in atomic compare
Shilei Tian [Fri, 18 Feb 2022 15:24:23 +0000 (10:24 -0500)]
[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

2 years ago[libc][automemcpy] Discard aggrated samples from JSON
Guillaume Chatelet [Thu, 17 Feb 2022 15:29:43 +0000 (15:29 +0000)]
[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

2 years ago[Clang][OpenMP] Add support for compare capture in parser
Shilei Tian [Fri, 18 Feb 2022 15:23:41 +0000 (10:23 -0500)]
[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

2 years ago[gn build] Port 57baa14d7442
LLVM GN Syncbot [Fri, 18 Feb 2022 15:11:13 +0000 (15:11 +0000)]
[gn build] Port 57baa14d7442

2 years ago[AMDGPU] Rename AMDGPUCFGStructurizer to R600MachineCFGStructurizer
Jay Foad [Fri, 18 Feb 2022 14:04:19 +0000 (14:04 +0000)]
[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

2 years agoRevert rGc24e197aaad5333717a27f6e4346f97da84821ed "[clangd] getHover - pass FormatSty...
Simon Pilgrim [Fri, 18 Feb 2022 14:59:57 +0000 (14:59 +0000)]
Revert rGc24e197aaad5333717a27f6e4346f97da84821ed "[clangd] getHover - pass FormatStyle argument by const reference"

There are a number of buildbot build failures on non MSVC compilers

2 years ago[flang] Lower basic binary operation for scalars
Valentin Clement [Fri, 18 Feb 2022 14:49:53 +0000 (15:49 +0100)]
[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>
2 years ago[clangd] getHover - pass FormatStyle argument by const reference
Simon Pilgrim [Fri, 18 Feb 2022 14:21:07 +0000 (14:21 +0000)]
[clangd] getHover - pass FormatStyle argument by const reference

Reported by coverity

2 years ago[ConstraintElimination] Remove ConstraintListTy (NFCI).
Florian Hahn [Fri, 18 Feb 2022 14:33:58 +0000 (14:33 +0000)]
[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.

2 years ago[mlir][ODS] Infer return types if the operands are variadic but the results are not
Benjamin Kramer [Fri, 18 Feb 2022 13:40:11 +0000 (14:40 +0100)]
[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

2 years agoLambdas are not necessarily locals. This resolves DR48250.
David Stone [Fri, 18 Feb 2022 13:54:33 +0000 (05:54 -0800)]
Lambdas are not necessarily locals. This resolves DR48250.

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

2 years ago[AMDGPU][NFC] Fix typos
Sebastian Neubauer [Fri, 18 Feb 2022 13:57:21 +0000 (14:57 +0100)]
[AMDGPU][NFC] Fix typos

Fix some typos in the amdgpu backend.

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

2 years ago[ConstraintSystem] Pass ArrayRef instead of full small vector (NFC).
Florian Hahn [Wed, 16 Feb 2022 14:35:46 +0000 (14:35 +0000)]
[ConstraintSystem] Pass ArrayRef instead of full small vector (NFC).

This makes the called functions independent of the container type.

2 years ago[AMDGPU] Fix kill flag on overlapping sgpr copy
Sebastian Neubauer [Thu, 17 Feb 2022 12:33:07 +0000 (13:33 +0100)]
[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

2 years ago[OpenMP] Add an option to limit shared memory usage in OpenMPOpt
Joseph Huber [Thu, 17 Feb 2022 20:48:12 +0000 (15:48 -0500)]
[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

2 years ago[OpenMP] Add flag for disabling thread state in runtime
Joseph Huber [Fri, 18 Feb 2022 00:09:46 +0000 (19:09 -0500)]
[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

2 years ago[X86] Add test cases for sub with select.
Luo, Yuanke [Fri, 18 Feb 2022 12:52:06 +0000 (20:52 +0800)]
[X86] Add test cases for sub with select.

2 years ago[SLP]Fix vectorization of the alternate cmp instruction with swapped predicates.
Alexey Bataev [Tue, 15 Feb 2022 15:50:28 +0000 (07:50 -0800)]
[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

2 years ago[VE] Enable v256 fcmp true|false tests
Simon Moll [Fri, 18 Feb 2022 12:26:08 +0000 (13:26 +0100)]
[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

2 years ago[VE] Fix vmp0 subregister mapping
Simon Moll [Fri, 18 Feb 2022 12:17:03 +0000 (13:17 +0100)]
[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

2 years ago[mlir][Vector] Add return type inference for multi_reduction
Benjamin Kramer [Fri, 18 Feb 2022 11:51:43 +0000 (12:51 +0100)]
[mlir][Vector] Add return type inference for multi_reduction

This subsumes the builder and verifier.

2 years ago[MemCpyOpt] Add non-local memcpy test with memory phi.
Florian Hahn [Fri, 18 Feb 2022 11:59:24 +0000 (11:59 +0000)]
[MemCpyOpt] Add non-local memcpy test with memory phi.

2 years ago[gn build] (manually) port 6c99a3469d9c
Nico Weber [Fri, 18 Feb 2022 11:56:32 +0000 (06:56 -0500)]
[gn build] (manually) port 6c99a3469d9c

2 years ago[lldb] Add support for a "global" lldbinit file
Pavel Labath [Tue, 15 Feb 2022 12:28:34 +0000 (13:28 +0100)]
[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

2 years ago[X86] combineADC/SBB - pull out repeated getOperand calls. NFC.
Simon Pilgrim [Fri, 18 Feb 2022 11:21:32 +0000 (11:21 +0000)]
[X86] combineADC/SBB - pull out repeated getOperand calls. NFC.

2 years agoRename PatternRewriteSet::insert to add
Tres Popp [Thu, 17 Feb 2022 09:27:19 +0000 (10:27 +0100)]
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

2 years ago[clang][ASTReader] Fix memory leak while reading FriendTemplateDecls
Kadir Cetinkaya [Thu, 17 Feb 2022 21:01:29 +0000 (22:01 +0100)]
[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

2 years ago[clangd] lookupSiblingsWithinContext - remove unnecessary nullptr check
Simon Pilgrim [Fri, 18 Feb 2022 11:12:33 +0000 (11:12 +0000)]
[clangd] lookupSiblingsWithinContext - remove unnecessary nullptr check

The DC pointer is always dereferenced after the loop

2 years agoRevert "Fix race condition when launching and attaching."
Pavel Labath [Fri, 18 Feb 2022 11:01:05 +0000 (12:01 +0100)]
Revert "Fix race condition when launching and attaching."

It breaks TestVSCode_attach.py.

This reverts commit 9febd1e573fb8b3d1de5844b7bfd33eb998f0106 and
38054556a08884aa15d3ebc720e2f43d0cb5a944.

2 years agoRevert "unbreak Modules/cxx20-export-import.cpp with LLVM_APPEND_VC_REV after 32b73bc...
Florian Hahn [Fri, 18 Feb 2022 09:49:50 +0000 (09:49 +0000)]
Revert "unbreak Modules/cxx20-export-import.cpp with LLVM_APPEND_VC_REV after 32b73bc6ab82"

This reverts commit 1689b1092ebb2c630f8ef1d3880a9fb4808d16fa.

This patch was only added to fix a failure with 32b73bc6ab8234b, which
has been reverted again.

2 years agoRevert "Add support for floating-point option `ffp-eval-method` and for"
Florian Hahn [Fri, 18 Feb 2022 09:47:08 +0000 (09:47 +0000)]
Revert "Add support for floating-point option `ffp-eval-method` and for"

This reverts commit 32b73bc6ab8234b670c34d5ef999300e072cc706.

This breaks builds on macOS in some configurations, because
__FLT_EVAL_METHOD__ is set to an unexpected value.

E.g.
https://green.lab.llvm.org/green/job/clang-stage1-RA/28282/consoleFull#129538464349ba4694-19c4-4d7e-bec5-911270d8a58c

More details available in the review thread
https://reviews.llvm.org/D109239

2 years ago[mlir][Vector] Switch ExtractOp to the declarative assembly format
Benjamin Kramer [Fri, 18 Feb 2022 10:39:48 +0000 (11:39 +0100)]
[mlir][Vector] Switch ExtractOp to the declarative assembly format

This is a bit awkward since ExtractOp allows both `f32` and
`vector<1xf32>` results for a scalar extraction. Allow both, but make
inference return the scalar to make this as NFC as possible.

2 years ago[mlir][bufferize][NFC] Remove obsolete tensor bufferization patterns from Linalg...
Matthias Springer [Fri, 18 Feb 2022 09:46:20 +0000 (18:46 +0900)]
[mlir][bufferize][NFC] Remove obsolete tensor bufferization patterns from Linalg/Bufferize.cpp

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

2 years ago[Hexagon] aligned load/store patterns - use cast<> instead of dyn_cast<> to avoid...
Simon Pilgrim [Fri, 18 Feb 2022 10:31:00 +0000 (10:31 +0000)]
[Hexagon] aligned load/store patterns - use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is always referenced inside isAlignedMemNode, so assert the cast is correct instead of returning nullptr

2 years ago[ARM] ARMAsmPrinter::emitAttributes - remove unnecessary nullptr test.
Simon Pilgrim [Fri, 18 Feb 2022 10:29:52 +0000 (10:29 +0000)]
[ARM] ARMAsmPrinter::emitAttributes - remove unnecessary nullptr test.

The MMI pointer has already been dereferenced several times.

2 years ago[AMDGPU] Return better Changed status from SIFoldOperands
Jay Foad [Wed, 16 Feb 2022 15:59:15 +0000 (15:59 +0000)]
[AMDGPU] Return better Changed status from SIFoldOperands

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

2 years ago[mlir][bufferize] Support memrefs with non-standard layout in `finalizing-bufferize`
Matthias Springer [Fri, 18 Feb 2022 09:45:36 +0000 (18:45 +0900)]
[mlir][bufferize] Support memrefs with non-standard layout in `finalizing-bufferize`

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

2 years ago[objcopy][NFC] Add rules to cmake to put files under specific folders.
Alexey Lapshin [Thu, 17 Feb 2022 22:41:29 +0000 (01:41 +0300)]
[objcopy][NFC] Add rules to cmake to put files under specific folders.

This patch adds rules to cmake to put files under specific folders.

It allows to have files for different formats(which are located in different
subdirectories) be displayed in different subfolders of VS IDE solution.

Depends on D114429

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

2 years ago[AMDGPU] Return better Changed status from SILowerControlFlow
Jay Foad [Wed, 16 Feb 2022 16:41:45 +0000 (16:41 +0000)]
[AMDGPU] Return better Changed status from SILowerControlFlow

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

2 years ago[AMDGPU] Return better Changed status from SIOptimizeExecMasking
Jay Foad [Wed, 16 Feb 2022 16:30:25 +0000 (16:30 +0000)]
[AMDGPU] Return better Changed status from SIOptimizeExecMasking

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

2 years agoAdd "REQUIRES: asserts" to test misched-predicate-virtreg.mir which uses "-debug...
Douglas Yung [Fri, 18 Feb 2022 09:48:13 +0000 (01:48 -0800)]
Add "REQUIRES: asserts" to test misched-predicate-virtreg.mir which uses "-debug-only".

2 years ago[CodeGen] Return better Changed status from PostRAHazardRecognizer
Jay Foad [Wed, 16 Feb 2022 16:49:47 +0000 (16:49 +0000)]
[CodeGen] Return better Changed status from PostRAHazardRecognizer

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

2 years agoRevert "[XCOFF][llvm-objdump] change the priority of symbols with"
esmeyi [Fri, 18 Feb 2022 09:12:32 +0000 (04:12 -0500)]
Revert "[XCOFF][llvm-objdump] change the priority of symbols with"

This reverts commit 2ad662172cbbd1ca53489bf8bddb0183d7692708.

Buildbot failure #19373

2 years ago[mlir][tensor] Extend reshape utils.
Stephan Herhut [Mon, 14 Feb 2022 16:46:35 +0000 (17:46 +0100)]
[mlir][tensor] Extend reshape utils.

This change changes the handling of trailing dimensions with unknown
extent. Users of the changessociationIndicesForReshape helper should
see benefits when transforming reshape like operations into
expand/collapse pairs if the higher-rank type has trailing unknown
dimensions.

The motivating example is a reshape from tensor<16x1x?xi32> to
tensor<16xi32> that can be modeled as collapsing the three dimensions.

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

2 years ago[NFC][Clang/test] add target triple to CodeGen/analyze_noundef.cpp
hyeongyukim [Fri, 18 Feb 2022 08:52:56 +0000 (17:52 +0900)]
[NFC][Clang/test] add target triple to CodeGen/analyze_noundef.cpp

2 years ago[asan] Add support for disable_sanitizer_instrumentation attribute
Alexander Potapenko [Thu, 17 Feb 2022 14:48:35 +0000 (15:48 +0100)]
[asan] Add support for disable_sanitizer_instrumentation attribute

For ASan this will effectively serve as a synonym for
__attribute__((no_sanitize("address"))).

Adding the disable_sanitizer_instrumentation to functions will drop the
sanitize_XXX attributes on the IR level.

This is the third reland of https://reviews.llvm.org/D114421.
Now that TSan test is fixed (https://reviews.llvm.org/D120050) there
should be no deadlocks.

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

2 years ago[NFC] Fix a buildbot failure after b529744
hyeongyukim [Fri, 18 Feb 2022 08:38:50 +0000 (17:38 +0900)]
[NFC] Fix a buildbot failure after b529744

2 years ago[mlir] Propagate NaNs in PolynomialApproximation
Tres Popp [Thu, 17 Feb 2022 09:20:50 +0000 (10:20 +0100)]
[mlir] Propagate NaNs in PolynomialApproximation

Previously, NaNs would be dropped in favor of bounded values which was
strictly incorrect. Now the min/max operation propagate this
information. Not all uses of min/max need this, but the given change
will help protect future additions, and this prevents the need for an
additional cmpf and select operation to handle NaNs.

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

2 years ago[Clang] Rename `disable-noundef-analysis` flag to `-[no-]enable-noundef-analysis`
hyeongyukim [Fri, 18 Feb 2022 08:00:00 +0000 (17:00 +0900)]
[Clang] Rename `disable-noundef-analysis` flag to `-[no-]enable-noundef-analysis`

This flag was previously renamed `enable_noundef_analysis` to
`disable-noundef-analysis,` which is not a conventional name. (Driver and
CC1's boolean options are using [no-] prefix)
As discussed at https://reviews.llvm.org/D105169, this patch reverts its
name to `[no-]enable_noundef_analysis` and enables noundef-analysis as
default.

Reviewed By: MaskRay

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

2 years agoFix buildbots after https://reviews.llvm.org/D119797
Greg Clayton [Fri, 18 Feb 2022 07:59:15 +0000 (23:59 -0800)]
Fix buildbots after https://reviews.llvm.org/D119797

This value error is no longer needed with the new version of the patch

2 years ago[flang] Lower scalar negation
Valentin Clement [Fri, 18 Feb 2022 07:08:34 +0000 (08:08 +0100)]
[flang] Lower scalar negation

Handle negation on scalar expression.

```
res = -a
```

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years ago[gn build] Port 0a4184909a8c
LLVM GN Syncbot [Fri, 18 Feb 2022 06:12:10 +0000 (06:12 +0000)]
[gn build] Port 0a4184909a8c

2 years agoReland "[memprof] Extend the index prof format to include memory profiles."
Snehasish Kumar [Fri, 18 Feb 2022 00:01:31 +0000 (16:01 -0800)]
Reland "[memprof] Extend the index prof format to include memory profiles."

This patch adds support for optional memory profile information to be
included with and indexed profile. The indexed profile header adds a new
field which points to the offset of the memory profile section (if
present) in the indexed profile. For users who do not utilize this
feature the only overhead is a 64-bit offset in the header.

The memory profile section contains (1) profile metadata describing the
information recorded for each entry (2) an on-disk hashtable containing
the profile records indexed via llvm::md5(function_name). We chose to
introduce a separate hash table instead of the existing one since the
indexing for the instrumented fdo hash table is based on a CFG hash
which itself is perturbed by memprof instrumentation.

This commit also includes the changes reviewed separately in D120093.

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

2 years ago[JITLink][RISCV] fix the extractBits behavior and add R_RISCV_JAL relocation.
fourdim [Fri, 18 Feb 2022 06:06:48 +0000 (14:06 +0800)]
[JITLink][RISCV] fix the extractBits behavior and add R_RISCV_JAL relocation.

This patch supports the R_RISCV_JAL relocation.
Moreover, it will fix the extractBits function's behavior as it extracts Size + 1 bits.
In the test ELF_jal.s:
Before:
```
Hi: 4294836480
extractBits(Hi, 12, 8): 480
```
After:
```
Hi: 4294836480
extractBits(Hi, 12, 8): 224
```

Reviewed By: StephenFan

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

2 years ago[MemoryDependency] Simplfy re-ordering condition. Cleanup. NFC.
Serguei Katkov [Thu, 17 Feb 2022 05:06:23 +0000 (12:06 +0700)]
[MemoryDependency] Simplfy re-ordering condition. Cleanup. NFC.

Make the reading of condition for restricting re-ordering simpler.

Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D120005

2 years ago[XCOFF][llvm-objdump] change the priority of symbols with
esmeyi [Fri, 18 Feb 2022 05:29:10 +0000 (00:29 -0500)]
[XCOFF][llvm-objdump] change the priority of symbols with
                      the same address by symbol types.

Summary: In XCOFF, each section comes with a default symbol
         with the same name as the section. It doesn't bind
         to code locations and it may cause incorrect display
         of symbol names under `llvm-objdump -d`.
         This patch changes the priority of symbols with the
         same address by symbol type.

Reviewed By: jhenderson, shchenz

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

2 years ago[gn build] Port 8e979460bb27
LLVM GN Syncbot [Fri, 18 Feb 2022 04:18:16 +0000 (04:18 +0000)]
[gn build] Port 8e979460bb27

2 years ago[libc++][ranges] Implement `std::sortable`.
Konstantin Varlamov [Fri, 18 Feb 2022 04:15:02 +0000 (20:15 -0800)]
[libc++][ranges] Implement `std::sortable`.

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

2 years ago[gn build] Port eea3d90af181
LLVM GN Syncbot [Fri, 18 Feb 2022 04:12:48 +0000 (04:12 +0000)]
[gn build] Port eea3d90af181

2 years ago[libc++][ranges] Implement `std::mergeable`.
Konstantin Varlamov [Fri, 18 Feb 2022 04:11:46 +0000 (20:11 -0800)]
[libc++][ranges] Implement `std::mergeable`.

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

2 years ago[GlobalDCE] [VFE] Avoid dropping vfunc dependencies when an invalid vtable entry...
Kuba Mracek [Fri, 18 Feb 2022 03:41:46 +0000 (19:41 -0800)]
[GlobalDCE] [VFE] Avoid dropping vfunc dependencies when an invalid vtable entry is present

When we scan vtables for a particular vload in ScanVTableLoad and an entry in
one possible vtable is invalid (null or non-fptr), we bail in a wrong way -- we
completely stop the scanning of vtables and this results in dropped dependencies
and incorrectly removed vfuncs from vtables. Let's fix that by correcting the
bailing logic to keep iterating and only skip the invalid entries.

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

2 years ago[NFC] Add myself to CREDITS.TXT
Weining Lu [Fri, 18 Feb 2022 02:18:13 +0000 (10:18 +0800)]
[NFC] Add myself to CREDITS.TXT

2 years ago[MachineOutliner] Add testcase for instruction mapping stats
Jessica Paquette [Fri, 18 Feb 2022 02:26:16 +0000 (18:26 -0800)]
[MachineOutliner] Add testcase for instruction mapping stats

I forgot to attach the testcase for 12389e375811d46ce41d949857f8b469d6563114!

2 years ago[MachineOutliner] Add statistics for unsigned vector size
Jessica Paquette [Fri, 18 Feb 2022 02:12:39 +0000 (18:12 -0800)]
[MachineOutliner] Add statistics for unsigned vector size

Useful for debugging + evaluating improvements to the outliner.

Stats are the number of illegal, legal, and invisible instructions in the
unsigned vector, and it's total length.

2 years ago[msan] strsignal interceptor
Vitaly Buka [Thu, 17 Feb 2022 21:06:11 +0000 (13:06 -0800)]
[msan] strsignal interceptor

Reviewed By: kstoimenov

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

2 years ago[LoongArch] Fix several instruction definition errors in initial patches
Weining Lu [Fri, 18 Feb 2022 02:04:28 +0000 (10:04 +0800)]
[LoongArch] Fix several instruction definition errors in initial patches

This patch corrects some instruction definitions that I incorrectly wrote
in initial patches including bstr{ins/pick}.{w/d}, ll.{w/d} and sc.{w/d}.

Reviewed By: xen0n

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

2 years ago[LoongArch] Add missing dollar prefix to register name in InstPrinter
Weining Lu [Thu, 17 Feb 2022 01:04:47 +0000 (09:04 +0800)]
[LoongArch] Add missing dollar prefix to register name in InstPrinter

This patch adds a '$' prefix to register name in InstPrinter that I missed in initial patches.

Reviewed By: xen0n

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

2 years ago[LICM][PhaseOrder] Don't speculate in LICM until after running loop rotate
William S. Moses [Sat, 12 Feb 2022 21:33:22 +0000 (16:33 -0500)]
[LICM][PhaseOrder] Don't speculate in LICM until after running loop rotate

LICM will speculatively hoist code outside of loops. This requires removing information, like alias analysis (https://github.com/llvm/llvm-project/issues/53794), range information (https://bugs.llvm.org/show_bug.cgi?id=50550), among others. Prior to https://reviews.llvm.org/D99249 , LICM would only be run after LoopRotate. Running Loop Rotate prior to LICM prevents a instruction hoist from being speculative, if it was conditionally executed by the iteration (as is commonly emitted by clang and other frontends). Adding the additional LICM pass first, however, forces all of these instructions to be considered speculative, even if they are not speculative after LoopRotate. This destroys information, resulting in performance losses for discarding this additional information.

This PR modifies LICM to accept a ``speculative'' parameter which allows LICM to be set to perform information-loss speculative hoists or not. Phase ordering is then modified to not perform the information-losing speculative hoists until after loop rotate is performed, preserving this additional information.

Reviewed By: lebedev.ri

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

2 years ago[mlir][Vector] Switch ShuffleOp to the declarative assembly format
Benjamin Kramer [Fri, 18 Feb 2022 00:35:25 +0000 (01:35 +0100)]
[mlir][Vector] Switch ShuffleOp to the declarative assembly format

This also requires implementing return type deduction.