Doru Bercea [Tue, 21 Mar 2023 18:07:57 +0000 (14:07 -0400)]
Enable constexpr class members that are device-mapped to not be optimized out.
This patch fixes an issue whereby a constexpr class member which is
mapped to the device is being optimized out thus leading to a runtime
error.
Patch: https://reviews.llvm.org/D146552
Ye Luo [Thu, 23 Mar 2023 13:56:47 +0000 (08:56 -0500)]
[OpenMP] Add notifyDataUnmapped back in disassociatePtr
Fix regression introduced by https://reviews.llvm.org/D123446
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D146689
David Spickett [Thu, 23 Mar 2023 13:46:49 +0000 (13:46 +0000)]
[lldb][AArch64] Fix run-qemu.sh when only MTE is enabled.
SVE and MTE both require a CPU with that feature before
you can use the other options, but we only added the "max"
cpu when SVE was enabled too.
Qiongsi Wu [Thu, 23 Mar 2023 13:16:18 +0000 (09:16 -0400)]
[AIX][CodeGen] Storage Locations for Constant Pointers
This patch adds an `llc` option `-mroptr` to specify storage locations for constant pointers on AIX.
When the `-mroptr` option is specified, constant pointers, virtual function tables, and virtual type tables are placed in read-only storage. Otherwise, by default, pointers, virtual function tables, and virtual type tables are placed are placed in read/write storage.
https://reviews.llvm.org/D144190 enables the `-mroptr` option for `clang`.
Reviewed By: hubert.reinterpretcast, stephenpeckham, myhsu, MaskRay, serge-sans-paille
Differential Revision: https://reviews.llvm.org/D144189
Alexey Lapshin [Thu, 23 Mar 2023 13:40:29 +0000 (14:40 +0100)]
Revert "[ADT] add ConcurrentHashtable class."
This reverts commit
8482b238062ed7263facea9490f67119e00a037a.
Benjamin Kramer [Thu, 23 Mar 2023 13:41:03 +0000 (14:41 +0100)]
Silence unused variable warning in NDEBUG builds
I usually would fold this into the assert, but the comment there
suggests side effects. NFC.
ModuleMap.cpp:938:9: error: unused variable 'MainFile' [-Werror,-Wunused-variable]
auto *MainFile = SourceMgr.getFileEntryForID(SourceMgr.getMainFileID());
Simon Pilgrim [Thu, 23 Mar 2023 13:37:04 +0000 (13:37 +0000)]
[X86] LowerVectorAllZero - add 512-bit support with AVX512 vptestnmd+kortestw patterns (REAPPLIED)
Another step toward #53419 - this is also another step towards expanding MatchVectorAllZeroTest to match any pair of vectors and merge EmitAVX512Test into it.
Alexey Lapshin [Wed, 22 Mar 2023 16:37:15 +0000 (17:37 +0100)]
[ADT] add ConcurrentHashtable class.
ConcurrentHashTable - is a resizeable concurrent hashtable.
The range of resizings is limited up to x2^32. The hashtable allows only concurrent insertions.
Concurrent hashtable is necessary for the D96035 patch.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D132455
Johannes de Fine Licht [Thu, 23 Mar 2023 13:22:15 +0000 (14:22 +0100)]
[MLIR][LLVM] Move the LLVM inliner interface into a separate file.
A fully fledged LLVM inliner will require a lot of logic. Since
`LLVMDialect.cpp` is large enough as it is, preemptively outline the
inlining logic into a separate `.cpp` file. This will also allow us to
add a `DEBUG_TYPE` for debugging the inliner.
The name `LLVMInlining` was chosen over `LLVMInlinerInterface` to keep
the option open for exposing inlining functionality even when not
invoked through the `DialectInlinerInterface`.
Depends on D146616
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D146628
NAKAMURA Takumi [Wed, 22 Mar 2023 23:47:55 +0000 (08:47 +0900)]
[Bazel] Rework `//llvm:llvm-tblgen` and `//llvm/unittests:tablegen_tests`
`llvm/utils/TableGen/GlobalISel` should be exported.
FYI, after D144351,`tablegen_tests` behaved same
as `llvm-tblgen -print-records`.
It suceeded because stdin is `/dev/null`.
Simon Pilgrim [Thu, 23 Mar 2023 13:07:29 +0000 (13:07 +0000)]
[X86] LowerVectorAllZero - early out for masked v2i64 cases without PTEST. NFC.
Job Noorman [Thu, 23 Mar 2023 13:01:22 +0000 (13:01 +0000)]
[RISCV][test] Fix another missed test change from RV64E patch
c39dd7c1db97fa367cb6282067b74cd8e55ef09a missed a needed change to the
llvm-objdump test.
Job Noorman [Thu, 23 Mar 2023 12:48:03 +0000 (12:48 +0000)]
[RISCV][clang][test] Fix missed test
c39dd7c1db97fa367cb6282067b74cd8e55ef09a missed the appropriate change
to clang/test/Driver/ricv-arch.c.
Iain Sandoe [Fri, 3 Jun 2022 09:43:38 +0000 (10:43 +0100)]
[C++20][Modules] Introduce an implementation module.
We need to be able to distinguish individual TUs from the same module in cases
where TU-local entities either need to be hidden (or, for some cases of ADL in
template instantiation, need to be detected as exposures).
This creates a module type for the implementation which implicitly imports its
primary module interface per C++20:
[module.unit/8] 'A module-declaration that contains neither an export-keyword
nor a module-partition implicitly imports the primary module interface unit of
the module as if by a module-import-declaration.
Implementation modules are never serialized (-emit-module-interface for an
implementation unit is diagnosed and rejected).
Differential Revision: https://reviews.llvm.org/D126959
Simon Pilgrim [Thu, 23 Mar 2023 12:37:11 +0000 (12:37 +0000)]
Revert rG6aa7cc037f2f95c237c1d82c523f8857fa3a10c3 - "[X86] LowerVectorAllZero - add 512-bit support with AVX512 vptestnmd+kortestw patterns"
Reverted - I need to adjust the implementation so we can properly refactor it into a "LowerVectorAllEqual" function
Yi Kong [Thu, 23 Mar 2023 12:29:17 +0000 (20:29 +0800)]
[llvm-objdump] Fix help message for --print-imm-hex
Commit
cc2457ca1bbd changed the default but forgot to update the help message.
Job Noorman [Thu, 23 Mar 2023 12:17:57 +0000 (12:17 +0000)]
[RISCV][MC] Add support for RV64E
Implement MC support for the recently ratified RV64E base instruction
set.
Differential Revision: https://reviews.llvm.org/D143570
Simon Pilgrim [Thu, 23 Mar 2023 12:18:45 +0000 (12:18 +0000)]
[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.
Kadir Cetinkaya [Mon, 20 Mar 2023 08:07:18 +0000 (09:07 +0100)]
[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
Aaron Ballman [Thu, 23 Mar 2023 12:05:15 +0000 (08:05 -0400)]
Revert "libclang: Pass Clang install directory to driver via argv[0]."
This reverts commit
201fdef40dd6ec193d18d39638454a3c972f1fec.
There was an issue found in post-commit by:
https://lab.llvm.org/buildbot/#/builders/91/builds/15272
Nico Weber [Thu, 23 Mar 2023 11:56:33 +0000 (12:56 +0100)]
Quentin Colombet [Thu, 23 Mar 2023 11:43:34 +0000 (12:43 +0100)]
[mlir] Fix call of overloaded ‘dropResults(<brace-enclosed initializer list>)’ is ambiguous
NFC
Jacek Caban [Thu, 23 Mar 2023 11:20:37 +0000 (13:20 +0200)]
[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
Jacek Caban [Thu, 23 Mar 2023 11:20:15 +0000 (13:20 +0200)]
[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
Jacek Caban [Thu, 23 Mar 2023 11:19:53 +0000 (13:19 +0200)]
[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
Jacek Caban [Thu, 23 Mar 2023 11:18:14 +0000 (13:18 +0200)]
[Object][NFC] Factor out computeHeadersSize.
In preparation for COFF archives support.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D143537
luxufan [Thu, 23 Mar 2023 11:31:29 +0000 (19:31 +0800)]
[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
LLVM GN Syncbot [Thu, 23 Mar 2023 11:20:20 +0000 (11:20 +0000)]
[gn build] Port
c2de8ff92753
LLVM GN Syncbot [Thu, 23 Mar 2023 11:20:19 +0000 (11:20 +0000)]
[gn build] Port
48f97e575137
Alex Bradbury [Thu, 23 Mar 2023 11:17:40 +0000 (11:17 +0000)]
[RISCV][test] Fix broken unit test after
d25751779ba
The patch had missed the RISCVISAInfoTest.cpp change.
Nicolas Vasilache [Tue, 21 Mar 2023 21:41:20 +0000 (14:41 -0700)]
[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
Haojian Wu [Fri, 17 Mar 2023 09:33:07 +0000 (10:33 +0100)]
[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
Sam McCall [Fri, 24 Feb 2023 13:50:00 +0000 (14:50 +0100)]
[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
Luke Lau [Fri, 10 Feb 2023 11:03:55 +0000 (11:03 +0000)]
[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
Adam Paszke [Thu, 23 Mar 2023 10:12:56 +0000 (10:12 +0000)]
[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
Carlos Galvez [Thu, 23 Mar 2023 10:30:01 +0000 (10:30 +0000)]
[clang-tidy][NFC] Fix broken link in Release Notes
Stefan Gränitz [Thu, 23 Mar 2023 10:10:39 +0000 (11:10 +0100)]
[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
Job Noorman [Thu, 23 Mar 2023 09:45:16 +0000 (17:45 +0800)]
Bump RV32E version to 2.0
RV32E was recently [ratified](https://github.com/riscv/riscv-isa-manual/commit/
afd613691cb89ccd7584206e8a6d1866fe77ec88) so we should update the version as our MC-layer support is complete.
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D144384
Yevgeny Rouban [Thu, 23 Mar 2023 09:19:19 +0000 (16:19 +0700)]
[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
mydeveloperday [Thu, 23 Mar 2023 09:52:59 +0000 (09:52 +0000)]
Revert "[clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date"
This reverts commit
7a5b95732ade6c2de69b26f1038aa0a5afc39393.
mydeveloperday [Thu, 23 Mar 2023 09:45:00 +0000 (09:45 +0000)]
[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
Simon Pilgrim [Thu, 23 Mar 2023 09:42:45 +0000 (09:42 +0000)]
[X86] LowerVectorAllZero - early out if the type size is not pow2. NFC.
David Spickett [Wed, 22 Mar 2023 10:05:48 +0000 (10:05 +0000)]
[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
Nico Weber [Thu, 23 Mar 2023 09:34:29 +0000 (10:34 +0100)]
[gn] Port
e655d8a54880 more
Timm Bäder [Thu, 23 Mar 2023 09:33:03 +0000 (10:33 +0100)]
Revert "[clang][Interp][NFC] Add tests for __fp16"
This reverts commit
0691bcb18024a28e82e8dd9a08ab0820b40c9a37.
Looks like this breaks builders, e.g.
https://lab.llvm.org/buildbot#builders/231/builds/9790
MarcoFalke [Tue, 14 Mar 2023 13:23:07 +0000 (14:23 +0100)]
clang-tidy: Detect use-after-move in CXXCtorInitializer
Fixes https://github.com/llvm/llvm-project/issues/51844
Differential Revision: https://reviews.llvm.org/D146288
esmeyi [Thu, 23 Mar 2023 09:09:47 +0000 (05:09 -0400)]
[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
Timm Bäder [Mon, 20 Mar 2023 16:43:26 +0000 (17:43 +0100)]
[clang][Interp][NFC] Add tests for __fp16
Differential Revision: https://reviews.llvm.org/D146436
Matthias Springer [Thu, 23 Mar 2023 08:40:51 +0000 (09:40 +0100)]
[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
Uday Bondhugula [Thu, 23 Mar 2023 07:45:22 +0000 (13:15 +0530)]
[MLIR][Affine] Fix bug and MSAN issue in affine loop utils
Fix bug and MSAN issue in affine loop utils introduced by
d25e022cd19b83c22a6022edb78c4b97a5fc1b49 (D146495). While on it,
fix/clean up issues in immediately surrounding code.
Differential Revision: https://reviews.llvm.org/D146698
Matthias Springer [Thu, 23 Mar 2023 08:25:01 +0000 (09:25 +0100)]
[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
Carlos Galvez [Wed, 22 Mar 2023 18:47:48 +0000 (18:47 +0000)]
[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
Martin Braenne [Thu, 23 Mar 2023 07:45:40 +0000 (07:45 +0000)]
[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
Congcong Cai [Thu, 23 Mar 2023 07:40:55 +0000 (15:40 +0800)]
[NFC] Fix typo lld::wasm in comment
Tobias Gysi [Thu, 23 Mar 2023 07:13:54 +0000 (08:13 +0100)]
[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
Timm Bäder [Thu, 23 Mar 2023 07:22:23 +0000 (08:22 +0100)]
[clang][Sema][NFC] Make local variable const
Théo Degioanni [Thu, 23 Mar 2023 06:58:37 +0000 (07:58 +0100)]
[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
Kazu Hirata [Thu, 23 Mar 2023 06:27:59 +0000 (23:27 -0700)]
[InstCombine] Precommit tests
This patch precommits tests for:
https://github.com/llvm/llvm-project/issues/61183
Craig Topper [Thu, 23 Mar 2023 06:17:15 +0000 (23:17 -0700)]
[TableGen] Change push_back back to emplace_back.
This was a mistake I made in
021edda0b20468e20a72b1788721b2b70228bffb.
Craig Topper [Thu, 23 Mar 2023 06:00:06 +0000 (23:00 -0700)]
[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.
Wu, Yingcong [Thu, 23 Mar 2023 04:49:19 +0000 (21:49 -0700)]
[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
wlei [Wed, 22 Mar 2023 20:13:27 +0000 (13:13 -0700)]
[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
Kazu Hirata [Thu, 23 Mar 2023 05:10:25 +0000 (22:10 -0700)]
[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.
Kazu Hirata [Thu, 23 Mar 2023 05:10:23 +0000 (22:10 -0700)]
[ARM] Use isNullConstant (NFC)
Kazu Hirata [Thu, 23 Mar 2023 05:10:22 +0000 (22:10 -0700)]
[InstCombine] Precommit a test
This patch precommits a test for:
https://github.com/llvm/llvm-project/issues/61183
Kazu Hirata [Thu, 23 Mar 2023 05:10:20 +0000 (22:10 -0700)]
[InstCombine] Precommit tests
This patch precommits tests for:
https://github.com/llvm/llvm-project/issues/60802
Jun Zhang [Thu, 23 Mar 2023 04:49:05 +0000 (12:49 +0800)]
[TLI] Fold ~X >/< ~Y --> Y >/< X
Fixes: https://github.com/llvm/llvm-project/issues/61120
Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D146512
Jun Zhang [Thu, 23 Mar 2023 04:48:59 +0000 (12:48 +0800)]
Precommit test for #61120
Signed-off-by: Jun Zhang <jun@junz.org>
Fangrui Song [Thu, 23 Mar 2023 04:02:00 +0000 (21:02 -0700)]
[-Wunsafe-buffer-usage] Add [[fallthrough]] after D143206
Chuanqi Xu [Thu, 23 Mar 2023 03:21:35 +0000 (11:21 +0800)]
Recommit [Modules] Remove unnecessary check when generating name lookup table in ASTWriter
Close https://github.com/llvm/llvm-project/issues/61065.
We will avoid writing the names from external AST naturally. But
currently its check is often false positive since we may have already
marked the declarations as external but
DeclContext::hasNeedToReconcileExternalVisibleStorage would be false
after reconciling.
Tested with libcxx's modular build.
This patch can improve 8% compilation time in an internal workloads.
See the discussion in
https://reviews.llvm.org/rG1e0709167f5edd330889f51bb203c458bdb5e359
to see the information for recommitting.
Matthias Gehre [Thu, 23 Mar 2023 01:08:43 +0000 (01:08 +0000)]
[mlir][tosa] TosaToLinalg: Lower TOSA.Cast via RoundEven according to TOSA spec 0.60.0
TOSA now specifies rounding of ties to even in section 1.8.2., "Main Inference Profile"
Reviewed By: eric-k256, rsuderman
Differential Revision: https://reviews.llvm.org/D146617
Kai Sasaki [Thu, 23 Mar 2023 00:59:29 +0000 (09:59 +0900)]
[mlir][affine] Prevent vectorizer test from crash without any map
If the vectorizer test pass does not get any affine map, it should output nothing instead of crash.
Issue: https://github.com/llvm/llvm-project/issues/61534
Reviewed By: nicolasvasilache, dcaballe
Differential Revision: https://reviews.llvm.org/D146601
Joseph Huber [Thu, 23 Mar 2023 00:58:08 +0000 (19:58 -0500)]
[libc] Adjust NVPTX startup code
Summary:
The startup code needs to include the environment pointer so we add this
to the arguments. Also we need to ensure that the `crt1.o` file is made
with `-fgpu-rdc` set so we can actually use it without undefined
reference errors.
Ben Shi [Tue, 14 Mar 2023 09:27:47 +0000 (17:27 +0800)]
[RISCV][NFC] Add more tests for SLP vectorization (binops on load/store)
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D146025
Kai Sasaki [Thu, 23 Mar 2023 00:50:40 +0000 (09:50 +0900)]
[mlir] Fix typo for unknown operation
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D146607
Amy Huang [Wed, 22 Mar 2023 22:55:18 +0000 (15:55 -0700)]
Add "REQUIRES: asserts" to test that uses --debug-only flag
Pavel Kopyl [Thu, 16 Mar 2023 20:53:14 +0000 (21:53 +0100)]
[NVPTX] Port GenericToNVVM to the new PM.
Differential Revision: https://reviews.llvm.org/D146345
Jakub Kuderski [Wed, 22 Mar 2023 23:15:12 +0000 (19:15 -0400)]
[mlir][arith] Fix typos in WIE. NFC.
Jakub Kuderski [Wed, 22 Mar 2023 23:09:48 +0000 (19:09 -0400)]
[mlir][arith] Add `sitofp` support to WIE
This depends on the handling of `uitofp` in D146606.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D146597
Jakub Kuderski [Wed, 22 Mar 2023 23:04:09 +0000 (19:04 -0400)]
[mlir][arith] Add `uitofp` support to WIE
This includes standard LIT tests and integration tests with the LLVM CPU
runner.
I plan to use this to implement `sitofp` in D146597.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D146606
MalavikaSamak [Wed, 22 Mar 2023 22:31:00 +0000 (15:31 -0700)]
[-Wunsafe-buffer-usage] Add Fixable for simple pointer dereference
This patch introduces PointerDereferenceGadget, a FixableGadget that emits
fixits to handle cases where a pointer that is identified as unsafe is
dereferenced. The current implementation only handles cases where the strategy
is to change the type of the raw pointer to std::span. The fixit for this
strategy is to fetch the first element from the corresponding span instance.
For example for the code below, the PointerDereferenceGadget emits a fixit for
S3 (S1, S2 are to be handled by other gadgets):
S1: int *ptr = new int[10];
S2: int val1 = ptr[k]; // Unsafe operation
S3: int val2 = *ptr; => Fixit: int val2 = ptr[0];
Differential revision: https://reviews.llvm.org/D143206
Peter Collingbourne [Tue, 21 Mar 2023 01:38:04 +0000 (18:38 -0700)]
libclang: Pass Clang install directory to driver via argv[0].
Various driver features, such as the sysroot path detection for Android
targets, rely on being able to find the Clang install directory (look
for callers of `getDriver().getInstalledDir()`). However, the install
directory isn't currently being plumbed through to the driver, which is
conventionally done via the argv[0] passed to the Driver constructor.
It looks like D14695 attempted to fix this by adding another API that
allows specifying the argv[0]. However, rather than requiring every
user of libclang to switch to this API for correct behavior, let's have
the other existing APIs work by default, by using the existing logic in
libclang for finding the install directory.
Differential Revision: https://reviews.llvm.org/D146497
Teresa Johnson [Thu, 29 Dec 2022 20:11:38 +0000 (12:11 -0800)]
[MemProf] Context disambiguation cloning pass [patch 1b/3]
Adds support for building the graph in ThinLTO from MemProf summaries.
Follow-on patches will contain the support for cloning on the graph and
in the IR.
Depends on D140908.
Differential Revision: https://reviews.llvm.org/D145836
Chia-hung Duan [Wed, 22 Mar 2023 21:46:23 +0000 (21:46 +0000)]
[scudo] Early exit from the case can't do page release.
There are heuristics to avoid marking blocks if there's little chance
to release pages. So far, those logics only exist in block-marking
section and we didn't leverage the results of those logics. For example,
in a round of releaseToOS try, we know it's still 128 KB away from the
release threshold. In the next round of releaseToOS, we can early exit
if the number of pushed bytes is smaller than 128 KB without looping
each memory group. This CL adds this heuristic and has reduced amount of
time in checking the status of each memory group.
This CL only applies this heuristic on SizeClassAllocator64.
SizeClassAllocator32 has a smaller region/group size and has little
impact on the default value.
Reviewed By: cferris
Differential Revision: https://reviews.llvm.org/D146312
Dave Lee [Thu, 9 Mar 2023 19:10:32 +0000 (11:10 -0800)]
[lldb] Fix dwim-print error message for missing expr
Nikolas Klauser [Wed, 22 Mar 2023 21:20:10 +0000 (22:20 +0100)]
[libc++] Remove __mutex_base header
This header should have been removed in
https://reviews.llvm.org/D146228, but there was a merge conflict.
Mark de Wever [Wed, 22 Mar 2023 16:39:27 +0000 (17:39 +0100)]
[libc++] Qualifies intptr_t and uintptr_t.
This has been done using the following command
find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?intptr_t)|\1std::\2|' \{} \;
The std module doesn't export declarations in the global namespaace.
This is a preparation for that module.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D146643
Stefan Gränitz [Wed, 22 Mar 2023 21:11:26 +0000 (22:11 +0100)]
[JITLink] Deterministic JITDylib symbol table dumps
Sort symbols before dumping so we get a deterministic order and can check them in tests.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D146658
Philip Reames [Wed, 22 Mar 2023 21:01:39 +0000 (14:01 -0700)]
[MSAN] Update vector load/store tests to use proper attribute
I had made a mistake when pre-committing the tests; caught in review of D146157.
Ethan Luis McDonough [Wed, 22 Mar 2023 20:49:50 +0000 (15:49 -0500)]
Revert "[flang] Feature list plugin" due to failing build
This reverts commit
823ddba1b325f30fc3fb2e9d695c211b856a4d5d.
Christopher Ferris [Fri, 17 Mar 2023 22:25:48 +0000 (15:25 -0700)]
[docs][scudo] Add information about M_PURGE_ALL.
Add information about M_PURGE_ALL
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D146336
Louis Dionne [Thu, 16 Mar 2023 17:09:44 +0000 (13:09 -0400)]
[libc++] Remove availability markup for std::format
std::format is currently experimental, so there is technically no
deployment target requirement for it (since the only symbols required
for it are in `libc++experimental.a`).
However, some parts of std::format depend indirectly on the floating
point std::to_chars implementation, which does have deployment target
requirements.
This patch removes all the availability format for std::format and
updates the XFAILs in the tests to properly explain why they fail
on old deployment targets, when they do. It also changes a couple
of tests to avoid depending on floating-point std::to_chars when
it isn't fundamental to the test.
Finally, some tests are marked as XFAIL but I added a comment saying
TODO FMT This test should not require std::to_chars(floating-point)
These tests do not fundamentally depend on floating-point std::to_chars,
however they end up failing because calling std::format even without a
floating-point argument to format will end up requiring floating-point
std::to_chars. I believe this is an implementation artifact that could
be avoided in all cases where we know the format string at compile-time.
In the tests, I added the TODO comment only to the places where we could
do better and actually avoid relying on floating-point std::to_chars
because we know the format string at compile-time.
Differential Revision: https://reviews.llvm.org/D134598
Fangrui Song [Wed, 22 Mar 2023 19:56:13 +0000 (12:56 -0700)]
[test] Add tools/llvm-dwarfdump/ARM/lit.local.cfg after D143513
Stefan Gränitz [Wed, 22 Mar 2023 19:21:59 +0000 (20:21 +0100)]
[JITLink] Introduce target flags for Symbol and prepare ObjectLinkingLayer to account for them
AArch32 branch offsets explicitly encode the target instruction subset (Arm/Thumb) in their least significant bit. We want this bit set (or clear) in addreses we hand out, but the addresses in the LinkGraph should be the real/physical addresses.
This patch allows ELFLinkGraphBuilder's to set target-specific flags in jitlink::Symbol and prepares ObjectLinkingLayer to account for them.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D146641
LLVM GN Syncbot [Wed, 22 Mar 2023 19:30:55 +0000 (19:30 +0000)]
[gn build] Port
e655d8a54880
Jeff Byrnes [Wed, 22 Mar 2023 19:19:00 +0000 (12:19 -0700)]
Precommit tests for D146327
Philip Reames [Wed, 22 Mar 2023 19:07:08 +0000 (12:07 -0700)]
[LFTR] Simplify integer case for genLoopLimit [nfc-ish]
The integer case in genLoopLimit reduces down to a special case for narrowing the bitwidth of the limit, and then performing the same expansion we would for a pointer IV.
Differential Revision: https://reviews.llvm.org/D146638
Nikolas Klauser [Thu, 9 Mar 2023 00:14:03 +0000 (01:14 +0100)]
[libc++] Granularize __mutex_base
This also updates the moved code to the current style. (i.e. `_VSTD` -> `std`, `_LIBCPP_INLINE_VISIBILITY` -> `_LIBCPP_HIDE_FROM_ABI`, clang-format).
Reviewed By: Mordante, #libc, EricWF
Spies: arichardson, libcxx-commits, mikhail.ramalho
Differential Revision: https://reviews.llvm.org/D146228
Philip Reames [Wed, 22 Mar 2023 16:51:58 +0000 (09:51 -0700)]
[SCEV] Infer no-self-wrap via constant ranges
Without this, pointer IVs in loops with small constant trip counts couldn't be proven no-self-wrap. This came up in a new LSR transform, but may also benefit other SCEV consumers as well.
Differential Revision: https://reviews.llvm.org/D146596
Carlos Galvez [Wed, 22 Mar 2023 18:38:10 +0000 (18:38 +0000)]
[clang-tidy][NFC] Move avoid-underscore-in-googletest-name to google folder
Since the check belongs to the google module, it makes sense
that the corresponding test also belongs to the google module.
Differential Revision: https://reviews.llvm.org/D146653