File: coroutine.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 (46 lines) | stat: -rw-r--r-- 1,624 bytes parent folder | download | duplicates (9)
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
37
38
39
40
41
42
43
44
45
46
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt -S -passes=loop-rotate < %s | FileCheck %s

declare void @bar()

@threadlocalint = thread_local global i32 0, align 4

define void @foo() #0 {
; CHECK-LABEL: define void @foo(
; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @threadlocalint)
; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
; CHECK-NEXT:    [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT:    br i1 [[CMP1]], label [[COND_END_LR_PH:%.*]], label [[COND_FALSE:%.*]]
; CHECK:       cond.end.lr.ph:
; CHECK-NEXT:    br label [[COND_END:%.*]]
; CHECK:       while.cond.cond.false_crit_edge:
; CHECK-NEXT:    br label [[COND_FALSE]]
; CHECK:       cond.false:
; CHECK-NEXT:    ret void
; CHECK:       cond.end:
; CHECK-NEXT:    call void @bar()
; CHECK-NEXT:    [[TMP2:%.*]] = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @threadlocalint)
; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32 [[TMP3]], 0
; CHECK-NEXT:    br i1 [[CMP]], label [[COND_END]], label [[WHILE_COND_COND_FALSE_CRIT_EDGE:%.*]]
;
entry:
  br label %while.cond

while.cond:
  %1 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @threadlocalint)
  %2 = load i32, ptr %1, align 4
  %cmp = icmp eq i32 %2, 0
  br i1 %cmp, label %cond.end, label %cond.false

cond.false:
  ret void

cond.end:
  call void @bar()
  br label %while.cond
}

attributes #0 = { presplitcoroutine }