80 if (
MI->memoperands_empty())
85 if (MMO->getAlign() < Alignment)
86 Alignment = MMO->getAlign();
88 unsigned AlignmentHint = 0;
89 if (Alignment >=
Align(16))
91 else if (Alignment >=
Align(8))
93 if (AlignmentHint == 0)
107 .
addReg(
MI->getOperand(3).getReg());
141 SystemZ_MC::verifyInstructionPredicates(
MI->getOpcode(),
146 switch (
MI->getOpcode()) {
147 case SystemZ::Return:
152 case SystemZ::CondReturn:
159 case SystemZ::CRBReturn:
168 case SystemZ::CGRBReturn:
177 case SystemZ::CIBReturn:
186 case SystemZ::CGIBReturn:
195 case SystemZ::CLRBReturn:
204 case SystemZ::CLGRBReturn:
213 case SystemZ::CLIBReturn:
222 case SystemZ::CLGIBReturn:
231 case SystemZ::CallBR:
233 .
addReg(
MI->getOperand(0).getReg());
236 case SystemZ::CallBCR:
240 .
addReg(
MI->getOperand(2).getReg());
243 case SystemZ::CRBCall:
252 case SystemZ::CGRBCall:
261 case SystemZ::CIBCall:
270 case SystemZ::CGIBCall:
279 case SystemZ::CLRBCall:
288 case SystemZ::CLGRBCall:
297 case SystemZ::CLIBCall:
306 case SystemZ::CLGIBCall:
315 case SystemZ::IILF64:
318 .
addImm(
MI->getOperand(2).getImm());
321 case SystemZ::IIHF64:
324 .
addImm(
MI->getOperand(2).getImm());
327 case SystemZ::RISBHH:
328 case SystemZ::RISBHL:
332 case SystemZ::RISBLH:
333 case SystemZ::RISBLL:
337 case SystemZ::VLVGP32:
400 case SystemZ::LFER_16:
408 case SystemZ::LEFR_16:
412#define LOWER_LOW(NAME) \
413 case SystemZ::NAME##64: LoweredMI = lowerRILow(MI, SystemZ::NAME); break
429#define LOWER_HIGH(NAME) \
430 case SystemZ::NAME##64: LoweredMI = lowerRIHigh(MI, SystemZ::NAME); break
446 case SystemZ::Serialize:
459 case SystemZ::Trap: {
472 case SystemZ::CondTrap: {
485 case TargetOpcode::PATCHABLE_FUNCTION_EXIT:
488 case TargetOpcode::PATCHABLE_TAIL_CALL:
492 "around this assert.");
494 case SystemZ::EXRL_Pseudo: {
495 unsigned TargetInsOpc =
MI->getOperand(0).getImm();
496 Register LenMinus1Reg =
MI->getOperand(1).getReg();
497 Register DestReg =
MI->getOperand(2).getReg();
498 int64_t DestDisp =
MI->getOperand(3).getImm();
500 int64_t SrcDisp =
MI->getOperand(5).getImm();
517 MCInstBuilder(SystemZ::EXRL).addReg(LenMinus1Reg).addExpr(Dot));
527 case SystemZ::EH_SjLj_Setup:
562 else if (MCOp.
isImm())
588 const char *ExtraCode,
594 if ((ExtraCode[0] ==
'N' || ExtraCode[0] ==
'M') && !ExtraCode[1] &&
595 MO.
isReg() && SystemZ::GR128BitRegClass.contains(MO.
getReg()))
602 MCOp =
Lower.lowerOperand(MO);
610 const char *ExtraCode,
612 if (ExtraCode && ExtraCode[0] && !ExtraCode[1]) {
613 switch (ExtraCode[0]) {
620 OS <<
MI->getOperand(OpNo + 1).getImm();
629 MI->getOperand(OpNo + 2).getReg(), OS);
636 "SystemZ Assembly Printer",
false,
false)
641 if (TM.getTargetTriple().isOSzOS())
650 createSystemZAsmPrinter);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static const Function * getParent(const Value *V)
#define LLVM_EXTERNAL_VISIBILITY
ModuleAnalysisManager MAM
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
MachineRegisterInfo & MRI
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
static MCInst lowerVecEltExtraction(const MachineInstr *MI, unsigned Opcode)
std::unique_ptr< MCStreamer > && Streamer
return new SystemZELFAsmPrinter(TM, std::move(Streamer))
static void lowerAlignmentHint(const MachineInstr *MI, MCInst &LoweredMI, unsigned Opcode)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSystemZAsmPrinter()
static void printFormattedRegName(const MCAsmInfo *MAI, unsigned RegNo, raw_ostream &OS)
static MCInst lowerRILow(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerRIHigh(const MachineInstr *MI, unsigned Opcode)
static void printAddress(const MCAsmInfo *MAI, unsigned Base, const MCOperand &DispMO, unsigned Index, raw_ostream &OS)
static MCInst lowerSubvectorStore(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerVecEltInsertion(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerSubvectorLoad(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerRIEfLow(const MachineInstr *MI, unsigned Opcode)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
This class is intended to be used as a driving class for all asm writers.
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
TargetMachine & TM
Target machine description.
MachineFunction * MF
The current machine function.
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
MCContext & OutContext
This is the context for the output file that we are streaming.
bool doFinalization(Module &M) override
Shut down the asmprinter.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
const MCAsmInfo & MAI
Target Asm Printer information.
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
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.
This class is intended to be used as a base class for asm properties and features specific to the tar...
unsigned getAssemblerDialect() const
void printExpr(raw_ostream &, const MCExpr &) const
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
MCInstBuilder & addReg(MCRegister Reg)
Add a new register operand.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
MCInstBuilder & addExpr(const MCExpr *Val)
Add a new MCExpr operand.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
Instances of this class represent operands of the MCInst class.
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
MCRegister getReg() const
Returns the register number.
const MCExpr * getExpr() const
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Streaming machine code generation interface.
Represent a reference to a symbol from inside an expression.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Function & getFunction()
Return the LLVM function that this machine code represents.
Representation of each machine instruction.
A description of a memory reference used in the backend.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Wrapper class representing virtual and physical registers.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MFAM)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MFAM)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
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...
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.
static const char * getRegisterName(MCRegister Reg)
static const char * getRegisterName(MCRegister Reg)
std::pair< MCInst, const MCSubtargetInfo * > MCInstSTIPair
EXRLT2SymMap EXRLTargets2Sym
Primary interface to the complete machine description for the target machine.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned getRegAsGR32(unsigned Reg)
unsigned getRegAsGRH32(unsigned Reg)
unsigned getRegAsVR128(unsigned Reg)
unsigned getRegAsGR64(unsigned Reg)
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheSystemZTarget()
OuterAnalysisManagerProxy< ModuleAnalysisManager, MachineFunction > ModuleAnalysisManagerMachineFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI void setupModuleAsmPrinter(Module &M, ModuleAnalysisManager &MAM, AsmPrinter &AsmPrinter)
LLVM_ABI void setupMachineFunctionAsmPrinter(MachineFunctionAnalysisManager &MFAM, MachineFunction &MF, AsmPrinter &AsmPrinter)
LLVM_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
static void RegisterAsmPrinter(Target &T, Target::AsmPrinterCtorTy Fn)
RegisterAsmPrinter - Register an AsmPrinter implementation for the given target.