- Sep 15, 2022
-
-
Roland Froese authored
Get some load-store forwarding cases for big-endian where a larger store covers a smaller load, and the offset would be 0 and handled on little-endian but on big-endian the offset is adjusted to be non-zero. The idea is just to shift the data to make it look like the offset 0 case. Differential Revision: https://reviews.llvm.org/D130115
-
Fangrui Song authored
When .gnu.version_r is empty (allowed by readelf but warned by objdump), llvm-objdump -p may decode the next section as .gnu.version_r and may crash due to out-of-bounds C string reference. ELFFile<ELFT>::getVersionDependencies handles 0-entry .gnu.version_r gracefully. Just use it. Fix https://github.com/llvm/llvm-project/issues/57707 Differential Revision: https://reviews.llvm.org/D133751
-
Fangrui Song authored
-
Nico Weber authored
Differential Revision: https://reviews.llvm.org/D133110
-
Michael Buch authored
This is in preparation for adding more gmodules tests. Differential Revision: https://reviews.llvm.org/D133876
-
Tue Ly authored
Reduce the number of subintervals that need lookup table and optimize the evaluation steps. Currently, `exp2f` is computed by reducing to `2^hi * 2^mid * 2^lo` where `-16/32 <= mid <= 15/32` and `-1/64 <= lo <= 1/64`, and `2^lo` is then approximated by a degree 6 polynomial. Experiment with Sollya showed that by using a degree 6 polynomial, we can approximate `2^lo` for a bigger range with reasonable errors: ``` > P = fpminimax((2^x - 1)/x, 5, [|D...|], [-1/64, 1/64]); > dirtyinfnorm(2^x - 1 - x*P, [-1/64, 1/64]); 0x1.e18a1bc09114def49eb851655e2e5c4dd08075ac2p-63 > P = fpminimax((2^x - 1)/x, 5, [|D...|], [-1/32, 1/32]); > dirtyinfnorm(2^x - 1 - x*P, [-1/32, 1/32]); 0x1.05627b6ed48ca417fe53e3495f7df4baf84a05e2ap-56 ``` So we can optimize the implementation a bit with: # Reduce the range to `mid = i/16` for `i = 0..15` and `-1/32 <= lo <= 1/32` # Store the table `2^mid` in bits, and add `hi` directly to its exponent field to compute `2^hi * 2^mid` # Rearrange the order of evaluating the polynomial approximating `2^lo`. Performance benchmark using perf tool from the CORE-MATH project on Ryzen 1700: ``` $ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh exp2f GNU libc version: 2.35 GNU libc release: stable CORE-MATH reciprocal throughput : 9.534 System LIBC reciprocal throughput : 6.229 BEFORE: LIBC reciprocal throughput : 21.405 LIBC reciprocal throughput : 15.241 (with `-msse4.2` flag) LIBC reciprocal throughput : 11.111 (with `-mfma` flag) AFTER: LIBC reciprocal throughput : 18.617 LIBC reciprocal throughput : 12.852 (with `-msse4.2` flag) LIBC reciprocal throughput : 9.253 (with `-mfma` flag) $ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh exp2f --latency GNU libc version: 2.35 GNU libc release: stable CORE-MATH latency : 40.869 System LIBC latency : 30.580 BEFORE LIBC latency : 64.888 LIBC latency : 61.027 (with `-msse4.2` flag) LIBC latency : 48.778 (with `-mfma` flag) AFTER LIBC latency : 48.803 LIBC latency : 45.047 (with `-msse4.2` flag) LIBC latency : 37.487 (with `-mfma` flag) ``` Reviewed By: sivachandra, orex Differential Revision: https://reviews.llvm.org/D133870
-
Fangrui Song authored
Similar to D107799 but for *BSD (DragonFlyBSD, FreeBSD, NetBSD, OpenBSD, etc). This Linux default has been in main and release/15.x for a while. `CMAKE_SYSTEM_PROCESSOR MATCHES "^arm"` is excluded for now. Link: https://discourse.llvm.org/t/rfc-time-to-drop-legacy-runtime-paths/64628 Reviewed By: dim Differential Revision: https://reviews.llvm.org/D110126
-
Stanley Winata authored
Most computer vision torch models uses nchw/ncw convolution. In a previous patch we added decomposition conv2dNchw to conv1dNcw. To enhance the performance on torch models we add this vectorization pattern for conv1dNcw which would consquently also improve the performance on conv2dNchw. On IREE + Intel Xeon 8360 + Resnet50, we were able to get ~7x speed up ~880ms to 126ms. Reviewed By: nicolasvasilache, hanchung Differential Revision: https://reviews.llvm.org/D133675
-
Piotr Sobczak authored
The rest of the code section assumes there are exactly two elements in the vector (Lo, Hi), so add the check before entering the section. Differential Revision: https://reviews.llvm.org/D133852
-
Julius authored
When running in MSVC compatibility mode, previously no deprecated copy operation warnings (enabled by -Wdeprecated-copy) were raised. This restriction was already in place when the deprecated copy warning was first introduced. This patch removes said restriction so that deprecated copy warnings, if enabled, are also raised in MSVC compatibility mode. The reasoning here being that these warnings are still useful when running in MSVC compatibility mode and also have to be semi-explicitly enabled in the first place (using -Wdeprecated-copy, -Wdeprecated or -Wextra). Differential Revision: https://reviews.llvm.org/D133354
-
Florian Hahn authored
Keep track if variables are known positive during constraint decomposition, aggregate the information when building the constraint object and encode the extra information as constraints to be used during reasoning.
-
Thomas Raoux authored
Simplify the lowering of warp_execute_on_lane0 of scf.if by making the logic more generic. Also remove the assumption that the most inner dimension is the dimension distributed. Differential Revision: https://reviews.llvm.org/D133826
-
Matt Arsenault authored
Also skip dead defs when looking for a previous vreg with the same class. This helps avoid some mid-reduction verifier errors when LiveIntervals computation starts introducing dead flags everywhere.
-
Matt Arsenault authored
Avoids breaking this test in a future change.
-
Joseph Huber authored
Previous support for device memory allocators used a single free routine and did not provide the original kind of the allocation. This is problematic as some of these memory types required different handling. Previously this was worked around using a map in runtime to record the original kind of each pointer. Instead, this patch introduces new free routines similar to the existing allocation routines. This allows us to avoid a map traversal every time we free a device pointer. The only interfaces defined by the standard are `omp_target_alloc` and `omp_target_free`, these do not take a kind as `omp_alloc` does. The standard dictates the following: "The omp_target_alloc routine returns a device pointer that references the device address of a storage location of size bytes. The storage location is dynamically allocated in the device data environment of the device specified by device_num." Which suggests that these routines only allocate the default device memory for the kind. So this has been changed to reflect this. This change is somewhat breaking if users were using `omp_target_free` as previously shown in the tests. Reviewed By: JonChesterfield, tianshilei1992 Differential Revision: https://reviews.llvm.org/D133053
-
Nico Weber authored
This reverts commit 6bf6730a. Breaks tests if LLD isn't being built, see comments on https://reviews.llvm.org/D133092
-
revunov.denis@huawei.com authored
In non-pie binaries BOLT unconditionally converted type encoding from indirect to absptr, which broke std exceptions since pointers to their typeinfo were only assigned at runtime in .data section. In this patch we preserve original encoding so that indirect remains indirect and can be resolved at runtime, and absolute remains absolute. Reviewed By: rafauler, maksfb Differential Revision: https://reviews.llvm.org/D132484
-
Ashay Rane authored
A previous patch (https://reviews.llvm.org/D132810) introduced a test that fails on systems where the linker executable (`ld`) has a `.exe` extension. This patch updates the regex in the test so that lit can look for both `ld` as well as `ld.exe`. Reviewed By: stella.stamenova Differential Revision: https://reviews.llvm.org/D133773
-
Stella Stamenova authored
This reverts commit a0fb69d1. This broke the windows lldb bot: https://lab.llvm.org/buildbot/#/builders/83/builds/23666
-
Nico Weber authored
This reverts commit 44075cc3. Broke check-clang, see comments on https://reviews.llvm.org/D133841
-
Eman Copty authored
Adds the accessor methods for I[2|4|16] types to the Builder. Differential Revision: https://reviews.llvm.org/D133793
-
- Sep 14, 2022
-
-
Peiming Liu authored
Previously, the iteration graph is computed without priority. This patch add a heuristic when computing the iteration graph by starting with Reduction iterator when doing topo sort, which makes Reduction iterators (likely) appear as late in the sorted array as possible. The current sparse compiler also failed to compile the newly added case. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D133738
-
Nicolas Vasilache authored
Revert "[mlir][scf][Transform] Refactor transform.fuse_into_containing_op so it is iterative and supports output fusion." This reverts commit 54a5f606 which is a WIP that was pushed by mistake.
-
Nicolas Vasilache authored
[mlir][scf][Transform] Refactor transform.fuse_into_containing_op so it is iterative and supports output fusion. This revision revisits the implementation of `transform.fuse_into_containing_op` so that it iterates on producers one use at a time. Support is added to fuse a producer through a foreach_thread shared tensor argument, in which case we tile and fuse the op inside the containing op and update the shared tensor argument to the unique destination operand. If one cannot find such a unique destination operand the transform fails.
-
Nicolas Vasilache authored
This allows matching ops by additionally providing an idiomatic spec for a unique return type. Differential Revision: https://reviews.llvm.org/D133862
-
Alexey Bataev authored
dependence checking, NFC. Part of D110978
-
Jeff Niu authored
LibM implementations differ, so the folders can have different results on different platforms. For instance, the `cos` folder was failing on M1 mac. I chose to match the constant floats to 2(.5) significant digits. Reviewed By: jacquesguan Differential Revision: https://reviews.llvm.org/D133797
-
Groverkss authored
This patch adds hermite normal form computation to Matrix. Part of this algorithm lived in LinearTransform, being used for compuing column echelon form. This patch moves the implementation to Matrix::hermiteNormalForm and generalises it to compute the hermite normal form. Reviewed By: arjunp Differential Revision: https://reviews.llvm.org/D133510
-
Mats Petersson authored
Tests don't work on PPC since `return` instruciton is't called `ret` (apparently) Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D133859
-
Zain Jaffal authored
Handle the case where both operands are negated in matrix multiplication Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D133695
-
Haojian Wu authored
-
David Spickett authored
SLH will fall back to a different technique if X16 is being used, so there is no need to warn for inline asm use. Only prevent other codegen from using it. Reviewed By: kristof.beyls Differential Revision: https://reviews.llvm.org/D133766
-
Joseph Huber authored
Summary: A previous patch removed the user of this function but did not remove the function causing unused function warnings. Remove it.
-
John Ericson authored
A simple sed doing these substitutions: - `${LLVM_BINARY_DIR}/\$\{CMAKE_CFG_INTDIR}/lib(${LLVM_LIBDIR_SUFFIX})?\>` -> `${LLVM_LIBRARY_DIR}` - `${LLVM_BINARY_DIR}/\$\{CMAKE_CFG_INTDIR}/bin\>` -> `${LLVM_TOOLS_BINARY_DIR}` where `\>` means "word boundary". The only manual modifications were reverting changes in - `compiler-rt/cmake/Modules/CompilerRTUtils.cmake` because these were "entry points" where we wanted to tread carefully not not introduce a "loop" which would end with an undefined variable being expanded to nothing. There are many more occurrences without `CMAKE_CFG_INTDIR`, but those are left for D132316 as they have proved somewhat tricky to fix. This hopefully increases readability overall, and also decreases the usages of `LLVM_LIBDIR_SUFFIX`, preparing us for D130586. Reviewed By: sebastian-ne Differential Revision: https://reviews.llvm.org/D133828 -
Arjun P authored
Only the main Presburger library under the Presburger directory has been switched to use arbitrary precision. Users have been changed to just cast returned values back to int64_t or to use newly added convenience functions that perform the same cast internally. The performance impact of this has been tested by checking test runtimes after copy-pasting 100 copies of each function. Affine/simplify-structures.mlir goes from 0.76s to 0.80s after this patch. Its performance sees no regression compared to its original performance at commit 18a06d4f before a series of patches that I landed to offset the performance overhead of switching to arbitrary precision. Affine/canonicalize.mlir and SCF/canonicalize.mlir show no noticable difference, staying at 2.02s and about 2.35s respectively. Also, for Affine and SCF tests as a whole (no copy-pasting), the runtime remains about 0.09s on average before and after. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D129510
-
Balazs Benics authored
Downstream users who doesn't make use of the clang cc1 frontend for commandline argument parsing, won't benefit from the Marshalling provided default initialization of the AnalyzerOptions entries. More about this later. Those analyzer option fields, as they are bitfields, cannot be default initialized at the declaration (prior c++20), hence they are initialized at the constructor. The only problem is that `ShouldEmitErrorsOnInvalidConfigValue` was forgotten. In this patch I'm proposing to initialize that field with the rest. Note that this value is read by `CheckerRegistry.cpp:insertAndValidate()`. The analyzer options are initialized by the marshalling at `CompilerInvocation.cpp:GenerateAnalyzerArgs()` by the expansion of the `ANALYZER_OPTION_WITH_MARSHALLING` xmacro to the appropriate default value regardless of the constructor initialized list which I'm touching. Due to that this only affects users using CSA as a library, without serious effort, I believe we cannot test this. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D133851
-
Joseph Huber authored
Previously, we linked in the ROCm device libraries which provide math and other utility functions late. This is not stricly correct as this library contains several flags that are only set per-TU, such as fast math or denormalization. This patch changes this to pass the bitcode libraries per-TU using the same method we use for the CUDA libraries. This has the advantage that we correctly propagate attributes making this implementation more correct. Additionally, many annoying unused functions were not being fully removed during LTO. This lead to erroneous warning messages and remarks on unused functions. I am not sure if not finding these libraries should be a hard error. let me know if it should be demoted to a warning saying that some device utilities will not work without them. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D133726
-
Joseph Huber authored
The old device runtime had a "simplified" version that prevented many of the runtime features from being initialized. The old device runtime was deleted in LLVM 14 and is no longer in use. Selectively deactivating features is now done using specific flags rather than the old technique. This patch simply removes the extra logic required for handling the old simple runtime scheme. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D133802
-
Nikita Popov authored
Currently, FunctionModRefBehavior tracks whether the function reads or writes memory (ModRefInfo) and which locations it can access (argmem, inaccessiblemem and other). This patch changes it to track ModRef information per-location instead. To give two examples of why this is useful: * D117095 highlights a weakness of ModRef modelling in the presence of operand bundles. For a memcpy call with deopt operand bundle, we want to say that it can read any memory, but only write argument memory. This would allow them to be treated like any other calls. However, we currently can't express this and have to say that it can read or write any memory. * D127383 would ideally be modelled as a separate threadid location, where threadid Refs outside pre-split coroutines can be ignored (like other accesses to constant memory). The current representation does not allow modelling this precisely. The patch as implemented is intended to be NFC, but there are some obvious opportunities for improvements and simplification. To fully capitalize on this we would also want to change the way we represent memory attributes on functions, but that's a larger change, and I think it makes sense to separate out the FunctionModRefBehavior refactoring. Differential Revision: https://reviews.llvm.org/D130896
-
Florian Hahn authored
Instead of checking if any of the new indices has a non-zero coefficient before using the constraint, do this directly when constructing the constraint.
-