- Feb 20, 2023
-
-
Ye Luo authored
~TaskAsyncInfoWrapperTy() calls isDone. With synchronize inside isDone, we need to handle the error return from synchronize in the destructor. The consumers of TaskAsyncInfoWrapperTy, targetDataMapper and targetKernel, both call AsyncInfo.synchronize() before exiting. For this reason in ~TaskAsyncInfoWrapperTy(), calling synchronize() via isDone() is redundant. This patch removes synchronize() call inside isDone() and makes it a lightweight check. __tgt_target_nowait_query needs to call synchronize() before checking isDone(). Differential Revision: https://reviews.llvm.org/D144315 (cherry picked from commit e2069be8)
-
Joseph Huber authored
Summary: Currently when we synchronize the asynchronous queue for the plugins, we ignore the return value. This is problematic because we will continue on like nothing happened if the kernel fails. Fixes https://github.com/llvm/llvm-project/issues/60814 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D144191 (cherry picked from commit 5172877b)
-
Chuanqi Xu authored
[C++20] [Modules] Allow -fmodule-file=<module-name>=<BMI-Path> for implementation unit and document the behavior Close https://github.com/llvm/llvm-project/issues/57293. Previsouly we can't use `-fmodule-file=<module-name>=<BMI-Path>` for implementation units, it is a bug. Also the behavior of the above option is not tested nor documented for C++20 Modules. This patch addresses the 2 problems. (cherry picked from commit 1782e8f9)
-
R. Voggenauer authored
The sys::fs::equivalent(file_status, file_status) function is meant to judge whether two file_status structs denote the same individual file. On Unix, this is implemented by only comparing the st_dev and st_ino numbers (from stat), ignoring all other fields. On Windows, lacking reliable fields corresponding to st_dev and st_ino, equivalent(file_status, file_status) compares essentially all fields. However, since 1e39ef33 (https://reviews.llvm.org/D18456), file_status also contains the file access time. Including the file access time in equivalent(file_status, file_status) makes it possible to spuriously break. In particular, when invoking equivalent(Twine, Twine), with two paths, there's a race condition - the function calls status() on both input paths. Even if the two paths are the same, the comparison can fail, if the file was accessed between the two status() calls. Thus, it seems like the inclusion of the access time in equivalent(file_status, file_status) was a mistake. This race condition can cause spurious failures when linking with LLD/ELF, where LLD uses equivalent() to check whether a file exists within a specific sysroot, and that sysroot is accessed by other processes concurrently. This fixes downstream issue https://github.com/msys2/MINGW-packages/issues/15695. Differential Revision: https://reviews.llvm.org/D144172 (cherry picked from commit a1e80c69)
-
Balazs Benics authored
One might think that by merging the equivalence classes (eqclasses) of `Sym1` and `Sym2` symbols we would end up with a `State` in which the eqclass of `Sym1` and `Sym2` should now be the same. Surprisingly, it's not //always// true. Such an example triggered the assertion enforcing this _unjustified_ invariant in https://github.com/llvm/llvm-project/issues/58677. ```lang=C++ unsigned a, b; #define assert(cond) if (!(cond)) return void f(unsigned c) { /*(1)*/ assert(c == b); /*(2)*/ assert((c | a) != a); /*(3)*/ assert(a); // a = 0 => c | 0 != 0 => c != 0 => b != 0 } ``` I believe, that this assertion hold for reasonable cases - where both `MemberSym` and `SimplifiedMemberSym` refer to live symbols. It can only fail if `SimplifiedMemberSym` refers to an already dead symbol. See the reasoning at the very end. In this context, I don't know any way of determining if a symbol is alive/dead, so I cannot refine the assertion in that way. So, I'm proposing to drop this unjustified assertion. --- Let me elaborate on why I think the assertion is wrong in its current shape. Here is a quick reminder about equivalence classes in CSA. We have 4 mappings: 1) `ClassMap`: map, associating `Symbols` with an `EquivalenceClass`. 2) `ClassMembers`: map, associating `EquivalenceClasses` with its members - basically an enumeration of the `Symbols` which are known to be equal. 3) `ConstraintRange`: map, associating `EquivalenceClasses` with the range constraint which should hold for all the members of the eqclass. 4) `DisequalityMap`: I'm omitting this, as it's irrelevant for our purposes now. Whenever we encounter/assume that two `SymbolRefs` are equal, we update the `ClassMap` so that now both `SymbolRefs` are referring to the same eqclass. This operation is known as `merge` or `union`. Each eqclass is uniquely identified by the `representative` symbol, but it could have been just a unique number or anything else - the point is that an eqclass is identified by something unique. Initially, all Symbols form - by itself - a trivial eqclass, as there are no other Symbols to which it is assumed to be equal. A trivial eqclass has //notionally// exactly one member, the representative symbol. I'm emphasizing that //notionally// because for such cases we don't store an entry in the `ClassMap` nor in the `ClassMembers` map, because it could be deduced. By `merging` two eqclasses, we essentially do what you would think it does. An important thing to highlight is that the representative symbol of the resulting eqclass will be the same as one of the two eqclasses. This operation should be commutative, so that `merge(eq1,eq2)` and `merge(eq2,eq1)` should result in the same eqclass - except for the representative symbol, which is just a unique identifier of the class, a name if you will. Using the representative symbol of `eq1` or `eq2` should have no visible effect on the analysis overall. When merging `eq1` into `eq2`, we take each of the `ClassMembers` of `eq1` and add them to the `ClassMembers` of `eq2` while we also redirect all the `Symbol` members of `eq1` to map to the `eq2` eqclass in the `ClassMap`. This way all members of `eq1` will refer to the correct eqclass. After these, `eq1` key is unreachable in the `ClassMembers`, hence we can drop it. --- Let's get back to the example. Note that when I refer to symbols `a`, `b`, `c`, I'm referring to the `SymbolRegionValue{VarRegion{.}}` - the value of that variable. After `(1)`, we will have a constraint `c == b : [1,1]` and an eqclass `c,b` with the `c` representative symbol. After `(2)`, we will have an additional constraint `c|b != a : [1,1]` with the same eqclass. We will also have disequality info about that `c|a` is disequal to `a` - and the other way around. However, after the full-expression, `c` will become dead. This kicks in the garbage collection, which transforms the state into this: - We no longer have any constraints, because only `a` is alive, for which we don't have any constraints. - We have a single (non-trivial) eqclass with a single element `b` and representative symbol `c`. (Dead symbols can be representative symbols.) - We have the same disequality info as before. At `(3)` within the false branch, `a` get perfectly constrained to zero. This kicks in the simplification, so we try to substitute (simplify) the variable in each SymExpr-tree. In our case, it means that the `c|a != a : [1,1]` constraint gets re-evaluated as `c|0 != 0 : [1,1]`, which is `c != 0 : [1,1]`. Under the hood, it means that we will call `merge(c|a, c)`. where `c` is the result of `simplifyToSVal(State, MemberSym).getAsSymbol()` inside `EquivalenceClass::simplify()`. Note that the result of `simplifyToSVal()` was a dead symbol. We shouldn't have acquired an already dead symbol. AFAIK, this is the only way we can get one at this point. Since `c` is dead, we no longer have a mapping in `ClassMap` for it; hence when we try to `find()` the eqclass of `c`, it will report that it's a trivial eqclass with the representative symbol `c`. After `merge(c|a, c)`, we will have a single (non-trivial) eqclass of `b, c|a` with the representative symbol `c|a` - because we merged the eqclass of `c` into the eqclass of `c|a`. This means that `find(c|a)` will result in the eqclass with the representative symbol `c|a`. So, we ended up having different eqclasses for `find(c|a)` and `find(c)` after `merge(c|a, c)`, firing the assertion. I believe, that this assertion hold for reasonable cases - where both `MemberSym` and `SimplifiedMemberSym` refer to live symbols. `MemberSym` should be live in all cases here, because it is from `ClassMembers` which is pruned in `removeDeadBindings()` so these must be alive. In this context, I don't know any way of determining if a symbol is alive/dead, so I cannot refine the assertion in that way. So, I'm proposing to drop this unjustified assertion. I'd like to thank @martong for helping me to conclude the investigation. It was really difficult to track down. PS: I mentioned that `merge(eq1, eq2)` should be commutative. We actually exploit this for merging the smaller eqclass into the bigger one within `EquivalenceClass::merge()`. Yea, for some reason, if you swap the operands, 3 tests break (only failures, no crashes) aside from the test which checks the state dumps. But I believe, that is a different bug and orthogonal to this one. I just wanted to mention that. - `Analysis/solver-sym-simplification-adjustment.c` - `Analysis/symbol-simplification-fixpoint-iteration-unreachable-code.cpp` - `Analysis/symbol-simplification-reassume.cpp` Fixes #58677 Reviewed By: vabridgers Differential Revision: https://reviews.llvm.org/D138037 (cherry picked from commit afcf70aa)
-
KAWASHIMA Takahiro authored
(cherry picked from commit e8d44841)
-
KAWASHIMA Takahiro authored
reST requires an empty line before a bullet list. (cherry picked from commit 6240627c)
-
Anastasia Stulova authored
Documented major OpenCL features in release 16. Differential Revision: https://reviews.llvm.org/D143348
-
- Feb 19, 2023
-
-
Vitaly Buka authored
"unsigned long" can be 8 bytes, but the code assumes 4. This this the real root cause D122215 was reverted. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D144316 (cherry picked from commit a53d940c)
-
- Feb 16, 2023
-
-
Ye Luo authored
Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D143871 (cherry picked from commit 0d4e55ba)
-
Jeremy Maitin-Shepard authored
While some blake3 symbols are already prefixed, a number of symbols with hidden visibility have been left without an `llvm_` prefix. This results in symbol collisions when statically linking llvm into a binary that also uses the external blake3 library. Reviewed By: akyrtzi, MaskRay Differential Revision: https://reviews.llvm.org/D143981 (cherry picked from commit 26662ac0)
-
Alvin Wong authored
On i386 Windows, after C++ names have been Itanium-mangled, the C name mangling specific to its call convention may also be applied on top. This change teaches symbolizer to be able to demangle this type of mangled names. As part of this change, `demanglePE32ExternCFunc` has also been modified to fix unwanted stripping for vectorcall names when the demangled name is supposed to contain a leading `_`. Notice that the vectorcall mangling does not add either an `_` or `@` prefix. The old code always tries to strip the prefix first, which for Itanium mangled names in vectorcall, the leading underscore of the Itanium name gets stripped instead and breaks the Itanium demangler. Differential Revision: https://reviews.llvm.org/D144049 (cherry picked from commit e117fd28)
-
Brian Cain authored
For v73 and later, clang users who wish to use the cabac instructions need a way to add the 'cabac' target feature. Reviewed By: kparzysz Differential Revision: https://reviews.llvm.org/D142947 (cherry picked from commit cd97675e)
-
Roland McGrath authored
Add some missed polish from https://reviews.llvm.org/D143355. Reviewed By: jrtc27 Differential Revision: https://reviews.llvm.org/D143360
-
Roland McGrath authored
The ShadowCallStack is the preferred and default ABI for Fuchsia. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D143357
-
Roland McGrath authored
Fuchsia's ABI always reserves the x18 (s2) register for the ShadowCallStack ABI, even when -fsanitize=shadow-call-stack is not enabled. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D143355
-
Roland McGrath authored
Fuchsia provides a slot relative to tp for the stack-guard value, which is cheaper to materialize than the default GOT load. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D143353
-
Brian Cain authored
Patch-by:
Colin Lemahieu <colinl@codeaurora.org> Differential Revision: https://reviews.llvm.org/D143531 (cherry picked from commit f1a87d47)
-
- Feb 14, 2023
-
-
Joseph Huber authored
The GPU plugins have a dependency on the device libraries. Sometimes we cannot build the device libraries because the user does not have a valid `clang` to use or it was explicitly disabled. Currently this leads to a transitive failure because we cannot meet this dependency. This patch simply removes that dependency. Fixes https://github.com/llvm/llvm-project/issues/60457 Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D143196 (cherry picked from commit 9f650ae7)
-
Louis Dionne authored
Instead of destroying the object with allocator::destroy, we must call its destructor directly. As a fly-by also mark LWG3008 as fixed since it is handled by our implementation. This was pointed out by Tim Song in https://reviews.llvm.org/D140913. Differential Revision: https://reviews.llvm.org/D143791 (cherry picked from commit 58010902)
-
Nikolas Klauser authored
Other macros that disable parts of the library are named `_LIBCPP_HAS_NO_WHATEVER`. Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D143164 (cherry picked from commit cf65d275)
-
Hui authored
Fix several bugs: 1. https://llvm.org/PR60258 The conversion constructors' constraint `__compatible_with` incorrectly allow array types conversion to scalar types 2. https://llvm.org/PR53368 The constructor that takes `unique_ptr` are not suffiently constrained. 3. The constructors that take raw pointers incorretly use `__compatible_with`. They have different constraints Differential Revision: https://reviews.llvm.org/D143346 (cherry picked from commit a38a4654)
-
Nikolas Klauser authored
Reviewed By: Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D142526 (cherry picked from commit ba43f3e8)
-
Peter Jung authored
Source tarball's are used from some distribution to build the project Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D143809 (cherry picked from commit b673135b)
-
Amy Kwan authored
This patch aims to restrict the emit-asm-from-mlir.mlir test to the targets that the test cases expect using the 'target=...' LIT expression. rG9067de2a has previously attempted to resolve the LIT failure on the ppc64le-flang-rhel-clang buildbot coming from the emit-asm-from-mlir.mlir test by restricting the test case for AArch64, x86 and ARM (as long as these targets are built). The original solution of adding "*-registered-target" works on ppc64le-flang-rhel-clang because this bot only builds PowerPC in LLVM_TARGETS_TO_BUILD. When we build all targets and also build the flang project, this test case will fail because despite being on PowerPC, we are still building the AArch64, x86 and ARM targets which will cause this test to run. These targets expect the ret instruction to be produced in this test case, while PowerPC produces a blr instead. Differential Revision: https://reviews.llvm.org/D143366 (cherry picked from commit 71513f76)
-
Carlos Alberto Enciso authored
As describe in https://github.com/llvm/llvm-project/issues/60363 the following DebugInfo LogicalView Tests unit tests failed: - ELFReader - SelectElements The tests fail only on the OSX-64 platform with the CMake options: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON Using the same options on a Linux platform all the tests pass: - https://lab.llvm.org/buildbot/#/builders/196 - llvm-x86_64-debian-dylib Basically it is a dynamic library initialization affecting a static instance for the string pool (LVStringPool). That string pool instance is accessed by all the logical elements to store/retrieve any associated string during the creation of the logical view. For a logical view comparison, both logical readers (Reference and Target) use retrieved indexes when comparing their strings. Moved the static instance to LVSupport module (unnamed namespace). Reviewed By: jmorse Differential Revision: https://reviews.llvm.org/D143716 (cherry picked from commit 92716a42)
-
Roy Jacobson authored
Do a large edit of the Clang release notes. This is meant to be merged into the Clang 16.x branch. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D142578
-
- Feb 13, 2023
-
-
Andrew Ng authored
Prevent errors and crash dumps for broken pipes on Windows. Fixes: https://github.com/llvm/llvm-project/issues/48672 Differential Revision: https://reviews.llvm.org/D142224 (cherry picked from commit 0b704d9d)
-
Adrian Vogelsgesang authored
The pretty printer for `std::coroutine_handle` was running into > Assertion failed: (target_ctx != source_ctx && "Can't import into itself") from ClangASTImporter.h, line 270. This commit fixes the issue by removing the `CopyType` call from the pretty printer. While this call was necessary in the past, it seems to be no longer required, at least all test cases are still passing. Maybe something changed in the meantime around the handling of `TypesystemClang` instances. I don't quite understand why `CopyType` was necessary earlier. I am not sure how to add a regression test for this, though. It seems the issue is already triggered by the exising `TestCoroutineHandle.py`, but API tests seem to ignore all violations of `lldbassert` and still report the test as "passed", even if assertions were triggered Differential Revision: https://reviews.llvm.org/D143127 (cherry picked from commit 54d4a255)
-
Adrian Vogelsgesang authored
So far, the pretty printer for `std::coroutine_handle` internally dereferenced the contained frame pointer displayed the `promise` as a sub-value. As noticed in https://reviews.llvm.org/D132624 by @labath, this can lead to an endless loop in lldb during printing if the coroutine frame pointers form a cycle. This commit breaks the cycle by exposing the `promise` as a pointer type instead of a value type. The depth to which the `frame variable` and the `expression` commands dereference those pointers can be controlled using the `--ptr-depth` argument. Differential Revision: https://reviews.llvm.org/D132815 (cherry picked from commit 8aa31375)
-
Konstantin Varlamov authored
Differential Revision: https://reviews.llvm.org/D143245 (cherry picked from commit 8e13ec9e)
-
Martin Storsjö authored
Don't use the ldrd instruction; that one requires armv5te. Instead do two separate loads (or only one if OMPT_SUPPORT isn't defined). This should fix https://github.com/llvm/llvm-project/issues/60370. Differential Revision: https://reviews.llvm.org/D143683 (cherry picked from commit 89197b59)
-
Kai Luo authored
-
Chuanqi Xu authored
[C++20] [Modules] [ClangScanDeps] Enable to print make-style dependency file within P1689 format (4/4) Required in https://reviews.llvm.org/D137534. The build systems needs the information to know that "header X changed, scanning may have changed, so please rerun scanning". Although it is possible to get the information by running clang-scan-deps for the second time with make format, it is not user friendly clearly. Reviewed By: jansvoboda11 Differential Revision: https://reviews.llvm.org/D139168
-
Jie Fu authored
In file included from /data/jiefu/llvm-project/clang/unittests/Lex/ModuleDeclStateTest.cpp:22: /data/jiefu/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1526:11: error: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare] if (lhs == rhs) { ~~~ ^ ~~~ /data/jiefu/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1553:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, int>' requested here return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); ^ /data/jiefu/llvm-project/clang/unittests/Lex/ModuleDeclStateTest.cpp:124:3: note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, int, nullptr>' requested here EXPECT_EQ(Callback->importNamedModuleNum(), 0); ^ /data/jiefu/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2027:54: note: expanded from macro 'EXPECT_EQ' EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2) ^ 1 error generated. -
Chuanqi Xu authored
[C++20] [Modules] [ClangScanDeps] Allow clang-scan-deps to without specified compilation database in P1689 (3/4) In a private chat with @ben.boeckel , we get in consensus it would be great for cmake if the invocation of clang-scan-deps can get rid of compilation database. Due to the compilation database can't do very well for the files which are not existed yet. @ben.boeckel may have more context to add here. This patch should be innocent for others usages. Reviewed By: jansvoboda11 Differential Revision: https://reviews.llvm.org/D137534
-
Chuanqi Xu authored
[C++20] [Modules] [ClangScanDeps] Add ClangScanDeps support for C++20 Named Modules in P1689 format (2/4) Close https://github.com/llvm/llvm-project/issues/51792 Close https://github.com/llvm/llvm-project/issues/56770 This patch adds ClangScanDeps support for C++20 Named Modules in P1689 format. We can find the P1689 format at: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html. After we land the patch, we're able to compile C++20 Named Modules with CMake! And although P1689 is written by kitware people, other build systems should be able to use the format to compile C++20 Named Modules too. TODO: Support header units in P1689 Format. TODO2: Support C++20 Modules in the full dependency format of ClangScanDeps. We also want to support C++20 Modules and clang modules together according to https://discourse.llvm.org/t/how-should-we-support-dependency-scanner-for-c-20-modules/66027. But P1689 format cares about C++20 Modules only for now. So let's focus on C++ Modules and P1689 format. And look at the full dependency format later. I'll add the ReleaseNotes and Documentations after the patch get landed. Reviewed By: jansvoboda11 Differential Revision: https://reviews.llvm.org/D137527
-
Chuanqi Xu authored
This patch prepares the necessary interfaces in the preprocessor part for D137527 since we need to recognize if we're in a module unit, the module kinds and the module declaration and the module we're importing in the preprocessor. Differential Revision: https://reviews.llvm.org/D137526
-
- Feb 12, 2023
-
-
eopXD authored
-
- Feb 10, 2023
-
-
Owen Pan authored
Fixes #60576. Differential Revision: https://reviews.llvm.org/D143546 (cherry picked from commit b4e35c63)
-