platform/upstream/llvm.git
2 years ago[clangd] Support multiline semantic tokens
Kadir Cetinkaya [Wed, 15 Jun 2022 13:44:09 +0000 (15:44 +0200)]
[clangd] Support multiline semantic tokens

Per LSP, multiline tokens should be handled as if they end at the end
of the line starting the token (there's also a capability to enable them, but
that's an adventure for a different day).

Fixes https://github.com/clangd/clangd/issues/1145

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

2 years ago[lldb] [test] Fix variable overwrite in non-stop fork tests
Michał Górny [Wed, 29 Jun 2022 11:33:43 +0000 (13:33 +0200)]
[lldb] [test] Fix variable overwrite in non-stop fork tests

Thanks to Pavel Labath for noticing the mistake in:
https://reviews.llvm.org/D128638#3618039

Sponsored by: The FreeBSD Foundation

2 years agoRevert clang-tidy fixes for readability-simplify-boolean-expr and add NOLINT
Arjun P [Wed, 29 Jun 2022 11:21:48 +0000 (12:21 +0100)]
Revert clang-tidy fixes for readability-simplify-boolean-expr and add NOLINT

The original code is more readable because the goal is to check if the given
value does *not* lie in the range. It is harder to understand this by
reading the rewritten code.

Reviewed By: mehdi_amini

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

2 years ago[IRBuilder] Migrate div/rem to use fold infrastructure
Nikita Popov [Wed, 29 Jun 2022 11:04:15 +0000 (13:04 +0200)]
[IRBuilder] Migrate div/rem to use fold infrastructure

Migrate udiv, sdiv, urem, and srem to use the FoldXYZ rather than
the CreateXYZ infrastructure.

2 years ago[analyzer] Fix BindingDecl evaluation for reference types
isuckatcs [Wed, 29 Jun 2022 10:50:24 +0000 (12:50 +0200)]
[analyzer] Fix BindingDecl evaluation for reference types

The case when the bound variable is reference type in a
BindingDecl wasn't handled, which lead to false positives.

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

2 years ago[AMDGPU] Remove FIXME that was resolved by D30212
Jay Foad [Tue, 28 Jun 2022 16:05:21 +0000 (17:05 +0100)]
[AMDGPU] Remove FIXME that was resolved by D30212

2 years ago[Presburger] Cheat around old versions of clang not doing NRVO when there's a derived...
Benjamin Kramer [Wed, 29 Jun 2022 10:32:32 +0000 (12:32 +0200)]
[Presburger] Cheat around old versions of clang not doing NRVO when there's a derived-to-base cast in the way

Should be NFC. We can just do the base conversion manually and avoid
warnings about it. Clang before Clang 13 didn't implement P1825 and
complains:

mlir/lib/Analysis/Presburger/IntegerRelation.cpp:226:10: warning: local variable 'result' will be copied
      despite being returned by name [-Wreturn-std-move]
  return result;
         ^~~~~~
mlir/lib/Analysis/Presburger/IntegerRelation.cpp:226:10: note: call 'std::move' explicitly to avoid copying
  return result;
         ^~~~~~
         std::move(result)

2 years ago[flang][NFC] Fix some typos
Valentin Clement [Wed, 29 Jun 2022 10:21:26 +0000 (03:21 -0700)]
[flang][NFC] Fix some typos

2 years ago[AMDGPU][GFX90a][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Mon, 27 Jun 2022 15:55:53 +0000 (18:55 +0300)]
[AMDGPU][GFX90a][DOC][NFC] Update assembler syntax description

Summary of changes:
- Update MUBUF lds syntax (see https://reviews.llvm.org/D124485).
- Update SMEM syntax (see https://reviews.llvm.org/D127314).
- Enable src0=literal for v_madak*, v_madmk* (see https://reviews.llvm.org/D111067).
- Correct src0 operands of v_accvgpr_write_b32.
- Correct description of s_getreg/s_setreg (add TBA/TMA).
- Remove SYSMSG_OP_HOST_TRAP_ACK message.
- Minor bug fixing and improvements.

2 years ago[SCEV] Construct SCEV iteratively.
Florian Hahn [Wed, 29 Jun 2022 10:29:31 +0000 (11:29 +0100)]
[SCEV] Construct SCEV iteratively.

This patch updates SCEV construction to work iteratively instead of recursively
in most cases. It resolves stack overflow issues when trying to construct SCEVs
for certain inputs, e.g. PR45201.

The basic approach is to to use a worklist to queue operands of V which
need to be created before V. To do so, the current patch adds a
getOperandsToCreate function which collects the operands SCEV
construction depends on for a given value. This is a slight duplication
with createSCEV.

At the moment, SCEVs for phis are still created recursively.

Fixes #32078, #42594, #44546, #49293, #49599,  #55333, #55511

Reviewed By: nikic

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

2 years ago[test][RISCV][Driver] Precommit tests for D128625
Anton Afanasyev [Sat, 25 Jun 2022 11:02:32 +0000 (14:02 +0300)]
[test][RISCV][Driver] Precommit tests for D128625

2 years ago[BasicAA] Add test coverage from D76194.
Florian Hahn [Wed, 29 Jun 2022 10:25:19 +0000 (11:25 +0100)]
[BasicAA] Add test coverage from D76194.

2 years ago[BasicAA] Convert test to use opaque pointers.
Florian Hahn [Wed, 29 Jun 2022 10:25:13 +0000 (11:25 +0100)]
[BasicAA] Convert test to use opaque pointers.

Using opaque pointers simplifies the tests quite a bit.

2 years agoRevert "Add default copy and move c'tor/assignment to PresburgerRelation."
Christian Sigg [Wed, 29 Jun 2022 10:24:28 +0000 (12:24 +0200)]
Revert "Add default copy and move c'tor/assignment to PresburgerRelation."

This reverts commit 2cd468ef1561e9f4c888e5dde821f86e427a75a1.

2 years agoStandardInstrumentation: print verifier output to errs
Nicolai Hähnle [Tue, 28 Jun 2022 17:14:09 +0000 (19:14 +0200)]
StandardInstrumentation: print verifier output to errs

Enabling the verifiers is not very helpful if their output is
suppressed beyond the fatal error.

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

2 years agoAdd default copy and move c'tor/assignment to PresburgerRelation.
Christian Sigg [Wed, 29 Jun 2022 08:40:34 +0000 (10:40 +0200)]
Add default copy and move c'tor/assignment to PresburgerRelation.

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

2 years ago[NFC] Switch FloatModeKind enum class to use bitmask enums
Jolanta Jensen [Wed, 15 Jun 2022 16:11:28 +0000 (17:11 +0100)]
[NFC] Switch FloatModeKind enum class to use bitmask enums

Using bitmask enums simplifies and clarifies the code.

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

2 years ago[SROA] Don't create constant expressions (NFC)
Nikita Popov [Wed, 29 Jun 2022 09:51:22 +0000 (11:51 +0200)]
[SROA] Don't create constant expressions (NFC)

Use IRBuilder instead, which will fold these. Just to clarify
that this does not actually create any udiv expression.

2 years ago[SCCP] Regenerate test checks (NFC)
Nikita Popov [Wed, 29 Jun 2022 09:24:16 +0000 (11:24 +0200)]
[SCCP] Regenerate test checks (NFC)

2 years ago[mlir][complex] Canonicalization for consecutive complex.neg
lewuathe [Wed, 29 Jun 2022 08:32:23 +0000 (10:32 +0200)]
[mlir][complex] Canonicalization for consecutive complex.neg

Consecutive complex.neg are redundant so that we can canonicalize them to the original operands.

Reviewed By: pifon2a

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

2 years ago[lldb] fix stepping through POSIX trampolines
Michael Daniels [Wed, 29 Jun 2022 09:00:45 +0000 (11:00 +0200)]
[lldb] fix stepping through POSIX trampolines

The DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan() function was
doing the symbol lookup using the demangled name. This stopped working
with https://reviews.llvm.org/D118814. To get things working again, just
use the mangled name for the lookup instead.

Reviewed By: labath

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

2 years ago[LLDB] Add PDB/calling-conventions.test for Arm/Windows
Muhammad Omair Javaid [Wed, 29 Jun 2022 08:56:00 +0000 (12:56 +0400)]
[LLDB] Add PDB/calling-conventions.test for Arm/Windows

This patch renames PDB/calling-conventions.test to calling-conventions-x86.test.
Also restrict it to run only for target-x86*.
This patch also adds a arm specific test PDB/calling-conventions-arm.test which
tests that x86 specifc calling convention decorators are ignored by Arm compiler.

Reviewed By: labath

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

2 years ago[LLDB] Add Arm64 CodeView to LLDB regnum mapping
Muhammad Omair Javaid [Wed, 29 Jun 2022 08:50:41 +0000 (12:50 +0400)]
[LLDB] Add Arm64 CodeView to LLDB regnum mapping

This patch writes a mapping structure for converting  CodeView Arm64 register numbers to LLDB Arm64 regnums.

This fixes various symbols and variable location test failures on AArch64/Windows.

Reviewed By: DavidSpickett

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

2 years ago[LLDB] Fix PDB/pointers.test for 32bit Arm/Windows
Muhammad Omair Javaid [Wed, 29 Jun 2022 08:34:56 +0000 (12:34 +0400)]
[LLDB] Fix PDB/pointers.test for 32bit Arm/Windows

PDB/pointers.test was orignally written for 32bit x86 keeping in mind
__cdecl and __stdcall calling conventions which does name mangling for
example like adding "_" underscore before function name.
This is only x86 specific but purpose of pointers.test is NOT to test
calling convention.
I am have made a few minor changes to this test which will make it pass
when run on Windows/Arm platform.

Reviewed By: mstorsjo

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

2 years ago[ConstExpr] Remove more leftovers of extractvalue expression (NFC)
Nikita Popov [Wed, 29 Jun 2022 08:42:46 +0000 (10:42 +0200)]
[ConstExpr] Remove more leftovers of extractvalue expression (NFC)

Remove some leftover bits of extractvalue handling after the
removal in D125795.

2 years ago[flang][test] Remove RUN COMMANDS/EXPECTED OUTPUT/INPUT markers from test/Driver
Fangrui Song [Wed, 29 Jun 2022 08:06:01 +0000 (01:06 -0700)]
[flang][test] Remove RUN COMMANDS/EXPECTED OUTPUT/INPUT markers from test/Driver

Uses of these markers are contrary to all other llvm-project subprojects
and carry no information for people who know the basics of a lit test.

I understand that there is an argument "this makes beginners get started
quickly" but I am unsure whether this is strong enough to deviate from
all other projects. https://llvm.org/docs/TestingGuide.html covers the
basics. Actually, some contributors were confused by the markers.

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

2 years ago[AsmPrinter] Further restrict expressions supported in global initializers
Nikita Popov [Thu, 16 Jun 2022 14:39:54 +0000 (16:39 +0200)]
[AsmPrinter] Further restrict expressions supported in global initializers

lowerConstant() currently accepts a number of constant expressions
which have corresponding MC expressions, but which cannot be
evaluated as a relocatable expression (unless the operands are
constant, in which case we'll just fold the expression to a constant).

The motivation here is to clarify which constant expressions are
really needed for https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179,
and in particular clarify that we do not need to support any
division expressions, which are particularly problematic.

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

2 years ago[TableGen] Add a knob for MCOperandInfo expansion in gen-instr-info
Amir Ayupov [Wed, 29 Jun 2022 07:59:01 +0000 (00:59 -0700)]
[TableGen] Add a knob for MCOperandInfo expansion in gen-instr-info

Control the MCOperandInfo expansion with `-instr-info-expand-mi-operand-info`.
For X86, this would make it possible to see memory operand type e.g.:
```
    /* MOV8rm */
    GR8, i8mem,
    /* MOV8rm_NOREX */
    GR8_NOREX, i8mem_NOREX,
```

The intended use is a follow-up diff D126116 (`getMemOperandSize`).

Reviewed By: skan

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

2 years ago[clang][flang] Disable defaulting to `-fpie` for LLVM Flang
Andrzej Warzynski [Wed, 22 Jun 2022 10:29:57 +0000 (10:29 +0000)]
[clang][flang] Disable defaulting to `-fpie` for LLVM Flang

In, https://reviews.llvm.org/D120305, CLANG_DEFAULT_PIE_ON_LINUX was set
to `On` by default. However, neither `-fpie` nor `-fpic` are currently
supported in LLVM Flang. Hence, in this patch the behaviour controlled
with CLANG_DEFAULT_PIE_ON_LINUX is refined not to apply to Flang.

Another way to look at this is that CLANG_DEFAULT_PIE_ON_LINUX is
currently affecting both Clang and Flang. IIUC, the intention for this
CMake variable has always been to only affect Clang. This patch makes
sure that that's the case.

Without this change, you might see errors like this on X86_64:
```
/usr/bin/ld: main.o: relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
```
I've not experienced any issues on AArch64. That's probably because on
AArch64 some object files happen to be position independent without
needing -fpie or -fpic.

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

2 years ago[ArgPromotion] Remove all the getters and ReplaceCallSite (NFC)
Pavel Samolysov [Tue, 28 Jun 2022 13:25:54 +0000 (16:25 +0300)]
[ArgPromotion] Remove all the getters and ReplaceCallSite (NFC)

AARGetter is an abstraction over a source of the `AAResults` introduced
to support the legacy pass manager as well as the modern one. Since the
Argument Promotion pass doesn't support the legacy pass manager anymore,
the abstraction is not required and `AAResults` may be used directly.

The instance of the `FunctionAnalysisManager` is passed through the
functions to get all the required analyses just wherever they are
required and do not use the awkward getter callbacks.

The `ReplaceCallSite` parameter was required for the legacy pass manager
only and isn't used anymore, so the parameter has been eliminated.

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

2 years ago[ArgPromotion] Move isDenselyPacked static member (NFC)
Pavel Samolysov [Wed, 18 May 2022 08:26:35 +0000 (11:26 +0300)]
[ArgPromotion] Move isDenselyPacked static member (NFC)

The `isDenselyPacked` static member of the `ArgumentPromotionPass` class
is not used in the class itself anymore. The single known user of the
function is in the `AttributorAttributes.cpp` file, so the function has
been moved into the file.

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

2 years agoRevert "[mlir][Presburger] Fix warning Wreturn-std-move (NFC)"
Adrian Kuegel [Wed, 29 Jun 2022 07:22:36 +0000 (09:22 +0200)]
Revert "[mlir][Presburger] Fix warning Wreturn-std-move (NFC)"

This reverts commit a4070a5e77283912eb29e79efd4fb872fdb9ec90.
It introduced another warning instead.

2 years ago[clang-format] Fix misplacement of `*` in declaration of pointer to struct
Huang Zhen-Hong [Wed, 29 Jun 2022 07:09:05 +0000 (15:09 +0800)]
[clang-format] Fix misplacement of `*` in declaration of pointer to struct

Fixes #55810

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

2 years ago[OpenMP] Implementing omp_get_device_num()
Jose M Monsalve Diaz [Wed, 22 Jun 2022 15:05:34 +0000 (10:05 -0500)]
[OpenMP] Implementing omp_get_device_num()

This patch implements omp_get_device_num() in the host and the device.

It uses the already existing getDeviceNum in the device config for the device.
And in the host it uses the omp_get_num_devices().

Two simple tests added

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

2 years ago[llvm-readobj][RISCV] Support dumping PT_RISCV_ATTRIBUTES
luxufan [Fri, 24 Jun 2022 05:18:19 +0000 (13:18 +0800)]
[llvm-readobj][RISCV] Support dumping PT_RISCV_ATTRIBUTES

This patch drops the prefix `PT_RISCV_` when dumping `PT_RISCV_ATTRIBUTES`.

GNU readelf dumps it as `RISCV_ATTRIBUT`. Because GNU readelf uses
something like `%-14.14s` so only the first 14 bytes are printed.

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

2 years ago[mlir][Presburger] Fix warning Wreturn-std-move (NFC)
Adrian Kuegel [Wed, 29 Jun 2022 07:10:20 +0000 (09:10 +0200)]
[mlir][Presburger] Fix warning Wreturn-std-move (NFC)

2 years ago[GuardWidening] Add tests showing incorrect behavior of GW.
Serguei Katkov [Wed, 29 Jun 2022 04:06:34 +0000 (11:06 +0700)]
[GuardWidening] Add tests showing incorrect behavior of GW.

The first test shows that combineRangeChecks may choose to keep only two poison conditions.
And we cannot do simple arithmetic or logical and in guard.
The second test shows that keeping two poison conditions in the widened guard may allow
execution of side-effect instruction even if just freeze these conditions.
The third test shows that even in simple test we can hoist a poison and even logical and does not help here.

Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D128779

2 years ago[libc++][format] Improve pointer formatters.
Mark de Wever [Tue, 28 Dec 2021 17:48:04 +0000 (18:48 +0100)]
[libc++][format] Improve pointer formatters.

This changes the implementation of the formatter. Instead of inheriting
from a specialized parser all formatters will use the same generic
parser. This reduces the binary size.

The new parser contains some additional fields only used in the chrono
formatting. Since this doesn't change the size of the parser the fields
are in the generic parser. The parser is designed to fit in 128-bit,
making it cheap to pass by value.

The new format function is a const member function. This isn't required
by the Standard yet, but it will be after LWG-3636 is accepted.
Additionally P2286 adds a formattable concept which requires the member
function to be const qualified in C++23. This paper is likely to be
accepted in the 2022 July plenary.

This is based on D125606. That commit did the groundwork and did similar
changes for the string formatters.

Depends on D128139.

Reviewed By: #libc, ldionne

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

2 years ago[MLIR][Math] Improve docs for round op (NFC)
lorenzo chelini [Mon, 27 Jun 2022 16:16:39 +0000 (18:16 +0200)]
[MLIR][Math] Improve docs for round op (NFC)

Reviewed By: antiagainst

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

2 years agoPass code-model through Module IR to [llc].
esmeyi [Wed, 29 Jun 2022 06:30:13 +0000 (02:30 -0400)]
Pass code-model through Module IR to [llc].

Currently, the code-model specified in IR can't be captured by [llc].
This patch fixes that.

Reviewed By: shchenz, MaskRay

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

2 years ago[libc++][format] Improve integral formatters.
Mark de Wever [Tue, 28 Dec 2021 17:48:04 +0000 (18:48 +0100)]
[libc++][format] Improve integral formatters.

This changes the implementation of the formatter. Instead of inheriting
from a specialized parser all formatters will use the same generic
parser. This reduces the binary size.

The new parser contains some additional fields only used in the chrono
formatting. Since this doesn't change the size of the parser the fields
are in the generic parser. The parser is designed to fit in 128-bit,
making it cheap to pass by value.

The new format function is a const member function. This isn't required
by the Standard yet, but it will be after LWG-3636 is accepted.
Additionally P2286 adds a formattable concept which requires the member
function to be const qualified in C++23. This paper is likely to be
accepted in the 2022 July plenary.

This is based on D125606. That commit did the groundwork and did similar
changes for the string formatters.

Depends on D125606

Reviewed By: #libc, ldionne

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

2 years ago[lldb] [test] Split TestGdbRemoteFork in two
Michał Górny [Wed, 29 Jun 2022 04:56:32 +0000 (06:56 +0200)]
[lldb] [test] Split TestGdbRemoteFork in two

Split the test that's gotten very long in two, in hope that it will
resolve the arm/aarch64 buildbot failures.  Even if it does not, it
could help pinpointing where the problem lies.

Sponsored by: The FreeBSD Foundation

2 years ago[C++20] [Module] Support reachable definition initially/partially
Chuanqi Xu [Wed, 29 Jun 2022 04:48:48 +0000 (12:48 +0800)]
[C++20] [Module] Support reachable definition initially/partially

This patch introduces a new kind of ModuleOwnershipKind as
ReachableWhenImported. This intended the status for reachable described
at: https://eel.is/c++draft/module.reach#3.

Note that this patch is not intended to support all semantics about
reachable semantics. For example, this patch didn't implement discarded
declarations in GMF. (https://eel.is/c++draft/module.global.frag#3).

This fixes: https://bugs.llvm.org/show_bug.cgi?id=52281 and
https://godbolt.org/z/81f3ocjfW.

Reviewed By: rsmith, iains

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

2 years agoRevert "[C++20] [Modules] Implement Reachable initiallly"
Chuanqi Xu [Wed, 29 Jun 2022 04:43:26 +0000 (12:43 +0800)]
Revert "[C++20] [Modules] Implement Reachable initiallly"

This reverts commit a223ba0a697c1598b434cf2495c9cd9ec5640fc7.

The previous commit don't contain additional information, which is bad.

2 years ago[C++20] [Modules] Implement Reachable initiallly
Chuanqi Xu [Mon, 21 Feb 2022 09:41:46 +0000 (17:41 +0800)]
[C++20] [Modules] Implement Reachable initiallly

2 years ago[NFC][OpenMP] Fix worksharing-loop
Peixin-Qiao [Wed, 29 Jun 2022 04:20:03 +0000 (12:20 +0800)]
[NFC][OpenMP] Fix worksharing-loop

1. Remove the redundant collapse clause in MLIR OpenMP worksharing-loop
   operation.
2. Fix several typos.
3. Refactor the chunk size type conversion since CreateSExtOrTrunc has
   both type check and type conversion.

Reviewed By: kiranchandramohan

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

2 years ago[XCOFF] change default program code csect alignment to 32
Chen Zheng [Wed, 29 Jun 2022 04:16:01 +0000 (04:16 +0000)]
[XCOFF] change default program code csect alignment to 32

This is the same with commercial XLC on AIX.

Reviewed By: Esme

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

2 years ago[XCOFF] make sure same number of paddings are added for DWARF sections
Chen Zheng [Wed, 29 Jun 2022 04:08:58 +0000 (04:08 +0000)]
[XCOFF] make sure same number of paddings are added for DWARF sections

We are going to change alignment for DWARF sections. This patch is to
fix functionality issue if the alignment is not the same with
DefaultSectionAlign defined in XCOFFObjectWriter.cpp.

Currently no test for this patch as for now alignment for DWARF sections
and other sections are always the same. This patch will be tested when
patch changing DWARF section is merged in.

Reviewed By: Esme

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

2 years ago[NFC][flang] Add the missed `constexpr`
Peixin-Qiao [Wed, 29 Jun 2022 04:07:29 +0000 (12:07 +0800)]
[NFC][flang] Add the missed `constexpr`

Reviewed By: kiranchandramohan

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

2 years ago[CoverageMapping] Remove dots from paths inside the profile
Petr Hosek [Tue, 22 Mar 2022 01:30:35 +0000 (18:30 -0700)]
[CoverageMapping] Remove dots from paths inside the profile

We already remove dots from collected paths and path mappings. This
makes it difficult to match paths inside the profile which contain
dots. For example, we would never match /path/to/../file.c because
the collected path is always be normalized to /path/file.c. This
change enables dot removal for paths inside the profile to address
the issue.

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

2 years ago[flang] Support check for BIND statement entity
Peixin-Qiao [Wed, 29 Jun 2022 03:25:19 +0000 (11:25 +0800)]
[flang] Support check for BIND statement entity

As Fortran 2018 8.6.4(1), the BIND statement specifies the BIND attribute
for a list of variables and common blocks.

Reviewed By: klausler

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

2 years ago[DirectX] Properly fix for MaybeAlign API removal
Chris Bieneman [Wed, 29 Jun 2022 02:53:54 +0000 (21:53 -0500)]
[DirectX] Properly fix for MaybeAlign API removal

My last attempt caused a test case failure. This resovles the issue.

2 years ago[X86][AMX] Split greedy RA for tile register
Luo, Yuanke [Sat, 25 Jun 2022 14:00:44 +0000 (22:00 +0800)]
[X86][AMX] Split greedy RA for tile register

When we fill the shape to tile configure memory, the shape is gotten
from AMX pseudo instruction. However the register for the shape may be
split or spilled by greedy RA. That cause we fill the shape to config
memory after ldtilecfg is executed, so that the shape configuration
would be wrong.
This patch is to split the tile register allocation from greedy register
allocation, so that after tile registers are allocated the shape
registers are still virtual register. The shape register only may be
redefined or multi-defined by phi elimination pass, two address pass.
That doesn't affect tile register configuration.

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

2 years agoRevert "[BOLT][AArch64] Handle gold linker veneers"
Rafael Auler [Wed, 29 Jun 2022 02:23:28 +0000 (19:23 -0700)]
Revert "[BOLT][AArch64] Handle gold linker veneers"

This reverts commit 425dda76e9fac93117289fd68a2abdfb1e4a0ba5.

This commit is currently causing BOLT to crash in one of our
binaries and needs a bit more checking to make sure it is safe
to land.

2 years ago[AArch64] Update test case.
Guozhi Wei [Wed, 29 Jun 2022 01:37:56 +0000 (01:37 +0000)]
[AArch64] Update test case.

Replace the new generated virtual register number with a macro to avoid
name mismatch due to different configuration of compiler.

2 years ago[DirectX] Fix broken build after API removal
Chris Bieneman [Wed, 29 Jun 2022 00:45:11 +0000 (19:45 -0500)]
[DirectX] Fix broken build after API removal

This removes the DirectX backend's usage of the MaybeAlign API removed
in 1baf1fc.

2 years ago[trace] Fix errors when handling command arguments
Walter Erquinigo [Wed, 29 Jun 2022 00:38:17 +0000 (17:38 -0700)]
[trace] Fix errors when handling command arguments

https://reviews.llvm.org/D128453 recently added some safety checks for
command arguments. Unfortunately, some few commands started failing due
to that, and this diff fixes it. But fortunately, the fix is trivial, which is
simply declaring the argument that these commands will receive.

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

2 years ago[RISCV] Fold (add X, [-4096, -2049]) or (add X, [2048,4096]) into load/store address...
Craig Topper [Tue, 28 Jun 2022 23:48:14 +0000 (16:48 -0700)]
[RISCV] Fold (add X, [-4096, -2049]) or (add X, [2048,4096]) into load/store address during isel.

Previously we iseled this to a pair of ADDIs and relied on a post
isel peephole to fold one of the ADDIs into the load/store. Now
we split the immediate in two parts the same way isel does and fold
one of the pieces. If the add has a non-memory use it will emit
two isels and larger one will CSE with the ADDI we created for the
the memory use.

Reviewed By: reames

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

2 years ago[trace] Improve the TraceCursor iteration API
Walter Erquinigo [Fri, 24 Jun 2022 18:19:09 +0000 (11:19 -0700)]
[trace] Improve the TraceCursor iteration API

The current way ot traversing the cursor is a bit uncommon and it can't handle empty traces, in fact, its invariant is that it shold always point to a valid item. This diff simplifies the cursor API and allows it to point to invalid items, thus being able to handle empty traces or to know it ran out of data.

- Removed all the granularity functionalities, because we are not actually making use of that. We can bring them back when they are actually needed.
- change the looping logic to the following:

```
  for (; cursor->HasValue(); cursor->Next()) {
     if (cursor->IsError()) {
       .. do something for error
       continue;
     }
     .. do something for instruction
  }

```

- added a HasValue method that can be used to identify if the cursor ran out of data, the trace is empty, or the user tried to move to an invalid position via SetId() or Seek()
- made several simplifications to severals parts of the code.

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

2 years ago[AMDGPU] Relax verification of soffset in scalar stores
Stanislav Mekhanoshin [Tue, 28 Jun 2022 22:06:41 +0000 (15:06 -0700)]
[AMDGPU] Relax verification of soffset in scalar stores

It must use m0 only on GFX8. Later chips can use ang SGPR.

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

2 years ago[Driver][ARM][AArch64] Use err_drv_unsupported_option_argument for -march=/-mcpu...
Fangrui Song [Tue, 28 Jun 2022 23:01:30 +0000 (16:01 -0700)]
[Driver][ARM][AArch64] Use err_drv_unsupported_option_argument for -march=/-mcpu=/-mtune= diagnostics

err_drv_clang_unsupported is for a Clang unsupported option (any value is rejected).
err_drv_unsupported_option_argument is for an unsupported value (other values may be supported).

2 years ago[RISCV] Rename getMin/MaxVLen to getArchMin/MaxVlen and make protected [nfc]
Philip Reames [Tue, 28 Jun 2022 22:54:34 +0000 (15:54 -0700)]
[RISCV] Rename getMin/MaxVLen to getArchMin/MaxVlen and make protected [nfc]

2 years ago[mlir] Add `enableSplitting` and `insertMarkerInOutput` options to `splitAndProcessBu...
River Riddle [Tue, 28 Jun 2022 21:50:26 +0000 (14:50 -0700)]
[mlir] Add `enableSplitting` and `insertMarkerInOutput` options to `splitAndProcessBuffer`

`enableSplitting` simply enables/disables whether we should split
or use the full buffer. `insertMarkerInOutput` toggles if split markers
should be inserted in between prcessed output chunks.

These options allow for merging the duplicate code paths we have
when splitting is optional.

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

2 years ago[RISCV] Refine known bits for READ_VLENB
Philip Reames [Tue, 28 Jun 2022 22:36:34 +0000 (15:36 -0700)]
[RISCV] Refine known bits for READ_VLENB

This implements known bits for READ_VALUE using any information known about minimum and maximum VLEN. There's an additional assumption that VLEN is a power of two.

The motivation here is mostly to remove the last use of getMinVLen, but while I was here, I decided to also fix the bug for VLEN < 128 and handle max from command line generically too.

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

2 years ago[lldb/Dataformatters] Adapt C++ std::string dataformatter for D128285
Med Ismail Bennani [Tue, 28 Jun 2022 01:28:30 +0000 (18:28 -0700)]
[lldb/Dataformatters] Adapt C++ std::string dataformatter for D128285

This patch changes the C++ `std::string` dataformatter to reflect
internal layout changes following D128285.

Now, in short-mode strings, in order to access the `__size_` and
`__is_long_` attributes, we need to access a packed anonymous struct,
which introduces another indirection.

We need to do the same in order to access the `__cap_` field for
long-mode strings.

This should fix the various test failures that are happening on
GreenDragon:

https://green.lab.llvm.org/green/job/lldb-cmake/44918/

rdar://96010248

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[OpenMP] Initial parsing and sema support for 'masked taskloop simd' construct
Fazlay Rabbi [Tue, 28 Jun 2022 21:35:43 +0000 (14:35 -0700)]
[OpenMP] Initial parsing and sema support for 'masked taskloop simd' construct

This patch gives basic parsing and semantic support for
"masked taskloop simd" construct introduced in OpenMP 5.1 (section 2.16.8)

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

2 years ago[OpenMP][NFC] Remove unused check lines in Clang/OpenMP tests
Johannes Doerfert [Mon, 27 Jun 2022 20:51:15 +0000 (15:51 -0500)]
[OpenMP][NFC] Remove unused check lines in Clang/OpenMP tests

The check lines are not referenced in RUN lines, hence useless.

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

2 years ago[UpdateTestChecks] Handle prefix reuse for appended check lines
Johannes Doerfert [Mon, 27 Jun 2022 22:55:00 +0000 (17:55 -0500)]
[UpdateTestChecks] Handle prefix reuse for appended check lines

When we appended check lines at the end we could not share prefixes
before. This patch should make it possible and allow us to reduce
some check line counts (especially for Clang/OpenMP tests).

See also: https://reviews.llvm.org/D128686

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

2 years agoRevert "Improve handling of static assert messages."
Corentin Jabot [Tue, 28 Jun 2022 22:03:23 +0000 (00:03 +0200)]
Revert "Improve handling of static assert messages."

This reverts commit 870b6d21839707a3e4c40a29b526995f065a220f.

This seems to break some libc++ tests, reverting while investigating

2 years ago[Sanitizers] Cleanup handling of stat64/statfs64
Mariusz Borsa [Tue, 7 Jun 2022 23:15:20 +0000 (16:15 -0700)]
[Sanitizers] Cleanup handling of stat64/statfs64

This is a follow up to <LLVM reviews>/D127343, which was reverted due to test failures.

There are differences in handling of stat64/statfs64 calls by sanitizers between Linux and macOS. Versions of macOS starting with 10.6 drop the stat64/statfs64 APIs completely, relying on the linker to redirect stat/statfs to the appropriate 64 bit versions. Emitting variables needed by sanitizers is thus controlled by convoluted sets of conditions, involving Linux, IOS, macOS and Android, sprinkled around files.

This change clarifies it a bit, allowing to specify presence/absence of stat64/statfs64 for each platform, in a single location.

Please note that I wasn't able to test this change on platforms other than macOS and Linux Fedora 34. The previous attempt has caused test failures but couldn't figure out the context. I have a vague suspicion that they were Android and perhaps Fuchsia builds - and some build involving ppc64le, I don't have hardware handy to attempt a test there. Tried to tighten the conditions this time to clearly separate macOS from Linux, so Linux builds should behave same (sanitizerwise) as before the change. Will add people who reported the tests failing before as reviewers, so they can provide context should the change cause the test failures again.

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

2 years ago[InstCombine] Fold strncmp of constant arrays and variable size
Martin Sebor [Tue, 28 Jun 2022 21:54:56 +0000 (15:54 -0600)]
[InstCombine] Fold strncmp of constant arrays and variable size

Extend the solution accepted in D127766 to strncmp and simplify
strncmp(A, B, N) calls with constant A and B and variable N to
the equivalent of

  N <= Pos ? 0 : (A < B ? -1 : B < A ? +1 : 0)

where Pos is the offset of either the first mismatch between A
and B or the terminating null character if both A and B are equal
strings.

Reviewed By: courbet

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

2 years ago[InstCombine] Look through more casts when folding memchr and memcmp
Martin Sebor [Tue, 28 Jun 2022 21:04:26 +0000 (15:04 -0600)]
[InstCombine] Look through more casts when folding memchr and memcmp

Enhance getConstantDataArrayInfo to let the memchr and memcmp library
call folders look through arbitrarily long sequences of bitcast and
GEP instructions.

Reviewed By: nikic

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

2 years agobuild_symbolizer: Set LLVM_DEFAULT_TARGET_TRIPLE in llvm builds
Matthias Braun [Tue, 28 Jun 2022 05:03:25 +0000 (22:03 -0700)]
build_symbolizer: Set LLVM_DEFAULT_TARGET_TRIPLE in llvm builds

Pass on the default target triple of the host clang to the LLVM builds
within the `build_symbolizer.sh` script.

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

2 years agoAvoid ar_to_bc.sh script in symbolizer build; add -ignore-non-bitcode flag to llvm...
Matthias Braun [Tue, 28 Jun 2022 04:38:45 +0000 (21:38 -0700)]
Avoid ar_to_bc.sh script in symbolizer build; add -ignore-non-bitcode flag to llvm-link

Remove the `ar_to_bc.sh` helper script in the compiler-rt symbolizer
build. Instead use `llvm-link` directly as D81109 introduced the
capability to read archives. I just needed to add a new flag
`-ignore-non-bitcode` to avoid `llvm-link` aborting when it found a
non-bitcode file in the archive.

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

2 years ago[MachineCombiner, AArch64] Add a new pattern A-(B+C) => (A-B)-C to reduce latency
Guozhi Wei [Tue, 28 Jun 2022 21:42:51 +0000 (21:42 +0000)]
[MachineCombiner, AArch64] Add a new pattern A-(B+C) => (A-B)-C to reduce latency

Add a new pattern A - (B + C) ==> (A - B) - C to give machine combiner a chance
to evaluate which instruction sequence has lower latency.

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

2 years ago[gn build] Port 77df3be0dee4
LLVM GN Syncbot [Tue, 28 Jun 2022 21:25:13 +0000 (21:25 +0000)]
[gn build] Port 77df3be0dee4

2 years ago[Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef.
Alexey Lapshin [Tue, 28 Jun 2022 16:52:12 +0000 (19:52 +0300)]
[Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef.

This review is extracted from D96035.

This patch adds possibility to keep not only DwarfStringPoolEntry, but also
pointer to it. The DwarfStringPoolEntryRef keeps reference to the string map entry.
String map keeps string data and corresponding DwarfStringPoolEntry
info. Not all string map entries may be included into the result,
and then not all string entries should have DwarfStringPoolEntry
info. Currently StringMap keeps DwarfStringPoolEntry for all entries.
It leads to extra memory usage. This patch allows to keep
DwarfStringPoolEntry info only for entries which really need it.

Reviewed By: JDevlieghere

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

2 years ago[libc] add integer writing to printf
Michael Jones [Fri, 10 Jun 2022 18:12:40 +0000 (11:12 -0700)]
[libc] add integer writing to printf

This patch adds %n to printf, as well as a compiler flag to disable it.
This is due to it having serious security issues when misused.

Reviewed By: lntue

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

2 years ago[RISCV] Pin two tests to fixed length vectorization to preserve test intent
Philip Reames [Tue, 28 Jun 2022 20:53:22 +0000 (13:53 -0700)]
[RISCV] Pin two tests to fixed length vectorization to preserve test intent

2 years ago[SLP]Fix PR56251: Do not remove the reordering from the root node, being used as...
Alexey Bataev [Mon, 27 Jun 2022 20:20:50 +0000 (13:20 -0700)]
[SLP]Fix PR56251: Do not remove the reordering from the root node, being used as an operand.

If the root order itself does not require reordering, we can just
remove its reorder mask safely (e.g., if the root node is a vector of
phis). But if this node is used as an operand in the graph, we cannot
delete the reordering, need to keep it. Otherwise the graph nodes are
not synchronized with the operands. It may cause an extra gather
instruction(s) or a compiler crash.
Also, need to be very careful when selecting the gather nodes for
reordering since there might several gather nodes with the same scalars
and we can try to reorder just the same node many times instead of
different nodes.

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

2 years ago[flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls.
Slava Zakharin [Wed, 22 Jun 2022 21:41:02 +0000 (14:41 -0700)]
[flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls.

Added new -lower-math-early option that defaults to 'true' that matches
the current math lowering scheme. If set to 'false', the intrinsic math
operations will be lowered to MLIR operations, which should potentially
enable more MLIR optimizations, or libm calls, if there is no corresponding
MLIR operation exists or if "precise" mode is requested.
The generated math MLIR operations are then converted to LLVM dialect
during codegen phase.

The -lower-math-early option is not exposed to users currently. I plan to
get rid of the "early" lowering completely, when "late" lowering
is robust enough to support all math intrinsics that are currently
supported via pgmath. So "late" mode will become default and -lower-math-early
option will not be needed. This will effectively eliminate the mandatory
dependency on pgmath in Fortran lowering, but this is WIP.

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

2 years agoImprove handling of static assert messages.
Corentin Jabot [Fri, 20 Aug 2021 15:52:28 +0000 (17:52 +0200)]
Improve handling of static assert messages.

Instead of dumping the string literal (which
quotes it and escape every non-ascii symbol),
we can use the content of the string when it is a
8 byte string.

Wide, UTF-8/UTF-16/32 strings are still completely
escaped, until we clarify how these entities should
behave (cf https://wg21.link/p2361).

`FormatDiagnostic` is modified to escape
non printable characters and invalid UTF-8.

This ensures that unicode characters, spaces and new
lines are properly rendered in static messages.
This make clang more consistent with other implementation
and fixes this tweet
https://twitter.com/jfbastien/status/1298307325443231744 :)

Of note, `PaddingChecker` did print out new lines that were
later removed by the diagnostic printing code.
To be consistent with its tests, the new lines are removed
from the diagnostic.

Unicode tables updated to both use the Unicode definitions
and the Unicode 14.0 data.

U+00AD SOFT HYPHEN is still considered a print character
to match existing practices in terminals, in addition of
being considered a formatting character as per Unicode.

Reviewed By: aaron.ballman, #clang-language-wg

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

2 years ago[mlir] Update flipped accessors (NFC)
Jacques Pienaar [Tue, 28 Jun 2022 20:11:25 +0000 (13:11 -0700)]
[mlir] Update flipped accessors (NFC)

Follow up with memref flipped and flipping any intermediate changes
made.

2 years agoApply clang-tidy fixes for performance-unnecessary-value-param in VectorDistribute...
Mehdi Amini [Sun, 12 Jun 2022 18:05:22 +0000 (18:05 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param in VectorDistribute.cpp (NFC)

2 years agoApply clang-tidy fixes for readability-simplify-boolean-expr in SPIRVOps.cpp (NFC)
Mehdi Amini [Sun, 12 Jun 2022 17:56:43 +0000 (17:56 +0000)]
Apply clang-tidy fixes for readability-simplify-boolean-expr in SPIRVOps.cpp (NFC)

2 years ago[lldb] [llgs] Fix premature server exit if multiprocess+nonstop
Michał Górny [Mon, 27 Jun 2022 12:22:38 +0000 (14:22 +0200)]
[lldb] [llgs] Fix premature server exit if multiprocess+nonstop

Fix lldb-server in the non-stop + multiprocess mode to exit on vStopped
only if all processes have exited, rather than when the first one exits.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D128639

2 years ago[lldb] [llgs] Add base nonstop fork/vfork tests
Michał Górny [Wed, 22 Jun 2022 18:04:08 +0000 (20:04 +0200)]
[lldb] [llgs] Add base nonstop fork/vfork tests

Extend the most of baseline fork tests to run in nonstop mode as well.
For more cases, we're just testing one example scenario to save time.
This patch does not cover tests that rely on correct exit handling,
as fixing that is addressed in a followup patch.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D128638

2 years ago[lldb] Add a NativeProcessProtocol::Threads() iterable
Michał Górny [Tue, 28 Jun 2022 06:24:24 +0000 (08:24 +0200)]
[lldb] Add a NativeProcessProtocol::Threads() iterable

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D128698

2 years ago[libc++] Fix signature of main() in tests
Louis Dionne [Tue, 28 Jun 2022 19:36:52 +0000 (15:36 -0400)]
[libc++] Fix signature of main() in tests

Otherwise, this breaks freestanding builds, where `main()` isn't mangled
specially and we need to assume that we have a `int main(int, char**)`
entry point in each test for things to work.

2 years ago[MLIR][Presburger] subtract: support non-div locals
Arjun P [Tue, 28 Jun 2022 19:35:05 +0000 (20:35 +0100)]
[MLIR][Presburger] subtract: support non-div locals

Also added test cases. Also extend support for `computeReprWithOnlyDivLocals` from `IntegerPolyhedron` to `IntegerRelation` and `PresburgerRelation`.

Depends on D128736.

Reviewed By: Groverkss

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

2 years ago[OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work
Shilei Tian [Tue, 28 Jun 2022 19:31:41 +0000 (15:31 -0400)]
[OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work

This patch fixes the issue that P2P memcpy doesn't work. The root cause is we didn't set current context when calling the API function. In addition, a matrix to track the states of each pair of devices is also added such that we only need to query and configure the device once.

Reviewed By: jdoerfert

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

2 years ago[MLIR][Presburger] subtract: fix support for divs defined by equalities
Arjun P [Tue, 28 Jun 2022 19:23:39 +0000 (20:23 +0100)]
[MLIR][Presburger] subtract: fix support for divs defined by equalities

Also added test cases to test this. Both IntegerRelation::addLocalFloorDiv and the fixed implementation of subtraction need to compute division inequalities from dividend and divisor, so this also adds helper util functions to avoid duplicating this logic.

Reviewed By: Groverkss

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

2 years agoRevert "[pseudo] Add error-recovery framework & brace-based recovery"
Sam McCall [Tue, 28 Jun 2022 19:09:15 +0000 (21:09 +0200)]
Revert "[pseudo] Add error-recovery framework & brace-based recovery"

This reverts commit a0f4c10ae227a62c2a63611e64eba83f0ff0f577.
This commit hadn't been reviewed yet, and was unintentionally included
on another branch.

2 years ago[NFC][HWASan] Refactor hwasan pass
Leonard Chan [Tue, 28 Jun 2022 19:08:12 +0000 (12:08 -0700)]
[NFC][HWASan] Refactor hwasan pass

This moves some code for getting PC and SP into their own functions. Since SP
is also retrieved in the prologue and getting the stack tag, we can cache the
SP if we get it once in the prologue. This caching will really only be relevant
in D128387 where StackBaseTag may not be set in the prologue if __hwasan_tls
is not used.

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

2 years ago[pseudo] Move ellipsis into initializer-list-item. NFC
Sam McCall [Tue, 28 Jun 2022 19:08:21 +0000 (21:08 +0200)]
[pseudo] Move ellipsis into initializer-list-item. NFC

This makes the list formation a bit simpler.

2 years ago[pseudo] Add error-recovery framework & brace-based recovery
Sam McCall [Wed, 8 Jun 2022 21:27:23 +0000 (23:27 +0200)]
[pseudo] Add error-recovery framework & brace-based recovery

The idea is:
 - a parse failure is detected when all heads die when trying to shift
   the next token
 - we can recover by choosing a nonterminal we're partway through parsing,
   and determining where it ends through nonlocal means (e.g. matching brackets)
 - we can find candidates by walking up the stack from the (ex-)heads
 - the token range is defined using heuristics attached to grammar rules
 - the unparsed region is represented in the forest by an Opaque node

This patch has the core GLR functionality.
It does not allow recovery heuristics to be attached as extensions to
the grammar, but rather infers a brace-based heuristic.

Expected followups:
 - make recovery heuristics grammar extensions (depends on D127448)
 - add recover to our grammar for bracketed constructs and sequence nodes
 - change the structure of our augmented `_ := start` rules to eliminate
   some special-cases in glrParse.
 - (if I can work out how): avoid some spurious recovery cases described
   in comments
 - grammar changes to eliminate the hard distinction between init-list
   and designated-init-list shown in the recovery-init-list.cpp testcase

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

2 years ago[libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal.
Konstantin Varlamov [Tue, 28 Jun 2022 18:59:59 +0000 (11:59 -0700)]
[libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal.

- P1252 ("Ranges Design Cleanup") -- deprecate
  `move_iterator::operator->` starting from C++20; add range comparisons
  to the `<functional>` synopsis. This restores
  `move_iterator::operator->` that was incorrectly deleted in D117656;
  it's still defined in the latest draft, see
  http://eel.is/c++draft/depr.move.iter.elem. Note that changes to
  `*_result` types from 6.1 in the paper are no longer relevant now that
  these types are aliases;
- P2106 ("Alternative wording for GB315 and GB316") -- add a few
  `*_result` types to the synopsis in `<algorithm>` (some algorithms are
  not implemented yet and thus some of the proposal still cannot be
  marked as done);

Also mark already done issues as done (or as nothing to do):
- P2091 ("Fixing Issues With Range Access CPOs") was already implemented
  (this patch adds tests for some ill-formed cases);
- LWG 3247 ("`ranges::iter_move` should perform ADL-only lookup of
  `iter_move`") was already implemented;
- LWG 3300 ("Non-array ssize overload is underconstrained") doesn't
  affect the implementation;
- LWG 3335 ("Resolve C++20 NB comments US 273 and GB 274") was already
  implemented;
- LWG 3355 ("The memory algorithms should support move-only input
  iterators introduced by P1207") was already implemented (except for
  testing).

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

2 years agoTestIgnoredExceptions.py needs support from debugserver, so it
Jim Ingham [Tue, 28 Jun 2022 18:48:28 +0000 (11:48 -0700)]
TestIgnoredExceptions.py needs support from debugserver, so it
needs to be marked skip if out of tree debugserver.

2 years ago[RISCV] Teach RISCVMergeBaseOffset to handle read-modify-write of a global.
Craig Topper [Tue, 28 Jun 2022 18:34:39 +0000 (11:34 -0700)]
[RISCV] Teach RISCVMergeBaseOffset to handle read-modify-write of a global.

The pass was previously limited to LUI+ADDI being used by a single
instruction.

This patch allows the pass to optimize multiple memory operations
that use the same offset. Each of them will receive a separate %lo
relocation. My main motivation is to handle a read-modify-write
where we have a load and store to the same address, but I didn't
restrict it to that case.

Reviewed By: asb

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

2 years ago[MLIR][Affine][NFC] Fix affine utlities docs using "identifiers" instead of "variables"
Groverkss [Tue, 28 Jun 2022 18:33:58 +0000 (19:33 +0100)]
[MLIR][Affine][NFC] Fix affine utlities docs using "identifiers" instead of "variables"