Commit Graph

413387 Commits

Author SHA1 Message Date
David Green c40744d4d6 [AArch64] Add some CCMP testing. NFC 2022-02-01 18:15:34 +00:00
Fangrui Song 0c3704fdbd [ELF] Deduplicate names of local symbols only with -O2
The deduplication requires a DenseMap of the same size of the local part of
.strtab . I optimized it in e205445434 but it is
still quite slow.

For Release build of clang, deduplication makes .strtab 1.1% smaller and makes the link 3% slower.
For chrome, deduplication makes .strtab 0.1% smaller and makes the link 6% slower.

I suggest that we only perform the optimization with -O2 (default is -O1).
Not deduplicating local symbol names will simplify parallel symbol table write.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D118577
2022-02-01 10:10:22 -08:00
Fangrui Song ceb9094a49 [llvm-ar] -s: don't convert a thin archive to a regular one
In binutils, ar -s and randlib don't convert a thin archive to a regular one.
This behavior makes sense and this patch ports the behavior.

Reviewed By: gbreynoo

Differential Revision: https://reviews.llvm.org/D117443
2022-02-01 09:59:51 -08:00
Fangrui Song dd6e7e0d57 [llvm-ar] Add --thin for creating a thin archive
In GNU ar (since 2008), the modifier 'T' means creating a thin archive.
In many other ar implementations (FreeBSD, macOS, elfutils, etc), -T
means "allow filename truncation of extracted files", as specified by
X/Open System Interface.

For portability, 'T' with thin archive semantics should be avoided.

See https://sourceware.org/bugzilla/show_bug.cgi?id=28759 binutils 2.38
will deprecate 'T' (without diagnostic) and add --thin.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D116979
2022-02-01 09:56:50 -08:00
Alexey Bataev 83620bd2ad [SLP]Alternate vectorization for cmp instructions.
Added support for alternate ops vectorization of the cmp instructions.
It allows to vectorize either cmp instructions with same/swapped
predicate but different (swapped) operands kinds or cmp instructions
with different predicates and compatible operands kinds.

Differential Revision: https://reviews.llvm.org/D115955
2022-02-01 09:54:20 -08:00
Fangrui Song 17a39aecd1 [ELF] Simplify code with invokeELFT. NFC 2022-02-01 09:53:29 -08:00
Krzysztof Parzyszek c935f6e048 [Hexagon] Punt on registers without reaching defs in addr mode opt
This fixes https://github.com/llvm/llvm-project/issues/52636.
2022-02-01 09:52:59 -08:00
Josh Mottley ce8022faa3 [flang] Upstream partial lowering of EXIT intrinsic
This patch adds partial lowering of the "EXIT" intrinsic to
the backend runtime hook implemented in patch D110741. It also adds a
helper function to the `RuntimeCallTestBase.h` for testing for an
intrinsic function call in a `mlir::Block`.

Differential Revision: https://reviews.llvm.org/D118141
2022-02-01 17:48:51 +00:00
Fangrui Song 7518d38f0a [ELF] De-template LinkerDriver::link. NFC
Replace `f<ELFT>(x)` with `InvokeELFT(f, x)`.
The size reduction comes from turning `link` from 4 specializations into 1.

My x86-64 lld executable is 26KiB smaller.

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D118551
2022-02-01 09:47:56 -08:00
Jonas Paulsson 16978d853b [TableGen] Fix reporting from CodeGenSchedModels::checkCompleteness().
Make the check for a complete SchedModel work as expected: report any
supported instruction not having scheduler info.

For unclear reasons there was a variable 'HadCompleteModel' that caused
e.g. new instructions for a new subtarget not to be reported. This variable
is now simply removed as all in-tree targets seem to build fine without it.

Review: Simon Pilgrim

Differential Revision: https://reviews.llvm.org/D118628
2022-02-01 11:32:38 -06:00
Alexey Bataev 0dc33c0a9c [SLP][NFC]Add a test for alternate vectorization in cmp instructions
with same/swapped predicate.
2022-02-01 09:28:06 -08:00
Alexander Belyaev ebc8153786 Revert "Revert "[mlir] Purge `linalg.copy` and use `memref.copy` instead.""
This reverts commit 25bf6a2a9b.
2022-02-01 18:21:21 +01:00
Nikolas Klauser 9c52a19e32 [libc++][NFC] Add namespace comments in ranges
With this patch there should be no more namespaces without closing comment

Reviewed By: ldionne, Quuxplusone, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D118668
2022-02-01 18:18:13 +01:00
Peter Steinfeld 93ee588232 [flang] Rename the runtime routine that reports a fatal user error
As per Steve Scalpone's suggestion, I've renamed the runtime routine to
better evoke its purpose.

I implemented a routine called "Crash" and added a test.

Differential Revision: https://reviews.llvm.org/D118703
2022-02-01 09:01:50 -08:00
Steven Wan 245b8e5691 [NFC][AIX]Disable failed tests due to aggressive byval alignment warning on AIX
These tests emit unexpected diagnostics on AIX because the byval alignment warning is emitted too aggressively. https://reviews.llvm.org/D118350 is supposed to provide a proper fix to the problem, but for the time being disable the tests to unblock.

Differential Revision: https://reviews.llvm.org/D118670
2022-02-01 11:49:53 -05:00
Alex Zinenko 22fea18e5f [mlir] Better error message in PybindAdaptors.h
When attempting to cast a pybind11 handle to an MLIR C API object through
capsules, the binding code would attempt to directly access the "_CAPIPtr"
attribute on the object, leading to a rather obscure AttributeError when the
attribute was missing, e.g., on non-MLIR types. Check for its presence and
throw a TypeError instead.

Depends On D117646

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D117658
2022-02-01 17:49:18 +01:00
Jake Egan 87387c403b [AIX] Bump DWARF versions to 3 because XCOFF64 requires DWARF64
DWARF64 was implemented at version 3, so if a DWARF version less than 3 is specified, DWARF64 does not get selected. Since XCOFF64 requires DWARF64, the modified tests fail on 64-bit AIX. This patch bumps these tests to dwarf version 3 to maintain test coverage on 64-bit AIX.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D114110
2022-02-01 11:18:19 -05:00
Olle Fredriksson 9d555b4a83 [DFAJumpThreading] make update order deterministic
We tracked down some non-determinism in compilation output to the
DFAJumpThreading pass. These changes fixed our issue:

* Make the DefMap type a MapVector to make its iteration order depend on
  insertion order.
* Sort the values to be inserted into NewDefs by instruction order to
  make the insertion order deterministic. Since these values come from
  iterating over a ValueMap, which doesn't have deterministic iteration
  order, I couldn't fix this at its source.

Reviewed By: alexey.zhikhar

Differential Revision: https://reviews.llvm.org/D118590
2022-02-01 11:02:58 -05:00
Mircea Trofin 22d3bbdf4e [nfc][regalloc] Move DefaultEvictionAdvisor::* to RegAllocEvictionAdvisor.cpp
This is leftover from the advisor refactoring. Straight-forward copy and
paste.
2022-02-01 07:59:25 -08:00
Craig Topper f943c58cae [RISCC] Add missing words to comment. NFC 2022-02-01 07:39:51 -08:00
Craig Topper 7eb7810727 [RISCV] Fix a vsetvli insertion bug involving loads/stores.
The first phase of the analysis can avoid a vsetvli if an earlier
instruction in the block used an SEW and LMUL that when combined with
the EEW of the load/store would produce the desired EMUL. If we
avoided a vsetvli this will affect the global analysis we do in the
second phase.

The third phase where we really insert the vsetvlis needs to agree
with the first phase. If it doesn't we can insert vsetvlis that
invalidate the global analysis.

In the test case there is a VSETVLI in the preheader that sets
SEW=64 and LMUL=1. Inside the loop there is a VADD with SEW=64 and LMUL=1.
This VADD is followed by a store that wants wants SEW=32 LMUL=1/2.
Because it has EEW=32 as part of the opcode the SEW=64 LMUL=1 from the
VADD can be become EMUL=1 for the store. So the first phase determines no
vsetvli is needed.

The third phase manages CurInfo differently than BBInfo.Change from the
first phase. CurInfo is only updated when we see a vsetvli or insert
a vsetvli. This was done to allow predecessor block information from
the global analysis to be applied to multiple instructions. Since the
loop body has no vsetvli we won't update CurInfo for either the VADD
or the VSE. This prevented us from checking the store vsetvli elision
for the VSE resulting in a vsetvli SEW=32 LMUL=1/2 being emitted which
invalidated the global analysis.

To mitigate this, I've added a BBLocalInfo variable that more closely
matches the first phase propagation. This gets updated based on the
VADD and prevents emitting a vsetvli for the store like we did in the
first phase.

I wonder if we should do an earlier phase to handle the load/store case
by adding more pseudo opcodes and changing the SEW/LMUL for those
instructions before the insertion analysis. That might be more robust
than trying to guarantee two phases make the same decision.

Fixes the test from D118629.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D118667
2022-02-01 07:29:01 -08:00
Stanislav Gatev 6b8800dfb5 [clang][dataflow] Enable comparison of distinct values in Environment
Make specializations of `DataflowAnalysis` extendable with domain-specific
logic for comparing distinct values when comparing environments.

This includes a breaking change to the `runDataflowAnalysis` interface
as the return type is now `llvm::Expected<...>`.

This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: ymandel, xazax.hun

Differential Revision: https://reviews.llvm.org/D118596
2022-02-01 15:25:59 +00:00
Craig Topper 2f023b9455 [RISCV] Don't make it an error have Zve* and V at the same time.
This should not be an error. V is a valid implementation of Zve.

Spec clarified here
9a877e8553

Differential Revision: https://reviews.llvm.org/D118679
2022-02-01 07:16:20 -08:00
Sam McCall 7af1a2ed81 [clangd] Fix handling of co_await in go-to-type 2022-02-01 16:01:53 +01:00
Nikita Popov 1652c3b80c [GlobalOpt] Avoid early exit before dead constant check
In a similar vein to 236fbf571d,
make sure we don't early-exit before the dead constant check.
2022-02-01 15:57:19 +01:00
Jon Chesterfield f52927c122 Revert "[OpenMP][FIX] Explicit barriers in SPMD mode are not aligned"
This seems to be the root cause of hangs on amdgpu. Reverting while investigating.
This reverts commit 7b9844cc8d.
2022-02-01 14:56:59 +00:00
Joseph Huber 28c1534136 [OpenMP] Temporarily remove checks to fix failing test on MACOS
Summary:
This patch removes some of the check lines that are problematic on
MACOS. The output on the MAC systems works but should be slightly
different. Because this is simply the output being slightly different
rather than broken functionality the test is being changed.
2022-02-01 09:56:09 -05:00
Shao-Ce SUN a2a7fc7ea5 [RISCV] Adjust some comments. 2022-02-01 22:53:54 +08:00
Sam McCall e9cba78653 [clangd] Group and extend release notes 2022-02-01 15:51:57 +01:00
Nikita Popov 236fbf571d [GlobalStatus] Skip non-pointer dead constant users
Constant expressions with a non-pointer result type used an early
exit that bypassed the later dead constant user check, and resulted
in different optimization outcomes depending on whether dead users
were present or not.

This fixes the issue reported in https://reviews.llvm.org/D117223#3287039.
2022-02-01 15:51:32 +01:00
David Green d9b4577c45 [AArch64] Add signed version of uaddlv test. NFC 2022-02-01 14:51:23 +00:00
Amy Kwan 0d6e64755a [PowerPC] Update P10 vector insert patterns to use refactored load/stores, and update handling of v4f32 vector insert.
This patch updates the P10 patterns with a load feeding into an insertelt to
utilize the refactored load and store infrastructure, as well as updating any
tests that exhibit any codegen changes.

Furthermore, custom legalization is added for v4f32 on Power9 and above to not
only assist with adjusting the refactored load/stores for P10 vector insert,
but also it enables the utilization of direct moves.

Differential Revision: https://reviews.llvm.org/D115691
2022-02-01 08:48:37 -06:00
Valentin Clement 89275300d8
[flang] Add lowering for basic empty SUBROUTINE
This patch adds the ability to lower an empty subroutine.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D118695
2022-02-01 15:28:18 +01:00
Nikita Popov a1dc6d4b83 [AArch64] Do not use ABI alignment for mops.memset.tag
Pointer element types do not imply that the pointer is ABI aligned.
We should be using either an explicit align attribute here, or fall
back to an alignment of 1. This fixes a new element type access
introduced in D117764.

I don't think this makes any practical difference though, as the
lowering does not depend on alignment.

Differential Revision: https://reviews.llvm.org/D118681
2022-02-01 14:37:53 +01:00
Pavel Labath b1127753b9 [lldb] Convert ProcessGDBRemoteLog to the new API 2022-02-01 14:36:29 +01:00
Christian Kühnel 8edfc2f814 [clangd] Cleanup of readability-identifier-naming
Auto-generated patch based on clang-tidy readability-identifier-naming.
Only some manual cleanup for `extern "C"` declarations and a GTest change was required.

I'm not sure if this cleanup is actually very useful. It cleans up clang-tidy findings to the number of warnings from clang-tidy should be lower.  Since it was easy to do and required only little cleanup I thought I'd upload it for discussion.

One pattern that keeps recurring: Test **matchers** are also supposed to start with a lowercase letter as per LLVM convention. However GTest naming convention for matchers start with upper case. I would propose to keep stay consistent with the GTest convention there. However that would imply a lot of `//NOLINT` throughout these files.

To re-product this patch run:
```
run-clang-tidy -checks="-*,readability-identifier-naming" -fix -format ./clang-tools-extra/clangd
```

To convert the macro names, I was using this script with some manual cleanup afterwards:
https://gist.github.com/ChristianKuehnel/a01cc4362b07c58281554ab46235a077

Differential Revision: https://reviews.llvm.org/D115634
2022-02-01 13:31:52 +00:00
Nathan Sidwell fa7834a554 [demangler] Preserve line numbering in copied demangler sources
While prepending lines to the copied source files is functional, it
disturbs the line numbering between the original and the copy.  That
makes development more awkward than necessary, as it is the copy that
generally gets compiled first and emits compiler errors.

This uses sed to alter the first two lines, and also emits better
emacs mode setting, getting both C++ mode and read-only mode.

While here, also update and clarify documentation.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D118135
2022-02-01 05:30:24 -08:00
Marek Kurdej af8f1dbb43 [clang-format] Use std::iota and reserve when sorting Java imports. NFC.
This way we have at most 1 allocation even if the number of includes is greater than the on-stack size of the small vector.
2022-02-01 14:29:31 +01:00
Marek Kurdej e75a3428a9 [clang-format] Use std::iota and reserve. NFC.
This way we have at most 1 allocation even if the number of includes is greater than the on-stack size of the small vector.
2022-02-01 14:24:01 +01:00
Marek Kurdej 34b4f00686 [clang-format] De-pessimize appending newlines. NFC.
* Avoid repeatedly calling std::string::append(char) in a loop.
* Reserve before calling std::string::append(const char *) in a loop.
2022-02-01 14:10:48 +01:00
Marek Kurdej 545317cb8e [clang-format] Use ranged for loops. NFC. 2022-02-01 14:10:48 +01:00
Jon Chesterfield 8b7e99c41d [openmp] Disable tests that presently hang on CI 2022-02-01 13:01:35 +00:00
Nicolas Vasilache 31b7f8857f [mlir][vector][integration] Reactivate LLI in vector integration test.
The test introduced in https://reviews.llvm.org/D118006 was missing a return and would
introduce a non-0 return which would fail tests.
2022-02-01 08:00:50 -05:00
Valentin Clement 990759136a
[flang] Add lowering placeholders
This patch puts in place the differents
function to lower the evaluation list. All functions
are just placholders with TODOs for now.
Follow up patches will bring the proper lowering in these
functions.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D118678
2022-02-01 13:50:09 +01:00
Simon Pilgrim 904395ab8f [DAG] SimplifyMultipleUseDemandedBits - add default Depth = 0 argument.
Simplifies an upcoming change.
2022-02-01 12:34:38 +00:00
Nicolas Vasilache c2fa5ff5ad Temporarily disable LLI to investigate weird non 0 error code
Somehow the test introduced in https://reviews.llvm.org/D118006 produces the expected result but running
through lli with Intel SDE activated sneaks in an error code 2 (before this commit) or an error code 10
(after this commit).

The test as is is still meaningful in that the LLVMIR generation would crash if the `elementtype` is set
improperly.

Still, this should run with lli turned on.
2022-02-01 07:24:49 -05:00
Nico Weber 93dc66a088 [gn build] unconfuse sync script after 762f0b5463 2022-02-01 07:22:33 -05:00
Alexander Shaposhnikov d03076223b [CodeGen][AArch64] Fix typo in legalizer-info-validation.mir 2022-02-01 12:14:25 +00:00
Alexander Shaposhnikov 80c27fbf94 [CodeGen][AArch64] Fix typo in arm64-zero-cycle-zeroing.ll 2022-02-01 12:08:06 +00:00
Alexander Shaposhnikov 3f53722347 [llvm-objcopy][COFF] Add missing RUN in bigobj.test 2022-02-01 12:00:13 +00:00