2 ; RUN: llc < %s -mtriple=armv8r-eabi -mcpu=cortex-a57 -enable-misched -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s
3 ; RUN: llc < %s -mtriple=armv8r-eabi -mcpu=cortex-a57 -mattr=+use-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s --check-prefix=POST-MISCHED
5 ; Check the latency for ALU shifted operand variants.
7 ; CHECK: ********** MI Scheduling **********
8 ; CHECK: foo:%bb.0 entry
10 ; ALU, basic - 1 cyc I0/I1
13 ; CHECK-NEXT: Latency : 1
15 ; ALU, shift by immed - 2 cyc M
18 ; CHECK-NEXT: Latency : 2
20 ; ALU, shift by register, unconditional - 2 cyc M
23 ; CHECK-NEXT: Latency : 2
25 ; ALU, shift by register, conditional - 2 cyc I0/I1
28 ; CHECK-NEXT: Latency : 2
30 ; Checking scheduling units
32 ; CHECK: ** ScheduleDAGMILive::schedule picking next node
34 ; CHECK: ** ScheduleDAGMILive::schedule picking next node
38 ; CHECK-NEXT: A57UnitI
40 ; CHECK: ** ScheduleDAGMILive::schedule picking next node
44 ; CHECK-NEXT: A57UnitI
46 ; CHECK: ** ScheduleDAGMILive::schedule picking next node
50 ; CHECK-NEXT: A57UnitM
52 ; CHECK: ** ScheduleDAGMILive::schedule picking next node
56 ; CHECK-NEXT: A57UnitM
58 ; CHECK: ** ScheduleDAGMILive::schedule picking next node
62 ; CHECK-NEXT: A57UnitI
64 ; Check that post RA MI scheduler is invoked with +use-misched
65 ; POST-MISCHED: Before post-MI-sched
67 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
68 target triple = "armv8r-arm-none-eabi"
70 ; Function Attrs: norecurse nounwind readnone
71 define hidden i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) local_unnamed_addr #0 {
74 %xor_shl = shl i32 %xor, 2
75 %add = add i32 %xor_shl, %d
76 %add_ashr = ashr i32 %add, %a
77 %sub = sub i32 %add_ashr, %a
78 %sub_lshr_pred = lshr i32 %sub, %c
79 %pred = icmp sgt i32 %a, 4
80 %and = and i32 %sub_lshr_pred, %b
81 %rv = select i1 %pred, i32 %and, i32 %d