- Feb 20, 2023
-
-
Zain Jaffal authored
[ConstraintElimination] Add tests to check for `or` instruction decomposition if a constant operand is < 2^known_zero_bits of the first operand. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D142545
-
Dmitry Vyukov authored
There are some programs that try to handle all malloc failures. Let's allow testing of such programs. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D144374
-
NAKAMURA Takumi authored
Anonymous namespace should be applied only to class definitions.
-
Alexey Bataev authored
If the scalar must be extracted and then used in the gather node, instead we can emit shuffle instruction to avoid those extra extractelements and vector-to-scalar and back data movement. Part of D110978 Differential Revision: https://reviews.llvm.org/D141940
-
David Green authored
The AArch64 backend will use legal BUILDVECTORs for zero vectors or all-ones vectors, so during selection tablegen patterns get rely on immAllZerosV and immAllOnesV pattern frags in patterns like vnot. It was not always consistent though, which this patch attempt to fix by recognizing where constant splat + insert vector element is used. The main outcome of this will be that full vector movi v0.2d, #0000000000000000 will be used as opposed to movi d0, #0, as per https://reviews.llvm.org/D53579. This helps simplify what tablegen will see, to make pattern matching simpler. Differential Revision: https://reviews.llvm.org/D144018
-
Florian Hahn authored
Suggested by @Ayal as follow-up improvement in D143864. I was unable to find a case where this actually changes generated code, but it is a unifying code to use common infrastructure.
-
Kerry McLaughlin authored
Adds intrinsics for the following SME2 instructions (2 & 4 vectors): - smlall - smlsll - umlall - umlsll - usmlall NOTE: These intrinsics are still in development and are subject to future changes. Reviewed By: david-arm Differential Revision: https://reviews.llvm.org/D143277
-
Aaron Ballman authored
This fixes the issue found by: https://lab.llvm.org/buildbot/#/builders/30/builds/32127
-
Caroline Concatto authored
This patch adds 2 new intrinsics: ; Interleave two vectors into a wider vector <vscale x 4 x i64> @llvm.vector.interleave2.nxv2i64(<vscale x 2 x i64> %even, <vscale x 2 x i64> %odd) ; Deinterleave the odd and even lanes from a wider vector {<vscale x 2 x i64>, <vscale x 2 x i64>} @llvm.vector.deinterleave2.nxv2i64(<vscale x 4 x i64> %vec) The main motivator for adding these intrinsics is to support vectorization of complex types using scalable vectors. The intrinsics are kept simple by only supporting a stride of 2, which makes them easy to lower and type-legalize. A stride of 2 is sufficient to handle complex types which only have a real/imaginary component. The format of the intrinsics matches how `shufflevector` is used in LoopVectorize. For example: using cf = std::complex<float>; void foo(cf * dst, int N) { for (int i=0; i<N; ++i) dst[i] += cf(1.f, 2.f); } For this loop, LoopVectorize: (1) Loads a wide vector (e.g. <8 x float>) (2) Extracts odd lanes using shufflevector (leading to <4 x float>) (3) Extracts even lanes using shufflevector (leading to <4 x float>) (4) Performs the addition (5) Interleaves the two <4 x float> vectors into a single <8 x float> using shufflevector (6) Stores the wide vector. In this example, we can 1-1 replace shufflevector in (2) and (3) with the deinterleave intrinsic, and replace the shufflevector in (5) with the interleave intrinsic. The SelectionDAG nodes might be extended to support higher strides (3, 4, etc) as well in the future. Similar to what was done for vector.splice and vector.reverse, the intrinsic is lowered to a shufflevector when the type is fixed width, so to benefit from existing code that was written to recognize/optimize shufflevector patterns. Note that this approach does not prevent us from adding new intrinsics for other strides, or adding a more generic shuffle intrinsic in the future. It just solves the immediate problem of being able to vectorize loops with complex math. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D141924 -
Max Kazantsev authored
This reverts commit f9599bbc. For some reason it caused us a huge compile time regression in downstream workloads. Not sure whether the source of it is in upstream code ir not. Temporarily reverting until investigated. Differential Revision: https://reviews.llvm.org/D142330
-
Mel Chen authored
- Add test config: -force-vector-width=4 -force-vector-interleave=1 - New test case: The test case both returns the minimum value and the index. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D143905
-
Florian Hahn authored
This fixes a build failure with assertions disabled.
-
Simon Tatham authored
[Originally committed as f6ddf778; reverted in bbef3835 due to test breakage; now relanded with the Arm tests conditioned on `arm-registered-target`] The LowerTypeTests pass emits a jump table in the form of an `inlineasm` IR node containing a string representation of some assembly. It tests the target triple to see what architecture it should be generating assembly for. But that's not good enough for `Triple::thumb`, because the 32-bit PC-relative `b.w` branch instruction isn't available in all supported architecture versions. In particular, Armv6-M doesn't support that instruction (although the similar Armv8-M Baseline does). Most of this patch is concerned with working out whether the compilation target is Armv6-M or not, which I'm doing by going through all the functions in the module, retrieving a TargetTransformInfo for each one, and querying it via a new method I've added to check its SubtargetInfo. If any function's TTI indicates that it's targeting an architecture supporting B.W, then we assume we're also allowed to use B.W in the jump table. The Armv6-M compatible jump table format requires a temporary register, and therefore also has to use the stack in order to restore that register. Another consequence of this change is that jump tables on Arm/Thumb are no longer always the same size. In particular, on an architecture that supports Arm and Thumb-1 but not Thumb-2, the Arm and Thumb tables are different sizes from //each other//. As a consequence, ``getJumpTableEntrySize`` can no longer base its answer on the target triple's architecture: it has to take into account the decision that ``selectJumpTableArmEncoding`` made, which meant I had to move that function to an earlier point in the code and store its answer in the ``LowerTypeTestsModule`` class. Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D143576
-
Florian Hahn authored
There is no need to update the AlsoPack field when creating VPReplicateRecipes. It can be easily computed based on the VP def-use chains when it is needed. Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D143864
-
Matt Devereau authored
-
Nicolas Vasilache authored
Connect the hoistRedundantVectorTransfers functionality to the transform dialect. Authored-by:
Quentin Colombet <quentin.colombet@gmail.com> Differential Revision: https://reviews.llvm.org/D144260
-
Nikita Popov authored
InstCombine is supposed to be a superset of InstSimplify, but failed to invoke load simplification. Unfortunately, this causes a minor compile-time regression, which will be mitigated in a future commit.
-
Max Kazantsev authored
Seems that it's a more appropriate place to do this transform.
-
Nikita Popov authored
These show that we currently fail to call load simplification from InstCombine.
-
Matt Devereau authored
define i1 @compare_vscales() { %vscale = call i64 @llvm.vscale.i64() %vscalex2 = shl nuw nsw i64 %vscale, 1 %vscalex4 = shl nuw nsw i64 %vscale, 2 %cmp = icmp ult i64 %vscalex2, %vscalex4 ret i1 %cmp } This IR is currently emitted by LLVM. This icmp is redundant as this snippet can be simplified to true or false as both operands originate from the same @llvm.vscale.i64() call. Differential Revision: https://reviews.llvm.org/D142542 -
Max Kazantsev authored
I stumbled over this while trying to improve our exit count work. These expressions are equivalent for complementary signed/unsigned ext and min/max (including umin_seq), but they are not canonicalized and SCEV cannot recognize them as the same. The benefit of this canonicalization is that SCEV can prove some new equivalences which it coudln't prove because of different forms. There is 1 test where trip count seems pessimized, I could not directly figure out why, but it just seems an unrelated issue that we can fix. Other changes seem neutral or positive to me. Differential Revision: https://reviews.llvm.org/D141481 Reviewed By: nikic
-
Kazu Hirata authored
Note that those functions on the left hand side are soft-deprecated in favor of those on the right hand side: getMinSignedBits -> getSignificantBits getNullValue -> getZero isNullValue -> isZero isOneValue -> isOne
-
Sameer Sahasrabuddhe authored
The uniformity analysis treated an undef argument to phi to be distinct from any other argument, equivalent to calling PHINode::hasConstantValue() instead of PHINode::hasConstantOrUndefValue(). Such a phi was reported as divergent. This is different from the older divergence analysis which treats such a phi as uniform. Fixed uniformity analysis to match the older behaviour. The original behaviour was added to DivergenceAnalysis in D19013. But it is not clear if relying on the undef value is safe. The defined values are not constant per se; they just happen to be uniform and the non-constant uniform value may not dominate the PHI. Reviewed By: ruiling Differential Revision: https://reviews.llvm.org/D144254
-
Valentin Clement authored
When calling PointerAssociateRemapping the dynamic type information from the target needs to be carried over to the pointer if any. Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D143717
-
Kohei Asano authored
Fold LoadInst for uniformly initialized constants, even if there are non-constant GEP indices. Goal proof: https://alive2.llvm.org/ce/z/oZtVby Motivated by https://github.com/rust-lang/rust/issues/107208 Differential Revision: https://reviews.llvm.org/D144184
-
David Spickett authored
The libc uses some functions that GCC does not currently implement, that come from Arm's ACLE header usually. These are: ``` __arm_wsr64 __arm_rsr64 __arm_wsr __arm_rsr ``` This issue was reported to us (https://github.com/llvm/llvm-project/issues/60473) and I've then reported that back to GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108642). Even if these functions are added, clang has some non standard extensions to them that gcc may not take. So we're looking at a fix in gcc 13 at best, and that may not be enough for what we're doing with them. So I've added ifdefs to use alternatives with gcc. For handling the stack pointer, inline assembly is unfortunately the only option. I have verified that the single mov is essentially what __arm_rsr64 generates. For fpsr and fpcr the gcc devs suggested using https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/AArch64-Built-in-Functions.html#AArch64-Built-in-Functions. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D143261
-
Kohei Asano authored
For D144184.
-
Tobias Gysi authored
This revision adds atomic support to the StoreOp. It chooses to print the atomic keywords together with the syncscope and ordering arguments. The revision also implements verifiers to ensure the constraints that apply to atomic store operations are checked. Depends on D144112 Reviewed By: Dinistro Differential Revision: https://reviews.llvm.org/D144200
-
Kazu Hirata authored
Note that getMinSignedBits has been soft-deprecated in favor of getSignificantBits.
-
Chuanqi Xu authored
The `IsImplicit` parameter should be removed since it is not used now.
-
Kazu Hirata authored
Note that isAllOnesValue has been soft-deprecated in favor of isAllOnes.
-
Chuanqi Xu authored
Sema::DirectModuleImports is not used now. Remove it for clearness.
-
Kazu Hirata authored
Note that isOneValue has been soft-deprecated in favor of isOne.
-
Kazu Hirata authored
Note that getAllOnesValue has been soft-deprecated in favor of getAllOnes.
-
Kazu Hirata authored
Note that APInt::getNullValue has been soft-deprecated in favor of APInt::getZero.
-
Serguei Katkov authored
Since canonicalizeForInvariantConditionInjection is introduced the in loop successor may be the second successor. Reviewed By: mkazantsev Differential Revision: https://reviews.llvm.org/D144361
-
Kazu Hirata authored
Note that APInt::isNullValue has been soft-deprecated in favor of APInt::isZero.
-
Chuanqi Xu authored
Close https://github.com/llvm/llvm-project/issues/60775 Previously, we will mark all the declarations in the GMF as not visible to other module units. But this is too strict and the users may meet problems during the template instantiation like the above exampel shows. The patch addresseds the problem.
-
Max Kazantsev authored
Adds support for these SCEVs to cover more cases. Differential Revision: https://reviews.llvm.org/D143259 Reviewed By: dmakogon, fhahn
-
Kazu Hirata authored
-