- Mar 29, 2024
-
-
Martin Storsjö authored
This reapplies 272d1b44 (from #85756), which was reverted in 40793703. In the previous attempt, empty CMAKE_INSTALL_PREFIX was handled by quoting them, in d209d134. That made the calls to cmake_path(ABSOLUTE_PATH) succeed, but the output paths of that weren't actually absolute, which was required by file(RELATIVE_PATH). Avoid this issue by constructing a non-empty base directory variable to use for calculating the relative path. (cherry picked from commit 50801f10)
-
- Mar 28, 2024
-
-
Ulrich Weigand authored
We use the VSCBIQ/VSBIQ/VSBCBIQ family of instructions to implement USUBO/USUBO_CARRY for the i128 data type. However, these instructions use an inverted sense of the borrow indication flag (a value of 1 indicates *no* borrow, while a value of 0 indicated borrow). This does not match the semantics of the boolean "overflow" flag of the USUBO/USUBO_CARRY ISD nodes. Fix this by generating code to explicitly invert the flag. These cancel out of the result of USUBO feeds into an USUBO_CARRY. To avoid unnecessary zero-extend operations, also improve the DAGCombine handling of ZERO_EXTEND to optimize (zext (xor (trunc))) sequences where appropriate. Fixes: https://github.com/llvm/llvm-project/issues/83268
-
Arthur Eubanks authored
The existing implementation didn't handle when the input text section was some offset from the output section. This resulted in an assert in relaxGot() with an lld built with asserts for some large binaries, or even worse, a silently broken binary with an lld without asserts. (cherry picked from commit 48048051)
-
Andrei Golubev authored
Using range.size() "as is" means we accumulate 'size_t' values into 'int32_t' variable. This may produce narrowing conversion warnings (particularly, on MSVC). The surrounding code seems to cast <x>.size() to 'int32_t' so following this practice seems safe enough. Co-authored-by:
Ovidiu Pintican <ovidiu.pintican@intel.com> (cherry picked from commit bce17034)
-
George Koehler authored
Delete the code that skips the CFI for the condition register on ELF32. The code checked !MustSaveCR, which happened only when Subtarget.is32BitELFABI(), where spillCalleeSavedRegisters is spilling cr in a different way. The spill was missing CFI. After deleting this code, a spill of cr2 to cr4 gets CFI in the same way as a spill of r14 to r31. Fixes #83094 (cherry picked from commit 6b70c5d7)
-
Chen Zheng authored
(cherry picked from commit 3196005f)
-
Thurston Dang authored
This ports the change from TSan (https://github.com/llvm/llvm-project/commit/0784b1eefa36d4acbb0dacd2d18796e26313b6c5). Testing notes: run 'sudo sysctl vm.mmap_rnd_bits=32; ninja check-msan' before and after this patch. N.B. aggressive ASLR may also cause the app to overlap with the allocator region; for MSan, this was fixed in https://github.com/llvm/llvm-project/commit/af2bf86a372cacf5f536bae06e2f2d3886eefb7b (cherry picked from commit 58f72518)
-
Thurston Dang authored
MSan divides the virtual address space into APP, INVALID, SHADOW and ORIGIN memory. The allocator usually just steals a bit of the APP address space: typically the bottom portion of the PIE binaries section, which works because the Linux kernel maps from the top of the PIE binaries section. However, if ASLR is very aggressive, the binary may end up mapped in the same location where the allocator wants to live; this results in a segfault. This patch adds in a MappingDesc::ALLOCATOR type and enforces that the memory range for the allocator is not occupied by anything else. Since the allocator range information is not readily available in msan.h, we duplicate the information from msan_allocator.cpp. Note: aggressive ASLR can also lead to a different type of failure, where the PIE binaries/libraries are mapped entirely outside of the APP/ALLOCATOR sections; that will be addressed in a separate patch (https://github.com/llvm/llvm-project/pull/85142). (cherry picked from commit af2bf86a)
-
Antonio Frighetto authored
When emitting the storage (or memory copy operations) for constant initializers, the decision whether to split a constant structure or array store into a sequence of field stores or to use `memcpy` is based upon the optimization level and the size of the initializer. In afe8b93f, we extended this by allowing constants to be split when the array (or struct) type does not match the type of data the address to the object (constant) is expected to contain. This may happen when `emitStoresForConstant` is called by `EmitAutoVarInit`, as the element type of the address gets shrunk. When this occurs, let the initializer be split into a bunch of stores only under `-ftrivial-auto-var-init=pattern`. Fixes: https://github.com/llvm/llvm-project/issues/84178.
-
- Mar 24, 2024
-
-
Jeffrey Byrnes authored
Change-Id: Ic77f87290905addadd5819dff2d0c62f031022ab (cherry picked from commit 1e828f83)
-
ostannard authored
PR #75527 fixed ARMFrameLowering to set the IsRestored flag for LR based on all of the return instructions in the function, not just one. However, there is also code in ARMLoadStoreOptimizer which changes return instructions, but it set IsRestored based on the one instruction it changed, not the whole function. The fix is to factor out the code added in #75527, and also call it from ARMLoadStoreOptimizer if it made a change to return instructions. Fixes #80287. (cherry picked from commit 749384c0)
-
Oliver Stannard authored
This test shows the bug where LR is used as a general-purpose register on a code path where it is not spilled to the stack. (cherry picked from commit 8779cf68)
- Mar 23, 2024
-
-
Tom Stellard authored
-
- Mar 20, 2024
-
-
Phoebe Wang authored
-
Chuanqi Xu authored
Previously we disabled to compute ODR hash for declarations from the global module fragment. However, we missed the case that the functions lives in the concept requiments (see the attached the test files for example). And the mismatch causes the potential crashment. Due to we will set the function body as lazy after we deserialize it and we will only take its body when needed. However, we don't allow to take the body during deserializing. So it is actually potentially problematic if we set the body as lazy first and computing the hash value of the function, which requires to deserialize its body. So we will meet a crash here. This patch tries to solve the issue by not taking the body of the function from GMF. Note that we can't skip comparing the constraint expression from the GMF directly since it is an key part of the function selecting and it may be the reason why we can't return 0 directly for `FunctionDecl::getODRHash()` from the GMF.
-
Luke Lau authored
This fixes the miscompile reported in #82430 by telling isSimpleVIDSequence to sign extend to XLen instead of the width of the indices, since the "sequence" of indices generated by a strided load will be at XLen. This was the simplest way I could think of getting isSimpleVIDSequence to treat the indexes as if they were zero extended to XLenVT. Another way we could do this is by refactoring out the "get constant integers" part from isSimpleVIDSequence and handle them as APInts so we can separately zero extend it. Fixes #82430 (cherry picked from commit 815644b4)
-
Luke Lau authored
See https://github.com/llvm/llvm-project/pull/82506#discussion_r1498080785 (cherry picked from commit 11d115d0)
-
Nikita Popov authored
atomicrmw xchg also accepts pointer and floating-point values. To handle those, insert necessary casts to and from integer. This is what we do for cmpxchg as well. Fixes https://github.com/llvm/llvm-project/issues/85226. (cherry picked from commit ff2fb2a1)
-
Patryk Wychowaniec authored
LDDRdPtrQ was marked as `earlyclobber`, which doesn't play well with GreedyRA (which can generate this instruction through `loadRegFromStackSlot()`). This seems to be the same case as: https://github.com/llvm/llvm-project/blob/a99b912c9b74f6ef91786b4dfbc25160c27d3b41/llvm/lib/Target/AVR/AVRInstrInfo.td#L1421 Closes https://github.com/llvm/llvm-project/issues/81911.
-
David CARLIER authored
This reverts commit 9b3edb59.
-
Qiu Chaofan authored
(cherry picked from commit e5b20c83)
-
Martin Storsjö authored
This reverts the changes from 91a38462 for Windows targets. The changes in that commit don't work as expected for Windows targets (those parts of llvm_add_library don't quite behave the same for Windows), while the previous status quo (producing a library named "libLLVM-<major>.dll") is the defacto standard way of doing versioned library names there, contrary to on Unix. After that commit, the library always ended up named "libLLVM.dll", executables linking against it would reference "libLLVM.dll", and "libLLVM-<major>.dll" was provided as a symlink. Thus revert this bit back to as it were, so that executables actually link against a versioned libLLVM, and no separate symlink is needed. The only thing that might be improved compared to the status quo as it was before these changes, is that the import library is named "lib/libLLVM-<major>.dll.a", while the common style would be to name it plainly "lib/libLLVM.dll.a" (even while it produces references to "libLLVM-<major>.dll", but none of these had that effect for Windows targets. (As a side note, the llvm-shlib library can be built for MinGW, but not currently in MSVC configurations.) (cherry picked from commit cb2ca233)
-
Tom Stellard authored
The TARGET_SONAME_FILE_NAME generator expression is not available on dll target platforms. (cherry picked from commit f8498057)
-
Tom Stellard authored
This is a partial revert of 10c48a77 with a fix for the symlink target name on MacOS See #84637 (cherry picked from commit ec2b7522)
-
Alex Crichton authored
This commit changes the default linker in the WebAssembly toolchain for the `wasm32-wasip2` target. This target is being added to the WebAssembly/wasi-sdk and WebAssembly/wasi-libc projects to target the Component Model by default, in contrast with the preexisting `wasm32-wasi` target (in the process of being renamed to `wasm32-wasip1`) which outputs a core WebAssembly module by default. The `wasm-component-ld` project currently lives in my GitHub account at https://github.com/alexcrichton/wasm-component-ld and isn't necessarily "official" yet, but it's expected to continue to evolve as the `wasm32-wasip2` target continues to shape up and evolve. (cherry picked from commit d66121d7)
-
- Mar 19, 2024
-
-
Tom Stellard authored
The baseline version calculations was assuming the minor release would always be 0. (cherry picked from commit d93363a0)
-
- Mar 17, 2024
-
-
Yingwei Zheng authored
When speculating an instruction in `InstCombinerImpl::FoldOpIntoSelect`, the call may result in undefined behavior. This patch drops all UB-implying attrs/metadata to fix this. Fixes #85536. (cherry picked from commit 252d0195)
-
Weining Lu authored
(cherry picked from commit a41bcb39)
-
Weining Lu authored
Buildbot failure: https://lab.llvm.org/buildbot/#/builders/5/builds/41530/steps/9/logs/stdio (cherry picked from commit d9b435c2)
-
Daniel Paoliello authored
-
Daniel Paoliello authored
As noted in <https://github.com/llvm/llvm-project/pull/78537>, MSVC places import descriptors in both the EC and regular map - that PR moved the descriptors to ONLY the regular map, however this causes linking errors when linking as Arm64EC: ``` bcryptprimitives.lib(bcryptprimitives.dll) : error LNK2001: unresolved external symbol __IMPORT_DESCRIPTOR_bcryptprimitives (EC Symbol) ``` This change copies import descriptors from the regular map to the EC map, which fixes this linking error.
-
Jacek Caban authored
ARM64EC import libraries expose two additional symbols: mangled thunk symbol (like `#func`) and auxiliary import symbol (like`__imp_aux_func`). The main functional change with this patch is that those symbols are properly added to static library ECSYMBOLS.
-
Jacek Caban authored
EXPORTAS is a new name type in import libraries. It's used by default on ARM64EC, but it's allowed on other platforms as well.
-
Jacek Caban authored
getExportName implementation is based on lld-link. In its current form, it's mostly about convenience, but it will be more useful for EXPORTAS support, for which export name is not possible to deduce from other printed properties.
-
Louis Dionne authored
This works around ODR violations in the clang-tidy plugin we use to perform the modules tests. Fixes #85242
-
Nathan Ridge authored
When resolving names inside templates that implement recursive compile-time functions (e.g. waldo<N>::type is defined in terms of waldo<N-1>::type), HeuristicResolver could get into an infinite recursion, specifically one where resolveDependentNameType() can be called recursively with the same DependentNameType*. To guard against this, HeuristicResolver tracks, for each external call into a HeuristicResolver function, the set of DependentNameTypes that it has seen, and bails if it sees the same DependentNameType again. To implement this, a helper class HeuristicResolverImpl is introduced to store state that persists for the duration of an external call into HeuristicResolver (but does not persist between such calls). Fixes https://github.com/clangd/clangd/issues/1951 (cherry picked from commit e6e53ca8)
-