xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/ppc32-cyclecounter.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Workertarget datalayout = "E-m:e-p:32:32-i64:64-n32"
2*9880d681SAndroid Build Coastguard Workertarget triple = "powerpc"
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -mcpu=ppc < %s | FileCheck %s
4*9880d681SAndroid Build Coastguard Worker; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i64 @test1() nounwind {
7*9880d681SAndroid Build Coastguard Workerentry:
8*9880d681SAndroid Build Coastguard Worker  %r = call i64 @llvm.readcyclecounter()
9*9880d681SAndroid Build Coastguard Worker  ret i64 %r
10*9880d681SAndroid Build Coastguard Worker}
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; CHECK: @test1
13*9880d681SAndroid Build Coastguard Worker; CHECK: mfspr 3, 269
14*9880d681SAndroid Build Coastguard Worker; CHECK: mfspr 4, 268
15*9880d681SAndroid Build Coastguard Worker; CHECK: mfspr [[REG:[0-9]+]], 269
16*9880d681SAndroid Build Coastguard Worker; CHECK: cmpw 3, [[REG]]
17*9880d681SAndroid Build Coastguard Worker; CHECK: bne 0, .LBB
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerdeclare i64 @llvm.readcyclecounter()
20*9880d681SAndroid Build Coastguard Worker
21