brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · f4817bb Raw
39 lines · plain
1; RUN: opt -passes=debugify,loop-vectorize \2; RUN: -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue \3; RUN: -mtriple=riscv64 -mattr=+v -riscv-v-vector-bits-max=128 -S < %s 2>&1 | FileCheck --check-prefix=DEBUGLOC %s4 5; Testing the debug locations of the generated vector intrinsic is same as6; its scalar counterpart.7 8define void @vp_select(ptr %a, ptr %b, ptr %c, i64 %N) {9; DEBUGLOC-LABEL: define void @vp_select(10; DEBUGLOC: vector.body:11; DEBUGLOC:   = select <vscale x 4 x i1> %{{.+}}, <vscale x 4 x i32> %{{.+}}, <vscale x 4 x i32> %{{.+}}, !dbg ![[SELLOC:[0-9]+]]12; DEBUGLOC: loop:13; DEBUGLOC:   = select i1 %{{.+}}, i32 %{{.+}}, i32 %{{.+}}, !dbg ![[SELLOC]]14;15 entry:16   br label %loop17 18loop:19   %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]20   %gep.b = getelementptr inbounds i32, ptr %b, i64 %iv21   %load.b = load i32, ptr %gep.b, align 422   %gep.c = getelementptr inbounds i32, ptr %c, i64 %iv23   %load.c = load i32, ptr %gep.c, align 424   %cmp = icmp sgt i32 %load.b, %load.c25   %neg.c = sub i32 0, %load.c26   %sel = select i1 %cmp, i32 %load.c, i32 %neg.c27   %add = add i32 %sel, %load.b28   %gep.a = getelementptr inbounds i32, ptr %a, i64 %iv29   store i32 %add, ptr %gep.a, align 430   %iv.next = add nuw nsw i64 %iv, 131   %exitcond = icmp eq i64 %iv.next, %N32   br i1 %exitcond, label %exit, label %loop33 34 exit:35   ret void36 }37 38 ; DEBUGLOC: [[SELLOC]] = !DILocation(line: 939