1 //==-- AArch64Schedule.td - AArch64 Scheduling Definitions -*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Define TII for use in SchedVariant Predicates.
10 // const MachineInstr *MI and const TargetSchedModel *SchedModel
11 // are defined by default.
12 def : PredicateProlog<[{
13 const AArch64InstrInfo *TII =
14 static_cast<const AArch64InstrInfo*>(SchedModel->getInstrInfo());
18 // AArch64 Scheduler Definitions
20 def WriteImm : SchedWrite; // MOVN, MOVZ
21 // TODO: Provide variants for MOV32/64imm Pseudos that dynamically
22 // select the correct sequence of WriteImms.
24 def WriteI : SchedWrite; // ALU
25 def WriteISReg : SchedWrite; // ALU of Shifted-Reg
26 def WriteIEReg : SchedWrite; // ALU of Extended-Reg
27 def ReadI : SchedRead; // ALU
28 def ReadISReg : SchedRead; // ALU of Shifted-Reg
29 def ReadIEReg : SchedRead; // ALU of Extended-Reg
30 def WriteExtr : SchedWrite; // EXTR shifts a reg pair
31 def ReadExtrHi : SchedRead; // Read the high reg of the EXTR pair
32 def WriteIS : SchedWrite; // Shift/Scale
33 def WriteID32 : SchedWrite; // 32-bit Divide
34 def WriteID64 : SchedWrite; // 64-bit Divide
35 def ReadID : SchedRead; // 32/64-bit Divide
36 def WriteIM32 : SchedWrite; // 32-bit Multiply
37 def WriteIM64 : SchedWrite; // 64-bit Multiply
38 def ReadIM : SchedRead; // 32/64-bit Multiply
39 def ReadIMA : SchedRead; // 32/64-bit Multiply Accumulate
40 def WriteBr : SchedWrite; // Branch
41 def WriteBrReg : SchedWrite; // Indirect Branch
43 def WriteLD : SchedWrite; // Load from base addr plus immediate offset
44 def WriteST : SchedWrite; // Store to base addr plus immediate offset
45 def WriteSTP : SchedWrite; // Store a register pair.
46 def WriteAdr : SchedWrite; // Address pre/post increment.
48 def WriteLDIdx : SchedWrite; // Load from a register index (maybe scaled).
49 def WriteSTIdx : SchedWrite; // Store to a register index (maybe scaled).
50 def ReadAdrBase : SchedRead; // Read the base resister of a reg-offset LD/ST.
52 // Serialized two-level address load.
54 def WriteLDAdr : WriteSequence<[WriteAdr, WriteLD]>;
56 // Serialized two-level address lookup.
57 // EXAMPLE: MOVaddr...
58 def WriteAdrAdr : WriteSequence<[WriteAdr, WriteAdr]>;
60 // The second register of a load-pair.
61 // LDP,LDPSW,LDNP,LDXP,LDAXP
62 def WriteLDHi : SchedWrite;
64 // Store-exclusive is a store followed by a dependent load.
65 def WriteSTX : WriteSequence<[WriteST, WriteLD]>;
67 def WriteSys : SchedWrite; // Long, variable latency system ops.
68 def WriteBarrier : SchedWrite; // Memory barrier.
69 def WriteHint : SchedWrite; // Hint instruction.
71 def WriteF : SchedWrite; // General floating-point ops.
72 def WriteFCmp : SchedWrite; // Floating-point compare.
73 def WriteFCvt : SchedWrite; // Float conversion.
74 def WriteFCopy : SchedWrite; // Float-int register copy.
75 def WriteFImm : SchedWrite; // Floating-point immediate.
76 def WriteFMul : SchedWrite; // Floating-point multiply.
77 def WriteFDiv : SchedWrite; // Floating-point division.
79 def WriteV : SchedWrite; // Vector ops.
80 def WriteVLD : SchedWrite; // Vector loads.
81 def WriteVST : SchedWrite; // Vector stores.
83 def WriteAtomic : SchedWrite; // Atomic memory operations (CAS, Swap, LDOP)
85 // Read the unwritten lanes of the VLD's destination registers.
86 def ReadVLD : SchedRead;
88 // Sequential vector load and shuffle.
89 def WriteVLDShuffle : WriteSequence<[WriteVLD, WriteV]>;
90 def WriteVLDPairShuffle : WriteSequence<[WriteVLD, WriteV, WriteV]>;
92 // Store a shuffled vector.
93 def WriteVSTShuffle : WriteSequence<[WriteV, WriteVST]>;
94 def WriteVSTPairShuffle : WriteSequence<[WriteV, WriteV, WriteVST]>;