418663 Commits

Author SHA1 Message Date
Markus Böck
e13d23bc6c [mlir] Rename OpAsmParser::OperandType to OpAsmParser::UnresolvedOperand
I am not sure about the meaning of Type in the name (was it meant be interpreted as Kind?), and given the importance and meaning of Type in the context of MLIR, its probably better to rename it. Given the comment in the source code, the suggestion in the GitHub issue and the final discussions in the review, this patch renames the OperandType to UnresolvedOperand.

Fixes https://github.com/llvm/llvm-project/issues/54446

Differential Revision: https://reviews.llvm.org/D122142
2022-03-21 21:42:13 +01:00
Eric Li
9edeceaece [libTooling] Generalize string explanation as templated metadata
Change RewriteRule from holding an `Explanation` to being able to generate
arbitrary metadata. Where TransformerClangTidyCheck was interested in a string
description for the diagnostic, other tools may be interested in richer metadata
at a higher level of abstraction than at the edit level (which is currently
available as ASTEdit::Metadata).

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D120360
2022-03-21 20:39:35 +00:00
Jakob Johnson
e6c84f82b8 Add thin wrapper for perf_event_open API
- Add PerfEvent class to handle creating ring buffers and handle the resources associated with a perf_event
  - Refactor IntelPT collection code to use this new API
  - Add TSC to timestamp conversion logic with unittest

Differential Revision: https://reviews.llvm.org/D121734
2022-03-21 13:38:52 -07:00
Stanislav Mekhanoshin
9b1fa6f89f [AMDGPU] Fix AV classes VTs. NFCI.
NFC at this point, but will be used at a later patch.

Differential Revision: https://reviews.llvm.org/D122174
2022-03-21 13:38:05 -07:00
Arthur Eubanks
3210647e5b [llvm-libtools-darwin] Don't use global LLVMContext
Fixes some initialization order fiasco issues
https://lab.llvm.org/buildbot#builders/5/builds/20996
2022-03-21 13:33:47 -07:00
Joseph Huber
a3248e4b28 [CUDA] Add getTargetFeatures for the NVPTX toolchain
The NVPTX toolchain uses target features to determine the PTX version to
use. However this isn't exposed externally like most other toolchain
specific target features are. Add this functionaliy in preparation for
using it in for OpenMP offloading.

Reviewed By: jdoerfert, tra

Differential Revision: https://reviews.llvm.org/D122089
2022-03-21 16:32:36 -04:00
Stefan Pintilie
4275d7e65a [PowerPC][NFC] Add test case for byval argument passing
Add a test case for byval argument passing where the argument size is more than
8 bytes and is not a factor of 8 bytes.
2022-03-21 15:14:28 -05:00
alex-t
a0ea7ec90f [AMDGPU] divergence patterns for the BUILD_VECTOR i16, undef expansion.
BUILD_VECTOR of i16 and undef gets expanded to the COPY_TO_REGCLASS.
         The latter is further lowererd to the copy instructions.
	 We need to provide the correct register class for the uniform and divergent BUILD_VECTOR nodes
	 to avoid VGPR to SGPR copies.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D122068
2022-03-21 21:11:20 +01:00
Peter Klausler
461b6fe470 [flang] Expose error recovery cases in external I/O
Some I/O error situations are current handled with fatal
runtime asserts, but should be exposed for user program
error recovery.

Differential Revision: https://reviews.llvm.org/D122049
2022-03-21 12:46:16 -07:00
Louis Dionne
240e06dfe7 [bootstrap] Allow passing options to sub-builds for all targets
This patch makes it possible to pass a CMake option to one of the runtimes
for all targets being built. Basically, any option that starts with the
name of a runtime project being built will be forwarded as-is to the
sub-build. This is useful for customizing a sub-build for all targets.

Differential Revision: https://reviews.llvm.org/D121822
2022-03-21 15:38:14 -04:00
Arjun P
523914c20d [MLIR][Presburger] Deduplicate and move getNegatedCoeffs and getComplementIneq into Utils 2022-03-21 19:29:11 +00:00
Craig Topper
37c0aacd71 [SelectionDAG] Make getPreferredExtendForValue take a Instruction * instead of Value *.
This is only called for instructions and the caller is already holding
an Instruction *. This makes the code more explicit and makes it
obvious the code doesn't make decisions about constants.
2022-03-21 12:15:22 -07:00
Nathan James
d89f9e963e
[ASTMatchers] Output currently processing match and nodes on crash
Create a PrettyStackTraceEvent that will dump the current `MatchCallback` id as well as the `BoundNodes` if the 'run' method of a `MatchCallback` results in a crash.
The purpose of this is sometimes clang-tidy checks can crash in the `check` method. And in a large codebase with alot of checks enabled and in a release build, it can be near impossible to figure out which check as well as the source code that caused the crash. Without that information a reproducer is very hard to create.
This is a more generalised version of D118520 which has a nicer integration and should be useful to clients other than clang-tidy.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D120185
2022-03-21 19:13:36 +00:00
Kim Gräsman
6b2335cace Adding a release note
This amends 403d7d8d7093d6637a006f8b3f75382294259d3f.
2022-03-21 15:10:01 -04:00
Yitzhak Mandelbaum
8351726e6d Revert "[libTooling] Generalize string explanation as templated metadata"
This reverts commit 18440547d3520b78c9ab929685309419fc1fbe95. Causing failures
in some build modes.

e.g. https://lab.llvm.org/buildbot/#/builders/217/builds/1886
2022-03-21 19:06:59 +00:00
Aaron Ballman
403d7d8d70 Ignore FullExpr when traversing cast sub-expressions
Full-expressions are Sema-generated implicit nodes that cover
constant-expressions and expressions-with-cleanup for temporaries.

Ignore those as part of implicit-ignore, and also remove too-aggressive
IgnoreImplicit (which includes nested ImplicitCastExprs, for example)
on unpacked sub-expressions.

Add some unittests to demonstrate that RecursiveASTVisitor sees through
ConstantExpr nodes correctly.

Adjust cxx2a-consteval test to cover diagnostics for nested consteval
expressions that were previously missed.

Fixes bug #53044.
2022-03-21 15:05:53 -04:00
Kim Gräsman
276d214314 Generalize and harmonize sub-expression traversal
CastExpr::getSubExprAsWritten and getConversionFunction used to have
disparate implementations to traverse the sub-expression chain and skip
so-called "implicit temporaries" (which are really implicit nodes added
by Sema to represent semantic details in the AST).

There's some friction in these algorithms that makes it hard to extend
and change them:

* skipImplicitTemporary is order-dependent; it can skip a
CXXBindTemporaryExpr nested inside a MaterializeTemporaryExpr, but not
vice versa
* skipImplicitTemporary only runs one pass, it does not traverse
multiple nested sequences of MTE/CBTE/MTE/CBTE, for example

Both of these weaknesses are void at this point, because this kind of
out-of-order multi-level nesting does not exist in the current AST.

Adding a new implicit expression to skip exacerbates the problem,
however, since a node X might show up in any and all locations between
the existing.

Thus;

* Harmonize the form of getSubExprAsWritten and getConversionFunction
so they both use a for loop
* Use the IgnoreExprNodes machinery to skip multiple nodes
* Rename skipImplicitTemporary to ignoreImplicitSemaNodes to generalize
* Update ignoreImplicitSemaNodes so it only skips one level per call,
to mirror existing Ignore functions and work better with
IgnoreExprNodes

This is a functional change, but one without visible effect.
2022-03-21 15:01:31 -04:00
Duncan P. N. Exon Smith
892c104fb7 Compiler: Remove empty fallback definition for LLVM_BUILTIN_UNREACHABLE
`llvm_unreachable()` and `LLVM_ASSUME_ALIGNED` use
`defined(LLVM_BUILTIN_UNREACHABLE)` to check whether it has a
definition. Remove the fallback added in 26827337dff26ba3 (as a drive-by
when updating the GCC logic) and add a comment to prevent future
mistakes.

Differential Revision: https://reviews.llvm.org/D122167
2022-03-21 11:52:24 -07:00
Eric Li
18440547d3 [libTooling] Generalize string explanation as templated metadata
Change RewriteRule from holding an `Explanation` to being able to generate
arbitrary metadata. Where TransformerClangTidyCheck was interested in a string
description for the diagnostic, other tools may be interested in richer metadata
at a higher level of abstraction than at the edit level (which is currently
available as ASTEdit::Metadata).

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D120360
2022-03-21 18:45:39 +00:00
Zarko Todorovski
0f0520003a [libc++][AIX] AIX allows for changing permissions of symlinks
The test fails on AIX due to it expecting an error as on Linux. However, as on
other non-Linux systems symlinks permissions are supported so expect an empty
error code.

Reviewed By: daltenty, #libc, ldionne

Differential Revision: https://reviews.llvm.org/D121140
2022-03-21 14:39:37 -04:00
Arjun P
8a67c6ee7c [MLIR][Presburger] simplify removeConstraintsInvolvingRange 2022-03-21 18:36:36 +00:00
Nico Weber
e6c58e6fd3 [clang] Remove stdint.h include from a test
Tests must not include headers from the host system.
It looks like the include wasn't needed for anything, so just remove it.

This makes check-clang work in a `git bash` launched from a cmd.exe
that isn't an MSVC shell (that is, %INCLUDE% isn't set).
2022-03-21 14:30:12 -04:00
Daniel Thornburgh
ace2a6c15e Fix buildbot failures from 7917b3c6. 2022-03-21 17:58:22 +00:00
Sam McCall
46dbd19afb [clangd] Fix nullptr crash in AddUsing tweak on catch(...)
Fixes https://github.com/clangd/clangd/issues/1072
2022-03-21 18:56:45 +01:00
Louis Dionne
d6f00f8839 [libc++] Trigger CI when cmake/ is modified 2022-03-21 13:51:01 -04:00
Philip Reames
56727f9472 [test] Add regression test from pr54465
The reported crash regression was (presumably) fixed in 79a1823, but without adding coverage.
2022-03-21 10:49:27 -07:00
Nico Weber
312ec6f156 [gn build] Use lld-link's new /winsysroot: flag
If `clang_base_path` is set, it must now point to a directory that contains
an lld-link built with D118070.

(If this is a problem for anyone, we can guard this behind a
lld_link_understands_winsysroot gn arg, but let's see if we can get away
without that for now.)

With this, it's possible to build everything in a normal cmd.exe Window,
an MSVC shell isn't needed \o/

(Assuming you set `clang_base_path`, and you set `sysroot` to a directory
that contains a win sysroot. If you have MSVC installed,
`python3 llvm\utils\sysroot.py make-fake --out-dir=my-sysroot` and
setting `sysroot = "//my-sysroot"` in args.gn works, for example.)

Differential Revision: https://reviews.llvm.org/D121871
2022-03-21 13:43:38 -04:00
Arthur Eubanks
7678e8ebbb [llvm-lipo] Don't use a global LLVMContext
Fixes initialization order fiasco issue reported by
https://lab.llvm.org/buildbot/#builders/5/builds/20987
2022-03-21 10:43:22 -07:00
Simon Pilgrim
5fd9451668 [X86][AVX512] lower1BitShuffle - fold broadcast(setcc(x,y)) -> setcc(broadcast(x),broadcast(y)) (PR52500)
AVX512 has excellent broadcast ops for everything but vXi1 bool vectors - so if we're broadcasting a comparison result, see if we can broadcast the comparison operands instead.
2022-03-21 17:42:49 +00:00
Snehasish Kumar
5cfb110090 [DebugInfo][NFC] Add a comment on the ordering of DILineInfo frames.
Add a comment to getFrame() to mention that frames are stored in
bottom-up, i.e. leaf to root in order of increasing index.

Differential Revision: https://reviews.llvm.org/D122033
2022-03-21 10:41:05 -07:00
Snehasish Kumar
c9a3d29613 [memprof] Update the frame is inline logic and unittests.
Since DI frames are enumerated with the leaf function at index 0, this
patch fixes the logic when IsInlineFrame is set. Also update the
unittests to check that only the last frame is marked as non-inline from
a set of DI Frames for a PC address.

Differential Revision: https://reviews.llvm.org/D121830
2022-03-21 10:41:05 -07:00
Aart Bik
69a7759b40 [mlir][sparse] implement loop index value vectorization
with CHECK and integration test

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D122040
2022-03-21 10:40:38 -07:00
Tom Honermann
059a953d88 [clang] [OpenMP] Diagnose use of 'target_clones' in OpenMP variant declarations.
Previously, OpenMP variant declarations for a function declaration that included
the 'cpu_dispatch', 'cpu_specific', or 'target' attributes was diagnosed, but
one with the 'target_clones' attribute was not. Now fixed.

Reviewed By: erichkeane, jdoerfert

Differential Revision: https://reviews.llvm.org/D121963
2022-03-21 13:39:44 -04:00
Tom Honermann
8ff8c3ac0d [clang] [OpenMP] Extend OpenMP variant declaration tests.
This change extends the existing diagnostic tests for OpenMP variant
declarations to cover diagnostics for declarations that include
multiversion function attributes. The new tests demonstrate a missing
check for the 'target_clones' attribute.

Reviewed By: erichkeane, jdoerfert

Differential Revision: https://reviews.llvm.org/D121962
2022-03-21 13:39:44 -04:00
Tom Honermann
0cceee7559 [clang] Produce a "multiversion" annotation in textual AST output.
This change adds a "multiversion" annotation to textual AST output.
For example:
  FunctionDecl 0xb6628b0 <t.c:1:1, col:13> col:5 multiversion foo 'int (void)'

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121961
2022-03-21 13:39:44 -04:00
Tom Honermann
58c202a3d8 [clang] NFC: Rename 'MVType' variables to 'MVKind' for consistency with their type.
Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121960
2022-03-21 13:39:43 -04:00
Tom Honermann
8b6f1cbb21 [clang] Add missing diagnostics for invalid overloads of multiversion functions in C.
Previously, an attempt to declare an overload of a multiversion function
in C was not properly diagnosed. In some cases, diagnostics were simply
missing. In other cases the following assertion failure occured...
```
Assertion `(Previous.empty() || llvm::any_of(Previous, [](const NamedDecl *ND) { return ND->hasAttr(); })) && "Non-redecls shouldn't happen without overloadable present"' failed.
```
... or the following diagnostic was spuriously issued.
```
error: at most one overload for a given name may lack the 'overloadable' attribute
```

The diagnostics issued in some cases could be improved. When the function
type of a redeclaration does not match the prior declaration, it would be
preferable to diagnose the type mismatch before diagnosing mismatched
attributes. Diagnostics are also missing for some cases.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D121959
2022-03-21 13:39:43 -04:00
Tom Honermann
42e4c5b261 [clang] NFC: Remove forced type merging in multiversion function checks.
Checking of multiversion function declarations performed by various functions
in clang/lib/Sema/SemaDecl.cpp previously forced the valus of a passed in
'MergeTypeWithPrevious' reference argument in several scenarios. This was
unnecessary and possibly incorrect in the one case that the value
was forced to 'true' (though seemingly unobservably so).

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D121958
2022-03-21 13:39:43 -04:00
Tom Honermann
01b2e0567c [clang] NFC: Redundant code removal in SemaDecl.cpp, CheckTargetCausesMultiVersioning().
This change removes redundant code in the definition of
CheckTargetCausesMultiVersioning() in SemaDecl.cpp. The removed code checked
for multiversion function support. The code immediately following the removed
code is a call to CheckMultiVersionAdditionalRules(); that function performs
the same check on entry. In both cases, the consequences of missing multiversion
function support results in the same diagnostic message being issued and the
applicable function declaration being marked as invalid.

Reviewed By: erichkeane, aaron.ballman

Differential Revision: https://reviews.llvm.org/D121957
2022-03-21 13:39:43 -04:00
Tom Honermann
77472a659e [clang] NFC: Dead code removal in SemaDecl.cpp, CheckMultiVersionFunction().
This change removes dead code in the definition of CheckMultiVersionFunction()
in clang/lib/Sema/SemaDecl.cpp. The removed code was made dead by commit
fc53eb69c26cdd7efa6b629c187d04326f0448ca: "Reapply 'Implement target_clones multiversioning'".
See the added code just above the code being deleted; it contains the same
return statement with the previous condition now distributed across an if
statement and a switch statement.

Reviewed By: erichkeane, aaron.ballman

Differential Revision: https://reviews.llvm.org/D121955
2022-03-21 13:39:42 -04:00
Tom Honermann
325c4c29d6 [clang] Add test cases for multiversion function overload scenarios in C.
This change adds test cases to validate diagnostics for overloaded sets
that contain declarations of multiversion functions. Many of the added test
cases exercise declarations that are intended to be valid. Others are
intended to be valid if and when restrictions on multiversion functions
being declared with the overloadable attribute are lifted.

Several of the new test cases currently trigger the following assertion
failure in SemaDecl.cpp; the relevant test is therefore marked as an
expected failure pending a fix.
```
Assertion `(Previous.empty() || llvm::any_of(Previous, [](const NamedDecl *ND) { return ND->hasAttr(); })) && "Non-redecls shouldn't happen without overloadable present"' failed.
```

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D121954
2022-03-21 13:39:42 -04:00
Hirochika Matsumoto
86f970e595 [IROutliner][NFC] Fix typo in doc of findOrCreatePHIInBlock
Typo Fix in Documentation

Author: hkmatsumoto

Reviewers: AndrewLitteken

Differential Revision: https://reviews.llvm.org/D121627
2022-03-21 12:34:20 -05:00
Adam Czachorowski
6009d0d580 [clangd] Track time spent in filesystem ops during preamble builds
In some deployments, for example when running on FUSE or using some
network-based VFS implementation, the filesystem operations might add up
to a significant fraction of preamble build time. This change allows us
to track time spent in FS operations to better understand the problem.

Differential Revision: https://reviews.llvm.org/D121712
2022-03-21 18:33:01 +01:00
LLVM GN Syncbot
f8cda8f6be [gn build] Port 7917b3c6957c 2022-03-21 17:28:05 +00:00
Daniel Thornburgh
7917b3c695 [Debuginfod] Don't depend on Content-Length.
The present implementation of debuginfod lookups requires the
Content-Length field to be populated in the HTTP server response.
Unfortunately, Content-Length is optional, and there are some real
scenarios where it's missing. (For example, a Google Cloud Storage
server doing on-the-fly gunzipping.)

This changes the debuginfod response handler to directly stream the
output to the cache file as it is received. In addition to allowing
lookups to proceed without a Content-Lenght, it seems somewhat more
straightforward to implement, and it allows the disk I/O to be
interleaved with the network I/O.

Reviewed By: noajshu

Differential Revision: https://reviews.llvm.org/D121720
2022-03-21 17:27:45 +00:00
Simon Pilgrim
8692e27ad6 [X86][AVX512] Add PR52500 vXi1 broadcast test case 2022-03-21 17:25:29 +00:00
Philip Reames
b880bde92b Add missing dependencies to mayHaveNonDefUseDependency
Two interesting ommissions:
* When reordering in either direction, reordering two calls which both
  contain inf-loops is illegal.  This one is possibly a change in behavior
  for certain callers (e.g. fixes a latent bug.)
* When moving down, control dependence must be respected by checking the
  inverse of isSafeToSpeculativeExecute.  Current callers all seem to
  handle this case - though admitted, I did not do an exhaustive audit.
  Most seem to be only interested in moving upwards within a block.  This
  is mostly a case of future proofing an API so that it implements what
  the comments says, not just what current callers need.

Noticed via inspection.  I don't have a test case.
2022-03-21 10:15:36 -07:00
Philip Reames
93102505aa Rename mayBeMemoryDependent in polly to fix build bot
This case was missed in ee7324b8.
2022-03-21 10:11:31 -07:00
Valentin Clement
5754bae429
[flang] Lower procedure designator
This patch adds lowering for procedure designator.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-21 18:05:18 +01:00
Dave Lee
826bdf51ff [lldb] Fix llvm::Optional summary provider
Differential Revision: https://reviews.llvm.org/D122041
2022-03-21 10:03:16 -07:00