- Mar 19, 2024
-
-
Fangrui Song authored
Created using spr 1.3.5-bogner
-
- Mar 18, 2024
-
-
LLVM GN Syncbot authored
-
Christian Ulmann authored
This commit changes MLIR's SROA implementation back from being pattern based into a full pass. This is beneficial for upcoming changes that rely more heavily on the datalayout. Unfortunately, this change required substantial test changes, as the IRBuilder no cleans up the IR.
-
Christian Ulmann authored
This commit changes MLIR's Mem2Reg implementation back from being pattern based into a full pass. Using Mem2Reg as a pattern is wasteful, as each application can invalidate the dominance info. Applying changes in bulk allows for reuse of the same dominance info. Unfortunately, this requires some test changes, due to the `IRBuilder` not simplifying IR.
-
Nikolas Klauser authored
We can simplify the implementation of the two range overload of `equal` a bit since we can now use `if constexpr`.
-
Nikolas Klauser authored
[libc++][NFC] Merge is{,_nothrow,_trivially}{,_copy,_move,_default}{_assignable,_constructible} (#85308) These headers have become very small by using compiler builtins, often containing only two declarations. This merges these headers, since there doesn't seem to be much of a benefit keeping them separate. Specifically, `is_{,_nothrow,_trivially}{assignable,constructible}` are kept and the `copy`, `move` and `default` versions of these type traits are moved in to the respective headers. -
Qiu Chaofan authored
rldimi is 64-bit instruction, so the corresponding builtin should not be available in 32-bit mode. Rotate amount should be in range and cases when mask is zero needs special handling. This change also swaps the first and second operands of rldimi/rlwimi to match previous behavior. For masks not ending at bit 63-SH, rotation will be inserted before rldimi.
-
Carlos Alberto Enciso authored
As part of the WebAssembly support work review https://github.com/llvm/llvm-project/pull/82588 It was decided to rename: Files: LVElfReader.cpp[h] -> LVDWARFReader.cpp[h] ELFReaderTest.cpp -> DWARFReaderTest.cpp Class: LVELFReader -> LVDWARFReader The name LVDWARFReader would match the another reader LVCodeViewReader as they will reflect the type of debug information format that they are parsing.
-
Carlos Alberto Enciso authored
As part of the WebAssembly support work https://github.com/llvm/llvm-project/pull/82588 As the object files used in the test cases are a single object (just produced by clang without being processed by wasm-ld), it was determined to use .o intead of .wasm. Update the README.txt to reflect that the tool now supports WebAssembly.
-
Sameer Sahasrabuddhe authored
[GlobalISel] Implement convergence control tokens and intrinsics in GMIR In the IR translator, convert the LLVM token type to LLT::token(), which is an alias for the s0 type. These show up as implicit uses on convergent operations. Differential Revision: https://reviews.llvm.org/D158147
-
-
Dhruv Chawla authored
[AArch64][GlobalISel] Avoid splitting loads of large vector types into individual element loads (#85042) This patch fixes an issue with the legalization of G_LOAD where the presence of .lowerIfMemSizeNotByteSizePow2 before .clampMaxNumElements was causing issues for vectors which matched that condition. Such vectors would be lowered into per-element loads instead of being split up into 128-bit chunks.
-
Dhruv Chawla authored
-
Louis Dionne authored
-
LLVM GN Syncbot authored
-
Nico Weber authored
-
Nico Weber authored
-
Petr Hosek authored
This addresses a build error introduced by 5a75242b.
-
Xiang Li authored
Add DXIL module flag bit offset for SHADER_FEATURE_FLAG. Added DXIL_MODULE_FLAG for DXIL module flag which does not have feature flag. Use DXILModuleFlags for ComputedShaderFlags instead of ShaderFeatureFlags. ComputedShaderFlags::getFeatureFlags() was added to get FeatureFlags. Rename DXContainerGlobals::getShaderFlags to DXContainerGlobals::getFeatureFlags. Fixes #57925
-
Noah Goldstein authored
We don't always have canonical order here, so do it manually. Closes #85575
-
Noah Goldstein authored
-
scythris authored
This resolves an issue in clang-format where `new` and `delete` were incorrectly formatted as keywords in C files. The fix modifies `TokenAnnotator::spaceRequiredBetween` to handle `new` and `delete` when used as identifiers for function pointers in structs in C code.
-
Nikolas Klauser authored
``` ------------------------------------------------------ Benchmark old new ------------------------------------------------------ bm_ranges_fill_n/1 1.64 ns 3.06 ns bm_ranges_fill_n/2 3.45 ns 3.06 ns bm_ranges_fill_n/3 4.88 ns 3.06 ns bm_ranges_fill_n/4 6.46 ns 3.06 ns bm_ranges_fill_n/5 8.03 ns 3.06 ns bm_ranges_fill_n/6 9.65 ns 3.07 ns bm_ranges_fill_n/7 11.5 ns 3.06 ns bm_ranges_fill_n/8 13.0 ns 3.06 ns bm_ranges_fill_n/16 25.9 ns 3.06 ns bm_ranges_fill_n/64 103 ns 4.62 ns bm_ranges_fill_n/512 711 ns 4.40 ns bm_ranges_fill_n/4096 5642 ns 9.86 ns bm_ranges_fill_n/32768 45135 ns 33.6 ns bm_ranges_fill_n/262144 360818 ns 243 ns bm_ranges_fill_n/1048576 1442828 ns 982 ns bm_ranges_fill/1 1.63 ns 3.17 ns bm_ranges_fill/2 3.43 ns 3.28 ns bm_ranges_fill/3 4.97 ns 3.31 ns bm_ranges_fill/4 6.53 ns 3.27 ns bm_ranges_fill/5 8.12 ns 3.33 ns bm_ranges_fill/6 9.76 ns 3.32 ns bm_ranges_fill/7 11.6 ns 3.29 ns bm_ranges_fill/8 13.2 ns 3.26 ns bm_ranges_fill/16 26.3 ns 3.26 ns bm_ranges_fill/64 104 ns 4.92 ns bm_ranges_fill/512 716 ns 4.47 ns bm_ranges_fill/4096 5772 ns 8.21 ns bm_ranges_fill/32768 45778 ns 33.1 ns bm_ranges_fill/262144 351422 ns 241 ns bm_ranges_fill/1048576 1404710 ns 965 ns ```
-
David Green authored
This is part of #70452 that changes the type used for the external interface of MMO to LocationSize as opposed to uint64_t. This means the constructors take LocationSize, and convert ~UINT64_C(0) to LocationSize::beforeOrAfter(). The getSize methods return a LocationSize. This allows us to be more precise with unknown sizes, not accidentally treating them as unsigned values, and in the future should allow us to add proper scalable vector support but none of that is included in this patch. It should mostly be an NFC. Global ISel is still expected to use the underlying LLT as it needs, and are not expected to see unknown sizes for generic operations. Most of the changes are hopefully fairly mechanical, adding a lot of getValue() calls and protecting them with hasValue() where needed.
-
Timm Bäder authored
Add the same warnings the current interpreter emits.
-
Timm Bäder authored
-
Timm Bäder authored
-
Timm Bäder authored
-
sethp authored
Prior to this commit, clang would fail to produce a constant value for `b` in: ```c++ struct base { }; struct s : base { int z; }; constexpr auto b = std::bit_cast<s>(0x12); ``` e.g. https://godbolt.org/z/srrbTMPq4 -
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 `arith.cmpf `(which is a pre-existing instruction in the previous impl) `arith.sitofp` `arith.mulf` `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. As part of the relanding, a casting issue from the original commit has been fixed, i.e. casting bool to float with `uitofp`. Additionally a correctness test with `mlir-cpu-runner` has been added.
-
- Mar 17, 2024
-
-
Benjamin Kramer authored
-
Timm Bäder authored
-
yronglin authored
Since we implemented `copyable-box` in (https://reviews.llvm.org/D102135, https://github.com/llvm/llvm-project/commit/6829db727e9e67dfdb70dd0846ffd4e48e00a98d ), this issue got addressed. --------- Signed-off-by:
yronglin <yronglin777@gmail.com>
-
Mark de Wever authored
Co-authored-by:Michael Buch <michaelbuch12@gmail.com>
-
Benjamin Kramer authored
-
Chuanqi Xu authored
Following of https://github.com/llvm/llvm-project/pull/82160 The reason why the above PR fails is that the `--sysroot` has lower priority than the libc++ built from the same source. On the one hand, it matches the codes behavior. We will add the built libc++ project paths in the ToolChain class. But we will only add the path related to sysroot in Linux class, which is derived from the ToolChain classes. So the paths of just built libc++ is in the front of the paths relative to sysroot. On the other hand, the behavior should be good from the higher level. Since the just built libc++ has the same version number with the just built clang, so it makes sense that these 2 compilers just matches. So for patch it self, I hacked it by using resource dir in the test since the resource dir has the higher priority, which is not strongly correct since we won't do that in practice. @kaz7 would you like to test on your environment to avoid this get reverted again? On the libc++ side, it shows that it lacks a `modules.json` file for the just built libc++ directory. If we don't have that, it will be problematic to use std modules from the just built clang and libc++ pair. Then it is not good. And I feel it may be problematic for future compiler/standard library developers. So I feel this is somewhat a libc++ issue that need to be fixed. Also if we don't like the hacked test in the current patch, we must wait for libc++ to fix this to proceed. But I feel this is somewhat odd since the test of clang shouldn't dependent on libc++. CC: @mordante --------- Co-authored-by:
Mark de Wever <koraq@xs4all.nl>
-
Benjamin Kramer authored
-
Benjamin Kramer authored
MSVC fails to parse this construct, leading to MlirTranslateMain.cpp(70): error C2065: 'inputSplitMarker': undeclared identifier Just switching to brace init works around the issue
-
XinWang10 authored
This patch support ND CMOV instructions and CFCMOV instructions. RFC: https://discourse.llvm.org/t/rfc-design-for-apx-feature-egpr-and-ndd-support/73031/4
-
Jay Foad authored
Definitions like this did not work as intended: let is_flat_scratch = 1 in { let SubtargetPredicate = HasFlatScratchSVSMode in def _SVS : FLAT_Scratch_Load_Pseudo<opName, regClass, HasTiedOutput, 1, 1>, FlatScratchInst<opName, "SVS">; let SubtargetPredicate = HasFlatScratchSTMode in def _ST : FLAT_Scratch_Load_Pseudo<opName, regClass, HasTiedOutput, 0, 0, 0>, FlatScratchInst<opName, "ST">; } They tried to override SubtargetPredicate, but then it was overridden again (back to its default value) by setting is_flat_scratch, which caused SubtargetPredicate to be recalculated in the base class. (This patch also removes some overrides of SubtargetPredicate that are redundant due to being recalculated in the base class.) Fix this by pushing overrides of is_flat_scratch and is_flat_global "in" as far as possible. This has the added benefit that there is no need to override them around groups of Pseudo definitions like this: let is_flat_global = 1 in { defm GLOBAL_ATOMIC_CMPSWAP : FLAT_Global_Atomic_Pseudo <"global_atomic_cmpswap", VGPR_32, i32, v2i32, VReg_64>; ... } which are plainly Global instructions anyway. Verified by inspecting the output of TableGen. It seems to be NFC in practice.
-