brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 7c8accb Raw
81 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 62; RUN: opt < %s -passes=gvn -S | FileCheck %s3 4target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"5target triple = "x86_64-apple-macosx10.7.0"6 7; rdar://128015848; Value of %shouldExit can be changed by RunInMode.9; Make sure we do not replace load %shouldExit in while.cond.backedge10; with a phi node where the value from while.body is 0.11define i32 @test() nounwind ssp {12; CHECK-LABEL: define i32 @test(13; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {14; CHECK-NEXT:  [[ENTRY:.*:]]15; CHECK-NEXT:    [[SHOULDEXIT:%.*]] = alloca i32, align 416; CHECK-NEXT:    [[TASKSIDLE:%.*]] = alloca i32, align 417; CHECK-NEXT:    store i32 0, ptr [[SHOULDEXIT]], align 418; CHECK-NEXT:    store i32 0, ptr [[TASKSIDLE]], align 419; CHECK-NEXT:    call void @CTestInitialize(ptr [[TASKSIDLE]]) #[[ATTR1:[0-9]+]]20; CHECK-NEXT:    br i1 true, label %[[WHILE_BODY_LR_PH:.*]], label %[[ENTRY_WHILE_END_CRIT_EDGE:.*]]21; CHECK:       [[ENTRY_WHILE_END_CRIT_EDGE]]:22; CHECK-NEXT:    br label %[[WHILE_END:.*]]23; CHECK:       [[WHILE_BODY_LR_PH]]:24; CHECK-NEXT:    br label %[[WHILE_BODY:.*]]25; CHECK:       [[WHILE_BODY]]:26; CHECK-NEXT:    call void @RunInMode(i32 100) #[[ATTR1]]27; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[TASKSIDLE]], align 428; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 029; CHECK-NEXT:    br i1 [[TOBOOL]], label %[[WHILE_COND_BACKEDGE:.*]], label %[[IF_THEN:.*]]30; CHECK:       [[IF_THEN]]:31; CHECK-NEXT:    store i32 0, ptr [[TASKSIDLE]], align 432; CHECK-NEXT:    call void @TimerCreate(ptr [[SHOULDEXIT]]) #[[ATTR1]]33; CHECK-NEXT:    br label %[[WHILE_COND_BACKEDGE]]34; CHECK:       [[WHILE_COND_BACKEDGE]]:35; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[SHOULDEXIT]], align 436; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32 [[TMP1]], 037; CHECK-NEXT:    br i1 [[CMP]], label %[[WHILE_BODY]], label %[[WHILE_COND_WHILE_END_CRIT_EDGE:.*]]38; CHECK:       [[WHILE_COND_WHILE_END_CRIT_EDGE]]:39; CHECK-NEXT:    br label %[[WHILE_END]]40; CHECK:       [[WHILE_END]]:41; CHECK-NEXT:    ret i32 042;43entry:44  %shouldExit = alloca i32, align 445  %tasksIdle = alloca i32, align 446  store i32 0, ptr %shouldExit, align 447  store i32 0, ptr %tasksIdle, align 448  call void @CTestInitialize(ptr %tasksIdle) nounwind49  %0 = load i32, ptr %shouldExit, align 450  %cmp1 = icmp eq i32 %0, 051  br i1 %cmp1, label %while.body.lr.ph, label %while.end52 53while.body.lr.ph:54  br label %while.body55 56while.body:57  call void @RunInMode(i32 100) nounwind58  %1 = load i32, ptr %tasksIdle, align 459  %tobool = icmp eq i32 %1, 060  br i1 %tobool, label %while.cond.backedge, label %if.then61 62if.then:63  store i32 0, ptr %tasksIdle, align 464  call void @TimerCreate(ptr %shouldExit) nounwind65  br label %while.cond.backedge66 67while.cond.backedge:68  %2 = load i32, ptr %shouldExit, align 469  %cmp = icmp eq i32 %2, 070  br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge71 72while.cond.while.end_crit_edge:73  br label %while.end74 75while.end:76  ret i32 077}78declare void @CTestInitialize(ptr)79declare void @RunInMode(i32)80declare void @TimerCreate(ptr)81