- Aug 24, 2021
-
-
Jon Chesterfield authored
(cherry picked from commit f420939b)
-
Joachim Protze authored
This patch should fix the build we observe when building LLVM from scratch. Differential Revision: https://reviews.llvm.org/D107156 (cherry picked from commit 4ffa1478)
-
Jon Chesterfield authored
Asm is a gnu extension for C, so at present -fopenmp -std=c99 and similar fail to compile on nvptx, bug 51344 Changing to `__asm__` or `__asm` works for openmp, all three appear to work for cuda. Suggesting `__asm__` here as `__asm` is used by MSVC with different syntax, so this should make for better error diagnostics if the header is passed to a compiler other than clang. Reviewed By: tra, emankov Differential Revision: https://reviews.llvm.org/D107492 (cherry picked from commit 509854b6)
-
Jon Chesterfield authored
Fixes miscompile of calls into ocml. Bug 51445. The stack variable `double __tmp` is moved to dynamically allocated shared memory by CGOpenMPRuntimeGPU. This is usually fine, but when the variable is passed to a function that is explicitly annotated address_space(5) then allocating the variable off-stack leads to a miscompile in the back end, which cannot decide to move the variable back to the stack from shared. This could be fixed by removing the AS(5) annotation from the math library or by explicitly marking the variables as thread_mem_alloc. The cast to AS(5) is still a no-op once IR is reached. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D107971 (cherry picked from commit dbd7bad9)
-
Pushpinder Singh authored
This fixes the issue https://bugs.llvm.org/show_bug.cgi?id=51337 Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D107468 (cherry picked from commit f3eb5f90)
-
Pushpinder Singh authored
This fixes the 'unused linker option: -lm' warning when compiling program with -c. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D107952 (cherry picked from commit 60e07a95)
-
Pushpinder Singh authored
With this patch, OpenMP on AMDGCN will use the math functions provided by ROCm ocml library. Linking device code to the ocml will be done in the next patch. Reviewed By: JonChesterfield, jdoerfert, scchan Differential Revision: https://reviews.llvm.org/D104904 (cherry picked from commit 713a5d12)
-
Pushpinder Singh authored
Math libraries are linked only when -lm is specified. This is because host system could be missing rocm-device-libs. Reviewed By: JonChesterfield, yaxunl Differential Revision: https://reviews.llvm.org/D105981 (cherry picked from commit 9830f902)
-
Jeremy Morse authored
This patch is a revert of e08f205f. In that patch, DW_TAG_subprograms were permitted to be referenced across CU boundaries, to improve stack trace construction using call site information. Unfortunately, as documented in PR48790, the way that subprograms are "owned" by dwarf units is sufficiently complicated that subprograms end up in unexpected units, invalidating cross-unit references. There's no obvious way to easily fix this, and several attempts have failed. Revert this to ensure correct DWARF is always emitted. Three tests change in addition to the reversion, but they're all very light alterations. Differential Revision: https://reviews.llvm.org/D107076 (cherry picked from commit d4ce9e46 ) Signed-off-by:
Jeremy Morse <jeremy.morse@sony.com> Conflicts: llvm/test/DebugInfo/X86/convert-loclist.ll
-
Louis Dionne authored
basic_string and vector currently have a hard dependency on the compiled library because they need to call __vector_base_common::__throw_xxx(), which are externally instantiated in the compiled library. That makes sense when exceptions are enabled (because we're trying to localize the exception-throwing code to the compiled library), but it doesn't really make sense when exceptions are disabled, and the __throw_xxx functions are just calling abort() anyways. This patch simply overrides the __throw_xxx() functions so that they don't rely on the compiled library when exceptions are disabled. Differential Revision: https://reviews.llvm.org/D108389 (cherry picked from commit f3bc0e51)
-
- Aug 21, 2021
-
-
Albion Fung authored
The test case is not ran unless libcxx is used, and a macro may be undefined. This patch checks for the definition of the macro before using it. Fixes http://llvm.org/PR51430 Differential Revision: https://reviews.llvm.org/D108352 (cherry picked from commit 4bef7a8f)
-
- Aug 20, 2021
-
-
Louis Dionne authored
The triple can sometimes be arm64-apple-macos, where the previous XFAIL annotation wouldn't match (and hence the test would fail unexpectedly). (cherry picked from commit e8118e6c)
-
Raphael Isemann authored
Regression tests for D108088 . Reviewed By: mib Differential Revision: https://reviews.llvm.org/D108121 (cherry picked from commit cf521e78)
-
Dimitry Andric authored
When assertions are turned off, the `llvm::Error` value created at the start of this function is overwritten using the move-assignment operator, but the success value is never checked. Whenever a TypeSystem cannot be found or created, this can lead to lldb core dumping with: Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed). Fix this by not creating a `llvm::Error` value in advance, and directly returning the result of `llvm::make_error` instead, whenever an error is encountered. See also: <https://bugs.freebsd.org/253881> and <https://bugs.freebsd.org/257829>. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D108088 (cherry picked from commit 5033f079) -
Martin Storsjö authored
The code is based on the same __mulh and __umulh intrinsics for x86. This should fix PR51128. Differential Revision: https://reviews.llvm.org/D106721 (cherry picked from commit cc3affd8)
-
Zahira Ammarguellat authored
This reverts commit 48ad446a. (cherry picked from commit 4389a413)
-
- Aug 19, 2021
-
-
Nikita Popov authored
This is a non-intrusive fix for https://bugs.llvm.org/show_bug.cgi?id=51476 intended for backport to the 13.x release branch. It expands on the current hack by distinguishing between CmpValue of 0, 1 and 2, where 0 and 1 have the obvious meaning and 2 means "anything else". The new optimization from D98564 should only be performed for CmpValue of 0 or 1. For main, I think we should switch the analyzeCompare() and optimizeCompare() APIs to use int64_t instead of int, which is in line with MachineOperand's notion of an immediate, and avoids this problem altogether. Differential Revision: https://reviews.llvm.org/D108076 (cherry picked from commit 81b10658)
-
Rainer Orth authored
The Solaris buildbots have been broken for some time by the unconditional use of `NT_GNU_BUILD_ID`, e.g. Solaris/sparcv9 <https://lab.llvm.org/staging/#/builders/50/builds/4910> and Solaris/amd64 <https://lab.llvm.org/staging/#/builders/101/builds/3751>. Being a GNU extension, it is not defined in `<sys/elf.h>`. However, providing a fallback definition doesn't help because the code also relies on `__ehdr_start`, another unportable GNU extension that most likely never will be implemented in Solaris `ld`. Besides, there's reallly no point in supporting build ids since they aren't used on Solaris at all. This patch fixes this by making the relevant code conditional on the definition of `NT_GNU_BUILD_ID`. Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`. Differential Revision: https://reviews.llvm.org/D107556 (cherry picked from commit 779714f8)
-
Simon Pilgrim authored
As reported on PR51281, an internal fuzz test encountered an issue when extracting constant bits from a SUBV_BROADCAST node from a constant pool source larger than the broadcasted subvector width. The getTargetConstantBitsFromNode was assuming that the Constant would the same size as the subvector, resulting in the incorrect packing of the per-element bits data. This patch attempts to solve this by using the SUBV_BROADCAST node to determine the subvector width, and then ensuring we extract only the lowest bits from Constant of that subvector bitsize. Differential Revision: https://reviews.llvm.org/D107158 (cherry picked from commit 18e6a03b)
-
Tomas Matheson authored
This assert is intended to ensure that the high registers are not selected when it is passed to one of the thumb UXT instructions. However it was triggering even for 32 bit where no UXT instruction is emitted. Fixes PR51313. Differential Revision: https://reviews.llvm.org/D107363 (cherry picked from commit 40650f27)
-
- Aug 18, 2021
-
-
Louis Dionne authored
In the future, we'll want to rely exclusively on using_if_exists for this job, but for now, only rely on it when the compiler supports that attribute. That removes the possibility for getting the logic wrong. Differential Revision: https://reviews.llvm.org/D108297 (cherry picked from commit ebc01bbc)
-
Louis Dionne authored
This allows testing the rest of those headers on most platforms, instead of XFAILing the whole test just because of a few functions. As a fly-by fix, remove std/utilities/time/date.time/ctime.pass.cpp, which was a duplicate of std/language.support/support.runtime/ctime.pass.cpp. Differential Revision: https://reviews.llvm.org/D108295 (cherry picked from commit ec574f5d)
-
Louis Dionne authored
Instead of trying to sniff out what features are supported by the library being tested, the way we normally handle these things is with Lit annotations. This should not be treated differently. Differential Revision: https://reviews.llvm.org/D108209 (cherry picked from commit ed7c81d1)
-
Kiran Chandramohan authored
std::clock_t can be an unsigned value on some platforms like MacOS and therefore needs a cast when initializing an std::clock_t value with -1. Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D107972 (cherry picked from commit 4573c31f)
-
Amy Kwan authored
It is possible to generate the llvm.fmuladd.ppcf128 intrinsic, and there is no actual FMA instruction that corresponds to this intrinsic call for ppcf128. Thus, this intrinsic needs to remain as a call as it cannot be lowered to any instruction, which also means we need to disable CTR loop generation for fma involving the ppcf128 type. This patch accomplishes this behaviour. Differential Revision: https://reviews.llvm.org/D107914 (cherry picked from commit 581a8030)
-
Fangrui Song authored
For the release/13.x branch. Differential Revision: https://reviews.llvm.org/D107782
-
- Aug 17, 2021
-
-
Paul Walker authored
visitEXTRACT_SUBVECTOR can sometimes create illegal BITCASTs when removing "redundant" INSERT_SUBVECTOR operations. This patch adds an extra check to ensure such combines only occur after operation legalisation if any resulting BITBAST is itself legal. Differential Revision: https://reviews.llvm.org/D108086 (cherry picked from commit cd0e1964)
-
Martin Storsjö authored
In e72403f9, we added the flag "--no-dynamicbase" for disabling the dynamicbase flag which we set by default. At the time, ld.bfd didn't have any corresponding option (as ld.bfd defaulted to not setting the flag). Almost at the same time, corresponding options were added to ld.bfd for disabling it (while it was being enabled by default), with a different name, "--disable-dynamicbase". Thus add the "--disable-dynamicbase" option. Make this default one advertised in the help listing, but keep the "--no-dynamicbase" form as an alias. Also improve checking for the last option set if there are multiple ones on the same command line. Also add corresponding disable options for a lot of other flags that we set by default, also added in ld.bfd in the same commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=514b4e191d5f46de8e142fe216e677a35fa9c4bb Differential Revision: https://reviews.llvm.org/D107930 (cherry picked from commit f8340c8c)
-
Matheus Izvekov authored
See PR48656. The implementation of the template instantiation of requires expressions was incorrectly trying to get the expression from an 'ExprRequirement' before checking if it was an error state. Signed-off-by:
Matheus Izvekov <mizvekov@gmail.com> Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D107399 (cherry picked from commit e64e6924)
-
Brian Cain authored
(cherry picked from commit 888876ba)
-
Johannes Doerfert authored
(cherry picked from commit 5f543919)
-
Sanjay Patel authored
The intrinsics have an extra chunk of known bits logic compared to the normal cmp+select idiom. That allows folding the icmp in each case to something better, but that then opposes the canonical form of min/max that we try to form for a select. I'm carving out a narrow exception to preserve all existing regression tests while avoiding the inf-loop. It seems unlikely that this is the only bug like this left, but this should fix: https://llvm.org/PR51419 (cherry picked from commit b267d3ce)
-
Sanjay Patel authored
This is already done within InstCombine: https://alive2.llvm.org/ce/z/MiGE22 ...but leaving it out of analysis makes it harder to avoid infinite loops there. (cherry picked from commit e260e10c)
-
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)
-