- Feb 10, 2022
-
-
Jordan Rupprecht authored
b07b5bd7 adds a use of `__comp_ref_type.h` to `std::min`. When libc++ is built with `-D_LIBCPP_DEBUG=0`, this enables `std::__debug_less`, which is only marked constexpr after c++17. `std::min` itself is marked as being `constexpr` as of c++14, so by extension, `std::__debug_less` should also be marked `constexpr` for the same versions so that `std::min` can use it. This change lowers the guard from `> 17` to `> 11`. Reproducer in godbolt: https://godbolt.org/z/ans3TGsj8 ``` constexpr int x() { return std::min<int>({1, 2, 3, 4}); } static_assert(x() == 1); ``` Reviewed By: #libc, philnik, Quuxplusone, ldionne Differential Revision: https://reviews.llvm.org/D118940
-
Mark de Wever authored
This avoids using an libc++ internal macro in our tests. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D119352
-
Jeremy Morse authored
This new-ish LEA-fixup code path creates two substitutions for an instruction number -- this is incorrect because each Value should be replaced by a single replacement Value. Fix by deleting the duplicate substitution. Add some test coverage for this path with debug-info attached. Differential Revision: https://reviews.llvm.org/D119232
-
alex-t authored
This change includes tablegen patterns that were missed by https://reviews.llvm.org/D110950 and https://reviews.llvm.org/D76230 Reviewed By: foad Differential Revision: https://reviews.llvm.org/D119302
-
Simon Pilgrim authored
This is guaranteed to be evaluated so we can avoid repeated calls. Helps the static analyzer as it couldn't recognise that each getVecSize() would return the same value.
-
David Sherwood authored
When lowering the get.active.lane.mask intrinsic with a fixed-width predicate vector result, we can actually make use of the SVE whilelo instruction when SVE is enabled. We do this by carefully choosing a sensible VT for the whilelo instruction, then promoting it to an integer vector, i.e. nxv16i1 -> nx16i8. We can then extract a v16i8 subvector and truncate back to the original return type, i.e. v16i1. This leads to a significant improvement in code quality. Differential Revision: https://reviews.llvm.org/D116664
-
Nikolas Klauser authored
Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D119304
-
Florian Hahn authored
-
Aart Bik authored
Reviewed By: bixia Differential Revision: https://reviews.llvm.org/D119395
-
dreachem authored
Differential Revision: https://reviews.llvm.org/D119440
-
Rainer Orth authored
As reported in Issue #53690, `tools/flang/unittests/Optimizer/FlangOptimizerTests` `FAIL`s to link on Solaris: Undefined first referenced symbol in file _ZN3fir7runtimeL8getModelIcEEPFN4mlir4TypeEPNS2_11MLIRContextEEv lib/libFIRBuilder.a(Reduction.cpp.o) which is `mlir::Type (*fir::runtime::getModel<char>())(mlir::MLIRContext*)`. `clang++` warn's In file included from /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/flang/lib/Optimizer/Builder/Runtime/Reduction.cpp:14: /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h:60:34: warning: function 'fir::runtime::getModel<char>' has internal linkage but is not defined [-Wundefined-internal] static constexpr TypeBuilderFunc getModel(); ^ /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h:289:29: note: used here TypeBuilderFunc ret = getModel<RT>(); ^ Fixed by adding an explicit template instantiation for `getModel<char>`. I suppose this is necessary because on Solaris `char` is `signed`. Tested on `sparcv9-sun-solaris2.11`. Differential Revision: https://reviews.llvm.org/D119438
-
LLVM GN Syncbot authored
-
Nikita Popov authored
With opaque pointers, a zero-index GEP is a no-op. It does not need to be retained for the pointer element type change it may perform.
-
Nikolas Klauser authored
Implement `std::ranges::swap_ranges()` Reviewed By: Quuxplusone, #libc, ldionne Spies: ldionne, mgorny, jloser, libcxx-commits Differential Revision: https://reviews.llvm.org/D116303
-
Christian Kandeler authored
... if there is a match. This is needed to that clients can can make a connection between a diagnostic and an associated quickfix-tweak. Ideally, quickfix-kind tweak code actions would be provided inline along with the non-tweak fixes, but this doesn't seem easily achievable. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D118976
-
Jay Foad authored
This is just a reminder that the operands are swapped compared with all the other CmpXChg instructions. Differential Revision: https://reviews.llvm.org/D119421
-
Paul Walker authored
The are several places where hasBF16 is used to protect code that has no requirement for the +bf16 feature. The lowering code uses stock SVE instructions for things like loads and stores and so is safe even when +bf16 is not available. NOTE: Currently the nxvbf16 type is not legal unless the +bf16 feature is available, but that isn't an issue because the affected code is post type legalisation. NOTE: This patch mirrors previous work that removed the same redundant protection from isel patterns where the resulting selection emitted stock SVE instructions. Differential Revision: https://reviews.llvm.org/D119328
-
Roman Lebedev authored
While that effectively concludes i1 select handling, that boolean restriction can be lifted later.
-
-
-
Roman Lebedev authored
By definition, `umin_seq` has the exact same poison stopping properties the original `select` had: https://alive2.llvm.org/ce/z/N6XwV-
-
Roman Lebedev authored
By definition, `umin_seq` has the exact same poison stopping properties the original `select` had: https://alive2.llvm.org/ce/z/aqe9GK
-
Roman Lebedev authored
By definition, `umin_seq` has the exact same poison stopping properties the original `select` had: https://alive2.llvm.org/ce/z/MUfbTL
-
Roman Lebedev authored
By definition, `umin_seq` has the exact same poison stopping properties the original `select` had: https://alive2.llvm.org/ce/z/59KuZZ
-
Roman Lebedev authored
We'd catch the tautological select pattern later anyways due to constant folding, so that leaves PHI-like select, but it does not appear to fire there.
-
Roman Lebedev authored
Currently `createNodeForSelectOrPHI()` takes an Instruction, and only works on the Cond that is an ICmpInst, but that can be relaxed somewhat. For now, simply rename the existing function, and add a thin wrapper ontop that still does the same thing as it used to.
-
Roman Lebedev authored
https://alive2.llvm.org/ce/z/ULuZxB We could transparently handle wider bitwidths, by effectively casting iN to <N x i1> and performing the `add` bit/element -wise, the expression will be rather large, so let's not do that for now.
-
Roman Lebedev authored
https://alive2.llvm.org/ce/z/aKAr94 We could transparently handle wider bitwidths, by effectively casting iN to <N x i1> and performing the `umin` bit/element -wise, the expression will be rather large, so let's not do that for now.
-
Roman Lebedev authored
https://alive2.llvm.org/ce/z/SMEaoc We could transparently handle wider bitwidths, by effectively casting iN to <N x i1> and performing the `umax` bit/element -wise, the expression will be rather large, so let's not do that for now.
-
Roman Lebedev authored
-
Paul Walker authored
The decision is perhaps arbitrary but I figure zeroing has no dependency on the value being loaded. Differential Revision: https://reviews.llvm.org/D119327
-
David Sherwood authored
Previously the code in AArch64TargetLowering::ReconstructShuffle assumed the input vectors were always fixed-width, however this is not always the case since you can extract elements from scalable vectors and insert into fixed-width ones. We were hitting crashes here for two different cases: 1. When lowering a fixed-length vector extract from a scalable vector with i1 element types. This happens due to the fact the i1 elements get promoted to larger integer types for fixed-width vectors and leads to sequences of INSERT_VECTOR_ELT and EXTRACT_VECTOR_ELT nodes. In this case AArch64TargetLowering::ReconstructShuffle will still fail to make a transformation, but at least it no longer crashes. 2. When lowering a sequence of extractelement/insertelement operations on mixed fixed-width/scalable vectors. For now, I've just changed AArch64TargetLowering::ReconstructShuffle to bail out if it finds a scalable vector. Tests for both instances described above have been added here: (1) CodeGen/AArch64/sve-extract-fixed-vector.ll (2) CodeGen/AArch64/sve-fixed-length-reshuffle.ll Differential Revision: https://reviews.llvm.org/D116602
-
Marius Brehler authored
-
OCHyams authored
Some configurations of gdb pretty print std::deque and some don't. Make this test run only on system-darwin (which uses lldb instead), otherwise it will fail on some non-darwin machines and not others.
-
Timm Bäder authored
DR2390 clarifies that the argument to __has_cpp_attribute() needs to be macro-expanded. Clang already supports this and tests it explicitly in clang/test/Preprocessor/has_attribute.cpp. Copy the test over to clang/test/CXX/drs/ so the make_cxx_drs script picks it up. Differential Revision: https://reviews.llvm.org/D119230
-
Timm Bäder authored
Clang already handles this fine, so add a test case to let the make_cxx_dr_status script pick it up. Differential Revision: https://reviews.llvm.org/D119224
-
Lei Zhang authored
Reviewed By: mravishankar Differential Revision: https://reviews.llvm.org/D119160
-
Matthias Springer authored
Differential Revision: https://reviews.llvm.org/D119433
-
Greg Miller authored
This option allows callers to disable the warning from https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html that would warn on the following ``` void f(const string &s); string s; f(std::move(s)); // ALLOWED if performance-move-const-arg.CheckMoveToConstRef=false ``` The reason people might want to disable this check, is because it allows callers to use `std::move()` or not based on local reasoning about the argument, and without having to care about how the function `f` accepts the argument. Indeed, `f` might accept the argument by const-ref today, but change to by-value tomorrow, and if the caller had moved the argument that they were finished with, the code would work as efficiently as possible regardless of how `f` accepted the parameter. Reviewed By: ymandel Differential Revision: https://reviews.llvm.org/D119370
-
Simon Pilgrim authored
Replace matchSelectPattern pattern match with the more general m_SMin so that it can handle smin intrinsics as well as the icmp+select pattern Noticed while reviewing regressions from D98152
-