Alex Bradbury | 8971842 | 2017-10-19 21:37:38 +0000 | [diff] [blame] | 1 | //===-- RISCVInstrInfo.cpp - RISCV Instruction Information ------*- C++ -*-===// |
| 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 RISCV implementation of the TargetInstrInfo class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "RISCVInstrInfo.h" |
| 15 | #include "RISCV.h" |
| 16 | #include "RISCVSubtarget.h" |
| 17 | #include "RISCVTargetMachine.h" |
| 18 | #include "llvm/ADT/STLExtras.h" |
| 19 | #include "llvm/ADT/SmallVector.h" |
| 20 | #include "llvm/CodeGen/MachineFunctionPass.h" |
| 21 | #include "llvm/CodeGen/MachineInstrBuilder.h" |
| 22 | #include "llvm/CodeGen/MachineRegisterInfo.h" |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 23 | #include "llvm/CodeGen/RegisterScavenging.h" |
Alex Bradbury | 8971842 | 2017-10-19 21:37:38 +0000 | [diff] [blame] | 24 | #include "llvm/Support/ErrorHandling.h" |
| 25 | #include "llvm/Support/TargetRegistry.h" |
| 26 | |
| 27 | #define GET_INSTRINFO_CTOR_DTOR |
| 28 | #include "RISCVGenInstrInfo.inc" |
| 29 | |
| 30 | using namespace llvm; |
| 31 | |
Alex Bradbury | a337675 | 2017-11-08 13:41:21 +0000 | [diff] [blame] | 32 | RISCVInstrInfo::RISCVInstrInfo() |
| 33 | : RISCVGenInstrInfo(RISCV::ADJCALLSTACKDOWN, RISCV::ADJCALLSTACKUP) {} |
Alex Bradbury | cfa6291 | 2017-11-08 12:20:01 +0000 | [diff] [blame] | 34 | |
| 35 | void RISCVInstrInfo::copyPhysReg(MachineBasicBlock &MBB, |
| 36 | MachineBasicBlock::iterator MBBI, |
| 37 | const DebugLoc &DL, unsigned DstReg, |
| 38 | unsigned SrcReg, bool KillSrc) const { |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 39 | if (RISCV::GPRRegClass.contains(DstReg, SrcReg)) { |
| 40 | BuildMI(MBB, MBBI, DL, get(RISCV::ADDI), DstReg) |
| 41 | .addReg(SrcReg, getKillRegState(KillSrc)) |
| 42 | .addImm(0); |
| 43 | return; |
| 44 | } |
Alex Bradbury | cfa6291 | 2017-11-08 12:20:01 +0000 | [diff] [blame] | 45 | |
Alex Bradbury | 21d28fe | 2018-04-12 05:50:06 +0000 | [diff] [blame] | 46 | // FPR->FPR copies |
| 47 | unsigned Opc; |
| 48 | if (RISCV::FPR32RegClass.contains(DstReg, SrcReg)) |
| 49 | Opc = RISCV::FSGNJ_S; |
| 50 | else if (RISCV::FPR64RegClass.contains(DstReg, SrcReg)) |
| 51 | Opc = RISCV::FSGNJ_D; |
| 52 | else |
| 53 | llvm_unreachable("Impossible reg-to-reg copy"); |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 54 | |
Alex Bradbury | 21d28fe | 2018-04-12 05:50:06 +0000 | [diff] [blame] | 55 | BuildMI(MBB, MBBI, DL, get(Opc), DstReg) |
| 56 | .addReg(SrcReg, getKillRegState(KillSrc)) |
| 57 | .addReg(SrcReg, getKillRegState(KillSrc)); |
Alex Bradbury | cfa6291 | 2017-11-08 12:20:01 +0000 | [diff] [blame] | 58 | } |
Alex Bradbury | 74913e1 | 2017-11-08 13:31:40 +0000 | [diff] [blame] | 59 | |
| 60 | void RISCVInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB, |
| 61 | MachineBasicBlock::iterator I, |
| 62 | unsigned SrcReg, bool IsKill, int FI, |
| 63 | const TargetRegisterClass *RC, |
| 64 | const TargetRegisterInfo *TRI) const { |
| 65 | DebugLoc DL; |
| 66 | if (I != MBB.end()) |
| 67 | DL = I->getDebugLoc(); |
| 68 | |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 69 | unsigned Opcode; |
| 70 | |
Alex Bradbury | 87a54d6 | 2017-12-07 12:45:05 +0000 | [diff] [blame] | 71 | if (RISCV::GPRRegClass.hasSubClassEq(RC)) |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 72 | Opcode = RISCV::SW; |
| 73 | else if (RISCV::FPR32RegClass.hasSubClassEq(RC)) |
| 74 | Opcode = RISCV::FSW; |
Alex Bradbury | 0b4175f | 2018-04-12 05:34:25 +0000 | [diff] [blame] | 75 | else if (RISCV::FPR64RegClass.hasSubClassEq(RC)) |
| 76 | Opcode = RISCV::FSD; |
Alex Bradbury | 74913e1 | 2017-11-08 13:31:40 +0000 | [diff] [blame] | 77 | else |
| 78 | llvm_unreachable("Can't store this register to stack slot"); |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 79 | |
| 80 | BuildMI(MBB, I, DL, get(Opcode)) |
| 81 | .addReg(SrcReg, getKillRegState(IsKill)) |
| 82 | .addFrameIndex(FI) |
| 83 | .addImm(0); |
Alex Bradbury | 74913e1 | 2017-11-08 13:31:40 +0000 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | void RISCVInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, |
| 87 | MachineBasicBlock::iterator I, |
| 88 | unsigned DstReg, int FI, |
| 89 | const TargetRegisterClass *RC, |
| 90 | const TargetRegisterInfo *TRI) const { |
| 91 | DebugLoc DL; |
| 92 | if (I != MBB.end()) |
| 93 | DL = I->getDebugLoc(); |
| 94 | |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 95 | unsigned Opcode; |
| 96 | |
Alex Bradbury | 87a54d6 | 2017-12-07 12:45:05 +0000 | [diff] [blame] | 97 | if (RISCV::GPRRegClass.hasSubClassEq(RC)) |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 98 | Opcode = RISCV::LW; |
| 99 | else if (RISCV::FPR32RegClass.hasSubClassEq(RC)) |
| 100 | Opcode = RISCV::FLW; |
Alex Bradbury | 0b4175f | 2018-04-12 05:34:25 +0000 | [diff] [blame] | 101 | else if (RISCV::FPR64RegClass.hasSubClassEq(RC)) |
| 102 | Opcode = RISCV::FLD; |
Alex Bradbury | 74913e1 | 2017-11-08 13:31:40 +0000 | [diff] [blame] | 103 | else |
| 104 | llvm_unreachable("Can't load this register from stack slot"); |
Alex Bradbury | 65d6ea5 | 2018-03-21 15:11:02 +0000 | [diff] [blame] | 105 | |
| 106 | BuildMI(MBB, I, DL, get(Opcode), DstReg).addFrameIndex(FI).addImm(0); |
Alex Bradbury | 74913e1 | 2017-11-08 13:31:40 +0000 | [diff] [blame] | 107 | } |
Alex Bradbury | 9fea488 | 2018-01-10 19:53:46 +0000 | [diff] [blame] | 108 | |
| 109 | void RISCVInstrInfo::movImm32(MachineBasicBlock &MBB, |
| 110 | MachineBasicBlock::iterator MBBI, |
| 111 | const DebugLoc &DL, unsigned DstReg, uint64_t Val, |
| 112 | MachineInstr::MIFlag Flag) const { |
| 113 | assert(isInt<32>(Val) && "Can only materialize 32-bit constants"); |
| 114 | |
Alex Bradbury | 480b7bc | 2018-04-17 21:56:40 +0000 | [diff] [blame] | 115 | BuildMI(MBB, MBBI, DL, get(RISCV::PseudoLI), DstReg) |
| 116 | .addImm(Val) |
Alex Bradbury | 9fea488 | 2018-01-10 19:53:46 +0000 | [diff] [blame] | 117 | .setMIFlag(Flag); |
| 118 | } |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 119 | |
| 120 | // The contents of values added to Cond are not examined outside of |
| 121 | // RISCVInstrInfo, giving us flexibility in what to push to it. For RISCV, we |
| 122 | // push BranchOpcode, Reg1, Reg2. |
| 123 | static void parseCondBranch(MachineInstr &LastInst, MachineBasicBlock *&Target, |
| 124 | SmallVectorImpl<MachineOperand> &Cond) { |
| 125 | // Block ends with fall-through condbranch. |
| 126 | assert(LastInst.getDesc().isConditionalBranch() && |
| 127 | "Unknown conditional branch"); |
| 128 | Target = LastInst.getOperand(2).getMBB(); |
| 129 | Cond.push_back(MachineOperand::CreateImm(LastInst.getOpcode())); |
| 130 | Cond.push_back(LastInst.getOperand(0)); |
| 131 | Cond.push_back(LastInst.getOperand(1)); |
| 132 | } |
| 133 | |
| 134 | static unsigned getOppositeBranchOpcode(int Opc) { |
| 135 | switch (Opc) { |
| 136 | default: |
| 137 | llvm_unreachable("Unrecognized conditional branch"); |
| 138 | case RISCV::BEQ: |
| 139 | return RISCV::BNE; |
| 140 | case RISCV::BNE: |
| 141 | return RISCV::BEQ; |
| 142 | case RISCV::BLT: |
| 143 | return RISCV::BGE; |
| 144 | case RISCV::BGE: |
| 145 | return RISCV::BLT; |
| 146 | case RISCV::BLTU: |
| 147 | return RISCV::BGEU; |
| 148 | case RISCV::BGEU: |
| 149 | return RISCV::BLTU; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | bool RISCVInstrInfo::analyzeBranch(MachineBasicBlock &MBB, |
| 154 | MachineBasicBlock *&TBB, |
| 155 | MachineBasicBlock *&FBB, |
| 156 | SmallVectorImpl<MachineOperand> &Cond, |
| 157 | bool AllowModify) const { |
| 158 | TBB = FBB = nullptr; |
| 159 | Cond.clear(); |
| 160 | |
| 161 | // If the block has no terminators, it just falls into the block after it. |
| 162 | MachineBasicBlock::iterator I = MBB.getLastNonDebugInstr(); |
| 163 | if (I == MBB.end() || !isUnpredicatedTerminator(*I)) |
| 164 | return false; |
| 165 | |
| 166 | // Count the number of terminators and find the first unconditional or |
| 167 | // indirect branch. |
| 168 | MachineBasicBlock::iterator FirstUncondOrIndirectBr = MBB.end(); |
| 169 | int NumTerminators = 0; |
| 170 | for (auto J = I.getReverse(); J != MBB.rend() && isUnpredicatedTerminator(*J); |
| 171 | J++) { |
| 172 | NumTerminators++; |
| 173 | if (J->getDesc().isUnconditionalBranch() || |
| 174 | J->getDesc().isIndirectBranch()) { |
| 175 | FirstUncondOrIndirectBr = J.getReverse(); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | // If AllowModify is true, we can erase any terminators after |
| 180 | // FirstUncondOrIndirectBR. |
| 181 | if (AllowModify && FirstUncondOrIndirectBr != MBB.end()) { |
| 182 | while (std::next(FirstUncondOrIndirectBr) != MBB.end()) { |
| 183 | std::next(FirstUncondOrIndirectBr)->eraseFromParent(); |
| 184 | NumTerminators--; |
| 185 | } |
| 186 | I = FirstUncondOrIndirectBr; |
| 187 | } |
| 188 | |
| 189 | // We can't handle blocks that end in an indirect branch. |
| 190 | if (I->getDesc().isIndirectBranch()) |
| 191 | return true; |
| 192 | |
| 193 | // We can't handle blocks with more than 2 terminators. |
| 194 | if (NumTerminators > 2) |
| 195 | return true; |
| 196 | |
| 197 | // Handle a single unconditional branch. |
| 198 | if (NumTerminators == 1 && I->getDesc().isUnconditionalBranch()) { |
| 199 | TBB = I->getOperand(0).getMBB(); |
| 200 | return false; |
| 201 | } |
| 202 | |
| 203 | // Handle a single conditional branch. |
| 204 | if (NumTerminators == 1 && I->getDesc().isConditionalBranch()) { |
| 205 | parseCondBranch(*I, TBB, Cond); |
| 206 | return false; |
| 207 | } |
| 208 | |
| 209 | // Handle a conditional branch followed by an unconditional branch. |
| 210 | if (NumTerminators == 2 && std::prev(I)->getDesc().isConditionalBranch() && |
| 211 | I->getDesc().isUnconditionalBranch()) { |
| 212 | parseCondBranch(*std::prev(I), TBB, Cond); |
| 213 | FBB = I->getOperand(0).getMBB(); |
| 214 | return false; |
| 215 | } |
| 216 | |
| 217 | // Otherwise, we can't handle this. |
| 218 | return true; |
| 219 | } |
| 220 | |
| 221 | unsigned RISCVInstrInfo::removeBranch(MachineBasicBlock &MBB, |
| 222 | int *BytesRemoved) const { |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 223 | if (BytesRemoved) |
| 224 | *BytesRemoved = 0; |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 225 | MachineBasicBlock::iterator I = MBB.getLastNonDebugInstr(); |
| 226 | if (I == MBB.end()) |
| 227 | return 0; |
| 228 | |
| 229 | if (!I->getDesc().isUnconditionalBranch() && |
| 230 | !I->getDesc().isConditionalBranch()) |
| 231 | return 0; |
| 232 | |
| 233 | // Remove the branch. |
| 234 | I->eraseFromParent(); |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 235 | if (BytesRemoved) |
| 236 | *BytesRemoved += getInstSizeInBytes(*I); |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 237 | |
| 238 | I = MBB.end(); |
| 239 | |
| 240 | if (I == MBB.begin()) |
| 241 | return 1; |
| 242 | --I; |
| 243 | if (!I->getDesc().isConditionalBranch()) |
| 244 | return 1; |
| 245 | |
| 246 | // Remove the branch. |
| 247 | I->eraseFromParent(); |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 248 | if (BytesRemoved) |
| 249 | *BytesRemoved += getInstSizeInBytes(*I); |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 250 | return 2; |
| 251 | } |
| 252 | |
| 253 | // Inserts a branch into the end of the specific MachineBasicBlock, returning |
| 254 | // the number of instructions inserted. |
| 255 | unsigned RISCVInstrInfo::insertBranch( |
| 256 | MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, |
| 257 | ArrayRef<MachineOperand> Cond, const DebugLoc &DL, int *BytesAdded) const { |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 258 | if (BytesAdded) |
| 259 | *BytesAdded = 0; |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 260 | |
| 261 | // Shouldn't be a fall through. |
| 262 | assert(TBB && "InsertBranch must not be told to insert a fallthrough"); |
| 263 | assert((Cond.size() == 3 || Cond.size() == 0) && |
| 264 | "RISCV branch conditions have two components!"); |
| 265 | |
| 266 | // Unconditional branch. |
| 267 | if (Cond.empty()) { |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 268 | MachineInstr &MI = *BuildMI(&MBB, DL, get(RISCV::PseudoBR)).addMBB(TBB); |
| 269 | if (BytesAdded) |
| 270 | *BytesAdded += getInstSizeInBytes(MI); |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 271 | return 1; |
| 272 | } |
| 273 | |
| 274 | // Either a one or two-way conditional branch. |
| 275 | unsigned Opc = Cond[0].getImm(); |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 276 | MachineInstr &CondMI = |
| 277 | *BuildMI(&MBB, DL, get(Opc)).add(Cond[1]).add(Cond[2]).addMBB(TBB); |
| 278 | if (BytesAdded) |
| 279 | *BytesAdded += getInstSizeInBytes(CondMI); |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 280 | |
| 281 | // One-way conditional branch. |
| 282 | if (!FBB) |
| 283 | return 1; |
| 284 | |
| 285 | // Two-way conditional branch. |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 286 | MachineInstr &MI = *BuildMI(&MBB, DL, get(RISCV::PseudoBR)).addMBB(FBB); |
| 287 | if (BytesAdded) |
| 288 | *BytesAdded += getInstSizeInBytes(MI); |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 289 | return 2; |
| 290 | } |
| 291 | |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 292 | unsigned RISCVInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB, |
| 293 | MachineBasicBlock &DestBB, |
| 294 | const DebugLoc &DL, |
| 295 | int64_t BrOffset, |
| 296 | RegScavenger *RS) const { |
| 297 | assert(RS && "RegScavenger required for long branching"); |
| 298 | assert(MBB.empty() && |
| 299 | "new block should be inserted for expanding unconditional branch"); |
| 300 | assert(MBB.pred_size() == 1); |
| 301 | |
| 302 | MachineFunction *MF = MBB.getParent(); |
| 303 | MachineRegisterInfo &MRI = MF->getRegInfo(); |
| 304 | const auto &TM = static_cast<const RISCVTargetMachine &>(MF->getTarget()); |
| 305 | const auto &STI = MF->getSubtarget<RISCVSubtarget>(); |
| 306 | |
| 307 | if (TM.isPositionIndependent() || STI.is64Bit()) |
| 308 | report_fatal_error("Unable to insert indirect branch"); |
| 309 | |
| 310 | if (!isInt<32>(BrOffset)) |
| 311 | report_fatal_error( |
| 312 | "Branch offsets outside of the signed 32-bit range not supported"); |
| 313 | |
| 314 | // FIXME: A virtual register must be used initially, as the register |
| 315 | // scavenger won't work with empty blocks (SIInstrInfo::insertIndirectBranch |
| 316 | // uses the same workaround). |
| 317 | unsigned ScratchReg = MRI.createVirtualRegister(&RISCV::GPRRegClass); |
| 318 | auto II = MBB.end(); |
| 319 | |
| 320 | MachineInstr &LuiMI = *BuildMI(MBB, II, DL, get(RISCV::LUI), ScratchReg) |
| 321 | .addMBB(&DestBB, RISCVII::MO_HI); |
| 322 | BuildMI(MBB, II, DL, get(RISCV::PseudoBRIND)) |
| 323 | .addReg(ScratchReg, RegState::Kill) |
| 324 | .addMBB(&DestBB, RISCVII::MO_LO); |
| 325 | |
| 326 | RS->enterBasicBlockEnd(MBB); |
| 327 | unsigned Scav = RS->scavengeRegisterBackwards( |
| 328 | RISCV::GPRRegClass, MachineBasicBlock::iterator(LuiMI), false, 0); |
| 329 | MRI.replaceRegWith(ScratchReg, Scav); |
| 330 | MRI.clearVirtRegs(); |
| 331 | RS->setRegUsed(Scav); |
| 332 | return 8; |
| 333 | } |
| 334 | |
Alex Bradbury | e027c93 | 2018-01-10 20:47:00 +0000 | [diff] [blame] | 335 | bool RISCVInstrInfo::reverseBranchCondition( |
| 336 | SmallVectorImpl<MachineOperand> &Cond) const { |
| 337 | assert((Cond.size() == 3) && "Invalid branch condition!"); |
| 338 | Cond[0].setImm(getOppositeBranchOpcode(Cond[0].getImm())); |
| 339 | return false; |
| 340 | } |
Alex Bradbury | 315cd3a | 2018-01-10 21:05:07 +0000 | [diff] [blame] | 341 | |
| 342 | MachineBasicBlock * |
| 343 | RISCVInstrInfo::getBranchDestBlock(const MachineInstr &MI) const { |
| 344 | assert(MI.getDesc().isBranch() && "Unexpected opcode!"); |
| 345 | // The branch target is always the last operand. |
| 346 | int NumOp = MI.getNumExplicitOperands(); |
| 347 | return MI.getOperand(NumOp - 1).getMBB(); |
| 348 | } |
| 349 | |
| 350 | bool RISCVInstrInfo::isBranchOffsetInRange(unsigned BranchOp, |
| 351 | int64_t BrOffset) const { |
| 352 | // Ideally we could determine the supported branch offset from the |
| 353 | // RISCVII::FormMask, but this can't be used for Pseudo instructions like |
| 354 | // PseudoBR. |
| 355 | switch (BranchOp) { |
| 356 | default: |
| 357 | llvm_unreachable("Unexpected opcode!"); |
| 358 | case RISCV::BEQ: |
| 359 | case RISCV::BNE: |
| 360 | case RISCV::BLT: |
| 361 | case RISCV::BGE: |
| 362 | case RISCV::BLTU: |
| 363 | case RISCV::BGEU: |
| 364 | return isIntN(13, BrOffset); |
| 365 | case RISCV::JAL: |
| 366 | case RISCV::PseudoBR: |
| 367 | return isIntN(21, BrOffset); |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | unsigned RISCVInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const { |
| 372 | unsigned Opcode = MI.getOpcode(); |
| 373 | |
| 374 | switch (Opcode) { |
| 375 | default: { return get(Opcode).getSize(); } |
| 376 | case TargetOpcode::EH_LABEL: |
| 377 | case TargetOpcode::IMPLICIT_DEF: |
| 378 | case TargetOpcode::KILL: |
| 379 | case TargetOpcode::DBG_VALUE: |
| 380 | return 0; |
| 381 | case TargetOpcode::INLINEASM: { |
| 382 | const MachineFunction &MF = *MI.getParent()->getParent(); |
| 383 | const auto &TM = static_cast<const RISCVTargetMachine &>(MF.getTarget()); |
| 384 | return getInlineAsmLength(MI.getOperand(0).getSymbolName(), |
| 385 | *TM.getMCAsmInfo()); |
| 386 | } |
| 387 | } |
| 388 | } |