File: objdump_cond_op_2.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (36 lines) | stat: -rw-r--r-- 1,048 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
32
33
34
35
36
; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s

; Source Code:
; int test(int a, int b) {
;   int s = 0;
;   while (a < b) { s++; a += s; b -= s; }
;   return s;
; }

define i32 @test(i32, i32) local_unnamed_addr #0 {
; CHECK-LABEL: <test>:
  %3 = icmp slt i32 %0, %1
  br i1 %3, label %4, label %13

; <label>:4:                                      ; preds = %2
  br label %5
; CHECK: if r4 s>= r3 goto +10 <test+0x90>

; <label>:5:                                      ; preds = %4, %5
  %6 = phi i32 [ %9, %5 ], [ 0, %4 ]
  %7 = phi i32 [ %11, %5 ], [ %1, %4 ]
  %8 = phi i32 [ %10, %5 ], [ %0, %4 ]
  %9 = add nuw nsw i32 %6, 1
  %10 = add nsw i32 %9, %8
  %11 = sub nsw i32 %7, %9
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %5, label %13
; CHECK: r1 = r3
; CHECK: if r2 s> r3 goto -10 <test+0x40>

; <label>:13:                                     ; preds = %5, %2
  %14 = phi i32 [ 0, %2 ], [ %9, %5 ]
  ret i32 %14
; CHECK: exit
}
attributes #0 = { norecurse nounwind readnone }