brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · 3c54ed9 Raw
79 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42; RUN: opt -S -O3 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s3 4define internal void @acc(ptr noalias noundef %val, ptr noalias noundef %prev) {5entry:6  %0 = load i8, ptr %prev, align 17  %conv = zext i8 %0 to i328  %1 = load i8, ptr %val, align 19  %conv1 = zext i8 %1 to i3210  %add = add nsw i32 %conv1, %conv11  %conv2 = trunc i32 %add to i812  store i8 %conv2, ptr %val, align 113  ret void14}15 16; This loop should not get vectorized.17define void @accsum(ptr noundef %vals, i64 noundef %num) #0 {18; CHECK-LABEL: define void @accsum(19; CHECK-SAME: ptr noundef captures(none) [[VALS:%.*]], i64 noundef [[NUM:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {20; CHECK-NEXT:  entry:21; CHECK-NEXT:    [[CMP1:%.*]] = icmp ugt i64 [[NUM]], 122; CHECK-NEXT:    br i1 [[CMP1]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_END:%.*]]23; CHECK:       for.body.preheader:24; CHECK-NEXT:    [[LOAD_INITIAL:%.*]] = load i8, ptr [[VALS]], align 125; CHECK-NEXT:    br label [[FOR_BODY:%.*]]26; CHECK:       for.body:27; CHECK-NEXT:    [[STORE_FORWARDED:%.*]] = phi i8 [ [[LOAD_INITIAL]], [[FOR_BODY_PREHEADER]] ], [ [[ADD_I:%.*]], [[FOR_BODY]] ]28; CHECK-NEXT:    [[I_02:%.*]] = phi i64 [ 1, [[FOR_BODY_PREHEADER]] ], [ [[INC:%.*]], [[FOR_BODY]] ]29; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8, ptr [[VALS]], i64 [[I_02]]30; CHECK-NEXT:    [[TMP0:%.*]] = load i8, ptr [[ARRAYIDX]], align 1, !alias.scope [[META0:![0-9]+]], !noalias [[META3:![0-9]+]]31; CHECK-NEXT:    [[ADD_I]] = add i8 [[TMP0]], [[STORE_FORWARDED]]32; CHECK-NEXT:    store i8 [[ADD_I]], ptr [[ARRAYIDX]], align 1, !alias.scope [[META0]], !noalias [[META3]]33; CHECK-NEXT:    [[INC]] = add nuw i64 [[I_02]], 134; CHECK-NEXT:    [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INC]], [[NUM]]35; CHECK-NEXT:    br i1 [[EXITCOND_NOT]], label [[FOR_END]], label [[FOR_BODY]]36; CHECK:       for.end:37; CHECK-NEXT:    ret void38;39entry:40  br label %for.cond41 42for.cond:                                         ; preds = %for.inc, %entry43  %i.0 = phi i64 [ 1, %entry ], [ %inc, %for.inc ]44  %cmp = icmp ult i64 %i.0, %num45  br i1 %cmp, label %for.body, label %for.cond.cleanup46 47for.cond.cleanup:                                 ; preds = %for.cond48  br label %for.end49 50for.body:                                         ; preds = %for.cond51  %arrayidx = getelementptr inbounds i8, ptr %vals, i64 %i.052  %sub = sub i64 %i.0, 153  %arrayidx1 = getelementptr inbounds i8, ptr %vals, i64 %sub54  call void @acc(ptr noundef %arrayidx, ptr noundef %arrayidx1)55  br label %for.inc56 57for.inc:                                          ; preds = %for.body58  %inc = add i64 %i.0, 159  br label %for.cond60 61for.end:                                          ; preds = %for.cond.cleanup62  ret void63}64 65; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)66declare void @llvm.lifetime.start.p0(ptr nocapture) #167 68; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)69declare void @llvm.lifetime.end.p0(ptr nocapture) #170 71attributes #0 = { "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87"}72;.73; CHECK: [[META0]] = !{[[META1:![0-9]+]]}74; CHECK: [[META1]] = distinct !{[[META1]], [[META2:![0-9]+]], !"acc: %val"}75; CHECK: [[META2]] = distinct !{[[META2]], !"acc"}76; CHECK: [[META3]] = !{[[META4:![0-9]+]]}77; CHECK: [[META4]] = distinct !{[[META4]], [[META2]], !"acc: %prev"}78;.79