- May 24, 2022
-
-
Thomas Raoux authored
Add lowering for cases where the reduction dimension is fully unrolled. It is common to unroll the reduction dimension, therefore we would want to lower the contractions to an elementwise vector op in this case. Differential Revision: https://reviews.llvm.org/D126120
-
Simon Pilgrim authored
We were using the default getScalarizationOverhead expansion for extraction costs, which adds up all the individual element extraction costs. This is fine for 128-bit vectors, but for 256/512-bit vectors each element extraction also has to account for extracting the upper 128-bit subvector extraction before it can handle the element. For scalarization costs we only need to extract each demanded subvector once. Differential Revision: https://reviews.llvm.org/D125527
-
Ivan Kosarev authored
Reviewed By: dp Differential Revision: https://reviews.llvm.org/D126207
-
Nikita Popov authored
Bitcasts were stripped in one case, but not the other. Of course, this no longer really matters with opaque pointers, but as I went through the trouble of tracking this down, we may as well remove one typed vs opaque pointer optimization discrepancy.
-
Nikita Popov authored
-
Louis Dionne authored
-
Nikita Popov authored
Use IRBuilder so that the newly created freeze instructions automatically gets inserted back into the IC worklist. The changed worklist processing order leads to some cosmetic differences in tests. Fixes https://github.com/llvm/llvm-project/issues/55619.
-
Nikita Popov authored
-
Sam McCall authored
Error-tolerant bracket matching enables our error-tolerant parsing strategies. The implementation here is *not* yet error tolerant: this patch sets up the APIs and plumbing, and describes the planned approach. Differential Revision: https://reviews.llvm.org/D125911
-
Joseph Huber authored
We use the clang-linker-wrapper to perform device linking of embedded offloading object files. This is done by generating those jobs inside of the linker-wrapper itself. This patch adds an argument in Clang and the linker-wrapper that allows users to forward input to the device linking phase. This can either be done for every device linker, or for a specific target triple. We use the `-Xoffload-linker <arg>` and the `-Xoffload-linker-<triple> <arg>` syntax to accomplish this. Reviewed By: markdewing, tra Differential Revision: https://reviews.llvm.org/D126226
-
Alexey Bataev authored
To be used correctly in a sort-like function, isFirstInsertElement function must follow weak strict ordering rule, i.e. isFirstInsertElement(IE1, IE1) should return false.
-
Nabeel Omer authored
Currently, two element vectors produced as the result of a binary op are widened to four element vectors on x86 by DAGTypeLegalizer::WidenVecRes_BinaryCanTrap. If the op still isn't legal after widening it is unrolled into 4 scalar ops in SelectionDAG before being converted into a libcall. This way we end up with 4 libcalls (two of them on known undef elements) instead of the original two libcalls. This patch modifies DAGTypeLegalizer::WidenVectorResult to ensure that if it is known that a binary op will be tunred into a libcall, it is unrolled instead of being widened. This prevents the creation of the extra scalar instructions on known undef elements and (eventually) libacalls with known undef parameters which would otherwise be created when the op gets expanded post widening. Differential Revision: https://reviews.llvm.org/D125988
-
Sylvestre Ledru authored
It is breaking the build with: /build/llvm-toolchain-snapshot-15~++20220524114008+96323c9f/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp:478:10: fatal error: 'M68kGenMCCodeBeads.inc' file not found ^~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Remove the #include causes: error: undefined reference to 'llvm::M68k::getMCInstrBeads(unsigned int)' This reverts commit f50be3d2.
-
Ivan Kosarev authored
Caught with D125604. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D126191
-
Kristof Beyls authored
-
Simon Pilgrim authored
These were left over from when we converted to the update_llc_test_checks script and were just matching some asm/cfi directives - we have CHECK-LABEL to do this properly now.
-
Anastasia Stulova authored
For generic targets such as SPIR-V clang sets all OpenCL extensions/features as supported by default. However concrete targets are unlikely to support all extensions features, which creates a problem when such generic SPIR-V binary is compiled for a specific target later on. To allow compile time diagnostics for unsupported features this flag is now being exposed in the clang driver. Differential Revision: https://reviews.llvm.org/D125243
-
Max Kazantsev authored
-
Max Kazantsev authored
-
Luo, Yuanke authored
Differential Revision: https://reviews.llvm.org/D126280
-
Simon Pilgrim authored
Similar to D125988 (and I have a pending follow up patch to handle fpow).
-
Sheng authored
Code beads is useless since the only user, M68k, has moved on to a new encoding/decoding infrastructure.
-
Kito Cheng authored
This NFC patch is splited from D111617. Using llvm::ArrayRef rather than llvm::SmallVector, ArrayRef is more generic interface that could accept both llvm::ArrayRef and llvm::SmallVector. Reviewed By: reames Differential Revision: https://reviews.llvm.org/D125893
-
Nikita Popov authored
Most of the folds implemented in this function work fine with logical operations. We only need to be careful for the cases that work on non-constant masks, where the RHS operand shouldn't be poison. This is a conservative implementation that bails out of illegal transforms, but we could also change these to insert freeze instead.
-
Nikita Popov authored
-
Nikita Popov authored
This is mostly intended as code cleanup, but it does also add support for splat vectors to this fold.
-
Nikita Popov authored
(NFC)
-
LLVM GN Syncbot authored
-
Nikolas Klauser authored
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D125752
-
Laramie Leavitt authored
Abseil benchmarks suggest that the conditional checks result in faster code (4-5x) as they are compiled into conditional move instructions (cmov on x86). Reviewed By: #libc, philnik, Mordante Spies: pengfei, Mordante, philnik, libcxx-commits Differential Revision: https://reviews.llvm.org/D125329
-
Fraser Cormack authored
This was probably copy/pasted from the MSCATTER widening.
-
Aaron Jacobs authored
This fixes incorrect handling of non-moveable types, adding tests for this case. See [issue 55346](https://github.com/llvm/llvm-project/issues/55346). The current implementation is based on is_convertible, which is [defined](https://timsong-cpp.github.io/cppwp/n4659/meta.rel#5) in terms of validity of the following function: ``` To test() { return declval<From>(); } ``` But this doesn't work if To and From are both some non-moveable type, which the [definition](https://timsong-cpp.github.io/cppwp/n4659/conv#3) of implicit conversions says should work due to guaranteed copy elision: ``` To to = E; // E has type From ``` It is this latter definition that is used in the [definition](https://timsong-cpp.github.io/cppwp/n4659/function.objects#func.require-2) of INVOKE<R>. Make __invokable_r use __is_core_convertible, which captures the ability to use guaranteed copy elision, making the definition correct for non-moveable types. Fixes llvm/llvm-project#55346. Reviewed By: #libc, philnik, EricWF Spies: EricWF, jloser, ldionne, philnik, libcxx-commits Differential Revision: https://reviews.llvm.org/D125300
-
Nikita Popov authored
The and/or of icmps fold is also applied in reassociated form. However, this currently only happens for bitwise and of bitwise and, but not for bitwise and of logical and (or other combinations, but this is the one being addressed here). We can do this for bitwise+logical combinations as well, but need to be a bit careful about which of the resulting ands are logical: https://alive2.llvm.org/ce/z/WYSjGh https://alive2.llvm.org/ce/z/guxYnz https://alive2.llvm.org/ce/z/S5SYxY https://alive2.llvm.org/ce/z/2rAWeW
-
Nikita Popov authored
Use an and/or of icmp pattern that produces different code depending on whether it is part of a logical or bitwise and/or.
-
Markus Lavin authored
When the single branch target of a block has been removed try updating it to target a block that is kept (by scanning forward in the sequence) instead of replacing the branch with a return instruction. Doing so reduces the risk of breaking loop structures meaning that when the loop is 'interesting' these reductions should have more blocks eliminated. Differential Revision: https://reviews.llvm.org/D125766
-
Nikita Popov authored
This is a followup to D125754. We introduce two branches, one before the unrolled loop and one before the epilogue (and similar for the prologue case). The previous patch only froze the condition on the first branch. Rather than independently freezing the second condition, this patch instead freezes TripCount and bases BECount on it. These are the two quantities involved in the conditions, and this ensures that both work on a consistent, non-poisonous trip count. Differential Revision: https://reviews.llvm.org/D125896
-
Lian Wang authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D126276
-
Fraser Cormack authored
This patch fixes another bug in the RVV frame lowering. While some frame objects with non-default stack IDs (such scalable-vector alloca instructions) are considered in the target-independent max alignment calculations, others (for example, during calling-convention lowering) are not. This means we'd occasionally align the base of the stack to only 16 bytes, with no way to ensure that the RVV section contained within that is aligned to anything higher. Reviewed By: StephenFan Differential Revision: https://reviews.llvm.org/D125973
-
Fraser Cormack authored
This patch addresses several alignment issues in the stack frame when RVV objects are taken into account. One bug is that the RVV stack was never guaranteed to keep the alignment of the stack *as a whole*. We must maintain a 16-byte aligned stack at all times, especially when calling other functions. With the standard V extension, this is conveniently happening since VLEN is at least 128 and always 16-byte aligned. However, we support Zvl64b which does not guarantee this. To fix this, the RVV stack size is rounded up to be aligned to 16 bytes. This in practice generally makes us allocate a stack sized at least 2*VLEN in size, and a multiple of 2. |------------------------------| -- <-- FP | 8-byte callee-save | | | |------------------------------| | | | one VLENB-sized RVV object | | | |------------------------------| | | | 8-byte local variable | | | |------------------------------| -- <-- SP (must be aligned to 16) In the example above, with Zvl64b we are decrementing SP by 12 bytes which does not leave SP correctly aligned. We therefore introduce an extra VLENB-sized amount used for alignment. This would therefore ensure the total stack size was 16 bytes (48 for Zvl128b, 80 for Zvl256b, etc): |------------------------------| -- <-- FP | 8-byte callee-save | | | |------------------------------| | | | one VLENB-sized padding obj | | | | one VLENB-sized RVV object | | | |------------------------------| | | | 8-byte local variable | | | |------------------------------| -- <-- SP A new RVV invariant has been introduced in this patch, which is that the base of the RVV stack itself is now always aligned to 16 bytes, not 8 as before. This keeps us more in line with the scalar stack and should be easier to reason about. The calculation of the RVV padding has thus changed to be the amount required to align the scalar local variable section to the RVV section's alignment. This amount is further rounded up when setting up the initial stack to keep everything aligned: |------------------------------| -- <-- FP | 8-byte callee-save | |------------------------------| | | | RVV objects | | (aligned to at least 16) | | | |------------------------------| | RVV padding of 8 bytes | |------------------------------| | 8-byte local variable | |------------------------------| -- <-- SP In the example above, it's clear that we need 8 bytes of padding to keep the RVV section aligned to 16 when using SP. But to keep SP *itself* aligned to 16 we can't decrement the initial stack pointer by 24 - we have to round up to 32. With the RVV section correctly aligned, the second bug fixed by this patch is that RVV objects themselves are now correctly aligned. We were previously only guaranteeing an alignment of 8 bytes, even if they required a higher alignment. This is relatively simple and in practice we see more rounding up of VLEN amounts to account for alignment in between objects: |------------------------------| | RVV object (aligned to 16) | |------------------------------| | no padding necessary | |------------------------------| | 2*VLENB RVV object (align 16)| |------------------------------| | VLENB alignment padding | |------------------------------| | RVV object (align 32) | |------------------------------| | 3*VLENB alignment padding | |------------------------------| | VLENB RVV object (align 32) | |------------------------------| -- <-- base of RVV section Note that a lot of the regressions in codegen owing to the new alignment rules are correct but actually only strictly necessary for Zvl64b (and Zvl32b but that's not really supported). I plan a follow-up patch to take the known VLEN into account when padding for alignment. Reviewed By: StephenFan Differential Revision: https://reviews.llvm.org/D125787 -
LLVM GN Syncbot authored
-