[PATCH] D136456: [SelectionDAG] Clamp stack alignment for memset, memmove
Haohai, Wen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 00:00:46 PDT 2022
HaohaiWen added inline comments.
================
Comment at: llvm/test/CodeGen/X86/memset.ll:2-4
; RUN: llc < %s -mcpu=pentium2 -mtriple=i686-apple-darwin8.8.0 | FileCheck %s --check-prefix=X86
; RUN: llc < %s -mcpu=pentium3 -mtriple=i686-apple-darwin8.8.0 | FileCheck %s --check-prefix=XMM
; RUN: llc < %s -mcpu=bdver1 -mtriple=i686-apple-darwin8.8.0 | FileCheck %s --check-prefix=YMM
----------------
wxiao3 wrote:
> do we also need to test "-stackrealign" option to make sure vmovaps is generated?
We have tested aligned memset in llvm/test/CodeGen/X86/memset-inline.ll.
```
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=avx,-avx512f | FileCheck %s --check-prefixes=GPR,AVX
define void @aligned_memset_64(ptr align 64 %a, i8 %value) nounwind {
; AVX-LABEL: aligned_memset_64:
; AVX: # %bb.0:
; AVX-NEXT: vmovd %esi, %xmm0
; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX-NEXT: vpshufb %xmm1, %xmm0, %xmm0
; AVX-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
; AVX-NEXT: vmovaps %ymm0, 32(%rdi)
; AVX-NEXT: vmovaps %ymm0, (%rdi)
; AVX-NEXT: vzeroupper
; AVX-NEXT: retq
tail call void @llvm.memset.inline.p0.i64(ptr align 64 %a, i8 %value, i64 64, i1 0)
ret void
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136456/new/
https://reviews.llvm.org/D136456
More information about the llvm-commits
mailing list