- Jul 13, 2022
-
-
Sam McCall authored
This was added in 2a095ff6, however it never worked with VSCode due to bugs in vscode-languageclient (https://github.com/microsoft/vscode-languageserver-node/issues/673). Now that it does work, we can tell the interactions with text editing, with snippets, and vscode's select-first-completion behavior are bad. The spec is vague and clients could do something reasonable with the current values. However they could clearly do something unreasonable too, and over time behavior+spec tends to converge on VSCode's behavior. This addresses https://github.com/clangd/vscode-clangd/pull/358 See also https://github.com/clangd/vscode-clangd/pull/358 which hotfixes this on the client-side (as we can't apply this change retroactively to clangd 12-14). Differential Revision: https://reviews.llvm.org/D129579
-
David Blaikie authored
-
sunho authored
-
Aaron Ballman authored
There is a failing bot: http://45.33.8.238/macm1/40002/step_7.txt It looks to be failing because of a regex and how it handles whitespace, so modifying the CHECK line slightly to account for that.
-
Mark de Wever authored
This was already reviewed as D128603. This contains only the updates to the test script. Differential Revision: https://reviews.llvm.org/D129578
-
Nico Weber authored
Like https://reviews.llvm.org/D129226, but for iOS. No behavior change. Differential Revision: https://reviews.llvm.org/D129569
-
Sunho Kim authored
This fixes the buildbot failure in release only buildbots.
-
LLVM GN Syncbot authored
-
Sunho Kim authored
Adds initial COFF support in JITLink. This is able to run a hello world c program in x86 windows successfully. Implemented - COFF object loader - Static local symbols - Absolute symbols - External symbols - Weak external symbols - Common symbols - COFF jitlink-check support - All COMDAT selection type execpt largest - Implicit symobl size calculation - Rel32 relocation with PLT stub. - IMAGE_REL_AMD64_ADDR32NB relocation Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D128968
-
Craig Topper authored
To convert CTLZ to popcount we do x = x | (x >> 1); x = x | (x >> 2); ... x = x | (x >>16); x = x | (x >>32); // for 64-bit input return popcount(~x); This smears the most significant set bit across all of the bits below it then inverts the remaining 0s and does a population count. To support non-power of 2 types, the last shift amount must be more than half of the size of the type. For i15, the last shift was previously a shift by 4, with this patch we add another shift of 8. Fixes PR56457. Differential Revision: https://reviews.llvm.org/D129431
-
Craig Topper authored
-
YongKang Zhu authored
When `--symbol-ordering-file` is specified, the linker today will always put hot contributions in the middle of cold ones when targeting RISC machine, so to minimize the chances that branch thunks need be generated for hot code calling into cold code. This is not necessary when user specifies an ordering of read-only data (vs. function) symbols, or when output section is small such that no branch thunk would ever be required. The latter is common for mobile apps. For example, among all the native ARM64 libraries in Facebook Instagram App for Android, 80% of them have text section smaller than 64KB and the largest text section seen is less than 8MB, well below the distance that a BRANCH26 can reach. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D128382
-
David Tenty authored
This header need not be included on non-z/OS IBM platforms (and indeed will add nothing when it is), so add a guard. This let's us remove the header without things breaking when shipping libc++ for AIX. Reviewed By: hubert.reinterpretcast, fanbo-meng Differential Revision: https://reviews.llvm.org/D129493
-
Sunil Srivastava authored
Differential Revision: https://reviews.llvm.org/D129404
-
Hans Wennborg authored
Recent CMake versions have started to prefer llvm-mt when using clang-cl, which doesn't work at all when llvm-mt is built without libxml which has been the case so far. See https://github.com/llvm/llvm-project/issues/55817 Differential revision: https://reviews.llvm.org/D129571
-
Pavel Labath authored
We need to check for the error inside the value object to avoid reading garbage through invalid (target) pointers.
-
Aaron Ballman authored
This mostly finishes the DRs in the 200s. There are a few DRs left which will require more thought and work to test.
-
Mitch Phillips authored
-
Yuanfang Chen authored
It is illegal to merge two `llvm.coro.save` calls unless their `llvm.coro.suspend` users are also merged. Marks it "nomerge" for the moment. This reverts D129025. Alternative to D129025, which affects other token type users like WinEH. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D129530
-
Mark de Wever authored
-
Mark de Wever authored
This is a preparation to look at possible performance improvements. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D129421
-
Mark de Wever authored
In our implementation the year is always less than or equal to the class' `max()`. It's unlikely this ever changes since changing the year's range will be an ABI break. A static_assert is added as a guard. This was reported by @philnik. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D129442
-
Aaron Ballman authored
This addresses the failure with: https://lab.llvm.org/buildbot/#/builders/92/builds/29618
-
Nico Weber authored
-
LLVM GN Syncbot authored
-
Roy Jacobson authored
Some compiler provided type traits like __has_trivial_constructor have been documented as deprecated for quite some time. Still, some people apparently still use them, even though mixing them with concepts and with deleted functions leads to weird results. There's also disagreement about some edge cases between GCC (which Clang claims to follow) and MSVC. This patch adds deprecation warnings for the usage of those builtins, except for __has_trivial_destructor which doesn't have a GCC alternative. I made the warning on by default, so I had to silence it for some tests but it's not too many. Some (decade old) history of issues with those builtins: https://github.com/llvm/llvm-project/issues/18187 https://github.com/llvm/llvm-project/issues/18559 https://github.com/llvm/llvm-project/issues/22161 https://github.com/llvm/llvm-project/issues/33063 The abseil usage of them that triggered me to add this warning: https://github.com/abseil/abseil-cpp/issues/1201 Weird interaction of those builtins with C++20's conditionally trivial special member functions: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106085 Reviewed By: #clang-language-wg, aaron.ballman Differential Revision: https://reviews.llvm.org/D129170
-
Nick Desaulniers authored
Adds support for: * `-mfunction-return=<value>` command line flag, and * `__attribute__((function_return("<value>")))` function attribute Where the supported <value>s are: * keep (disable) * thunk-extern (enable) thunk-extern enables clang to change ret instructions into jmps to an external symbol named __x86_return_thunk, implemented as a new MachineFunctionPass named "x86-return-thunks", keyed off the new IR attribute fn_ret_thunk_extern. The symbol __x86_return_thunk is expected to be provided by the runtime the compiled code is linked against and is not defined by the compiler. Enabling this option alone doesn't provide mitigations without corresponding definitions of __x86_return_thunk! This new MachineFunctionPass is very similar to "x86-lvi-ret". The <value>s "thunk" and "thunk-inline" are currently unsupported. It's not clear yet that they are necessary: whether the thunk pattern they would emit is beneficial or used anywhere. Should the <value>s "thunk" and "thunk-inline" become necessary, x86-return-thunks could probably be merged into x86-retpoline-thunks which has pre-existing machinery for emitting thunks (which could be used to implement the <value> "thunk"). Has been found to build+boot with corresponding Linux kernel patches. This helps the Linux kernel mitigate RETBLEED. * CVE-2022-23816 * CVE-2022-28693 * CVE-2022-29901 See also: * "RETBLEED: Arbitrary Speculative Code Execution with Return Instructions." * AMD SECURITY NOTICE AMD-SN-1037: AMD CPU Branch Type Confusion * TECHNICAL GUIDANCE FOR MITIGATING BRANCH TYPE CONFUSION REVISION 1.0 2022-07-12 * Return Stack Buffer Underflow / Return Stack Buffer Underflow / CVE-2022-29901, CVE-2022-28693 / INTEL-SA-00702 SystemZ may eventually want to support "thunk-extern" and "thunk"; both options are used by the Linux kernel's CONFIG_EXPOLINE. This functionality has been available in GCC since the 8.1 release, and was backported to the 7.3 release. Many thanks for folks that provided discrete review off list due to the embargoed nature of this hardware vulnerability. Many Bothans died to bring us this information. Link: https://www.youtube.com/watch?v=IF6HbCKQHK8 Link: https://github.com/llvm/llvm-project/issues/54404 Link: https://gcc.gnu.org/legacy-ml/gcc-patches/2018-01/msg01197.html Link: https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/return-stack-buffer-underflow.html Link: https://arstechnica.com/information-technology/2022/07/intel-and-amd-cpus-vulnerable-to-a-new-speculative-execution-attack/?comments=1 Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce114c866860aa9eae3f50974efc68241186ba60 Link: https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00702.html Link: https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00707.html Reviewed By: aaron.ballman, craig.topper Differential Revision: https://reviews.llvm.org/D129572 -
Chuanqi Xu authored
There were two assertions in DefaultArgStorage::setInherited previously. It requires the DefaultArgument is either empty or an argument value. It would crash if it has a pointer refers to the previous declaration or contains a chain to the previous declaration. But there are edge cases could hit them actually. One is InheritDefaultArguments.cppm that I found recently. Another one is pr31469.cpp, which was created fives years ago. This patch tries to fix the two failures by handling full cases in DefaultArgStorage::setInherited. This is guaranteed to not introduce any breaking change since it lives in the path we wouldn't touch before. And the added assertions for sameness should keep the correctness. Reviewed By: v.g.vassilev Differential Revision: https://reviews.llvm.org/D128974
-
Mariusz Borsa authored
This is to finish the change started by D125816 , D126263 and D126577 (replace SANITIZER_MAC by SANITIZER_APPLE). Dropping definition of SANITIZER_MAC completely, to remove any possible confusion. Differential Revision: https://reviews.llvm.org/D129502
-
- Jul 12, 2022
-
-
Chuanqi Xu authored
parameters. The current implementation to judge the similarity of TypeConstraint in ASTContext::isSameTemplateParameter is problematic, it couldn't handle the following case: ```C++ template <__integer_like _Tp, C<_Tp> Sentinel> constexpr _Tp operator()(_Tp &&__t, Sentinel &&last) const { return __t; } ``` When we see 2 such declarations from different modules, we would judge their similarity by `ASTContext::isSame*` methods. But problems come for the TypeConstraint. Originally, we would profile each argument one by one. But it is not right. Since the profiling result of `_Tp` would refer to two different template type declarations. So it would get different results. It is right since the `_Tp` in different modules refers to different declarations indeed. So the same declaration in different modules would meet incorrect our-checking results. It is not the thing we want. We want to know if the TypeConstraint have the same expression. Reviewer: vsapsai, ilya-biryukov Differential Revision: https://reviews.llvm.org/D129068 -
Jay Foad authored
The availability of LiveIntervals affects kill flags in the output, so declare the use to avoid strange effects where the output of this pass is different depending on what other passes are scheduled after it. Differential Revision: https://reviews.llvm.org/D129555
-
Joseph Huber authored
Summary: There are a few definitions that are unused or unnecessary after previous changes, clean them up.
-
Joseph Huber authored
Summary: Previous assumptions held that the LTO stage would only have a single output. This is incorrect when using thinLTO which outputs multiple files. Additionally there were some bugs with how we hanlded input that cause problems when performing thinLTO. This patch addresses these issues. The performance of Thin-LTO is currently pretty bad. But I am content to leave it that way as long as it compiles.
-
Chuanqi Xu authored
Closing https://github.com/llvm/llvm-project/issues/56310 Previously we don't check the contents of concept so it might merge inconsistent results. Important Note: this patch might break existing code but the behavior might be right. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D129104
-
Kai Nacke authored
When lowering llvm::stackprotect intrinsic, the SDAG implementation checks useLoadStackGuardNode() to either create a LOAD_STACK_GUARD or use the first argument of the intrinsic. This check is not present in the IRTranslator, which results in always generating a LOAD_STACK_GUARD even if the target does not support it. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D129505
-
Slava Zakharin authored
Calling runtime TRANSPOSE requires a temporary array for the result, and, sometimes, a temporary array for the argument. Lowering it inline should provide faster code. I added -opt-transpose control just for debugging purposes temporary. I am going to make driver changes that will disable inline lowering for -O0. For the time being I would like to enable it by default to expose the code to more tests. Differential Revision: https://reviews.llvm.org/D129497
-
Krzysztof Drewniak authored
Between issues such as https://github.com/llvm/llvm-project/issues/56323, the fact that this lowering (unlike the code in amdgpu-to-rocdl) does not correctly set up bounds checks (and thus will cause page faults on reads that might need to be padded instead), and that fixing these problems would, essentially, involve replicating amdgpu-to-rocdl, remove --vector-to-rocdl for being broken. In addition, the lowering does not support many aspects of transfer_{read,write}, like supervectors, and may not work correctly in their presence. We (the MLIR-based convolution generator at AMD) do not use this conversion pass, nor are we aware of any other clients. Migration strategies: - Use VectorToLLVM - If buffer ops are particularly needed in your application, use amdgpu.raw_buffer_{load,store} A VectorToAMDGPU pass may be introduced in the future. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D129308
-
Ben Langmuir authored
When building modules, override secondary outputs (dependency file, dependency targets, serialized diagnostic file) in addition to the pcm file path. This avoids inheriting per-TU command-line options that cause non-determinism in the results (non-deterministic command-line for the module build, non-determinism in which TU's .diag and .d files will contain the module outputs). In clang-scan-deps we infer whether to generate dependency or serialized diagnostic files based on an original command-line. In a real build system this should be modeled explicitly. Differential Revision: https://reviews.llvm.org/D129389
-
Paul Robinson authored
Also add a test to verify this difference in the PS4/PS5 ABIs, now that we have identified it.
-