• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; REQUIRES: asserts
2; RUN: llc < %s -mtriple=arm64-linux-gnu -mcpu=cortex-a53 -pre-RA-sched=source -enable-misched -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s
3;
4; For Cortex-A53, shiftable operands that are not actually shifted
5; are not needed for an additional two cycles.
6;
7; CHECK: ********** MI Scheduling **********
8; CHECK: shiftable
9; CHECK: SU(2):   %2:gpr64common = SUBXri %1:gpr64common, 20, 0
10; CHECK:   Successors:
11; CHECK-NEXT:    SU(4): Data Latency=1 Reg=%2
12; CHECK-NEXT:    SU(3): Data Latency=2 Reg=%2
13; CHECK: ********** INTERVALS **********
14define i64 @shiftable(i64 %A, i64 %B) {
15        %tmp0 = sub i64 %B, 20
16        %tmp1 = shl i64 %tmp0, 5;
17        %tmp2 = add i64 %A, %tmp1;
18        %tmp3 = add i64 %A, %tmp0
19        %tmp4 = mul i64 %tmp2, %tmp3
20
21        ret i64 %tmp4
22}
23