- Jun 29, 2023
-
-
Hideto Ueno authored
Follow-up to D154015
-
Hideto Ueno authored
This fixes a bug that `OperationEquivalence::computeHash` doesn't combine hash of operation locations even when `IgnoreLocations` is false. Added a unit test which fails at the current trunk. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D154015
-
Kai Sasaki authored
Memref normalization fails to recognize the non-zero symbols used in the memref type itself with strided, offset information. It causes the crash with the type like `memref<128x512xf32, strided<[?, ?], offset: ?>>`. The original issue is here. https://github.com/llvm/llvm-project/issues/61345 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D150250
-
Amir Ayupov authored
Reviewed By: #bolt, rafauler Differential Revision: https://reviews.llvm.org/D153994
-
Amir Ayupov authored
Reviewed By: #bolt, rafauler Differential Revision: https://reviews.llvm.org/D153987
-
Amir Ayupov authored
Add an extra point of dumping functions: immediately after attaching the profile information. This dumping is enabled by newly introduced `-print-profile` and `-print-all`. The reason is that in `aggregate-only`/perf2bolt mode BOLT may not reach the point of printing the function after CFG is constructed (`-print-cfg`), while we may still want to inspect the attached profile, especially for diff'ing purposes. Reviewed By: #bolt, rafauler Differential Revision: https://reviews.llvm.org/D153996
-
Tue Ly authored
-
Christopher Ferris authored
When I moved the primary to use the faster get time syscall, I missed the secondary use. Now fix the secondary to use this function too. Reviewed By: Chia-hungDuan Differential Revision: https://reviews.llvm.org/D154012
-
Florian Hahn authored
Extra tests for D152730
-
varconst authored
Replace most uses of `_LIBCPP_ASSERT` with `_LIBCPP_ASSERT_UNCATEGORIZED`. This is done as a prerequisite to introducing hardened mode to libc++. The idea is to make enabling assertions an opt-in with (somewhat) fine-grained controls over which categories of assertions are enabled. The vast majority of assertions are currently uncategorized; the new macro will allow turning on `_LIBCPP_ASSERT` (the underlying mechanism for all kinds of assertions) without enabling all the uncategorized assertions (in the future; this patch preserves the current behavior). Differential Revision: https://reviews.llvm.org/D153816
-
Luke Lau authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D153350
-
Luke Lau authored
These cases could have the vmv.v.v folded into the VL of the previous instruction. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D153030
-
Luke Lau authored
If we have a store of a load with no other uses in between it, it's considered dead and is removed. So sometimes when legalizing a fixed length vector store of an insert, we end up producing better code through scalarization than without. An example is the follow below: %a = load <4 x i64>, ptr %x %b = insertelement <4 x i64> %a, i64 %y, i32 2 store <4 x i64> %b, ptr %x If this is scalarized, then DAGCombine successfully removes 3 of the 4 stores which are considered dead, and on RISC-V we get: sd a1, 16(a0) However if we make the vector type legal (-mattr=+v), then we lose the optimisation because we don't scalarize it. This patch attempts to recover the optimisation for vectors by identifying patterns where we store a load with a single insert inbetween, replacing it with a scalar store of the inserted element. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D152276
-
Luke Lau authored
So we can still test insert_vector_elt lowering with D152276 Reviewed By: frasercrmck, craig.topper Differential Revision: https://reviews.llvm.org/D153964
-
LLVM GN Syncbot authored
-
Paul Kirth authored
Fat LTO objects contain both LTO compatible IR, as well as generated object code. This allows users to defer the choice of whether to use LTO or not to link-time. This is a feature available in GCC for some time, and makes the existing -ffat-lto-objects flag functional in the same way as GCC's. Within LLVM, we add a new EmbedBitcodePass that serializes the module to the object file, and expose a new pass pipeline for compiling fat objects. The new pipeline initially clones the module and runs the selected (Thin)LTOPrelink pipeline, after which it will serialize the module into a `.llvm.lto` section of an ELF file. When compiling for (Thin)LTO, this normally the point at which the compiler would emit a object file containing the bitcode and metadata. After that point we compile the original module using the PerModuleDefaultPipeline used for non-LTO compilation. We generate standard object files at the end of this pipeline, which contain machine code and the new `.llvm.lto` section containing bitcode. Since the two pipelines operate on different copies of the module, we can be sure that the bitcode in the `.llvm.lto` section and object code in `.text` are congruent with the existing output produced by the default and LTO pipelines. Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977 Earlier versions of this patch were missing REQUIRES lines for llc related tests in Transforms/EmbedBitcode. Those tests are now under CodeGen/X86, which should avoid running the check on unsupported platforms. The EmbedbBitcodePass also returned PreservedAnalyses::all when adding a metadata section, which failed expensive checks, since it modified the module. This is now corrected. Reviewed By: tejohnson, MaskRay, nikic Differential Revision: https://reviews.llvm.org/D146776
-
Peiming Liu authored
Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D153998
-
Fangrui Song authored
clang -ffat-lto-objects can use this new ELF section type for the .llvm.lto section for fat LTO support (D146776). Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977 Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D153215
-
Matt Arsenault authored
-
Alexey Bataev authored
If the buildvector node is a full match of another node, need to correctly build the mask for the original vector value and build common mask for the emitted node.
-
Wenlei He authored
Exposing a non-const accessor for clearing CallsiteSamples during flattening is a big of an overkill. Replace the non-const accessor with removeAllCallsiteSamples. Differential Revision: https://reviews.llvm.org/D153995
-
Nikolas Klauser authored
Fixes #63192 Reviewed By: cor3ntin Spies: cfe-commits Differential Revision: https://reviews.llvm.org/D153890
-
Ethan Luis McDonough authored
Flang currently supports offloading for AMD GPUs. This patch establishes a test structure for Fortran offloading tests in libomptarget. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D148778
-
Florian Hahn authored
Extra tests for D152730 with different GEP step sizes and the end pointer being an argument.
-
David Green authored
Similar to the other code that costs main/alt instructions, the cmp should be using the VecTy for the costs, not the ScalarTy. One of the tests look like it gets worse just because it is not simplified to 0. Differential Revision: https://reviews.llvm.org/D153507
-
Serge Pavlov authored
This reverts commit 98390ccb. It caused issue #63542.
-
Matt Arsenault authored
-
Matt Arsenault authored
-
root authored
Currently, bf16 has been scatteredly added to the PTX codegen. This patch aims to complete the set of instructions and code path required to support bf16 data type. Reviewed By: tra Differential Revision: https://reviews.llvm.org/D144911 Co-authored-by:
Artem Belevich <tra@google.com>
-
Matt Arsenault authored
-
Matt Arsenault authored
Add an intrinsic which returns the two pieces as multiple return values. Alternatively could introduce a pair of intrinsics to separately return the fractional and exponent parts. AMDGPU has native instructions to return the two halves, but could use some generic legalization and optimization handling. For example, we should be able to handle legalization of f16 on older targets, and for bf16. Additionally antique targets need a hardware workaround which would be better handled in the backend rather than in library code where it is now.
-
Caroline Tice authored
In two calls to ReadMemory in DWARFExpression.cpp, the buffer size passed to ReadMemory is not actually the size of the buffer (I suspect a copy/paste error where the variable name was not properly updated). This caused a buffer overflow bug, which we found throuth Address Sanitizer. This patch fixes the problem by passing the correct buffer size to the calls to ReadMemory (and to the DataExtractor). Differential Revision: https://reviews.llvm.org/D153840
-
Nikolas Klauser authored
-
Tue Ly authored
Implement correctly rounded `erff` functions. For `x >= 4`, `erff(x) = 1` for `FE_TONEAREST` or `FE_UPWARD`, `0x1.ffffep-1` for `FE_DOWNWARD` or `FE_TOWARDZERO`. For `0 <= x < 4`, we divide into 32 sub-intervals of length `1/8`, and use a degree-15 odd polynomial to approximate `erff(x)` in each sub-interval: ``` erff(x) ~ x * (c0 + c1 * x^2 + c2 * x^4 + ... + c7 * x^14). ``` For `x < 0`, we can use the same formula as above, since the odd part is factored out. Performance tested with `perf.sh` tool from the CORE-MATH project on AMD Ryzen 9 5900X: Reciprocal throughput (clock cycles / op) ``` $ ./perf.sh erff --path2 GNU libc version: 2.35 GNU libc release: stable -- CORE-MATH reciprocal throughput -- with -march=native (with FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 11.790 + 0.182 clc/call; Median-Min = 0.154 clc/call; Max = 12.255 clc/call; -- CORE-MATH reciprocal throughput -- with -march=x86-64-v2 (without FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 14.205 + 0.151 clc/call; Median-Min = 0.159 clc/call; Max = 15.893 clc/call; -- System LIBC reciprocal throughput -- [####################] 100 % Ntrial = 20 ; Min = 45.519 + 0.445 clc/call; Median-Min = 0.552 clc/call; Max = 46.345 clc/call; -- LIBC reciprocal throughput -- with -mavx2 -mfma (with FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 9.595 + 0.214 clc/call; Median-Min = 0.220 clc/call; Max = 9.887 clc/call; -- LIBC reciprocal throughput -- with -msse4.2 (without FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 10.223 + 0.190 clc/call; Median-Min = 0.222 clc/call; Max = 10.474 clc/call; ``` and latency (clock cycles / op): ``` $ ./perf.sh erff --path2 GNU libc version: 2.35 GNU libc release: stable -- CORE-MATH latency -- with -march=native (with FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 38.566 + 0.391 clc/call; Median-Min = 0.503 clc/call; Max = 39.170 clc/call; -- CORE-MATH latency -- with -march=x86-64-v2 (without FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 43.223 + 0.667 clc/call; Median-Min = 0.680 clc/call; Max = 43.913 clc/call; -- System LIBC latency -- [####################] 100 % Ntrial = 20 ; Min = 111.613 + 1.267 clc/call; Median-Min = 1.696 clc/call; Max = 113.444 clc/call; -- LIBC latency -- with -mavx2 -mfma (with FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 40.138 + 0.410 clc/call; Median-Min = 0.536 clc/call; Max = 40.729 clc/call; -- LIBC latency -- with -msse4.2 (without FMA instructions) [####################] 100 % Ntrial = 20 ; Min = 44.858 + 0.872 clc/call; Median-Min = 0.814 clc/call; Max = 46.019 clc/call; ``` Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D153683
-
Daniel Thornburgh authored
The symbolizer markup syntax is structured such that fields require only previous fields for their interpretation; this was originally intended to make adding new fields a natural extension mechanism for existing elements. This codifies this into the spec and makes the behavior of the llvm-symbolizer match. Extra fields are now warned about, but ignored, rather than ignoring the whole element. Reviewed By: mcgrathr Differential Revision: https://reviews.llvm.org/D153821
-
Jon Roelofs authored
In https://reviews.llvm.org/D149445, it was lowered from 32 to 16bits, which broke an internal project of ours. The relevant code being compiled is a fairly large nested switch that results in a PHI node with 65k+ operands, which can't easily be turned into a table for perf reasons. This change unifies `NumOperands`, `Flags`, and `AsmPrinterFlags` into a packed 7-byte struct, which `CapOperands` can follow as the 8th byte, rounding it up to a nice alignment before the `Info` field. rdar://111217742&109362033 Differential revision: https://reviews.llvm.org/D153791
-
Matt Arsenault authored
Move it up with other module passes. It's a higher level optimization that should probably be done before hacking up the IR for codegen. It should really be done earlier than this. We could possibly move this with other IPO passes, but we'd have to stop inferring the lack of lds.kernel.id calls and have the LDS module pass mark functions which don't need the ID. The one test change is because that pass is relying on the backend run of SROA (which we ideally wouldn't have).
-
Philip Reames authored
-
Snehasish Kumar authored
Add an overload for InstrProfWriter::write so that users can emit the buffer to a string. Also use this new overload for existing unit test usecases. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D153904
-
David Green authored
See D153507. The existing test is over-simplified, as written it should have been simpified prior to SLP vectorization. I have left it as-is to ensure the crash it was protecting against doesn't arise again. A new test with valid inputs is also added to show the incorrect costs of alt cmp vectorization.
-