1 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-gep-opt=0 < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-gen-isel=false -ppc-gep-opt=0 < %s | FileCheck --check-prefix=CHECK-NO-ISEL %s
3 target datalayout = "E-m:e-i64:64-n32:64"
4 target triple = "powerpc64-unknown-linux-gnu"
6 ; Function Attrs: nounwind
7 define void @jbd2_journal_commit_transaction(i32 %input1, ptr %input2, ptr %input3, ptr %input4) #0 {
9 br label %while.body392
11 while.body392: ; preds = %wait_on_buffer.exit1319, %while.body392.lr.ph
12 %0 = load ptr, ptr %input4, align 8
13 %add.ptr399 = getelementptr inbounds i8, ptr %0, i64 -72
14 %ivar = add i32 %input1, 1
15 %tobool.i1316 = icmp eq i32 %input1, 0
16 br i1 %tobool.i1316, label %wait_on_buffer.exit1319, label %while.end418
18 wait_on_buffer.exit1319: ; preds = %while.body392
19 %1 = load volatile i64, ptr %add.ptr399, align 8
20 %conv.i.i1322 = and i64 %1, 1
21 %lnot404 = icmp eq i64 %conv.i.i1322, 0
22 %.err.4 = select i1 %lnot404, i32 -5, i32 %input1
23 %2 = call i64 asm sideeffect "1:.long 0x7c0000a8 $| ((($0) & 0x1f) << 21) $| (((0) & 0x1f) << 16) $| ((($3) & 0x1f) << 11) $| (((0) & 0x1) << 0) \0Aandc $0,$0,$2\0Astdcx. $0,0,$3\0Abne- 1b\0A", "=&r,=*m,r,r,*m,~{cc},~{memory}"(ptr elementtype(i64) %add.ptr399, i64 262144, ptr %add.ptr399, ptr elementtype(i64) %add.ptr399) #0
24 store ptr %0, ptr %input4, align 8
25 %cmp.i1312 = icmp eq ptr %input2, %input3
26 br i1 %cmp.i1312, label %while.end418, label %while.body392
28 while.end418: ; preds = %wait_on_buffer.exit1319, %do.body378
29 %err.4.lcssa = phi i32 [ %ivar, %while.body392 ], [ %.err.4, %wait_on_buffer.exit1319 ]
30 %tobool419 = icmp eq i32 %err.4.lcssa, 0
31 br i1 %tobool419, label %if.end421, label %if.then420
33 ; CHECK-LABEL: @jbd2_journal_commit_transaction
34 ; CHECK-NO-ISEL-LABEL: @jbd2_journal_commit_transaction
36 ; CHECK: crmove [[REG:[0-9]+]], 1
38 ; CHECK: isel {{[0-9]+}}, {{[0-9]+}}, {{[0-9]+}}, [[REG]]
39 ; CHECK-NO-ISEL: bc 12, 20, [[TRUE:.LBB[0-9]+]]
40 ; CHECK-NO-ISEL: ori 7, 8, 0
41 ; CHECK-NO-ISEL-NEXT: b [[SUCCESSOR:.LBB[0-9]+]]
42 ; CHECK-NO-ISEL: [[TRUE]]
43 ; CHECK-NO-ISEL: addi 7, 3, 0
45 if.then420: ; preds = %while.end418
48 if.end421: ; preds = %while.end418
53 attributes #0 = { nounwind }