- Jan 23, 2023
-
-
Guillaume Chatelet authored
This implements the same behavior as D141997 but makes sure that the same detection mechanism is used between CMake and source code. Differential Revision: https://reviews.llvm.org/D142108
-
Valentin Clement authored
NULL() passed as actual argument to a procedure with an optional dummy argument is represented with `fir.box<none>` type. When the dummy argument is polymoprhic or unlimited polymorphic, the SelectOp will complain if the types of the two arguments are not identical. Add a conversion from `fir.box<none>` to `fir.class<none>` in that case. Other situations with optional will require a fir.rebox and will be done in a follow up patch. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D142203
-
Jannik Silvanus authored
It is widely assumed that i8 is naturally aligned (i8:8), and that hence i8s can be used to access arbitrary bytes. As discussed in https://discourse.llvm.org/t/status-of-overaligned-i8, this patch makes this assumption explicit, by documenting it in the LangRef, and enforcing it when parsing a data layout string. Historically, there have been data layouts that violate this requirement, notably the old DXIL data layout that aligns i8 to 32 bits. A previous patch (df1a74ac) enabled importing modules with invalid data layouts using override callbacks. Users who wish to continue importing modules with overaligned i8s (e.g. DXIL) thus need to provide a data layout override callback that fixes the data layout, at minimum by setting natural alignment for i8. Any further adjustments to the module (e.g. adding padding bytes if necessary) need to be done after module import. In the case of DXIL, this should not be necessary, because i8 usage in DXIL is very limited and its alignment actually does not matter, see https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst#primitive-types Differential Revision: https://reviews.llvm.org/D142211
-
Johannes Doerfert authored
While full support requires more work (see TODOs), this allows us to handle vector writes with a single constant value properly. For now, we can handle the same constant values stored to all elements if everything is of a fixed size.
-
Johannes Doerfert authored
Even if we have multiple access ranges, the access can be exact. It is not a MUST access but that is taken care of elsewhere. The tests were wrong as they contained uninitialized memory. When the memory is initialized it works as expected.
-
Johannes Doerfert authored
Even if a barrier does not enforce aligned execution, it will effectively be like an aligned barrier if it is executed by all threads in an aligned way. We lack control flow divergence analysis here so we can only do (basic block) local reasoning for now.
-
LLVM GN Syncbot authored
-
Johannes Doerfert authored
-
Nikolas Klauser authored
Also remove clang-query related code, since it's unused now. Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D141805
-
Nikolas Klauser authored
__exception_guard is a no-op in -fno-exceptions mode to produce better code-gen. This means that we don't provide the strong exception guarantees. However, Clang doesn't generate cleanup code with exceptions disabled, so even if we wanted to provide the strong exception guarantees we couldn't. This is also only relevant for constructs with a stack of -fexceptions > -fno-exceptions > -fexceptions code, since the exception can't be caught where exceptions are disabled. While -fexceptions > -fno-exceptions is quite common (e.g. libc++.dylib > -fno-exceptions), having another layer with exceptions enabled seems a lot less common, especially one that tries to catch an exception through -fno-exceptions code. Fixes https://github.com/llvm/llvm-project/issues/56783 Reviewed By: ldionne, Mordante, huixie90, #libc Spies: EricWF, alexfh, hans, joanahalili, libcxx-commits Differential Revision: https://reviews.llvm.org/D133661
-
Wang, Xin10 authored
Now, when llc encounters the case that contains a lot of extract_vector_elt and a BUILD_VECTOR, it will replace these to vector_shuffle to decrease the size of code, the actions are done in createBuildVecShuffle in DAGCombiner.cpp, but now the code cannot handle the case that the size of source vector reg is more than twice the dest size. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D139685
-
Kazu Hirata authored
This patch defines ByteSwap_{32,64} and getSwappedBytes with llvm::byteswap. It's tempting to define something like: template <typename T, typename = std::enable_if_t<std::is_integral_v<T>>> inline T getSwappedBytes(T C) { return llvm::byteswap(C); } But this doesn't work. The host compiler would issue: error: call to 'getSwappedBytes' is ambiguous while compiling lldb/source/Utility/UUID.cpp. -
Johannes Doerfert authored
-
Yaxun (Sam) Liu authored
Reviewed by: Artem Belevich Differential Revision: https://reviews.llvm.org/D142246
-
Matt Arsenault authored
-
Sergei Barannikov authored
Same as e5f746e9 but for MasmParser.
-
Ben Shi authored
Fixes https://github.com/llvm/llvm-project/issues/58856 Reviewed By: aykevl Differential Revision: https://reviews.llvm.org/D142298
-
Johannes Doerfert authored
With this patch we track aligned barriers in AAExecutionDomain and also delete unnecessary barriers there. This allows us to eliminate barriers across blocks, across functions, and in the presence of complex accesses that do not force a barrier. Further, we can use the collected information to enable store-load forwarding in a threaded environment (follow up patch). Differential Revision: https://reviews.llvm.org/D140463
-
Sergei Barannikov authored
This simplifies logic a bit and helps to reduce the future diff.
-
Shilei Tian authored
[OpenMP][DeviceRTL][NFC] Use `OMPTgtExecModeFlags` from `llvm/include/llvm/Frontend/OpenMP/OMPDeviceConstants.h` This patch makes preparation for a series that will enable per-kernel information used in both host and device runtime. Some variables/enums, such as `OMPTgtExecModeFlags`, have to be shared by both of them. A new header `OMPDeviceConstants.h` is added, containing code that will be shared by them. We will introduce more variables soon. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D142320
-
Johannes Doerfert authored
If we do not guard code during SPMDzation, we do not need to check conditions for successfull guarding. That is, even if some code is executed in different modes, it does not prevent SPMDzation if there is no guarded code in there.
-
Johannes Doerfert authored
-
Johannes Doerfert authored
-
Kazu Hirata authored
-
Kazu Hirata authored
In both of these cases, the arguments to Log2_32_Ceil are known to be nonzero.
-
Kazu Hirata authored
In all these cases, the arguments to Log2_32 are known to be nonzero, so we don't have to worry about "1 << -1".
-
Dimitry Andric authored
Since bfloat16 and float16 support is not available for i386-freebsd, the `truncdfbf2.c` and `truncsfbf2.c` builtin sources should be skipped when targeting that platform, and `COMPILER_RT_HAS_FLOAT16` should not be defined. However, the CMake configuration stage runs its tests with the default target, which normally is amd64-freebsd, so it will detect both bfloat16 and float16 support. Move adding of the `COMPILER_RT_HAS_FLOAT16` define to the `foreach()` loop where all the supported architectures are handled, and do not enable it when targeting i386-freebsd. Also remove the bfloat16 sources from the `i386_SOURCES` list, when targeting i386-freebsd. Differential Revision: https://reviews.llvm.org/D136044
-
Kazu Hirata authored
-
Aaron Puchert authored
In an installation using the all-contained libLLVM.so, individual components are not available as targets, so we have to look them up in LLVM_AVAILABLE_LIBS just like llvm_map_components_to_libnames does it. Here I don't think we need the capitalized names though because we know the right capitalization. But I might be wrong. This is required by dragonffi, who call llvm_map_components_to_libnames on a list containing ${LLVM_NATIVE_ARCH}. Downstream bug report: https://bugzilla.opensuse.org/show_bug.cgi?id=1180748. Differential Revision: https://reviews.llvm.org/D96670 -
Roman Lebedev authored
I'm not really sure the problem can be nicely exposed via a lit test, since we don't give up on range calculation for deeply nested ranges, but if i add an assertion that those opcodes are never encountered, the assertion fails in a number of existing tests. In reality, the iterative approach is still pretty partial: 1. `Seen` should not be there. We want the last instance of expression, not the first one 2. There should be a check that `getRangeRefIter()` does not self-recurse
-
Roman Lebedev authored
And, this shows a bug in the original code: why do we not recurse into casts? If i add an assertion that those opcodes are never encountered, the assertion fails in a number of existing tests.
-
Roman Lebedev authored
`scPtrToInt` recieves same treatment as normal n-ary ops.
-
Roman Lebedev authored
-
Florian Hahn authored
This patch introduces DomTreeNodeTraits for customization. Clients can implement DomTreeNodeTraitsCustom to provide custom ParentPtr, getEntryNode and getParent. There's also a default specialization if DomTreeNodeTraitsCustom is not implemented, that assume a Function-like NodeT. This is what is used for the existing DominatorTree and MachineDominatorTree. The main motivation for this patch is using DominatorTreeBase across all regions of a VPlan, see D140513. Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D142162
-
Piotr Fusik authored
Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142007
-
Kazu Hirata authored
This patch makes the following replacements: countLeadingZeros -> llvm::countl_zero countTrailingZeros -> llvm::countr_zero countPopulation -> llvm::popcount
-
Simon Pilgrim authored
If the compiler supports __builtin_bit_cast we should try to use it instead of std::memcpy (and avoid including the cstring header). Differential Revision: https://reviews.llvm.org/D142305
-
Kazu Hirata authored
This patch adds C++23-style byteswap to bit.h. The implementation and tests are largely taken from llvm/include/llvm/Support/SwapByteOrder.h and llvm/unittests/Support/SwapByteOrderTest.cpp, respectively. Differential Revision: https://reviews.llvm.org/D142274
-
Sergei Barannikov authored
-
Simon Pilgrim authored
-