xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/post-ra-ec.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Workertarget datalayout = "E-m:e-i64:64-n32:64"
3*9880d681SAndroid Build Coastguard Workertarget triple = "powerpc64-unknown-linux-gnu"
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker%struct.inode.0.12.120 = type { i8* }
6*9880d681SAndroid Build Coastguard Worker%struct.kstat2.1.13.121 = type { i32 }
7*9880d681SAndroid Build Coastguard Worker%struct.task_struct.4.16.124 = type { i8*, %struct.atomic_t.2.14.122, %struct.signal_struct.3.15.123* }
8*9880d681SAndroid Build Coastguard Worker%struct.atomic_t.2.14.122 = type { i32 }
9*9880d681SAndroid Build Coastguard Worker%struct.signal_struct.3.15.123 = type { i64 }
10*9880d681SAndroid Build Coastguard Worker%struct.pid.5.17.125 = type { i8* }
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind
13*9880d681SAndroid Build Coastguard Workerdefine signext i32 @proc_task_getattr(%struct.inode.0.12.120* nocapture readonly %inode, %struct.kstat2.1.13.121* nocapture %stat) #0 {
14*9880d681SAndroid Build Coastguard Workerentry:
15*9880d681SAndroid Build Coastguard Worker  %call1.i = tail call %struct.task_struct.4.16.124* @get_pid_task(%struct.pid.5.17.125* undef, i32 zeroext 0) #0
16*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %if.end, label %if.then
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerif.then:                                          ; preds = %entry
19*9880d681SAndroid Build Coastguard Worker  %0 = load i64, i64* undef, align 8
20*9880d681SAndroid Build Coastguard Worker  %conv.i = trunc i64 %0 to i32
21*9880d681SAndroid Build Coastguard Worker  %1 = load i32, i32* null, align 4
22*9880d681SAndroid Build Coastguard Worker  %add = add i32 %1, %conv.i
23*9880d681SAndroid Build Coastguard Worker  store i32 %add, i32* null, align 4
24*9880d681SAndroid Build Coastguard Worker  %counter.i.i = getelementptr inbounds %struct.task_struct.4.16.124, %struct.task_struct.4.16.124* %call1.i, i64 0, i32 1, i32 0
25*9880d681SAndroid Build Coastguard Worker  %2 = tail call i32 asm sideeffect "\09lwsync\0A1:\09lwarx\09$0,0,$1\09\09# atomic_dec_return\0A\09addic\09$0,$0,-1\0A\09stwcx.\09$0,0,$1\0A\09bne-\091b\0A\09sync\0A", "=&r,r,~{cr0},~{xer},~{memory}"(i32* %counter.i.i) #0
26*9880d681SAndroid Build Coastguard Worker  %cmp.i = icmp eq i32 %2, 0
27*9880d681SAndroid Build Coastguard Worker  br i1 %cmp.i, label %if.then.i, label %if.end
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @proc_task_getattr
30*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: stwcx. [[REG:[0-9]+]],0,[[REG]]
31*9880d681SAndroid Build Coastguard Worker; CHECK: blr
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Workerif.then.i:                                        ; preds = %if.then
34*9880d681SAndroid Build Coastguard Worker  %3 = bitcast %struct.task_struct.4.16.124* %call1.i to i8*
35*9880d681SAndroid Build Coastguard Worker  tail call void @foo(i8* %3) #0
36*9880d681SAndroid Build Coastguard Worker  unreachable
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Workerif.end:                                           ; preds = %if.then, %entry
39*9880d681SAndroid Build Coastguard Worker  ret i32 0
40*9880d681SAndroid Build Coastguard Worker}
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Workerdeclare void @foo(i8*)
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Workerdeclare %struct.task_struct.4.16.124* @get_pid_task(%struct.pid.5.17.125*, i32 zeroext)
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind }
47*9880d681SAndroid Build Coastguard Worker
48