- Dec 10, 2021
-
-
Benjamin Kramer authored
-
Petr Hosek authored
This reverts commit e5c2a46c as this change introduced a linker error when building sanitizer runtimes: ld.lld: error: undefined symbol: __sanitizer::internal_start_thread(void* (*)(void*), void*) >>> referenced by sanitizer_stackdepot.cpp:133 (compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp:133) >>> compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_stackdepot.cpp.obj:(__sanitizer::(anonymous namespace)::CompressThread::NewWorkNotify())
-
Philip Reames authored
This change allows us to estimate trip count from profile metadata for all multiple exit loops. We still do the estimate only from the latch, but that's fine as it causes us to over estimate the trip count at worst. Reviewing the uses of the API, all but one are cases where we restrict a loop transformation (unroll, and vectorize respectively) when we know the trip count is short enough. So, as a result, the change makes these passes strictly less aggressive. The test change illustrates a case where we'd previously have runtime unrolled a loop which ran fewer iterations than the unroll factor. This is definitely unprofitable. The one case where an upper bound on estimate trip count could drive a more aggressive transform is peeling, and I duplicated the logic being removed from the generic estimation there to keep it the same. The resulting heuristic makes no sense and should probably be immediately removed, but we can do that in a separate change. This was noticed when analyzing regressions on D113939. I plan to come back and incorporate estimated trip counts from other exits, but that's a minor improvement which can follow separately. Differential Revision: https://reviews.llvm.org/D115362
-
Stanislav Mekhanoshin authored
Transform ``` (~a & b & c) | ~(a | b | c) -> ~(a | (b ^ c)) ``` And swapped case: ``` (~a | b | c) & ~(a & b & c) -> ~a | (b ^ c) ``` ``` ---------------------------------------- define i4 @src(i4 %a, i4 %b, i4 %c) { %0: %or1 = or i4 %b, %a %or2 = or i4 %or1, %c %not1 = xor i4 %or2, 15 %not2 = xor i4 %a, 15 %and1 = and i4 %b, %not2 %and2 = and i4 %and1, %c %or3 = or i4 %and2, %not1 ret i4 %or3 } => define i4 @tgt(i4 %a, i4 %b, i4 %c) { %0: %1 = xor i4 %c, %b %2 = or i4 %1, %a %or3 = xor i4 %2, 15 ret i4 %or3 } Transformation seems to be correct! ``` ``` ---------------------------------------- define i4 @src(i4 %a, i4 %b, i4 %c) { %0: %and1 = and i4 %b, %a %and2 = and i4 %and1, %c %not1 = xor i4 %and2, 15 %not2 = xor i4 %a, 15 %or1 = or i4 %not2, %b %or2 = or i4 %or1, %c %and3 = and i4 %or2, %not1 ret i4 %and3 } => define i4 @tgt(i4 %a, i4 %b, i4 %c) { %0: %xor = xor i4 %b, %c %not = xor i4 %a, 15 %or = or i4 %xor, %not ret i4 %or } Transformation seems to be correct! ``` Differential Revision: https://reviews.llvm.org/D112966 -
CJ Johnson authored
This change applies two fixes to the abseil-cleanup-ctad check. It uses hasSingleDecl() to ensure only declStmt()s with one varDecl() are matched (leaving compount declStmt()s unchanged). It also addresses a bug in the handling of comments that surround the absl::MakeCleanup() calls by switching to the callArgs() combinator from Clang Transformer. Reviewed By: ymandel Differential Revision: https://reviews.llvm.org/D115452
-
Kazu Hirata authored
-
MaheshRavishankar authored
This patterns tries to convert an inner (outer) dim reduction to an outer (inner) dim reduction. Doing this on a 1D or 0D vector results in an infinite loop since the converted op is same as the original operation. Just returning failure when source rank <= 1 fixes the issue. Differential Revision: https://reviews.llvm.org/D115426
-
Valentin Clement authored
Some of the function name in the comment didn't match their actual name in the runtime. This patch fixes that. Reviewed By: schweitz Differential Revision: https://reviews.llvm.org/D115076
-
Jonas Devlieghere authored
This reverts commit 5a33e412 becuase it breaks LLDB. https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/39208/
-
Craig Topper authored
D113805 improved handling of i32 divu/remu on RV64. The basic idea from that can be extended to (mul (and X, C2), C1) where C2 is any mask constant. We can replace the and with an SLLI by shifting by the number of leading zeros in C2 if we also shift C1 left by XLen - lzcnt(C1) bits. This will give the full product XLen additional trailing zeros, putting the result in the output of MULHU. If we can't use ANDI, ZEXT.H, or ZEXT.W, this will avoid materializing C2 in a register. The downside is it make take 1 additional instruction to create C1. But since that's not on the critical path, it can hopefully be interleaved with other operations. The previous tablegen pattern is replaced by custom isel code. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D115310
-
Jon Chesterfield authored
-
Haojian Wu authored
lldb.cpp is unused after https://github.com/llvm/llvm-project/commit/ccf1469a4cdb03cb2bc7868f76164e85d90ebee1 Differential Revision: https://reviews.llvm.org/D115438
-
Arthur Eubanks authored
Reviewed By: gchatelet Differential Revision: https://reviews.llvm.org/D115370
-
Craig Topper authored
-Remove feq, fle, flt tests from *-arith.ll in favor of *-fcmp.ll which tests all predicates. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D113703
-
Bixia Zheng authored
The sparse tensor code generator allocates memory for the output tensor. As such, we only need to allocate a MemRefDescriptor to receive the output tensor and do not need to allocate and initialize the storage for the tensor. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D115292
-
Shraiysh Vaishay authored
This patch adds the documentation for the operations `omp.atomic.read`, `omp.atomic.write` and `omp.atomic.update`. Reviewed By: peixin Differential Revision: https://reviews.llvm.org/D115445
-
David Sherwood authored
This patch adds on an overhead cost for gathers and scatters, which is a rough estimate based on performance investigations I have performed on SVE hardware for various micro-benchmarks. Differential Revision: https://reviews.llvm.org/D115143
-
- Dec 09, 2021
-
-
Krzysztof Drewniak authored
- Define a gpu.printf op, which can be lowered to any GPU printf() support (which is present in CUDA, HIP, and OpenCL). This op only supports constant format strings and scalar arguments - Define the lowering of gpu.pirntf to a call to printf() (which is what is required for AMD GPUs when using OpenCL) as well as to the hostcall interface present in the AMD Open Compute device library, which is the interface present when kernels are running under HIP. - Add a "runtime" enum that allows specifying which of the possible runtimes a ROCDL kernel will be executed under or that the runtime is unknown. This enum controls how gpu.printf is lowered This change does not enable lowering for Nvidia GPUs, but such a lowering should be possible in principle. And: [MLIR][AMDGPU] Always set amdgpu-implicitarg-num-bytes=56 on kernels This is something that Clang always sets on both OpenCL and HIP kernels, and failing to include it causes mysterious crashes with printf() support. In addition, revert the max-flat-work-group-size to (1, 256) to avoid triggering bugs in the AMDGPU backend. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D110448
-
David Sherwood authored
I've added some tests that were previously missing for the gather-scatter costs being calculated by the vectorizer for AArch64: Transforms/LoopVectorize/AArch64/sve-gather-scatter-cost.ll The costs are sometimes different to the ones in Analysis/CostModel/AArch64/sve-gather.ll because the vectorizer also adds on the address computation cost.
-
Brian Cain authored
This reverts commit 543a9ad7.
-
Eugene Zhulenev authored
Depends On D115263 By aligning block size to inner loop iterations parallel_compute_fn LLVM can later unroll and vectorize some of the inner loops with small number of trip counts. Up to 2x speedup in multiple benchmarks. Reviewed By: bkramer Differential Revision: https://reviews.llvm.org/D115436
-
Eugene Zhulenev authored
With complex recursive structure of async dispatch function LLVM can't always propagate constants to the parallel_compute_fn and it often prevents optimizations like loop unrolling and vectorization. We help LLVM by pushing known constants into the parallel_compute_fn explicitly. Reviewed By: bkramer Differential Revision: https://reviews.llvm.org/D115263
-
Amy Kwan authored
This patch adds allows the LIT runs within test-release.sh to obey the width that is passed into the script. This is accomplished by adding the width in the LLVM_LIT_ARGS CMake configuration. Differential Revision: https://reviews.llvm.org/D115350
-
Nikita Popov authored
This just returns None nowadays, so this comment doesn't apply anymore.
-
Nikita Popov authored
-
Jake Egan authored
The following tests are failing due to missing DWARF sections: `DwarfAccelNamesSection` and `DwarfAddrSection`. This patch sets these tests as `XFAIL` until the sections can be implemented for AIX. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D114681
-
Brian Cain authored
Adds x-ray support for hexagon to llvm codegen, clang driver, compiler-rt libs. Differential Revision: https://reviews.llvm.org/D113638
-
Ties Stuij authored
When using -mbranch-protection=pac-ret+b-key, macro __ARM_FEATURE_PAC_DEFAULT should still have the value corresponding to a-key, because b-key is only valid for AArch64. This patch is part of a series that adds support for the PACBTI-M extension of the Armv8.1-M architecture, as detailed here: https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension The PACBTI-M specification can be found in the Armv8-M Architecture Reference Manual: https://developer.arm.com/documentation/ddi0553/latest The following people contributed to this patch: - Victor Campos Reviewed By: danielkiss Differential Revision: https://reviews.llvm.org/D115140
-
Matthias Springer authored
LinalgOp results usually bufferize inplace with output args. With this change, they may buffer inplace with input args if the value of the output arg is not used in the computation. Differential Revision: https://reviews.llvm.org/D115022
-
lh123 authored
Desugar array type. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D115107
-
Dmitry Makogon authored
This patch adds 4 options for specifying functions, aliases, globals and structs name prefixes hat don't need to be renamed by MetaRenamer pass. This is useful if one has some downstream logic that depends directly on an entity name. MetaRenamer can break this logic, but with the patch you can tell it not to rename certain names. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D115323
-
https://reviews.llvm.org/D114627Lasse Folger authored
Reviewed By: werat Differential Revision: https://reviews.llvm.org/D115110
-
Groverkss authored
This patch factors out math functionality that is a subset of Presburger arithmetic and moves it from FlatAffineConstraints to Presburger/IntegerPolyhedron. This patch only moves some parts of the functionality planned to be moved, with subsequent patches moving more functionality. There are three main reasons for this: 1. This split makes the Presburger Library easier and more flexible to use across MLIR, by not depending on IR. 2. This split allows the Presburger library to be developed independently from Affine Analysis, with Affine Analysis using this library. 3. With more functionality being upstreamed to the Presburger Library, the mlir/Analysis directory will be cluttered with Presburger library components since they depend on math functionality from FlatAffineConstraints. Moving this functionality to the Presburger directory allows keeping the new functionality in the Presburger directory. This patch is part of an ongoing effort to make the Presburger Library easier to use. The motivation for this effort is the feedback received at the LLVM conference from Mehdi and others. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D114674 -
Martin Storsjö authored
Revert "Reapply [runtimes] Fix building initial libunwind+libcxxabi+libcxx with compiler implied -lunwind" This reverts commit 317dc31e. After that change, OpenMP doesn't find dependencies in the host system (it fails do find e.g. /usr/lib/x86_64-linux-gnu/libelf.so which it found before), which causes some OpenMP target offloading plugins to not be found. This doesn't break the build, but just causes the AMDGPU OpenMP target plugin to be omitted. See https://reviews.llvm.org/D113253#3181934 for the report of this issue.
-
Florian Hahn authored
Make sure various accessors do not modify any state, in preparation for D115111.
-
Ties Stuij authored
If the extension string "+pacbti" was given in -march=... or -mcpu=... options the compiler shall define the following preprocessor macros: __ARM_FEATURE_PAUTH with value 1. __ARM_FEATURE_BTI with value 1. This patch is part of a series that adds support for the PACBTI-M extension of the Armv8.1-M architecture, as detailed here: https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension The PACBTI-M specification can be found in the Armv8-M Architecture Reference Manual: https://developer.arm.com/documentation/ddi0553/latest The following people contributed to this patch: - Momchil Velikov - Ties Stuij Reviewed By: miyuki Differential Revision: https://reviews.llvm.org/D112431 -
mydeveloperday authored
https://bugs.llvm.org/show_bug.cgi?id=48916 Left and Right Alignment inside a loop is misaligned. Reviewed By: HazardyKnusperkeks, curdeius Differential Revision: https://reviews.llvm.org/D115050
-
Jan Svoboda authored
This patch avoids unnecessarily copying contents of `mmap`-ed files into `CachedFileSystemEntry` by storing `MemoryBuffer` instead. The change leads to ~50% reduction of peak memory footprint when scanning LLVM+Clang via `clang-scan-deps`. Depends on D115331. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D115043
-
Jan Svoboda authored
Most of `MemoryBuffer` interfaces expose a `RequiresNullTerminator` parameter that's being used to: * determine how to open a file (`mmap` vs `open`), * assert newly initialized buffer indeed has an implicit null terminator. This patch adds the paramater to the `SmallVectorMemoryBuffer` constructors, meaning: * null terminator can now be added to `SmallVector`s that didn't have one before, * `SmallVectors` that had a null terminator before keep it even after the move. In line with existing code, the new parameter is defaulted to `true`. This patch makes sure all calls to the `SmallVectorMemoryBuffer` constructor set it to `false` to preserve the current semantics. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D115331
-
Jan Svoboda authored
-