Commit graph

420151 commits

Author SHA1 Message Date
Tom Honermann c54ad13602 [Lint][Verifier] NFC: Rename 'Assert*' macros to 'Check*'.
The LLVM IR verifier and analysis linter defines and uses several macros in
code that performs validation of IR expectations. Previously, these macros
were named with an 'Assert' prefix. These names were misleading since the
macro definitions are not conditioned on build kind; they are defined
identically in builds that have asserts enabled and those that do not. This
was confusing since an LLVM developer might expect these macros to be
conditionally enabled as 'assert' is. Further confusion was possible since
the LLVM IR verifier is implicitly disabled (in Clang::ConstructJob()) for
builds without asserts enabled, but only for Clang driver invocations; not
for clang -cc1 invocations. This could make it appear that the macros were
not active for builds without asserts enabled, e.g. when investigating
behavior using the Clang driver, and thus lead to surprises when running
tests that exercise the clang -cc1 interface.

This change renames this set of macros as follows:
  Assert -> Check
  AssertDI -> CheckDI
  AssertTBAA -> CheckTBAA
2022-04-05 15:34:35 -04:00
Bert Abrath 019e7b7f6e
[PartiallyInlineLibCalls] Don't partially inline a musttail libcall.
Partially inlining a libcall that has the musttail attribute
leads to broken LLVM IR, triggering an assertion in the IR verifier.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D123116
2022-04-05 22:30:50 +03:00
Benjamin Kramer e7f0552682 [mlir] Fix unused variable warning. NFCI. 2022-04-05 21:24:05 +02:00
Roy Sundahl 47e7a22471 [Darwin][ASan][Sanitizer] Enable dlclose-test for all darwin targets.
Test was being skipped on non-x86 darwin architectures.

rdar://79795770

Differential Revision: https://reviews.llvm.org/D123099
2022-04-05 12:21:36 -07:00
Jonas Devlieghere e9ec16177f
Change the LLVM signpost category
Currently, the LLVM/LLDB timers are visible in Instruments for all apps.

The developer-visible "PointsOfInterest" category is reserved for
runtime issues and developer-authored "important" logging. These logs
are visible to developer almost always in Instruments

The LLVM/LLDB timers do not belong there. Having these present in the
system is noisy and confusing to developers. This patch moves them under
a new "toolchain" category.

rdar://91266582

Differential revision: https://reviews.llvm.org/D123149
2022-04-05 12:18:31 -07:00
Jessica Paquette 5830afa532 [GlobalISel] NFC: Regen some tests + improve test coverage for wide even types
It turns out we don't do an awesome job with weird types like s318 (and other
types near them, like s316).

We don't have any test coverage for those types, so let's add some so it's
easier to see the impact of legalization improvements on them when we make
changes.

Since the test generator was changed, it's easier to update relevant tests prior
to changing things rather than squinting at a bunch of "ah, CHECK is now
CHECK-NEXT" lines. So, let's just regenerate a bunch of tests while we're
here.

Unfortunately the "CHECK-NEXT" scheme doesn't work with legalize-cmp for some
reason, and the test will fail. So keep that one having CHECK lines.
2022-04-05 12:13:22 -07:00
Scott Linder 09f33a430b [AMDGPU][OpenCL] Remove "printf and hostcall" diagnostic
The diagnostic is unreliable, and triggers even for dead uses of
hostcall that may exist when linking the device-libs at lower
optimization levels.

Eliminate the diagnostic, and directly document the limitation for
OpenCL before code object V5.

Make some NFC changes to clarify the related code in the
MetadataStreamer.

Add a clang test to tie OCL sources containing printf to the backend IR
tests for this situation.

Reviewed By: sameerds, arsenm, yaxunl

Differential Revision: https://reviews.llvm.org/D121951
2022-04-05 19:10:23 +00:00
Corentin Jabot 84f0a36b14 [Clang] Do not warn on unused lifetime-extending vars with side effects...
const auto & var = ObjectWithSideEffects();

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

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D122661
2022-04-05 21:03:02 +02:00
Lei Zhang 59d3a9e087 [mlir][vector] Separate high-D insert/extract strided slice rewrite
Right now `populateVectorInsertExtractStridedSliceTransforms` contains
two categories of patterns, one for decomposing high-D insert/extract
strided slices, the other for lowering them to shuffle ops.
They are at different levels---the former is in the middle, while
the latter is a step of final lowering. Split them to give users
more control of which pattern to pick.

This means break down the previous `VectorExtractStridedSliceOpRewritePattern`,
which is doing two things together.

Also renamed those patterns to be clearer.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D123137
2022-04-05 15:00:50 -04:00
Daniel Sanders 93977f37e6 Check if register class was changed in constrainOperandRegClass()
NFC
When no actual change happens there's no need to notify the
observers about the fact the register class is being constrained.
So we should avoid notifying observers when no change has
happened, because this can dramatically affect compile
time for particular test cases.

Reviewed By: dsanders, arsenm

Differential Revision: https://reviews.llvm.org/D122615
2022-04-05 11:55:07 -07:00
Walter Erquinigo 9bcaf6ddfe [lldb-vscode] Implement stderr/stdout on win32 and redirect lldb log to VSCode
This patch implements stderr/stdout forwarding on windows.
This was previously not implemented in D99974.
I added separate callbacks so the output can be sent to the different channels VSCode provides (OutputType::Stdout, OutputType::Stderr, OutputType::Console).

This patch also passes a log callback handler to SBDebugger::Create to be able to see logging output when it is enabled.

Since the output is now redirect on early startup I removed the calls to SetOutputFileHandle/SetErrorFileHandle, which set them to /dev/null.

I send the output of stderr/stdout/lldb log to OutputType::Console

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D123025
2022-04-05 11:54:03 -07:00
Michael Jones 5561ab3495 [libc] Add holder class for va_lists
This class is intended to be used in cases where a class is being used
on a va_list. It provides destruction and copy semantics with small
overhead. This is intended to be used in printf.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D123061
2022-04-05 11:39:57 -07:00
Jake Egan f9e0bc37db Specify --format for tests to workaround AIX big archive write operation
D122746 missed the following tests, so this patch adds them.

This patch refactors D122949, which marked the following tests XFAIL, but it makes more sense to temporarily add `--format=gnu` option because these tests aren’t testing `llvm-ar` and AIX won’t lose their coverage.

Reviewed By: jhenderson, MaskRay, DiggerLin

Differential Revision: https://reviews.llvm.org/D123063
2022-04-05 14:36:38 -04:00
Mehdi Amini 435a176db9 [mlir] Add the Emacs support for MLIR's LSP server
In order to use the MLIR LSP server in Emacs, first the `mlir-lsp-client.el`
has to be loaded via elisp and then, one should call `lsp-mlir-setup` function
to setup the LSP client. After that simply calling the `lsp` function while
the `mlir-mode` is active with result in finding the language server (default
to `mlir-lsp-server`) via the `lsp-mlir-server-executable` customization variable
and connecting to it by the LSP library. Users who use MLIR's language server
library to create their own server can simply set the variable `lsp-mlir-server-executable`
to point to their own implementation executable.

Reviewed By: tschuett

Differential Revision: https://reviews.llvm.org/D123002
2022-04-05 18:11:35 +00:00
Andrew Browne 5748219fd2 [DFSan] Add dfsan-combine-taint-lookup-table option as work around for
false negatives when dfsan-combine-pointer-labels-on-load=0 and
dfsan-combine-offset-labels-on-gep=0 miss data flows through lookup tables.

Example case:
628a2825f8/absl/strings/ascii.h (L182)

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D122787
2022-04-05 11:05:10 -07:00
Min-Yih Hsu d68b4dc0a8 [M68k] Adopt VarLenCodeEmitter for rest of the data instructions
This wraps up the encoding refactoring of all M68k instructions.
2022-04-05 10:55:26 -07:00
Sam McCall cf1c5507b7 FileManager: std::map => BumpPtrAllocator + DenseMap of pointers. NFC
This is both smaller and faster.

Differential Revision: https://reviews.llvm.org/D123144
2022-04-05 19:54:44 +02:00
Arjun P 79ad5fb295 [MLIR][Presburger] IntegerPolyhedron: add support for symbolic integer lexmin
Add support for computing the symbolic integer lexmin of a polyhedron.
This finds, for every assignment to the symbols, the lexicographically
minimum value attained by the dimensions. For example, the symbolic lexmin
of the set

`(x, y)[a, b, c] : (a <= x, b <= x, x <= c)`

can be written as

```
x = a if b <= a, a <= c
x = b if a <  b, b <= c
```

This also finds the set of assignments to the symbols that make the lexmin unbounded.

This was previously landed in da92f92621 and
reverted in b238c252e8 due to a build failure
in the code. Re-landing now with a fixed build.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D122985
2022-04-05 18:50:34 +01:00
Fabio Rossini Sluzala a0e4ba4b46 [clangd] Add support to extract method for ExtractFunction Tweak
I miss more automatically refactoring functions when working with already running code, so I am making some small addition that I hope help more people.

This works by checking if the function is a method (CXXMethodDecl), then collecting information about the function that the code is being extracted, looking for the declaration if it is out-of-line, creating the declaration if it is necessary and putting the extracted function as a class-method.

This is my first code review request, sorry if I did something wrong.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D122698
2022-04-05 19:49:17 +02:00
Michael Kruse c082ca16f1 [OpenMPIRBuilder] Detect and fix ambiguous InsertPoints for createSections.
Follow-up on D117226 for createSections.

Reviewed By: shraiysh

Differential Revision: https://reviews.llvm.org/D117835
2022-04-05 12:36:29 -05:00
David Blaikie bb3980ae9f DebugInfo: Don't use enumerators in template names for debug info as they are not canonical
Since enumerators may not be available in every translation unit they
can't be reliably used to name entities. (this also makes simplified
template name roundtripping infeasible - since the expected name could
only be rebuilt if the enumeration definition could be found (or only if
it couldn't be found, depending on the context of the original name))
2022-04-05 17:16:42 +00:00
Martin Storsjö 6efda5e6d6 [libcxx] [test] Fix the locale ctype widen tests on Windows
On Windows, like on macOS and FreeBSD, widening char(-5) in the
"C" locale succeeds and produces L'\u00fb'.

Switch widen_many to test \xfb instead of \x85; the mingw
version of btowc widens \x85 in the "C" locale into
\u2026 (which is the corresponding character according to the
Windows-1252 codepage), while Microsoft CRT's btowc widens it
into \u0085 (just like macOS and FreeBSD). Switch this to test \xfb
which is the character tested by the widen_1 test (as `char(-5)`),
which gets handled the same by all Windows implementations of btowc.

Differential Revision: https://reviews.llvm.org/D121003
2022-04-05 20:06:44 +03:00
owenca 357afd9528 [clang-format] Pass return code of git-clang-format by sys.exit()
Fixes #54758
2022-04-05 09:52:01 -07:00
Chris Bieneman 6599fdab2c Add DXILPrepare CodeGen pass
The DXIL Prepare pass handles the IR mutations required to convert
modern LLVM IR into something that more closely resembles LLVM-3.7 IR
so that the DXIL bitcode writer can emit 3.7 IR.

This change adds the codegen pass handling the first two IR
transformations:

* stripping new function attributes
* converting fneg into fsub

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D122081
2022-04-05 11:50:07 -05:00
Krzysztof Drewniak 408a67ff49 [MLIR][ROCm] Suppress warnings generated by HIP headers
This removes tens of warnings from build logs that we can't do
anything about.

Reviewed By: pcf000

Differential Revision: https://reviews.llvm.org/D122927
2022-04-05 16:49:37 +00:00
Craig Topper 3c831c9b28 [RISCV] Add support for vp.fptosi where the result is a mask type.
We can do this conversion by converting the same sized integer type, then compare the result with 0. The conversion is undefined if the converted FP value doesn't fit in an i1.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D122678
2022-04-05 09:48:04 -07:00
Simon Pilgrim b1e6ca9d22 [X86] fmaddsub/fmsubadd combines - add NOFMA target for reference 2022-04-05 17:47:46 +01:00
Jonas Devlieghere e90d8f024b
[lldb] Improve documentation for some of the platform functions
Improve the documentation for the platform functions that take a process
host architecture as input.

Differential revision: https://reviews.llvm.org/D122767
2022-04-05 09:47:32 -07:00
Jim Ingham 8c3a6fe37f Fix a mistyping introduced with the new container command.
I also added a call to help in the test which was crashing before
the test, and not after.
2022-04-05 09:42:05 -07:00
Alex Brachet 016e59bf2c Revert "[Scudo] enabling anonymous named pages on Linux 5.17 and onwards."
This reverts commit 6194992523.
2022-04-05 16:38:49 +00:00
Jonas Devlieghere 73714a3c60
[lldb] Fix undefined behavior: left shift of negative value
Fix undefined behavior in AppleObjCRuntimeV2 where we were left shifting
a signed value. This also removes redundant casts of unobfuscated to
uint64_t which it already is.

rdar://91242879

Differential revision: https://reviews.llvm.org/D123098
2022-04-05 09:37:31 -07:00
Pierre Gousseau a3d5f1cf5d [x86] Fix infinite loop inside DAG combiner with lzcnt feature.
The issue affects targets supporting fast-lzcnt such as btver2.
This removes extraneous zext/trunc node insertions to fix the infinite
loop.
This fixes Issue https://github.com/llvm/llvm-project/issues/54694

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

Reviewed By: RKSimon, spatel, lebedev.ri
2022-04-05 17:32:10 +01:00
Alisamar Husain d849959071 [lldb][intelpt] Remove IntelPTInstruction and move methods to DecodedThread
This is to reduce the size of the trace further and has appreciable results.

Differential Revision: https://reviews.llvm.org/D122991
2022-04-05 22:01:36 +05:30
Matt Devereau 2c3f66519c [SVE] Extend support for folding select + masked gathers
Extend the work done in D106376 to include masked gathers

Differential Revision: https://reviews.llvm.org/D122896
2022-04-05 16:27:11 +00:00
Kirill Bobyrev 211df7319a Fix the test after D123031 2022-04-05 18:21:24 +02:00
Simon Pilgrim f55fdded79 [MIPS] selectAddrFrameIndexOffset - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is used immediately below, so assert the cast is correct instead of returning nullptr
2022-04-05 17:20:39 +01:00
Hui Xie c00df57b86 [libc++] add global variable template std::views::empty
[libc++] add global variable template std::views::empty
Note it is neither a range adaptor, nor a CPO. It is simplify a global variable template.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D122996
2022-04-05 18:18:16 +02:00
Lorenzo Chelini ae0fb61303 [MLIR] Check for static shape before bare pointer conversion
Originally in the returnOp conversion, the result type was changing to bare
pointer if the type was a memref. This is incorrect as conversion to bare
pointer can only be done if the memref has static shape, strides and offset.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D123121
2022-04-05 17:56:41 +02:00
Mark de Wever 83de107382 [libc++][test] Adds an cpp20_output_iterator.
This iterator is used to test code that only needs to satisfy the
output_iterator concept. Follow-up changes will use this iterator in
older language Standards.

Reviewed By: ldionne, #libc, philnik, var-const

Differential Revision: https://reviews.llvm.org/D122072
2022-04-05 17:31:42 +02:00
Jean Perier 0601a0dc01 [flang] Fix fir.embox codegen with constant interior shape
Fix https://github.com/flang-compiler/f18-llvm-project/issues/1416.

The `constRows` variable was being decremented too soon, causing the
last constant interior dimension extent being used to multiply the GEP
offset. This lead to wrong address computation and caused segfaults.

Note: also upstream fir.embox tests that can be upstreamed.

Differential Revision: https://reviews.llvm.org/D123130
2022-04-05 17:27:03 +02:00
Jean Perier bb3afae99b [flang] Set lower bounds of array section fir.embox to one
Do not use the shift of a fir.embox to set lower bounds if there is
a fir.slice operand. This matches Fortran semantics where lower bounds
of array sections are ones.
Note that in case there is a fir.slice, the array shift may be provided
because it is used to calculate the origin/base address of an array slice.

Add a TODO for substring codegen since I noticed it was not upstreamed
yet and would cause some program to silently compile incorrectly.

Differential Revision: https://reviews.llvm.org/D123123
2022-04-05 17:25:48 +02:00
Yaxun (Sam) Liu 09a5eae0d1 [clang-offload-bundler] add -input/-output options
Currently, clang-offload-bundler has -inputs and -outputs options that accept
values with comma as the delimiter. This causes issues with file paths
containing commas, which are valid file paths on Linux.

This add two new options -input and -output, which accept one single file,
and allow multiple instances. This allows arbitrary file paths. The old
-inputs and -outputs options will be kept for backward compatibility, but
are not allowed to be used with -input and -output options for simplicity.
In the future, -inputs and -outputs options will be phasing out.

RFC: https://discourse.llvm.org/t/rfc-adding-input-and-output-options-to-clang-offload-bundler/60049

Patch by: Siu Chi Chan

Reviewed by: Yaxun Liu

Differential Revision: https://reviews.llvm.org/D120662
2022-04-05 11:13:01 -04:00
Kirill Bobyrev 012e90bb24
Reland "[clangd] IncludeCleaner: Add support for IWYU pragma private"
This lands 4cb38bfe76 again.
2022-04-05 16:57:39 +02:00
Louis Dionne 8ec4999766 [libc++] Tidy up tests for deduction guides and other compile-time failing properties in std::string
Instead of using `.fail.cpp` tests, use `.verify.cpp` to check for the
exact reason of the failure. In the case of deduction guides, use SFINAE
based tests instead since that is our preferred way of testing those.

Finally, ensure that we actually run the test in `iter_alloc_deduction.pass.cpp`,
since we were not running anything before.

Differential Revision: https://reviews.llvm.org/D123055
2022-04-05 10:52:52 -04:00
Nikita Popov 516333d632 [ValueTracking] Handle non-pow2 align assume bundle (PR53693)
https://reviews.llvm.org/D119414 clarified that this is legal IR,
so handle it gracefully. (We could aggressively use the fact that
the pointer must be a null pointer in that case, but I'm not
bothering with that.)

Fixes https://github.com/llvm/llvm-project/issues/53693.
2022-04-05 16:48:40 +02:00
Nikita Popov 4f4bffec12 [X86] Regenerate test checks (NFC) 2022-04-05 16:33:52 +02:00
Kirill Bobyrev 3de4d5e6dd [clangd] Use stable keys for CanonicalIncludes mappings
This patch switches CanonicalInclude mappings to use `llvm::sys::fs::UniqueID` for a stable file representation because the `FileEntry::getName()` results turn out to be changing throughout the lifetime of a program (exposed in D120306). This patch makes it possible for D120306 to be re-landed and increases overall stability.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D123031
2022-04-05 16:27:54 +02:00
Louis Dionne 45ce3f3252 [libc++] Silence new deprecation warnings for C functions in tests 2022-04-05 10:26:32 -04:00
Yitzhak Mandelbaum d002495b94 [clang][dataflow] Support integral casts
Adds support for implicit casts `CK_IntegralCast` and `CK_IntegralToBoolean`.

Differential Revision: https://reviews.llvm.org/D123037
2022-04-05 13:55:32 +00:00
Nathan Sidwell 54c50336e4 [clang] Document p1703 not needed
We list p1703 as unimplemented, but it is subsumed by p1857.

Reviewed By: tbaeder

Differential Revision: https://reviews.llvm.org/D123120
2022-04-05 06:54:31 -07:00