Relax an invariant that block placement was trying to assert a bit
[oota-llvm.git] / test / CodeGen / X86 / dec-eflags-lower.ll
1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
2
3 %struct.obj = type { i64 }
4
5 define void @_Z7releaseP3obj(%struct.obj* nocapture %o) nounwind uwtable ssp {
6 entry:
7 ; CHECK: decq   (%{{rdi|rcx}})
8 ; CHECK-NEXT: je
9   %refcnt = getelementptr inbounds %struct.obj* %o, i64 0, i32 0
10   %0 = load i64* %refcnt, align 8, !tbaa !0
11   %dec = add i64 %0, -1
12   store i64 %dec, i64* %refcnt, align 8, !tbaa !0
13   %tobool = icmp eq i64 %dec, 0
14   br i1 %tobool, label %if.end, label %return
15
16 if.end:                                           ; preds = %entry
17   %1 = bitcast %struct.obj* %o to i8*
18   tail call void @free(i8* %1)
19   br label %return
20
21 return:                                           ; preds = %entry, %if.end
22   ret void
23 }
24
25 declare void @free(i8* nocapture) nounwind
26
27 !0 = metadata !{metadata !"long", metadata !1}
28 !1 = metadata !{metadata !"omnipotent char", metadata !2}
29 !2 = metadata !{metadata !"Simple C/C++ TBAA", null}