35 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=loop-vectorize \3; RUN: -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue \4; RUN: -mtriple=riscv64 -mattr=+v -S < %s | FileCheck %s5 6; RUN: opt -passes=loop-vectorize \7; RUN: -prefer-predicate-over-epilogue=scalar-epilogue \8; RUN: -mtriple=riscv64 -mattr=+v -S < %s | FileCheck %s9 10; No need to emit predicated vector code if the vector instructions with masking are not required.11define i32 @no_masking() {12; CHECK-LABEL: @no_masking(13; CHECK-NEXT: entry:14; CHECK-NEXT: br label [[BODY:%.*]]15; CHECK: body:16; CHECK-NEXT: [[P:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[BODY]] ]17; CHECK-NEXT: [[INC]] = add i32 [[P]], 118; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[INC]], 019; CHECK-NEXT: br i1 [[CMP]], label [[END:%.*]], label [[BODY]]20; CHECK: end:21; CHECK-NEXT: ret i32 022;23entry:24 br label %body25 26body:27 %p = phi i32 [ 1, %entry ], [ %inc, %body ]28 %inc = add i32 %p, 129 %cmp = icmp eq i32 %inc, 030 br i1 %cmp, label %end, label %body31 32end:33 ret i32 034}35