2 ; RUN: llc < %s -mtriple=armv8r-eabi -mcpu=cortex-r52 -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s --check-prefix=CHECK --check-prefix=R52_SCHED
3 ; RUN: llc < %s -mtriple=armv8r-eabi -mcpu=cortex-r52plus -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s --check-prefix=CHECK --check-prefix=R52_SCHED
4 ; RUN: llc < %s -mtriple=armv8r-eabi -mcpu=generic -enable-misched -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC
6 ; Check the latency for instructions for both generic and cortex-r52.
7 ; Cortex-r52 machine model will cause the div to be sceduled before eor
8 ; as div takes more cycles to compute than eor.
10 ; CHECK: ********** MI Scheduling **********
11 ; CHECK: foo:%bb.0 entry
13 ; GENERIC: Latency : 1
14 ; R52_SCHED: Latency : 3
16 ; GENERIC: Latency : 2
17 ; R52_SCHED: Latency : 4
19 ; GENERIC: Latency : 0
20 ; R52_SCHED: Latency : 8
21 ; CHECK: ** Final schedule for %bb.0 ***
26 ; CHECK: ********** INTERVALS **********
28 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
29 target triple = "armv8r-arm-none-eabi"
31 ; Function Attrs: norecurse nounwind readnone
32 define hidden i32 @foo(i32 %a, i32 %b, i32 %c) local_unnamed_addr #0 {
35 %mul = mul nsw i32 %xor, %c
36 %add = add nsw i32 %mul, %a
37 %div = sdiv i32 %a, %b
38 %sub = sub i32 %add, %div