- Jan 27, 2021
-
-
Adhemerval Zanella authored
Recent shouldAssumeDSOLocal changes (introduced by 961f31d8) 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 authored
[RISCV] Have customLegalizeToWOp truncate to the original type instead of i32 now that we use it for i8/i16 as well. 239cfbcc 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 authored
Fixes the LLVM code gen bugs and adds the missing tests. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D95378
-
Julian Lettner authored
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 authored
37510f69 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 authored
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 authored
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 authored
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 authored
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 authored
This function isn't used. Differential Revision: https://reviews.llvm.org/D95411
-
Kadir Cetinkaya authored
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 authored
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 authored
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 authored
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 authored
Replace cast_or_null<> with cast<> as we immediately dereference the pointer afterward so we're not expecting a null pointer.
-
Simon Pilgrim authored
Removes an unnecessary chain of StringRef -> std::string -> StringRef conversions
-
Mircea Trofin authored
Differential Revision: https://reviews.llvm.org/D95417
-
Alexander Belyaev authored
-
- Jan 26, 2021
-
-
Simon Pilgrim authored
Fixes clang static analysis warnings.
-
Simon Pilgrim authored
Avoid repeated calls to isZeroValue() and check for a null pointer before dereferencing a dyn_cast<>.
-
George Rokos authored
-
Matt Arsenault authored
Fixes verifier error when writing MIR testcases
-
Florian Hahn authored
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 authored
Add a few additional tests where partial unswitching is not really profitable and should be avoided.
-
Simon Pilgrim authored
-
Sander de Smalen authored
Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D95355
-
Sebastian Neubauer authored
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 authored
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 authored
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 authored
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 authored
This reverts commit d987b61b. 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 authored
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 authored
-
Lang Hames authored
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 authored
Fixed declaration of define by adding a comma symbol. Required to fix build without profiling.
-
Alex Zinenko authored
-
Adhemerval Zanella authored
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 authored
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 authored
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 authored
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.
-