LLVM 17.0.0git
|
#include "MCTargetDesc/X86ATTInstPrinter.h"
#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86InstComments.h"
#include "MCTargetDesc/X86ShuffleDecode.h"
#include "MCTargetDesc/X86TargetStreamer.h"
#include "X86AsmPrinter.h"
#include "X86RegisterInfo.h"
#include "X86ShuffleDecodeConstantPool.h"
#include "X86Subtarget.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Mangler.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolELF.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizerCommon.h"
#include <string>
Go to the source code of this file.
Classes | |
struct | NoAutoPaddingScope |
A RAII helper which defines a region of instructions which can't have padding added between them for correctness. More... | |
Macros | |
#define | MOV_CASE(Prefix, Suffix) |
#define | MOV_AVX512_CASE(Suffix) |
#define | CASE_ALL_MOV_RM() |
Functions | |
static void | emitX86Nops (MCStreamer &OS, unsigned NumBytes, const X86Subtarget *Subtarget) |
Emit the optimal amount of multi-byte nops on X86. | |
static void | SimplifyShortImmForm (MCInst &Inst, unsigned Opcode) |
Simplify FOO $imm, %{al,ax,eax,rax} to FOO $imm, for instruction with a short fixed-register form. | |
static void | SimplifyMOVSX (MCInst &Inst) |
If a movsx instruction has a shorter encoding for the used register simplify the instruction to use it instead. | |
static void | SimplifyShortMoveForm (X86AsmPrinter &Printer, MCInst &Inst, unsigned Opcode) |
Simplify things like MOV32rm to MOV32o32a. | |
static unsigned | getRetOpcode (const X86Subtarget &Subtarget) |
static unsigned | convertTailJumpOpcode (unsigned Opcode) |
static unsigned | emitNop (MCStreamer &OS, unsigned NumBytes, const X86Subtarget *Subtarget) |
Emit the largest nop instruction smaller than or equal to NumBytes bytes. | |
static MachineBasicBlock::const_iterator | PrevCrossBBInst (MachineBasicBlock::const_iterator MBBI) |
static const Constant * | getConstantFromPool (const MachineInstr &MI, const MachineOperand &Op) |
static std::string | getShuffleComment (const MachineInstr *MI, unsigned SrcOp1Idx, unsigned SrcOp2Idx, ArrayRef< int > Mask) |
static void | printConstant (const APInt &Val, raw_ostream &CS) |
static void | printConstant (const APFloat &Flt, raw_ostream &CS) |
static void | printConstant (const Constant *COp, raw_ostream &CS) |
static unsigned | getRegisterWidth (const MCOperandInfo &Info) |
static void | addConstantComments (const MachineInstr *MI, MCStreamer &OutStreamer) |
#define CASE_ALL_MOV_RM | ( | ) |
#define MOV_AVX512_CASE | ( | Suffix | ) |
#define MOV_CASE | ( | Prefix, | |
Suffix | |||
) |
|
static |
Definition at line 2105 of file X86MCInstLower.cpp.
References llvm::MCStreamer::AddComment(), llvm::X86::AddrDisp, llvm::X86::AddrNumOperands, assert(), llvm::CallingConv::C, CASE_ALL_MOV_RM, llvm::DecodePSHUFBMask(), llvm::DecodeVPERMIL2PMask(), llvm::DecodeVPERMILPMask(), llvm::DecodeVPPERMMask(), getConstantFromPool(), llvm::MachineOperand::getImm(), llvm::DstOp::getReg(), llvm::X86ATTInstPrinter::getRegisterName(), getRegisterWidth(), getShuffleComment(), llvm::MachineOperand::isImm(), llvm::X86II::isKMasked(), llvm::X86II::isKMergeMasked(), llvm_unreachable, MI, printConstant(), llvm::raw_string_ostream::str(), and llvm::dwarf::toString().
Referenced by llvm::X86AsmPrinter::emitInstruction().
Definition at line 465 of file X86MCInstLower.cpp.
|
static |
Emit the largest nop instruction smaller than or equal to NumBytes
bytes.
Return the size of nop emitted.
Definition at line 1109 of file X86MCInstLower.cpp.
References assert(), llvm_unreachable, and OS.
Referenced by emitX86Nops().
|
static |
Emit the optimal amount of multi-byte nops on X86.
Definition at line 1226 of file X86MCInstLower.cpp.
|
static |
Definition at line 1882 of file X86MCInstLower.cpp.
References llvm::MachineConstantPoolEntry::ConstVal, llvm::MachineConstantPoolEntry::isMachineConstantPoolEntry(), MI, and llvm::MachineConstantPoolEntry::Val.
Referenced by addConstantComments().
|
static |
Definition at line 2093 of file X86MCInstLower.cpp.
References Info, and llvm_unreachable.
Referenced by addConstantComments().
|
static |
Definition at line 426 of file X86MCInstLower.cpp.
Referenced by llvm::X86AsmPrinter::emitInstruction().
|
static |
Definition at line 1899 of file X86MCInstLower.cpp.
References assert(), llvm::raw_ostream::flush(), llvm::DstOp::getReg(), llvm::MachineOperand::getReg(), llvm::X86ATTInstPrinter::getRegisterName(), llvm::MachineOperand::isReg(), MI, llvm::SmallVectorBase< Size_T >::size(), llvm::SM_SentinelUndef, and llvm::SM_SentinelZero.
Referenced by addConstantComments().
|
static |
Definition at line 1870 of file X86MCInstLower.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::front(), llvm::MachineBasicBlock::getParent(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getPrevNode(), MBB, and MBBI.
Referenced by llvm::X86AsmPrinter::emitInstruction().
|
static |
Definition at line 1999 of file X86MCInstLower.cpp.
References Flt.
|
static |
Definition at line 1984 of file X86MCInstLower.cpp.
References llvm::APInt::getBitWidth(), llvm::APInt::getNumWords(), llvm::APInt::getRawData(), llvm::APInt::getZExtValue(), and N.
Referenced by addConstantComments(), and printConstant().
|
static |
Definition at line 2006 of file X86MCInstLower.cpp.
References printConstant().
|
static |
If a movsx instruction has a shorter encoding for the used register simplify the instruction to use it instead.
Definition at line 348 of file X86MCInstLower.cpp.
References llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::MCOperand::getReg(), llvm_unreachable, and llvm::MCInst::setOpcode().
Simplify FOO $imm, %{al,ax,eax,rax} to FOO $imm, for instruction with a short fixed-register form.
Definition at line 325 of file X86MCInstLower.cpp.
References llvm::MCInst::addOperand(), assert(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOperand(), llvm::MCOperand::getReg(), llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), Saved, and llvm::MCInst::setOpcode().
|
static |
Simplify things like MOV32rm to MOV32o32a.
Definition at line 375 of file X86MCInstLower.cpp.
References llvm::MCInst::addOperand(), llvm::X86::AddrBaseReg, llvm::X86::AddrIndexReg, llvm::X86::AddrScaleAmt, llvm::X86::AddrSegmentReg, assert(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOperand(), llvm::MCOperand::getReg(), llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), Printer, Saved, llvm::MCInst::setOpcode(), and llvm::MCSymbolRefExpr::VK_TLVP.