1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S -passes=loop-rotate < %s | FileCheck %s
6 @threadlocalint = thread_local global i32 0, align 4
8 define void @foo() #0 {
9 ; CHECK-LABEL: define void @foo(
10 ; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
12 ; CHECK-NEXT: [[TMP0:%.*]] = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @threadlocalint)
13 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
14 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 0
15 ; CHECK-NEXT: br i1 [[CMP1]], label [[COND_END_LR_PH:%.*]], label [[COND_FALSE:%.*]]
16 ; CHECK: cond.end.lr.ph:
17 ; CHECK-NEXT: br label [[COND_END:%.*]]
18 ; CHECK: while.cond.cond.false_crit_edge:
19 ; CHECK-NEXT: br label [[COND_FALSE]]
21 ; CHECK-NEXT: ret void
23 ; CHECK-NEXT: call void @bar()
24 ; CHECK-NEXT: [[TMP2:%.*]] = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @threadlocalint)
25 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
26 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP3]], 0
27 ; CHECK-NEXT: br i1 [[CMP]], label [[COND_END]], label [[WHILE_COND_COND_FALSE_CRIT_EDGE:%.*]]
33 %1 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @threadlocalint)
34 %2 = load i32, ptr %1, align 4
35 %cmp = icmp eq i32 %2, 0
36 br i1 %cmp, label %cond.end, label %cond.false
46 attributes #0 = { presplitcoroutine }