• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=aarch64-unknown-unknown -asm-verbose=false < %s |\
2; RUN:   FileCheck %s --check-prefix=CHECK --check-prefix=PERFMON
3; RUN: llc -mtriple=aarch64-unknown-unknown -mattr=-perfmon -asm-verbose=false < %s |\
4; RUN:   FileCheck %s --check-prefix=CHECK --check-prefix=NOPERFMON
5
6define i64 @test_readcyclecounter() nounwind {
7  ; CHECK-LABEL:   test_readcyclecounter:
8  ; PERFMON-NEXT:   mrs x0, PMCCNTR_EL0
9  ; NOPERFMON-NEXT: mov x0, xzr
10  ; CHECK-NEXT:     ret
11  %tmp0 = call i64 @llvm.readcyclecounter()
12  ret i64 %tmp0
13}
14
15declare i64 @llvm.readcyclecounter()
16