LLVM  15.0.0git
CSKYAsmPrinter.cpp
Go to the documentation of this file.
1 //===-- CSKYAsmPrinter.cpp - CSKY LLVM assembly writer --------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains a printer that converts from our internal representation
10 // of machine-dependent LLVM code to the CSKY assembly language.
11 //
12 //===----------------------------------------------------------------------===//
13 #include "CSKYAsmPrinter.h"
14 #include "CSKY.h"
15 #include "CSKYConstantPoolValue.h"
16 #include "CSKYTargetMachine.h"
21 #include "llvm/ADT/Statistic.h"
25 #include "llvm/IR/DataLayout.h"
26 #include "llvm/MC/MCAsmInfo.h"
27 #include "llvm/MC/MCContext.h"
28 #include "llvm/MC/MCInstBuilder.h"
29 #include "llvm/MC/MCStreamer.h"
30 #include "llvm/MC/TargetRegistry.h"
31 
32 using namespace llvm;
33 
34 #define DEBUG_TYPE "csky-asm-printer"
35 
36 STATISTIC(CSKYNumInstrsCompressed,
37  "Number of C-SKY Compressed instructions emitted");
38 
40  std::unique_ptr<llvm::MCStreamer> Streamer)
41  : AsmPrinter(TM, std::move(Streamer)), MCInstLowering(OutContext, *this) {}
42 
44  MCP = MF.getConstantPool();
46 
47  // Set the current MCSubtargetInfo to a copy which has the correct
48  // feature bits for the current MachineFunction
49  MCSubtargetInfo &NewSTI =
50  OutStreamer->getContext().getSubtargetCopy(*TM.getMCSubtargetInfo());
52  Subtarget = &NewSTI;
53 
55 }
56 
57 #define GEN_COMPRESS_INSTR
58 #include "CSKYGenCompressInstEmitter.inc"
60  MCInst CInst;
61  bool Res = compressInst(CInst, Inst, *Subtarget, OutStreamer->getContext());
62  if (Res)
63  ++CSKYNumInstrsCompressed;
64  AsmPrinter::EmitToStreamer(*OutStreamer, Res ? CInst : Inst);
65 }
66 
67 // Simple pseudo-instructions have their lowering (with expansion to real
68 // instructions) auto-generated.
69 #include "CSKYGenMCPseudoLowering.inc"
70 
71 void CSKYAsmPrinter::expandTLSLA(const MachineInstr *MI) {
72  DebugLoc DL = MI->getDebugLoc();
73 
76  "_" + Twine(MI->getOperand(3).getImm()));
77 
78  OutStreamer->emitLabel(PCLabel);
79 
80  auto Instr = BuildMI(*MF, DL, TII->get(CSKY::LRW32))
81  .add(MI->getOperand(0))
82  .add(MI->getOperand(2));
83  MCInst LRWInst;
84  MCInstLowering.Lower(Instr, LRWInst);
85  EmitToStreamer(*OutStreamer, LRWInst);
86 
87  Instr = BuildMI(*MF, DL, TII->get(CSKY::GRS32))
88  .add(MI->getOperand(1))
89  .addSym(PCLabel);
90  MCInst GRSInst;
91  MCInstLowering.Lower(Instr, GRSInst);
92  EmitToStreamer(*OutStreamer, GRSInst);
93  return;
94 }
95 
96 void CSKYAsmPrinter::emitCustomConstantPool(const MachineInstr *MI) {
97 
98  // This instruction represents a floating constant pool in the function.
99  // The first operand is the ID# for this instruction, the second is the
100  // index into the MachineConstantPool that this is, the third is the size
101  // in bytes of this constant pool entry.
102  // The required alignment is specified on the basic block holding this MI.
103  unsigned LabelId = (unsigned)MI->getOperand(0).getImm();
104  unsigned CPIdx = (unsigned)MI->getOperand(1).getIndex();
105 
106  // If this is the first entry of the pool, mark it.
107  if (!InConstantPool) {
108  OutStreamer->emitValueToAlignment(4);
109  InConstantPool = true;
110  }
111 
112  OutStreamer->emitLabel(GetCPISymbol(LabelId));
113 
114  const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
115  if (MCPE.isMachineConstantPoolEntry())
117  else
119  return;
120 }
121 
123  // Make sure to terminate any constant pools that were at the end
124  // of the function.
125  if (!InConstantPool)
126  return;
127  InConstantPool = false;
128 }
129 
132  emitAttributes();
133 }
134 
136  CSKYTargetStreamer &CTS =
137  static_cast<CSKYTargetStreamer &>(*OutStreamer->getTargetStreamer());
138 
141 }
142 
144  // Do any auto-generated pseudo lowerings.
146  return;
147 
148  // If we just ended a constant pool, mark it as such.
149  if (InConstantPool && MI->getOpcode() != CSKY::CONSTPOOL_ENTRY) {
150  InConstantPool = false;
151  }
152 
153  if (MI->getOpcode() == CSKY::PseudoTLSLA32)
154  return expandTLSLA(MI);
155 
156  if (MI->getOpcode() == CSKY::CONSTPOOL_ENTRY)
157  return emitCustomConstantPool(MI);
158 
159  MCInst TmpInst;
160  MCInstLowering.Lower(MI, TmpInst);
161  EmitToStreamer(*OutStreamer, TmpInst);
162 }
163 
164 // Convert a CSKY-specific constant pool modifier into the associated
165 // MCSymbolRefExpr variant kind.
168  switch (Modifier) {
169  case CSKYCP::NO_MOD:
171  case CSKYCP::ADDR:
173  case CSKYCP::GOT:
175  case CSKYCP::GOTOFF:
177  case CSKYCP::PLT:
179  case CSKYCP::TLSGD:
181  case CSKYCP::TLSLE:
183  case CSKYCP::TLSIE:
185  }
186  llvm_unreachable("Invalid CSKYCPModifier!");
187 }
188 
190  MachineConstantPoolValue *MCPV) {
191  int Size = getDataLayout().getTypeAllocSize(MCPV->getType());
192  CSKYConstantPoolValue *CCPV = static_cast<CSKYConstantPoolValue *>(MCPV);
193  MCSymbol *MCSym;
194 
195  if (CCPV->isBlockAddress()) {
196  const BlockAddress *BA =
197  cast<CSKYConstantPoolConstant>(CCPV)->getBlockAddress();
198  MCSym = GetBlockAddressSymbol(BA);
199  } else if (CCPV->isGlobalValue()) {
200  const GlobalValue *GV = cast<CSKYConstantPoolConstant>(CCPV)->getGV();
201  MCSym = getSymbol(GV);
202  } else if (CCPV->isMachineBasicBlock()) {
203  const MachineBasicBlock *MBB = cast<CSKYConstantPoolMBB>(CCPV)->getMBB();
204  MCSym = MBB->getSymbol();
205  } else if (CCPV->isJT()) {
206  signed JTI = cast<CSKYConstantPoolJT>(CCPV)->getJTI();
207  MCSym = GetJTISymbol(JTI);
208  } else {
209  assert(CCPV->isExtSymbol() && "unrecognized constant pool value");
210  StringRef Sym = cast<CSKYConstantPoolSymbol>(CCPV)->getSymbol();
211  MCSym = GetExternalSymbolSymbol(Sym);
212  }
213  // Create an MCSymbol for the reference.
214  const MCExpr *Expr =
216 
217  if (CCPV->getPCAdjustment()) {
218 
220  Twine(MAI->getPrivateGlobalPrefix()) + "PC" +
221  Twine(getFunctionNumber()) + "_" + Twine(CCPV->getLabelID()));
222 
223  const MCExpr *PCRelExpr = MCSymbolRefExpr::create(PCLabel, OutContext);
224  if (CCPV->mustAddCurrentAddress()) {
225  // We want "(<expr> - .)", but MC doesn't have a concept of the '.'
226  // label, so just emit a local label end reference that instead.
228  OutStreamer->emitLabel(DotSym);
229  const MCExpr *DotExpr = MCSymbolRefExpr::create(DotSym, OutContext);
230  PCRelExpr = MCBinaryExpr::createSub(PCRelExpr, DotExpr, OutContext);
231  }
232  Expr = MCBinaryExpr::createSub(Expr, PCRelExpr, OutContext);
233  }
234 
235  // Create an MCSymbol for the reference.
237  OutContext);
238 
239  OutStreamer->emitValue(Expr, Size);
240 }
241 
242 void CSKYAsmPrinter::emitAttributes() {
243  CSKYTargetStreamer &CTS =
244  static_cast<CSKYTargetStreamer &>(*OutStreamer->getTargetStreamer());
245 
246  const Triple &TT = TM.getTargetTriple();
247  StringRef CPU = TM.getTargetCPU();
249  const CSKYTargetMachine &CTM = static_cast<const CSKYTargetMachine &>(TM);
250  /* TuneCPU doesn't impact emission of ELF attributes, ELF attributes only
251  care about arch related features, so we can set TuneCPU as CPU. */
252  const CSKYSubtarget STI(TT, CPU, /*TuneCPU=*/CPU, FS, CTM);
253 
254  CTS.emitTargetAttributes(STI);
255 }
256 
258  const char *ExtraCode, raw_ostream &OS) {
259  // First try the generic code, which knows about modifiers like 'c' and 'n'.
260  if (!AsmPrinter::PrintAsmOperand(MI, OpNo, ExtraCode, OS))
261  return false;
262 
263  const MachineOperand &MO = MI->getOperand(OpNo);
264  if (ExtraCode && ExtraCode[0]) {
265  if (ExtraCode[1] != 0)
266  return true; // Unknown modifier.
267 
268  switch (ExtraCode[0]) {
269  default:
270  return true; // Unknown modifier.
271  case 'R':
272  if (MO.getType() == MachineOperand::MO_Register) {
274  return false;
275  }
276  }
277  }
278 
279  switch (MO.getType()) {
281  OS << MO.getImm();
282  return false;
284  if (MO.getReg() == CSKY::C)
285  return false;
287  return false;
289  PrintSymbolOperand(MO, OS);
290  return false;
293  Sym->print(OS, MAI);
294  return false;
295  }
296  default:
297  break;
298  }
299 
300  return true;
301 }
302 
304  unsigned OpNo, const char *ExtraCode,
305  raw_ostream &OS) {
306  if (!ExtraCode) {
307  const MachineOperand &MO = MI->getOperand(OpNo);
308  // For now, we only support register memory operands in registers and
309  // assume there is no addend
310  if (!MO.isReg())
311  return true;
312 
313  OS << "(" << CSKYInstPrinter::getRegisterName(MO.getReg()) << ", 0)";
314  return false;
315  }
316 
317  return AsmPrinter::PrintAsmMemoryOperand(MI, OpNo, ExtraCode, OS);
318 }
319 
322 }
llvm::Check::Size
@ Size
Definition: FileCheck.h:77
llvm::CSKYMCExpr::VK_CSKY_GOTOFF
@ VK_CSKY_GOTOFF
Definition: CSKYMCExpr.h:28
AsmPrinter.h
llvm::CSKYConstantPoolValue::isMachineBasicBlock
bool isMachineBasicBlock() const
Definition: CSKYConstantPoolValue.h:68
llvm::MachineOperand::MO_BlockAddress
@ MO_BlockAddress
Address of a basic block.
Definition: MachineOperand.h:62
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
llvm::MachineOperand::MO_Immediate
@ MO_Immediate
Immediate operand.
Definition: MachineOperand.h:52
llvm::CSKYCP::PLT
@ PLT
Definition: CSKYConstantPoolValue.h:39
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::CSKYCP::TLSGD
@ TLSGD
Definition: CSKYConstantPoolValue.h:39
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
CSKYConstantPoolValue.h
llvm::CSKYAsmPrinter::emitFunctionBodyEnd
void emitFunctionBodyEnd() override
Targets can override this to emit stuff after the last basic block in the function.
Definition: CSKYAsmPrinter.cpp:122
llvm::MachineInstrBuilder::add
const MachineInstrBuilder & add(const MachineOperand &MO) const
Definition: MachineInstrBuilder.h:224
llvm::TargetSubtargetInfo::getInstrInfo
virtual const TargetInstrInfo * getInstrInfo() const
Definition: TargetSubtargetInfo.h:93
llvm::MachineConstantPoolEntry::MachineCPVal
MachineConstantPoolValue * MachineCPVal
Definition: MachineConstantPool.h:72
llvm::AsmPrinter::MAI
const MCAsmInfo * MAI
Target Asm Printer information.
Definition: AsmPrinter.h:88
llvm::MCAsmInfo::getPrivateGlobalPrefix
StringRef getPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:666
Statistic.h
llvm::CSKYAsmPrinter::emitPseudoExpansionLowering
bool emitPseudoExpansionLowering(MCStreamer &OutStreamer, const MachineInstr *MI)
tblgen'erated driver function for lowering simple MI->MC pseudo instructions.
llvm::MachineOperand::getBlockAddress
const BlockAddress * getBlockAddress() const
Definition: MachineOperand.h:577
llvm::CSKYConstantPoolValue::isExtSymbol
bool isExtSymbol() const
Definition: CSKYConstantPoolValue.h:66
llvm::AsmPrinter::emitGlobalConstant
void emitGlobalConstant(const DataLayout &DL, const Constant *CV, AliasMapTy *AliasList=nullptr)
EmitGlobalConstant - Print a general LLVM constant to the .s file.
Definition: AsmPrinter.cpp:3325
CSKYTargetMachine.h
MCInstBuilder.h
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::MachineConstantPoolValue
Abstract base class for all machine specific constantpool value subclasses.
Definition: MachineConstantPool.h:35
llvm::MachineConstantPoolEntry::Val
union llvm::MachineConstantPoolEntry::@189 Val
The constant itself.
llvm::AsmPrinter::PrintSymbolOperand
virtual void PrintSymbolOperand(const MachineOperand &MO, raw_ostream &OS)
Print the MachineOperand as a symbol.
Definition: AsmPrinterInlineAsm.cpp:457
CSKY.h
llvm::CSKYConstantPoolValue::isJT
bool isJT() const
Definition: CSKYConstantPoolValue.h:71
llvm::CSKYCP::GOT
@ GOT
Definition: CSKYConstantPoolValue.h:39
llvm::CSKYMCExpr::create
static const CSKYMCExpr * create(const MCExpr *Expr, VariantKind Kind, MCContext &Ctx)
Definition: CSKYMCExpr.cpp:22
llvm::MCSubtargetInfo::setFeatureBits
void setFeatureBits(const FeatureBitset &FeatureBits_)
Definition: MCSubtargetInfo.h:113
llvm::CSKYMCExpr::VK_CSKY_GOT
@ VK_CSKY_GOT
Definition: CSKYMCExpr.h:25
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::CSKYConstantPoolValue::isGlobalValue
bool isGlobalValue() const
Definition: CSKYConstantPoolValue.h:65
llvm::CSKYMCExpr::VK_CSKY_None
@ VK_CSKY_None
Definition: CSKYMCExpr.h:20
llvm::MachineOperand::MO_Register
@ MO_Register
Register operand.
Definition: MachineOperand.h:51
llvm::AsmPrinter::EmitToStreamer
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
Definition: AsmPrinter.cpp:401
llvm::MachineConstantPoolValue::getType
Type * getType() const
Definition: MachineConstantPool.h:44
llvm::getTheCSKYTarget
Target & getTheCSKYTarget()
Definition: CSKYTargetInfo.cpp:13
LLVMInitializeCSKYAsmPrinter
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeCSKYAsmPrinter()
Definition: CSKYAsmPrinter.cpp:320
llvm::MachineBasicBlock::getSymbol
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Definition: MachineBasicBlock.cpp:57
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:212
llvm::MCContext::getOrCreateSymbol
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition: MCContext.cpp:207
llvm::Triple::isOSBinFormatELF
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:656
llvm::CSKYConstantPoolValue::isBlockAddress
bool isBlockAddress() const
Definition: CSKYConstantPoolValue.h:67
llvm::MachineOperand::MO_GlobalAddress
@ MO_GlobalAddress
Address of a global value.
Definition: MachineOperand.h:61
llvm::CSKYCP::NO_MOD
@ NO_MOD
Definition: CSKYConstantPoolValue.h:39
llvm::MachineOperand::getImm
int64_t getImm() const
Definition: MachineOperand.h:546
llvm::CSKYAsmPrinter::CSKYAsmPrinter
CSKYAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
Definition: CSKYAsmPrinter.cpp:39
llvm::AsmPrinter::OutStreamer
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition: AsmPrinter.h:97
llvm::AsmPrinter::PrintAsmMemoryOperand
virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
Definition: AsmPrinterInlineAsm.cpp:509
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::CSKYMCExpr::VK_CSKY_ADDR
@ VK_CSKY_ADDR
Definition: CSKYMCExpr.h:21
MCContext.h
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:125
llvm::CSKYAsmPrinter::PrintAsmOperand
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
Definition: CSKYAsmPrinter.cpp:257
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:48
llvm::MCSubtargetInfo::getFeatureBits
const FeatureBitset & getFeatureBits() const
Definition: MCSubtargetInfo.h:112
llvm::CSKYConstantPoolValue::mustAddCurrentAddress
bool mustAddCurrentAddress() const
Definition: CSKYConstantPoolValue.h:61
llvm::STATISTIC
STATISTIC(NumFunctions, "Total number of functions")
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
CSKYTargetStreamer.h
llvm::CSKYMCExpr::VK_CSKY_PLT
@ VK_CSKY_PLT
Definition: CSKYMCExpr.h:29
llvm::CSKYTargetStreamer
Definition: CSKYTargetStreamer.h:45
llvm::MCSymbol::print
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
Definition: MCSymbol.cpp:58
llvm::CSKYSubtarget
Definition: CSKYSubtarget.h:30
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::CSKYAsmPrinter::EmitToStreamer
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
Definition: CSKYAsmPrinter.cpp:59
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:94
llvm::CSKYAsmPrinter::emitStartOfAsmFile
void emitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
Definition: CSKYAsmPrinter.cpp:130
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:656
llvm::CSKYMCInstLower::Lower
void Lower(const MachineInstr *MI, MCInst &OutMI) const
Definition: CSKYMCInstLower.cpp:27
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::CSKYConstantPoolValue::getLabelID
unsigned getLabelID() const
Definition: CSKYConstantPoolValue.h:63
llvm::AsmPrinter::GetCPISymbol
virtual MCSymbol * GetCPISymbol(unsigned CPID) const
Return the symbol for the specified constant pool entry.
Definition: AsmPrinter.cpp:3373
llvm::MachineOperand::isReg
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Definition: MachineOperand.h:320
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
CSKYAsmPrinter.h
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:126
llvm::TargetMachine::getMCSubtargetInfo
const MCSubtargetInfo * getMCSubtargetInfo() const
Definition: TargetMachine.h:209
llvm::AsmPrinter::GetBlockAddressSymbol
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
Definition: AsmPrinter.cpp:3363
llvm::CSKYConstantPoolValue
CSKYConstantPoolValue - CSKY specific constantpool value.
Definition: CSKYConstantPoolValue.h:45
llvm::CSKYCP::GOTOFF
@ GOTOFF
Definition: CSKYConstantPoolValue.h:39
llvm::CSKYAsmPrinter::emitInstruction
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
Definition: CSKYAsmPrinter.cpp:143
llvm::CSKYCP::ADDR
@ ADDR
Definition: CSKYConstantPoolValue.h:39
MachineConstantPool.h
llvm::CSKYInstPrinter::getRegisterName
static const char * getRegisterName(unsigned RegNo)
Definition: CSKYInstPrinter.cpp:263
llvm::MachineOperand::getType
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Definition: MachineOperand.h:218
llvm::CSKYMCExpr::VariantKind
VariantKind
Definition: CSKYMCExpr.h:19
llvm::MachineFunction::getConstantPool
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
Definition: MachineFunction.h:688
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MachineConstantPoolEntry::isMachineConstantPoolEntry
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
Definition: MachineConstantPool.h:93
llvm::AsmPrinter::getSymbol
MCSymbol * getSymbol(const GlobalValue *GV) const
Definition: AsmPrinter.cpp:654
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1675
llvm::X86AS::FS
@ FS
Definition: X86.h:192
llvm::CSKYConstantPoolValue::getModifier
CSKYCP::CSKYCPModifier getModifier() const
Definition: CSKYConstantPoolValue.h:62
llvm::MCBinaryExpr::createSub
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:610
llvm::AsmPrinter::MF
MachineFunction * MF
The current machine function.
Definition: AsmPrinter.h:100
llvm::AsmPrinter::OutContext
MCContext & OutContext
This is the context for the output file that we are streaming.
Definition: AsmPrinter.h:92
llvm::CSKYAsmPrinter::emitMachineConstantPoolValue
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override
Definition: CSKYAsmPrinter.cpp:189
llvm::MachineOperand::getReg
Register getReg() const
getReg - Returns the register number.
Definition: MachineOperand.h:359
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::CSKYAsmPrinter::emitEndOfAsmFile
void emitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
Definition: CSKYAsmPrinter.cpp:135
llvm::CSKYMCExpr::VK_CSKY_TLSIE
@ VK_CSKY_TLSIE
Definition: CSKYMCExpr.h:31
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::AsmPrinter::runOnMachineFunction
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
Definition: AsmPrinter.h:377
llvm::BlockAddress
The address of a basic block.
Definition: Constants.h:849
llvm::CSKYCP::TLSLE
@ TLSLE
Definition: CSKYConstantPoolValue.h:39
llvm::AsmPrinter::GetExternalSymbolSymbol
MCSymbol * GetExternalSymbolSymbol(StringRef Sym) const
Return the MCSymbol for the specified ExternalSymbol.
Definition: AsmPrinter.cpp:3420
MCAsmInfo.h
DataLayout.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
this
Analysis the ScalarEvolution expression for r is this
Definition: README.txt:8
llvm::CSKYMCExpr::VK_CSKY_TLSLE
@ VK_CSKY_TLSLE
Definition: CSKYMCExpr.h:32
llvm::CSKYCP::CSKYCPModifier
CSKYCPModifier
Definition: CSKYConstantPoolValue.h:39
llvm::AsmPrinter::GetJTISymbol
MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const
Return the symbol for the specified jump table entry.
Definition: AsmPrinter.cpp:3401
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::CSKYAsmPrinter::PrintAsmMemoryOperand
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
Definition: CSKYAsmPrinter.cpp:303
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::CSKYTargetMachine
Definition: CSKYTargetMachine.h:22
llvm::TargetMachine::getTargetFeatureString
StringRef getTargetFeatureString() const
Definition: TargetMachine.h:128
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCContext::createTempSymbol
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
Definition: MCContext.cpp:324
CSKYInstPrinter.h
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::MachineConstantPoolEntry
This class is a data container for one entry in a MachineConstantPool.
Definition: MachineConstantPool.h:67
std
Definition: BitVector.h:851
llvm::CSKYMCExpr::VK_CSKY_TLSGD
@ VK_CSKY_TLSGD
Definition: CSKYMCExpr.h:33
llvm::MachineConstantPool::getConstants
const std::vector< MachineConstantPoolEntry > & getConstants() const
Definition: MachineConstantPool.h:145
llvm::CSKYAsmPrinter::runOnMachineFunction
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
Definition: CSKYAsmPrinter.cpp:43
MachineFrameInfo.h
llvm::CSKYConstantPoolValue::getPCAdjustment
unsigned getPCAdjustment() const
Definition: CSKYConstantPoolValue.h:60
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:82
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
getModifierVariantKind
static CSKYMCExpr::VariantKind getModifierVariantKind(CSKYCP::CSKYCPModifier Modifier)
Definition: CSKYAsmPrinter.cpp:167
CSKYMCExpr.h
llvm::MachineInstrBuilder::addSym
const MachineInstrBuilder & addSym(MCSymbol *Sym, unsigned char TargetFlags=0) const
Definition: MachineInstrBuilder.h:267
llvm::TargetMachine::getTargetCPU
StringRef getTargetCPU() const
Definition: TargetMachine.h:127
llvm::CSKYTargetStreamer::finishAttributeSection
virtual void finishAttributeSection()
Definition: CSKYTargetStreamer.cpp:132
llvm::AsmPrinter::TM
TargetMachine & TM
Target machine description.
Definition: AsmPrinter.h:85
llvm::BuildMI
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
Definition: MachineInstrBuilder.h:328
MCStreamer.h
llvm::TargetMachine::getTargetTriple
const Triple & getTargetTriple() const
Definition: TargetMachine.h:126
llvm::MachineFunction::getDataLayout
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Definition: MachineFunction.cpp:285
CSKYTargetInfo.h
llvm::AsmPrinter::getDataLayout
const DataLayout & getDataLayout() const
Return information about data layout.
Definition: AsmPrinter.cpp:386
llvm::CSKYCP::TLSIE
@ TLSIE
Definition: CSKYConstantPoolValue.h:39
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::MCSymbolRefExpr::VK_None
@ VK_None
Definition: MCExpr.h:195
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::RegisterAsmPrinter
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...
Definition: TargetRegistry.h:1381
TargetRegistry.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76
llvm::AsmPrinter::getFunctionNumber
unsigned getFunctionNumber() const
Return a unique ID for the current function.
Definition: AsmPrinter.cpp:378
llvm::MachineConstantPoolEntry::ConstVal
const Constant * ConstVal
Definition: MachineConstantPool.h:71
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::AsmPrinter::PrintAsmOperand
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
Definition: AsmPrinterInlineAsm.cpp:467
llvm::CSKYTargetStreamer::emitTargetAttributes
virtual void emitTargetAttributes(const MCSubtargetInfo &STI)
Definition: CSKYTargetStreamer.cpp:127
llvm::DataLayout::getTypeAllocSize
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
Definition: DataLayout.h:506