File: check-no-vectorize.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (32 lines) | stat: -rw-r--r-- 1,206 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; This test checks that we don't emit both
; successful and unsuccessful message about vectorization.

; REQUIRES: asserts
; RUN: opt -passes=loop-vectorize -debug -disable-output < %s 2>&1 | FileCheck %s
; CHECK-NOT: LV: We can vectorize this loop
; CHECK: LV: Not vectorizing: Cannot prove legality
; CHECK-NOT: LV: We can vectorize this loop

@a = global [32000 x i32] zeroinitializer, align 4

define void @foo(i32 %val1, i32 %val2) {
entry:
  br label %for.body

for.body:                                         ; preds = %entry, %for.body
  %0 = phi i32 [ %val1, %entry ], [ %add1, %for.body ]
  %1 = phi i32 [ %val2, %entry ], [ %2, %for.body ]
  %iv = phi i64 [ 1, %entry ], [ %iv.next, %for.body ]
  %arrayidx = getelementptr inbounds [32000 x i32], ptr @a, i64 0, i64 %iv
  %iv.next = add nuw nsw i64 %iv, 1
  %arrayidx2 = getelementptr inbounds [32000 x i32], ptr @a, i64 0, i64 %iv.next
  %2 = load i32, ptr %arrayidx2, align 4
  %add0 = add nsw i32 %2, %1
  %add1 = add nsw i32 %add0, %0
  store i32 %add1, ptr %arrayidx, align 4
  %exitcond = icmp eq i64 %iv.next, 31999
  br i1 %exitcond, label %exit, label %for.body

exit:                                 ; preds = %for.body
  ret void
}