Commit Graph

420119 Commits

Author SHA1 Message Date
Shangwu Yao 15a1769631 Emit OpenCL metadata when targeting SPIR-V
This is required for converting function calls such as get_global_id()
into SPIR-V builtins.

Differential Revision: https://reviews.llvm.org/D123049
2022-04-05 20:58:32 +00:00
Bill Wendling 1acba8a4b5 [mlir] Reinstate the variable
Mid-air collition of patches.
2022-04-05 13:57:14 -07:00
Jonas Devlieghere a722dea4af
[lldb] Update reinterpret_cast in linux/Host.cpp
Fixes error: reinterpret_cast from type ‘const uint8_t*’ {aka ‘const
unsigned char*’} to type ‘char*’ casts away qualifiers
2022-04-05 13:52:07 -07:00
Nathan James b4ad3c3891 Reland "[ASTMatchers] Output currently matching node on crash"
Extend D120185 to also log the node being matched on in case of a crash.
This can help if a matcher is causing a crash or there are not enough interesting nodes bound.

Reviewed By: aaron.ballman

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

This reverts commit 61d67c8eec.

This relands commit 6e33e45b94.

Fixing the build issue on 32bit machines due to not enough free bits in the PointerUnion.
2022-04-05 21:47:16 +01:00
Jonas Devlieghere f2ea125ea0
[lldb] Change CreateMemoryInstance to take a WritableDataBuffer
Change the CreateMemoryInstance interface to take a WritableDataBuffer.

Differential revision: https://reviews.llvm.org/D123073
2022-04-05 13:46:41 -07:00
Jonas Devlieghere fc54427e76
[lldb] Refactor DataBuffer so we can map files as read-only
Currently, all data buffers are assumed to be writable. This is a
problem on macOS where it's not allowed to load unsigned binaries in
memory as writable. To be more precise, MAP_RESILIENT_CODESIGN and
MAP_RESILIENT_MEDIA need to be set for mapped (unsigned) binaries on our
platform.

Binaries are mapped through FileSystem::CreateDataBuffer which returns a
DataBufferLLVM. The latter is backed by a llvm::WritableMemoryBuffer
because every DataBuffer in LLDB is considered to be writable. In order
to use a read-only llvm::MemoryBuffer I had to split our abstraction
around it.

This patch distinguishes between a DataBuffer (read-only) and
WritableDataBuffer (read-write) and updates LLDB to use the appropriate
one.

rdar://74890607

Differential revision: https://reviews.llvm.org/D122856
2022-04-05 13:46:37 -07:00
Bill Wendling 4169650537 [mlir] Remove an unused variable and correct types.
No functionality change.
2022-04-05 13:44:12 -07:00
River Riddle 43c0a45a79 [mlir-vscode] Add better support for multiple workspace folders
We currently only launch one set of language clients when starting the extension,
but this has the unfortunate effect of applying the same settings to all workspace
folders. This commit adds support for multiple workspace folders by launching
a server for each folder in the workspace. This allows for having different servers
for different workspace folders, e.g. when there are multiple MLIR projects in
the same workspace.

Differential Revision: https://reviews.llvm.org/D122793
2022-04-05 13:41:40 -07:00
River Riddle ade148d936 [mlir-vscode] Add better resolution for server file paths
We currently require that server paths are full paths, which is
fairly inconvenient for a myriad of reasons. This commit
attempts to resolve a given server path with the current workspace.

This has a nice additional affect that we can now actually have
default server paths. This means that mlir-lsp-server and
mlir-pdll-lsp-server can be transparently picked up from
build directories (i.e. generally no need for upstream users to
configure the extension).

Fixes #54627

Differential Revision: https://reviews.llvm.org/D122792
2022-04-05 13:41:40 -07:00
Vladislav Khmelevsky 2e51a32219 [BOLT] Check for !isTailCall in isUnconditionalBranch
Add !isTailCall in isUnconditionalBranch check in order to sync the x86
and aarch64 and fix the fixDoubleJumps pass on aarch64.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

Differential Revision: https://reviews.llvm.org/D122929
2022-04-05 23:39:34 +03:00
Aaron Siddhartha Mondal 04b42c99f6 Fix typo in new -config-file option
The new -config-file option introduced by 9e1f4f1 was accidentally
referenced as args.config_path on the python side. This patch renames
args.config_path to args.config_file.

To avoid confusion with python file objects, the input argument for
get_tidy_invocation has been renamed from config_path to
config_file_path.

See GitHub issue #54728 for a discussion.
2022-04-05 16:28:49 -04:00
Nirvedh 01055ed1d7 [mlir][linalg] Move linalg.fill folding into linalg.generic pattern from canonicalization to elementwise fusion
Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D122847
2022-04-05 20:13:03 +00:00
Artur Pilipenko 857d699667 Move BasicBlock::getTerminator definition to the header
This way it can be inlined to its caller. This method
shows up in the profile and it is essentially a fancy
getter. It would benefit from inlining into its callers.

NFC.
2022-04-05 13:11:38 -07:00
Lang Hames 01bc5b7034 [JITLink] Fix sorting bug for PC-begin candidate symbols during EH-frame fixup.
The sort should have been lexicographic, but wasn't. This resulted in us
choosing a common symbol at address zero over the intended target function,
leading to a crash.

This patch also moves sorting up to the start of the pass, which means that we
only need to hold on to the canonical symbol at each address rather than a list
of candidates.
2022-04-05 13:02:28 -07:00
Paul Robinson 077f90315b [PS5] Add PS5 as a legal triple component 2022-04-05 12:55:12 -07:00
Jason Molenda ee394177e6 Refine memory buffer for importing shared cache objc class list
In https://reviews.llvm.org/D118972 I increased this buffer to be
big enough to import 261,144 classes but this is a lot more than
we currently have, an allocating a too-large buffer can add memory
pressure even if it's only for a short time.  Reduce the size of
this memory buffer to big enough to import 163,840 classes.  I'll
probably move to a scheme where we read the objc classes in chunks,
with a smaller buffer and multiple inferior function calls.

rdar://91275493
2022-04-05 12:49:40 -07:00
Tom Honermann 7c53fc4fe1 [clang] Emit target_clones resolver functions as COMDAT.
Previously, resolver functions synthesized for target_clones multiversion
functions were not emitted as COMDAT. Now fixed.
2022-04-05 15:34:35 -04:00
Tom Honermann 3531a4fa3b [clang] NFC: Extend comdat validation in target multiversion function tests. 2022-04-05 15:34:35 -04:00
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