1; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s 2; PHI elimination shouldn't break backedge. 3; rdar://8263994 4 5%struct.list_data_s = type { i16, i16 } 6%struct.list_head = type { %struct.list_head*, %struct.list_data_s* } 7 8define arm_apcscc %struct.list_head* @t(%struct.list_head* %list) nounwind { 9entry: 10 %0 = icmp eq %struct.list_head* %list, null 11 br i1 %0, label %bb2, label %bb 12 13bb: 14; CHECK: LBB0_2: 15; CHECK: bne LBB0_2 16; CHECK-NOT: b LBB0_2 17; CHECK: bx lr 18 %list_addr.05 = phi %struct.list_head* [ %2, %bb ], [ %list, %entry ] 19 %next.04 = phi %struct.list_head* [ %list_addr.05, %bb ], [ null, %entry ] 20 %1 = getelementptr inbounds %struct.list_head* %list_addr.05, i32 0, i32 0 21 %2 = load %struct.list_head** %1, align 4 22 store %struct.list_head* %next.04, %struct.list_head** %1, align 4 23 %3 = icmp eq %struct.list_head* %2, null 24 br i1 %3, label %bb2, label %bb 25 26bb2: 27 %next.0.lcssa = phi %struct.list_head* [ null, %entry ], [ %list_addr.05, %bb ] 28 ret %struct.list_head* %next.0.lcssa 29} 30