83 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=slp-vectorizer,dce < %s | FileCheck %s3target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"4target triple = "arm64-apple-ios5.0.0"5 6define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c) {7; CHECK-LABEL: @foo(8; CHECK-NEXT: entry:9; CHECK-NEXT: [[TMP1:%.*]] = load <4 x float>, ptr [[B:%.*]], align 4, !nontemporal !010; CHECK-NEXT: [[TMP3:%.*]] = load <4 x float>, ptr [[C:%.*]], align 411; CHECK-NEXT: [[TMP4:%.*]] = fadd <4 x float> [[TMP1]], [[TMP3]]12; CHECK-NEXT: store <4 x float> [[TMP4]], ptr [[A:%.*]], align 4, !nontemporal !013; CHECK-NEXT: ret void14;15entry:16; Check that we don't lose !nontemporal hint when vectorizing loads.17 %b1 = load float, ptr %b, align 4, !nontemporal !018 %arrayidx.1 = getelementptr inbounds float, ptr %b, i64 119 %b2 = load float, ptr %arrayidx.1, align 4, !nontemporal !020 %arrayidx.2 = getelementptr inbounds float, ptr %b, i64 221 %b3 = load float, ptr %arrayidx.2, align 4, !nontemporal !022 %arrayidx.3 = getelementptr inbounds float, ptr %b, i64 323 %b4 = load float, ptr %arrayidx.3, align 4, !nontemporal !024 25; Check that we don't introduce !nontemporal hint when the original scalar loads didn't have it.26 %c1 = load float, ptr %c, align 427 %arrayidx2.1 = getelementptr inbounds float, ptr %c, i64 128 %c2 = load float, ptr %arrayidx2.1, align 429 %arrayidx2.2 = getelementptr inbounds float, ptr %c, i64 230 %c3 = load float, ptr %arrayidx2.2, align 431 %arrayidx2.3 = getelementptr inbounds float, ptr %c, i64 332 %c4 = load float, ptr %arrayidx2.3, align 433 34 %a1 = fadd float %b1, %c135 %a2 = fadd float %b2, %c236 %a3 = fadd float %b3, %c337 %a4 = fadd float %b4, %c438 39; Check that we don't lose !nontemporal hint when vectorizing stores.40 store float %a1, ptr %a, align 4, !nontemporal !041 %arrayidx3.1 = getelementptr inbounds float, ptr %a, i64 142 store float %a2, ptr %arrayidx3.1, align 4, !nontemporal !043 %arrayidx3.2 = getelementptr inbounds float, ptr %a, i64 244 store float %a3, ptr %arrayidx3.2, align 4, !nontemporal !045 %arrayidx3.3 = getelementptr inbounds float, ptr %a, i64 346 store float %a4, ptr %arrayidx3.3, align 4, !nontemporal !047 48 ret void49}50 51define void @foo2(ptr noalias %a, ptr noalias %b) {52; CHECK-LABEL: @foo2(53; CHECK-NEXT: entry:54; CHECK-NEXT: [[TMP1:%.*]] = load <4 x float>, ptr [[B:%.*]], align 455; CHECK-NEXT: store <4 x float> [[TMP1]], ptr [[A:%.*]], align 456; CHECK-NEXT: ret void57;58entry:59; Check that we don't mark vector load with !nontemporal attribute if some of60; the original scalar loads don't have it.61 %b1 = load float, ptr %b, align 4, !nontemporal !062 %arrayidx.1 = getelementptr inbounds float, ptr %b, i64 163 %b2 = load float, ptr %arrayidx.1, align 464 %arrayidx.2 = getelementptr inbounds float, ptr %b, i64 265 %b3 = load float, ptr %arrayidx.2, align 466 %arrayidx.3 = getelementptr inbounds float, ptr %b, i64 367 %b4 = load float, ptr %arrayidx.3, align 4, !nontemporal !068 69; Check that we don't mark vector store with !nontemporal attribute if some of70; the original scalar stores don't have it.71 store float %b1, ptr %a, align 4, !nontemporal !072 %arrayidx3.1 = getelementptr inbounds float, ptr %a, i64 173 store float %b2, ptr %arrayidx3.1, align 474 %arrayidx3.2 = getelementptr inbounds float, ptr %a, i64 275 store float %b3, ptr %arrayidx3.2, align 476 %arrayidx3.3 = getelementptr inbounds float, ptr %a, i64 377 store float %b4, ptr %arrayidx3.3, align 4, !nontemporal !078 79 ret void80}81 82!0 = !{i32 1}83