1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -memcpyopt -S -verify-memoryssa | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 ; Verify that we don't combine nontemporal stores into memset calls.
8 define void @nontemporal_stores_1(<4 x float>* nocapture %dst) {
9 ; CHECK-LABEL: @nontemporal_stores_1(
11 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[DST:%.*]], align 16, !nontemporal !0
12 ; CHECK-NEXT: [[PTR1:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 1
13 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR1]], align 16, !nontemporal !0
14 ; CHECK-NEXT: [[PTR2:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 2
15 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR2]], align 16, !nontemporal !0
16 ; CHECK-NEXT: [[PTR3:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 3
17 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR3]], align 16, !nontemporal !0
18 ; CHECK-NEXT: [[PTR4:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 4
19 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR4]], align 16, !nontemporal !0
20 ; CHECK-NEXT: [[PTR5:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 5
21 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR5]], align 16, !nontemporal !0
22 ; CHECK-NEXT: [[PTR6:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 6
23 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR6]], align 16, !nontemporal !0
24 ; CHECK-NEXT: [[PTR7:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 7
25 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR7]], align 16, !nontemporal !0
26 ; CHECK-NEXT: ret void
29 store <4 x float> zeroinitializer, <4 x float>* %dst, align 16, !nontemporal !0
30 %ptr1 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 1
31 store <4 x float> zeroinitializer, <4 x float>* %ptr1, align 16, !nontemporal !0
32 %ptr2 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 2
33 store <4 x float> zeroinitializer, <4 x float>* %ptr2, align 16, !nontemporal !0
34 %ptr3 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 3
35 store <4 x float> zeroinitializer, <4 x float>* %ptr3, align 16, !nontemporal !0
36 %ptr4 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 4
37 store <4 x float> zeroinitializer, <4 x float>* %ptr4, align 16, !nontemporal !0
38 %ptr5 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 5
39 store <4 x float> zeroinitializer, <4 x float>* %ptr5, align 16, !nontemporal !0
40 %ptr6 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 6
41 store <4 x float> zeroinitializer, <4 x float>* %ptr6, align 16, !nontemporal !0
42 %ptr7 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 7
43 store <4 x float> zeroinitializer, <4 x float>* %ptr7, align 16, !nontemporal !0
47 define void @nontemporal_stores_2(<4 x float>* nocapture %dst) {
48 ; CHECK-LABEL: @nontemporal_stores_2(
50 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[DST:%.*]], align 16, !nontemporal !0
51 ; CHECK-NEXT: [[PTR1:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[DST]], i64 1
52 ; CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* [[PTR1]], align 16, !nontemporal !0
53 ; CHECK-NEXT: ret void
56 store <4 x float> zeroinitializer, <4 x float>* %dst, align 16, !nontemporal !0
57 %ptr1 = getelementptr inbounds <4 x float>, <4 x float>* %dst, i64 1
58 store <4 x float> zeroinitializer, <4 x float>* %ptr1, align 16, !nontemporal !0