aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-11-28Revert "[runtimes] Add missing test dependencies to check-all (#72955)"llvmorg-17.0.6release/17.xTobias Hieta1-1/+0
This reverts commit e957e6dcb29d94e4e1678da9829b77009be88926. The commit was reverted on main because of issues. We will not carry this in the release branch for 17.x
2023-11-28[Driver] Enable __float128 support on X86 on FreeBSD / NetBSD (#72788)Brad Smith2-3/+25
(cherry picked from commit 23c47eba879769a29772c999be2991201c2fe399)
2023-11-27eliminate python SyntaxWarnings from check-all output.Georgios Eleftheriou6-10/+10
``` src_dir/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py:28: SyntaxWarning: invalid escape sequence '\*' self.implementationContent += """ src_dir/llvm/utils/lit/lit/TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c' """ src_dir/llvm/utils/lit/lit/TestRunner.py:1561: SyntaxWarning: invalid escape sequence '\s' match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln) src_dir/libcxx/utils/libcxx/test/format.py:64: SyntaxWarning: invalid escape sequence '\s' for output in re.split('[$]\s*":"\s*"RUN: at line \d+"', fullOutput): src_dir/libcxx/utils/libcxx/test/params.py:121: SyntaxWarning: invalid escape sequence '\+' AddSubstitution("%{cxx_std}", re.sub("\+", "x", std)), src_dir/libcxx/utils/libcxx/test/params.py:214: SyntaxWarning: invalid escape sequence '\+' AddFeature("stdlib=libc++") if re.match(".+-libc\+\+", stdlib) else None, src_dir/compiler-rt/test/lit.common.cfg.py:800: SyntaxWarning: invalid escape sequence '\$' "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" src_dir/compiler-rt/test/lit.common.cfg.py:809: SyntaxWarning: invalid escape sequence '\$' "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix, src_dir/compiler-rt/test/lit.common.cfg.py:817: SyntaxWarning: invalid escape sequence '\$' "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix, src_dir/llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d' match = re.search("release (\d+)\.(\d+)", ptxas_out) ```
2023-11-27[clang-format] Fix crashes in AlignArrayOfStructures (#72520)Owen Pan3-2/+36
Fixed #54815. Fixed #55269. Fixed #55493. Fixed #68431.
2023-11-27[clang] Fix sorting module headers (#73146)Tulio Magno Quites Machado Filho1-4/+4
Struct Module::Header is not a POD type. As such, qsort() and llvm::array_pod_sort() must not be used to sort it. This became an issue with the new implementation of qsort() in glibc 2.39 that is not guaranteed to be a stable sort, causing Headers to be re-ordered and corrupted. Replace the usage of llvm::array_pod_sort() with std::stable_sort() in order to fix this issue. The signature of compareModuleHeaders() has to be modified. Fixes #73145. (cherry picked from commit cf1bde33423da5eb9b7dc95daac4aada3167de3c)
2023-11-27[JITLink][aarch32] Change writeRegister's return type to void.Lang Hames1-1/+1
This function does not return a value. https://github.com/llvm/llvm-project/issues/64418 (cherry picked from commit dce179396e7e547fe6b42f0f9625b49212e6ec0b)
2023-11-27[CMake] Support building shared library for NetBSDBrad Smith1-3/+5
(cherry picked from commit 51c5d74940c3a6682ccd44491cb40c7e26fb83e5)
2023-11-27workflows/release-binaries: Do a preliminary build to fill ccache (#72576)Tom Stellard1-2/+46
Build clang with the host compiler and ccache enabled in order to speed up the phase 1 builds. This helps reduce the amount of time spent running on the non-free builders. (cherry picked from commit e746b56c98f6180cffd4cad9ebdd249bdaa17283)
2023-11-27Add RV64 constraint to SRLIW (#69416)Shao-Ce SUN2-5/+26
Fixes #69408 (cherry picked from commit f48dab523784252448dbd42e72f0048ee0463368)
2023-11-24[runtimes] Add missing test dependencies to check-all (#72955)Tom Stellard1-0/+1
The test-depends target contained all the dependencies needed to run the runtimes tests, but it was never added as a dependency of check-all. This caused some of the tsan tests to fail, since the custom libcxx build the tests were looking for was never built. Besides the tsan failures, this fixes all the other test failures I was seeing with: cmake -G Ninja -B release-build -S llvm \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_PROJECTS="clang;lld" \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;compiler-rt" This is the same configuration the test-release.sh script uses, so I'm hoping this will also fix all the test failures we've been seeing when building the releases. Fixes #58680 (cherry picked from commit 7f215b1380da49dccbf57da3040a40d25ed898f4)
2023-11-20[clang-format] Fix a bug in aligning comments above PPDirective (#72791)Owen Pan2-2/+13
Fixed #72785. (cherry picked from commit 5860d248a780aaef860db3d54184b49fc758c3c1)
2023-11-20[clangd] Avoid null result in FindRecordTypeAt()Nathan Ridge2-2/+16
Fixes https://github.com/clangd/clangd/issues/1743 Differential Revision: https://reviews.llvm.org/D158851 (cherry picked from commit 1994e1173b64b61c07f8acf107f29c2c015575b4)
2023-11-20Bump version to 17.0.6Tobias Hieta4-4/+4
2023-11-20remove tests from bad mergeUtkarsh Saxena1-62/+0
2023-11-20Use the correct namespace for looking up matching operator!= (#68922)Utkarsh Saxena4-12/+199
`S.getScopeForContext` determins the **active** scope associated with the given `declContext`. This fails to find the matching `operator!=` if candidate `operator==` was found via ADL since that scope is not active. Instead, just directly lookup using the namespace decl of `operator==` Fixes #68901 (cherry picked from commit 9330261143ccbe947ef0687fd20747ba47f26879)
2023-11-20[libc++] Use correct size for deallocation of arrays in shared_ptr (#68233)Ilya Biryukov2-2/+30
Fixes #68051. Current implementation passes the number of `_AlignedStorage` objects when it calls to `allocate` and the number of **bytes** on `deallocate`. This only applies to allocations that allocate control block and the storage together, i.e. `make_shared` and `allocate_shared`. Found by ASan under Clang combined with `-fsized-deallocation`. (cherry picked from commit f722db02d359e29ca001b78197ee1a275f8c3d7c)
2023-11-20Revert "Reland [clang] Canonicalize system headers in dependency file when ↵Arthur Eubanks8-70/+12
-canonical-prefixes" (#71697) This reverts commit 578a4716f549167165a2ec3bac89c86706136d4e. This causes multiple issues. Compile time slowdown due to more path canonicalization, and weird behavior on Windows. Will reland under a separate flag `-f[no-]canonical-system-headers` to match gcc in the future and further limit when it's passed by default. Fixes #70011.
2023-11-20[clang][WebAssembly] Link crt1 even in case of -sharedYAMAMOTO Takashi2-19/+31
This allows -mexec-model=reactor -shared produces a library module with _initialize entrypoint, which is preferrable over __wasm_call_ctors. This partially reverts https://reviews.llvm.org/D153293 Discussion: https://github.com/dicej/component-linking-demo/issues/3 Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D156205 (cherry picked from commit 989ce069a4638fd561bebc95f478ca9e45154fec)
2023-11-14[BranchFolding] Remove dubious assert from operator< (#71639)llvmorg-17.0.5Nikita Popov1-6/+0
`MergePotentialElts::operator<` asserts that the two elements being compared are not equal. However, sorting functions are allowed to invoke the comparison function with equal arguments (though they usually don't for efficiency reasons). There is an existing special-case that disables the assert if _GLIBCXX_DEBUG is used, which may invoke the comparator with equal args to verify strict weak ordering. I believe libc++ also has strict weak ordering checks under some options nowadays. Recently, #71312 was reported, where a change to glibc's qsort_r implementation can also result in comparison between equal elements. From what I understood, this is an inefficiency that will be fixed on the glibc side as well, but I think at this point we should just remove this assertion. Fixes https://github.com/llvm/llvm-project/issues/71312. (cherry picked from commit 74a76a288562c486f377121855ef7db0386e0e43)
2023-11-14[GlobalOpt] Cache whether CC is changeable (#71381)Nikita Popov1-8/+22
The hasAddressTaken() call in hasOnlyColdCalls() has quadratic complexity if there are many cold calls to a function: We're going to visit each call of the function, and then for each of them iterate all the users of the function. We've recently encountered a case where GlobalOpt spends more than an hour in these hasAddressTaken() checks when full LTO is used. Avoid this by moving the hasAddressTaken() check into hasChangeableCC() and caching its result, so it is only computed once per function. (cherry picked from commit e360a16fee2dc3cb632ace556fb715832f488a90)
2023-11-14[libc++] Fix UB in <expected> related to "has value" flag (#68552) (#68733)Jan Kokemüller30-164/+540
The calls to std::construct_at might overwrite the previously set __has_value_ flag in the case where the flag is overlapping with the actual value or error being stored (since we use [[no_unique_address]]). To fix this issue, this patch ensures that we initialize the __has_value_ flag after we call std::construct_at. Fixes #68552 (cherry picked from commit 134c91595568ea1335b22e559f20c1a488ea270e)
2023-11-14[clang] fix test PR69717.cpp (#72134)antoine moynault1-1/+1
Test still fail on ARM machine (no float_control support) (cherry picked from commit 5fdb70be7b0a1340a7ebdeb94ab073e466fc4aa6)
2023-11-14[clang] Run test on x86 onlySerge Pavlov1-0/+1
The test Sema/PR69717.cpp fails on platforms that do not support pragma float_control. So run this test on x86 only. (cherry picked from commit 93ae26331592f41bf2b1d10b048743d80c468385)
2023-11-14[clang] Do not clear FP pragma stack when instantiating functions (#70646)Serge Pavlov2-2/+22
When instantiation function, a call to Sema::resetFPOption was used to set the FP options associated with AST node. However this function also cleared FP pragma stack, and it is incorrect. Template instantiation takes place on AST representation and semantic information like the FP pragma stack should not affect it. This was a reason for miscompilation in some cases. To make the Sema interface more consistent, now `resetFPOptions` does not clear FP pragma stack anymore. It is cleared in `FpPragmaStackSaveRAII`, which is used in parsing only. This change must fix https://github.com/llvm/llvm-project/issues/69717 (Problems with float_control pragma stack in Clang 17.x). (cherry picked from commit f6f625f4c6c3cbeb8cf6b889cdafc848dd4cb117)
2023-11-13[SLP]Fix PR70004: Do not change insert point for reduction gather nodes.Alexey Bataev3-21/+66
No need to change the insert point for reduction gather node, we can use the ReductionRoot as insert point instead to avoid possible crashes. (cherry picked from commit d79051f894129428ec36dedc6bbfdfdcc1bd0c17)
2023-11-13[DAG] WidenVectorOperand - add basic handling for *_EXTEND_VECTOR_INREG nodesSimon Pilgrim3-0/+36
Fixes Issue #70208 (cherry picked from commit c9c9bf0f20fd820b86fac35113bbd8049ff4e72a)
2023-11-13[Mips] In LowerShift*Parts, xor with bits-1 instead of -1. (#71149)Craig Topper4-44/+46
If we start with an i128 shift, the initial shift amount would usually have zeros in bit 8 and above. xoring the shift amount with -1 will set those upper bits to 1. If DAGCombiner is able to prove those bits are now 1, then the shift that uses the xor will be replaced with undef. Which we don't want. Reduce the xor constant to VT.bits-1 where VT is half the size of the larger shift type. This avoids toggling the upper bits. The hardware shift instruction only uses the lower bits of the shift amount. I assume the code used NOT because the hardware doesn't use the upper bits, but that isn't compatible with the LLVM poison semantics. Fixes #71142. (cherry picked from commit 8d24d3900ec3f28902b2fad4a2c2c2b789257424)
2023-11-13[clang-format] Correctly annotate keyword operator function name (#66904)Owen Pan2-0/+16
Fixes #66890. (cherry picked from commit 67b99fa8ba638edddd5ce38b4d379eab8e339e4a)
2023-11-13Bump version to 17.0.5Tobias Hieta4-4/+4
2023-11-13[Driver] Fix linking with -lm on Solaris (#65632)Rainer Orth2-8/+22
As noticed in D158846, the Solaris driver deviates from other targets in that it links every executable with `-lm`, but doesn't for shared objects. For C code, this is unnecessary, while for C++ `libm` is always needed, even for shared objects. This patch fixes this by following the `Gnu.cpp` precedent. It adjusts the `solaris-ld.c` test accordingly, adding some more tests. Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and `x86_64-pc-linux-gnu`. (cherry picked from commit 1e6b0df3503567488e7df2d574c90f8f31a001a2)
2023-11-13[clang-repl] Fix BUILD_SHARED_LIBS symbols from libclangInterpreter on MinGW ↵Martin Storsjö1-0/+11
(#71393) A few symbols within libclangInterpreter have got explicit dllexport attributes, in order to make them exported (and thus visible at runtime) in any build, not only when they are part of e.g. a DLL libclang-cpp, but also when they are part of a plain .exe. Due to the explicit dllexports, these symbols would sidestep the regular MinGW logic of exporting all symbols if there are no dllexports. Therefore, for libclang-cpp, a separate fix was made in 592e935e115ffb451eb9b782376711dab6558fe0, to pass --export-all-symbols to the build of libclang-cpp. If building with BUILD_SHARED_LIBS enabled, then the same issue appears in libclangInterpreter; pass the same flag --export-all-symbols there as well, to make sure all symbols are visible, not only the ones that are explicitly marked as dllexport. (cherry picked from commit 0d3eeac8c0f45410398a87f72ae38ea6ae1c3073)
2023-11-13[CGExprConstant] stop calling into ConstExprEmitter for Reference type ↵Nick Desaulniers2-3/+10
destinations (#70366) Fixes a bug introduced by commit b54294e2c959 ("[clang][ConstantEmitter] have tryEmitPrivate[ForVarInit] try ConstExprEmitter fast-path first") In the added test case, the QualType is a LValueReferenceType. LValueReferenceType 0x558412998d90 'const char (&)[41]' `-ParenType 0x558412998d30 'const char[41]' sugar `-ConstantArrayType 0x558412998cf0 'const char[41]' 41 `-QualType 0x55841294c271 'const char' const `-BuiltinType 0x55841294c270 'char' Fixes: #69979 (cherry picked from commit d9b15b068d19089f72fc0d7dc59ed1d6d77125dc)
2023-10-31[AArch64][GlobalISel] Fix incorrect ABI when tail call not supported (#70215)llvmorg-17.0.4Nikita Popov2-13/+12
The check for whether a tail call is supported calls determineAssignments(), which may modify argument flags. As such, even though the check fails and a non-tail call will be emitted, it will not have a different (incorrect) ABI. Fix this by operating on a separate copy of the arguments. Fixes https://github.com/llvm/llvm-project/issues/70207. (cherry picked from commit 292f34b0d3cb2a04be5ebb85aaeb838b29f71323)
2023-10-31[AArch64] Add test for #70207 (NFC)Nikita Popov1-0/+33
(cherry picked from commit d9cfb82207035fc7382ad02ec827c0dbed96565c)
2023-10-31[GVN] Fix use-after-free in load PRE with select available value (#69314)Nikita Popov2-3/+65
replaceValuesPerBlockEntry() only handled simple and coerced load values, however the load may also be referenced by a select value. Additionally, I suspect that the previous code might have been incorrect if a load had an offset, as it always constructed the AvailableValue from scratch. Fixes https://github.com/llvm/llvm-project/issues/69301. (cherry picked from commit 7f1733a252cbbad74445bd54dc95aeec52bb3199)
2023-10-31[clang-tidy] Fix crash in modernize-use-trailing-return-type (#70709)Piotr Zegar2-1/+19
Resolved the crash that occurred during the use of a user-defined C-style string literal. The fix entails checking whether the identifier is non-empty before attempting to read its name. (cherry picked from commit a396fb247e0719f56a830a9e4aab0449be7f843a)
2023-10-31[OpenMP] Fix building for 32-bit DragonFly, NetBSD, OpenBSD (#70527)Brad Smith1-1/+2
Fixing ```#error "Unknown or unsupported OS"``` (cherry picked from commit 223852aecf3f01cea21c40ea128a26f6a194345d)
2023-10-31[OpenMP] record-replay use static-cast (#70516)Konstantinos Parasyris1-2/+1
[OpenMP] Fixes #69905 (cherry picked from commit 01828c4323172db5901ac3e959d52553b2bd74e5)
2023-10-31[flang] Add comdats to functions with linkonce linkage (#66516)David Truby3-1/+57
This fixes a bug where functions generated by the MLIR Math dialect, for example ipowi, would fail to link with link.exe on Windows due to having linkonce linkage but no associated comdat. Adding the comdat on ELF also allows linkers to perform better garbage collection in the binary. Simply adding comdats to all functions with this linkage type should also cover future cases where linkonce or linkonce_odr functions might be necessary. (cherry picked from commit 5f476b80e3d472f672f5f6a719eebe2c0aadf52c)
2023-10-31[mlir] Add pass to add comdat to all linkonce functions (#65270)David Truby6-0/+122
This adds a new pass to add an Any comdat to each linkonce and linkonce_odr function in the LLVM dialect. These comdats are necessary on Windows to allow the default system linker to link binaries containing these functions. (cherry picked from commit a6857156df9a73720fbd9633067d1a61c32dd74e)
2023-10-30Update release note for the fixTakuya Shimizu1-1/+2
2023-10-30[clang][ExprConst] Fix crash on uninitialized array subobject (#67817)Takuya Shimizu6-6/+27
https://reviews.llvm.org/D146358 was assuming that all subobjects have their own name (`SubobjectDecl`), but it was not true for array elements. Fixes https://github.com/llvm/llvm-project/issues/67317
2023-10-30[RISCV] Correct copyPhysReg for GPRPF64. (#70419)Craig Topper3-5/+34
GPRF64 represents a pair of registers. We were only copying the even part. We need to copy the odd part too.
2023-10-30[SVE] Fix incorrect offset calculation when rewriting an instruction's frame ↵Paul Walker2-1/+23
index. (#70315) When partially packing an offset into an SVE load/store instruction we are incorrectly calculating the remainder. (cherry picked from commit 7c90be2857fc4c6a2e67f203ca289ed7773fae03)
2023-10-30[MemCpyOpt] Combine alias metadatas when replacing byval arguments (#70580)DianQK2-0/+15
Fixes #70578. (cherry picked from commit 0c4f326d8bc97a2fdb0533a68dbe1a7164da3911)
2023-10-30[OpenMP] Use the more appropriate function to retrieve the thread id on ↵Brad Smith1-1/+1
OpenBSD (#65553) Use the getthrid() function instead of a syscall. (cherry picked from commit 7e31b45d6a2571ff17426930dcbb784473a965b4)
2023-10-30[libc++] Encode additional ODR-affecting properties in the ABI tag (#69669)Louis Dionne3-15/+161
As explained in `__config`, we have an ABI tag that we use to ensure that we don't run into ODR issues when mixing different versions of libc++ in multiple TUs. However, the reasoning behind that extends not only to different versions of libc++, but also to different configurations of the same version of libc++. In fact, we've been aware of this for a while but never really bothered to make the change because ODR issues are often thought to be benign. Well, it turns out that I just spent over an hour banging my head against an issue that boils down to our lack of encoding of some ODR properties in the ABI tag, so here's the patch we should have done a long time ago. For now, the ODR properties we encode in the ABI tag are: - library version - exceptions vs no-exceptions - hardening mode Those are all things that we support different values for on a per-TU basis and they definitely affect ODR in a meaningful way. We can add more properties later as we see fit. (cherry picked from commit bc792a284362696c91599f9ab01f74eda4b9108f)
2023-10-27[AArch64] Prevent argument promotion of vector with size > 128 bits (#70034)KAWASHIMA Takahiro3-0/+217
This patch prevents argument promotion from promoting pointers to fixed-length vector types larger than 128 bits like `<8 x float>` into the values of the pointees. Such vector types are used for SVE VLS but there is no ABI for SVE VLS arguments and the backend cannot lower such value arguments. Fixes #69147 (cherry picked from commit 926173c614784149889b2c975adccf52bcece75b)
2023-10-27[LoongArch] Implement COPY instruction between CFRs (#69300)wanglei12-14/+227
With this patch, all CFRs can be used for register allocation. (cherry picked from commit 271087e3a0875672b26c185a28b3552d5600d2fb)
2023-10-27Revert "[clang-format] Fix align consecutive declarations over function ↵Owen Pan2-11/+1
pointers" This reverts commit a84e0b4bdc9999872adbdaafbade8164b197784b. Fixes #68079. (cherry picked from commit 7bc1031c474ebb2216a5432273dafe4d1490fbce)