Eduardo Caldas [Fri, 21 Aug 2020 12:20:02 +0000 (12:20 +0000)]
[SyntaxTree] Use annotations in Statement tests
Differential Revision: https://reviews.llvm.org/D86345
Raphael Isemann [Fri, 21 Aug 2020 14:08:37 +0000 (16:08 +0200)]
Revert "Correctly emit dwoIDs after ASTFileSignature refactoring (D81347)"
This reverts commit
a4c3ed42ba5625af54254584d762ebf96cc06942.
The test is curiously failing with a plain exit code 1 on Fuchsia.
Florian Hahn [Fri, 21 Aug 2020 11:26:41 +0000 (12:26 +0100)]
Recommit "[SCEVExpander] Add helper to clean up instrs inserted while expanding."
Recommit the patch after fixing an issue reported caused by the fact
that re-used values are also added to InsertedValues.
Additional tests have been added in
88818491b9dea64ec65c92ce5652bc45bef337a4
This reverts the revert commit
38884641f28e373ce291dc5ea93416756216e536.
Cameron McInally [Fri, 21 Aug 2020 14:00:13 +0000 (09:00 -0500)]
[SVE] Lower fixed length UDIV to scalable
Pretty much just a copy of the SDIV patches (D86114 and D85982) with string replacement.
Differential Revision: https://reviews.llvm.org/D86316
Haojian Wu [Fri, 21 Aug 2020 13:48:59 +0000 (15:48 +0200)]
[AST][RecoveryExpr] Fix a bogus unused diagnostic when the type is preserved.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D85716
Raphael Isemann [Fri, 21 Aug 2020 12:21:21 +0000 (14:21 +0200)]
Correctly emit dwoIDs after ASTFileSignature refactoring (D81347)
D81347 changes the ASTFileSignature to be an array of 20 uint8_t instead of 5
uint32_t. However, it didn't update the code in ObjectFilePCHContainerOperations
that creates the dwoID in the module from the ASTFileSignature
(`Buffer->Signature` being the array subclass that is now `std::array<uint8_t,
20>` instead of `std::array<uint32_t, 5>`).
```
uint64_t Signature = [..] (uint64_t)Buffer->Signature[1] << 32 | Buffer->Signature[0]
```
This code works with the old ASTFileSignature (where two uint32_t are enough to
fill the uint64_t), but after the patch this only took two bytes from the
ASTFileSignature and only partly filled the Signature uint64_t.
This caused that the dwoID in the module ref and the dwoID in the actual module
no longer match (which in turns causes that LLDB keeps warning about the dwoID's
not matching when debugging -gmodules-compiled binaries).
This patch just unifies the logic for turning the ASTFileSignature into an
uint64_t which makes the dwoID match again (and should prevent issues like that
in the future).
Reviewed By: aprantl, dang
Differential Revision: https://reviews.llvm.org/D84013
Florian Hahn [Fri, 21 Aug 2020 11:48:05 +0000 (12:48 +0100)]
[LoopIdiom,LSR] Add additional tests for SCEVExpander cleanups.
Sam Parker [Fri, 21 Aug 2020 12:10:25 +0000 (13:10 +0100)]
[NFC][SimplifyCFG] Formatting and variable rename
Georgii Rymar [Thu, 20 Aug 2020 12:45:27 +0000 (15:45 +0300)]
[llvm-readelf][test] - Refine the merged.test
The testing in merged.test is not ideal.
It uses the following set of flags: `-aeWhSrnudlVgIs`
and the precompiled object `trivial.obj.elf-i386`.
In fact, this object, for example, does not contain versioning stuff,
so specifying `-V` does not make much sense for it, so it is not really tested.
Also, we want to avoid using of precompiled objects, ideally we
want to use a YAML that triggers an output for each of the short options in use:
```
-a: --all
-e: --headers
-W: --wide
-h: --file-headers, --file-header
-S: --section-headers, --sections
-r: --relocations
-n: --notes
-u: --unwind
-d: --dynamic-table
-l: --program-headers
-V: --version-info
-g: --elf-section-groups
-I: --elf-hash-histogram
-s: --symbols
```
Note that, for example, we do not need to have groups to test `-g`, because for a
object with no groups llvm-readelf still prints "There are no section groups in this file.",
but that is not always the case. E.g. for `-d` we don't print anything when we have
no dynamic table, so we have to describe it in a YAML to test `-d` properly.
Also, we probably want to test cases with and without `-a`(-all) option separately
to be sure that we handle all options and not only the first one in the sequence.
Differential revision: https://reviews.llvm.org/D86283
Luís Marques [Fri, 21 Aug 2020 12:04:25 +0000 (13:04 +0100)]
[compiler-rt][RISCV] Use muldi3 builtin assembly implementation
D80465 added an assembly implementation of muldi3 for RISC-V but it didn't
add it to the cmake `*_SOURCES` list, so the C implementation was being used
instead. This patch fixes that.
Differential Revision: https://reviews.llvm.org/D86036
Georgii Rymar [Thu, 20 Aug 2020 12:56:24 +0000 (15:56 +0300)]
[llvm-readobj/elf] - Refine the code for broken PT_DYNAMIC segment diagnostic.
The code that reports "PT_DYNAMIC segment offset + size exceeds the size of the file"
has an issue: it is possible to bypass the validation by overflowing the size + offset result.
Differential revision: https://reviews.llvm.org/D85519
Nemanja Ivanovic [Fri, 21 Aug 2020 11:13:56 +0000 (06:13 -0500)]
[PowerPC] Pre-commit FISel with PC-Rel test
Our handling of PC-Relative addressing is currently broken with
Fast ISel in 3 ways:
- FISel emits calls without handling all the PC-Rel intricacies
- FISel materializes FP constants through the TOC
- FISel materializes GV's through the TOC
As it would be unnecessarily tedious to implement all the handling
for PC-Rel in Fast ISel, we will turn off FISel for anything that
generates references to the TOC.
Dmitry Preobrazhensky [Fri, 21 Aug 2020 11:22:25 +0000 (14:22 +0300)]
[AMDGPU][MC][NFC][DOC] Updated AMD GPU assembler syntax description.
Summary of changes:
- added description of MTBUF instructions and format modifier;
- described limitations of f16 inline constants when used with integer operands;
- updated description of gfx9+ flat global addressing modes;
- v_accvgpr_write_b32 src0 corrections (gfx908);
- minor bugfixing and improvements.
Adam Czachorowski [Tue, 11 Aug 2020 16:48:22 +0000 (18:48 +0200)]
[clangd] Discard diagnostics from another SourceManager.
This can happen when building implicit modules, as demonstrated in test.
The CompilerInstance uses the same StoredDiags, but different
SourceManager. This used to crash clangd when it tried to relocate the
diagnostic to the main file, which, according to SourceManager from the
diagnostic, is a fake <module-includes> file.
Differential Revision: https://reviews.llvm.org/D85753
Xing GUO [Fri, 21 Aug 2020 11:01:35 +0000 (19:01 +0800)]
Recommit: [DWARFYAML] Add support for referencing different abbrev tables.
The original commit (
7ff0ace96db9164dcde232c36cab6519ea4fce8) was causing
build failure and was reverted in
6d242a73264ef1e3e128547f00e0fe2d20d3ada0
==================== Original Commit Message ====================
This patch adds support for referencing different abbrev tables. We use
'ID' to distinguish abbrev tables and use 'AbbrevTableID' to explicitly
assign an abbrev table to compilation units.
The syntax is:
```
debug_abbrev:
- ID: 0
Table:
...
- ID: 1
Table:
...
debug_info:
- ...
AbbrevTableID: 1 ## Reference the second abbrev table.
- ...
AbbrevTableID: 0 ## Reference the first abbrev table.
```
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D83116
Sam Parker [Fri, 21 Aug 2020 10:51:40 +0000 (11:51 +0100)]
[NFC] Add SimplifyCFG for ARM
Add some phi elimination threshold testing.
Simon Pilgrim [Fri, 21 Aug 2020 10:37:40 +0000 (11:37 +0100)]
[X86] Enable constexpr on BITSCAN intrinsics (PR31446)
This enables constexpr BSF/BSR intrinsics defined in ia32intrin.h
lewis-revill [Fri, 21 Aug 2020 09:47:54 +0000 (10:47 +0100)]
[RISCV] Fix inaccurate annotations on PseudoBRIND
PseudoBRIND had seemingly inherited incorrect annotations denoting it as
a call instruction and that it defines X1/ra. This caused excess
save/restore code to be emitted for ra.
Differential Revision: https://reviews.llvm.org/D86286
Mirko Brkusanin [Fri, 21 Aug 2020 09:51:06 +0000 (11:51 +0200)]
[AMDGPU] Use ds_read/write_b96/b128 when possible for SDag
Do not break down local loads and stores so ds_read/write_b96/b128 in
ISelLowering can be selected on subtargets that support them and if align
requirements allow them.
Differential Revision: https://reviews.llvm.org/D84403
Mirko Brkusanin [Fri, 21 Aug 2020 09:42:49 +0000 (11:42 +0200)]
[AMDGPU][GlobalISel] Fix 96 and 128 local loads and stores
Fix local ds_read/write_b96/b128 so they can be selected if the alignment
allows. Otherwise, either pick appropriate ds_read2/write2 instructions or break
them down.
Differential Revision: https://reviews.llvm.org/D81638
Mirko Brkusanin [Fri, 21 Aug 2020 09:37:23 +0000 (11:37 +0200)]
[AMDGPU] Reorganize GCN subtarget features for unaligned access
Features UnalignedBufferAccess and UnalignedDSAccess are now used to determine
whether hardware supports such access.
UnalignedAccessMode should be used to enable them.
hasUnalignedBufferAccessEnabled() and hasUnalignedDSAccessEnabled() can be
now used to quickly check both.
Differential Revision: https://reviews.llvm.org/D84522
Mirko Brkusanin [Fri, 21 Aug 2020 09:29:32 +0000 (11:29 +0200)]
[AMDGPU] Fix alignment requirements for 96bit and 128bit local loads and stores
Adjust alignment requirements for ds_read/write_b96/b128.
GFX9 and onwards allow misaligned access for reads and writes but only if
SH_MEM_CONFIG.alignment_mode allows it.
UnalignedDSAccess is set on GCN subtargets from GFX9 onward to let us know if we
can relax alignment requirements.
UnalignedAccessMode acts similary to UnalignedBufferAccess for DS instructions
but only from GFX9 onward and is supposed to match alignment_mode. By default
alignment of 4 is required.
Differential Revision: https://reviews.llvm.org/D82788
Georgii Rymar [Wed, 19 Aug 2020 12:38:43 +0000 (15:38 +0300)]
[llvm-readelf] - Start recognizing 'PT_OPENBSD_*' segment types.
Its a follow-up for D85830, it stops ignoring 'PT_OPENBSD_*' segment types.
Now them are recognized properly.
Note: GNU readelf does not recognize them, though perhaps it shouldn't.
Anyways, it was reported to binutils: https://sourceware.org/bugzilla/show_bug.cgi?id=26405#c0
Differential revision: https://reviews.llvm.org/D86208
Simon Pilgrim [Fri, 21 Aug 2020 09:53:17 +0000 (10:53 +0100)]
[X86] Enable constexpr on BSWAP intrinsics (PR31446)
This enables constexpr BSWAP intrinsics defined in ia32intrin.h
Florian Hahn [Fri, 21 Aug 2020 09:18:32 +0000 (10:18 +0100)]
[DSE,MemorySSA] Handle atomicrmw/cmpxchg conservatively.
This adds conservative handling of AtomicRMW/AtomicCmpXChg to
isDSEBarrier, similar to atomic loads and stores.
Roman Lebedev [Fri, 17 Jul 2020 11:30:51 +0000 (14:30 +0300)]
[NFC] Port InstCount pass to new pass manager
Jay Foad [Tue, 31 Mar 2020 16:24:07 +0000 (17:24 +0100)]
[SelectionDAG] Better legalization for FSHL and FSHR
In SelectionDAGBuilder always translate the fshl and fshr intrinsics to
FSHL and FSHR (or ROTL and ROTR) instead of lowering them to shifts and
ORs. Improve the legalization of FSHL and FSHR to avoid code quality
regressions.
Differential Revision: https://reviews.llvm.org/D77152
Simon Pilgrim [Fri, 21 Aug 2020 09:19:41 +0000 (10:19 +0100)]
[X86] Enable constexpr on POPCNT intrinsics (PR31446)
Followup to D86229, this enables constexpr on the alternative (which fallback to generic code) POPCNT intrinsics defined in ia32intrin.h
Florian Hahn [Fri, 21 Aug 2020 08:50:01 +0000 (09:50 +0100)]
[DSE,MemorySSA] Regenerate check lines for atomic.ll tests.
Jay Foad [Fri, 21 Aug 2020 09:01:01 +0000 (10:01 +0100)]
[AMDGPU] Apply llvm-prefer-register-over-unsigned from clang-tidy
sstefan1 [Fri, 21 Aug 2020 09:11:47 +0000 (11:11 +0200)]
[Attributor][NFC] run update_test_checks with --check-attributes.
Yevgeny Rouban [Fri, 21 Aug 2020 08:52:26 +0000 (15:52 +0700)]
[NewPM][PassInstrumentation] Add PreservedAnalyses parameter to AfterPass* callbacks
Both AfterPass and AfterPassInvalidated pass instrumentation
callbacks get additional parameter of type PreservedAnalyses.
This patch was created by @fedor.sergeev. I have just slightly
changed it.
Reviewers: fedor.sergeev
Differential Revision: https://reviews.llvm.org/D81555
Simon Pilgrim [Fri, 21 Aug 2020 09:02:37 +0000 (10:02 +0100)]
[X86] ia32intrin.h - pull out common attributes into defines. NFCI.
Matches what we do in most other x86 headers
Sam Parker [Fri, 21 Aug 2020 08:27:21 +0000 (09:27 +0100)]
[SimplifyCFG] Cost required selects
Before we speculatively execute a basic block, query the cost of
inserting the necessary select instructions against the phi folding
threshold. For non-trivial insertions, a more accurate decision can
probably be made during machine if-conversion. With minsize we query
the CodeSize cost, otherwise we use SizeAndLatency.
Differential Revision: https://reviews.llvm.org/D82438
Gongyu Deng [Fri, 21 Aug 2020 07:57:18 +0000 (09:57 +0200)]
[lldb] Tab completion for process load/unload
1. Complete `process load` with the common disk file completion, so there is not test provided for it;
2. Complete `process unload` with the tokens of valid loaded images.
Thanks for Raphael's help on the test for `process unload`.
Reviewed By: teemperor
Differential Revision: https://reviews.llvm.org/D79887
Georgii Rymar [Thu, 20 Aug 2020 15:40:52 +0000 (18:40 +0300)]
[llvm-readobj] - Change how we create DynRegionInfo objects. NFCI.
Currently we have `checkDRI` and two `createDRIFrom` methods which
are used to create `DynRegionInfo` objects.
And we have an issue: constructions like:
`ObjF->getELFFile()->base() + P->p_offset`
that are used in `createDRIFrom` functions might overflow.
I had to revert `D85519` which triggered such UBSan failure.
This NFC, simplifies and generalizes how we create `DynRegionInfo` objects.
It will allow us to introduce more/better validation checks in a single place.
It also will allow to change `createDRI` to return `Expected<>` so
that we will be able to stop using the `reportError`, which
is used inside currently, and have a warning instead.
Differential revision: https://reviews.llvm.org/D86297
Florian Hahn [Fri, 21 Aug 2020 08:13:59 +0000 (09:13 +0100)]
[DSE,MemorySSA] Split off partial tracking from isOverwite.
When traversing memory uses to look for aliasing reads/writes, we only
care about complete overwrites. This patch splits off the partial
overwrite tracking from isOverwrite This avoids some unnecessary work
when checking for read/write clobbers with MemorySSA-DSE.
isOverwrite, which skips the partial overwrite tracking.
This gives a relatively small improvement
http://llvm-compile-time-tracker.com/compare.php?from=
ef2a2f77f87553a0a4a39f518eb9ac86b756bda6&to=
658f3905dd96d3415f3782adc712c79fa59a4665&stat=instructions
This is part of the patches to bring down compile-time to the level
referenced in
http://lists.llvm.org/pipermail/llvm-dev/2020-August/144417.html
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D86280
Eduardo Caldas [Thu, 20 Aug 2020 15:47:48 +0000 (15:47 +0000)]
[SyntaxTree] Add support for `this`
Differential Revision: https://reviews.llvm.org/D86298
Sam Parker [Tue, 18 Aug 2020 11:52:58 +0000 (12:52 +0100)]
[ARM][CostModel] Select instruction costs.
Modify the ARM getCmpSelInstrCost implementation for the code size
costs of selects. Now consider the legalization cost and increase
the cost of i1 because those values wouldn't live in a general purpose
register. We also make selects +1 more expensive to account for the IT
instruction.
Differential Revision: https://reviews.llvm.org/D82091
David Green [Fri, 21 Aug 2020 07:48:12 +0000 (08:48 +0100)]
[ARM][LV] Add a preferPredicatedReductionSelect target hook
As part of D84741, this adds a target hook for the
preferPredicatedReductionSelect option and makes use
of it under MVE, allowing us to tail predicate most
reduction loops.
Differential Revision: https://reviews.llvm.org/D85980
Qiu Chaofan [Fri, 21 Aug 2020 07:12:19 +0000 (15:12 +0800)]
[PowerPC] Add readflm/setflm intrinsics to Clang
Commit
dbcfbffc adds ppc.readflm and ppc.setflm intrinsics to read or
write FPSCR register. This patch adds them to Clang.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D85874
Craig Topper [Fri, 21 Aug 2020 06:45:34 +0000 (23:45 -0700)]
[X86] Correct the implementation of the testFeature macro in getIntelProcessorTypeAndSubtype to do a proper bit test.
Instead of ANDing with a one hot mask representing the bit to
be tested, we were ANDing with just the bit number. This tests
multiple bits none of them the correct one.
This caused skylake-avx512, cascadelake and cooperlake to all
be misdetected. Based on experiments with the Intel SDE, it seems
that all of these CPUs are being detected as being cooperlake.
This is bad since its the newest CPU of the 3.
Mehdi Amini [Fri, 21 Aug 2020 04:25:57 +0000 (04:25 +0000)]
Allow multiple calls to InitLLVM() (NFC)
In
e99dee82b0, the "out_of_memory_new_handler" was changed to be
explicitly initialized instead of relying on a global static
constructor.
However before this change, install_out_of_memory_new_handler could be
called multiple times while it asserts right now.
We can be more tolerant to calling multiple time InitLLVM without
reintroducing a global constructor for this handler.
Differential Revision: https://reviews.llvm.org/D86330
Jonas Devlieghere [Fri, 21 Aug 2020 05:59:13 +0000 (22:59 -0700)]
[lldb] Fix a new -Wdocumetnation issues (NFC)
Jonas Devlieghere [Fri, 21 Aug 2020 05:40:48 +0000 (22:40 -0700)]
[lldb] Remove redundant call to FindBacktrace (NFC)
We're not using any of the Backtrace_* CMake variables set by
FindBacktrace in LLDB.
Jonas Devlieghere [Fri, 21 Aug 2020 05:32:31 +0000 (22:32 -0700)]
[lldb] Simplify CMake logic with LLVM's append_if function
Use the append_if CMake function from HandleLLVMOptions. Since we
include this file in LLDBStandalone it should work in both for in-tree
and out-of-tree builds.
Michael Kruse [Fri, 21 Aug 2020 05:17:29 +0000 (00:17 -0500)]
[Polly] Update isl to isl-0.22.1-416-g61d6dc75.
This fixes llvm.org/PR47104
Mauricio Sifontes [Fri, 21 Aug 2020 04:59:23 +0000 (04:59 +0000)]
Refactor Reduction Tree Pass
Refactor the way the reduction tree pass works in the MLIR Reduce tool by introducing a set of utilities that facilitate the implementation of new Reducer classes to be used in the passes.
This will allow for the fast implementation of general transformations to operate on all mlir modules as well as custom transformations for different dialects.
These utilities allow for the implementation of Reducer classes by simply defining a method that indexes the operations/blocks/regions to be transformed and a method to perform the deletion or transfomration based on the indexes.
Create the transformSpace class member in the ReductionNode class to keep track of the indexes that have already been transformed or deleted at a current level.
Delete the FunctionReducer class and replace it with the OpReducer class to reflect this new API while performing the same transformation and allowing the instantiation of a reduction pass for different types of operations at the module's highest hierarchichal level.
Modify the SinglePath Traversal method to reflect the use of the new API.
Reviewed: jpienaar
Differential Revision: https://reviews.llvm.org/D85591
Xing GUO [Fri, 21 Aug 2020 04:14:58 +0000 (12:14 +0800)]
Revert "[DWARFYAML] Add support for referencing different abbrev tables."
This reverts commit
f7ff0ace96db9164dcde232c36cab6519ea4fce8.
This change is causing build failure.
http://lab.llvm.org:8011/builders/clang-cmake-armv7-global-isel/builds/10400
Yevgeny Rouban [Fri, 21 Aug 2020 03:45:11 +0000 (10:45 +0700)]
[ADT] Allow IsSizeLessThanThresholdT for incomplete types. NFC
If the type T is incomplete then sizeof(T) results in C++ compilation error at line:
static constexpr bool value = sizeof(T) <= (2 * sizeof(void *));
This patch allows incomplete types in parameters of function. Example:
using SomeFunc = void(SomeIncompleteType &);
llvm::unique_function<SomeFuncType> SomeFunc;
Reviewers: DaniilSuchkov, vvereschaka
Differential Revision: https://reviews.llvm.org/D81554
Xing GUO [Fri, 21 Aug 2020 02:33:58 +0000 (10:33 +0800)]
[DWARFYAML] Add support for referencing different abbrev tables.
This patch adds support for referencing different abbrev tables. We use
'ID' to distinguish abbrev tables and use 'AbbrevTableID' to explicitly
assign an abbrev table to compilation units.
The syntax is:
```
debug_abbrev:
- ID: 0
Table:
...
- ID: 1
Table:
...
debug_info:
- ...
AbbrevTableID: 1 ## Reference the second abbrev table.
- ...
AbbrevTableID: 0 ## Reference the first abbrev table.
```
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D83116
Xing GUO [Thu, 20 Aug 2020 02:33:51 +0000 (10:33 +0800)]
[DWARFYAML] Add support for emitting multiple abbrev tables.
This patch adds support for emitting multiple abbrev tables. Currently,
compilation units will always reference the first abbrev table.
Reviewed By: jhenderson, labath
Differential Revision: https://reviews.llvm.org/D86194
Shoaib Meenai [Fri, 21 Aug 2020 02:50:09 +0000 (19:50 -0700)]
[cmake] Don't use ld.lld when targeting Darwin
ld.lld is an ELF linker. We can switch to the new LLD for Mach-O port
when it's more complete, but for now, assume the user will have set
CMAKE_LINKER correctly themselves when targeting Darwin.
Xing GUO [Fri, 21 Aug 2020 02:11:33 +0000 (10:11 +0800)]
[DWARFYAML] Add support for emitting multiple abbrev tables.
This patch adds support for emitting multiple abbrev tables. Currently,
compilation units will always reference the first abbrev table.
Reviewed By: jhenderson, labath
Differential Revision: https://reviews.llvm.org/D86194
Michael Liao [Wed, 24 Jun 2020 16:13:10 +0000 (12:13 -0400)]
[amdgpu] Add codegen support for HIP dynamic shared memory.
Summary:
- HIP uses an unsized extern array `extern __shared__ T s[]` to declare
the dynamic shared memory, which size is not known at the
compile time.
Reviewers: arsenm, yaxunl, kpyzhov, b-sumner
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82496
Shoaib Meenai [Thu, 20 Aug 2020 19:18:15 +0000 (12:18 -0700)]
[runtimes] Allow LLVM_BUILTIN_TARGETS to include Darwin
We have two ways of using the runtimes build setup to build the
builtins. You can either have an empty LLVM_BUILTIN_TARGETS (or have it
include the "default" target), in which case builtin_default_target is
called to set up the default target, or you can have actual triples in
LLVM_BUILTIN_TARGETS, in which case builtin_register_target is called
for each triple. builtin_default_target lets you build the builtins for
Darwin (assuming your default triple is Darwin); builtin_register_target
does not.
I don't understand the reason for this distinction. The Darwin builtins
build is special in that a single CMake configure handles building the
builtins for multiple platforms (e.g. macOS, iPhoneSimulator, and iOS)
and architectures (e.g. arm64, armv7, and x86_64). Consequently, if you
specify multiple Darwin triples in LLVM_BUILTIN_TARGETS, expecting each
configure to only build for that particular triple, it won't work.
However, if you specify a *single* x86_64-apple-darwin triple in
LLVM_BUILTIN_TARGETS, that single configure will build the builtins for
all Darwin targets, exactly the same way that the default target would.
The only difference between the configuration for the default target and
the x86_64-apple-darwin triple is that the latter runs the configuration
with `-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON`, but that makes no
difference for Apple targets (none of the CMake codepaths which have
different behavior based on that variable are run for Apple targets).
I tested this by running two builtins builds on my Mac, one with the
default target and one with the x86_64-apple-darwin19.5.0 target (which
is the default target triple for my clang). The only relevant
CMakeCache.txt difference was the following, and as discussed above, it
has no effect on the actual build for Apple targets:
```
-//Default triple for which compiler-rt runtimes will be built.
-COMPILER_RT_DEFAULT_TARGET_TRIPLE:STRING=x86_64-apple-darwin19.5.0
+//No help, variable specified on the command line.
+COMPILER_RT_DEFAULT_TARGET_ONLY:UNINITIALIZED=ON
```
Furthermore, when I add the `-D` flag to compiler-rt's libtool
invocations, the libraries produced by the two builds are *identical*.
If anything, I would expect builtin_register_target to complain if you
tried specifying a triple for a particular Apple platform triple (e.g.
macosx), since that's the scenario in which it won't work as you want.
The generic darwin triple should be fine though, as best as I can tell.
I'm happy to add the error for specific Apple platform triples, either
in this diff or in a follow-up.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D86313
Gousemoodhin Nadaf [Fri, 21 Aug 2020 01:07:46 +0000 (18:07 -0700)]
[clang]: Remove assertion which checks explicit declaration
explicit keyword is declared outside of class is invalid, invalid explicit declaration is handled inside DiagnoseFunctionSpecifiers() function. To avoid compiler crash in case of invalid explicit declaration, remove assertion.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D83929
Kang Zhang [Fri, 21 Aug 2020 01:10:52 +0000 (01:10 +0000)]
[PowerPC] Fix a typo for InstAlias of mfsprg
D77531 has a type for mfsprg, it should be mtsprg. This patch is to fix
this typo.
Jonas Devlieghere [Thu, 20 Aug 2020 23:19:17 +0000 (16:19 -0700)]
[lldb] Capture and load home directory from the reproducer.
When replaying the reproducer, lldb should source the .lldbinit file
that was captured by the reproducer and not the one in the current home
directory. This requires that we store the home directory as part of the
reproducer. By returning the virtual home directory during replay, we
ensure the correct virtual path gets constructed which the VFS can then
find and remap to the correct file in the reproducer root.
This patch adds a new HomeDirectoryProvider, similar to the existing
WorkingDirectoryProvider. As the home directory is not part of the VFS,
it is stored in LLDB's FileSystem instance.
Jonas Devlieghere [Thu, 20 Aug 2020 23:03:45 +0000 (16:03 -0700)]
[lldb] Implement WorkingDirectoryProvider in terms of DirectoryProvider (NFC)
Add an abstract base class that can be used to create other directory
providers.
Vitaly Buka [Fri, 21 Aug 2020 00:47:41 +0000 (17:47 -0700)]
Revert "[libFuzzer] Fix value-profile-load test."
D86247 fails on Windows.
This reverts commit
428bebaf10e177db5e42206ca8f871f0bcbef058.
Volodymyr Sapsai [Wed, 20 May 2020 00:29:35 +0000 (17:29 -0700)]
[HeaderSearch] Fix processing #import-ed headers multiple times with modules enabled.
HeaderSearch was marking requested HeaderFileInfo as Resolved only based on
the presence of ExternalSource. As the result, using any module was enough
to set ExternalSource and headers unknown to this module would have
HeaderFileInfo with empty fields, including `isImport = 0`, `NumIncludes = 0`.
Such HeaderFileInfo was preserved without changes regardless of how the
header was used in other modules and caused incorrect result in
`HeaderSearch::ShouldEnterIncludeFile`.
Fix by marking HeaderFileInfo as Resolved only if ExternalSource knows
about this header.
rdar://problem/
62126911
Reviewed By: bruno
Differential Revision: https://reviews.llvm.org/D80263
Vitaly Buka [Fri, 21 Aug 2020 00:33:51 +0000 (17:33 -0700)]
[NFC][libFuzzer] Try to fix test on Windows
Broken after D86247
Vitaly Buka [Fri, 21 Aug 2020 00:25:57 +0000 (17:25 -0700)]
Fix msan build
After D85820 TERMINFO_LIB is undefined.
Justin Bogner [Fri, 21 Aug 2020 00:03:18 +0000 (17:03 -0700)]
[GISel] Correct the known bits of G_ANYEXT
Known bits for G_ANYEXT was incorrectly using KnownBits::zext, causing
us to treat the high bits as zero even though they're (by definition)
unknown.
Differential Revision: https://reviews.llvm.org/D86323
Richard Smith [Thu, 20 Aug 2020 23:41:16 +0000 (16:41 -0700)]
Improve pretty-printing for APValues of void type.
No functionality change intended: there doesn't seem to be any way to
cause Clang to print such a value, but they can show up when dumping
APValues from a debugger.
Julian Lettner [Thu, 20 Aug 2020 23:33:40 +0000 (16:33 -0700)]
[Darwin][iOS] Enable test on non-macOS platforms
We are now using a properly-substituted minimal deployment target
compiler flag (`%min_macos_deployment_target=10.11`). Enable test on
iOS and watchOS plus simulators. We are also not testing on very old
platforms anymore, so we can remove some obsolete lit infrastructure.
Richard Smith [Thu, 20 Aug 2020 23:34:48 +0000 (16:34 -0700)]
Fix up clangd after Clang
038edf6029bafe70b1f7165abe2b0e61ddf506b3.
Now that Clang is able to constant-evaluate void-typed expressions,
disable showing hover-card values for them. It's not useful to say that
an expression cast to void has value '<no value>', even if we can
constant-evaluate it to that result!
Julian Lettner [Wed, 12 Aug 2020 22:02:42 +0000 (15:02 -0700)]
[compiler-rt][Darwin] Refactor minimum deployment target substitutions
* Support macOS 11+ version scheme
* Standardize substitution name `%min_deployment_target=x.y`
* Remove unneeded error cases (the input version is hard-coded)
* Specify version as tuple instead of string; no need to parse it
These changes should also facilitate a future addition of a substitution
that expands to "set deployment target to current target version"
(https://reviews.llvm.org/D70151).
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D85925
Fangrui Song [Thu, 20 Aug 2020 23:05:27 +0000 (16:05 -0700)]
[ELF] Keep st_type for symbol assignment
PR46970: for `alias = aliasee`, the alias can be used in relocation processing
and on ARM st_type does affect Thumb interworking. It is thus desirable for the
alias to get the same st_type.
Note that the st_size field should not be inherited because some tools use
st_size=0 as a heuristic to detect aliases. Retaining st_size can thwart such
heuristics and cause aliases to be preferred over the original symbols.
Differential Revision: https://reviews.llvm.org/D86263
JonChesterfield [Thu, 20 Aug 2020 22:50:33 +0000 (23:50 +0100)]
Fix 32 bit build broken by D85990 by dropping align from filecheck pattern
Richard Smith [Thu, 20 Aug 2020 22:34:34 +0000 (15:34 -0700)]
Don't reject uses of void-returning consteval functions.
Frank Laub [Thu, 20 Aug 2020 22:19:37 +0000 (22:19 +0000)]
[MLIR] Add affine.parallel folder and normalizer
Add a folder to the affine.parallel op so that loop bounds expressions are canonicalized.
Additionally, a new AffineParallelNormalizePass is added to adjust affine.parallel ops so that the lower bound is always 0 and the upper bound always represents a range with a step size of 1.
Differential Revision: https://reviews.llvm.org/D84998
Eric Leese [Thu, 20 Aug 2020 21:13:21 +0000 (14:13 -0700)]
Make DWARFExpression::GetLocationExpression public
This method is used to get the DataExtractor when the expression is a location list.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D86090
Jonas Devlieghere [Thu, 20 Aug 2020 22:07:27 +0000 (15:07 -0700)]
[lldb] Extract FileSystem initialization code into helper (NFC)
The FileSystem initialization depends on the reproducer mode. It has
been growing organically to the point where it deserves its own helper
function. This also allows for early returns to simplify the code.
Fangrui Song [Thu, 20 Aug 2020 22:00:25 +0000 (15:00 -0700)]
[test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection
George Mitenkov [Thu, 20 Aug 2020 20:47:35 +0000 (23:47 +0300)]
[MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion
Removed the Standard to LLVM conversion patterns that were previously
pulled in for testing purposes. This helps to separate the conversion
to LLVM dialect of the MLIR module with both SPIR-V and Standard
dialects in it (particularly helpful for SPIR-V cpu runner). Also,
tests were changed accordingly.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D86285
Fangrui Song [Thu, 20 Aug 2020 21:11:08 +0000 (14:11 -0700)]
[llvm-dwarfdump] Fix a typo: witin -> within
Jonas Devlieghere [Thu, 20 Aug 2020 18:36:32 +0000 (11:36 -0700)]
[lldb] Provide GetHomeDirectory wrapper in Host::FileSystem (NFC)
Provider a wrapper around llvm::sys::path::home_directory in the
FileSystem class. This will make it possible for the reproducers to
intercept the call in a central place.
Jon Roelofs [Thu, 20 Aug 2020 20:56:57 +0000 (14:56 -0600)]
Fix a couple of typos. NFC
Simon Pilgrim [Thu, 20 Aug 2020 20:37:51 +0000 (21:37 +0100)]
[X86] Enable constexpr on POPCNT intrinsics (PR31446)
This is a first step patch to enable constexpr support and testing to a large number of x86 intrinsics.
All I've done here is provide a DEFAULT_FN_ATTRS_CONSTEXPR variant to our existing DEFAULT_FN_ATTRS tag approach that adds constexpr on c++ builds. The clang cuda headers do something similar.
I've started with POPCNT mainly as its tiny and are wrappers to generic __builtin_* intrinsics which already act as constexpr.
Differential Revision: https://reviews.llvm.org/D86229
Matt Arsenault [Sat, 8 Aug 2020 16:22:40 +0000 (12:22 -0400)]
CodeGen: Don't drop AA metadata when splitting MachineMemOperands
Assuming this is used to split a memory access into smaller pieces,
the new access should still have the same aliasing properties as the
original memory access. As far as I can tell, this wasn't
intentionally dropped. It may be necessary to drop this if you are
moving the operand outside of the bounds of the original object in
such a way that it may alias another IR object, but I don't think any
of the existing users are doing this. Some of the uses widen into
unused alignment padding, which I think is OK.
Matt Arsenault [Fri, 26 Jun 2020 23:02:46 +0000 (19:02 -0400)]
AMDGPU/GlobalISel: Legalize odd sized loads with widening
Custom lower and widen odd sized loads up to the alignment. The
default set of legalization actions doesn't have a way to represent
this. This fixes naturally aligned <3 x s8> and <3 x s16> loads.
This also starts moving towards eliminating the buggy and
overcomplicated legalization rules for narrowing. All the memory size
changes should be done in the lower or custom action, not NarrowScalar
/ FewerElements. These currently have redundant and ambiguous code
with the lower action.
vnalamot [Thu, 20 Aug 2020 14:18:11 +0000 (19:48 +0530)]
allSGPRSpillsAreDead() should use actual FP/BP frame indices
The SGPR spills happen in SILowerSGPRSpills() and allSGPRSpillsAreDead()
make sure there are no SGPR spills pending during PEI. But the FP/BP
spills happen during PEI and are exceptions.
Use actual frame indices of FP/BP in allSGPRSpillsAreDead() to
accommodate the exceptions.
Differential Revision: https://reviews.llvm.org/D86291
Kamau Bridgeman [Mon, 22 Jun 2020 16:43:03 +0000 (11:43 -0500)]
[PowerPC][PCRelative] Thread Local Storage Support for General Dynamic
This patch is the initial support for the General Dynamic Thread Local
Local Storage model to produce code sequence and relocations correct
to the ABI for the model when using PC relative memory operations.
Patch by: NeHuang
Reviewed By: stefanp
Differential Revision: https://reviews.llvm.org/D82315
Julian Lettner [Fri, 14 Aug 2020 00:26:56 +0000 (17:26 -0700)]
[TSan][Darwin] Remove unnecessary lit substitution
We don't test on very old versions of Apple platforms anymore. The
following lit substitution concerning the minimum deployment target for
ARC support can be removed.
```
%darwin_min_target_with_full_runtime_arc_support -> 10.11
```
Differential Revision: https://reviews.llvm.org/D85803
Cameron McInally [Thu, 20 Aug 2020 19:36:15 +0000 (14:36 -0500)]
[NFCI][SVE] Move fixed length i32/i64 SDIV tests
Move fixed length SDIV tests from sve-fixed-length-int-arith.ll to sve-fixed-length-int-div.ll. The former uses CHECK lines that verify legalization decisions. That's overkill for the i8/i16 SDIV tests, since they have a tricky legalization.
Julian Lettner [Fri, 14 Aug 2020 01:06:19 +0000 (18:06 -0700)]
[TSan][Darwin] Enable test on non-macOS platforms
After removing the unnecessary `-mmacosx-version-min=10.12` compiler
flag this test can run on all platforms. I confirmed that this test is
green for iOS, iOS simulator, and watchOS simulator.
Differential Revision: https://reviews.llvm.org/D85952
Fangrui Song [Mon, 17 Aug 2020 01:26:13 +0000 (18:26 -0700)]
[llvm-dwarfdump] --statistics: switch to json::OStream. NFC
Then it is trivial to make the output indented (the second parameter of
json::OStream::OStream specifies the indentation).
Reviewed By: jhenderson, echristo
Differential Revision: https://reviews.llvm.org/D86045
Raul Tambre [Thu, 20 Aug 2020 19:15:01 +0000 (22:15 +0300)]
Test commit
Gongyu Deng [Thu, 20 Aug 2020 17:10:34 +0000 (19:10 +0200)]
[lldb] tab completion for breakpoint names
1. created a common completion for breakpoint names;
2. bound the breakpoint name common completion with eArgTypeBreakpointName;
3. implemented the dedicated completion for breakpoint read -N.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D80693
Cameron McInally [Thu, 20 Aug 2020 18:28:46 +0000 (13:28 -0500)]
[SVE] Lower fixed length vXi8/vXi16 SDIV to scalable
There are no nxv16i8/nxv8i16 SDIV instructions, so these fixed width operations must be promoted to nxv4i32.
Differential Revision: https://reviews.llvm.org/D86114
LLVM GN Syncbot [Thu, 20 Aug 2020 18:24:44 +0000 (18:24 +0000)]
[gn build] Port
1a995a0af3c
Jessica Clarke [Thu, 20 Aug 2020 17:36:50 +0000 (18:36 +0100)]
[RISCV] Enable MCCodeEmitter instruction predicate verifier
This ensures that we never encode an instruction which is unavailable,
such as if we explicitly insert a forbidden instruction when lowering.
This is particularly important on RISC-V given its high degree of
modularity, and will become increasingly important as new standard
extensions appear.
Reviewed By: asb, lenary
Differential Revision: https://reviews.llvm.org/D85015
Roman Lebedev [Thu, 20 Aug 2020 16:16:48 +0000 (19:16 +0300)]
[NFC][InstCombine] Tests for PHI-of-insertvalue's
Currently we don't do anything about these,
neither in InstCombine, nor in SimplifyCFG's sinking.
These happen exceedingly rarely, but i've seen them in the cases where
PHI-aware aggregate reconstruction would have fired if not for them.
Jay Foad [Thu, 20 Aug 2020 16:46:16 +0000 (17:46 +0100)]
[AMDGPU] Remove uses of Register::isPhysicalRegister/isVirtualRegister
... in favour of the isPhysical/isVirtual methods.
Mircea Trofin [Wed, 19 Aug 2020 16:30:52 +0000 (09:30 -0700)]
[NFC] Expose the -Oz module optimization pipeline to opt
This exposes the module optimization pipeline as a pass that can be
applied stand-alone when using 'opt'. This helps ml inliner training
scenarios, where we start with IR captured right before inlining,
perform the inlining (-scc-oz-module-inliner) and then want to continue
and observe the final IR (where this patch comes into play). We can then
apply llc on the resulting IR to continue compilation down to native.
Differential Revision: https://reviews.llvm.org/D86224
Jordan Rupprecht [Thu, 20 Aug 2020 16:15:37 +0000 (09:15 -0700)]
[lldb][asan] Mark destructor as virtual to allow subclasses.
`lldb_private::ScriptInterpreterPython::CommandDataPython` inherits from `lldb_private::BreakpointOptions::CommandData`, but the latter does not have a virtual destructor. This leads to a new-delete-type-mismatch error when running certain tests (such as `functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py`) under asan.
Siva Chandra Reddy [Wed, 19 Aug 2020 08:08:03 +0000 (01:08 -0700)]
[libc] Add a class called NormalFloat which represents normalized floats.
This class helps in dealing with normal and subnormal numbers uniformly.
Moreover, since this class has been designed to handle all floating
formats across platforms, it helps implement floating point functions in
a uniform manner.
The implementations of frexp and logb have been switched to use this new
class as it allows us to use just one implementation across all
different floating point formats.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D86241
Jay Foad [Thu, 20 Aug 2020 15:47:30 +0000 (16:47 +0100)]
[PeepholeOptimizer] Remove dead code
At this point we have already ruled out all def operands, so we can't
possibly see a dead implicit def operand.