From 3dc9abd7c5cae2136024faa6c6709ec73f3ba5a9 Mon Sep 17 00:00:00 2001 From: Michael Zolotukhin Date: Fri, 21 Aug 2015 00:08:39 +0000 Subject: [PATCH] [SLP] Add one more test case for propagating 'nontemporal' attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245644 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../SLPVectorizer/AArch64/nontemporal.ll | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/Transforms/SLPVectorizer/AArch64/nontemporal.ll b/test/Transforms/SLPVectorizer/AArch64/nontemporal.ll index d96356c4658..87d021d534c 100644 --- a/test/Transforms/SLPVectorizer/AArch64/nontemporal.ll +++ b/test/Transforms/SLPVectorizer/AArch64/nontemporal.ll @@ -44,4 +44,33 @@ entry: ret void } +; CHECK-LABEL: @foo2 +define void @foo2(float* noalias %a, float* noalias %b) { +entry: +; Check that we don't mark vector load with !nontemporal attribute if some of +; the original scalar loads don't have it. +; CHECK: %{{[0-9]*}} = load <4 x float>, <4 x float>* %{{[0-9]+}}, align 4{{$}} + %b1 = load float, float* %b, align 4, !nontemporal !0 + %arrayidx.1 = getelementptr inbounds float, float* %b, i64 1 + %b2 = load float, float* %arrayidx.1, align 4 + %arrayidx.2 = getelementptr inbounds float, float* %b, i64 2 + %b3 = load float, float* %arrayidx.2, align 4 + %arrayidx.3 = getelementptr inbounds float, float* %b, i64 3 + %b4 = load float, float* %arrayidx.3, align 4, !nontemporal !0 + +; Check that we don't mark vector store with !nontemporal attribute if some of +; the original scalar stores don't have it. +; CHECK: store <4 x float> %{{[0-9]+}}, <4 x float>* %{{[0-9]+}}, align 4{{$}} + store float %b1, float* %a, align 4, !nontemporal !0 + %arrayidx3.1 = getelementptr inbounds float, float* %a, i64 1 + store float %b2, float* %arrayidx3.1, align 4 + %arrayidx3.2 = getelementptr inbounds float, float* %a, i64 2 + store float %b3, float* %arrayidx3.2, align 4 + %arrayidx3.3 = getelementptr inbounds float, float* %a, i64 3 + store float %b4, float* %arrayidx3.3, align 4, !nontemporal !0 + +; CHECK: ret void + ret void +} + !0 = !{i32 1} -- 2.34.1