Files
clang-p2996/llvm/test/CodeGen/AArch64/memset.ll
Owen Anderson 06a4c85890 Use v16i8 rather than v2i64 as the VT for memset expansion on AArch64.
This allows the instruction selector to realize that it can directly
broadcast the low byte of the memset value, rather than replicating
it to a 64-bit GPR before broadcasting.

This fixes PR50985.

Differential Revision: https://reviews.llvm.org/D108354
2021-08-19 16:54:07 +00:00

19 lines
467 B
LLVM

; RUN: llc < %s | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-gnu"
; CHECK: memset_call:
; CHECK-NOT: and
; CHECK: dup
; CHECK-NEXT: stp
; CHECK-NEXT: stp
; CHECK-NEXT: ret
define void @memset_call(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
call void @llvm.memset.p0i8.i64(i8* %0, i8 %3, i64 64, i1 false)
ret void
}
declare void @llvm.memset.p0i8.i64(i8*, i8, i64, i1 immarg)