Johannes Doerfert [Tue, 13 Jul 2021 20:35:58 +0000 (15:35 -0500)]
[OpenMP] Encode `omp [...] assume[...]` assumptions with `omp[x]` prefix
Since these assumptions are coming from OpenMP it makes sense to mark
them as such in the generic IR encoding. Standardized assumptions will
be named
omp_ASSUMPTION_NAME
and extensions will be named
ompx_ASSUMPTION_NAME
which is the OpenMP 5.2 syntax for "extensions" of any kind.
This also matches what the OpenMP-Opt pass expects.
Summarized,
#pragma omp [...] assume[s] no_parallelism
now generates the same IR assumption annotation as
__attribute__((assume("omp_no_parallelism")))
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D105937
Johannes Doerfert [Thu, 2 Sep 2021 19:12:22 +0000 (14:12 -0500)]
[GlobalOpt][FIX] Do not embed initializers into AS!=0 globals
Not all address spaces support initializers for globals and we can
therefore not set them without checking if they are allowed. This
patch adds a hook into TTI to check if an AS allows non-undef
initializers. We disable it for all but address space 0 by default,
NVPTX and AMDGPU targets allow all but address space 3.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D109337
Johannes Doerfert [Wed, 11 Aug 2021 05:03:42 +0000 (00:03 -0500)]
[OpenMP] Group side-effects to improve guarding efficiency
When we guard side-effects as part of SPMDzation we do it for
consecutive instructions that need guarding. This patch will try to
reorder guarded side-effects in a block to decrease the number of
guarded regions we need. It does not use any smarts, e.g., alias
analysis, to move side-effects over non-interfering reads. Instead,
it only moves side-effects downwards to the next guarded side-effect
if there was nothing in between that could have possibly be affected.
Reviewed By: ggeorgakoudis
Differential Revision: https://reviews.llvm.org/D109070
David Green [Fri, 10 Sep 2021 17:03:54 +0000 (18:03 +0100)]
[ARM] Remove unused tblgen arguments. NFC
As per D109359, this removes or makes use of some of the existing unused
NEON and base ARM tblgn arguments.
Nikita Popov [Fri, 10 Sep 2021 16:13:08 +0000 (18:13 +0200)]
[CallLowering] Support opaque pointers
Always use the byval/inalloca/preallocated type (which is required
nowadays), don't fall back on the pointer element type.
This requires adding Function::getParamPreallocatedType() to
mirror the CallBase API, so that the templated code can work with
both.
Nikita Popov [Fri, 10 Sep 2021 16:15:40 +0000 (18:15 +0200)]
[IR] Remove unused parameter (NFC)
Craig Topper [Fri, 10 Sep 2021 16:03:59 +0000 (09:03 -0700)]
[RISCV] Enable CGP to sink splat operands of Add/Sub/Mul/Shl/LShr/AShr
LICM may have pulled out a splat, but with .vx instructions we
can fold it into an operation.
This patch enables CGP to reverse the LICM transform and move the
splat back into the loop.
I've started with the commutable integer operations and shifts, but we can
extend this with more operations in future patches.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D109394
Craig Topper [Thu, 9 Sep 2021 22:17:51 +0000 (15:17 -0700)]
[RISCV] Teach vsetvli insertion that stores don't use the policy bits in vtype.
This can avoid a vsetvl after a tail undisturbed operation.
Differential Revision: https://reviews.llvm.org/D109549
Michał Górny [Fri, 10 Sep 2021 16:02:21 +0000 (18:02 +0200)]
[lldb] [test] Remove parent check in Subprocess/clone-follow-child-softbp.test
Hopefully this will resolve the remaining flakiness.
Sam Clegg [Fri, 10 Sep 2021 08:46:03 +0000 (04:46 -0400)]
[lld][WebAssembly] Cleanup output of --verbose
Remove some unnecessary logging from wasm-ld when running under
`--verbose`. Unlike `-debug` this logging is available in release
builds. This change makes it little more minimal/readable.
Also, avoid compiling the `debugWrite` function in releaase builds
where it does nothing. This should remove a lot debug strings from
the binary, and avoid having to construct unused debug strings at
runtime.
Differential Revision: https://reviews.llvm.org/D109583
Michał Górny [Fri, 10 Sep 2021 14:34:20 +0000 (16:34 +0200)]
[lldb] [test] Skip A/vRun/QEnvironment* tests on Windows, and fix them
Skip A/vRun/QEnvironment* tests on Windows as testing for output is
known not to work there. Add a missing output check to the vRun test.
Michał Górny [Fri, 10 Sep 2021 14:27:29 +0000 (16:27 +0200)]
[lldb] [test] Attempt to fix gdb_remote_client A/vRun tests on Windows
Michał Górny [Fri, 10 Sep 2021 14:06:29 +0000 (16:06 +0200)]
[lldb] [test] Mark new launch/QEnvironment tests as llgs category
Michał Górny [Fri, 10 Sep 2021 14:03:02 +0000 (16:03 +0200)]
[lldb] [test] Skip file permission tests on Windows
David Green [Fri, 10 Sep 2021 14:06:31 +0000 (15:06 +0100)]
[ARM] Remove unused tblgen arguments. NFCI
As per D109359, this removes or makes use of some of the existing unused
MVE tblgn arguments.
Sam Clegg [Tue, 31 Aug 2021 11:04:31 +0000 (07:04 -0400)]
[WebAssembly][libObject] Avoid re-use of Section object during parsing
The re-use of this struct across iterations of the loop was causing
fields (specifically Name) to be incorrectly shared between multiple
sections.
Differential Revision: https://reviews.llvm.org/D108984
Saiyedul Islam [Fri, 10 Sep 2021 11:16:13 +0000 (16:46 +0530)]
[clang-offload-bundler] Fix compatibility testing for non-assert builds
Test using debug-only=CodeObjectComaptibility was failing in
non-assert builds, so it has been moved to a different file which
requires assert.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D109592
Nikita Popov [Sat, 4 Sep 2021 10:18:52 +0000 (12:18 +0200)]
[OpaquePtr] Forbid mixing typed and opaque pointers
Currently, opaque pointers are supported in two forms: The
-force-opaque-pointers mode, where all pointers are opaque and
typed pointers do not exist. And as a simple ptr type that can
coexist with typed pointers.
This patch removes support for the mixed mode. You either get
typed pointers, or you get opaque pointers, but not both. In the
(current) default mode, using ptr is forbidden. In -opaque-pointers
mode, all pointers are opaque.
The motivation here is that the mixed mode introduces additional
issues that don't exist in fully opaque mode. D105155 is an example
of a design problem. Looking at D109259, it would probably need
additional work to support mixed mode (e.g. to generate GEPs for
typed base but opaque result). Mixed mode will also end up
inserting many casts between i8* and ptr, which would require
significant additional work to consistently avoid.
I don't think the mixed mode is particularly valuable, as it
doesn't align with our end goal. The only thing I've found it to
be moderately useful for is adding some opaque pointer tests in
between typed pointer tests, but I think we can live without that.
Differential Revision: https://reviews.llvm.org/D109290
Filipp Zhinkin [Fri, 10 Sep 2021 13:06:48 +0000 (09:06 -0400)]
[InstCombine] add tests for X == 0 ? 0 : X * Y ; NFC
These are the tests for D108408 with current baseline results.
David Green [Fri, 10 Sep 2021 12:48:15 +0000 (13:48 +0100)]
[AArch64] Regenerate some test checks. NFC
This updates some mostly update_test_check test files and generates the
check lines with the script, making them more maintainable.
Jan Svoboda [Fri, 10 Sep 2021 12:44:18 +0000 (14:44 +0200)]
[clang][deps] Test diagnostic options are being respected
This patch tests code in D108976. This split is necessary to avoid temporary regression.
Depends on D108974,
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D109158
Jan Svoboda [Fri, 10 Sep 2021 12:42:11 +0000 (14:42 +0200)]
[clang][deps] Sanitize both instances of DiagnosticOptions
During dependency scanning, we generally want to suppress -Werror. Apply the same logic to the DiagnosticOptions instance used for command-line parsing.
This fixes a test failure on the PS4 bot, where the system header directory could not be found, which was reported due to -Werror being on the command line and not being sanitized.
Sander de Smalen [Fri, 10 Sep 2021 11:54:22 +0000 (12:54 +0100)]
[SelectionDAG] PromoteIntRes_EXTRACT_SUBVECTOR for scalable vectors (widening).
This patch implements legalization of EXTRACT_SUBVECTOR for the case
where the result needs promoting, and the input type requires widening.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D109509
Sander de Smalen [Fri, 10 Sep 2021 11:13:54 +0000 (12:13 +0100)]
[SelectionDAG] PromoteIntRes_EXTRACT_SUBVECTOR for scalable vectors.
This patch implements legalization of EXTRACT_SUBVECTOR for the case
where the result needs promoting, and the input type is either legal
or requires splitting.
The idea is that the operation is broken down into simpler steps,
by first extracting a smaller subvector until the input vector
becomes legal or requires promotion.
Reviewed By: CarolineConcatto
Differential Revision: https://reviews.llvm.org/D109313
Pavel Labath [Fri, 10 Sep 2021 12:16:00 +0000 (14:16 +0200)]
[lldb] Clean up Platform/CMakeLists.txt
Remove comments looking like preprocessor directives (thankfully cmake
does not have those yet), and sort the file.
Alex Zinenko [Fri, 10 Sep 2021 12:08:15 +0000 (14:08 +0200)]
[mlir] spelling and style changes in ReconcileUnrealizedCasts.cpp. NFC.
Michał Górny [Mon, 16 Aug 2021 17:33:07 +0000 (19:33 +0200)]
[lldb] [gdb-remote] Use standardized GDB errno values
GDB uses normalized errno values for vFile errors. Implement
the translation between them and system errno values in the gdb-remote
plugin.
Differential Revision: https://reviews.llvm.org/D108148
Michał Górny [Thu, 12 Aug 2021 15:01:30 +0000 (17:01 +0200)]
[lldb] [gdb-remote] Support QEnvironment fallback to hex-encoded
Fall back to QEnvironmentHexEncoded if QEnvironment is not supported.
The latter packet is an LLDB extension, while the former is universally
supported.
Add tests for both QEnvironment and QEnvironmentHexEncoded packets,
including both use due to characters that need escaping and fallback
when QEnvironment is not supported.
Differential Revision: https://reviews.llvm.org/D108018
Michał Górny [Wed, 11 Aug 2021 20:58:11 +0000 (22:58 +0200)]
[lldb] [gdb-remote] Implement the vRun packet
Implement the simpler vRun packet and prefer it over the A packet.
Unlike the latter, it tranmits command-line arguments without redundant
indices and lengths. This also improves GDB compatibility since modern
versions of gdbserver do not implement the A packet at all.
Make qLaunchSuccess not obligatory when using vRun. It is not
implemented by gdbserver, and since vRun returns the stop reason,
we can assume it to be successful.
Differential Revision: https://reviews.llvm.org/D107931
Michał Górny [Tue, 10 Aug 2021 11:01:34 +0000 (13:01 +0200)]
[lldb] [gdb-remote] Add fallbacks for vFile:mode and vFile:exists
Add a GDB-compatible fallback to vFile:fstat for vFile:mode, and to
vFile:open for vFile:exists. Note that this is only partial fallback,
as it fails if the file cannot be opened.
Differential Revision: https://reviews.llvm.org/D107811
Michał Górny [Tue, 10 Aug 2021 10:03:35 +0000 (12:03 +0200)]
[lldb] Add new commands and tests for getting file perms & exists
Add two new commands 'platform get-file-permissions' and 'platform
file-exists' for the respective bits of LLDB protocol. Add tests for
them. Fix error handling in GetFilePermissions().
Differential Revision: https://reviews.llvm.org/D107809
Michał Górny [Fri, 10 Sep 2021 09:17:08 +0000 (11:17 +0200)]
[lldb] [test] Move "platform connect" logic into a common class
Create a common GDBPlatformClientTestBase class and move the platform
select/connect logic there to reduce duplication.
Differential Revision: https://reviews.llvm.org/D109585
Anastasia Stulova [Fri, 10 Sep 2021 12:05:03 +0000 (13:05 +0100)]
[OpenCL][Docs] Update OpenCL 3.0 status info.
Update info on OpenCLSupport page to reflect changes
committed after release 13 branched.
Jan Svoboda [Fri, 10 Sep 2021 11:46:01 +0000 (13:46 +0200)]
[clang][tooling] Properly initialize DiagnosticsEngine for cc1 command-line construction
In `ToolInvocation::run`, the driver -> cc1 command-line transformation uses `DiagnosticsEngine` that wasn't completely initialized. This patch ensures `ProcessWarningOptions(DiagnosticsEngine&, const DiagnosticOptions &)` is called.
Depends on D108982.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D108974
Max Kazantsev [Fri, 10 Sep 2021 11:45:03 +0000 (18:45 +0700)]
[Test][NFC] Regenerate checks in test
Jan Svoboda [Fri, 10 Sep 2021 11:43:48 +0000 (13:43 +0200)]
[clang][deps] Use correct DiagnosticOptions for command-line handling
In this patch the dependency scanner starts using proper `DiagnosticOptions` parsed from the actual TU command-line in order to mimic what the actual compiler would do. The actual functionality will be enabled and tested in follow-up patches. (This split is necessary to avoid temporary regression.)
Depends on D108976.
Reviewed By: dexonsmith, arphaman
Differential Revision: https://reviews.llvm.org/D108982
Stephan Herhut [Fri, 10 Sep 2021 10:58:18 +0000 (12:58 +0200)]
[mlir][linalg] Fix bufferize pattern to allow unknown operations in body of generic
The original version of the bufferization pattern for linalg.generic would
manually clone operations within the region to the bufferized clone of the
operation. This triggers legality requirements on those operations in the
conversion infra. Instead, this now uses the rewriter to inline the region
instead, avoiding those legality requirements.
Differential Revision: https://reviews.llvm.org/D109581
Sjoerd Meijer [Fri, 3 Sep 2021 14:05:09 +0000 (15:05 +0100)]
[LoopFlatten] Make the analysis more robust after IV widening
LoopFlatten wasn't triggering on this motivating case after IV widening:
void foo(int *A, int N, int M) {
for (int i = 0; i < N; ++i)
for (int j = 0; j < M; ++j)
f(A[i*M+j]);
}
The reason was that the old induction phi nodes were getting in the way. These
narrow and dead induction phis are not always trivially dead, and having both
the narrow and wide IVs confused the analysis and caused it to bail. This adds
some extra bookkeeping for these old phis, so we can filter them out when
checks on phi nodes are performed. Other clean up passes will get rid of these
old phis and increment instructions.
As this was one of the motivating examples from the beginning, it was
surprising this wasn't triggering from C/C++ code. It looks like the IR and CFG
is just slightly different.
Differential Revision: https://reviews.llvm.org/D109309
Jan Svoboda [Fri, 10 Sep 2021 10:50:51 +0000 (12:50 +0200)]
[clang][tooling] Accept custom diagnostic options in ToolInvocation
This patch allows the clients of `ToolInvocation` to provide custom diagnostic options to be used during driver -> cc1 command-line transformation and parsing.
Tests covering this functionality are in a follow-up commit. To make this testable, the `DiagnosticsEngine` needs to be properly initialized via `CompilerInstance::createDiagnostics`.
Reviewed By: dexonsmith, arphaman
Differential Revision: https://reviews.llvm.org/D108976
Anastasia Stulova [Fri, 10 Sep 2021 11:29:11 +0000 (12:29 +0100)]
[OpenCL][Docs] Added ref to libclcxx
Linked libclcxx GitHub project page in C++ libraries
for OpenCL section on OpenCLSupport page.
Differential Revision: https://reviews.llvm.org/D109526
Anastasia Stulova [Mon, 6 Sep 2021 12:44:23 +0000 (13:44 +0100)]
[OpenCL][Docs] Update OpenCL 3.0 implementation status.
Update a section of OpenCLSupport page to reflect the latest
development in OpenCL 3.0 support for release 13.
Differential Revision: https://reviews.llvm.org/D109320
Raphael Isemann [Fri, 10 Sep 2021 11:10:09 +0000 (13:10 +0200)]
[lldb] Fix Clang modules build after D101329
D101329 introduces the Process:SaveCore function returning a
`llvm::Expected<bool>`. That function causes that Clang with -fmodules crashes
while compiling LLDB's PythonDataObjects.cpp. With enabled asserts Clang fails
because of:
Assertion failed: (CachedFieldIndex && "failed to find field in parent")
Crash can be reproduced by building via -DLLVM_ENABLE_MODULES=On with Clang
12.0.1 and then building PythonDataObjects.cpp.o .
Clang bug is tracked at rdar://
82901462
Jean Perier [Fri, 10 Sep 2021 11:07:13 +0000 (13:07 +0200)]
[flang] Signal EOR in non advancing IO and move to next record
When an end of record is met in non advancing IO:
- Set IOSTAT if present according to 12.11.4 (5).
- Position the file to the next record (12.11.4 (4)).
The previous code was only signaling EOR for fixed record length IO.
Reading at 12.11.4, I do not find the rational for this condition, so I
removed it.
It also does not seem the presence of padding should prevent
the EOR signaling.
The positionning to the next record was block when EOR is signaling
in FinishReadingRecord because ErrorHandler.isError() is true in this
case.
EOR in input is not an error, but I am not confident to modify
ErrorHandler.isError() to cover that. However, In FinishReadingRecord,
the code should not bail if the error is simply an end of record.
I did not check the SIZE requirements here because GetSize runtime is
not yet implemented.
Differential Revision: https://reviews.llvm.org/D109505
Michał Górny [Fri, 10 Sep 2021 10:51:13 +0000 (12:51 +0200)]
[lldb] [test] Synchronize before the breakpoint in fork tests
We set breakpoint on child_func, so synchronization inside it is too
late to guarantee ordering between the parent output and child
breakpoint. Split the function in two, and perform synchronization
before the breakpoint.
Differential Revision: https://reviews.llvm.org/D109591
Rosie Sumpter [Wed, 8 Sep 2021 12:42:33 +0000 (13:42 +0100)]
[SVE][LoopVectorize] Optimise code generated by widenPHIInstruction
For SVE, when scalarising the PHI instruction the whole vector part is
generated as opposed to creating instructions for each lane for fixed-
width vectors. However, in some cases the lane values may be needed
later (e.g for a load instruction) so we still need to calculate
these values to avoid extractelement being called on the vector part.
Differential Revision: https://reviews.llvm.org/D109445
Serge Bazanski [Fri, 10 Sep 2021 10:54:43 +0000 (10:54 +0000)]
[Lanai] implement wide immediate support
This fixes LanaiTTIImpl::getIntImmCost to return valid costs for i128
(and wider) values. Previously any immediate wider than
64 bits would cause Lanai llc to crash.
A regression test is also added that exercises this functionality.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D107091
Serge Bazanski [Fri, 10 Sep 2021 10:45:25 +0000 (10:45 +0000)]
[Lanai] fix MC / objdump
D78776 removed is{Call,Branch,UnconditionalBranch} guards in objdump
before calling MCInstrAnalysis::evaluateBranch. This is fine for other
architectures as they gracefully handle evaluateBranch being called on
non-branches. However, the Lanai MCInstrAnalysis implementation didn't
and that change caused it to crash.
This inserts the same guards back into Lanai's evaluateBranch
implementation and adds a smoke test that exercises `llc | objdump` so
this kind of regression is hopefully caught next time.
Reviewed By: jpienaar, MaskRay
Differential Revision: https://reviews.llvm.org/D107593
Jan Svoboda [Fri, 10 Sep 2021 10:44:17 +0000 (12:44 +0200)]
[clang][deps] NFC: Extract ModuleName initialization
Cheng Wang [Thu, 9 Sep 2021 10:05:06 +0000 (18:05 +0800)]
[libc] Check signs instead of values in memcmp unittests.
The C standard only guarantees the sign of return value. The exact return
value is implementation defined.
Reviewed By: gchatelet
Differential Revision: https://reviews.llvm.org/D109588
Jan Svoboda [Fri, 10 Sep 2021 10:17:06 +0000 (12:17 +0200)]
[clang][deps] NFC: Remove CompilationDatabase from DependencyScanningTool API
This patch simplifies the dependency scanner API. Depends on D108980.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D108981
Matthias Springer [Fri, 10 Sep 2021 10:06:13 +0000 (19:06 +0900)]
[mlir][scf] Loop peeling: Use scf.for for partial iteration
Generate an scf.for instead of an scf.if for the partial iteration. This is for consistency reasons: The peeling of linalg.tiled_loop also uses another loop for the partial iteration.
Note: Canonicalizations patterns may rewrite partial iterations to scf.if afterwards.
Differential Revision: https://reviews.llvm.org/D109568
Michał Górny [Fri, 10 Sep 2021 09:59:06 +0000 (11:59 +0200)]
[lldb] [gdb-server] Zero-initialize fields on WIN32
Michał Górny [Tue, 10 Aug 2021 16:36:11 +0000 (18:36 +0200)]
Reland "[lldb] [gdb-server] Implement the vFile:fstat packet"
Now with an #ifdef for WIN32.
Differential Revision: https://reviews.llvm.org/D107840
Michał Górny [Fri, 10 Sep 2021 09:43:24 +0000 (11:43 +0200)]
Revert "[lldb] [gdb-server] Implement the vFile:fstat packet"
This reverts commit
9e886fbb18b525c080c04f4a12bd481c9aa849c0. It breaks
on Windows.
Jan Svoboda [Mon, 30 Aug 2021 14:05:15 +0000 (16:05 +0200)]
[clang][deps] NFC: Remove CompilationDatabase from DependencyScanningWorker API
This patch simplifies the dependency scanner API. Depends on D108979.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D108980
Michał Górny [Tue, 10 Aug 2021 16:36:11 +0000 (18:36 +0200)]
[lldb] [gdb-server] Implement the vFile:fstat packet
Differential Revision: https://reviews.llvm.org/D107840
Michał Górny [Mon, 9 Aug 2021 19:25:18 +0000 (21:25 +0200)]
[lldb] [gdb-remote] Implement fallback to vFile:stat for GetFileSize()
Implement a fallback to getting the file size via vFile:stat packet
when the remote server does not implement vFile:size. This makes it
possible to query file sizes from remote gdbserver.
Note that unlike vFile:size, the fallback will not work if the server is
unable to open the file.
While at it, add a few tests for the 'platform get-size' command.
Differential Revision: https://reviews.llvm.org/D107780
David Green [Fri, 10 Sep 2021 09:08:57 +0000 (10:08 +0100)]
[AArch64] Rewrite addsub_ext.ll test. NFC
Rewrite this test to not rely on volatile stores in a large function,
just use separate functions like any other test would.
Jan Svoboda [Fri, 10 Sep 2021 08:24:16 +0000 (10:24 +0200)]
[clang][deps] NFC: Stop going through ClangTool
The dependency scanner currently uses `ClangTool` to invoke the dependency scanning action.
However, `ClangTool` seems to be the wrong level of abstraction. It's intended to be run over a collection of compile commands, which we actively avoid via `SingleCommandCompilationDatabase`. It automatically injects `-fsyntax-only` and other flags, which we avoid by calling `clearArgumentsAdjusters()`. It deduces the resource directory based on the current executable path, which we'd like to change to deducing from `argv[0]`.
Internally, `ClangTool` uses `ToolInvocation` which seems to be more in line with what the dependency scanner tries to achieve. This patch switches to directly using `ToolInvocation` instead. NFC.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D108979
Alfonso Sánchez-Beato [Fri, 10 Sep 2021 08:55:26 +0000 (09:55 +0100)]
[llvm-objcopy][COFF] Fix test for debug dir presence
If the number of directories was 6 (equal to the DEBUG_DIRECTORY
index), patchDebugDirectory() was run even though the debug directory
is actually the 7th entry. Use <= in the comparison to fix that.
This fixes https://llvm.org/PR51243
Differential Revision: https://reviews.llvm.org/D106940
Reviewed by: jhenderson
Cheng Wang [Sun, 5 Sep 2021 03:09:34 +0000 (11:09 +0800)]
[libc] Some clean work with memmove.
- Replace `move_byte_forward()` with `memcpy`. In `memcpy` implementation,
it copies bytes forward from beginning to end. Otherwise, `memmove` unit
tests will break.
- Make `memmove` unit tests work.
Reviewed By: gchatelet
Differential Revision: https://reviews.llvm.org/D109316
Florian Hahn [Fri, 10 Sep 2021 06:58:18 +0000 (08:58 +0200)]
[ARM] Remove unnecessary use of replaceSymbolicStrideSCEV (NFC).
When passing an empty strides map, there's nothing to replace for
replaceSymbolicStrideSCEV and it just returns the SCEV for Ptr. There
should be no need to call the function.
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D109462
Tobias Gysi [Fri, 10 Sep 2021 08:34:56 +0000 (08:34 +0000)]
[mlir][linalg] Pass all operands to tile to the tile loop region builder (NFC).
Extend the signature of the tile loop nest region builder to take all operand values to use and not just the scf::For iterArgs. This change allows us to pass in all block arguments of TiledLoop and use them directly instead of replacing them after the loop generation.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D109569
Petr Hosek [Fri, 10 Sep 2021 07:07:07 +0000 (00:07 -0700)]
[CMake] Use NOT instead of STREQUAL
`<var> STREQUAL ""` fails when `<var>` is unset which can be the
case when using runtimes as top-level build. Use `NOT` instead.
Differential Revision: https://reviews.llvm.org/D109570
Diana Picus [Fri, 10 Sep 2021 08:07:24 +0000 (10:07 +0200)]
[clang][deps] Stop using `ClangTool` for virtual files
This patch changes how the dependency scanner creates the fake input file when scanning dependencies of a single module (introduced in D109485). The scanner now has its own `InMemoryFilesystem` which sits under the minimizing FS (when that's requested). This makes it possible to drop the duplicate work in `DependencyScanningActions::runInvocation` that sets up the main file ID. Besides that, this patch makes it possible to land D108979, where we drop `ClangTool` entirely.
Depends on D109485.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D109498
Sjoerd Meijer [Fri, 10 Sep 2021 07:41:53 +0000 (08:41 +0100)]
[FuncSpec] Don't specialise call sites that have the MinSize attribute set
The MinSize attribute can be attached to both the callee and the caller
in the callsite. Function specialisation was already skipped for function
declarations (callees) with MinSize. This also skips specialisations for
the callsite when it has MinSize set.
Differential Revision: https://reviews.llvm.org/D109441
Michał Górny [Thu, 9 Sep 2021 13:36:55 +0000 (15:36 +0200)]
[lldb] [Process/FreeBSD] Introduce mips64 FPU reg support
Differential Revision: https://reviews.llvm.org/D96766
Michał Górny [Thu, 9 Sep 2021 10:15:22 +0000 (12:15 +0200)]
[lldb] [test] Add synchronization fix Subprocess test flakiness
Add synchronization routines to ensure that Subprocess tests output
in a predictable order, and all test strings are output before the tests
terminate.
Differential Revision: https://reviews.llvm.org/D109495
Nicolas Vasilache [Thu, 9 Sep 2021 15:06:51 +0000 (15:06 +0000)]
[mlir][Linalg] Properly order extract_slice traversal in comprehensive bufferization
This revision fixes the traversal order of extract_slice during the inplace analysis.
It was previously thought that such ops could be analyzed at the very end.
This is unfortunately not true as the AliasInfo for dependents of these ops need to be updated.
This change allows the aliases introduced by the bufferization of extract_slice to be properly propagated.
Differential Revision: https://reviews.llvm.org/D109519
Alexey Lapshin [Wed, 8 Sep 2021 16:27:29 +0000 (19:27 +0300)]
[DebugInfo][NFC] Erase capacity in DWARFUnit::clearDIEs().
DWARFUnit::clearDIEs() uses std::vector::shrink_to_fit() to make
capacity of DieArray matched with its size(). The shrink_to_fit()
is not binding request to make capacity match with size().
Thus the memory could still be reserved after DWARFUnit::clearDIEs()
is called. This patch erases capacity when DWARFUnit::clearDIEs() is requested.
So the memory occupied by dies would be freed.
Differential Revision: https://reviews.llvm.org/D109499
Marius Brehler [Thu, 9 Sep 2021 09:52:08 +0000 (09:52 +0000)]
[mlir] Replace `include_directories`
Switches to adding target specific, private includes instead of adding
global includes.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D109494
Bjorn Pettersson [Thu, 9 Sep 2021 20:19:29 +0000 (22:19 +0200)]
[NPM] Complementary fixes for opt option -print-pipeline-passes
Make sure we handle some more adaptors etc (such as cgscc and devirt).
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D109542
Chris Lattner [Thu, 9 Sep 2021 23:20:25 +0000 (16:20 -0700)]
[APInt] Enable APInt to support zero bit integers.
Motivation: APInt not supporting zero bit values leads to
a lot of special cases in various bits of code, particularly
when using APInt as a bit vector (where you want to start with
zero bits and then concat on more. This is particularly
challenging in the CIRCT project, where the absence of zero-bit
ConstantOp forces duplication of ops and makes instcombine-like
logic far more complicated.
Approach: zero bit integers are weird. There are two reasonable
approaches: either make it illegal to do general arithmetic on
them (e.g. sign extends), or treat them as as implicitly having
a zero value. This patch takes the conservative approach, which
enables their use in bitvector applications.
Differential Revision: https://reviews.llvm.org/D109555
Liu, Chen3 [Fri, 10 Sep 2021 03:02:12 +0000 (11:02 +0800)]
[X86][NFC] Remove unused encoding string: VK[1/2/4/8/16]PAIR
This is also a bug. The VK[1/2/4/8/16]PAIR here should be VK[1/2/4/8/16]Pair which has its
custom PrintMethod and ParserMatchClass. However we don't have any instructions using vvvv
and ModR/M.REG field so this issue is not exposed.
Differential Revision: https://reviews.llvm.org/D109564
hsmahesha [Fri, 10 Sep 2021 04:51:58 +0000 (10:21 +0530)]
Revert "[AMDGPU] Split entry basic block after alloca instructions."
This reverts commit
98f47131228cc73b5308e3cc6fd70375808594e3.
Without any (theoretical/practical) guarantee that all the allocas within
*entry* basic block are clustered together at the beginning of the block,
this patch is doomed to fail. Hence reverting it.
Max Kazantsev [Fri, 10 Sep 2021 04:16:13 +0000 (11:16 +0700)]
[Test] Add tests showing missed opportunity for SimplifyCFG for switches
Patch by Dmitry Bakunevich!
Yonghong Song [Fri, 10 Sep 2021 01:31:18 +0000 (18:31 -0700)]
BPF: change BTF_KIND_TAG format
Previously we have the following binary representation:
struct bpf_type { name, info, type }
struct btf_tag { __u32 component_idx; }
If the tag points to a struct/union/var/func type, we will have
kflag = 1, component_idx = 0
if the tag points to struct/union member or func argument, we will have
kflag = 0, component_idx = 0, ..., vlen - 1
The above rather makes interface complex to have both kflag and
component needed to determine its legality and index.
This patch simplifies the interface by removing kflag involvement.
component_idx = (u32)-1 : tag pointing to a type
component_idx = 0 ... vlen - 1 : tag pointing to a member or argument
and kflag is always 0 and there is no need to check.
Differential Revision: https://reviews.llvm.org/D109560
Zequan Wu [Thu, 9 Sep 2021 23:00:15 +0000 (16:00 -0700)]
[DebugInfo] Emit DW_AT_inline under -g1/-gmlt
Differential Revision: https://reviews.llvm.org/D109554
Arthur O'Dwyer [Sat, 4 Sep 2021 16:48:10 +0000 (12:48 -0400)]
[libc++] Clean up test_iterators.h. NFCI.
The majority of the changes here are whitespace.
Also simplify `ThrowingIterator`'s bookkeeping (NFC).
Also move some free operators into hidden friends, for sanity's sake.
Also `=delete` some more comma operators.
Also use `constexpr` in C++20 instead of `TEST_CONSTEXPR_CXX14`.
Differential Revision: https://reviews.llvm.org/D103341
Jason Molenda [Fri, 10 Sep 2021 00:02:42 +0000 (17:02 -0700)]
Add specific error messages around gdb RSP handshake failures
Report timeout exceeded and connection lost error messages
when sending the initial handshake packet in a gdb remote
serial protocol connection, an especially fragile time.
Differential Revision: https://reviews.llvm.org/D108888
Jason Molenda [Thu, 9 Sep 2021 00:34:00 +0000 (17:34 -0700)]
Don't re-define constants that are now in compact_unwind_encoding.h.
Fangrui Song [Thu, 9 Sep 2021 23:51:11 +0000 (16:51 -0700)]
[lld] Enable ANSI escape code for Windows
Buffered diagnostics need ENABLE_VIRTUAL_TERMINAL_PROCESSING after D87272.
Do it unconditionally like FileCheck.
Haowei Wu [Thu, 9 Sep 2021 22:15:47 +0000 (15:15 -0700)]
[clang_format] Add fallback-style flag to clang-format-diff.py
This change adds fallback-style flag to clang-format-diff.py
Differential Revision: https://reviews.llvm.org/D109550
natashaknk [Thu, 9 Sep 2021 22:57:22 +0000 (15:57 -0700)]
[mlir][tosa] Add lowering for tosa.clz using scf::whileOp
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D109540
Aart Bik [Thu, 9 Sep 2021 21:20:52 +0000 (14:20 -0700)]
[mlir][sparse] add folding to sparse_tensor.convert
folds conversion between identical types (with tests)
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D109545
Matt Arsenault [Sat, 14 Aug 2021 01:45:46 +0000 (21:45 -0400)]
AMDGPU: Optimize amdgpu-no-* attributes
This allows clobbering a few extra registers in the fixed ABI, and
avoids some workitem ID packing instructions.
Matt Arsenault [Sat, 14 Aug 2021 18:32:35 +0000 (14:32 -0400)]
AMDGPU: Use attributor to propagate uniform-work-group-size
Drop the legacy version in AMDGPUAnnotateKernelFeatures. This has the
side effect of now respecting the linkage, and not changing externally
visible functions.
Matt Arsenault [Sat, 14 Aug 2021 15:20:04 +0000 (11:20 -0400)]
AMDGPU: Invert ABI attribute handling
Previously we assumed all callable functions did not need any
implicitly passed inputs, and added attributes to functions to
indicate when they were necessary. Requiring attributes for
correctness is pretty ugly, and it makes supporting indirect and
external calls more complicated.
This inverts the direction of the attributes, so an undecorated
function is assumed to need all implicit imputs. This enables
AMDGPUAttributor by default to mark when functions are proven to not
need a given input. This strips the equivalent functionality from the
legacy AMDGPUAnnotateKernelFeatures pass.
However, AMDGPUAnnotateKernelFeatures is not fully removed at this
point although it should be in the future. It is still necessary for
the two hacky amdgpu-calls and amdgpu-stack-objects attributes, which
would be better served by a trivial analysis on the IR during
selection. Additionally, AMDGPUAnnotateKernelFeatures still
redundantly handles the uniform-work-group-size attribute to be
removed in a future commit.
At this point when not using -amdgpu-fixed-function-abi, we are still
modifying the ABI based on these newly negated attributes. In the
future, this option will be removed and the locations for implicit
inputs will always be fixed. We will then use the new attributes to
avoid passing the values when unnecessary.
Philip Reames [Thu, 9 Sep 2021 22:18:47 +0000 (15:18 -0700)]
[ScalarEvolution] Add an additional bailout to avoid NOT of pointer.
It's possible in some cases for the LHS to be a pointer where the RHS is not. This isn't directly possible for an icmp, but the analysis mixes up operands of different icmp expressions in some cases.
This does not include a test case as the smallest reduced case we've managed is extremely fragile and unlikely to test anything meaningful in the long term.
Also add an assertion to getNotSCEV() to make tracking down this sort of issue a bit easier in the future.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51787 .
Differential Revision: https://reviews.llvm.org/D109546
thomasraoux [Thu, 9 Sep 2021 20:29:18 +0000 (13:29 -0700)]
[mlir][sparse] Mark convert op as noSideEffect
Differential Revision: https://reviews.llvm.org/D109543
Philip Reames [Thu, 9 Sep 2021 21:07:22 +0000 (14:07 -0700)]
[SCEV] Allow negative steps for LT exit count computation for unsigned comparisons
This bit of code is incredibly suspicious. It allows fully unknown (but potentially negative) steps, but not steps known to be negative. The comment about scev flag inference is worrying, but also not correct to my knowledge.
At best, this might be covering up some related miscompile. However, there's no test in tree for it, the review history doesn't include obvious motivation, and the C++ example doesn't appear to give wrong results when hand translated to IR. I think it's time to remove this and see what falls out.
During review, there were concerns raised about the correctness of the corresponding signed case. This change was deliberately narrowed to the unsigned case which has been auditted and appears correct for negative values. We need to get back to the known-negative signed case, but that'll be a future patch if nothing falls out from this one.
Differential Revision: https://reviews.llvm.org/D104140
Siva Chandra Reddy [Thu, 9 Sep 2021 18:46:22 +0000 (18:46 +0000)]
[libc] Skip fenv exception tests on aarch64 if HW doesn't support exceptions.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D109538
Amy Kwan [Thu, 9 Sep 2021 20:37:02 +0000 (15:37 -0500)]
[PowerPC] Update PC-Relative Load/Store Patterns to use the refactored Load/Store Implementation
This patch updates the PC-Relative load and store patterns to utilize the
refactored load/store implementation introduced in D93370.
PC-Relative implementation has been added to PPCISelLowering.cpp, and also the
patterns in PPCInstrPrefix.td have been updated and no longer require AddedComplexity.
All existing test cases pass with this update.
Differential Revision: https://reviews.llvm.org/D95116
Julian Lettner [Mon, 6 Sep 2021 17:53:08 +0000 (19:53 +0200)]
[TSan][Darwin] Add integration tests for dyld interposition
Add integration tests for dyld interposition: DYLD_LIBRARY_PATH and
DYLD_INSERT_LIBRARIES.
DYLD_INSERT_LIBRARIES is also relevant for TSan thread
finalization/destruction sequence in the presence of additional pthread
introspection hooks (libBacktraceRecording.dylib for Xcode 'Queue
Debugging' feature).
rdar://
78739125
Differential Revision: https://reviews.llvm.org/D109332
Nilay Vaish [Thu, 9 Sep 2021 19:10:36 +0000 (19:10 +0000)]
Add "profiling" to the list of absl libraries.
Reviewed By: ymandel
Differential Revision: https://reviews.llvm.org/D109470
Craig Topper [Thu, 9 Sep 2021 20:10:55 +0000 (13:10 -0700)]
[SelectionDAG] Add isZero/isAllOnes methods to ConstantSDNode.
Soft deprecrate isNullValue/isAllOnesValue and update in tree
callers. This matches the changes to the APInt interface from
D109483.
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D109535
Xing Xue [Thu, 9 Sep 2021 20:20:36 +0000 (16:20 -0400)]
[libc++] Add missing short wchar handling for codecvt_utf8, codecvt_utf16 and codecvt_utf8_utf16
Summary:
AIX have 2 byte wchar in 32 bit mode and 4 byte wchar in 64 bit mode.
This patch add more missing short wchar handling under the existing _LIBCPP_SHORT_WCHAR macro.
Marked test case ctor_move.pass.cpp as XFAIL for 32-bit mode on AIX because UTF-8 constants used cannot be converted to 2-byte wchar (by xingxue).
Authored by: jasonliu
Reviewed by: ldionne, zibi, SeanP, libc++
Differential Revision: https://reviews.llvm.org/D100777
Nikita Popov [Thu, 9 Sep 2021 19:55:28 +0000 (21:55 +0200)]
[IR] Handle constant expressions in containsUndefinedElement()
If the constant is a constant expression, then getAggregateElement()
will return null. Guard against this before calling HasFn().
Joe Nash [Thu, 9 Sep 2021 17:42:36 +0000 (13:42 -0400)]
[AMDGPU] Make fexp.ll test autogenerated
This test is very verbose and appears generated by a script.
Make it truly autogenerated for easy updates.
NFC
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D109530
Change-Id: I1352b17b6d13ab9c5650dbe95ef0da97f71f1930
Craig Topper [Thu, 9 Sep 2021 19:23:36 +0000 (12:23 -0700)]
[RISCV] Add test cases showing failure to fold splatted shift amounts across basic blocks.
We should have CGP copy the splats into the same basic block as the
shift so that SelectionDAG can fold them.