brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 344a6d0 Raw
62 lines · plain
1; RUN: opt %loadNPMPolly -S '-passes=polly<no-default-opts>' -polly-annotate-metadata-vectorize < %s | FileCheck %s2 3; Basic verification of vectorize metadata getting added when "-polly-vectorize-metadata" is4; passed.5 6; void add(int *A, int *B, int *C,int n) {7;    for(int i=0; i<n; i++)8;      C[i] += A[i] + B[i];9; }10 11; CHECK: for.body:12; CHECK: br {{.*}} !llvm.loop [[LOOP:![0-9]+]]13; CHECK: polly.stmt.for.body:14; CHECK: br {{.*}} !llvm.loop [[POLLY_LOOP:![0-9]+]]15; CHECK: [[LOOP]] = distinct !{[[LOOP]], [[META2:![0-9]+]], [[META3:![0-9]+]]}16; CHECK: [[META3]] = !{!"llvm.loop.vectorize.enable", i32 0}17; CHECK: [[POLLY_LOOP]] = distinct !{[[POLLY_LOOP]], [[META2:![0-9]+]], [[META3:![0-9]+]]}18; CHECK: [[META3]] = !{!"llvm.loop.vectorize.enable", i1 true}19 20target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"21target triple = "aarch64-unknown-linux-gnu"22 23; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable24define dso_local void @add(ptr nocapture noundef readonly %A, ptr nocapture noundef readonly %B, ptr nocapture noundef %C, i32 noundef %n) local_unnamed_addr #0 {25entry:26  br label %entry.split27 28entry.split:                                      ; preds = %entry29  %cmp10 = icmp sgt i32 %n, 030  br i1 %cmp10, label %for.body.preheader, label %for.cond.cleanup31 32for.body.preheader:                               ; preds = %entry.split33  %wide.trip.count = zext nneg i32 %n to i6434  br label %for.body35 36for.cond.cleanup.loopexit:                        ; preds = %for.body37  br label %for.cond.cleanup38 39for.cond.cleanup:                                 ; preds = %for.cond.cleanup.loopexit, %entry.split40  ret void41 42for.body:                                         ; preds = %for.body.preheader, %for.body43  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]44  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv45  %0 = load i32, ptr %arrayidx, align 446  %arrayidx2 = getelementptr inbounds i32, ptr %B, i64 %indvars.iv47  %1 = load i32, ptr %arrayidx2, align 448  %add = add nsw i32 %1, %049  %arrayidx4 = getelementptr inbounds i32, ptr %C, i64 %indvars.iv50  %2 = load i32, ptr %arrayidx4, align 451  %add5 = add nsw i32 %add, %252  store i32 %add5, ptr %arrayidx4, align 453  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 154  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count55  br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !056}57 58attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cortex-a57" "target-features"="+aes,+crc,+fp-armv8,+neon,+outline-atomics,+perfmon,+sha2,+v8a,-fmv" }59 60!0 = distinct !{!0, !1}61!1 = !{!"llvm.loop.mustprogress"}62