- May 24, 2023
-
-
Piotr Zegar authored
Ignore duplicated switch cases with [[fallthrough]] attribute to reduce false positives. Fixes: #47588 Reviewed By: donat.nagy Differential Revision: https://reviews.llvm.org/D147889
-
Craig Topper authored
Reviewed By: fakepaper56 Differential Revision: https://reviews.llvm.org/D151132
-
Joshua Cranmer authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D151141
-
Noah Goldstein authored
In `select c, x, y` the condition `c` dominates the resulting `x` or `y` chosen by the `select`. This adds logic to `isKnownNonZero` to try and use the `icmp` for the `c` condition to see if it implies the select `x` or `y` are known non-zero. For example in: ``` %c = icmp ugt i8 %x, %C %r = select i1 %c, i8 %x, i8 %y ``` The true arm of select `%x` is non-zero (when "returned" by the `select`) because `%c` being true implies `%x` is non-zero. Alive2 Links (with `x {pred} C`): - EQ iff `C != 0`: - https://alive2.llvm.org/ce/z/umLabn - NE iff `C == 0`: - https://alive2.llvm.org/ce/z/DQvy8Y - UGT [always]: - https://alive2.llvm.org/ce/z/HBkjgQ - UGE iff `C != 0`: - https://alive2.llvm.org/ce/z/LDNifB - SGT iff `C s>= 0`: - https://alive2.llvm.org/ce/z/QzWDj3 - SGE iff `C s> 0`: - https://alive2.llvm.org/ce/z/rR4g3D - SLT iff `C s<= 0`: - https://alive2.llvm.org/ce/z/uysayx - SLE iff `C s< 0`: - https://alive2.llvm.org/ce/z/2jYc7e Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D147900 -
Noah Goldstein authored
Differential Revision: https://reviews.llvm.org/D147899
-
Noah Goldstein authored
The knownbits implementation covers all the cases previously handled by `uadd.sat`/`usub.sat` as well some additional ones. We previously were not handling the `ssub.sat`/`sadd.sat` cases at all. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D150103
-
Noah Goldstein authored
These where previously missing. Even in the case where overflow is indeterminate we can still deduce some of the low/high bits. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D150102
-
Noah Goldstein authored
Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D150101
-
Noah Goldstein authored
`abs` preserves the lowest set bit, so if we know the lowest set bit, set it in the output. As well, implement the case where the operand is known negative. Reviewed By: foad, RKSimon Differential Revision: https://reviews.llvm.org/D150100
-
Manna, Soumi authored
Reported by Coverity static analyzer tool: Inside "ItaniumCXXABI.cpp" file, in <unnamed>::ItaniumCXXABI::EmitLoadOfMemberFunctionPointer(clang::CodeGen::CodeGenFunction &, clang::Expr const *, clang::CodeGen::Address, llvm::Value *&, llvm::Value *, clang::MemberPointerType const *): Return value of function which returns null is dereferenced without checking. //returned_null: getAs returns nullptr (checked 130 out of 156 times). //var_assigned: Assigning: FPT = nullptr return value from getAs. const FunctionProtoType *FPT = MPT->getPointeeType()->getAs<FunctionProtoType>(); auto *RD = cast<CXXRecordDecl>(MPT->getClass()->castAs<RecordType>()->getDecl()); // Dereference null return value (NULL_RETURNS) //dereference: Dereferencing a pointer that might be nullptr FPT when calling arrangeCXXMethodType. llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType( CGM.getTypes().arrangeCXXMethodType(RD, FPT, /*FD=*/nullptr)); This patch uses castAs instead of getAs which will assert if the type doesn't match. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D151054 -
LLVM GN Syncbot authored
-
walter erquinigo authored
This simple diff declares some enum values needed to create a REPL for the mojo language. Differential Revision: https://reviews.llvm.org/D150303
-
Nitin John Raj authored
Add minimal support to lower return, and introduce an OutgoingValueHandler and an OutgoingValueAssigner for returns. Supports return values with integer, pointer and aggregate types. (Update of D69808 - avoiding commandeering that revision) Co-authored By: lewis-revill Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D117318
-
Thurston Dang authored
This patch does the bare minimum to import sanitizer_common_interceptors, but without actually enabling any interceptors or meaningfully defining the COMMON_INTERCEPT macros. This will allow selectively enabling sanitizer_common interceptors (if the appropriate macros are defined), as suggested by Vitaly in D149701. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D150708
-
Tue Ly authored
This fixes an issue with missing `unsigned long` conversion on macOS. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D151234
-
Vitaly Buka authored
https://reviews.llvm.org/D150742 is the fix. This reverts commit edd0981e.
-
Vlad Serebrennikov authored
Now with support for MSVC-specific triples. CWG977 focus on point of /completeness/ of enums. Wording provided in CWG1482. CWG1482 and CWG2516 focus on locus (point) of /declaration/. Wording provided in CWG2516. Reviewed By: clang-language-wg, shafik Differential Revision: https://reviews.llvm.org/D151042
-
Rahul Kayaith authored
2.9.0 was released on December 28, 2021, and some following changes require at least this version. Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D150247
-
Aaron Ballman authored
-
Markus Böck authored
C++s iterator concept requires operator* to return the same type as is specified by the iterators reference type. This functionality is especially important for older generic code that did not yet make use of auto. An example from within LLVM is iterator_adaptor_base which uses the reference type of the iterator it is wrapping as its return type for operator* (this class is used as base for a lot of other functionality like filter iterators and so on). Using any of the graph traversal iterators listed above with it would previously fail to compile due to reference being non-const while operator* returned a const reference. This patch fixes that by correctly specifying reference and using it as the return type of operator* explicitly to prevent further issues in the future. Differential Revision: https://reviews.llvm.org/D151198
-
Azat Khuzhin authored
This will avoid hardcoding all unsupported targets, since even after one more follow up fix [1], there is one more failure. [1]: https://reviews.llvm.org/D150886 Plus, if you want to run it locally on some target that CI does not covers, it could also false-positively fail, which is not good. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D151046
-
Alex Langford authored
[lldb][NFCI] Merge implementations of ObjectFileMachO::GetMinimumOSVersion and ObjectFileMachO::GetSDKVersion These functions do the exact same thing (even if they look slightly different). I yanked the common implementation, cleaned it up, and shoved it into its own function. Differential Revision: https://reviews.llvm.org/D151120
-
Diego Caballero authored
This patch adds support to shape cast a vector<1x1x1...1xElemenType> to a vector<ElementType> and the other way around. Differential Revision: https://reviews.llvm.org/D151169
-
Joseph Huber authored
Summry: This was accidentally dropped from a previous patch following a rebase. Fix it to where it's consistent. Differential Revision: https://reviews.llvm.org/D151232
-
Aaron Ballman authored
We documented -fmsc-version as defaulting to 1300 and -fms-compatibility-version as defaulting to 1800, neither of which were accurate. We currently default to 1920. See MSVCToolChain::computeMSVCVersion() for details.
-
Jin Xin Ng authored
Ensures a subsequent call (via an external caller) to __sanitizer_get_allocated_size via hooks will return a valid size. This allows a faster version of __sanitizer_get_allocated_size to be implemented, which can skip checks. Test to ensure RunFreeHooks' call order will come with __sanitizer_get_allocated_size_fast Differential Revision: https://reviews.llvm.org/D151151
-
Mark de Wever authored
This is a followup of the review comments in D144499. Reviewed By: ldionne, philnik, #libc Differential Revision: https://reviews.llvm.org/D150585
-
Mark de Wever authored
This member has been added in D148641 so it can be used in the formatter to avoid creating a "temporary" string. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D150791
-
Mark de Wever authored
This adds the cppm files of D144994. These files by themselves will do nothing. The goal is to reduce the size of D144994 and making it easier to review the real changes of the patch. Implements parts of - P2465R3 Standard Library Modules std and std.compat Reviewed By: ldionne, ChuanqiXu, aaronmondal, #libc Differential Revision: https://reviews.llvm.org/D151030
-
Fangrui Song authored
There are two motivations. `-fno-pic -fstack-protector -mstack-protector-guard=global` created `__stack_chk_guard` is referenced directly on all ELF OSes except FreeBSD. This patch allows referencing the symbol indirectly with -fno-direct-access-external-data. Some Linux kernel folks want `-fno-pic -fstack-protector -mstack-protector-guard-reg=gs -mstack-protector-guard-symbol=__stack_chk_guard` created `__stack_chk_guard` to be referenced directly, avoiding R_X86_64_REX_GOTPCRELX (even if the relocation may be optimized out by the linker). https://github.com/llvm/llvm-project/issues/60116 Why they need this isn't so clear to me. --- Add module flag "direct-access-external-data" and set the dso_local property of the stack protector symbol. The module flag can benefit other LLVMCodeGen synthesized symbols that are not represented in LLVM IR. Nowadays, with `-fno-pic` being uncommon, ideally we should set "direct-access-external-data" when it is true. However, doing so would require ~90 clang/test tests to be updated, which are too much. As a compromise, we set "direct-access-external-data" only when it's different from the implied default value. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D150841
-
Mark de Wever authored
During the ISO C++ Committee meeting plenary session the C++23 Standard has been voted as technical complete. This updates the reference to c++2b to c++23 and updates the __cplusplus macro. Note since we use clang-tidy 16 a small work-around is needed. Clang knows -std=c++23 but clang-tidy not so for now force the lit compiler flag to use -std=c++2b instead of -std=c++23. Reviewed By: #libc, philnik, jloser, ldionne Differential Revision: https://reviews.llvm.org/D150795
-
Jin Xin Ng authored
Previously lsan would not invoke hooks on reallocations. An accompanying regression test is included in sanitizer_common. This change also moves hook calls to a location where subsequent calls (via an external caller) to __sanitizer_get_allocated_size via hooks will return a valid size. This allows a faster version of __sanitizer_get_allocated_size to be implemented, which can skip checks. Test to ensure RunFreeHooks' call order will come with __sanitizer_get_allocated_size_fast Differential Revision: https://reviews.llvm.org/D151175
-
Slava Zakharin authored
There are several observations regarding the copy-in/copy-out: * Actual argument associated with INTENT(OUT) dummy argument that requires finalization (7.5.6.3 p. 7) may be read by the finalization function, so a copy-in is required. * A temporary created for the copy-in/copy-out must be destroyed without finalization after the call (or after the corresponding copy-out), otherwise, memory leaks may occur. * The copy-out assignment must not perform finalization for the LHS. * The copy-out assignment from the temporary to the actual argument may or may not need to initialize the LHS. This change-set introduces new runtime methods: CopyOutAssign and DestroyWithoutFinalization. They are called by the compiler generated code to match the behavior described above. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D151135 -
max authored
Differential Revision: https://reviews.llvm.org/D151167
-
Pavel Iliin authored
On AArch64 for function multiversioning target_version/target_clones attributes should be used. The patch fixes the defect allowing target attribute to cause multiversioning. Differential Revision: https://reviews.llvm.org/D150867
-
Craig Topper authored
[LegalizeTypes][ARM][AArch6][RISCV][VE][WebAssembly] Add special case for smin(X, -1) and smax(X, 0) to ExpandIntRes_MINMAX. We can compute a simpler expression for Lo for these cases. This is an alternative for the test cases in D151180 that works for more targets. This is similar to some of the special cases we have for expanding setcc operands. Differential Revision: https://reviews.llvm.org/D151182
-
Joseph Huber authored
These files aren't fully formatted. I'm guessing this was a holdover from when `clang-format` was totally broken for OpenMP offloading. Format the files to be more consistent. Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D151226
-
- May 23, 2023
-
-
Joseph Huber authored
Currently we have the `send_n` and `recv_n` routines to stream data, such as a string to print, to the other side. The first operation is to send the size so the other side knows the number of bytes to recieve. However, this wasted 56 bytes that could've been sent. This meant that small values, like the arguments to a function to call on the host for example, needed to perform an extra send. This patch sends the first 56 bytes in the first packet and continues if necessary. Depends on D150992 Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D151041
-
Joseph Huber authored
We provide the `send_n` and `recv_n` utilities as a generic way to stream data between both sides of the process. This was previously tested and performed as expected when using a string of constant size. However, when the size was allowed to diverge between the threads in the warp or wavefront this could deadlock. This did not occur on NVPTX because of the use of the explicit warp sync. However, on AMD one of the work items in the wavefront could continue executing and hit the next `recv` call before the other threads, then we would deadlock as we violated the RPC invariants. This patch replaces the for loop with a thread ballot. This will cause every thread in the warp or wavefront to continue executing the loop until all of them can exit. This acts as a more explicit wavefront sync. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D150992
-
Nikolas Klauser authored
This also removes some tests which we have grouped together into robust_from_*.pass.cpp tests. Specifically, checking that - `ranges::dangling` is returned is done in `libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp` - `std::invoke` is used is done in `libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp`. - implicit conversion to bool works is done in `libcxx/test/std/algorithms/ranges_robust_against_nonbool_predicates.pass.cpp` Checking the comparison order is invalid because the `operator==` isn't symmetric. Checking what the exact type of `operator==` is, is invalid because comparing the same object has to yield the same results if the objects are not modified. Reviewed By: ldionne, #libc Spies: EricWF, libcxx-commits Differential Revision: https://reviews.llvm.org/D150588
-