Nathan James [Tue, 26 Jan 2021 18:59:29 +0000 (18:59 +0000)]
[clangd] FindTarget resolves base specifier
FindTarget on the virtual keyword or access specifier of a base specifier will now resolve to type of the base specifier.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D95338
Nathan James [Tue, 26 Jan 2021 18:58:53 +0000 (18:58 +0000)]
[clangd] Selection handles CXXBaseSpecifier
Selection now includes the virtual and access modifier as part of their range for cxx base specifiers.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D95231
Adhemerval Zanella [Tue, 26 Jan 2021 18:20:26 +0000 (15:20 -0300)]
[ARM] [ELF] Fix ARMMaterializeGV for Indirect calls
Recent shouldAssumeDSOLocal changes (introduced by
961f31d8ad14c66)
do not take in consideration the relocation model anymore. The ARM
fast-isel pass uses the function return to set whether a global symbol
is loaded indirectly or not, and without the expected information
llvm now generates an extra load for following code:
```
$ cat test.ll
@__asan_option_detect_stack_use_after_return = external global i32
define dso_local i32 @main(i32 %argc, i8** %argv) #0 {
entry:
%0 = load i32, i32* @__asan_option_detect_stack_use_after_return,
align 4
%1 = icmp ne i32 %0, 0
br i1 %1, label %2, label %3
2:
ret i32 0
3:
ret i32 1
}
attributes #0 = { noinline optnone }
$ lcc test.ll -o -
[...]
main:
.fnstart
[...]
movw r0, :lower16:__asan_option_detect_stack_use_after_return
movt r0, :upper16:__asan_option_detect_stack_use_after_return
ldr r0, [r0]
ldr r0, [r0]
cmp r0, #0
[...]
```
And without 'optnone' it produces:
```
[...]
main:
.fnstart
[...]
movw r0, :lower16:__asan_option_detect_stack_use_after_return
movt r0, :upper16:__asan_option_detect_stack_use_after_return
ldr r0, [r0]
clz r0, r0
lsr r0, r0, #5
bx lr
[...]
```
This triggered a lot of invalid memory access in sanitizers for
arm-linux-gnueabihf. I checked this patch both a stage1 built with
gcc and a stage2 bootstrap and it fixes all the Linux sanitizers
issues.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D95379
Craig Topper [Tue, 26 Jan 2021 18:47:49 +0000 (10:47 -0800)]
[RISCV] Have customLegalizeToWOp truncate to the original type instead of i32 now that we use it for i8/i16 as well.
239cfbccb0509da1a08d9e746706013b732e646b add support for legalizing
i8/i16 UDIV/UREM/SDIV to use *W instructions. So we need to truncate
to i8/i16 if we're legalizing one of those.
Eric Schweitz [Tue, 26 Jan 2021 18:18:44 +0000 (10:18 -0800)]
[mlir] sret and byval now require a type argument when constructed.
Fixes the LLVM code gen bugs and adds the missing tests.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D95378
Julian Lettner [Fri, 15 Jan 2021 01:04:39 +0000 (17:04 -0800)]
Reland "[lit] Use os.cpu_count() to cleanup TODO"
The initial problem with the remaining bot config was resolved.
We can now use Python3. Let's use `os.cpu_count()` to cleanup this
helper.
Differential Revision: https://reviews.llvm.org/D94734
Raphael Isemann [Tue, 26 Jan 2021 17:13:45 +0000 (18:13 +0100)]
[lldb][NFC] Another attempt to fix GCC 5.x compilation
37510f69b4cb8d76064f108d57bebe95984a23ae tried to fix GCC 5.x compilation
by making the enum which is used as a unordered_map key unscoped. However it
seems that in GCC 5.x, enum keys are not supported *at all* in unordered_maps
(at least that's what some trial&error on godbolt tells me). This updates the
workaround to just use an int until GCC 5.x support is dropped.
Christian Sigg [Tue, 26 Jan 2021 13:24:43 +0000 (14:24 +0100)]
[mlir] Set CUDA/ROCm context before creating resources.
The current context is thread-local state, and in preparation of GPU async execution (on multiple threads) we need to set the context before calling API that create resources.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D94495
Matt Arsenault [Mon, 21 Sep 2020 12:43:06 +0000 (08:43 -0400)]
AMDGPU: Fix redundant FP spilling/assert in some functions
If a function has stack objects, and a call, we require an FP. If we
did not initially have any stack objects, and only introduced them
during PrologEpilogInserter for CSR VGPR spills, SILowerSGPRSpills
would end up spilling the FP register as if it were a normal
register. This would result in an assert in a debug build, or
redundant handling of the FP register in a release build.
Try to predict that we will have an FP later, although this is ugly.
Matt Arsenault [Thu, 21 Jan 2021 18:19:50 +0000 (13:19 -0500)]
AMDGPU: Add assertion to determineCalleeSaves
Make sure this isn't getting called multiple times. I was surprised we
were modifying the function here, which I think is a bit questionable.
Shilei Tian [Tue, 26 Jan 2021 17:28:15 +0000 (12:28 -0500)]
[OpenMP][deviceRTLs] Build the deviceRTLs with OpenMP instead of target dependent language
From this patch (plus some landed patches), `deviceRTLs` is taken as a regular OpenMP program with just `declare target` regions. In this way, ideally, `deviceRTLs` can be written in OpenMP directly. No CUDA, no HIP anymore. (Well, AMD is still working on getting it work. For now AMDGCN still uses original way to compile) However, some target specific functions are still required, but they're no longer written in target specific language. For example, CUDA parts have all refined by replacing CUDA intrinsic and builtins with LLVM/Clang/NVVM intrinsics.
Here're a list of changes in this patch.
1. For NVPTX, `DEVICE` is defined empty in order to make the common parts still work with AMDGCN. Later once AMDGCN is also available, we will completely remove `DEVICE` or probably some other macros.
2. Shared variable is implemented with OpenMP allocator, which is defined in `allocator.h`. Again, this feature is not available on AMDGCN, so two macros are redefined properly.
3. CUDA header `cuda.h` is dropped in the source code. In order to deal with code difference in various CUDA versions, we build one bitcode library for each supported CUDA version. For each CUDA version, the highest PTX version it supports will be used, just as what we currently use for CUDA compilation.
4. Correspondingly, compiler driver is also updated to support CUDA version encoded in the name of bitcode library. Now the bitcode library for NVPTX is named as `libomptarget-nvptx-cuda_[cuda_version]-sm_[sm_number].bc`, such as `libomptarget-nvptx-cuda_80-sm_20.bc`.
With this change, there are also multiple features to be expected in the near future:
1. CUDA will be completely dropped when compiling OpenMP. By the time, we also build bitcode libraries for all supported SM, multiplied by all supported CUDA version.
2. Atomic operations used in `deviceRTLs` can be replaced by `omp atomic` if OpenMP 5.1 feature is fully supported. For now, the IR generated is totally wrong.
3. Target specific parts will be wrapped into `declare variant` with `isa` selector if it can work properly. No target specific macro is needed anymore.
4. (Maybe more...)
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D94745
Dave Lee [Tue, 26 Jan 2021 00:52:32 +0000 (16:52 -0800)]
[lldb] Remove unused ThreadPlanStack::GetStackOfKind (NFC)
This function isn't used.
Differential Revision: https://reviews.llvm.org/D95411
Kadir Cetinkaya [Tue, 26 Jan 2021 06:39:43 +0000 (07:39 +0100)]
[clangd] Add std::size_t to StdSymbol mapping
This is a common symbol that's missing from our mapping because
cppreference yields multiple headers.
Add it manually by picking cstddef to prevent insertion of some stdlib-internal
headers instead.
Fixes https://github.com/clangd/clangd/issues/666.
Differential Revision: https://reviews.llvm.org/D95423
Alex Zinenko [Mon, 25 Jan 2021 17:17:19 +0000 (18:17 +0100)]
[mlir] Add Python bindings for IntegerSet
This follows up on the introduction of C API for the same object and is similar
to AffineExpr and AffineMap.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D95437
Sanjay Patel [Tue, 26 Jan 2021 15:43:38 +0000 (10:43 -0500)]
[LoopVectorize] add test for fmin/fmax FMF propagation; NFC
The existing test has less FMF than we might expect if
our FMF was fixed (on all FP values), so this additional
test is intended to check propagation in a more "normal"
example.
Sanjay Patel [Tue, 26 Jan 2021 15:25:36 +0000 (10:25 -0500)]
[LoopUtils] do not initialize Cmp predicate unnecessarily; NFC
The switch must set the predicate correctly; anything else
should lead to unreachable/assert.
I'm trying to fix FMF propagation here and the callers,
so this is a preliminary cleanup.
Simon Pilgrim [Tue, 26 Jan 2021 16:19:18 +0000 (16:19 +0000)]
Fix null dereference static analysis warning. NFCI.
Replace cast_or_null<> with cast<> as we immediately dereference the pointer afterward so we're not expecting a null pointer.
Simon Pilgrim [Tue, 26 Jan 2021 16:09:27 +0000 (16:09 +0000)]
[AMDGPU] HSAMD::fromString - replace std::string arg with StringRef. NFCI.
Removes an unnecessary chain of StringRef -> std::string -> StringRef conversions
Mircea Trofin [Tue, 26 Jan 2021 04:44:41 +0000 (20:44 -0800)]
[NFC] Disallow unused prefixes under clang/test/CodeGen
Differential Revision: https://reviews.llvm.org/D95417
Alexander Belyaev [Tue, 26 Jan 2021 15:59:19 +0000 (16:59 +0100)]
[mlir][nfc] Move `getInnermostParallelLoops` to SCF/Transforms/Utils.h.
Simon Pilgrim [Tue, 26 Jan 2021 15:51:49 +0000 (15:51 +0000)]
[Sema] diagnoseEquivalentInternalLinkageDeclarations - assert for non-null NamedDecl. NFCI.
Fixes clang static analysis warnings.
Simon Pilgrim [Tue, 26 Jan 2021 15:33:31 +0000 (15:33 +0000)]
[AMDGPU] Fix null-dereference static analysis warnings. NFCI.
Avoid repeated calls to isZeroValue() and check for a null pointer before dereferencing a dyn_cast<>.
George Rokos [Tue, 26 Jan 2021 15:37:21 +0000 (07:37 -0800)]
[libomptarget][NFC] Fixed obsolete function names in comments
Matt Arsenault [Mon, 18 Jan 2021 15:49:48 +0000 (10:49 -0500)]
AMDGPU: Clear IsSSA property in SIFormMemoryClauses
Fixes verifier error when writing MIR testcases
Florian Hahn [Fri, 22 Jan 2021 22:49:45 +0000 (22:49 +0000)]
[LoopUnswitch] Avoid partially unswitching too aggressively.
This patch adds additional checks to avoid partial unswitching
in cases where it won't be profitable, e.g. because the path directly
exits the loop anyways.
Florian Hahn [Fri, 22 Jan 2021 22:47:43 +0000 (22:47 +0000)]
[LoopUnswitch] Add some additional tests.
Add a few additional tests where partial unswitching is not really
profitable and should be avoided.
Simon Pilgrim [Tue, 26 Jan 2021 14:57:37 +0000 (14:57 +0000)]
Fix signed/unsigned comparison warning. NFCI.
Sander de Smalen [Tue, 26 Jan 2021 14:03:55 +0000 (14:03 +0000)]
[CostModel] Handle CTLZ and CCTZ in getTypeBasedIntrinsicInstrCost
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D95355
Sebastian Neubauer [Tue, 26 Jan 2021 11:44:02 +0000 (12:44 +0100)]
[AMDGPU] Add IntrWillReturn to three intrinsics
None of these can terminate a wave or lane.
With these, all intrinsic are IntrWillReturn except those that change
exec or can terminate the wave.
Not marking intrinsics as WillReturn may prevent optimizations in the
future: https://lists.llvm.org/pipermail/llvm-dev/2021-January/148047.html
Differential Revision: https://reviews.llvm.org/D95436
Mirko Brkusanin [Tue, 26 Jan 2021 14:21:11 +0000 (15:21 +0100)]
[AMDGPU] Fix use of HasModifiers in VopProfile
HasModifiers should be true if at least one modifier is used.
This should make the use of this field bit more consistent.
Differential Revision: https://reviews.llvm.org/D94795
Florian Hahn [Tue, 26 Jan 2021 13:43:39 +0000 (13:43 +0000)]
[Passes] Run peeling as part of simple/full loop unrolling.
Loop peeling removes conditions from loop bodies that become invariant
after a small number of iterations. When triggered, this leads to fewer
compares and possibly PHIs in loop bodies, enabling further
optimizations. The current cost-model of loop peeling should be quite
conservative/safe, i.e. only peel if a condition in the loop becomes
known after peeling.
For example, see PR47671, where loop peeling enables vectorization by
removing a PHI the vectorizer does not understand. Granted, the
loop-vectorizer could also be taught about constant PHIs, but loop
peeling is likely to enable other optimizations as well.
This has an impact on quite a few benchmarks from
MultiSource/SPEC2000/SPEC2006 on X86 with -O3 -flto, for example
Same hash: 186 (filtered out)
Remaining: 51
Metric: loop-vectorize.LoopsVectorized
Program base patch diff
test-suite...ve-susan/automotive-susan.test 8.00 9.00 12.5%
test-suite...nal/skidmarks10/skidmarks.test 35.00 31.00 -11.4%
test-suite...lications/sqlite3/sqlite3.test 41.00 43.00 4.9%
test-suite...s/ASC_Sequoia/AMGmk/AMGmk.test 25.00 26.00 4.0%
test-suite...006/450.soplex/450.soplex.test 88.00 89.00 1.1%
test-suite...TimberWolfMC/timberwolfmc.test 120.00 119.00 -0.8%
test-suite.../CINT2006/403.gcc/403.gcc.test 215.00 216.00 0.5%
test-suite...006/447.dealII/447.dealII.test 957.00 958.00 0.1%
test-suite...ternal/HMMER/hmmcalibrate.test 75.00 75.00 0.0%
Same hash: 186 (filtered out)
Remaining: 51
Metric: loop-vectorize.LoopsAnalyzed
Program base patch diff
test-suite...ks/Prolangs-C/agrep/agrep.test 440.00 434.00 -1.4%
test-suite...nal/skidmarks10/skidmarks.test 312.00 308.00 -1.3%
test-suite...marks/7zip/7zip-benchmark.test 6399.00 6323.00 -1.2%
test-suite...lications/minisat/minisat.test 134.00 135.00 0.7%
test-suite...rks/FreeBench/pifft/pifft.test 295.00 297.00 0.7%
test-suite...TimberWolfMC/timberwolfmc.test 1879.00 1869.00 -0.5%
test-suite...pplications/treecc/treecc.test 689.00 691.00 0.3%
test-suite...T2000/300.twolf/300.twolf.test 1593.00 1597.00 0.3%
test-suite.../Benchmarks/Bullet/bullet.test 1394.00 1392.00 -0.1%
test-suite...ications/JM/ldecod/ldecod.test 1431.00 1429.00 -0.1%
test-suite...6/464.h264ref/464.h264ref.test 2229.00 2230.00 0.0%
test-suite...lications/sqlite3/sqlite3.test 2590.00 2589.00 -0.0%
test-suite...ications/JM/lencod/lencod.test 2732.00 2733.00 0.0%
test-suite...006/453.povray/453.povray.test 3395.00 3394.00 -0.0%
Note the -11% regression in number of loops vectorized for skidmarks. I
suspect this corresponds to the fact that those loops are gone now (see
the reduction in number of loops analyzed by LV).
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D88471
Lang Hames [Tue, 26 Jan 2021 12:56:01 +0000 (23:56 +1100)]
[ORC] Attempt to auto-claim responsibility for weak defs in ObjectLinkingLayer.
Compilers may insert new definitions during compilation, E.g. EH personality
function pointers, or named constant pool entries. This commit causes
ObjectLinkingLayer to attempt to claim responsibility for all weak definitions
in objects as they're linked. This is always safe (first claimant for each
symbol is granted responsibility, subsequent claims are rejected without error)
and prevents compiler-injected symbols from being dead-stripped (which they
will be if they remain unclaimed by anyone).
This change was motivated by errors seen by an out-of-tree client while testing
eh-frame support in JITLink ELF/x86-64: IR containing exceptions didn't define
DW.ref.__gxx_personality_v0 (since it's added by CodeGen), and this caused
DW.ref.__gxx_personality_v0 to be dead-stripped leading to linker failures.
No test case yet: We won't have a way to test in-tree until we enable JITLink
for lli on Linux.
Andrzej Warzynski [Tue, 26 Jan 2021 12:54:12 +0000 (12:54 +0000)]
Revert "[flang] Search for #include "file" in right directory"
This reverts commit
d987b61b1dce9948801ac37704477e7c257100b1.
As pointed out in https://reviews.llvm.org/D95388, the reverted commit
causes build failures in the following Flang buildbots:
* http://lab.llvm.org:8011/#/builders/32/builds/2642
* http://lab.llvm.org:8011/#/builders/33/builds/2131
* http://lab.llvm.org:8011/#/builders/135/builds/1473
* http://lab.llvm.org:8011/#/builders/66/builds/1559
* http://lab.llvm.org:8011/#/builders/134/builds/1409
* http://lab.llvm.org:8011/#/builders/132/builds/1817
I'm guessing that the patch was only tested with
`FLANG_BUILD_NEW_DRIVER=Off` (i.e. the default). The builders listed
above set `FLANG_BUILD_NEW_DRIVER` to `On`.
Although fixing the build is relatively easy, the reverted patch
modifies the behaviour of the frontend, which breaks driver tests. In
particular, in https://reviews.llvm.org/D93453 support for `-I` was
added that depends on the current behaviour. The reverted patch
changes that behaviour. Either the tests have to be updated or the
change fine-tuned.
Zarko Todorovski [Tue, 26 Jan 2021 12:43:22 +0000 (07:43 -0500)]
Remove requirement for -maltivec to be used when using -mabi=vec-extabi or -mabi=vec-default when not using vector code
The previous implementation required that `-maltivec` be specified when using either `-mabi=vec-extabi` or `-mabi=vec-default`, this patch removes that requirement.
Reviewed By: cebowleratibm
Differential Revision: https://reviews.llvm.org/D94986
Lang Hames [Tue, 26 Jan 2021 12:52:44 +0000 (23:52 +1100)]
[ORC] Fix debug logging message.
Lang Hames [Tue, 26 Jan 2021 12:46:33 +0000 (23:46 +1100)]
[JITLink][ELF/x86-64] When building PLT stub, use -4 offset for PCRel32.
This is required for ELF where PCRel32 doesn't implicitly subtract 4.
No test case yet: I haven't figured out a good way to test stub
generation -- this may required extensions to jitlink-check.
Alexey Bataev [Tue, 26 Jan 2021 12:43:31 +0000 (07:43 -0500)]
[LIBOMPTARGET]FIX define declaration, NFC
Fixed declaration of define by adding a comma symbol. Required to fix build without profiling.
Alex Zinenko [Tue, 26 Jan 2021 12:30:45 +0000 (13:30 +0100)]
[mlir] drop unused statics
Adhemerval Zanella [Wed, 13 Jan 2021 17:29:16 +0000 (17:29 +0000)]
[LLD][ELF][AArch64] Add support for R_AARCH64_LD64_GOTPAGE_LO15 relocation
It is not used by LLVM, but GCC might generates it when compiling
with -fpie, as indicated by PR#40357 [1].
[1] https://bugs.llvm.org/show_bug.cgi?id=40357
Dmitry Preobrazhensky [Tue, 26 Jan 2021 11:52:24 +0000 (14:52 +0300)]
[AMDGPU][MC] Refactored exp tgt handling
Summary:
- Separated tgt encoding from parsing;
- Separated tgt decoding from printing;
- Improved errors handling;
- Disabled leading zeroes in index. The following code is no longer accepted: exp pos00 v3, v2, v1, v0
Reviewers: arsenm, rampitec, foad
Differential Revision: https://reviews.llvm.org/D95216
Eugene Zhulenev [Tue, 26 Jan 2021 10:40:43 +0000 (02:40 -0800)]
[mlir] Async: add a separate pass to lower from async to async.coro and async.runtime
Depends On D95000
Move async.execute outlining and async -> async.runtime lowering into the separate Async transformation pass
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D95311
David Sherwood [Tue, 26 Jan 2021 10:59:36 +0000 (10:59 +0000)]
[SVE] Fix some logical arithmetic tests
There were some right-shift tests in
CodeGen/AArch64/sve-int-arith-imm.ll
that were being folded away because we were shifting all the bits
out to the right. I've updated the tests to ensure this doesn't
happen.
Marek Kurdej [Tue, 26 Jan 2021 10:58:56 +0000 (11:58 +0100)]
Revert "[clang-format] add case aware include sorting"
This reverts commit
3395a336b02538d0bb768ccfae11c9b6151b102e as there was a post-merge doubt about option naming and type.
Eugene Zhulenev [Mon, 25 Jan 2021 22:14:12 +0000 (14:14 -0800)]
[mlir:async] Use ODS to define async types
Depends On D94923
Migrate Async dialect to ODS `TypeDef`
Reviewed By: ftynse, rriddle
Differential Revision: https://reviews.llvm.org/D95000
Georgii Rymar [Mon, 25 Jan 2021 14:15:31 +0000 (17:15 +0300)]
[yaml2obj][obj2yaml] - Improve how we set/dump the sh_entsize field.
We already set the `sh_entsize` field in a single place
for all non-implicit sections.
This patch reorders the logic slightly and with it
we finally have the only one place where the `sh_entsize` is set.
obj2yaml will not dump the `EntSize` key for `SHT_DYNSYM/SHT_SYMTAB` sections anymore,
when the value of `sh_entsize` is equal to `sizeof(Elf_Sym)`
Note that this also seems revealed an issue in llvm-objcopy:
Previously yaml2obj set the `sh_entsize` for the `.symtab` section to 0x18,
now we it sets it for `SHT_SYMTAB` sections, i.e. by type.
But the `llvm-objcopy/ELF/only-keep-debug.test` has a `.symtab` section of type `SHT_STRTAB`,
and now yaml2obj sets the `sh_entsize` to 0 for it.
I had to update the corresponding check lines for `ES`, but the behavior of
`llvm-objcopy` should be fixed instead I think.
I've added a TODO and a comment.
Differential revision: https://reviews.llvm.org/D95364
Martin Storsjö [Tue, 26 Jan 2021 10:29:14 +0000 (12:29 +0200)]
[llvm-nm] Silence a gcc warning about a stray semicolon. NFC.
Ben Shi [Tue, 26 Jan 2021 09:50:56 +0000 (17:50 +0800)]
[update_llc_test_checks] Support AVR
Reviewed By: arichardson
Differential Revision: https://reviews.llvm.org/D95240
Georgii Rymar [Tue, 26 Jan 2021 09:42:24 +0000 (12:42 +0300)]
[LLDB][test] - Fix test after yaml2obj change.
D95354 started to set the sh_link field for SHT_SYMTAB sections.
Previously it was set for symbol tables basing on their names (e.g. ".symtab").
This test now crashes see:
http://lab.llvm.org:8011/#/builders/68/builds/5911
I updated it to restore the old behavior.
Jan Svoboda [Tue, 26 Jan 2021 08:35:32 +0000 (09:35 +0100)]
[clang][cli] Port GPU-related language options to marshalling system
Port some GPU-related language options to the marshalling system for automatic command line parsing and generation.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95345
Georgii Rymar [Mon, 25 Jan 2021 13:26:21 +0000 (16:26 +0300)]
[yaml2obj] - Refine how we set the sh_link field. NFCI.
This refactors the logic that sets the `sh_link` field.
With this patch we set it in a single place for all sections.
Differential revision: https://reviews.llvm.org/D95354
Georgii Rymar [Mon, 18 Jan 2021 13:13:45 +0000 (16:13 +0300)]
[llvm-nm][ELF] - Use @@ prefix when printing default versions.
llvm-readelf prints default versions with `@@` prefix.
This patch does the same for llvm-nm.
Differential revision: https://reviews.llvm.org/D94912
Haojian Wu [Mon, 25 Jan 2021 15:26:17 +0000 (16:26 +0100)]
[clangd] Add include-fixer fixit for no_member_template diagnostic.
Differential Revision: https://reviews.llvm.org/D95365
Georgii Rymar [Fri, 22 Jan 2021 09:26:42 +0000 (12:26 +0300)]
[libObject,llvm-readelf/obj] - Don't use @@ when printing versions of undefined symbols.
A default version (@@) is only available for defined symbols.
Currently we use "@@" for undefined symbols too.
This patch fixes the issue and improves our test case.
Differential revision: https://reviews.llvm.org/D95219
Craig Topper [Tue, 26 Jan 2021 08:43:42 +0000 (00:43 -0800)]
[RISCV] Adjust RISCVInstrInfoVSDPatterns.td for different pseudo instructions for different FPR.
Move the Suffix string into the VTypeInfo class so we don't need a helper class to get to it.
Adjust pseudo naming scheme for FPRs to put F16/F32/F64 in
place of F in the pseudo instruction name rather than as a suffix.
This avoids special cases like VFMERGE from the original patch.
Differential Revision: https://reviews.llvm.org/D95404
Freddy Ye [Tue, 26 Jan 2021 08:40:04 +0000 (16:40 +0800)]
[NFC] Refine some uninitialized used variables.
These warning are reported by static code analysis tool: Klocwork
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D95421
Kadir Cetinkaya [Tue, 26 Jan 2021 06:08:53 +0000 (07:08 +0100)]
[clangd] Fix filename completion at the end of file
Fixes https://github.com/clangd/clangd/issues/433
Differential Revision: https://reviews.llvm.org/D95419
Jan Svoboda [Tue, 26 Jan 2021 08:21:55 +0000 (09:21 +0100)]
[clang][cli] Accept strings instead of options in ImpliedByAnyOf
To be able to refer to constant keypaths (e.g. `defvar cplusplus = LangOpts<"CPlusPlus">`) inside `ImpliedByAnyOf`, let's accept strings instead of `Option` instances.
This somewhat weakens the guarantees that we're referring to an existing (option) record, but we can still use the option.KeyPath syntax to simulate this.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95344
Jan Svoboda [Tue, 26 Jan 2021 08:08:08 +0000 (09:08 +0100)]
[clang][cli] Port GNU language options to marshalling system
Port some GNU-related language options to the marshalling system for automatic command line parsing and generation.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95343
Jan Svoboda [Tue, 26 Jan 2021 07:52:31 +0000 (08:52 +0100)]
[clang][cli] Store LangStandard::Kind in LangOptions
The `LangStandard::Kind` parsed from command line arguments is used to set up some `LangOption` defaults, but isn't stored anywhere.
To be able to generate `-std=` (in future patch), we need `CompilerInvocation` to not forget it.
This patch demonstrates another use-case: using `LangStd` to set up defaults of marshalled options.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95342
Hsiangkai Wang [Fri, 22 Jan 2021 14:38:11 +0000 (22:38 +0800)]
[RISCV] Define different pseudo instructions for different FPR.
When spilling, the spill size will depend on the size of register class.
For .vf vector instructions, it may spill the floating point scalar
argument. In order to use the correct load/store instructions for
spilling, we need to provide the correct floating point register class
for the .vf vector pseudo instructions.
In this commit, we define the .vf pseudo instructions as three
different kinds of pseudo instructions for half/float/double. For
example, PseudoVFADD_M1 will become as PseudoVFADD_F16_M1,
PseudoVFADD_F32_M1, and PseudoVFADD_F64_M1.
Differential Revision: https://reviews.llvm.org/D95234
Jan Svoboda [Tue, 26 Jan 2021 07:27:40 +0000 (08:27 +0100)]
[clang][cli] NFC: Simplify BoolOption API
The `Bool{,F,G}Option` TableGen classes were designed after `Opt{In,Out}FFlag`, which put marshalling info on only one of the boolean options. To encode which record is supposed to carry the marshalling info (and be visible on -cc1 command-line), we used the `ChangedBy` and `ResetBy` classes.
However, we need to put marshalling info on both records anyways (see D93008 for details). This means we don't really need the distinction between `ChangedBy/ResetBy + BoolOption` and `FlagDef + BoolOptionBase` anymore.
This patch reduces the number of ways one can encode the marshalling information for pairs of boolean flags. Regardless of whether the key path value defaults to a statically known boolean, or a result of an expression, one can always use the new `BoolOption` and `PosFlag<SetTrue>, NegFlag<SetFalse>` syntax.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95340
Matthias Springer [Tue, 26 Jan 2021 07:31:20 +0000 (07:31 +0000)]
Add vp2intersect to AVX512 dialect.
Adds vp2intersect to the AVX512 dialect and defines a lowering to the
LLVM dialect.
Author: Matthias Springer <springerm@google.com>
Differential Revision: https://reviews.llvm.org/D95301
Sam Clegg [Tue, 26 Jan 2021 06:09:45 +0000 (22:09 -0800)]
Revert "[WebAssembly] MC layer writes table symbols to object files"
This reverts commit
d806618636f8a82bfc3f620e1fad83af4d2a2575.
Review: https://reviews.llvm.org/D92215
We had issues where older versions of wasm-ld were crashing on object
files containing a table symbol. We decided that the best strategy
going forward is to only generate these symbol if refernece types is
enabled. Without reference types enabled we should never geneate a
table symbol or a TABLE_NUMBER relocation.
This revert is in addition to the one already reverted in
https://reviews.llvm.org/D95005.
The plan is to re-land these in updated form after the llvm 12 branch.
Differential Revision: https://reviews.llvm.org/D95420
Sam Clegg [Fri, 22 Jan 2021 15:46:28 +0000 (07:46 -0800)]
[Object][WebAssembly] Update format of error messages
Error message should start with lowercase in accordance with
https://llvm.org/docs/CodingStandards.html#error-and-warning-messages
Differential Revision: https://reviews.llvm.org/D95239
zhanghb97 [Tue, 26 Jan 2021 02:40:21 +0000 (10:40 +0800)]
[mlir][Python] Fix comments of 'getCapsule' and 'createFromCapsule'
The `getCapsule` and `createFromCapsule` comments incorrectly state the `PyMlirContext` and `MlirContext` in `PyLocation`, `PyAttribute`, and `PyType` classes.
Differential Revision: https://reviews.llvm.org/D95413
Johannes Doerfert [Sat, 23 Jan 2021 01:04:44 +0000 (19:04 -0600)]
[OpenMP] Add source location information to the libomptarget profile
In much of the libomptarget interface we have an ident_t object now, if
it is not null we can use it to improve the profile output. For now, we
simply use the ident_t "source information string" as generated by the
FE.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D95282
Johannes Doerfert [Fri, 8 Jan 2021 16:30:28 +0000 (10:30 -0600)]
[OpenMP][FIX] Enforce a function boundary for a new data environment
Whenever we enter a new OpenMP data environment we want to enter a
function to simplify reasoning. Later we probably want to remove the
entire specialization wrt. the if clause and pass the result to the
runtime, for now this should fix PR48686.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D94315
Hsiangkai Wang [Wed, 13 Jan 2021 06:38:30 +0000 (14:38 +0800)]
[RISCV] Update V extension to v1.0-draft
08a0b464.
Differential Revision: https://reviews.llvm.org/D94583
Hsiangkai Wang [Sun, 24 Jan 2021 05:37:38 +0000 (13:37 +0800)]
[RISCV] Implement vlsegff intrinsics.
Differential Revision: https://reviews.llvm.org/D95303
Kazu Hirata [Tue, 26 Jan 2021 03:24:01 +0000 (19:24 -0800)]
[AMDGPU] Forward-declare MachineIRBuilder (NFC)
AMDGPULegalizerInfo.h needs MachineIRBuilder but relies on a forward
declaration of MachineIRBuilder in LegalizerInfo.h. This patch adds a
forward declaration right in AMDGPULegalizerInfo.h.
While we are at it, this patch removes the one in LegalizerInfo.h,
where it is unnecessary.
Kazu Hirata [Tue, 26 Jan 2021 03:23:59 +0000 (19:23 -0800)]
[StackSafety] Use ListSeparator (NFC)
Kazu Hirata [Tue, 26 Jan 2021 03:23:57 +0000 (19:23 -0800)]
[TableGen] Use llvm::append_range (NFC)
Shilei Tian [Tue, 26 Jan 2021 03:14:52 +0000 (22:14 -0500)]
[OpenMP] Added the support for hidden helper task in RTL
The basic design is to create an outer-most parallel team. It is not a regular team because it is only created when the first hidden helper task is encountered, and is only responsible for the execution of hidden helper tasks. We first use `pthread_create` to create a new thread, let's call it the initial and also the main thread of the hidden helper team. This initial thread then initializes a new root, just like what RTL does in initialization. After that, it directly calls `__kmpc_fork_call`. It is like the initial thread encounters a parallel region. The wrapped function for this team is, for main thread, which is the initial thread that we create via `pthread_create` on Linux, waits on a condition variable. The condition variable can only be signaled when RTL is being destroyed. For other work threads, they just do nothing. The reason that main thread needs to wait there is, in current implementation, once the main thread finishes the wrapped function of this team, it starts to free the team which is not what we want.
Two environment variables, `LIBOMP_NUM_HIDDEN_HELPER_THREADS` and `LIBOMP_USE_HIDDEN_HELPER_TASK`, are also set to configure the number of threads and enable/disable this feature. By default, the number of hidden helper threads is 8.
Here are some open issues to be discussed:
1. The main thread goes to sleeping when the initialization is finished. As Andrey mentioned, we might need it to be awaken from time to time to do some stuffs. What kind of update/check should be put here?
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D77609
Jon Chesterfield [Tue, 26 Jan 2021 03:14:53 +0000 (03:14 +0000)]
Revert "[libomptarget][cuda] Gracefully handle missing cuda library"
This reverts commit
fafd45c01f3a49a40b09a31e9ea82efc87f3ab35.
Cassie Jones [Tue, 26 Jan 2021 03:04:42 +0000 (22:04 -0500)]
[Test][AArch64] Add s32 legalizer test for UADDE/USUBE
Differential Revision: https://reviews.llvm.org/D95324
Cassie Jones [Tue, 26 Jan 2021 03:02:31 +0000 (22:02 -0500)]
[Test][AArch64] Move overflow add/sub tests to their own file. NFC
Differential Revision: https://reviews.llvm.org/D95323
Lang Hames [Tue, 26 Jan 2021 02:56:29 +0000 (13:56 +1100)]
[JITLink] Disable ELF_ehframe_basic.s test on Windows.
This test is failing on some windows bots with an error claiming that it is not
producing output. This appears to be a spurious failure, so I'm disabling on
windows while we investigate rather than reverting.
Nemanja Ivanovic [Tue, 26 Jan 2021 02:55:42 +0000 (20:55 -0600)]
[PowerPC] Do not emit HW loop with half precision operations
If a loop has any operations on half precision values, there will be calls to
library functions on Power8. Even on Power9, there is a small subset of
instructions that are actually supported for the type.
This patch disables HW loops whenever any operations on the type are found
(other than the handfull of supported ones when compiling for Power9). Fixes a
few PR's opened by Julia:
https://bugs.llvm.org/show_bug.cgi?id=48785
https://bugs.llvm.org/show_bug.cgi?id=48786
https://bugs.llvm.org/show_bug.cgi?id=48519
Differential revision: https://reviews.llvm.org/D94980
Jon Chesterfield [Tue, 26 Jan 2021 02:54:00 +0000 (02:54 +0000)]
[libomptarget][cuda] Gracefully handle missing cuda library
[libomptarget][cuda] Gracefully handle missing cuda library
If using dynamic cuda, and it failed to load, it is not safe to call
cuGetErrorString.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D95412
Wolfgang Pieb [Tue, 26 Jan 2021 02:48:09 +0000 (18:48 -0800)]
[X86] Correct some cross references in avxintrin.h.
Sergey Dmitriev [Tue, 26 Jan 2021 02:07:23 +0000 (18:07 -0800)]
[llvm-link] Fix crash when materializing appending global
This patch fixes llvm-link crash when materializing global variable
with appending linkage and initializer that depends on another
global with appending linkage.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D95329
Richard Smith [Tue, 26 Jan 2021 02:02:39 +0000 (18:02 -0800)]
Revert "Fix SBDebugger::CreateTargetWithFileAndArch to accept LLDB_ARCH_DEFAULT."
Also revert "Follow on to:
f05dc40c31d1883b46b8bb60547087db2f4c03e3"
After these changes, multiple lldb tests are failing. Calls to
CreateTargetWithFileAndArch(None, None) appear to fail after these
changes.
This reverts commit
f05dc40c31d1883b46b8bb60547087db2f4c03e3 and
1fba21778f84f266f7d32153c88e59e1900fbe5b.
Brad Smith [Tue, 26 Jan 2021 01:55:09 +0000 (20:55 -0500)]
[libcxx] random_device, for OpenBSD specify optimal entropy properties
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D94571
Duncan P. N. Exon Smith [Tue, 10 Nov 2020 15:54:03 +0000 (10:54 -0500)]
Frontend: Take VFS and MainFileBuffer by reference in PrecompiledPreamble::CanReuse, NFC
Clarify that `PrecompiledPreamble::CanReuse` requires non-null arguments
for `VFS` and `MainFileBuffer`, taking them by reference instead of by
pointer.
Differential Revision: https://reviews.llvm.org/D91297
Amara Emerson [Mon, 25 Jan 2021 19:43:19 +0000 (11:43 -0800)]
[GlobalISel][Localizer] Don't localize phi operands which are used more than once in the phi.
The current algorithm just tries to localize defs as far as they can go, and in
the case of G_PHI operands, it clones the def into the predecessor block for
each incoming edge. When multiple edges have the same register value, this can
cause unnecessary code bloat, and inhibit later optimizations.
This change checks if a given phi operand is unique in the phi, if not the
def of that register is not localized to the predecessor.
Differential Revision: https://reviews.llvm.org/D95406
Julian Lettner [Mon, 25 Jan 2021 21:46:00 +0000 (13:46 -0800)]
[lit] Update lit.py shebang for Python3
Update shebang to always use Python3 when executing `lit.py` directly.
A previous change of mine [1] revealed that we still use Python2 on some
bot configurations that invoke `llvm/utils/lit/lit.py` as a script
directly (instead of `python3 path/to/lit.py`).
[1] https://reviews.llvm.org/D94734
Differential Revision: https://reviews.llvm.org/D95393
Wolfgang Pieb [Tue, 26 Jan 2021 00:52:23 +0000 (16:52 -0800)]
[x86] Fix trivial typo in emmintrin.h
Duncan P. N. Exon Smith [Thu, 10 Dec 2020 00:42:33 +0000 (16:42 -0800)]
SourceManager: Migrate to FileEntryRef in getOrCreateContentCache, NFC
Change `SourceManager::getOrCreateContentCache` to take a `FileEntryRef`
and update call sites (mostly internal to SourceManager.cpp). In a
couple of cases this temporarily relies on `FileEntry::getLastRef`, but
those can be cleaned up once other APIs switch over.
The one change outside of SourceManager.cpp is in ASTReader.cpp, which
stops relying on the auto-degrade-to-`FileEntry*` behaviour from
`InputFile::getFile` since it now needs a `FileEntryRef`.
No functionality change here.
Differential Revision: https://reviews.llvm.org/D92983
Duncan P. N. Exon Smith [Tue, 26 Jan 2021 00:54:12 +0000 (16:54 -0800)]
SourceManager: Unify FileEntry/FileEntryRef versions of createFileID
Change `SourceManager::createFileID(const FileEntry*)` to defer to
`SourceManager::createFileID(FileEntryRef)`. This fixes an unexercised
bug where the latter gained support for named pipes and the former
didn't, but since we're trying to remove all calls to the former it
doesn't really make sense to test this explicitly now that the
implementation is hollowed out.
This is a belated follow-up to
245218bb355599771ba43a0fe1449d1670f2666c,
which sunk named pipe support into FileManager and SourceManager. The
original version of that patch was based on top of
https://reviews.llvm.org/D92984, which removed the `FileEntry` overload
of `createFileID()`, and I missed the subtle difference when it was
rebased.
Lang Hames [Tue, 26 Jan 2021 00:24:55 +0000 (11:24 +1100)]
[JITLink] Re-apply
6884fbc2c4f (ELF eh support) with fix for broken test case.
Eugene Zhulenev [Mon, 25 Jan 2021 23:53:42 +0000 (15:53 -0800)]
[mlir:Async] Use LLVM coro operations in async.coro lowering
Instead of using llvm.call operations to call LLVM coro intrinsics use Coro operations from the LLVM dialect.
(This was reviewed as a part of https://reviews.llvm.org/D94923 but was lost in arc land from local branch)
Differential Revision: https://reviews.llvm.org/D95405
Duncan P. N. Exon Smith [Wed, 9 Dec 2020 19:36:00 +0000 (11:36 -0800)]
ExpressionParser: Migrate to FileEntryRef in ParseInternal, NFC
Migrate to the `FileEntryRef` overload of `SourceManager::createFileID`
(using `FileManager::getOptionalFileRef`) in
`ClangExpressionParser::ParseInternal`.
No functionality change here.
Differential Revision: https://reviews.llvm.org/D92957
Craig Topper [Tue, 26 Jan 2021 00:17:42 +0000 (16:17 -0800)]
[TargetLowering][RISCV] Don't transform (seteq/ne (sext_inreg X, VT), C1) -> (seteq/ne (zext_inreg X, VT), C1) if the sext_inreg is cheaper
RISCV has to use 2 shifts for (i64 (zext_inreg X, i32)), but we
can use addiw rd, rs1, x0 for sext_inreg. We already understood this
when type legalizing i32 seteq/ne on rv64. But this transform in
SimplifySetCC would sometimes undo it.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D95289
Arthur O'Dwyer [Mon, 11 Jan 2021 21:29:17 +0000 (16:29 -0500)]
[libc++] Support immovable return types in std::function.
LWG reflector consensus is that this was a bug in libc++.
(In particular, MSVC also will fix it in their STL, soon.)
Bug originally discovered by Logan Smith.
Also fix `std::function<const void()>`, which should work
the same way as `std::function<void()>` in terms of allowing
"conversions" from non-void types.
Differential Revision: https://reviews.llvm.org/D94452
David Blaikie [Tue, 26 Jan 2021 00:15:14 +0000 (16:15 -0800)]
DebugInfo: Generalize the .debug_addr minimization flag to pave the way for including other strategies
Mitch Phillips [Fri, 22 Jan 2021 22:25:31 +0000 (14:25 -0800)]
Revert "Revert "[GlobalISel] LegalizerHelper - Extract widenScalarAddoSubo method""
This reverts commit
554b3211fefd09b56b64357b9edd66c78ae200b5.
Differential Revision: https://reviews.llvm.org/D95035
Craig Topper [Mon, 25 Jan 2021 23:59:25 +0000 (15:59 -0800)]
[RISCV] Add isel patterns to optimize slli.uw patterns without Zba extension.
This pattern can occur when an unsigned is used to index an array
on RV64.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D95290
Changpeng Fang [Tue, 26 Jan 2021 00:08:08 +0000 (16:08 -0800)]
AMDGPU: Reduce the number of expensive calls in SIFormMemoryClause
Summary:
RPTracker::reset(MI) is a very expensive call when the number of virtual registers is huge.
We observed a long compilation time issue when RPT::reset() is called once for each cluster.
In this work, we call RPT.reset() only at the first seen cluster, and use advance() to get
the register pressure for the later clusters in the same basic block. This could effectively reduce the number
of the expensive calls and thus reduce the compile time.
Reviewers:
rampitec
Fixes:
SWDEV-239161
Differential Revision:
https://reviews.llvm.org/D95273
Jez Ng [Mon, 25 Jan 2021 14:43:39 +0000 (09:43 -0500)]
[lld-macho] Link against ObjCARCOpts instead of ObjCARC
Not sure what the difference is, but using the latter appears to cause
issues in standalone builds. See llvm.org/PR48853.
Reviewed By: #lld-macho, compnerd
Differential Revision: https://reviews.llvm.org/D95359
Mircea Trofin [Fri, 22 Jan 2021 18:25:08 +0000 (10:25 -0800)]
[NFC] Disallow unused prefixes in clang/test/Analysis
Differential Revision: https://reviews.llvm.org/D95249