1 ; RUN: opt < %s -memcpyopt -S | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 ; Verify that we don't combine nontemporal stores into memset calls.
7 define void @nontemporal_stores_1(<4 x float>* nocapture %dst) {
8 ; CHECK-LABEL: @nontemporal_stores_1
9 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %dst, align 16, !nontemporal !0
10 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr1, align 16, !nontemporal !0
11 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr2, align 16, !nontemporal !0
12 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr3, align 16, !nontemporal !0
13 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr4, align 16, !nontemporal !0
14 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr5, align 16, !nontemporal !0
15 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr6, align 16, !nontemporal !0
16 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr7, align 16, !nontemporal !0
17 ; CHECK-NEXT: ret void
19 store <4 x float> zeroinitializer, <4 x float>* %dst, align 16, !nontemporal !0
20 %ptr1 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 1
21 store <4 x float> zeroinitializer, <4 x float>* %ptr1, align 16, !nontemporal !0
22 %ptr2 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 2
23 store <4 x float> zeroinitializer, <4 x float>* %ptr2, align 16, !nontemporal !0
24 %ptr3 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 3
25 store <4 x float> zeroinitializer, <4 x float>* %ptr3, align 16, !nontemporal !0
26 %ptr4 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 4
27 store <4 x float> zeroinitializer, <4 x float>* %ptr4, align 16, !nontemporal !0
28 %ptr5 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 5
29 store <4 x float> zeroinitializer, <4 x float>* %ptr5, align 16, !nontemporal !0
30 %ptr6 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 6
31 store <4 x float> zeroinitializer, <4 x float>* %ptr6, align 16, !nontemporal !0
32 %ptr7 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 7
33 store <4 x float> zeroinitializer, <4 x float>* %ptr7, align 16, !nontemporal !0
37 define void @nontemporal_stores_2(<4 x float>* nocapture %dst) {
38 ; CHECK-LABEL: @nontemporal_stores_2
39 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %dst, align 16, !nontemporal !0
40 ; CHECK: store <4 x float> zeroinitializer, <4 x float>* %ptr1, align 16, !nontemporal !0
41 ; CHECK-NEXT: ret void
43 store <4 x float> zeroinitializer, <4 x float>* %dst, align 16, !nontemporal !0
44 %ptr1 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 1
45 store <4 x float> zeroinitializer, <4 x float>* %ptr1, align 16, !nontemporal !0