blob: 5df439389cdb01d14f402164088e6c8b7430ad78 [file] [log] [blame]
Lang Hamesc47e2832011-10-26 20:56:52 +00001; Make sure short memsets on ARM lower to stores, even when optimizing for size.
Akira Hatanaka2670f4a2015-07-28 22:44:28 +00002; RUN: llc -march=arm -mattr=+strict-align < %s | FileCheck %s -check-prefix=CHECK-GENERIC
Lang Hamesb85fcd02011-11-08 18:56:23 +00003; RUN: llc -march=arm -mcpu=cortex-a8 < %s | FileCheck %s -check-prefix=CHECK-UNALIGNED
Lang Hamesc47e2832011-10-26 20:56:52 +00004
5target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
6target triple = "thumbv7-apple-ios5.0.0"
7
Lang Hamesb85fcd02011-11-08 18:56:23 +00008; CHECK-GENERIC: strb
Nico Rieck76471782014-02-16 07:31:05 +00009; CHECK-GENERIC-NEXT: strb
10; CHECK-GENERIC-NEXT: strb
11; CHECK-GENERIC-NEXT: strb
12; CHECK-GENERIC-NEXT: strb
Andrew Trickd24698c2013-09-25 00:26:16 +000013; CHECK-UNALIGNED: strb
14; CHECK-UNALIGNED: str
Lang Hamesc47e2832011-10-26 20:56:52 +000015define void @foo(i8* nocapture %c) nounwind optsize {
16entry:
Pete Cooper67cf9a72015-11-19 05:56:52 +000017 call void @llvm.memset.p0i8.i64(i8* %c, i8 -1, i64 5, i32 1, i1 false)
Lang Hamesc47e2832011-10-26 20:56:52 +000018 ret void
19}
20
Pete Cooper67cf9a72015-11-19 05:56:52 +000021declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind