File: basic.ll

package info (click to toggle)
llvm-3.0 3.0-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 75,412 kB
  • sloc: cpp: 468,043; asm: 109,345; ansic: 13,782; sh: 12,935; ml: 4,716; python: 4,351; perl: 2,096; makefile: 1,905; pascal: 1,578; exp: 389; xml: 283; lisp: 187; csh: 117
file content (24 lines) | stat: -rw-r--r-- 656 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: opt < %s -loop-unroll -S | FileCheck %s


; This should not unroll since the address of the loop header is taken.

; CHECK: @test1
; CHECK: store i8* blockaddress(@test1, %l1), i8** %P
; CHECK: l1:
; CHECK-NEXT: phi i32
; rdar://8287027
define i32 @test1(i8** %P) nounwind ssp {
entry:
  store i8* blockaddress(@test1, %l1), i8** %P
  br label %l1

l1:                                               ; preds = %l1, %entry
  %x.0 = phi i32 [ 0, %entry ], [ %inc, %l1 ]
  %inc = add nsw i32 %x.0, 1
  %exitcond = icmp eq i32 %inc, 3
  br i1 %exitcond, label %l2, label %l1

l2:                                               ; preds = %l1
  ret i32 0
}