- Dec 30, 2023
-
-
Yeting Kuo authored
The patch adds the instructions in Zicfiss extension. Zicfiss extension is to support shadow stack for control flow integrity. This patch is based on version [0.3.1]. [0.3.1]: https://github.com/riscv/riscv-cfi/releases/tag/v0.3.1
-
Owen Pan authored
-
Mikhail Gudim authored
The original PR had a typo which was causing a bug.
-
Owen Pan authored
-
Ben Shi authored
Co-authored-by:Balazs Benics <benicsbalazs@gmail.com>
-
Mikhail Gudim authored
These instructions are legal in the presence of Zbkb extension.
-
Alexander Shaposhnikov authored
Add tests for llvm.abs. This is a preparation for https://github.com/llvm/llvm-project/pull/73189 Test plan: ninja check-all
-
Owen Pan authored
-
Owen Pan authored
Closes #52975.
-
Aiden Grossman authored
This patch switches out the `and` keyword for && in preprocessor directives recently added to fix some buildbot failures to be consistent with the rest of the code base.
-
Enna1 authored
…r instruction. Before https://github.com/llvm/llvm-project/commit/77a609b55636dc540090ef9105c60a99cfdbd1dd, we always skip in-tree uses of the vectorized scalars in `buildExternalUses()`, that commit handles the case that if the in-tree use is scalar operand in vectorized instruction, we need to generate extract for these in-tree uses. in-tree uses remain as scalar in vectorized instructions can be 3 cases: - The pointer operand of vectorized LoadInst uses an in-tree scalar - The pointer operand of vectorized StoreInst uses an in-tree scalar - The scalar argument of vector form intrinsic uses an in-tree scalar Generating extract for in-tree uses for vectorized instructions are implemented in `BoUpSLP::vectorizeTree()`: - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11497-L11506 - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11542-L11551 - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11657-L11667 However, https://github.com/llvm/llvm-project/commit/77a609b55636dc540090ef9105c60a99cfdbd1dd not only generates extract for vectorized instructions, but also generates extract for original scalar instructions. There is no need to generate extract for origin scalar instrutions, as these scalar instructions will be replaced by vector instructions and get erased later. This patch marks there is no exact user for in-tree scalars that remain as scalar in vectorized instructions when building external uses, In this case all uses of this scalar will be automatically replaced by extractelement. and remove - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11497-L11506 - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11542-L11551 - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11657-L11667 extracts.
-
Aiden Grossman authored
a15532d7 landed a patch that added support for detecting more AMD znver2 CPUs and cleaned up some of the surrounding code, including the znver3 detection. Since one model group is 00h-0fh, I adjusted the check to include checking if the value is greater than zero. Since the value is unsigned, this is always true and gcc warns on it. This patch removes the comparison with zero to get rid of the compiler warning.
-
Aiden Grossman authored
Previous patches moved the save/restore system call register functions behind a preprocessor check, but neglected to move the constant expression array used by the functions behind the preprocessor check. This patch gates the array behind the preprocessor check to fix build failures caused by -Werror,unused-const-variable on the clang--ppc64-aix buildbot.
-
Aiden Grossman authored
Relanding this patch broke some builds (including Windows) due to certain functions not being guarded by appropriate preprocessor directives, particularly the loadImmediateSegmentRegister function not having most of its functionality only enabled on Linux. The previous relanding addressed issues with headers not being available on non-x86_64 linux, but neglected to fix issues with the header not being included, but the function still trying to use it on certain platforms, such as x86-64 windows.
-
Aiden Grossman authored
This reverts commit 8b485070. This relands commit 7c383481. This caused build failures on non-x86-64 builders as there was no preprocessor logic around the newly included headers. This has been fixed in the relanded patch.
-
Joseph Huber authored
Summary: In the future, we may have more checks for different kinds of inputs, e.g. SPIR-V. This patch simply reworks the handling to be more generic and do the magic detection up-front. The checks inside the routines are now asserts so we don't spend time checking this stuff over and over again. This patch also tweaked the bitcode check. I used a different function to get the Lazy-IR module now, as it returns the raw expected value rather than the SM diganostic. No functionality change intended.
-
Rainer Orth authored
Most asan tests `FAIL` on FreeBSD 14.0/amd64 with ``` ==17651==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. ``` With `ASAN_OPTIONS=verbosity=2` one sees: ``` ==4880==info->dlpi_name = [vdso] info->dlpi_addr = 0xffffe780 ==4880==info->dlpi_name = lib/clang/18/lib/freebsd/libclang_rt.asan-i386.so info->dlpi_addr = 0x2808a000 ``` Ignoring the vDSO as on Linux fixes this. Tested on `amd64-pc-freebsd14.0`.
-
XDeme authored
Fixes llvm/llvm-project#76314
-
Jan Patrick Lehr authored
This adds the ROCm device libs defines for both target architectures so that we an compile libc on such GPUs.
-
Joseph Huber authored
Summary: This was actually set, I just forget where it was.
-
Joseph Huber authored
Summary: The AMDGPU architecture does not use a fixed frequency for all of its architectures. However, the newer GPUs tend to have one that's consistent between them (Except for Vega10). This was set up but not actually used, so the implementation was just defaulting to whatever value the global was being set to. Fix.
-
Min-Yih Hsu authored
And disable offset folding altogether since we cannot always gain the precise offset there to see if that fits into a certain size of displacement.
-
Min-Yih Hsu authored
The MximmSExt8/16/32 should be "any immediate that can be represented by 8/16/32-bit signed integer", hence it shouldn't express an explicit type. Rename those into Mxi8/16/32immSExt8/16/32. NFC.
-
- Dec 29, 2023
-
-
Yingwei Zheng authored
Alive2: https://alive2.llvm.org/ce/z/Qdsqk6 The commit https://github.com/llvm/llvm-project/commit/f1eda235142ed071e219bd231310e44cda08f932 didn't handle other cases that commute operands.
-
Ivan Kosarev authored
-
Shengchen Kan authored
-
LLVM GN Syncbot authored
-
Dimitry Andric authored
[builtins] Fix CPU feature detection for FreeBSD on AArch64 This is a follow-up to #75635 which broke the build for FreeBSD on AArch64: ``` compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/freebsd.inc:3:16: error: call to undeclared function 'elf_aux_info'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 3 | int result = elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); | ^ ``` Using `elf_aux_info()` requires including `<sys/auxv.h>` first. To prevent redeclaration issues with `hwcap.inc` attempting to define `HWCAP_xxx` macros before `<sys/auxv.h>` does so, include `<sys/auxv.h>` before any of the `.inc` files on FreeBSD. -
Brad Smith authored
Support for FreeBSD 11.x was dropped so garbage collect a few FreeBSD 9.x workarounds and make 12.x the oldest supported releases.
-
XChy authored
-
yingopq authored
Do optimization to turn x >> (shift & 31/63) into a single srlv instead of andi + srlv, since the mips variable shift instruction already implicitly masks the shift, like x86, wasm and AMDGPU. Copy the X86DAGToDAGISel::isUnneededShiftMask() function to MIPS for checking whether need combine two instructions to one.
-
Chia authored
This patch closed #73424, which is also a missed-optimization case similar to #68466 on X86. ## Source Code ``` define void @trunc_sat_i8i16(ptr %x, ptr %y) { %1 = load <8 x i16>, ptr %x, align 16 %2 = tail call <8 x i16> @llvm.smax.v8i16(<8 x i16> %1, <8 x i16> <i16 -128, i16 -128, i16 -128, i16 -128, i16 -128, i16 -128, i16 -128, i16 -128>) %3 = tail call <8 x i16> @llvm.smin.v8i16(<8 x i16> %2, <8 x i16> <i16 127, i16 127, i16 127, i16 127, i16 127, i16 127, i16 127, i16 127>) %4 = trunc <8 x i16> %3 to <8 x i8> store <8 x i8> %4, ptr %y, align 8 ret void } ``` ## Before this patch: ``` trunc_sat_i8i16: # @trunc_maxmin_id_i8i16 vsetivli zero, 8, e16, m1, ta, ma vle16.v v8, (a0) li a0, -128 vmax.vx v8, v8, a0 li a0, 127 vmin.vx v8, v8, a0 vsetvli zero, zero, e8, mf2, ta, ma vnsrl.wi v8, v8, 0 vse8.v v8, (a1) ret ``` ## After this patch: ``` trunc_sat_i8i16: # @trunc_maxmin_id_i8i16 vsetivli zero, 8, e8, mf2, ta, ma vle16.v v8, (a0) csrwi vxrm, 0 vnclip.wi v8, v8, 0 vse8.v v8, (a1) ret ``` -
Nathan Ridge authored
For calls through a pointer to member, CXXMemberCallExpr::getCallee() is a BinaryOperator with operator ->* (after unwrapping parens). getMethodDecl() only returns non-null if the callee is a MemberExpr. Fixes https://github.com/clangd/clangd/issues/1873
-
wanglei authored
Adjusted the operand order of [X]VBITSELI_B to correctly match vselect.
-
Chia authored
This PR mainly aims at resolving the below missed-optimization case, while it could also be considered as an extension of the previous patch https://reviews.llvm.org/D133739?id= ## Missed-Optimization Case Compiler Explorer: https://godbolt.org/z/GzWzP7Pfh ### Source Code: ``` define <vscale x 2 x i16> @multiple_users(ptr %x, ptr %y, ptr %z) { %a = load <vscale x 2 x i8>, ptr %x %b = load <vscale x 2 x i8>, ptr %y %b2 = load <vscale x 2 x i8>, ptr %z %c = sext <vscale x 2 x i8> %a to <vscale x 2 x i16> %d = sext <vscale x 2 x i8> %b to <vscale x 2 x i16> %d2 = sext <vscale x 2 x i8> %b2 to <vscale x 2 x i16> %e = mul <vscale x 2 x i16> %c, %d %f = add <vscale x 2 x i16> %c, %d2 %g = sub <vscale x 2 x i16> %c, %d2 %h = or <vscale x 2 x i16> %e, %f %i = or <vscale x 2 x i16> %h, %g ret <vscale x 2 x i16> %i } ``` ### Before This Patch ``` # %bb.0: vsetvli a3, zero, e16, mf2, ta, ma vle8.v v8, (a0) vle8.v v9, (a1) vle8.v v10, (a2) svf2 v11, v8 vsext.vf2 v8, v9 vsext.vf2 v9, v10 vmul.vv v8, v11, v8 vadd.vv v10, v11, v9 vsub.vv v9, v11, v9 vor.vv v8, v8, v10 vor.vv v8, v8, v9 ret ``` ### After This Patch ``` # %bb.0: vsetvli a3, zero, e8, mf4, ta, ma vle8.v v8, (a0) vle8.v v9, (a1) vle8.v v10, (a2) vwmul.vv v11, v8, v9 vwadd.vv v9, v8, v10 vwsub.vv v12, v8, v10 vsetvli zero, zero, e16, mf2, ta, ma vor.vv v8, v11, v9 vor.vv v8, v8, v12 ret ``` We can see Add/Sub/Mul are combined with the Sign Extension. ## Relation to the Patch D133739 The patch D133739 introduced an optimization for folding `ADD_VL`/ `SUB_VL` / `MUL_V` with `VSEXT_VL` / `VZEXT_VL`. However, the patch did not consider the case of non-fixed length vector case, thus this PR could also be considered as an extension for the D133739. Furthermore, in the current `SelectionDAG`, we represent scalable vector add (or any binary operator) as a normal `ADD` operation. It might be better to use an Opcode like `ADD_VL`, which needs further conversation and decision.
-
wanglei authored
Remove the incorrect patterns for `XVREPL128VEI_{W/D}` instructions, and add correct patterns for XVREPLVE0_{W/D} instructions -
wanglei authored
Custom lowering `ISD::EXTRACT_VECTOR_ELT` with lasx.
-
Shengchen Kan authored
64ri -> 64ri32
-
Fangrui Song authored
To actually address my review comment in #75693
-
Fangrui Song authored
-