- Nov 22, 2023
-
-
Guray Ozen authored
PR adds support of `im2col` and `l2cache` to `cp.async.bulk.tensor.shared.cluster.global`. The Op is now supports all the traits of the corresponding PTX instruction. The current structure of this operation looks somewhat like below. The PR also simplifies types so we don't need to write obvious types after `:` anymore. ``` nvvm.cp.async.bulk.tensor.shared.cluster.global %dest, %tmaDescriptor, %barrier, box[%crd0,%crd1,%crd2,%crd3,%crd4] im2col[%off0,%off1,%off2] <-- PR introduces multicast_mask = %ctamask l2_cache_hint = %cacheHint <-- PR introduces : !llvm.ptr<3>, !llvm.ptr ```
-
Momchil Velikov authored
This patch add intrinsics of the form sv<type>_t svld1q_gather_u64offset_<typ>(svbool_t pg, const <type>_t *base, svuint64_t offs); void svst1q_scatter_u64offset_<typ>(sbvool_t, <type>_t *base, svuint64_t offst, sv<type>_t data); as well as their short forms. ACLE spec: ARM-software/acle#257
-
Johannes Reifferscheid authored
-
Phoebe Wang authored
Some MMX intrinsics like _mm_setzero_si64 will be called by XMM intrinsics, so need to propagate no-evex512 there. Checked locally with a lot of modified tests and no side effect with this change. No extra test needed for the update.
-
Joseph Huber authored
Summary: These tests are currently failing for some reason. A lot of math tests on the GPU are disabled temporarily and need to be fixed.
-
Benjamin Maxwell authored
This gives more flexibility with when these lowerings are performed, without also lowering unrelated vector ops. This is a NFC (other than adding a new `-convert-arm-sme-to-llvm` pass)
-
CarolineConcatto authored
…d LLVM intrinisc (#70362)"" This reverts commit e1ee0e85. The patch https://github.com/llvm/llvm-project/pull/70362 had a test in LLDB failing. The Feature sve2p1 in AArch64InstrInfo.td uses AssemblerPredicate instead of AssemblerPredicateWithAll This patch adds again PR #70362 with the fix in the AArch64InstrInfo.td.
-
Tai Ly authored
This adds an optional bool attribute, local_bound, with default false, to following ops per TOSA spec 0.90: CONV2D CONV3D DEPTHWISE_CONV2D FFT2D RFFT2D TRANSPOSE_CONV2D also added tests in ops.mlir to validate this attribute is optional Signed-off-by:Tai Ly <tai.ly@arm.com>
-
Rafael Ubal authored
The TOSA-to-linalg conversion of `tosa.transpose` contains a bug in the computation of the result tensor shape when using dynamic dimensions. This bug may have widespread implications in projects such as Tensorflow, where `tosa.transpose` is frequently generated. Consider the following TOSA code using only static dimensions. The code transposes a tensor of shape 10x11x12 into 12x10x11 by permuting dimensions [2, 0, 1] into [0, 1, 2]. ``` func.func @test_tosa_transpose(%input: tensor<10x11x12xf32>) -> tensor<12x10x11xf32> { %perms = "tosa.const"() <{value = dense<[2, 0, 1]> : tensor<3xi32>}> : () -> tensor<3xi32> %transposed = "tosa.transpose"(%input, %perms) : (tensor<10x11x12xf32>, tensor<3xi32>) -> tensor<12x10x11xf32> return %transposed : tensor<12x10x11xf32> } ``` The code is correctly lowered to: ``` #map = affine_map<(d0, d1, d2) -> (d1, d2, d0)> #map1 = affine_map<(d0, d1, d2) -> (d0, d1, d2)> module { func.func @test_tosa_transpose(%arg0: tensor<10x11x12xf32>) -> tensor<12x10x11xf32> { %empty = tensor.empty() : tensor<12x10x11xf32> %transposed = linalg.generic {indexing_maps = [#map, #map1], iterator_types = ["parallel", "parallel", "parallel"]} ins(%arg0 : tensor<10x11x12xf32>) outs(%empty : tensor<12x10x11xf32>) { ^bb0(%in: f32, %out: f32): linalg.yield %in : f32 } -> tensor<12x10x11xf32> return %transposed : tensor<12x10x11xf32> } } ``` Now let's make all dimensions dynamic in the TOSA code: ``` func.func @test_tosa_transpose(%input: tensor<?x?x?xf32>) -> tensor<?x?x?xf32> { %perms = "tosa.const"() <{value = dense<[2, 0, 1]> : tensor<3xi32>}> : () -> tensor<3xi32> %transposed = "tosa.transpose"(%input, %perms) : (tensor<?x?x?xf32>, tensor<3xi32>) -> tensor<?x?x?xf32> return %transposed : tensor<?x?x?xf32> } ``` The `tensor.empty()` op now needs additional information about the size of the output tensor, which is computed dynamically with a set of `tensor.dim` ops. The comments below assume an input tensor of size 10x11x12, as before. The code is lowered as: ``` #map = affine_map<(d0, d1, d2) -> (d1, d2, d0)> #map1 = affine_map<(d0, d1, d2) -> (d0, d1, d2)> module { func.func @test_tosa_transpose(%arg0: tensor<?x?x?xf32>) -> tensor<?x?x?xf32> { %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index %c2 = arith.constant 2 : index %arg0_dim0 = tensor.dim %arg0, %c0 : tensor<?x?x?xf32> // Evaluates to 10 %arg0_dim1 = tensor.dim %arg0, %c1 : tensor<?x?x?xf32> // Evaluates to 11 %arg0_dim2 = tensor.dim %arg0, %c2 : tensor<?x?x?xf32> // Evaluates to 12 %empty = tensor.empty(%arg0_dim1, %arg0_dim2, %arg0_dim0) : tensor<?x?x?xf32> // Output of type tensor<11x12x10> WRONG! %transposed = linalg.generic {indexing_maps = [#map, #map1], iterator_types = ["parallel", "parallel", "parallel"]} ins(%arg0 : tensor<?x?x?xf32>) outs(%empty : tensor<?x?x?xf32>) { ^bb0(%in: f32, %out: f32): linalg.yield %in : f32 } -> tensor<?x?x?xf32> return %transposed : tensor<?x?x?xf32> } } ``` The output tensor shape is dynamically computed as 11x12x10 instead of 12x10x11. Since the total size of the output tensor is still the same, the code does not segfault after bufferization. However, index computations are invalid and lead to SWAs. -
Simon Pilgrim authored
We currently look for X86ISD::VBROADCAST_LOAD patterns, but this won't work with a future patch which will improve sharing of constant pool loads.
-
Florian Hahn authored
Instead of expanding the src/sink SCEV expressions and emitting an IR sub to compute the difference, the subtraction can be directly be performed by ScalarEvolution. This allows the subtraction to be simplified by SCEV, which in turn can reduced the number of redundant runtime check instructions generated. It also allows to generate checks that are invariant w.r.t. an outer loop, if he inner loop AddRecs have the same outer loop AddRec as start.
-
Spenser Bauman authored
The existing lowering of tosa.matmul will construct illegal tensor.empty operations when the output type is more dynamic than the input types. %0 = tosa.matmul %arg0, %arg1 : (tensor<1x1x8xf32>, tensor<1x8x1xf32>) -> tensor<?x1x1xf32> When constructing the tensor.empty operation, consult the output type rather than the input types to decide whether a dimension is dynamic.
-
Florian Hahn authored
Add a test case where many runtime check instructions can be simplified.
-
Utkarsh Saxena authored
Adds attribute `[[clang::coro_lifetimebound]]`. All arguments to a function are considered to be **lifetime bound** if the function returns a type annotated with ``[[clang::coro_lifetimebound]]`` and ``[[clang::coro_return_type]]``.
-
Hui authored
- implement P0020R6 Floating Point Atomic Differential Revision: https://reviews.llvm.org/D153981
-
NimishMishra authored
Initialization of reduction variable for min-reduction is set to largest negative value. As such, in presence of non-negative operands, min reduction gives incorrect output. This patch initialises min-reduction to use the maximum positive value instead, so that it can produce correct output for the entire range of real valued operands. Fixes https://github.com/llvm/llvm-project/issues/73101
-
Simon Pilgrim authored
We currently look for X86ISD::VBROADCAST_LOAD patterns, but this won't work with a future patch which will improve sharing of constant pool loads.
-
Florian Hahn authored
Future patches will remove some redundant instructions for runtime checks, which brings this test case slightly below the default limit of 128. Force a lower limit to preserve the original spirit of the test (checking that no interleaving happens if the number of checks is above he threshold)
-
Nikita Popov authored
ReverseChildren is populated during runDFS() with reachable nodes only. This check dates back to a time when this code used inverse_children<> directly, which could indeed contain unreachable nodes.
-
Mats Petersson authored
When using the LLVM flang compiler with alias analysis (AA) enabled, SPEC2017:548.exchange2_r was running significantly slower than wihtout the AA. This was caused by the GVN pass replacing many of the loads in the pre-AA code with phi-nodes that form a long chain of dependencies, which the function specialization was unable to follow. This adds a function to discover phi-nodes in a transitive set, with some limitations to avoid spending ages analysing phi-nodes. The minimum latency savings also had to be lowered - fewer load instructions means less saving. Adding some more prints to help debugging the isProfitable decision. No significant change in compile time or generated code-size. (A previous attempt to fix this was abandoned: https://github.com/llvm/llvm-project/pull/71442 ) --------- Co-authored-by:
Alexandros Lamprineas <alexandros.lamprineas@arm.com>
-
Jonas Paulsson authored
The SystemZ ABI requires any global variable to be aligned to at least 2 bytes, and therefore an external global Value with an opaque type should get this alignment as well.
-
Nikita Popov authored
Cache the result of the TLI libfunc lookup in the Function object. This only caches the actual lookup of the LibFunc in the TLI map, but not the prototype validation, as that might differ between different TLI instances. This uses the existing mechanism for invalidating the intrinsic ID when the function name changes. The libfunc will be invalidated in that case as well. I don't believe this increases the size of Function on 64bit (which currently has a trailing `bool` member), and I don't think we would particularly care if it did, as Functions are uncommon as Values go.
-
simpal01 authored
[llvm][ARM] Emit MVE .arch_extension after .fpu directive if it does not include MVE features (#71545) The floating-point and MVE features together specify the MVE functionality that is supported on the Cortex-M85 processor. But the FPU extension for the underlying architecture(armv8.1-m.main) is FPV5 which does not include MVE-F. So Compiler's -S output and `-save-temps=obj` loses MVE feature which leads to assembler error. What happening here is .fpu directive overrides any previously set features by .cpu directive. Since the the corresponding .fpu generated (.fpu fpv5-d16) does not include MVE-F, it overrides those features even though it is supported and set by the .cpu directive. Looks like .fpu is supposed to do this. In this case, there should be an .arch_extension directive re-enabling the relevant extensions after .fpu if the goal is to keep these extensions enabled. GCC also does the same. So this patch enables the MVE features by emitting the below arch extension: .fpu fpv5-d16 .arch_extension mve.fp --------- Co-authored-by: Simi Pallipurath <simi.pallipurath.com>
-
Sander de Smalen authored
-
Sander de Smalen authored
It seems TypeSize is currently broken in the sense that: TypeSize::Fixed(4) + TypeSize::Scalable(4) => TypeSize::Fixed(8) without failing its assert that explicitly tests for this case: assert(LHS.Scalable == RHS.Scalable && ...); The reason this fails is that `Scalable` is a static method of class TypeSize, and LHS and RHS are both objects of class TypeSize. So this is evaluating if the pointer to the function Scalable == the pointer to the function Scalable, which is always true because LHS and RHS have the same class. This patch fixes the issue by renaming `TypeSize::Scalable` -> `TypeSize::getScalable`, as well as `TypeSize::Fixed` to `TypeSize::getFixed`, so that it no longer clashes with the variable in FixedOrScalableQuantity. The new methods now also better match the coding standard, which specifies that: * Variable names should be nouns (as they represent state) * Function names should be verb phrases (as they represent actions)
-
Nikita Popov authored
The whole point of the GenericDomTree.h vs GenericDomTreeConstruction.h distinction is that the latter only needs to be included in the source file and not the header.
-
Zi Xuan Wu (Zeson) authored
The first argument of setTruncStoreAction/setLoadExtAction should be Value VT instead of Memory VT.
-
Craig Topper authored
-
Yuxuan Chen authored
This change aims to fix an ICE in issue https://github.com/llvm/llvm-project/issues/63803 The crash happens in `ExitCXXTryStmt` because `EmitAnyExpr()` adds additional cleanup to the `EHScopeStack`. This messes up the assumption in `ExitCXXTryStmt` that the top of the stack should be a `EHCatchScope`. However, since we never read a value returned from `await_resume()` of an init suspend, we can skip the part that builds this `RValue`. The code here may not be in the best shape. There's another bug that `memberCallExpressionCanThrow` doesn't work on the current Expr due to type mismatch. I am preparing a separate PR to address it plus some refactoring might be beneficial.
-
Vitaly Buka authored
kNumShadowPages=1024 helps to pass it consistenly (10k runs). But to be sure also changing success condition to 8 out of 10.
-
Ho Cheung authored
Fix build issue on Windows. Fixes #73006
-
Shengchen Kan authored
JMPABS is a 64-bit only ISA extension, and acts as a near-direct branch with an absolute target. The 64-bit immediate operand is treated an as absolute effective address, which is subject to canonicality checks. It is in legacy map 0 and requires REX2 prefix with `REX2.M0=0` and `REX2.W=0`. All other REX2 payload bits are ignored. blog: https://kanrobert.github.io/rfc/All-about-APX-JMPABS/ This patch 1. Extends `ExplicitVEXPrefix` to `ExplicitOpPrefix` for instrcutions requires explicit `REX2` or `EVEX` 2. Adds `ATTR_REX2` and `IC_64BIT_REX2` to put `JMPABS` , `MOV EAX, moffs32` in different tables to avoid opcode conflict NOTE: 1. `ExplicitREX2Prefix` can be reused by the following PUSHP/POPP instructions. 2. `ExplicitEVEXPrefix` will be used by the instructions promoted to EVEX space for EGPR.
-
Matthias Braun authored
- Change `BranchProbabilityPrinterPass` output to match expectations of `update_analyze_test_checks.py`. - Add `Branch Probability Analysis` to list of supported analyses. - Process `llvm/test/Analysis/BranchProbabilityInfo/basic.ll` with `update_analyze_test_checks.py` as proof of concept. Leaving the other tests unchanged to reduce the amount of churn.
-
Aart Bik authored
All DLT related methods have DLT at end, removed stale TODO
-
Yeting Kuo authored
DAGCombiner folds (select_cc seteq (and x, y), 0, 0, A) to (and (sra (shl x)) A) where y has a single bit set. Previously, DAGCombiner relies on `shouldAvoidTransformToShift` to decide when to do the combine, but `shouldAvoidTransformToShift` is only about shift cost. This patch introuduces a specific hook to decide when to do the combine and disable the combine when Zicond enabled and AndMask <= 1024.
-
Valentin Clement (バレンタイン クレメン) authored
-
Valentin Clement (バレンタイン クレメン) authored
-
Valentin Clement (バレンタイン クレメン) authored
HLFIR lowering as been set by default now and FIR lowering support will be removed in the near future. This patch removes the specific FIR check lines on enter/exit data tests.
-
GkvJwa authored
Use "__this" in DataMemberRecord, make vs debugger can be parsed normally Fixes #71562
-
Valentin Clement (バレンタイン クレメン) authored
Remove the run lines that check for the FIR lowering. HLFIR lowering produce the same check lines.
-