brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · bb3f37d Raw
35 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt %s -passes=loop-vectorize,instcombine,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=x86_64-unknown-linux-gnu -mattr=avx512vl,avx512dq,avx512bw -S | FileCheck %s3 4@bytes = global [128 x i8] zeroinitializer, align 165 6; Make sure we end up with vector code for this loop. We used to try to create7; a VF=64,UF=4 loop, but the scalar trip count is only 128 so8; the vector loop was dead code leaving only a scalar remainder.9define zeroext i8 @sum() {10; CHECK-LABEL: @sum(11; CHECK-NEXT:  entry:12; CHECK-NEXT:    [[WIDE_LOAD2:%.*]] = load <64 x i8>, ptr getelementptr inbounds nuw (i8, ptr @bytes, i64 64), align 113; CHECK-NEXT:    [[WIDE_LOAD:%.*]] = load <64 x i8>, ptr @bytes, align 114; CHECK-NEXT:    [[BIN_RDX:%.*]] = add <64 x i8> [[WIDE_LOAD2]], [[WIDE_LOAD]]15; CHECK-NEXT:    [[TMP0:%.*]] = call i8 @llvm.vector.reduce.add.v64i8(<64 x i8> [[BIN_RDX]])16; CHECK-NEXT:    ret i8 [[TMP0]]17;18entry:19  br label %for.body20 21for.body:                                         ; preds = %for.body, %entry22  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]23  %r.010 = phi i8 [ 0, %entry ], [ %add, %for.body ]24  %arrayidx = getelementptr inbounds [128 x i8], ptr @bytes, i64 0, i64 %indvars.iv25  %0 = load i8, ptr %arrayidx, align 126  %add = add i8 %0, %r.01027  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 128  %exitcond = icmp eq i64 %indvars.iv.next, 12829  br i1 %exitcond, label %for.end, label %for.body30 31for.end:                                          ; preds = %for.body32  %add.lcssa = phi i8 [ %add, %for.body ]33  ret i8 %add.lcssa34}35