LLVM 20.0.0git
|
#include "MCTargetDesc/X86ATTInstPrinter.h"
#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86EncodingOptimization.h"
#include "MCTargetDesc/X86InstComments.h"
#include "MCTargetDesc/X86ShuffleDecode.h"
#include "MCTargetDesc/X86TargetStreamer.h"
#include "X86AsmPrinter.h"
#include "X86MachineFunctionInfo.h"
#include "X86RegisterInfo.h"
#include "X86ShuffleDecodeConstantPool.h"
#include "X86Subtarget.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.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/MCStreamer.h"
#include "llvm/MC/MCSymbol.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 | INSTR_CASE(Prefix, Instr, Suffix, Postfix) case X86::Prefix##Instr##Suffix##rm##Postfix: |
#define | CASE_ARITH_RM(Instr) |
#define | MASK_AVX512_CASE(Instr) |
#define | MOV_CASE(Prefix, Suffix) |
#define | MOV_AVX512_CASE(Suffix, Postfix) |
#define | CASE_128_MOV_RM() |
#define | CASE_256_MOV_RM() |
#define | CASE_512_MOV_RM() |
#define | MOVX_CASE(Prefix, Ext, Type, Suffix, Postfix) case X86::Prefix##PMOV##Ext##Type##Suffix##rm##Postfix: |
#define | CASE_MOVX_RM(Ext, Type) |
Functions | |
static void | emitX86Nops (MCStreamer &OS, unsigned NumBytes, const X86Subtarget *Subtarget) |
Emit the optimal amount of multi-byte nops on X86. | |
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 unsigned | getSrcIdx (const MachineInstr *MI, unsigned SrcIdx) |
static void | printDstRegisterName (raw_ostream &CS, const MachineInstr *MI, unsigned SrcOpIdx) |
static void | printShuffleMask (raw_ostream &CS, StringRef Src1Name, StringRef Src2Name, ArrayRef< int > Mask) |
static std::string | getShuffleComment (const MachineInstr *MI, unsigned SrcOp1Idx, unsigned SrcOp2Idx, ArrayRef< int > Mask) |
static void | printConstant (const APInt &Val, raw_ostream &CS, bool PrintZero=false) |
static void | printConstant (const APFloat &Flt, raw_ostream &CS, bool PrintZero=false) |
static void | printConstant (const Constant *COp, unsigned BitWidth, raw_ostream &CS, bool PrintZero=false) |
static void | printZeroUpperMove (const MachineInstr *MI, MCStreamer &OutStreamer, int SclWidth, int VecWidth, const char *ShuffleComment) |
static void | printBroadcast (const MachineInstr *MI, MCStreamer &OutStreamer, int Repeats, int BitWidth) |
static bool | printExtend (const MachineInstr *MI, MCStreamer &OutStreamer, int SrcEltBits, int DstEltBits, bool IsSext) |
static void | printSignExtend (const MachineInstr *MI, MCStreamer &OutStreamer, int SrcEltBits, int DstEltBits) |
static void | printZeroExtend (const MachineInstr *MI, MCStreamer &OutStreamer, int SrcEltBits, int DstEltBits) |
static void | addConstantComments (const MachineInstr *MI, MCStreamer &OutStreamer) |
Variables | |
static cl::opt< bool > | EnableBranchHint ("enable-branch-hint", cl::desc("Enable branch hint."), cl::init(false), cl::Hidden) |
static cl::opt< unsigned > | BranchHintProbabilityThreshold ("branch-hint-probability-threshold", cl::desc("The probability threshold of enabling branch hint."), cl::init(50), cl::Hidden) |
#define CASE_128_MOV_RM | ( | ) |
#define CASE_256_MOV_RM | ( | ) |
#define CASE_512_MOV_RM | ( | ) |
#define CASE_ARITH_RM | ( | Instr | ) |
#define CASE_MOVX_RM | ( | Ext, | |
Type | |||
) |
#define INSTR_CASE | ( | Prefix, | |
Instr, | |||
Suffix, | |||
Postfix | |||
) | case X86::Prefix##Instr##Suffix##rm##Postfix: |
#define MASK_AVX512_CASE | ( | Instr | ) |
#define MOV_AVX512_CASE | ( | Suffix, | |
Postfix | |||
) |
#define MOV_CASE | ( | Prefix, | |
Suffix | |||
) |
#define MOVX_CASE | ( | Prefix, | |
Ext, | |||
Type, | |||
Suffix, | |||
Postfix | |||
) | case X86::Prefix##PMOV##Ext##Type##Suffix##rm##Postfix: |
|
static |
Definition at line 1787 of file X86MCInstLower.cpp.
References llvm::MCStreamer::AddComment(), llvm::X86::AddrNumOperands, assert(), llvm::CallingConv::C, CASE_128_MOV_RM, CASE_256_MOV_RM, CASE_512_MOV_RM, CASE_ARITH_RM, CASE_MOVX_RM, llvm::DecodePSHUFBMask(), llvm::DecodeVPERMIL2PMask(), llvm::DecodeVPERMILPMask(), llvm::DecodeVPPERMMask(), llvm::X86::getConstantFromPool(), llvm::MachineOperand::getImm(), llvm::DstOp::getReg(), llvm::X86ATTInstPrinter::getRegisterName(), getShuffleComment(), getSrcIdx(), llvm::X86::getVectorRegisterWidth(), llvm::MachineOperand::isImm(), llvm_unreachable, MASK_AVX512_CASE, MI, printBroadcast(), printConstant(), printSignExtend(), printZeroExtend(), printZeroUpperMove(), llvm::raw_string_ostream::str(), and llvm::toString().
Referenced by llvm::X86AsmPrinter::emitInstruction().
Definition at line 374 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 663 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 780 of file X86MCInstLower.cpp.
|
static |
Definition at line 332 of file X86MCInstLower.cpp.
Referenced by llvm::X86AsmPrinter::emitInstruction().
|
static |
Definition at line 1525 of file X86MCInstLower.cpp.
References llvm::MachineOperand::getReg(), llvm::X86ATTInstPrinter::getRegisterName(), llvm::MachineOperand::isReg(), MI, printDstRegisterName(), and printShuffleMask().
Referenced by addConstantComments().
|
static |
Definition at line 1455 of file X86MCInstLower.cpp.
References llvm::X86II::isKMasked(), llvm::X86II::isKMergeMasked(), and MI.
Referenced by addConstantComments(), printBroadcast(), printExtend(), printZeroExtend(), and printZeroUpperMove().
|
static |
Definition at line 1443 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 1639 of file X86MCInstLower.cpp.
References llvm::MCStreamer::AddComment(), llvm::BitWidth, llvm::CallingConv::C, llvm::X86::getConstantFromPool(), getSrcIdx(), MI, printConstant(), printDstRegisterName(), and llvm::raw_string_ostream::str().
Referenced by addConstantComments().
|
static |
Definition at line 1562 of file X86MCInstLower.cpp.
References Flt, llvm::APFloat::getZero(), and llvm::APFloat::toString().
|
static |
Definition at line 1546 of file X86MCInstLower.cpp.
References llvm::APInt::getBitWidth(), llvm::APInt::getNumWords(), llvm::APInt::getRawData(), llvm::APInt::getZExtValue(), and N.
Referenced by addConstantComments(), printBroadcast(), printConstant(), printExtend(), and printZeroUpperMove().
|
static |
Definition at line 1573 of file X86MCInstLower.cpp.
References assert(), llvm::BitWidth, llvm::Type::getPrimitiveSizeInBits(), I, llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isHalfTy(), llvm::Type::isIntegerTy(), and printConstant().
|
static |
Definition at line 1467 of file X86MCInstLower.cpp.
References llvm::DstOp::getReg(), llvm::MachineOperand::getReg(), llvm::X86ATTInstPrinter::getRegisterName(), llvm::X86II::isKMasked(), llvm::X86II::isKMergeMasked(), and MI.
Referenced by getShuffleComment(), printBroadcast(), printExtend(), printZeroExtend(), and printZeroUpperMove().
|
static |
Definition at line 1657 of file X86MCInstLower.cpp.
References llvm::MCStreamer::AddComment(), llvm::CallingConv::C, llvm::X86::getConstantFromPool(), getSrcIdx(), MI, printConstant(), printDstRegisterName(), llvm::APInt::sext(), llvm::raw_string_ostream::str(), and llvm::APInt::zext().
Referenced by printSignExtend(), and printZeroExtend().
|
static |
Definition at line 1485 of file X86MCInstLower.cpp.
References llvm::SmallVectorBase< Size_T >::size(), llvm::SM_SentinelUndef, and llvm::SM_SentinelZero.
Referenced by getShuffleComment(), and printZeroExtend().
|
static |
Definition at line 1686 of file X86MCInstLower.cpp.
References MI, and printExtend().
Referenced by addConstantComments().
|
static |
Definition at line 1690 of file X86MCInstLower.cpp.
References llvm::MCStreamer::AddComment(), assert(), llvm::DecodeZeroExtendMask(), getSrcIdx(), llvm::X86::getVectorRegisterWidth(), MI, printDstRegisterName(), printExtend(), printShuffleMask(), and llvm::raw_string_ostream::str().
Referenced by addConstantComments().
|
static |
Definition at line 1612 of file X86MCInstLower.cpp.
References llvm::MCStreamer::AddComment(), llvm::CallingConv::C, llvm::X86::getConstantFromPool(), getSrcIdx(), I, MI, printConstant(), printDstRegisterName(), and llvm::raw_string_ostream::str().
Referenced by addConstantComments().
|
static |
Referenced by llvm::X86AsmPrinter::emitInstruction().