platform/upstream/llvm.git
19 months ago[NFC] Refine tests by adding `:` to checks
Mariya Podchishchaeva [Fri, 3 Mar 2023 10:02:22 +0000 (05:02 -0500)]
[NFC] Refine tests by adding `:` to checks

The tests can fail if working directory where the tests were launched
has a `error` substring in its path.

Reviewed By: jhenderson, foad

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

19 months agoFix crash in ConvertVectorToLLVM.cpp pattern
Mehdi Amini [Fri, 3 Mar 2023 10:14:17 +0000 (11:14 +0100)]
Fix crash in ConvertVectorToLLVM.cpp pattern

Fixes #61094

19 months agoRecommit [C++20] [Modules] Trying to compare the trailing require clause from the...
Chuanqi Xu [Fri, 3 Mar 2023 09:27:37 +0000 (17:27 +0800)]
Recommit [C++20] [Modules] Trying to compare the trailing require clause from the primary template function

Close https://github.com/llvm/llvm-project/issues/60890.

For the following example:

```
export module a;

export template<typename T>
struct a {
friend void aa(a) requires(true) {
}
};
```

```
export module b;

import a;

struct b {
a<int> m;
};
```

```
export module c;

import a;

struct c {
void f() const {
aa(a<int>());
}
};
```

```
import a;
import b;
import c;

void d() {
aa(a<int>());
}
```

The current clang will reject this incorrectly. The reason is that the
require clause  will be replaced with the evaluated version
(https://github.com/llvm/llvm-project/blob/efae3174f09560353fb0f3d528bcbffe060d5438/clang/lib/Sema/SemaConcept.cpp#L664-L665).
In module 'b', the friend function is instantiated but not used so the
require clause of the friend function is `(true)`. However, in module
'c', the friend function is used so the require clause is `true`. So
deserializer classify these two function to two different functions
instead of one. Then here is the bug report.

The proposed solution is to try to compare the trailing require clause
of the primary template when performing ODR checking.

Reviewed By: erichkeane

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

19 months ago[libcxx] Temporarily skip Arm configs
David Spickett [Tue, 31 May 2022 10:10:12 +0000 (10:10 +0000)]
[libcxx] Temporarily skip Arm configs

The machine hosting these agents will be down
for maintenance today.

We (Linaro) will remove this once the agents are back online.

19 months agoRevert "Add the ability to segment GSYM files."
Douglas Yung [Fri, 3 Mar 2023 08:25:06 +0000 (00:25 -0800)]
Revert "Add the ability to segment GSYM files."

This reverts commit fe758254181a824d73ad960b651b42f671f8936b.

This change was causing several buildbot failures:
- https://lab.llvm.org/buildbot/#/builders/38/builds/10105
- https://lab.llvm.org/buildbot/#/builders/192/builds/562
- https://lab.llvm.org/buildbot/#/builders/109/builds/58893
- https://lab.llvm.org/buildbot/#/builders/16/builds/44360
- https://lab.llvm.org/buildbot/#/builders/247/builds/2095
- https://lab.llvm.org/buildbot/#/builders/196/builds/27236
- https://lab.llvm.org/buildbot/#/builders/54/builds/3714

19 months ago[clang][ASTImporter] Import TemplateName correctly
Balázs Kéri [Fri, 3 Mar 2023 07:46:06 +0000 (08:46 +0100)]
[clang][ASTImporter] Import TemplateName correctly

This is a fix for a problem when multiple template
specializations are created by ASTImporter for the
same specialization. The problem happens if a
TemplateName is imported that points to a template
delcaration (for a template template argument)
(specialization) that has multiple instances in the
declaration chain. If two TemplateName objects contain
different pointers to a template specialization,
these TemplateName objects will have different checksum
even if they point into the same declaration chain.
The problem is fixed if the canonical declaration is used.

Reviewed By: vabridgers, donat.nagy

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

19 months ago[clang][RISCV] Enable -fasynchronous-unwind-tables by default on Linux
Kito Cheng [Fri, 3 Mar 2023 07:32:44 +0000 (15:32 +0800)]
[clang][RISCV] Enable -fasynchronous-unwind-tables by default on Linux

This could improve user experience for stack unwinding, and also this is
enabled by default by X86 and AArch64 and RISC-V GCC.

Reviewed By: luismarques, MaskRay

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

19 months ago[CodeGen] guarantee templated static variables are initialized in the reverse instant...
Yuanfang Chen [Thu, 9 Jun 2022 19:48:23 +0000 (12:48 -0700)]
[CodeGen] guarantee templated static variables are initialized in the reverse instantiation order

Based on Richard's suggestion in D126341:
`If we can actually describe a rule that we provide for initialization
order of instantiated variables, and we can easily implement that rule
and be confident we won't want to substantially weaken it later, and we
can thereby assure our users that we will satisfy that rule, then I
think that could be interesting, but anything less than that doesn't
seem worthwhile to me.`

I'm giving it try here. IMHO the implementation is pretty simple and
does not change behavior for unrelated constructs like the timing when
instantiated variables are passed to CodeGen.

This is based on the same ordering guarantee needed for inline variables D127233.
To provide this guarantee, we also need to
emit DeferredDeclsToEmit in the DFS order. https://github.com/llvm/llvm-project/commit/e5df59ff78faebd897e81907606ce6074aac0df6
originally supported this but it is not exactly DFS order for cases like
the one in cwg362. For the example of Fib<5>, it triggers the instantiation
of Fib<4> and Fib<3>. However, due to the way GlobalEagerInstantiationScope
is implemented, Fib<4> does not actually trigger Fib<3> instantiation
since it is already triggered by Fib<5>. This breaks the guarantee.

This patch makes sure DeferredDeclsToEmit is emitted in DFS order by moving
DeferredDeclsToEmit storage from the call stack to an explicit stack-like
data structure. Then the DFS order could be enforced.

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

19 months ago[TypePromotion] Deference pointer before printing it in a debug message.
Craig Topper [Fri, 3 Mar 2023 07:22:56 +0000 (23:22 -0800)]
[TypePromotion] Deference pointer before printing it in a debug message.

Without deferencing it just prints the value of the pointer which
isn't meaningful. Dereferencing prints the operand.

19 months ago[libc] Make errno an entrypoint.
Siva Chandra Reddy [Thu, 2 Mar 2023 05:53:38 +0000 (05:53 +0000)]
[libc] Make errno an entrypoint.

The entrypoint has been added to the various entrypoint lists. The libc
code style doc has been updated with information on how errno should be
set from the libc runtime code.

Reviewed By: lntue

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

19 months ago[ADCE] Only remove debug intrinsics if non debug instructions are removed
Mikael Holmen [Thu, 2 Mar 2023 05:16:41 +0000 (06:16 +0100)]
[ADCE] Only remove debug intrinsics if non debug instructions are removed

We now limit ADCE to only remove debug intrinsics if it does something else
that would invalidate cached analyses anyway.
As we've seen in
 https://github.com/llvm/llvm-project/issues/58285
throwing away cached analysis info when only debug instructions are removed
can lead to different code when debug info is present or not present.

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

19 months ago[C++20] [Modules] Deprecate to load C++20 Modules eagerly
Chuanqi Xu [Fri, 24 Feb 2023 08:41:52 +0000 (16:41 +0800)]
[C++20] [Modules] Deprecate to load C++20 Modules eagerly

Close https://github.com/llvm/llvm-project/issues/60824

The form -fmodule-file=<path-to-BMI> will load modules eagerly and the
form -fmodule-file=<module-name>=<path-to-BMI> will load modules lazily.
The inconsistency adds many additional burdens to the implementations.
And the inconsistency looks not helpful and necessary neither. So I want
to deprecate the form -fmodule-file=<path-to-BMI> for named modules.
This is pretty helpful for us (the developers).

Does this change make any regression from the perspective of the users?

To be honest, yes. But I think such regression is acceptable. Here is
the example:

```
// M.cppm
export module M;
export int m = 5;

// N.cpp
// import M; // woops, we forgot to import M.
int n = m;
```

In the original version, the compiler can diagnose the users to import
`M` since the compiler have already imported M. But in the later style,
the compiler can only say "unknown identifier `m`".

But I think such regression doesn't make a deal since it only works if
the user put `-fmodule-file=M.pcm` in the command line. But how can the
user put `-fmodule-file=M.pcm` in the command line without `import M;`?
Especially currently such options are generated by build systems. And
the build systems will only generate the command line from the source
file.

So I think this change is pretty pretty helpful for developers and
almost innocent for users and we should accept this one.

I'll add the release notes and edit the document after we land this.

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

19 months agoAdd the ability to segment GSYM files.
Greg Clayton [Thu, 9 Feb 2023 18:16:34 +0000 (10:16 -0800)]
Add the ability to segment GSYM files.

Some workflows can generate large GSYM files and sharding GSYM files into segments can help some performant workflows that can take advantage of smaller GSYM files. This patch add a new --segment-size option to llvm-gsymutil. This option can specify a rough size in bytes of how large each segment should be.

Segmented GSYM files contain only the strings and files that are needed for the FunctionInfo objects that are added to each shard. The output file path gets the first address of the first contained function info appended as a suffix to the filename. If a base address of an image is set in the GsymCreator, then all segments will use this same base address which allows lookups for symbolication to happen correctly when the image has been slid in memory.

Code has been addeed to refactor and re-use methods within the GsymCreator to allow for segments to be created easily and tested.

Example of segmenting GSYM files:

$ llvm-gsymutil --convert llvm-gsymutil.dSYM -o llvm-gsymutil.gsym --segment-size 10485760
$ ls -l llvm-gsymutil.gsym-*
-rw-r--r--  1 gclayton  staff  10485839 Feb  9 10:45 llvm-gsymutil.gsym-0x1000030c0
-rw-r--r--  1 gclayton  staff  10485765 Feb  9 10:45 llvm-gsymutil.gsym-0x100668888
-rw-r--r--  1 gclayton  staff  10485881 Feb  9 10:45 llvm-gsymutil.gsym-0x100c948b8
-rw-r--r--  1 gclayton  staff  10485954 Feb  9 10:45 llvm-gsymutil.gsym-0x101659e70
-rw-r--r--  1 gclayton  staff  10485792 Feb  9 10:45 llvm-gsymutil.gsym-0x1022b1dc0
-rw-r--r--  1 gclayton  staff  10485889 Feb  9 10:45 llvm-gsymutil.gsym-0x102a18b10
-rw-r--r--  1 gclayton  staff  10485893 Feb  9 10:45 llvm-gsymutil.gsym-0x1030b05d0
-rw-r--r--  1 gclayton  staff  10485802 Feb  9 10:45 llvm-gsymutil.gsym-0x1037caaac
-rw-r--r--  1 gclayton  staff  10485781 Feb  9 10:45 llvm-gsymutil.gsym-0x103e767a0
-rw-r--r--  1 gclayton  staff  10485832 Feb  9 10:45 llvm-gsymutil.gsym-0x10452d0d4
-rw-r--r--  1 gclayton  staff  10485782 Feb  9 10:45 llvm-gsymutil.gsym-0x104b93310
-rw-r--r--  1 gclayton  staff   6255785 Feb  9 10:45 llvm-gsymutil.gsym-0x10526bf34

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

19 months ago[PowerPC][NFC] cleanup isEligibleForTCO
Ting Wang [Fri, 3 Mar 2023 04:04:19 +0000 (23:04 -0500)]
[PowerPC][NFC] cleanup isEligibleForTCO

The input parameter IsByValArg to isEligibleForTCO() is false in all
cases, so it is considered redundant and should be removed.

Reviewed By: shchenz

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

19 months ago[C++20] [Modules] Make TheImplicitGlobalModuleFragment and TheExportedImplicitGlobalM...
Chuanqi Xu [Fri, 3 Mar 2023 03:11:31 +0000 (11:11 +0800)]
[C++20] [Modules] Make TheImplicitGlobalModuleFragment and TheExportedImplicitGlobalModuleFragment to be useable modules

The unexported language linkage become unvisible to the current module
unit after the previous commit bf52ead24ca4. This patch fixes the issue.

19 months ago[C++20] [Modules] Support to export declarations in language linkage
Chuanqi Xu [Fri, 3 Mar 2023 02:31:48 +0000 (10:31 +0800)]
[C++20] [Modules] Support to export declarations in language linkage

Close https://github.com/llvm/llvm-project/issues/60405

See the discussion in the above link for the background.

What the patch does:
- Rename `Module::ModuleKind::GlobalModuleFragment` to
  `Module::ModuleKind::ExplicitGlobalModuleFragment`.
- Add another module kind `ImplicitGlobalModuleFragment` to
  `ModuleKind`.
- Create an implicit global module fragment for the language linkage
  declarations inside a module purview.
    - If the language linkage lives inside the scope of an export decl,
      the created modules is marked as exported to outer modules.
- In fact, Sema will only create at most 2 implicit global module
  fragments to avoid creating a lot of unnecessary modules in the edging
case.

Reviewed By: iains

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

19 months ago[libc++] Temporarily not use compiler intrinsics for some type traits in Objective...
Konstantin Varlamov [Fri, 3 Mar 2023 01:35:03 +0000 (17:35 -0800)]
[libc++] Temporarily not use compiler intrinsics for some type traits in Objective-C++ mode.

Currently, there are bugs in Clang's intrinsics for type traits when
handling Objective-C++ `id` (e.g. in `add_pointer`). As a temporary
workaround, don't use these intrinsics in the Objective-C++ mode.

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

19 months ago[NFC] Properly handle optional minor value for ArchInfo::Version
Zixu Wang [Fri, 3 Mar 2023 00:23:57 +0000 (16:23 -0800)]
[NFC] Properly handle optional minor value for ArchInfo::Version

Use `value_or` instead of `value` for checking minor versions in
`ArchInfo::implies`.

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

19 months agoThis check-in makes the following improvements to the OpenMP Windows build:
Vadim Paretsky (Intel Americas Inc) [Thu, 2 Mar 2023 23:46:13 +0000 (15:46 -0800)]
This check-in makes the following improvements to the OpenMP Windows build:

Only generate the second def file when necessary (native Windows import
library builds).
Properly clean up .def file artifacts.
Reduce the re-generated import library build artifacts to the minimum.
Refactor the import library related portions of the script for clarity.

Tested with MSVC and MinWG/gcc12.0

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

19 months agoRevert "[WebAssembly] Implement build-id feature"
Derek Schuff [Thu, 2 Mar 2023 23:28:56 +0000 (15:28 -0800)]
Revert "[WebAssembly] Implement build-id feature"

This reverts commit 41e31466af6a7feab82742bb01af43f4f3ae4ede
due to a build failure on Windows.

19 months ago[flang] Warn about inconsistent implicit interfaces
Peter Klausler [Fri, 17 Feb 2023 22:57:52 +0000 (14:57 -0800)]
[flang] Warn about inconsistent implicit interfaces

When a global procedure has no explicit interface, emit warnings
when its references are inconsistent implicit procedure interfaces.

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

19 months ago[llvm] Add missing header guards in LogicCombine.h and LogicalExpr.h
Alex Langford [Thu, 2 Mar 2023 23:12:23 +0000 (15:12 -0800)]
[llvm] Add missing header guards in LogicCombine.h and LogicalExpr.h

These files were added in 97dcbea63e11d566cff0cd3a758cf1114cf1f633 but
it looks like they are missing header guards. This breaks module builds.

19 months ago[SelectionDAG] Fix missing lambda capture
Marco Elver [Thu, 2 Mar 2023 22:45:42 +0000 (23:45 +0100)]
[SelectionDAG] Fix missing lambda capture

Move MaxDepth into the lambda, since it is not needed outside. This
fixes some compilers that complain about missing capture:

  error C3493: 'MaxDepth' cannot be implicitly captured because no
  default capture mode has been specified

Fixes: f693932fbea7 ("[SelectionDAG] Transitively copy NodeExtraInfo on RAUW")

19 months ago[GISel][CSE][NFC]: Handle mutual recursion when inserting node
Aditya Nandakumar [Thu, 2 Mar 2023 22:06:29 +0000 (14:06 -0800)]
[GISel][CSE][NFC]: Handle mutual recursion when inserting node

GISel's CSE mechanism lazily inserts instructions into the CSE List
to improve on efficiency as well as efficacy of CSE
(for allowing partially built instructions to be fully built).

There's unfortunately a mutual recursion via
 `handleRecordedInsts -> handleRecordedInst -> insertNode-> handleRecordedInsts`.

So this change simply records that we're already draining this list so we can just bail out on the recursion.

No changes to codegen are expected as we're still draining/handling the temporary
list via pop_back and we should get the same sequence of instructions
whether we call pop_back in a loop at the top level or recursive.

https://reviews.llvm.org/D145006

reviewed by: dsanders

19 months ago[libc][NFC] Switch use of errno in src/time and test/src/time to libc_errno.
Raman Tenneti [Thu, 2 Mar 2023 22:24:42 +0000 (14:24 -0800)]
[libc][NFC] Switch use of errno in src/time and test/src/time to libc_errno.

Switch use of errno in src/time and test/src/time to libc_errno.

Reviewed By: sivachandra

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

19 months agoRevert "Add SBValue::GetValueAsAddress API for removing non-addressing metadata"
Jason Molenda [Thu, 2 Mar 2023 22:36:37 +0000 (14:36 -0800)]
Revert "Add SBValue::GetValueAsAddress API for removing non-addressing metadata"

Revert while I investigate two CI bot failures;
the more important is the lldb-arm-ubuntu where
the FixAddress is removing the 0th bit so we're
adding the `actual=` decorator on a string pointer,

```
Got output:
(char *) strptr = 0x00400817 (actual=0x400816) ptr = [{ },{H}]
```

in TestDataFormatterSmartArray.py line 229.

This reverts commit 4d635be2dbadc77522eddc9668697385a3b9f8b4.

19 months ago[ASAN] Autogen masked load/store test coverage [nfc]
Philip Reames [Thu, 2 Mar 2023 22:16:19 +0000 (14:16 -0800)]
[ASAN] Autogen masked load/store test coverage [nfc]

I also removed two runlines which added no additional coverage.  No test in the file has both loads and stores, thus the two configurations duplicate the disabled configuration.

19 months ago[WebAssembly] Implement build-id feature
Derek Schuff [Wed, 4 Aug 2021 21:05:40 +0000 (14:05 -0700)]
[WebAssembly] Implement build-id feature

Implement the --build-id flag similarly to ELF, and generate a build_id
section according to the WebAssembly tool convention specified in
https://github.com/WebAssembly/tool-conventions/pull/183

The default style ("fast" aka "tree") hashes the contents of the output
and (unlike ELF) generates a v5 UUID based on the hash (using a random
namespace).
It also supports generating a random v4 UUID, a sha1 hash,
and a user-specified string (as ELF does).

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

19 months ago[AArch64] Fix crash in LowerBUILD_VECTOR trying to create invalid EXTRACT_SUBVECTOR.
Amara Emerson [Thu, 2 Mar 2023 21:49:00 +0000 (13:49 -0800)]
[AArch64] Fix crash in LowerBUILD_VECTOR trying to create invalid EXTRACT_SUBVECTOR.

rdar://106096671

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

19 months ago[SelectionDAG] Transitively copy NodeExtraInfo on RAUW
Marco Elver [Mon, 27 Feb 2023 11:05:02 +0000 (12:05 +0100)]
[SelectionDAG] Transitively copy NodeExtraInfo on RAUW

During legalization of the SelectionDAG, some nodes are replaced with
arch-specific nodes. These may be complex nodes, where the root node no
longer corresponds to the node that should carry the extra info.

Fix the issue by copying extra info to the new node and all its new
transitive operands during RAUW. See code comments for more details.

This fixes the remaining pcsections-atomics.ll tests on X86.

v2: Optimize copyExtraInfo() deep copy. For now we assume that only
NodeExtraInfo that have PCSections set require deep copy. Furthermore,
limit the depth of graph search while pre-populating the visited set,
assuming the to-be-replaced subgraph 'From' has limited complexity. An
assertion catches if the maximum depth needs to be increased.

Reviewed By: dvyukov

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

19 months ago[flang] Fix CONTIGUOUS attribute for construct entities
Peter Klausler [Sat, 25 Feb 2023 14:46:32 +0000 (06:46 -0800)]
[flang] Fix CONTIGUOUS attribute for construct entities

Currently, the selector of a construct entity (e.g., ASSOCIATE(x=>a(1:20)))
is inheriting the CONTIGUOUS attribute from its associated variable
even if it has subscripts that make it noncontiguous (a(1:20:2)).
Add construct entities to the dynamic contiguity predicate instead.

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

19 months ago[ASAN] Simplify masked load/store test [nfc]
Philip Reames [Thu, 2 Mar 2023 22:00:21 +0000 (14:00 -0800)]
[ASAN] Simplify masked load/store test [nfc]

Only use of the globals was to load a pointer, we can just pass in a pointer instead.

19 months ago[libc][obvious] Fix errno includes in unistd
Michael Jones [Thu, 2 Mar 2023 22:03:03 +0000 (14:03 -0800)]
[libc][obvious] Fix errno includes in unistd

Minor typo swapped quotes for angle brackets. This patch moves
everything to quotes.

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

19 months ago[Linux] Add kernel.yama.ptrace_scope note when ptrace fails to attach.
Jordan Rupprecht [Thu, 2 Mar 2023 21:51:30 +0000 (13:51 -0800)]
[Linux] Add kernel.yama.ptrace_scope note when ptrace fails to attach.

A common reason for LLDB failing to attach to an already-running process on Linux is the Yama security module: https://www.kernel.org/doc/Documentation/security/Yama.txt. This patch adds an explaination and suggested fix when it detects that case happening.

This was previously proposed in D106226, but hasn't been updated in a while. The last request was to put the check in a target-specific location, which is the approach this patch takes. I believe Yama only exists on Linux, so it's put in that package.

This has no end-to-end test because I'm not sure how to set `ptrace_scope` in a test environment -- if there are suggestions on how to do that, I'd be happy to add it. (Also, setting it to `3` is comically irreversible). I tested this locally.

Reviewed By: DavidSpickett, labath

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

19 months ago[clang][deps] NFC: Simplify worker loop
Jan Svoboda [Wed, 1 Mar 2023 19:51:20 +0000 (11:51 -0800)]
[clang][deps] NFC: Simplify worker loop

This patch simplifies the loop inside each worker by extracting index retrieval into a lambda function.

Reviewed By: benlangmuir

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

19 months ago[flang] Move check for statement function in BLOCK construct
Peter Klausler [Sat, 25 Feb 2023 01:36:15 +0000 (17:36 -0800)]
[flang] Move check for statement function in BLOCK construct

A BLOCK construct may not contain a statement function definition;
but it may of course contain an assignment statement with an array
element on its left-hand side that looks like a statement function
definition.  These misparsed statement functions are converted
into assignment statements during semantics once it is clear what
they are.  Move the C1107 check for a statement function definition
in a block construct into declaration checking, which is where it
probably should have been in the first place anyway.

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

19 months ago[ADT] Clean up `enumerate` implementation. NFC.
Jakub Kuderski [Thu, 2 Mar 2023 21:37:56 +0000 (16:37 -0500)]
[ADT] Clean up `enumerate` implementation. NFC.

*  Remove unnecessary member functions.
*  Fix code sample.

This is in preparation for landing future changes in https://reviews.llvm.org/D144503.

Reviewed By: zero9178

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

19 months agoRevert "[Support] Implement findModulesAndOffsets on Apple 64-bit platforms"
Luís Marques [Thu, 2 Mar 2023 21:42:23 +0000 (21:42 +0000)]
Revert "[Support] Implement findModulesAndOffsets on Apple 64-bit platforms"

This reverts commit b8b8aa6f06458212193c4202291c9f68364b2025.
It broke AIX.

19 months ago[clang][deps] Preserve input ordering in the full output
Jan Svoboda [Wed, 1 Mar 2023 19:31:49 +0000 (11:31 -0800)]
[clang][deps] Preserve input ordering in the full output

This patch makes sure the ordering of TUs in the input CDB is preserved in the full output. Previously, the results were pushed into a global vector, potentially out-of-order and then sorted by the input file name. This is non-deterministic when the CDB contains multiple entries with the same input file. This patch fixes that by pre-allocating the output vector and writing directly to the position corresponding to the current input. This also eliminates one critical section.

Reviewed By: benlangmuir

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

19 months ago[libc] disable integration tests when using gcc
Michael Jones [Thu, 2 Mar 2023 00:27:02 +0000 (16:27 -0800)]
[libc] disable integration tests when using gcc

The integration tests were failing to build under GCC due to missing
compile options for using LLVM's libc++ and compiler-rt.

This should unblock https://github.com/llvm/llvm-project/issues/60467

Reviewed By: sivachandra, lntue

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

19 months agoAdd SBValue::GetValueAsAddress API for removing non-addressing metadata
Jason Molenda [Thu, 2 Mar 2023 21:28:34 +0000 (13:28 -0800)]
Add SBValue::GetValueAsAddress API for removing non-addressing metadata

On target where metadata is stored in bits that aren't used for
virtual addressing -- AArch64 Top Byte Ignore and pointer authentication
are two examples -- an SBValue object representing a pointer will
return the address with metadata for SBValue::GetValueAsUnsigned.
Users may want to get the virtual address without the metadata;
this new method gives them a way to do this.

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

19 months ago[mlir] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata [Thu, 2 Mar 2023 21:19:42 +0000 (13:19 -0800)]
[mlir] Use std::optional instead of llvm::Optional (NFC)

19 months ago[mlir][sparse] convenience util to test for "sparse" op
Aart Bik [Thu, 2 Mar 2023 20:06:29 +0000 (12:06 -0800)]
[mlir][sparse] convenience util to test for "sparse" op

Reviewed By: cota

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

19 months ago[Docs] update MemorySSA for opaque ptrs
Nick Desaulniers [Thu, 2 Mar 2023 20:58:53 +0000 (12:58 -0800)]
[Docs] update MemorySSA for opaque ptrs

Reviewed By: asbirlea, nikic

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

19 months ago[lldb/Interpreter] Fix build failures in ScriptInterpreterLua
Med Ismail Bennani [Thu, 2 Mar 2023 20:46:34 +0000 (12:46 -0800)]
[lldb/Interpreter] Fix build failures in ScriptInterpreterLua

This patch should fix the build failures in the Lua ScriptedInterpreter
introduced by 9a9fce1fed6d.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
19 months agoRevert "[lldb/Interpreter] Fix build failures in ScriptInterpreterLua"
Med Ismail Bennani [Thu, 2 Mar 2023 20:46:18 +0000 (12:46 -0800)]
Revert "[lldb/Interpreter] Fix build failures in ScriptInterpreterLua"

This reverts commit 6de18eb050a66544cc38210024860366b84faf35.

19 months ago[lldb/Interpreter] Fix build failures in ScriptInterpreterLua
Med Ismail Bennani [Thu, 2 Mar 2023 20:43:15 +0000 (12:43 -0800)]
[lldb/Interpreter] Fix build failures in ScriptInterpreterLua

This patch should fix the build failures in the Lua ScriptedInterpreter
introduced by 9a9fce1fed6d.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
19 months agoRevert "Revert "Revert "[scudo] Only prepare PageMap entry for partial region"""
Chia-hung Duan [Thu, 2 Mar 2023 20:37:55 +0000 (20:37 +0000)]
Revert "Revert "Revert "[scudo] Only prepare PageMap entry for partial region"""

ScudoReleaseTest.ReleaseFreeMemoryToOSAndroid failed on Fuchsia

This reverts commit c6ef6bbd8d964028ee6c2f03441604d7a7ba5375.

19 months ago[libc++][chrono] XFAIL hh_mm_ss formatter test on FreeBSD
Ed Maste [Wed, 1 Mar 2023 22:09:38 +0000 (17:09 -0500)]
[libc++][chrono] XFAIL hh_mm_ss formatter test on FreeBSD

This test did not exist when I added the previous set of XFAILs (and the
libc++ FreeBSD CI runner is not yet active).

Reviewed by: Mordante

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

19 months agoRevert "[Clang] Refactor "Designators" into a unified implementation [NFC]"
Bill Wendling [Thu, 2 Mar 2023 20:08:07 +0000 (12:08 -0800)]
Revert "[Clang] Refactor "Designators" into a unified implementation [NFC]"

This reverts commit 3c07db5f58e9852f35202f0fffed50fc7506f37b.

This caused https://github.com/llvm/llvm-project/issues/61118. Reverting
to ensure this is a pure NFC change.

19 months ago[SelectionDAG][AArch64] Constant fold in SelectionDAG::getVScale if VScaleMin==VScaleMax.
Craig Topper [Thu, 2 Mar 2023 20:02:37 +0000 (12:02 -0800)]
[SelectionDAG][AArch64] Constant fold in SelectionDAG::getVScale if VScaleMin==VScaleMax.

Reviewed By: paulwalker-arm

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

19 months ago[clang-format] Add -j to clang-format-diff to speed up formatting
Sean Maher [Thu, 2 Mar 2023 19:53:57 +0000 (11:53 -0800)]
[clang-format] Add -j to clang-format-diff to speed up formatting

This patch changes the implementation of clang-format-diff.py to
start up many clang-format processes in parallel in order to speed
up clang-format-diff.py by several orders of magnitude on large
patches.

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

19 months ago[C2x] Add tests for WG14 N3035 and update the C status page
Aaron Ballman [Thu, 2 Mar 2023 19:35:03 +0000 (14:35 -0500)]
[C2x] Add tests for WG14 N3035 and update the C status page

The paper was making minor corrections to the standard that Clang had
already implemented. This adds (most of) the test coverage for the
paper and claims support. In my testing, we supported this in Clang 15.

19 months ago[PowerPC] Recognize long CPU name for -mtune in Clang
Nemanja Ivanovic [Thu, 2 Mar 2023 18:54:13 +0000 (13:54 -0500)]
[PowerPC] Recognize long CPU name for -mtune in Clang

There are two ways of specifying a CPU on PowerPC:
power<N> and pwr<N>. Clang/LLVM traditionally
supports the latter and Clang replaces the former
with the latter when passing it to the back end for
the -mcpu= option. However, when the -mtune= option
was introduced, this replacement was not implemented for it.

This leaves us in an inconsistent state of accepting
both forms for -mcpu= and and only the latter for
-mtune=. Furthermore, it leaves us incompatible with
GCC which only understands the power<N> version for
both options.

This patch just adds the same handling for the long
names for -mtune= as already exists for -mcpu=.

Differential revision: https://reviews.llvm.org/D144967

19 months ago[test][ASAN] Add test coverage for (fixed) vector load and stores
Philip Reames [Thu, 2 Mar 2023 19:10:57 +0000 (11:10 -0800)]
[test][ASAN] Add test coverage for (fixed) vector load and stores

19 months ago[libc][NFC] Move all developer docs into a sub-directory docs/dev.
Siva Chandra Reddy [Thu, 2 Mar 2023 18:58:04 +0000 (10:58 -0800)]
[libc][NFC] Move all developer docs into a sub-directory docs/dev.

19 months ago[SLP][NFC]Add a test with reused scalars in 3 tree nodes with different
Alexey Bataev [Thu, 2 Mar 2023 18:44:53 +0000 (10:44 -0800)]
[SLP][NFC]Add a test with reused scalars in 3 tree nodes with different
VF, NFC.

19 months ago[ASAN] Rename TypeSize to TypeStoreSize [mostly NFC]
Philip Reames [Thu, 2 Mar 2023 18:39:06 +0000 (10:39 -0800)]
[ASAN] Rename TypeSize to TypeStoreSize [mostly NFC]

This is a mechanical prep change for scalable vector support.  All it does is move the point of TypeSize to unsigned (i.e. the unsafe cast) closer to point of use.

19 months ago[flang][runtime] Handle explicit-length character padding & truncation in Assign()
Peter Klausler [Wed, 22 Feb 2023 18:19:25 +0000 (10:19 -0800)]
[flang][runtime] Handle explicit-length character padding & truncation in Assign()

When the left-hand side of an allocatable assignment has an explicit character length,
rather than a deferred length that might imply reallocation, handle any discrepancy
in lengths via truncation or blank padding.

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

19 months ago[flang] Stricter interface compatibility checking for TBP overrides
Peter Klausler [Tue, 21 Feb 2023 00:11:04 +0000 (16:11 -0800)]
[flang] Stricter interface compatibility checking for TBP overrides

The compiler currently ignores attributes for PASS dummy arguments that
are incompatible between a type-bound procedure in an extended type and
the binding of the same name that it overrides in an ancestor type,
if any.  Strengthen this checking so that discrepancies between attributes
and intents are caught, and add some tests.

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

19 months ago[flang] Catch name conflict between generic TBP and inherited non-generic
Peter Klausler [Mon, 20 Feb 2023 20:39:53 +0000 (12:39 -0800)]
[flang] Catch name conflict between generic TBP and inherited non-generic

A generic procedure binding in an extended derived type may not have the
same name as a symbol inherited from an ancestor type unless that inherited
symbol is also a generic TBP.  Since generic names can be things like
"ASSIGNMENT(=)", name resolution doesn't use OkToAddComponent() for
generic TBPs, which would have caught this error as it does for other
symbols in derived types, so it must be special-cased.

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

19 months ago[flang] BIND(C,NAME=...) corrections
Peter Klausler [Tue, 28 Feb 2023 19:58:30 +0000 (11:58 -0800)]
[flang] BIND(C,NAME=...) corrections

The Fortran standard's various restrictions on the use of BIND(C)
often depend more on the presence or absence of an explicit NAME=
specification rather than on its value, but semantics and module
file generation aren't making distinctions between explicit NAME=
specifications that happen to match the default name and declarations
that don't have NAME=.  Tweak semantics and module file generation
to conform, and also complain when named BIND(C) attributes are
erroneously applied to entities that can't support them, like
ABSTRACT interfaces.

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

19 months ago[libc++][NFC] Reformat aligned_storage specialization macro
Louis Dionne [Thu, 2 Mar 2023 18:04:58 +0000 (13:04 -0500)]
[libc++][NFC] Reformat aligned_storage specialization macro

19 months ago[flang] Enforce prohibition against empty interoperable arrays
Peter Klausler [Sun, 19 Feb 2023 23:55:04 +0000 (15:55 -0800)]
[flang] Enforce prohibition against empty interoperable arrays

Fortran doesn't allow a BIND(C) variable or a component of a BIND(C)
type to be an array with no elements.

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

19 months ago[flang] A TBP override may not make a public binding private
Peter Klausler [Sat, 18 Feb 2023 17:32:45 +0000 (09:32 -0800)]
[flang] A TBP override may not make a public binding private

When a procedure binding in a derived type has PRIVATE accessibility,
it may not be an override of a type-bound procedure that is accessible.

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

19 months ago[flang] Disallow intrinsics and statement functions from generics
Peter Klausler [Sat, 18 Feb 2023 17:06:57 +0000 (09:06 -0800)]
[flang] Disallow intrinsics and statement functions from generics

Generic interfaces are not permitted to have intrinsic procedures or
statement functions as specific procedures.

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

19 months ago[Flang][OpenMP] Improved reduction clause TODO message
Kiran Chandramohan [Thu, 2 Mar 2023 17:35:11 +0000 (17:35 +0000)]
[Flang][OpenMP] Improved reduction clause TODO message

Provide the name of the construct and the clause info (reduction)
in the TODO mesage.

Reviewed By: DavidTruby

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

19 months ago[flang] Catch attempt to misuse an abstract procedure in a generic interface
Peter Klausler [Sat, 18 Feb 2023 01:12:14 +0000 (17:12 -0800)]
[flang] Catch attempt to misuse an abstract procedure in a generic interface

A procedure defined in an ABSTRACT INTERFACE may not appear as
a specific procedure in a generic interface.

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

19 months ago[flang] Warn about violations of an obscure requirement (15.6.4 p2)
Peter Klausler [Sat, 18 Feb 2023 00:48:25 +0000 (16:48 -0800)]
[flang] Warn about violations of an obscure requirement (15.6.4 p2)

The Fortran 2018 standard, perhaps as an attempt to prevent ambiguity
in  older compilers, requires that a statement function appear in an
explicit type declaration statement if its name is also accessible
from a host scope.  F18 processes the specification parts of inner
procedures first, so we don't need this requirement to prevent
ambiguity, and can only really check it retrospectively after name
resolution.  Emit a portability warning when appropriate.

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

19 months ago[libc++][NFC] Fix typo in documentation
Louis Dionne [Thu, 2 Mar 2023 17:42:15 +0000 (12:42 -0500)]
[libc++][NFC] Fix typo in documentation

19 months ago[libc++] Reintroduce workaround for stdint re-export on Darwin
Louis Dionne [Wed, 1 Mar 2023 19:58:03 +0000 (14:58 -0500)]
[libc++] Reintroduce workaround for stdint re-export on Darwin

This had been removed as part of 3a0f88c4c2c4. It turns out that this
did break some code, but we never noticed because it requires including
<stdint.h> (and nothing else), and then using one of the types from
that header. It also requires running with modules enabled in a Standard
no later than C++17.

After the test refactorings in D145116, this bug would be caught
by running a CI job on macOS with modules enabled in C++17 mode
(but surprisingly not with more recent standards). This patch doesn't
add such a job because it is deemed a corner case.

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

19 months ago[libc++] Use ASSERT_SAME_TYPE instead of <type_traits> in depr tests
Louis Dionne [Wed, 1 Mar 2023 21:37:12 +0000 (16:37 -0500)]
[libc++] Use ASSERT_SAME_TYPE instead of <type_traits> in depr tests

Whenever, possible, use ASSERT_SAME_TYPE instead of static_assert along
with std::is_same in the depr header tests. This prevents dragging in
multiple headers unrelated to the header being tested, which can (and
has) hidden issues.

Also, add a couple of tests to ensure that basic declarations in
<stddef.h> and <stdint.h> are available when including just those
headers, since the rest of the tests for those types require pulling
in additional dependencies.

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

19 months ago[AMDGPU] Remove outdated FIXME in comments [NFC]
ZHU Zijia [Thu, 2 Mar 2023 17:26:53 +0000 (01:26 +0800)]
[AMDGPU] Remove outdated FIXME in comments [NFC]

This case has already been handled by D106449.

19 months ago[flang] Refine procedure compatibility checking
Peter Klausler [Wed, 15 Feb 2023 01:33:57 +0000 (17:33 -0800)]
[flang] Refine procedure compatibility checking

The test for compatible function results needs to be nearly strict
equality of their types, not the usual actual/dummy type compatibility
test used in other situations.  The exceptional case is that assumed
length CHARACTER function results are compatible with explicit length
results of the same kind.  In particular, a function returning a
polymorphic pointer is not compatible with a function returning a
monomorphic pointer even of the same declared type.

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

19 months ago[flang] Fix ISHFTC argument value check
Peter Klausler [Wed, 15 Feb 2023 00:07:24 +0000 (16:07 -0800)]
[flang] Fix ISHFTC argument value check

The code that visits all pairs of constant SHIFT= and SIZE= arguments
in an array-valued call to the ISHFTC intrinsic function had a bad loop
test that affected the case where one of these arguments was scalar and
the other was not.  Fix it, and add tests.

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

19 months ago[flang] Warn about dangerous actual argument association with TARGET dummy arguments
Peter Klausler [Tue, 14 Feb 2023 22:58:34 +0000 (14:58 -0800)]
[flang] Warn about dangerous actual argument association with TARGET dummy arguments

The actual argument associated with a dummy argument with the TARGET attribute is
not required to be itself a target or pointer, or even to be a variable, but in
those cases, any pointer that is associated with the dummy argument during the
execution of the procedure is either going to be invalid afterwards because it
points to temporary storage that has since been deallocated or an optimization
time bomb because it aliases an object that isn't a target.  Add warnings for
these cases.

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

19 months ago[libc][NFC] Switch use of errno in src/unistd and src/sys to libc_errno.
Siva Chandra Reddy [Wed, 1 Mar 2023 17:41:02 +0000 (17:41 +0000)]
[libc][NFC] Switch use of errno in src/unistd and src/sys to libc_errno.

Reviewed By: lntue

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

19 months ago[mlir][SparseTensor] Fix incorrect API usage in RewritePatterns
Matthias Springer [Thu, 2 Mar 2023 16:22:06 +0000 (17:22 +0100)]
[mlir][SparseTensor] Fix incorrect API usage in RewritePatterns

Incorrect API usage was detected by D144552.

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

19 months ago[AMDGPU] Mark mbcnt as convergent
Yaxun (Sam) Liu [Wed, 1 Mar 2023 15:56:11 +0000 (10:56 -0500)]
[AMDGPU] Mark mbcnt as convergent

since it depends on CFG.

Otherwise some passes will try to merge them and cause
incorrect results.

Reviewed by: Artem Belevich

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

19 months ago[ADT] Drop append_range test that doesn't compile with EXPENSIVE_CHECKS
Jakub Kuderski [Thu, 2 Mar 2023 16:23:49 +0000 (11:23 -0500)]
[ADT] Drop append_range test that doesn't compile with EXPENSIVE_CHECKS

The issue seems to be caused by the definition of `SafeIntIterator` and
is otherwise unrelated to the implementation of `append_range`.

We have a simialr test below, so this does not meaningfully decrease the
test coverage of `append_range`.

See the discussion in: https://reviews.llvm.org/D144420#4164373

Issue: https://github.com/llvm/llvm-project/issues/61122

19 months ago[InstCombine] add tests for absolute diff; NFC
Sanjay Patel [Thu, 2 Mar 2023 14:43:23 +0000 (09:43 -0500)]
[InstCombine] add tests for absolute diff; NFC

More coverage for D145073.

19 months agoMake clang/test/C/C2x/n2934.c compatible with targets that do not support thread_loca...
Fanbo Meng [Thu, 2 Mar 2023 14:28:37 +0000 (09:28 -0500)]
Make clang/test/C/C2x/n2934.c compatible with targets that do not support thread_local storage.

Add an optional error check to test case for it to pass on targets that do not support thread_local storage.

Reviewed By: aaron.ballman, abhina.sreeskantharajan

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

19 months ago[GlobalOpt] Drop bitcast handling in global to alloca fold
Nikita Popov [Thu, 2 Mar 2023 16:10:42 +0000 (17:10 +0100)]
[GlobalOpt] Drop bitcast handling in global to alloca fold

Pointer bitcasts no longer occur with opaque pointers -- and in
this case not handling them allows us to drop the code for
promoting constant expressions to instructions as well.

19 months ago[Sanitizers] Disable armv7* sanitizers slice for ios
usama hameed [Thu, 2 Mar 2023 16:04:45 +0000 (21:04 +0500)]
[Sanitizers] Disable armv7* sanitizers slice for ios

rdar://104059106

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

19 months ago[GlobalOpt] Regenerate test checks (NFC)
Nikita Popov [Thu, 2 Mar 2023 16:06:08 +0000 (17:06 +0100)]
[GlobalOpt] Regenerate test checks (NFC)

And drop the unnecessary main function.

19 months ago[ASAN] Use TypeSize in InterestingMemoryOperand [mostly NFC]
Philip Reames [Thu, 2 Mar 2023 15:44:00 +0000 (07:44 -0800)]
[ASAN] Use TypeSize in InterestingMemoryOperand [mostly NFC]

This is a mechanical prep change for scalable vector support.  All it does is move the point of TypeSize to unsigned (i.e. the unsafe cast) closer to point of use.

19 months ago[DAGCombiner] Replace LegalOperations check in visitSIGN_EXTEND with LegalTypes.
Craig Topper [Thu, 2 Mar 2023 15:44:00 +0000 (07:44 -0800)]
[DAGCombiner] Replace LegalOperations check in visitSIGN_EXTEND with LegalTypes.

This is guarding a check for isTypeLegal so it should check is
LegalTypes.

Fixes PR61111.

Reviewed By: RKSimon

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

19 months ago[clang][ExtractAPI] Handle platform specific unavailability correctly
Ankur [Thu, 2 Mar 2023 14:33:56 +0000 (14:33 +0000)]
[clang][ExtractAPI] Handle platform specific unavailability correctly

This Patch gives ExtractAPI the ability to emit correct availability information for symbols marked as unavailable on a specific platform ( PR#60954 )

Reviewed By: dang

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

19 months ago[mlir][NVGPU] Fix incorrect API usage in RewritePatterns
Matthias Springer [Thu, 2 Mar 2023 15:12:42 +0000 (16:12 +0100)]
[mlir][NVGPU] Fix incorrect API usage in RewritePatterns

Incorrect API usage was detected by D144552.

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

19 months ago[mlir][linalg] Fix incorrect API usage in RewritePatterns
Matthias Springer [Thu, 2 Mar 2023 14:43:59 +0000 (15:43 +0100)]
[mlir][linalg] Fix incorrect API usage in RewritePatterns

Incorrect API usage was detected by D144552.

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

19 months agoCall MarkVirtualMembersReferenced on an actual class definition
Stephan Bergmann [Wed, 1 Mar 2023 22:29:45 +0000 (23:29 +0100)]
Call MarkVirtualMembersReferenced on an actual class definition

...rather than on potentially just a declaration.

Without the fix, the newly added clang/test/SemaCXX/warn-undefined-internal.cpp
failed with

> error: 'warning' diagnostics expected but not seen:
>   File /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp Line 12 (directive at /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp:13): function 'test2()::S::f' has internal linkage but is not defined
> error: 'note' diagnostics expected but not seen:
>   File /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp Line 14 (directive at /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp:15): used here

(I ran into this when two LibreOffice Clang plugins produced false positive
warnings, as they relied on Decl::isReferenced() returning true for such virtual
member functions of local classes.)

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

19 months agoRevert "[Sanitizers] Error out for -static-libsan on darwin"
usama hameed [Thu, 2 Mar 2023 14:48:38 +0000 (19:48 +0500)]
Revert "[Sanitizers] Error out for -static-libsan on darwin"

This reverts commit 4e7d40e0928cfe448ba947d2a67895fccaa3535f.

19 months agoRevert "Revert "[SCEV] Add SCEVType to represent `vscale`.""
Paul Walker [Thu, 2 Mar 2023 12:23:52 +0000 (12:23 +0000)]
Revert "Revert "[SCEV] Add SCEVType to represent `vscale`.""

Relanding after fixing Polly related build error.

This reverts commit 7b26dcae9eaf8cdcba7fef032fd83d060dffd4b4.

19 months agoChange ClangTidy unit tests to run in C++20 mode instead of C++11.
Utkarsh Saxena [Thu, 2 Mar 2023 12:04:07 +0000 (13:04 +0100)]
Change ClangTidy unit tests to run in C++20 mode instead of C++11.

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

19 months ago[mlir][vector] Fix incorrect API usage in RewritePatterns
Matthias Springer [Thu, 2 Mar 2023 11:51:35 +0000 (12:51 +0100)]
[mlir][vector] Fix incorrect API usage in RewritePatterns

Incorrect API usage was detected by D144552.

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

19 months ago[gn build] Port 97dcbea63e11
LLVM GN Syncbot [Thu, 2 Mar 2023 12:51:00 +0000 (12:51 +0000)]
[gn build] Port 97dcbea63e11

19 months ago[LogicCombine 1/?] Implement a general way to simplify logical operations.
chenglin.bi [Thu, 2 Mar 2023 12:45:54 +0000 (20:45 +0800)]
[LogicCombine 1/?] Implement a general way to simplify logical operations.

This patch involves boolean ring to simplify logical operations. We can treat `&` as ring multiplication and `^` as ring addition.
So we need to canonicalize all other operations to `*` `+`. Like:
```
a & b -> a * b
a ^ b -> a + b
~a -> a + 1
a | b -> a * b + a + b
c ? a : b -> c * a + (c + 1) * b
```
In the code, we use a mask set to represent an expression. Every value that is not comes from logical operations could be a bit in the mask.
The mask itself is a multiplication chain. The mask set is an addiction chain.
We can calculate two expressions based on boolean algebras.

For now, the initial patch only enabled on and/or/xor,  Later we can enhance the code step by step.

Reference: https://en.wikipedia.org/wiki/Boolean_ring

Reviewed By: spatel

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

19 months ago[MCA] Fix crash in `EntryStage::cycleEnd` when there are no instructions.
Clement Courbet [Thu, 2 Mar 2023 12:34:43 +0000 (13:34 +0100)]
[MCA] Fix crash in `EntryStage::cycleEnd` when there are no instructions.

19 months ago[AArch64] NFC: Add missing CHECK lines for sme-aarch64-svcount.ll test
Sander de Smalen [Thu, 2 Mar 2023 12:20:53 +0000 (12:20 +0000)]
[AArch64] NFC: Add missing CHECK lines for sme-aarch64-svcount.ll test

19 months ago[clangd] Use the normalized file path to do the filtering.
Haojian Wu [Thu, 2 Mar 2023 12:31:04 +0000 (13:31 +0100)]
[clangd] Use the normalized file path to do the filtering.

This is an oversight, where we normalized the path, but we didn't use it
in the filtering.