Skip to content

Commit

Permalink
Clean comment in test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Mel-Chen committed Apr 12, 2024
1 parent 12a8cfa commit ac56a99
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions llvm/test/Transforms/LoopVectorize/iv-select-cmp-trunc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
; RUN: opt -passes=loop-vectorize -force-vector-interleave=4 -force-vector-width=4 -S < %s | FileCheck %s --check-prefix=CHECK-VF4IC4 --check-prefix=CHECK
; RUN: opt -passes=loop-vectorize -force-vector-interleave=4 -force-vector-width=1 -S < %s | FileCheck %s --check-prefix=CHECK-VF1IC4 --check-prefix=CHECK

; This test can theoretically be vectorized without a runtime-check, by
; pattern-matching on the constructs that are introduced by IndVarSimplify.
; We can check two things:
; %1 = trunc i64 %iv to i32
; This indicates that the %iv is truncated to i32. We can then check the loop
; guard is a signed i32:
; %cmp.sgt = icmp sgt i32 %n, 0
; and successfully vectorize the case without a runtime-check.
; About the truncated test cases, the range analysis of induction variable is
; used to ensure the induction variable is always greater than the sentinal
; value. The case is vectorizable if the truncated induction variable is
; monotonic increasing, and not equals to the sentinal.
define i32 @select_icmp_const_truncated_iv_widened_exit(ptr %a, i32 %n) {
; CHECK-VF4IC1-LABEL: define i32 @select_icmp_const_truncated_iv_widened_exit(
; CHECK-VF4IC1-SAME: ptr [[A:%.*]], i32 [[N:%.*]]) {
Expand Down Expand Up @@ -251,14 +247,8 @@ exit: ; preds = %for.body, %entry
ret i32 %rdx.lcssa
}

; This test can theoretically be vectorized without a runtime-check, by
; pattern-matching on the constructs that are introduced by IndVarSimplify.
; We can check two things:
; %1 = trunc i64 %iv to i32
; This indicates that the %iv is truncated to i32. We can then check the loop
; exit condition, which compares to a constant that fits within i32:
; %exitcond.not = icmp eq i64 %inc, 20000
; and successfully vectorize the case without a runtime-check.
; Without loop guard, the range analysis is also able to base on the constant
; trip count.
define i32 @select_icmp_const_truncated_iv_const_exit(ptr %a) {
; CHECK-VF4IC1-LABEL: define i32 @select_icmp_const_truncated_iv_const_exit(
; CHECK-VF4IC1-SAME: ptr [[A:%.*]]) {
Expand Down

0 comments on commit ac56a99

Please sign in to comment.