|
| 1 | +; RUN: opt -passes=debugify,loop-vectorize \ |
| 2 | +; RUN: -force-tail-folding-style=data-with-evl \ |
| 3 | +; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \ |
| 4 | +; RUN: -mtriple=riscv64 -mattr=+v -riscv-v-vector-bits-max=128 -S < %s 2>&1 | FileCheck --check-prefix=DEBUGLOC %s |
| 5 | + |
| 6 | +; Testing the debug locations of the generated vector intstruction are same as |
| 7 | +; their scalar instruction. |
| 8 | + |
| 9 | +; DEBUGLOC-LABEL: define void @vp_select( |
| 10 | +define void @vp_select(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) { |
| 11 | +; DEBUGLOC: vector.body: |
| 12 | +; DEBUGLOC: %[[VPSel:[0-9]+]] = call <vscale x 4 x i32> @llvm.vp.select.nxv4i32(<vscale x 4 x i1> %15, <vscale x 4 x i32> %vp.op.load1, <vscale x 4 x i32> %vp.op, i32 %9) |
| 13 | +; DEBUGLOC: for.body: |
| 14 | +; DEBUGLOC: %cond.p = select i1 %cmp4, i32 %22, i32 %23, !dbg !39 |
| 15 | + entry: |
| 16 | + br label %for.body |
| 17 | + |
| 18 | + for.body: |
| 19 | + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] |
| 20 | + %arrayidx = getelementptr inbounds i32, ptr %b, i64 %indvars.iv |
| 21 | + %0 = load i32, ptr %arrayidx, align 4 |
| 22 | + %arrayidx3 = getelementptr inbounds i32, ptr %c, i64 %indvars.iv |
| 23 | + %1 = load i32, ptr %arrayidx3, align 4 |
| 24 | + %cmp4 = icmp sgt i32 %0, %1 |
| 25 | + %2 = sub i32 0, %1 |
| 26 | + %cond.p = select i1 %cmp4, i32 %1, i32 %2 |
| 27 | + %cond = add i32 %cond.p, %0 |
| 28 | + %arrayidx15 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv |
| 29 | + store i32 %cond, ptr %arrayidx15, align 4 |
| 30 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 31 | + %exitcond.not = icmp eq i64 %indvars.iv.next, %N |
| 32 | + br i1 %exitcond.not, label %exit, label %for.body |
| 33 | + |
| 34 | + exit: |
| 35 | + ret void |
| 36 | + } |
0 commit comments