- Mar 15, 2024
-
-
Matthias Gehre authored
Introduces a SubscriptOp that allows to write IR like ``` func.func @load_store(%arg0: !emitc.array<4x8xf32>, %arg1: !emitc.array<3x5xf32>, %arg2: index, %arg3: index) { %0 = emitc.subscript %arg0[%arg2, %arg3] : <4x8xf32>, index, index %1 = emitc.subscript %arg1[%arg2, %arg3] : <3x5xf32>, index, index emitc.assign %0 : f32 to %1 : f32 return } ``` which gets translated into the C++ code ``` v1[v2][v3] = v0[v1][v2]; ``` To make this happen, this - adds the SubscriptOp - allows the subscript op as rhs of emitc.assign - updates the emitter to print SubscriptOps The emitter prints emitc.subscript in a delayed fashing to allow it being used as lvalue. I.e. while processing ``` %0 = emitc.subscript %arg0[%arg2, %arg3] : <4x8xf32>, index, index ``` it will not emit any text, but record in the `valueMapper` that the name for `%0` is `v0[v1][v2]`, see `CppEmitter::getSubscriptName`. Only when that result is then used (here in `emitc.assign`), that name is inserted into the text. -
Jie Fu authored
llvm-project/llvm/lib/CodeGen/MachineLoopInfo.cpp:215:14: error: lambda capture 'Reg' is not used [-Werror,-Wunused-lambda-capture] [this, Reg](const MachineInstr &MI) { return this->contains(&MI); }); ~~^~~ 1 error generated. -
Timm Bäder authored
Instead of aborting interpretation right away. This way we can still successfully evaluate such functions provided we don't reach the Error op at all.
-
Sander de Smalen authored
At the moment MachineLoopInfo has a very simple way to determine if a use of a physical register will be invariant: if it is not a constant value or if it's not an ignorable use, then it's not considered invariant. From a compile-time performance perspective this makes a lot of sense, but it limits code that uses implicit physical registers from being hoisted until the later MachineLICM pass (after register allocation), which has a lot fewer opportunities to hoist. For AArch64 SME we use an implicit physical register ($vg) to avoid rematerialization beyond certain instructions. Doing this led to regressions because simple expressions were no longer hoisted by Early MachineLICM. This patch adds some extra checks to 'isLoopInvariant' to see if any of the defs are found in the loop. If not, we can considered it loop invariant. We expect the impact on compile-time to be negligible because there is an incentive for users to reduce the need for the smstart/smstop instructions that define $vg. In either case, we've put the functionality under a target interface to limit this only to specific registers.
-
Timm Bäder authored
-
Artem Tyurin authored
Fixes https://github.com/llvm/llvm-project/issues/61240.
-
Timm Bäder authored
-
Timm Bäder authored
The function returns a const Expr* anyway.
-
Sander de Smalen authored
This is just a bit of cleanup to make the pseudo/code easier to understand. This is based on the observation that we only need to pass in a runtime value for 'pstate' if is actually needed for generating a runtime check.
-
Nikita Popov authored
This is mainly for consistency across code paths, but also makes sure that all calls use IRInstrumentationBuilder and its special debuginfo handling. The two remaining uses don't actually need RAUW, they just have to erase the original instruction.
-
SahilPatidar authored
Alive2: https://alive2.llvm.org/ce/z/n_ns-W Resolve #84608
-
Nikita Popov authored
atomicrmw xchg also accepts pointer and floating-point values. To handle those, insert necessary casts to and from integer. This is what we do for cmpxchg as well. Fixes https://github.com/llvm/llvm-project/issues/85226.
-
Timm Bäder authored
By doing the same thing the current interpreter does: Just passing on the first parameter.
-
Mark de Wever authored
With the timezone information available in the CI these tests can be enabled again. Fixes: https://github.com/llvm/llvm-project/issues/81654
-
Adrian Kuegel authored
atom.add.noftz.f16 is supported since SM 7.0
-
Mehdi Amini authored
-
Fangrui Song authored
The section type from 9f64604e (2013) was untested.
-
Mehdi Amini authored
Clang has a custom separate pipeline integrated with libc++ that only runs in release mode. It means that changes which touches only clang won't run the clang tests in the configuration used by LLVM premerge and will break it unknowingly.
-
Fangrui Song authored
getBuildAttributes is only called for ARM/RISCV object files and `SHT_ARM_ATTRIBUTES == SHT_RISCV_ATTRIBUTES`, so the following check `Sec.sh_type == ELF::SHT_ARM_ATTRIBUTES || Sec.sh_type == ELF::SHT_RISCV_ATTRIBUTES` is actually fine. But the convention is to guard such processor-specific section type checks with an e_machine test.
-
Christudasan Devadasan authored
This would bring a cleaner interface while obtaining wait event masks by combining various wait event types in the derived classes.
-
Sameer Sahasrabuddhe authored
The new token type is used in #67006 for implementing convergence control tokens in GMIR.
-
Matthias Springer authored
This commit adds a new test-only op: `sparse_tensor.has_runtime_library`. The op returns "1" if the sparse compiler runs in runtime library mode. This op is useful for writing test cases that require different IR depending on whether the sparse compiler runs in runtime library or codegen mode. This commit fixes a memory leak in `sparse_pack_d.mlir`. This test case uses `sparse_tensor.assemble` to create a sparse tensor SSA value from existing buffers. This runtime library reallocates+copies the existing buffers; the codegen path does not. Therefore, the test requires additional deallocations when running in runtime library mode. Alternatives considered: - Make the codegen path allocate. "Codegen" is the "default" compilation mode and it is handling `sparse_tensor.assemble` correctly. The issue is with the runtime library path, which should not allocate. Therefore, it is better to put a workaround in the runtime library path than to work around the issue with a new flag in the codegen path. - Add a `sparse_tensor.runtime_only` attribute to `bufferization.dealloc_tensor`. Verifying that the attribute can only be attached to `bufferization.dealloc_tensor` may introduce an unwanted dependency of `MLIRSparseTensorDialect` on `MLIRBufferizationDialect`.
-
Matthias Springer authored
This commit fixes memory leaks in sparse tensor integration tests by adding `bufferization.dealloc_tensor` ops. Note: Buffer deallocation will be automated in the future with the ownership-based buffer deallocation pass, making `dealloc_tensor` obsolete (only codegen path, not when using the runtime library).
-
Matthias Springer authored
This commit fixes a memory leak in `sparse_codegen_foreach.mlir`. The bufferization inserted a copy for the operand of `sparse_tensor.foreach` because it conservatively assumed that the op writes to the operand.
-
Owen Pan authored
Initialize IsCpp in LeftRightQualifierAlignmentFixer ctor.
-
Mehdi Amini authored
Reverts llvm/llvm-project#84599 This broke the presubmit bot.
-
eddyz87 authored
There are a few places where `arena` name is used for pointers in non-zero address space in BPF backend, rename these to use a more generic `address_space`: - macro `__BPF_FEATURE_ARENA_CAST` -> `__BPF_FEATURE_ADDR_SPACE_CAST - name for arena global variables section `.arena.N` -> `.addr_space.N`
-
Owen Pan authored
-
Jordan Rupprecht authored
This is a quick fix to make the bzl build work w/ this change. The sources included in the cc_library don't actually need the values here. Before adding more files, this should be replaced with something that actually parses Features.inc.in and sets configurable values.
-
Matthias Springer authored
D144193 (#66771) has been merged.
-
Jordan Rupprecht authored
-
Iman Hosseini authored
grid can be 3 dimensional. (@clementval)
-
Jordan Rupprecht authored
-
Haohai Wen authored
Intel Vtune/SEP has supported collecting LBR on Windows and generating perf-script file which is same format as Linux perf script. This patch teaches llvm-profgen to disassemble COFF binary so that we can do Sampling based PGO on Windows.
-
josh11b authored
Creates a `BUILD.bazel` file for the `clangd` directory in the project overlay. This upstreams the patch that allows https://github.com/carbon-language/carbon-lang/tree/trunk/language_server to use `clangd` as a library. This was created as part of a Summer of Code project building a prototype Carbon language server. If this is not an appropriate architecture, I'm very open to alternative paths forward. Thanks!
-
Kazu Hirata authored
We always apply all of the items in PatchItems. This patch simplifies the interface of ProfOStream::patch by switching to ArrayRef.
-
Valentin Clement authored
-
Farzon Lotfi authored
This change implements lowering for #70076, #70100, #70072, & #70102 `CGBuiltin.cpp` - - simplify `lerp` intrinsic `IntrinsicsDirectX.td` - simplify `lerp` intrinsic `SemaChecking.cpp` - remove unnecessary check `DXILIntrinsicExpansion.*` - add intrinsic to instruction expansion cases `DXILOpLowering.cpp` - make sure `DXILIntrinsicExpansion` happens first `DirectX.h` - changes to support new pass `DirectXTargetMachine.cpp` - changes to support new pass Why `any`, and `lerp` as instruction expansion just for DXIL? - SPIR-V there is an [OpAny](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpAny) - SPIR-V has a GLSL lerp extension via [Fmix](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#FMix) Why `exp` instruction expansion? - We have an `exp2` opcode and `exp` reuses that opcode. So instruction expansion is a convenient way to do preprocessing. - Further SPIR-V has a GLSL exp extension via [Exp](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#Exp) and [Exp2](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#Exp2) Why `rcp` as instruction expansion? This one is a bit of the odd man out and might have to move to `cgbuiltins` when we better understand SPIRV requirements. However I included it because it seems like [fast math mode has an AllowRecip flag](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_fp_fast_math_mode) which lets you compute the reciprocal without performing the division. We don't have that in DXIL so thought to include it.
-
srcarroll authored
The previous implementation decomposes `tanh(x)` into `(exp(2x) - 1)/(exp(2x)+1), x < 0` `(1 - exp(-2x))/(1 + exp(-2x)), x >= 0` This is fine as it avoids overflow with the exponential, but the whole decomposition is computed for both cases unconditionally, then the result is chosen based off the sign of the input. This results in doing two expensive `exp` computations. The proposed change avoids doing the whole computation twice by exploiting the reflection symmetry `tanh(-x) = -tanh(x)`. We can "normalize" the input to be positive by setting `y = sign(x) * x`, where the sign of `x` is computed as `sign(x) = (float)(x > 0) * (-2) + 1`. Then compute `z = tanh(y)` with the decomposition above for `x >=0` and "denormalize" the result `z * sign(x)` to retain the sign. The reason it is done this way is that it is very amenable to vectorization. This method trades the duplicate decomposition computations (which takes 5 instructions including an extra expensive `exp` and `div`) for 4 cheap instructions to compute the signs value 1. `arith.cmpf` (which is a pre-existing instruction in the previous impl) 2. `arith.sitofp` 3. `arith.mulf` 4. `arith.addf` and 1 more instruction to get the right sign in the result 5. `arith.mulf`. Moreover, numerically, this implementation will yield the exact same results as the previous implementation.
-
Alexey Bataev authored
-