Commit Graph

455558 Commits

Author SHA1 Message Date
Job Noorman
c39dd7c1db [RISCV][MC] Add support for RV64E
Implement MC support for the recently ratified RV64E base instruction
set.

Differential Revision: https://reviews.llvm.org/D143570
2023-03-23 12:32:25 +00:00
Simon Pilgrim
6aa7cc037f [X86] LowerVectorAllZero - add 512-bit support with AVX512 vptestnmd+kortestw patterns
Another step toward #53419 - this is also another step towards expanding MatchVectorAllZeroTest to match any pair of vectors and merge EmitAVX512Test into it.
2023-03-23 12:18:49 +00:00
Kadir Cetinkaya
43fcfdb1d6 [IncludeCleaner][clangd] Mark umbrella headers as users of private
Private headers inside umbrella files shouldn't be marked as unused.

Differential Revision: https://reviews.llvm.org/D146406
2023-03-23 13:08:07 +01:00
Aaron Ballman
18d56880a8 Revert "libclang: Pass Clang install directory to driver via argv[0]."
This reverts commit 201fdef40d.

There was an issue found in post-commit by:
https://lab.llvm.org/buildbot/#/builders/91/builds/15272
2023-03-23 08:05:58 -04:00
Nico Weber
c2c9de4ae1 [gn] port a282ea4898 2023-03-23 12:56:33 +01:00
Quentin Colombet
0cbfd68af7 [mlir] Fix call of overloaded ‘dropResults(<brace-enclosed initializer list>)’ is ambiguous
NFC
2023-03-23 12:45:54 +01:00
Jacek Caban
a5988034a4 [lld] Fill .text section gaps with INT3 only on x86 targets.
It doesn't make sense on ARM and using default 0 fill is compatible
with MSVC.

(It's more noticeable ARM64EC targets, where additional padding mixed
with alignment is used for entry thunk association, so there are more
gaps).

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D145962
2023-03-23 13:43:21 +02:00
Jacek Caban
4fcbf38420 [llvm-lib] Use COFF archive format in llvm-lib (other archive tools don't use this format).
We currently just use GNU format for llvm-lib. This mostly works, but
ARM64EC needs an additional section that does not really fit GNU format.
This patch implements writing in COFF format (as in, it's what archive
reader considers as K_COFF). This mostly requires symbol emitting symbol
map. Note that, just like in case of MSVC, symbols are de-duplicated in
both usual symbol table and the new symbol map.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D143540
2023-03-23 13:43:21 +02:00
Jacek Caban
257dc54be2 [Object][NFC] Don't insert string table into object members vector.
Having string table in members vector does not fit later patches in
this series. Symbol map needs to refer to objects' offsets, but string
table should not be referenced. Also for ARM64EC, the new <ECSYMBOLS>
table is inserted after string table.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D143538
2023-03-23 13:43:21 +02:00
Jacek Caban
67d828fb2c [Object][NFC] Factor out computeHeadersSize.
In preparation for COFF archives support.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D143537
2023-03-23 13:43:21 +02:00
luxufan
f44c7dec67 [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef
Since D141386 has changed the return value of !range from IUB to poison,
metadata !range shouldn't be preserved even if K dominates J.

If this patch was accepted, I plan to adjust metadata !nonnull as well.
BTW, I found that metadata !noundef is not handled in combineMetadata,
is this intentional?

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D142687
2023-03-23 19:31:55 +08:00
LLVM GN Syncbot
20725d34b2 [gn build] Port c2de8ff927 2023-03-23 11:20:20 +00:00
LLVM GN Syncbot
80db8b03a9 [gn build] Port 48f97e5751 2023-03-23 11:20:19 +00:00
Alex Bradbury
da44224d3a [RISCV][test] Fix broken unit test after d25751779b
The patch had missed the RISCVISAInfoTest.cpp change.
2023-03-23 11:17:40 +00:00
Nicolas Vasilache
4dc72d47ce [mlir][Tensor] Add a FoldTensorSubsetOps pass and patterns
These patterns follow FoldMemRefAliasOps which is further refactored for reuse.
In the process, fix FoldMemRefAliasOps handling of strides for vector.transfer ops which was previously incorrect.

These opt-in patterns generalize the existing canonicalizations on vector.transfer ops.
In the future the blanket canonicalizations will be retired.
They are kept for now to minimize porting disruptions.

Differential Revision: https://reviews.llvm.org/D146624
2023-03-23 04:03:27 -07:00
Haojian Wu
002c4b7b95 [clangd] Extend CollectMainFileMacros.
Extend the existing MainFileMacros structure:
- record more information (InConditionalDirective) in MacroOccurrence
- collect macro references inside macro body (fix a long-time FIXME)

So that the MainFileMacros preseve enough information, which allows a
just-in-time convertion to interop with include-cleaner::Macro for
include-cleaer features.

See the context in https://reviews.llvm.org/D146017.

Differential Revision: https://reviews.llvm.org/D146279
2023-03-23 11:59:11 +01:00
Sam McCall
48f97e5751 [FlowSensitive] Log analysis progress for debugging purposes
The goal is to be able to understand how the analysis executes, and what its
incremental and final findings are, by enabling logging and reading the logs.
This should include both framework and analysis-specific information.

Ad-hoc printf-debugging doesn't seem sufficient for my understanding, at least.
Being able to check in logging, turn it on in a production binary, and quickly
find particular analysis steps within complex functions seem important.

This can be enabled programmatically through DataflowAnalysisOptions, or
via the flag -dataflow-log. (Works in unittests, clang-tidy, standalone
tools...)

Important missing pieces here:
 - a logger implementation that produces an interactive report (HTML file)
   which can be navigated via timeline/code/CFG.
   (I think the Logger interface is sufficient for this, but need to prototype).
 - display of the application-specific lattice
 - more useful display for the built-in environment
   (e.g. meaningful & consistent names for values, hiding redundant variables in
   the flow condition, hiding unreachable expressions)

Differential Revision: https://reviews.llvm.org/D144730
2023-03-23 11:36:21 +01:00
Luke Lau
8d16c6809a [RISCV] Increase default vectorizer LMUL to 2
After some discussion and experimentation, we have seen that changing the default number of vector register bits to LMUL=2 strikes a sweet spot.
Whilst we could be clever here and make the vectorizer smarter about dynamically selecting an LMUL that
a) Doesn't affect register pressure
b) Suitable for the microarchitecture
we would need to teach its heuristics about RISC-V register grouping specifics.
Instead this just does the easy, pragmatic thing by changing the default to a safe value that doesn't affect register pressure signifcantly[1], but should increase throughput and unlock more interleaving.

[1] Register spilling when compiling sqlite at various levels of `-riscv-v-register-bit-width-lmul`:

LMUL=1    2573 spills
LMUL=2    2583 spills
LMUL=4    2819 spills
LMUL=8    3256 spills

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D143723
2023-03-23 10:33:50 +00:00
Adam Paszke
61f33def13 [mlir][Vector] Make sure that vector.contract preserves extra attributes while parsing
The old implementation parsed the optional attribute dict, only to replace its
contents by using `assign`.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D146707
2023-03-23 10:31:46 +00:00
Carlos Galvez
b7677846da [clang-tidy][NFC] Fix broken link in Release Notes 2023-03-23 10:30:15 +00:00
Stefan Gränitz
c2de8ff927 [JITLink] Initial AArch32 backend
This first version lays the foundations for AArch32 support in JITLink. ELFLinkGraphBuilder_aarch32 processes REL-type relocations and populates LinkGraphs from ELF object files for both big- and little-endian systems. The ArmCfg member controls subarchitecture-specific details throughout the linking process (i.e. it's passed to ELFJITLinker_aarch32).

Relocation types follow the ABI documentation's division into classes: Data (endian-sensitive), Arm (32-bit little-endian) and Thumb (2x 16-bit little-endian, "Thumb32" in the docs). The implementation of instruction encoding/decoding for relocation resolution is implemented symmetrically and is testable in isolation (see AArch32 category in JITLinkTests).

Callable Thumb functions are marked with a ThumbSymbol target-flag and stored in the LinkGraph with their real addresses. The thumb-bit is added back in when the owning JITDylib requests the address for such a symbol.

The StubsManager can generate (absolute) Thumb-state stubs for branch range extensions on v7+ targets. Proper GOT/PLT handling is not yet implemented.

This patch is based on the backend implementation in ez-clang and has just enough functionality to model the infrastructure and link a Thumb function `main()` that calls `printf()` to dump "Hello Arm!" on Armv7a. It was tested on Raspberry Pi with 32-bit Raspbian OS.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D144083
2023-03-23 11:25:45 +01:00
Job Noorman
d25751779b Bump RV32E version to 2.0
RV32E was recently [ratified](afd613691c) so we should update the version as our MC-layer support is complete.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D144384
2023-03-23 18:12:26 +08:00
Yevgeny Rouban
26d954bd40 [AsmParser] Avoid instantiating LLVMContext if not needed. Try 2.
The deleted copy constructor LLVMContext(LLVMContext &) got its
parameter changed to const to allow the latest clang compiler to
instantiatiate template std::optional<LLVMContext>.

Differential Revision: https://reviews.llvm.org/D142699
2023-03-23 16:57:46 +07:00
mydeveloperday
7c928205c1 Revert "[clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date"
This reverts commit 7a5b95732a.
2023-03-23 09:52:59 +00:00
mydeveloperday
7a5b95732a [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date
Regenerate the style documentation, requires some minor sphinx changes to avoid warnings

Differential Revision: https://reviews.llvm.org/D146704
2023-03-23 09:48:24 +00:00
Simon Pilgrim
4f17d75b24 [X86] LowerVectorAllZero - early out if the type size is not pow2. NFC. 2023-03-23 09:42:45 +00:00
David Spickett
61b0a492cc [llvm][ARM] Refactor isMnemonicVPTPredicable
Fixes #61607

Several names were repeated in this giant list. I have refactored
it and removed the duplicates.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D146619
2023-03-23 09:39:08 +00:00
Nico Weber
25466efb53 [gn] Port e655d8a548 more 2023-03-23 10:34:44 +01:00
Timm Bäder
814177e434 Revert "[clang][Interp][NFC] Add tests for __fp16"
This reverts commit 0691bcb180.

Looks like this breaks builders, e.g.
https://lab.llvm.org/buildbot#builders/231/builds/9790
2023-03-23 10:33:51 +01:00
MarcoFalke
8c10256734 clang-tidy: Detect use-after-move in CXXCtorInitializer
Fixes https://github.com/llvm/llvm-project/issues/51844

Differential Revision: https://reviews.llvm.org/D146288
2023-03-23 10:19:54 +01:00
esmeyi
49dcd08c3d [XCOFF] support the ref directive for object generation.
Summary: A R_REF relocation as a non-relocating reference is required to prevent garbage collection (by the binder) of the ref symbol in object generation.

Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D144356
2023-03-23 05:09:47 -04:00
Timm Bäder
0691bcb180 [clang][Interp][NFC] Add tests for __fp16
Differential Revision: https://reviews.llvm.org/D146436
2023-03-23 10:08:34 +01:00
Matthias Springer
47bff1cc46 [mlir][Analysis][NFC] Make BoundType a top-level enum
`BoundType` is no longer a nested member of `IntegerRelation` but a top-level enum in the `presburger` namespace.

This allows `BoundType` to be predeclared in header files. Nested members cannot be predeclared.

Differential Revision: https://reviews.llvm.org/D146210
2023-03-23 09:46:21 +01:00
Uday Bondhugula
e50f131ae6 [MLIR][Affine] Fix bug and MSAN issue in affine loop utils
Fix bug and MSAN issue in affine loop utils introduced by
d25e022cd1 (D146495). While on it,
fix/clean up issues in immediately surrounding code.

Differential Revision: https://reviews.llvm.org/D146698
2023-03-23 14:13:28 +05:30
Matthias Springer
5b0055a4ae [mlir][Analysis][NFC] Split FlatAffineValueConstraints into multiple classes
The new class hierarchy is as follows:

* `IntegerRelation` (no change)
* `IntegerPolyhedron` (no change)
* `FlatLinearConstraints`: provides an AffineExpr-based API
* `FlatLinearValueConstraints`: stores an additional mapping of non-local vars to SSA values
* `FlatAffineValueConstraints`: provides additional helper functions for Affine dialect ops
* `FlatAffineRelation` (no change)

`FlatConstraints` and `FlatValueConstraints` are moved from `MLIRAffineAnalysis` to `MLIRAnalysis` and can be used without depending on the Affine dialect.

This change is in preparation of D145681, which adds an MLIR interface that depends on `FlatConstraints` (and cannot depend on the Affine dialect or any other dialect).

Differential Revision: https://reviews.llvm.org/D146201
2023-03-23 09:38:12 +01:00
Carlos Galvez
b08d35f826 [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name
Test suite name can also be disabled with DISABLED_, not just
the test case name.

Fix also broken link in the test that refers to the explanation
as to why underscores may not be used.

Differential Revision: https://reviews.llvm.org/D146655
2023-03-23 08:31:12 +00:00
Martin Braenne
5acd29eb4d [clang][dataflow] Fix crash when RHS of && or || calls noreturn func.
The crash happened because the transfer fucntion for `&&` and `||`
unconditionally tried to retrieve the value of the RHS. However, if the RHS
is unreachable, there is no environment for it, and trying to retrieve the
operand's value causes an assertion failure.

See also the comments in the code for further details.

Reviewed By: xazax.hun, ymandel, sgatev, gribozavr2

Differential Revision: https://reviews.llvm.org/D146514
2023-03-23 08:02:43 +00:00
Congcong Cai
467cf15428 [NFC] Fix typo lld::wasm in comment 2023-03-23 15:40:55 +08:00
Tobias Gysi
79df1a785d [mlir][llvm] Switch rountrip tests to opaque pointers.
The revision switches all remaining LLVM dialect roundtrip
tests to opaque pointers. Selected tests are copied to a
postfixed test file for the time being.

Part of https://discourse.llvm.org/t/rfc-switching-the-llvm-dialect-and-dialect-lowerings-to-opaque-pointers/68179

Reviewed By: zero9178

Differential Revision: https://reviews.llvm.org/D146639
2023-03-23 08:24:43 +01:00
Timm Bäder
c5d22f4e18 [clang][Sema][NFC] Make local variable const 2023-03-23 08:23:00 +01:00
Théo Degioanni
a35f9c6e08 [mlir][llvm] Add poison constant.
This patch introduces the poison constant from LLVM in the LLVM IR dialect. It also adds import and export support for it, along with roundtrip tests.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D146631
2023-03-23 07:58:56 +01:00
Kazu Hirata
f9f4767af9 [InstCombine] Precommit tests
This patch precommits tests for:

https://github.com/llvm/llvm-project/issues/61183
2023-03-22 23:27:59 -07:00
Craig Topper
b3256047d0 [TableGen] Change push_back back to emplace_back.
This was a mistake I made in 021edda0b2.
2023-03-22 23:17:36 -07:00
Craig Topper
021edda0b2 [TableGen] Simplify CodeGenHwModes constructor. NFC
Remove the loop that erases the DefaultMode from the Record vector.
Instead we can skip over in the loop that creates HwMode objects.
2023-03-22 23:04:33 -07:00
Wu, Yingcong
c2df1d8a6d [libfuzzer] add test of cov file-id in control file
There is test for ft file-id in control file, but no test for cov line.
Without the test, a invalid cov file-id would cause crash.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D145672
2023-03-22 22:55:48 -07:00
wlei
fd29a4d242 [Pseudo Probe] Use the name from debug info to compute GUID in probe desc
This is to fix a GUID mismatch while decoding pseudo probe, a GUID from the inline tree is not in the GUID2FuncDescMap. It turned out that frontend could change the function name making it different from the one in debug info(https://reviews.llvm.org/D111009). Here change to use the function name from debug info to be consistent with the probe name from the inline stack.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D146657
2023-03-22 22:47:23 -07:00
Kazu Hirata
7bb6d1b32e [llvm] Skip getAPIntValue (NFC)
ConstantSDNode provides some convenience functions like isZero,
getZExtValue, and isMinSignedValue that are named identically to those
provided by APInt, so we can "skip" getAPIntValue.
2023-03-22 22:10:25 -07:00
Kazu Hirata
4524db7316 [ARM] Use isNullConstant (NFC) 2023-03-22 22:10:23 -07:00
Kazu Hirata
0d19e583f1 [InstCombine] Precommit a test
This patch precommits a test for:

https://github.com/llvm/llvm-project/issues/61183
2023-03-22 22:10:22 -07:00
Kazu Hirata
8d93cbed6e [InstCombine] Precommit tests
This patch precommits tests for:

https://github.com/llvm/llvm-project/issues/60802
2023-03-22 22:10:20 -07:00