File: sle.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.4-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,998,488 kB
  • sloc: cpp: 6,951,470; ansic: 1,486,052; asm: 913,550; python: 232,020; f90: 80,126; objc: 75,349; lisp: 37,276; pascal: 16,990; sh: 9,935; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,164; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (31 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download | duplicates (7)
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
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
; RUN: opt -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 < %s 2>&1 | FileCheck %s

; ScalarEvolution should be able to use nsw information to prove that
; this loop has a finite trip count.

define void @le(i64 %n, ptr nocapture %p) nounwind {
; CHECK-LABEL: 'le'
; CHECK-NEXT:  Determining loop execution counts for: @le
; CHECK-NEXT:  Loop %for.body: backedge-taken count is %n
; CHECK-NEXT:  Loop %for.body: constant max backedge-taken count is i64 9223372036854775807
; CHECK-NEXT:  Loop %for.body: symbolic max backedge-taken count is %n
; CHECK-NEXT:  Loop %for.body: Trip multiple is 1
;
entry:
  %cmp6 = icmp slt i64 %n, 0                      ; <i1> [#uses=1]
  br i1 %cmp6, label %for.end, label %for.body

for.body:                                         ; preds = %for.body, %entry
  %i = phi i64 [ %i.next, %for.body ], [ 0, %entry ] ; <i64> [#uses=2]
  %arrayidx = getelementptr double, ptr %p, i64 %i    ; <ptr> [#uses=2]
  %t4 = load double, ptr %arrayidx                    ; <double> [#uses=1]
  %mul = fmul double %t4, 2.200000e+00            ; <double> [#uses=1]
  store double %mul, ptr %arrayidx
  %i.next = add nsw i64 %i, 1                     ; <i64> [#uses=2]
  %cmp = icmp sgt i64 %i.next, %n                 ; <i1> [#uses=1]
  br i1 %cmp, label %for.end, label %for.body

for.end:                                          ; preds = %for.body, %entry
  ret void
}