Files
clang-p2996/llvm/test/CodeGen/ARM/readcyclecounter.ll
David Green 351edf1c47 [ARM] Remove FeaturePerfMon from armv7-m
FeaturePerfMon relates to the PMU extensions available in armv7-a, and
should not be available in v7-m (it requires loading from a system
register with a mrc). Sink it down a level in the dependency map so that
it isn't present in ARMv7m or HasV8MMainlineOps.

It is also removed from the Neoverse-N2, as it will already be
transitively included.

Differential Revision: https://reviews.llvm.org/D117022
2022-01-12 09:44:53 +00:00

26 lines
1022 B
LLVM

; RUN: llc -mtriple=armv7-none-linux-gnueabi < %s | FileCheck %s
; RUN: llc -mtriple=thumbv7-none-linux-gnueabi < %s | FileCheck %s
; RUN: llc -mtriple=armv7-none-linux-gnueabi -mattr=-perfmon < %s | FileCheck %s --check-prefix=CHECK-NO-PERFMON
; RUN: llc -mtriple=armv7m-none-linux-gnueabi < %s | FileCheck %s --check-prefix=CHECK-NO-PERFMON
; RUN: llc -mtriple=armv6-none-linux-gnueabi < %s | FileCheck %s --check-prefix=CHECK-NO-PERFMON
; The performance monitor we're looking for is an ARMv7 extension. It should be
; possible to disable it, but realistically present on at least every v7-A
; processor (but not on v6, at least by default).
declare i64 @llvm.readcyclecounter()
define i64 @get_count() {
%val = call i64 @llvm.readcyclecounter()
ret i64 %val
; As usual, exact registers only sort of matter but the cycle-count had better
; end up in r0 in the end.
; CHECK: mrc p15, #0, r0, c9, c13, #0
; CHECK: {{movs?}} r1, #0
; CHECK-NO-PERFMON: {{movs?}} r0, #0
; CHECK-NO-PERFMON: {{movs?}} r1, #0
}