- Aug 17, 2021
-
-
Sanjay Patel authored
(cherry picked from commit 9b942a54)
-
Joseph Huber authored
Temporary files created by the offloading device toolchain are not removed after compilation when using a two-step compilation. The offload-bundler uses a different filename for the device binary than the `.o` file present in the Job's input list. This is not listed as a temporary file so it is never removed. This patch explicitly adds the device binary as a temporary file to consume it. This fixes PR50336. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D107668 (cherry picked from commit 01d59c0d)
-
David Sherwood authored
This patch adds more instructions to the Uniforms list, for example certain intrinsics that are uniform by definition or whose operands are loop invariant. This list includes: 1. The intrinsics 'experimental.noalias.scope.decl' and 'sideeffect', which are always uniform by definition. 2. If intrinsics 'lifetime.start', 'lifetime.end' and 'assume' have loop invariant input operands then these are also uniform too. Also, in VPRecipeBuilder::handleReplication we check if an instruction is uniform based purely on whether or not the instruction lives in the Uniforms list. However, there are certain cases where calls to some intrinsics can be effectively treated as uniform too. Therefore, we now also treat the following cases as uniform for scalable vectors: 1. If the 'assume' intrinsic's operand is not loop invariant, then we are free to treat this as uniform anyway since it's only a performance hint. We will get the benefit for the first lane. 2. When the input pointers for 'lifetime.start' and 'lifetime.end' are loop variant then for scalable vectors we assume these still ultimately come from the broadcast of an alloca. We do not support scalable vectorisation of loops containing alloca instructions, hence the alloca itself would be invariant. If the pointer does not come from an alloca then the intrinsic itself has no effect. I have updated the assume test for fixed width, since we now treat it as uniform: Transforms/LoopVectorize/assume.ll I've also added new scalable vectorisation tests for other intriniscs: Transforms/LoopVectorize/scalable-assume.ll Transforms/LoopVectorize/scalable-lifetime.ll Transforms/LoopVectorize/scalable-noalias-scope-decl.ll Differential Revision: https://reviews.llvm.org/D107284 (cherry picked from commit 3fd96e1b)
-
David Sherwood authored
The tests previously had lots of unnecessary CHECK lines, where all we really need to check is the presence (or absence) of the assume intrinsic and the correct input operands. Differential Revision: https://reviews.llvm.org/D107157 (cherry picked from commit 1172a8a7)
-
Jez Ng authored
I probably missed out some things, given how much work was done in the last few months... Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D107922
-
- Aug 16, 2021
-
-
Martin Storsjö authored
-
- Aug 13, 2021
-
-
Rainer Orth authored
The introduction of `SHF_GNU_RETAIN` has caused massive problems on Solaris. Initially, as reported in Bug 49437, it caused dozens of testsuite failures on both sparc and x86. The objects were marked as `ELFOSABI_NONE`, but `SHF_GNU_RETAIN` is a GNU extension. In the native Solaris ABI, that flag (in the range for OS-specific values) is `SHF_SUNW_ABSENT` with a completely different semantics, which confuses Solaris `ld` very much. Later, the objects became (correctly) marked `ELFOSABI_GNU`, which Solaris `ld` doesn't support, causing it to SEGV and break the build. The linker is currently being hardened to not accept non-native OS ABIs to avoid this. The need for linker support is already documented in `clang/include/clang/Basic/AttrDocs.td`, but not currently checked. This patch avoids all this by not emitting `SHF_GNU_RETAIN` on Solaris at all. Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and `x86_64-pc-linux-gnu`. Differential Revision: https://reviews.llvm.org/D107747 (cherry picked from commit 7bbbf295)
-
Petr Hosek authored
This fixes support for merging profiles which broke as a consequence of e50a3884. The issue was missing adjustment in merge logic to account for the binary IDs which are now included in the raw profile just after header. In addition, this change also: * Includes the version in module signature that's used for merging to avoid accidental attempts to merge incompatible profiles. * Moves the binary IDs size field after version field in the header as was suggested in the review. Differential Revision: https://reviews.llvm.org/D107143 (cherry picked from commit 83302c84)
-
- Aug 12, 2021
-
-
Liuke Gehry authored
Fix cppcoreguidelines-init-variables by removing the enum FixIt, and add support for initialization check of scoped enum In C++, the enumeration is never Integer, and the enumeration condition judgment is added to avoid compiling errors when it is initialized to an integer. Add support for initialization check of scope enum. As the following case show, clang-tidy will give a wrong automatic fix: enum Color {Red, Green, Blue}; enum class Gender {Male, Female}; void func() { Color color; // Color color = 0; <--- fix bug Gender gender; // <--- no warning } Reviewd By: aaron.ballman, whisperity Differential Revision: http://reviews.llvm.org/D106431 (cherry picked from commit 4a097efe) -
Andrea Di Biagio authored
This fixes a bug where implicit uses of EFLAGS were not marked as ReadAdvance in the RM/MR variants of ADC/SBB (PR51318) This also fixes the absence of ReadAdvance for the register operand of RMW arithmetic instructions (PR51322). Differential Revision: https://reviews.llvm.org/D107367 (cherry picked from commit 7a1a35a1)
-
Andrea Di Biagio authored
Also, regenerate existing X86 tests using update_mca_test.py. (cherry picked from commit f0658c7a)
-
Pan, Tao authored
Same as 3bec7ed5 Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D107422 (cherry picked from commit c70fa6da)
-
Andrea Di Biagio authored
This is related to PR51392. Before this patch, the timeline view was rounding doubles to the first decimal, using a logic similar to this: ``` double AverageTime = (double)Input / CumulativeExecutions; double Result = floor((AverageTime * 10) + 0.5) / 10 ``` Here, Input and CumulativeExecutions are both unsigned integers. The last operation is what effectively performs the rounding of AverageTime. PR51392 has been raised because - under specific -m32 configurations of GCC - one of the timeline tests reports slighlty different values (due to a different rounding choice). This patch tries to minimise the propagation of floating-point error by hoisting the multiply by 10, so that it is performed on the unsigned. ``` double AverageTime = (double)(Input * 10) / CumulativeExecutions; floor(AverageTime + 0.5) / 10 ``` So we are trading a floating point multiply for a integer multiply (which can be expanded using a simple MUL or using an `ADD + LEA` sequence). This decrease in floating point operations executed should also help with decreasing the error in the computation.. Strictly speaking, that computation will always be potentially subject to error (depending on what values are passed in input). However, this patch should improve the situation and make bug like PR51392 less frequent. (cherry picked from commit 45685a1f)
-
Arthur O'Dwyer authored
efriedma noted that D104682 broke this test case, reduced from SPEC2006. #include <istream> bool a(std::istream a) { return a.getline(0,0) == 0; } We can unbreak it by restoring the conversion to something-convertible-to-bool. We chose `void*` in order to match libstdc++. For more ancient history, see PR19460: https://bugs.llvm.org/show_bug.cgi?id=19460 Differential Revision: https://reviews.llvm.org/D107663 (cherry picked from commit c1a8f128) -
Johannes Doerfert authored
Failed for some reason, potentially because of the inner type declaration in combination with the `using`. This might help. Failure: https://lab.llvm.org/buildbot/#/builders/127/builds/15432 (cherry picked from commit fc32a5c8)
-
Johannes Doerfert authored
PHI nodes are not pass through but change their value, we have to account for that to avoid missing stores. Follow up for D107798 to fix PR51249 for good. Differential Revision: https://reviews.llvm.org/D107808 (cherry picked from commit e7e3585c)
-
Johannes Doerfert authored
AAPointerInfoFloating needs to visit all uses and some multiple times if we go through PHI nodes. Attributor::checkForAllUses keeps a visited set so we don't recurs endlessly. We now allow recursion for non-phi uses so we track all pointer offsets via PHI nodes properly without endless recursion. This replaces the first attempt D107579. Differential Revision: https://reviews.llvm.org/D107798 (cherry picked from commit 96da6dd6)
-
Johannes Doerfert authored
The bulk of the changes come from attributes but only the @phi_store function is effectively added. (cherry picked from commit f358727c)
-
- Aug 11, 2021
-
-
Matheus Izvekov authored
See PR47174. When canonicalizing nested name specifiers of the type kind, the prefix for 'DependentTemplateSpecialization' types was being dropped, leading to malformed types which would cause failures when rebuilding template names. Signed-off-by:
Matheus Izvekov <mizvekov@gmail.com> Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D107311 (cherry picked from commit 219790c1)
-
Evandro Menezes authored
Add the scheduling resources for the V extension instructions. Differential Revision: https://reviews.llvm.org/D98002 (cherry picked from commit 63a5ac4e)
-
Tom Stellard authored
-
Rainer Orth authored
Linking `libclang.so` is currently broken on Solaris: ld: fatal: option --version-script requires option -z gnu-version-script-compat to be specified While Solaris `ld` supports a considerable subset of `--version-script`, there are some elements of the syntax that aren't. The fix is equivalent to D78510 <https://reviews.llvm.org/D78510>. Additionally, use of C-style comments is a GNU extension that can easily be avoided by using `#` as comment character, which is supported by GNU `ld`, `gold`, and `lld`. Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, `x86_64-pc-linux-gnu`. Differential Revision: https://reviews.llvm.org/D107559 (cherry picked from commit a382a746)
-
Tom Stellard authored
This function is marked with CINDEX_LINKAGE, but was never added to the export list / linker script. Reviewed By: jrtc27 Differential Revision: https://reviews.llvm.org/D106974 (cherry picked from commit a4edb2b1)
-
Michał Górny authored
Include the vaue of LLVM_ENABLE_NEW_PASS_MANAGER in generated LLVMConfig.cmake since it is needed by clang's build system. This fixes test failures when the new pass manager is enabled (i.e. by default) by having clang's CMake files correctly detect that and skip relevant tests. Differential Revision: https://reviews.llvm.org/D107628 (cherry picked from commit 889a1e69)
-
Michał Górny authored
Add a LLVM_LIT_ARGS cached variable in order to make it possible to override lit arguments when doing standalone builds. Without that, the user variable is ignored and the default options are always used. Based on a similar solution found in clang. Differential Revision: https://reviews.llvm.org/D107700 (cherry picked from commit 614c7d03)
-
Michał Górny authored
Some LD_PRELOAD-ed libraries tend to interact badly with --nodefaultlib, particularly Gentoo sandbox. Do not run this test if LD_PRELOAD is present in the running environment. Differential Revision: https://reviews.llvm.org/D107701 (cherry picked from commit 15cacab7)
-
Bradley Smith authored
The patterns for fixed length gather/scatter with 32-bit offsets and 64-bit memory type are slightly different that the rest of the patterns, as such the lowering needs to be slightly different to ensure the correct types are used. Differential Revision: https://reviews.llvm.org/D107576 (cherry picked from commit 73ecb998)
-
Dimitry Andric authored
On FreeBSD, the `environ` symbol is undefined at link time for shared libraries, but resolved by the dynamic linker at runtime. Therefore, allow the symbol to be undefined when creating a shared library, by using the `--allow-shlib-undefined` linker flag, instead of `-z defs` (a.k.a `--no-undefined`). Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D107698 (cherry picked from commit 400cd6d2)
-
Tom Stellard authored
This reverts commit ba485d5b. This was committed on accident.
-
- Aug 10, 2021
-
-
Dimitry Andric authored
Instead, include `<cstdlib>` which is the canonical header containing the declaration of `alloca()`. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D107699 (cherry picked from commit ab4b4684)
-
Shilei Tian authored
This patch fixes the "performance regression" reported in https://bugs.llvm.org/show_bug.cgi?id=51235. In fact it has nothing to do with performance. The root cause is, the stolen task is not allowed to execute by another thread because by default it is tied task. Since hidden helper task will always be executed by hidden helper threads, it should be untied. Reviewed By: protze.joachim Differential Revision: https://reviews.llvm.org/D107121 (cherry picked from commit 9f5d6ea5)
-
Tom Stellard authored
-
Dimitry Andric authored
Recently in 0da172b1 thread safety warnings-as-errors were enabled. However, googletest is currently not compatible with thread safety annotations. On FreeBSD, which has the pthread functions marked with such annotations, this results in errors when building the compiler-rt tests: In file included from compiler-rt/lib/interception/tests/interception_test_main.cpp:15: In file included from llvm/utils/unittest/googletest/include/gtest/gtest.h:62: In file included from llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:40: llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1636:3: error: mutex 'mutex_' is still held at the end of function [-Werror,-Wthread-safety-analysis] } ^ llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1633:32: note: mutex acquired here GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); ^ llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1645:32: error: releasing mutex 'mutex_' that was not held [-Werror,-Wthread-safety-analysis] GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); ^ 2 errors generated. At some point googletest will hopefully be made compatible with thread safety annotations, but for now add corresponding `-Wno-thread-*` flags to `COMPILER_RT_GTEST_CFLAGS` to silence these warnings-as-errors. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D107491 (cherry picked from commit b260f3fd)
-
Martin Storsjö authored
This does the same fix as D107237 but for a couple more options, converting all remaining cases of such options to accept both forms, for consistency. This fixes building e.g. openldap, which uses --image-base=<value>. Differential Revision: https://reviews.llvm.org/D107253 (cherry picked from commit b7fb5b54)
-
Martin Storsjö authored
Don't just check for the existence of one, but check which one was specified last, if any. This fixes https://llvm.org/PR51296. Differential Revision: https://reviews.llvm.org/D107261 (cherry picked from commit ce49fd02)
-
- Aug 07, 2021
-
-
Michał Górny authored
Remove test times when running shtest-keyword-parse-errors test, in order to prevent the previous executions from impacting subtest order and therefore causing FileCheck to fail. Differential Revision: https://reviews.llvm.org/D107427 (cherry picked from commit 39fa96a4)
-
Yonghong Song authored
Kuniyuki Iwashima reported in [1] that llvm compiler may convert a loop exit condition with "i < bound" to "i != bound", where "i" is the loop index variable and "bound" is the upper bound. In case that "bound" is not a constant, verifier will always have "i != bound" true, which will cause verifier failure since to verifier this is an infinite loop. The fix is to avoid transforming "i < bound" to "i != bound". In llvm, the transformation is done by IndVarSimplify pass. The compiler checks loop condition cost (i = i + 1) and if the cost is lower, it may transform "i < bound" to "i != bound". This patch implemented getArithmeticInstrCost() in BPF TargetTransformInfo class to return a higher cost for such an operation, which will prevent the transformation for the test case added in this patch. [1] https://lore.kernel.org/netdev/1994df05-8f01-371f-3c3b-d33d7836878c@fb.com/ Differential Revision: https://reviews.llvm.org/D107483 (cherry picked from commit e52946b9)
-
Michał Górny authored
LLVMLineEditor library is part of the LLVM dylib. Move it into LLVM_LINK_COMPONENTS to avoid duplicate linking when dylib is being used. This fixes building standalone clang against installed LLVM without static libraries. Differential Revision: https://reviews.llvm.org/D107558 (cherry picked from commit d99e9461)
-
Dylan Fleming authored
Fixed type assertion failure caused by trying to fold a masked load with a select where the select condition is a scalar value Reviewed By: sdesmalen, lebedev.ri Differential Revision: https://reviews.llvm.org/D107372 (cherry picked from commit 3943a746)
-
Martin Storsjö authored
This option is always interpreted strictly as a hexadecimal string, even if it has no prefix that indicates the number format, hence the existing call to StringRef::getAsInteger(16, ...). StringRef::getAsInteger(0, ...) consumes a leading "0x" prefix is present, but when the radix is specified, the radix shouldn't be included. Both MS rc.exe and GNU windres accept the language with that prefix. Also allow specifying the codepage to llvm-windres with a different radix, as GNU windres allows that (but MS rc.exe doesn't). This fixes https://llvm.org/PR51295. Differential Revision: https://reviews.llvm.org/D107263 (cherry picked from commit 46020f6f)
-