| Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===- HexagonInstrInfo.h - Hexagon Instruction Information -----*- C++ -*-===// | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 2 | // | 
|  | 3 | //                     The LLVM Compiler Infrastructure | 
|  | 4 | // | 
|  | 5 | // This file is distributed under the University of Illinois Open Source | 
|  | 6 | // License. See LICENSE.TXT for details. | 
|  | 7 | // | 
|  | 8 | //===----------------------------------------------------------------------===// | 
|  | 9 | // | 
|  | 10 | // This file contains the Hexagon implementation of the TargetInstrInfo class. | 
|  | 11 | // | 
|  | 12 | //===----------------------------------------------------------------------===// | 
|  | 13 |  | 
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONINSTRINFO_H | 
|  | 15 | #define LLVM_LIB_TARGET_HEXAGON_HEXAGONINSTRINFO_H | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 16 |  | 
| Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 17 | #include "MCTargetDesc/HexagonBaseInfo.h" | 
| Eugene Zelenko | b2ca1b3 | 2017-01-04 02:02:05 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/ArrayRef.h" | 
|  | 19 | #include "llvm/ADT/SmallVector.h" | 
|  | 20 | #include "llvm/CodeGen/MachineBasicBlock.h" | 
| Eugene Zelenko | b2ca1b3 | 2017-01-04 02:02:05 +0000 | [diff] [blame] | 21 | #include "llvm/CodeGen/MachineValueType.h" | 
| Eugene Zelenko | 3b87336 | 2017-09-28 22:27:31 +0000 | [diff] [blame] | 22 | #include "llvm/CodeGen/ValueTypes.h" | 
| Chandler Carruth | 8a8cd2b | 2014-01-07 11:48:04 +0000 | [diff] [blame] | 23 | #include "llvm/Target/TargetInstrInfo.h" | 
| Eugene Zelenko | b2ca1b3 | 2017-01-04 02:02:05 +0000 | [diff] [blame] | 24 | #include <cstdint> | 
|  | 25 | #include <vector> | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 26 |  | 
|  | 27 | #define GET_INSTRINFO_HEADER | 
|  | 28 | #include "HexagonGenInstrInfo.inc" | 
|  | 29 |  | 
|  | 30 | namespace llvm { | 
|  | 31 |  | 
| Eric Christopher | 234a1ec | 2015-03-12 06:07:16 +0000 | [diff] [blame] | 32 | class HexagonSubtarget; | 
| Eugene Zelenko | 3b87336 | 2017-09-28 22:27:31 +0000 | [diff] [blame] | 33 | class MachineBranchProbabilityInfo; | 
|  | 34 | class MachineFunction; | 
|  | 35 | class MachineInstr; | 
|  | 36 | class MachineOperand; | 
|  | 37 | class TargetRegisterInfo; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 38 |  | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 39 | class HexagonInstrInfo : public HexagonGenInstrInfo { | 
| Krzysztof Parzyszek | 4697dde | 2017-10-04 18:00:15 +0000 | [diff] [blame] | 40 | const HexagonSubtarget &Subtarget; | 
| Eugene Zelenko | b2ca1b3 | 2017-01-04 02:02:05 +0000 | [diff] [blame] | 41 | virtual void anchor(); | 
|  | 42 |  | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 43 | public: | 
|  | 44 | explicit HexagonInstrInfo(HexagonSubtarget &ST); | 
|  | 45 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 46 | /// TargetInstrInfo overrides. | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 47 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 48 | /// If the specified machine instruction is a direct | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 49 | /// load from a stack slot, return the virtual or physical register number of | 
|  | 50 | /// the destination along with the FrameIndex of the loaded stack slot.  If | 
|  | 51 | /// not, return 0.  This predicate must return 0 if the instruction has | 
|  | 52 | /// any side effects other than loading from the stack slot. | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 53 | unsigned isLoadFromStackSlot(const MachineInstr &MI, | 
| Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 54 | int &FrameIndex) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 55 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 56 | /// If the specified machine instruction is a direct | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 57 | /// store to a stack slot, return the virtual or physical register number of | 
|  | 58 | /// the source reg along with the FrameIndex of the loaded stack slot.  If | 
|  | 59 | /// not, return 0.  This predicate must return 0 if the instruction has | 
|  | 60 | /// any side effects other than storing to the stack slot. | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 61 | unsigned isStoreToStackSlot(const MachineInstr &MI, | 
| Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 62 | int &FrameIndex) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 63 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 64 | /// Analyze the branching code at the end of MBB, returning | 
|  | 65 | /// true if it cannot be understood (e.g. it's a switch dispatch or isn't | 
|  | 66 | /// implemented for a target).  Upon success, this returns false and returns | 
|  | 67 | /// with the following information in various cases: | 
|  | 68 | /// | 
|  | 69 | /// 1. If this block ends with no branches (it just falls through to its succ) | 
|  | 70 | ///    just return false, leaving TBB/FBB null. | 
|  | 71 | /// 2. If this block ends with only an unconditional branch, it sets TBB to be | 
|  | 72 | ///    the destination block. | 
|  | 73 | /// 3. If this block ends with a conditional branch and it falls through to a | 
|  | 74 | ///    successor block, it sets TBB to be the branch destination block and a | 
|  | 75 | ///    list of operands that evaluate the condition. These operands can be | 
|  | 76 | ///    passed to other TargetInstrInfo methods to create new branches. | 
|  | 77 | /// 4. If this block ends with a conditional branch followed by an | 
|  | 78 | ///    unconditional branch, it returns the 'true' destination in TBB, the | 
|  | 79 | ///    'false' destination in FBB, and a list of operands that evaluate the | 
|  | 80 | ///    condition.  These operands can be passed to other TargetInstrInfo | 
|  | 81 | ///    methods to create new branches. | 
|  | 82 | /// | 
| Matt Arsenault | 1b9fc8e | 2016-09-14 20:43:16 +0000 | [diff] [blame] | 83 | /// Note that removeBranch and insertBranch must be implemented to support | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 84 | /// cases where this method returns success. | 
|  | 85 | /// | 
|  | 86 | /// If AllowModify is true, then this routine is allowed to modify the basic | 
|  | 87 | /// block (e.g. delete instructions after the unconditional branch). | 
| Jacques Pienaar | 71c30a1 | 2016-07-15 14:41:04 +0000 | [diff] [blame] | 88 | bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, | 
|  | 89 | MachineBasicBlock *&FBB, | 
|  | 90 | SmallVectorImpl<MachineOperand> &Cond, | 
|  | 91 | bool AllowModify) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 92 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 93 | /// Remove the branching code at the end of the specific MBB. | 
|  | 94 | /// This is only invoked in cases where AnalyzeBranch returns success. It | 
|  | 95 | /// returns the number of instructions that were removed. | 
| Matt Arsenault | 1b9fc8e | 2016-09-14 20:43:16 +0000 | [diff] [blame] | 96 | unsigned removeBranch(MachineBasicBlock &MBB, | 
| Matt Arsenault | a2b036e | 2016-09-14 17:23:48 +0000 | [diff] [blame] | 97 | int *BytesRemoved = nullptr) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 98 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 99 | /// Insert branch code into the end of the specified MachineBasicBlock. | 
|  | 100 | /// The operands to this method are the same as those | 
|  | 101 | /// returned by AnalyzeBranch.  This is only invoked in cases where | 
|  | 102 | /// AnalyzeBranch returns success. It returns the number of instructions | 
|  | 103 | /// inserted. | 
|  | 104 | /// | 
|  | 105 | /// It is also invoked by tail merging to add unconditional branches in | 
|  | 106 | /// cases where AnalyzeBranch doesn't apply because there was no original | 
|  | 107 | /// branch to analyze.  At least this much must be implemented, else tail | 
|  | 108 | /// merging needs to be disabled. | 
| Matt Arsenault | e8e0f5c | 2016-09-14 17:24:15 +0000 | [diff] [blame] | 109 | unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, | 
| Ahmed Bougacha | c88bf54 | 2015-06-11 19:30:37 +0000 | [diff] [blame] | 110 | MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond, | 
| Matt Arsenault | a2b036e | 2016-09-14 17:23:48 +0000 | [diff] [blame] | 111 | const DebugLoc &DL, | 
|  | 112 | int *BytesAdded = nullptr) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 113 |  | 
| Brendon Cahoon | 254f889 | 2016-07-29 16:44:44 +0000 | [diff] [blame] | 114 | /// Analyze the loop code, return true if it cannot be understood. Upon | 
|  | 115 | /// success, this function returns false and returns information about the | 
|  | 116 | /// induction variable and compare instruction used at the end. | 
|  | 117 | bool analyzeLoop(MachineLoop &L, MachineInstr *&IndVarInst, | 
|  | 118 | MachineInstr *&CmpInst) const override; | 
|  | 119 |  | 
|  | 120 | /// Generate code to reduce the loop iteration by one and check if the loop is | 
|  | 121 | /// finished.  Return the value/register of the the new loop count.  We need | 
|  | 122 | /// this function when peeling off one or more iterations of a loop. This | 
|  | 123 | /// function assumes the nth iteration is peeled first. | 
|  | 124 | unsigned reduceLoopCount(MachineBasicBlock &MBB, | 
| Krzysztof Parzyszek | 8fb181c | 2016-08-01 17:55:48 +0000 | [diff] [blame] | 125 | MachineInstr *IndVar, MachineInstr &Cmp, | 
| Brendon Cahoon | 254f889 | 2016-07-29 16:44:44 +0000 | [diff] [blame] | 126 | SmallVectorImpl<MachineOperand> &Cond, | 
|  | 127 | SmallVectorImpl<MachineInstr *> &PrevInsts, | 
|  | 128 | unsigned Iter, unsigned MaxIter) const override; | 
|  | 129 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 130 | /// Return true if it's profitable to predicate | 
|  | 131 | /// instructions with accumulated instruction latency of "NumCycles" | 
|  | 132 | /// of the specified basic block, where the probability of the instructions | 
|  | 133 | /// being executed is given by Probability, and Confidence is a measure | 
|  | 134 | /// of our confidence that it will be properly predicted. | 
|  | 135 | bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, | 
|  | 136 | unsigned ExtraPredCycles, | 
|  | 137 | BranchProbability Probability) const override; | 
| Krzysztof Parzyszek | cfe285e | 2013-02-11 20:04:29 +0000 | [diff] [blame] | 138 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 139 | /// Second variant of isProfitableToIfCvt. This one | 
|  | 140 | /// checks for the case where two basic blocks from true and false path | 
|  | 141 | /// of a if-then-else (diamond) are predicated on mutally exclusive | 
|  | 142 | /// predicates, where the probability of the true path being taken is given | 
|  | 143 | /// by Probability, and Confidence is a measure of our confidence that it | 
|  | 144 | /// will be properly predicted. | 
|  | 145 | bool isProfitableToIfCvt(MachineBasicBlock &TMBB, | 
|  | 146 | unsigned NumTCycles, unsigned ExtraTCycles, | 
|  | 147 | MachineBasicBlock &FMBB, | 
|  | 148 | unsigned NumFCycles, unsigned ExtraFCycles, | 
|  | 149 | BranchProbability Probability) const override; | 
|  | 150 |  | 
|  | 151 | /// Return true if it's profitable for if-converter to duplicate instructions | 
|  | 152 | /// of specified accumulated instruction latencies in the specified MBB to | 
|  | 153 | /// enable if-conversion. | 
|  | 154 | /// The probability of the instructions being executed is given by | 
|  | 155 | /// Probability, and Confidence is a measure of our confidence that it | 
|  | 156 | /// will be properly predicted. | 
|  | 157 | bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, | 
|  | 158 | BranchProbability Probability) const override; | 
|  | 159 |  | 
|  | 160 | /// Emit instructions to copy a pair of physical registers. | 
|  | 161 | /// | 
|  | 162 | /// This function should support copies within any legal register class as | 
|  | 163 | /// well as any cross-class copies created during instruction selection. | 
|  | 164 | /// | 
|  | 165 | /// The source and destination registers may overlap, which may require a | 
|  | 166 | /// careful implementation when multiple copy instructions are required for | 
|  | 167 | /// large registers. See for example the ARM target. | 
| Benjamin Kramer | bdc4956 | 2016-06-12 15:39:02 +0000 | [diff] [blame] | 168 | void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, | 
|  | 169 | const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, | 
| Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 170 | bool KillSrc) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 171 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 172 | /// Store the specified register of the given register class to the specified | 
|  | 173 | /// stack frame index. The store instruction is to be added to the given | 
|  | 174 | /// machine basic block before the specified machine instruction. If isKill | 
|  | 175 | /// is true, the register operand is the last use and must be marked kill. | 
| Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 176 | void storeRegToStackSlot(MachineBasicBlock &MBB, | 
|  | 177 | MachineBasicBlock::iterator MBBI, | 
|  | 178 | unsigned SrcReg, bool isKill, int FrameIndex, | 
|  | 179 | const TargetRegisterClass *RC, | 
|  | 180 | const TargetRegisterInfo *TRI) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 181 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 182 | /// Load the specified register of the given register class from the specified | 
|  | 183 | /// stack frame index. The load instruction is to be added to the given | 
|  | 184 | /// machine basic block before the specified machine instruction. | 
| Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 185 | void loadRegFromStackSlot(MachineBasicBlock &MBB, | 
|  | 186 | MachineBasicBlock::iterator MBBI, | 
|  | 187 | unsigned DestReg, int FrameIndex, | 
|  | 188 | const TargetRegisterClass *RC, | 
|  | 189 | const TargetRegisterInfo *TRI) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 190 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 191 | /// This function is called for all pseudo instructions | 
| Colin LeMahieu | 7b1799c | 2015-03-09 22:05:21 +0000 | [diff] [blame] | 192 | /// that remain after register allocation. Many pseudo instructions are | 
|  | 193 | /// created to help register allocation. This is the place to convert them | 
|  | 194 | /// into real instructions. The target can edit MI in place, or it can insert | 
|  | 195 | /// new instructions and erase MI. The function should return true if | 
|  | 196 | /// anything was changed. | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 197 | bool expandPostRAPseudo(MachineInstr &MI) const override; | 
| Colin LeMahieu | 7b1799c | 2015-03-09 22:05:21 +0000 | [diff] [blame] | 198 |  | 
| Brendon Cahoon | 254f889 | 2016-07-29 16:44:44 +0000 | [diff] [blame] | 199 | /// \brief Get the base register and byte offset of a load/store instr. | 
|  | 200 | bool getMemOpBaseRegImmOfs(MachineInstr &LdSt, unsigned &BaseReg, | 
|  | 201 | int64_t &Offset, | 
|  | 202 | const TargetRegisterInfo *TRI) const override; | 
|  | 203 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 204 | /// Reverses the branch condition of the specified condition list, | 
|  | 205 | /// returning false on success and true if it cannot be reversed. | 
| Matt Arsenault | 1b9fc8e | 2016-09-14 20:43:16 +0000 | [diff] [blame] | 206 | bool reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 207 | const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 208 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 209 | /// Insert a noop into the instruction stream at the specified point. | 
|  | 210 | void insertNoop(MachineBasicBlock &MBB, | 
|  | 211 | MachineBasicBlock::iterator MI) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 212 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 213 | /// Returns true if the instruction is already predicated. | 
| Duncan P. N. Exon Smith | 6307eb5 | 2016-02-23 02:46:52 +0000 | [diff] [blame] | 214 | bool isPredicated(const MachineInstr &MI) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 215 |  | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 216 | /// Return true for post-incremented instructions. | 
| Krzysztof Parzyszek | 8fb181c | 2016-08-01 17:55:48 +0000 | [diff] [blame] | 217 | bool isPostIncrement(const MachineInstr &MI) const override; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 218 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 219 | /// Convert the instruction into a predicated instruction. | 
|  | 220 | /// It returns true if the operation was successful. | 
| Duncan P. N. Exon Smith | 6307eb5 | 2016-02-23 02:46:52 +0000 | [diff] [blame] | 221 | bool PredicateInstruction(MachineInstr &MI, | 
| Ahmed Bougacha | c88bf54 | 2015-06-11 19:30:37 +0000 | [diff] [blame] | 222 | ArrayRef<MachineOperand> Cond) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 223 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 224 | /// Returns true if the first specified predicate | 
|  | 225 | /// subsumes the second, e.g. GE subsumes GT. | 
| Ahmed Bougacha | c88bf54 | 2015-06-11 19:30:37 +0000 | [diff] [blame] | 226 | bool SubsumesPredicate(ArrayRef<MachineOperand> Pred1, | 
|  | 227 | ArrayRef<MachineOperand> Pred2) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 228 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 229 | /// If the specified instruction defines any predicate | 
|  | 230 | /// or condition code register(s) used for predication, returns true as well | 
|  | 231 | /// as the definition predicate(s) by reference. | 
| Duncan P. N. Exon Smith | 6307eb5 | 2016-02-23 02:46:52 +0000 | [diff] [blame] | 232 | bool DefinesPredicate(MachineInstr &MI, | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 233 | std::vector<MachineOperand> &Pred) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 234 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 235 | /// Return true if the specified instruction can be predicated. | 
|  | 236 | /// By default, this returns true for every instruction with a | 
|  | 237 | /// PredicateOperand. | 
| Krzysztof Parzyszek | cc31871 | 2017-03-03 18:30:54 +0000 | [diff] [blame] | 238 | bool isPredicable(const MachineInstr &MI) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 239 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 240 | /// Test if the given instruction should be considered a scheduling boundary. | 
|  | 241 | /// This primarily includes labels and terminators. | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 242 | bool isSchedulingBoundary(const MachineInstr &MI, | 
| Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 243 | const MachineBasicBlock *MBB, | 
|  | 244 | const MachineFunction &MF) const override; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 245 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 246 | /// Measure the specified inline asm to determine an approximation of its | 
|  | 247 | /// length. | 
|  | 248 | unsigned getInlineAsmLength(const char *Str, | 
|  | 249 | const MCAsmInfo &MAI) const override; | 
|  | 250 |  | 
|  | 251 | /// Allocate and return a hazard recognizer to use for this target when | 
|  | 252 | /// scheduling the machine instructions after register allocation. | 
|  | 253 | ScheduleHazardRecognizer* | 
| Eugene Zelenko | 3b87336 | 2017-09-28 22:27:31 +0000 | [diff] [blame] | 254 | CreateTargetPostRAHazardRecognizer(const InstrItineraryData *II, | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 255 | const ScheduleDAG *DAG) const override; | 
|  | 256 |  | 
|  | 257 | /// For a comparison instruction, return the source registers | 
|  | 258 | /// in SrcReg and SrcReg2 if having two register operands, and the value it | 
|  | 259 | /// compares against in CmpValue. Return true if the comparison instruction | 
|  | 260 | /// can be analyzed. | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 261 | bool analyzeCompare(const MachineInstr &MI, unsigned &SrcReg, | 
|  | 262 | unsigned &SrcReg2, int &Mask, int &Value) const override; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 263 |  | 
|  | 264 | /// Compute the instruction latency of a given instruction. | 
|  | 265 | /// If the instruction has higher cost when predicated, it's returned via | 
|  | 266 | /// PredCost. | 
|  | 267 | unsigned getInstrLatency(const InstrItineraryData *ItinData, | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 268 | const MachineInstr &MI, | 
| Eugene Zelenko | b2ca1b3 | 2017-01-04 02:02:05 +0000 | [diff] [blame] | 269 | unsigned *PredCost = nullptr) const override; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 270 |  | 
|  | 271 | /// Create machine specific model for scheduling. | 
|  | 272 | DFAPacketizer * | 
|  | 273 | CreateTargetScheduleState(const TargetSubtargetInfo &STI) const override; | 
|  | 274 |  | 
|  | 275 | // Sometimes, it is possible for the target | 
|  | 276 | // to tell, even without aliasing information, that two MIs access different | 
|  | 277 | // memory addresses. This function returns true if two MIs access different | 
|  | 278 | // memory addresses and false otherwise. | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 279 | bool | 
|  | 280 | areMemAccessesTriviallyDisjoint(MachineInstr &MIa, MachineInstr &MIb, | 
|  | 281 | AliasAnalysis *AA = nullptr) const override; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 282 |  | 
| Brendon Cahoon | 254f889 | 2016-07-29 16:44:44 +0000 | [diff] [blame] | 283 | /// For instructions with a base and offset, return the position of the | 
|  | 284 | /// base register and offset operands. | 
| Krzysztof Parzyszek | 8fb181c | 2016-08-01 17:55:48 +0000 | [diff] [blame] | 285 | bool getBaseAndOffsetPosition(const MachineInstr &MI, unsigned &BasePos, | 
| Brendon Cahoon | 254f889 | 2016-07-29 16:44:44 +0000 | [diff] [blame] | 286 | unsigned &OffsetPos) const override; | 
|  | 287 |  | 
|  | 288 | /// If the instruction is an increment of a constant value, return the amount. | 
| Krzysztof Parzyszek | 8fb181c | 2016-08-01 17:55:48 +0000 | [diff] [blame] | 289 | bool getIncrementValue(const MachineInstr &MI, int &Value) const override; | 
| Brendon Cahoon | 254f889 | 2016-07-29 16:44:44 +0000 | [diff] [blame] | 290 |  | 
| Krzysztof Parzyszek | 2af5037 | 2017-05-03 20:10:36 +0000 | [diff] [blame] | 291 | /// getOperandLatency - Compute and return the use operand latency of a given | 
|  | 292 | /// pair of def and use. | 
|  | 293 | /// In most cases, the static scheduling itinerary was enough to determine the | 
|  | 294 | /// operand latency. But it may not be possible for instructions with variable | 
|  | 295 | /// number of defs / uses. | 
|  | 296 | /// | 
|  | 297 | /// This is a raw interface to the itinerary that may be directly overriden by | 
|  | 298 | /// a target. Use computeOperandLatency to get the best estimate of latency. | 
|  | 299 | int getOperandLatency(const InstrItineraryData *ItinData, | 
|  | 300 | const MachineInstr &DefMI, unsigned DefIdx, | 
|  | 301 | const MachineInstr &UseMI, | 
|  | 302 | unsigned UseIdx) const override; | 
|  | 303 |  | 
| Krzysztof Parzyszek | 0ac065f | 2017-07-10 18:31:02 +0000 | [diff] [blame] | 304 | /// Decompose the machine operand's target flags into two values - the direct | 
|  | 305 | /// target flag value and any of bit flags that are applied. | 
|  | 306 | std::pair<unsigned, unsigned> | 
|  | 307 | decomposeMachineOperandsTargetFlags(unsigned TF) const override; | 
|  | 308 |  | 
|  | 309 | /// Return an array that contains the direct target flag values and their | 
|  | 310 | /// names. | 
|  | 311 | /// | 
|  | 312 | /// MIR Serialization is able to serialize only the target flags that are | 
|  | 313 | /// defined by this method. | 
|  | 314 | ArrayRef<std::pair<unsigned, const char *>> | 
|  | 315 | getSerializableDirectMachineOperandTargetFlags() const override; | 
|  | 316 |  | 
|  | 317 | /// Return an array that contains the bitmask target flag values and their | 
|  | 318 | /// names. | 
|  | 319 | /// | 
|  | 320 | /// MIR Serialization is able to serialize only the target flags that are | 
|  | 321 | /// defined by this method. | 
|  | 322 | ArrayRef<std::pair<unsigned, const char *>> | 
|  | 323 | getSerializableBitmaskMachineOperandTargetFlags() const override; | 
|  | 324 |  | 
| Dean Michael Berris | 6d6addb | 2016-09-01 01:58:24 +0000 | [diff] [blame] | 325 | bool isTailCall(const MachineInstr &MI) const override; | 
|  | 326 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 327 | /// HexagonInstrInfo specifics. | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 328 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 329 | unsigned createVR(MachineFunction* MF, MVT VT) const; | 
|  | 330 |  | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 331 | bool isAbsoluteSet(const MachineInstr &MI) const; | 
|  | 332 | bool isAccumulator(const MachineInstr &MI) const; | 
|  | 333 | bool isComplex(const MachineInstr &MI) const; | 
|  | 334 | bool isCompoundBranchInstr(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 335 | bool isConstExtended(const MachineInstr &MI) const; | 
|  | 336 | bool isDeallocRet(const MachineInstr &MI) const; | 
|  | 337 | bool isDependent(const MachineInstr &ProdMI, | 
|  | 338 | const MachineInstr &ConsMI) const; | 
|  | 339 | bool isDotCurInst(const MachineInstr &MI) const; | 
|  | 340 | bool isDotNewInst(const MachineInstr &MI) const; | 
|  | 341 | bool isDuplexPair(const MachineInstr &MIa, const MachineInstr &MIb) const; | 
|  | 342 | bool isEarlySourceInstr(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 343 | bool isEndLoopN(unsigned Opcode) const; | 
|  | 344 | bool isExpr(unsigned OpType) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 345 | bool isExtendable(const MachineInstr &MI) const; | 
|  | 346 | bool isExtended(const MachineInstr &MI) const; | 
|  | 347 | bool isFloat(const MachineInstr &MI) const; | 
|  | 348 | bool isHVXMemWithAIndirect(const MachineInstr &I, | 
|  | 349 | const MachineInstr &J) const; | 
|  | 350 | bool isIndirectCall(const MachineInstr &MI) const; | 
|  | 351 | bool isIndirectL4Return(const MachineInstr &MI) const; | 
|  | 352 | bool isJumpR(const MachineInstr &MI) const; | 
|  | 353 | bool isJumpWithinBranchRange(const MachineInstr &MI, unsigned offset) const; | 
|  | 354 | bool isLateInstrFeedsEarlyInstr(const MachineInstr &LRMI, | 
|  | 355 | const MachineInstr &ESMI) const; | 
|  | 356 | bool isLateResultInstr(const MachineInstr &MI) const; | 
|  | 357 | bool isLateSourceInstr(const MachineInstr &MI) const; | 
|  | 358 | bool isLoopN(const MachineInstr &MI) const; | 
|  | 359 | bool isMemOp(const MachineInstr &MI) const; | 
|  | 360 | bool isNewValue(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 361 | bool isNewValue(unsigned Opcode) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 362 | bool isNewValueInst(const MachineInstr &MI) const; | 
|  | 363 | bool isNewValueJump(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 364 | bool isNewValueJump(unsigned Opcode) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 365 | bool isNewValueStore(const MachineInstr &MI) const; | 
| Jyotsna Verma | 300f0b9 | 2013-05-10 20:27:34 +0000 | [diff] [blame] | 366 | bool isNewValueStore(unsigned Opcode) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 367 | bool isOperandExtended(const MachineInstr &MI, unsigned OperandNum) const; | 
| Duncan P. N. Exon Smith | 6307eb5 | 2016-02-23 02:46:52 +0000 | [diff] [blame] | 368 | bool isPredicatedNew(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 369 | bool isPredicatedNew(unsigned Opcode) const; | 
| Duncan P. N. Exon Smith | 6307eb5 | 2016-02-23 02:46:52 +0000 | [diff] [blame] | 370 | bool isPredicatedTrue(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 371 | bool isPredicatedTrue(unsigned Opcode) const; | 
|  | 372 | bool isPredicated(unsigned Opcode) const; | 
|  | 373 | bool isPredicateLate(unsigned Opcode) const; | 
|  | 374 | bool isPredictedTaken(unsigned Opcode) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 375 | bool isSaveCalleeSavedRegsCall(const MachineInstr &MI) const; | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 376 | bool isSignExtendingLoad(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 377 | bool isSolo(const MachineInstr &MI) const; | 
|  | 378 | bool isSpillPredRegOp(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 379 | bool isTC1(const MachineInstr &MI) const; | 
|  | 380 | bool isTC2(const MachineInstr &MI) const; | 
|  | 381 | bool isTC2Early(const MachineInstr &MI) const; | 
|  | 382 | bool isTC4x(const MachineInstr &MI) const; | 
|  | 383 | bool isToBeScheduledASAP(const MachineInstr &MI1, | 
|  | 384 | const MachineInstr &MI2) const; | 
| Krzysztof Parzyszek | 2af5037 | 2017-05-03 20:10:36 +0000 | [diff] [blame] | 385 | bool isHVXVec(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 386 | bool isValidAutoIncImm(const EVT VT, const int Offset) const; | 
| Krzysztof Parzyszek | 5577297 | 2017-09-15 15:46:05 +0000 | [diff] [blame] | 387 | bool isValidOffset(unsigned Opcode, int Offset, | 
|  | 388 | const TargetRegisterInfo *TRI, bool Extend = true) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 389 | bool isVecAcc(const MachineInstr &MI) const; | 
|  | 390 | bool isVecALU(const MachineInstr &MI) const; | 
|  | 391 | bool isVecUsableNextPacket(const MachineInstr &ProdMI, | 
|  | 392 | const MachineInstr &ConsMI) const; | 
| Duncan P. N. Exon Smith | 9cfc75c | 2016-06-30 00:01:54 +0000 | [diff] [blame] | 393 | bool isZeroExtendingLoad(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 394 |  | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 395 | bool addLatencyToSchedule(const MachineInstr &MI1, | 
|  | 396 | const MachineInstr &MI2) const; | 
|  | 397 | bool canExecuteInBundle(const MachineInstr &First, | 
|  | 398 | const MachineInstr &Second) const; | 
| Krzysztof Parzyszek | 1b689da | 2016-08-11 21:14:25 +0000 | [diff] [blame] | 399 | bool doesNotReturn(const MachineInstr &CallMI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 400 | bool hasEHLabel(const MachineBasicBlock *B) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 401 | bool hasNonExtEquivalent(const MachineInstr &MI) const; | 
|  | 402 | bool hasPseudoInstrPair(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 403 | bool hasUncondBranch(const MachineBasicBlock *B) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 404 | bool mayBeCurLoad(const MachineInstr &MI) const; | 
|  | 405 | bool mayBeNewStore(const MachineInstr &MI) const; | 
|  | 406 | bool producesStall(const MachineInstr &ProdMI, | 
|  | 407 | const MachineInstr &ConsMI) const; | 
|  | 408 | bool producesStall(const MachineInstr &MI, | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 409 | MachineBasicBlock::const_instr_iterator MII) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 410 | bool predCanBeUsedAsDotNew(const MachineInstr &MI, unsigned PredReg) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 411 | bool PredOpcodeHasJMP_c(unsigned Opcode) const; | 
|  | 412 | bool predOpcodeHasNot(ArrayRef<MachineOperand> Cond) const; | 
|  | 413 |  | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 414 | short getAbsoluteForm(const MachineInstr &MI) const; | 
|  | 415 | unsigned getAddrMode(const MachineInstr &MI) const; | 
|  | 416 | unsigned getBaseAndOffset(const MachineInstr &MI, int &Offset, | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 417 | unsigned &AccessSize) const; | 
| Krzysztof Parzyszek | f5cbac9 | 2016-04-29 15:49:13 +0000 | [diff] [blame] | 418 | short getBaseWithLongOffset(short Opcode) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 419 | short getBaseWithLongOffset(const MachineInstr &MI) const; | 
|  | 420 | short getBaseWithRegOffset(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 421 | SmallVector<MachineInstr*,2> getBranchingInstrs(MachineBasicBlock& MBB) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 422 | unsigned getCExtOpNum(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 423 | HexagonII::CompoundGroup | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 424 | getCompoundCandidateGroup(const MachineInstr &MI) const; | 
|  | 425 | unsigned getCompoundOpcode(const MachineInstr &GA, | 
|  | 426 | const MachineInstr &GB) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 427 | int getCondOpcode(int Opc, bool sense) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 428 | int getDotCurOp(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | 0a8043e | 2017-05-03 15:28:56 +0000 | [diff] [blame] | 429 | int getNonDotCurOp(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 430 | int getDotNewOp(const MachineInstr &MI) const; | 
|  | 431 | int getDotNewPredJumpOp(const MachineInstr &MI, | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 432 | const MachineBranchProbabilityInfo *MBPI) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 433 | int getDotNewPredOp(const MachineInstr &MI, | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 434 | const MachineBranchProbabilityInfo *MBPI) const; | 
| Krzysztof Parzyszek | 143158b | 2017-03-06 17:03:16 +0000 | [diff] [blame] | 435 | int getDotOldOp(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 436 | HexagonII::SubInstructionGroup getDuplexCandidateGroup(const MachineInstr &MI) | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 437 | const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 438 | short getEquivalentHWInstr(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 439 | MachineInstr *getFirstNonDbgInst(MachineBasicBlock *BB) const; | 
|  | 440 | unsigned getInstrTimingClassLatency(const InstrItineraryData *ItinData, | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 441 | const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 442 | bool getInvertedPredSense(SmallVectorImpl<MachineOperand> &Cond) const; | 
|  | 443 | unsigned getInvertedPredicatedOpcode(const int Opc) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 444 | int getMaxValue(const MachineInstr &MI) const; | 
|  | 445 | unsigned getMemAccessSize(const MachineInstr &MI) const; | 
|  | 446 | int getMinValue(const MachineInstr &MI) const; | 
|  | 447 | short getNonExtOpcode(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 448 | bool getPredReg(ArrayRef<MachineOperand> Cond, unsigned &PredReg, | 
|  | 449 | unsigned &PredRegPos, unsigned &PredRegFlags) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 450 | short getPseudoInstrPair(const MachineInstr &MI) const; | 
|  | 451 | short getRegForm(const MachineInstr &MI) const; | 
|  | 452 | unsigned getSize(const MachineInstr &MI) const; | 
|  | 453 | uint64_t getType(const MachineInstr &MI) const; | 
|  | 454 | unsigned getUnits(const MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 455 |  | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 456 | /// getInstrTimingClassLatency - Compute the instruction latency of a given | 
|  | 457 | /// instruction using Timing Class information, if available. | 
|  | 458 | unsigned nonDbgBBSize(const MachineBasicBlock *BB) const; | 
|  | 459 | unsigned nonDbgBundleSize(MachineBasicBlock::const_iterator BundleHead) const; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 460 |  | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 461 | void immediateExtend(MachineInstr &MI) const; | 
|  | 462 | bool invertAndChangeJumpTarget(MachineInstr &MI, | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 463 | MachineBasicBlock* NewTarget) const; | 
|  | 464 | void genAllInsnTimingClasses(MachineFunction &MF) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 465 | bool reversePredSense(MachineInstr &MI) const; | 
| Krzysztof Parzyszek | b9a1c3a | 2015-11-24 14:55:26 +0000 | [diff] [blame] | 466 | unsigned reversePrediction(unsigned Opcode) const; | 
|  | 467 | bool validateBranchCond(const ArrayRef<MachineOperand> &Cond) const; | 
| Krzysztof Parzyszek | f0b34a5 | 2016-07-29 21:49:42 +0000 | [diff] [blame] | 468 | short xformRegToImmOffset(const MachineInstr &MI) const; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 469 | }; | 
|  | 470 |  | 
| Eugene Zelenko | b2ca1b3 | 2017-01-04 02:02:05 +0000 | [diff] [blame] | 471 | } // end namespace llvm | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 472 |  | 
| Eugene Zelenko | b2ca1b3 | 2017-01-04 02:02:05 +0000 | [diff] [blame] | 473 | #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONINSTRINFO_H |