1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin8 -misched-print-dags -o - 2>&1 > /dev/null | FileCheck %s
4 @sc = common global i8 0
5 @uc = common global i8 0
6 @ui = common global i32 0
8 ; Regression Test for PR92368.
10 ; CHECK: SU(8): CMP8rr %4:gr8, %3:gr8, implicit-def $eflags
11 ; CHECK: Predecessors:
12 ; CHECK-NEXT: SU(6): Data Latency=0 Reg=%4
13 ; CHECK-NEXT: SU(7): Out Latency=0
14 ; CHECK-NEXT: SU(5): Out Latency=0
15 ; CHECK-NEXT: SU(3): Data Latency=4 Reg=%3
16 define void @misched_bug() nounwind {
18 %v0 = load i8, ptr @sc, align 1
19 %v1 = zext i8 %v0 to i32
20 %v2 = load i8, ptr @uc, align 1
21 %v3 = zext i8 %v2 to i32
22 %v4 = trunc i32 %v3 to i8
23 %v5 = trunc i32 %v1 to i8
24 %pair74 = cmpxchg ptr @sc, i8 %v4, i8 %v5 monotonic monotonic
25 %v6 = extractvalue { i8, i1 } %pair74, 0
26 %v7 = icmp eq i8 %v6, %v4
27 %v8 = zext i1 %v7 to i8
28 %v9 = zext i8 %v8 to i32
29 store i32 %v9, ptr @ui, align 4
32 return: ; preds = %ventry