35#define DEBUG_TYPE "x86-expand-pseudo"
36#define X86_EXPAND_PSEUDO_NAME "X86 pseudo instruction expansion pass"
39class X86ExpandPseudoImpl {
65 void expandVastartSaveXmmRegs(
93 return "X86 pseudo instruction expansion pass";
96char X86ExpandPseudoLegacy::ID = 0;
102void X86ExpandPseudoImpl::expandICallBranchFunnel(
111 std::vector<std::pair<MachineBasicBlock *, unsigned>> TargetMBBs;
116 auto CmpTarget = [&](
unsigned Target) {
117 if (Selector.
isReg())
131 auto CreateMBB = [&]() {
133 MBB->addSuccessor(NewMBB);
134 if (!
MBB->isLiveIn(X86::EFLAGS))
135 MBB->addLiveIn(X86::EFLAGS);
142 auto *ElseMBB = CreateMBB();
143 MF->
insert(InsPt, ElseMBB);
148 auto EmitCondJumpTarget = [&](
unsigned CC,
unsigned Target) {
149 auto *ThenMBB = CreateMBB();
150 TargetMBBs.push_back({ThenMBB,
Target});
151 EmitCondJump(CC, ThenMBB);
154 auto EmitTailCall = [&](
unsigned Target) {
159 std::function<void(
unsigned,
unsigned)> EmitBranchFunnel =
161 if (NumTargets == 1) {
166 if (NumTargets == 2) {
173 if (NumTargets < 6) {
181 auto *ThenMBB = CreateMBB();
185 EmitBranchFunnel(
FirstTarget + (NumTargets / 2) + 1,
186 NumTargets - (NumTargets / 2) - 1);
188 MF->
insert(InsPt, ThenMBB);
195 for (
auto P : TargetMBBs) {
200 JTMBB->
erase(JTInst);
203void X86ExpandPseudoImpl::expandCALL_RVMARKER(
209 MachineInstr *OriginalCall;
210 assert((
MI.getOperand(1).isGlobal() ||
MI.getOperand(1).isReg()) &&
211 "invalid operand for regular call");
213 if (
MI.getOpcode() == X86::CALL64m_RVMARKER)
215 else if (
MI.getOpcode() == X86::CALL64r_RVMARKER)
217 else if (
MI.getOpcode() == X86::CALL64pcrel32_RVMARKER)
218 Opc = X86::CALL64pcrel32;
223 bool RAXImplicitDead =
false;
227 if (
Op.isReg() &&
Op.isImplicit() &&
Op.isDead() &&
228 TRI->regsOverlap(
Op.getReg(), X86::RAX)) {
231 RAXImplicitDead =
true;
243 .
addReg(TargetReg, RegState::Define)
246 if (
MI.shouldUpdateAdditionalCallInfo())
250 const uint32_t *RegMask =
252 MachineInstr *RtCall =
258 (RAXImplicitDead ? (RegState::Dead | RegState::Define)
261 MI.eraseFromParent();
266 if (TM.getTargetTriple().isOSDarwin())
274bool X86ExpandPseudoImpl::expandMI(MachineBasicBlock &
MBB,
277 unsigned Opcode =
MI.getOpcode();
279#define GET_EGPR_IF_ENABLED(OPC) (STI->hasEGPR() ? OPC##_EVEX : OPC)
283 case X86::TCRETURNdi:
284 case X86::TCRETURNdicc:
285 case X86::TCRETURNri:
286 case X86::TCRETURN_WIN64ri:
287 case X86::TCRETURN_HIPE32ri:
288 case X86::TCRETURNmi:
289 case X86::TCRETURNdi64:
290 case X86::TCRETURNdi64cc:
291 case X86::TCRETURNri64:
292 case X86::TCRETURNri64_ImpCall:
293 case X86::TCRETURNmi64:
294 case X86::TCRETURN_WINmi64: {
295 bool isMem = Opcode == X86::TCRETURNmi || Opcode == X86::TCRETURNmi64 ||
296 Opcode == X86::TCRETURN_WINmi64;
297 MachineOperand &JumpTarget =
MBBI->getOperand(0);
300 assert(StackAdjust.
isImm() &&
"Expecting immediate value.");
303 int StackAdj = StackAdjust.
getImm();
306 assert(MaxTCDelta <= 0 &&
"MaxTCDelta should never be positive");
309 Offset = StackAdj - MaxTCDelta;
310 assert(
Offset >= 0 &&
"Offset should never be negative");
312 if (Opcode == X86::TCRETURNdicc || Opcode == X86::TCRETURNdi64cc) {
313 assert(
Offset == 0 &&
"Conditional tail call cannot adjust the stack.");
325 if (Opcode == X86::TCRETURNdi || Opcode == X86::TCRETURNdicc ||
326 Opcode == X86::TCRETURNdi64 || Opcode == X86::TCRETURNdi64cc) {
329 case X86::TCRETURNdi:
332 case X86::TCRETURNdicc:
333 Op = X86::TAILJMPd_CC;
335 case X86::TCRETURNdi64cc:
337 "Conditional tail calls confuse "
338 "the Win64 unwinder.");
339 Op = X86::TAILJMPd64_CC;
344 Op = X86::TAILJMPd64;
356 if (
Op == X86::TAILJMPd_CC ||
Op == X86::TAILJMPd64_CC) {
360 }
else if (Opcode == X86::TCRETURNmi || Opcode == X86::TCRETURNmi64 ||
361 Opcode == X86::TCRETURN_WINmi64) {
362 unsigned Op = (Opcode == X86::TCRETURNmi)
364 : (IsX64 ?
X86::TAILJMPm64_REX :
X86::TAILJMPm64);
368 }
else if (Opcode == X86::TCRETURNri64 ||
369 Opcode == X86::TCRETURNri64_ImpCall ||
370 Opcode == X86::TCRETURN_WIN64ri) {
373 TII->get(IsX64 ? X86::TAILJMPr64_REX : X86::TAILJMPr64))
376 assert(!IsX64 &&
"Win64 and UEFI64 require REX for indirect jumps.");
382 MachineInstr &NewMI = *std::prev(
MBBI);
387 if (
MBBI->isCandidateForAdditionalCallInfo())
396 case X86::EH_RETURN64: {
397 MachineOperand &DestAddr =
MBBI->getOperand(0);
398 assert(DestAddr.
isReg() &&
"Offset should be in register!");
402 TII->get(Uses64BitFramePtr ? X86::MOV64rr : X86::MOV32rr), StackPtr)
409 int64_t StackAdj =
MBBI->getOperand(0).getImm();
412 unsigned RetOp = STI->is64Bit() ? X86::IRET64 : X86::IRET32;
414 if (STI->is64Bit() && STI->hasUINTR() &&
423 int64_t StackAdj =
MBBI->getOperand(0).getImm();
424 MachineInstrBuilder MIB;
427 TII->get(STI->is64Bit() ? X86::RET64 : X86::RET32));
430 TII->get(STI->is64Bit() ? X86::RETI64 : X86::RETI32))
434 "shouldn't need to do this for x86_64 targets!");
442 for (
unsigned I = 1,
E =
MBBI->getNumOperands();
I !=
E; ++
I)
447 case X86::LCMPXCHG16B_SAVE_RBX: {
454 const MachineOperand &InArg =
MBBI->getOperand(6);
466 const MachineOperand &
Base =
MBBI->getOperand(1);
467 if (
Base.getReg() == X86::RBX ||
Base.getReg() == X86::EBX)
469 Base.getReg() == X86::RBX
471 :
Register(
TRI->getSubReg(SaveRbx, X86::sub_32bit)),
493 case X86::MASKPAIR16LOAD: {
495 assert(Disp >= 0 && Disp <= INT32_MAX - 2 &&
"Unexpected displacement");
497 bool DstIsDead =
MBBI->getOperand(0).isDead();
509 MIBLo.add(
MBBI->getOperand(1 + i));
511 MIBHi.addImm(Disp + 2);
513 MIBHi.add(
MBBI->getOperand(1 + i));
517 MachineMemOperand *OldMMO =
MBBI->memoperands().
front();
522 MIBLo.setMemRefs(MMOLo);
523 MIBHi.setMemRefs(MMOHi);
529 case X86::MASKPAIR16STORE: {
531 assert(Disp >= 0 && Disp <= INT32_MAX - 2 &&
"Unexpected displacement");
543 MIBLo.add(
MBBI->getOperand(i));
545 MIBHi.addImm(Disp + 2);
547 MIBHi.add(
MBBI->getOperand(i));
553 MachineMemOperand *OldMMO =
MBBI->memoperands().
front();
558 MIBLo.setMemRefs(MMOLo);
559 MIBHi.setMemRefs(MMOHi);
565 case X86::MWAITX_SAVE_RBX: {
572 const MachineOperand &InArg =
MBBI->getOperand(1);
585 case TargetOpcode::ICALL_BRANCH_FUNNEL:
586 expandICallBranchFunnel(&
MBB,
MBBI);
588 case X86::PLDTILECFGV: {
592 case X86::PTILELOADDV:
593 case X86::PTILELOADDT1V:
594 case X86::PTILELOADDRSV:
595 case X86::PTILELOADDRST1V:
596 case X86::PTCVTROWD2PSrteV:
597 case X86::PTCVTROWD2PSrtiV:
598 case X86::PTCVTROWPS2BF16HrteV:
599 case X86::PTCVTROWPS2BF16HrtiV:
600 case X86::PTCVTROWPS2BF16LrteV:
601 case X86::PTCVTROWPS2BF16LrtiV:
602 case X86::PTCVTROWPS2PHHrteV:
603 case X86::PTCVTROWPS2PHHrtiV:
604 case X86::PTCVTROWPS2PHLrteV:
605 case X86::PTCVTROWPS2PHLrtiV:
606 case X86::PTILEMOVROWrteV:
607 case X86::PTILEMOVROWrtiV: {
608 for (
unsigned i = 2; i > 0; --i)
612 case X86::PTILELOADDRSV:
615 case X86::PTILELOADDRST1V:
618 case X86::PTILELOADDV:
621 case X86::PTILELOADDT1V:
624 case X86::PTCVTROWD2PSrteV:
625 Opc = X86::TCVTROWD2PSrte;
627 case X86::PTCVTROWD2PSrtiV:
628 Opc = X86::TCVTROWD2PSrti;
630 case X86::PTCVTROWPS2BF16HrteV:
631 Opc = X86::TCVTROWPS2BF16Hrte;
633 case X86::PTCVTROWPS2BF16HrtiV:
634 Opc = X86::TCVTROWPS2BF16Hrti;
636 case X86::PTCVTROWPS2BF16LrteV:
637 Opc = X86::TCVTROWPS2BF16Lrte;
639 case X86::PTCVTROWPS2BF16LrtiV:
640 Opc = X86::TCVTROWPS2BF16Lrti;
642 case X86::PTCVTROWPS2PHHrteV:
643 Opc = X86::TCVTROWPS2PHHrte;
645 case X86::PTCVTROWPS2PHHrtiV:
646 Opc = X86::TCVTROWPS2PHHrti;
648 case X86::PTCVTROWPS2PHLrteV:
649 Opc = X86::TCVTROWPS2PHLrte;
651 case X86::PTCVTROWPS2PHLrtiV:
652 Opc = X86::TCVTROWPS2PHLrti;
654 case X86::PTILEMOVROWrteV:
655 Opc = X86::TILEMOVROWrte;
657 case X86::PTILEMOVROWrtiV:
658 Opc = X86::TILEMOVROWrti;
666 case X86::PTCMMIMFP16PSV:
667 case X86::PTCMMRLFP16PSV:
672 case X86::PTDPBF16PSV:
673 case X86::PTDPFP16PSV:
674 case X86::PTDPBF8PSV:
675 case X86::PTDPBHF8PSV:
676 case X86::PTDPHBF8PSV:
677 case X86::PTDPHF8PSV: {
678 MI.untieRegOperand(4);
679 for (
unsigned i = 3; i > 0; --i)
684 case X86::PTCMMIMFP16PSV:
Opc = X86::TCMMIMFP16PS;
break;
685 case X86::PTCMMRLFP16PSV:
Opc = X86::TCMMRLFP16PS;
break;
686 case X86::PTDPBSSDV:
Opc = X86::TDPBSSD;
break;
687 case X86::PTDPBSUDV:
Opc = X86::TDPBSUD;
break;
688 case X86::PTDPBUSDV:
Opc = X86::TDPBUSD;
break;
689 case X86::PTDPBUUDV:
Opc = X86::TDPBUUD;
break;
690 case X86::PTDPBF16PSV:
Opc = X86::TDPBF16PS;
break;
691 case X86::PTDPFP16PSV:
Opc = X86::TDPFP16PS;
break;
692 case X86::PTDPBF8PSV:
Opc = X86::TDPBF8PS;
break;
693 case X86::PTDPBHF8PSV:
Opc = X86::TDPBHF8PS;
break;
694 case X86::PTDPHBF8PSV:
Opc = X86::TDPHBF8PS;
break;
695 case X86::PTDPHF8PSV:
Opc = X86::TDPHF8PS;
break;
701 MI.tieOperands(0, 1);
704 case X86::PTILESTOREDV: {
705 for (
int i = 1; i >= 0; --i)
710#undef GET_EGPR_IF_ENABLED
711 case X86::PTILEZEROV: {
712 for (
int i = 2; i > 0; --i)
714 MI.setDesc(
TII->get(X86::TILEZERO));
717 case X86::CALL64pcrel32_RVMARKER:
718 case X86::CALL64r_RVMARKER:
719 case X86::CALL64m_RVMARKER:
720 expandCALL_RVMARKER(
MBB,
MBBI);
722 case X86::CALL64r_ImpCall:
723 MI.setDesc(
TII->get(X86::CALL64r));
725 case X86::ADD32mi_ND:
726 case X86::ADD64mi32_ND:
727 case X86::SUB32mi_ND:
728 case X86::SUB64mi32_ND:
729 case X86::AND32mi_ND:
730 case X86::AND64mi32_ND:
732 case X86::OR64mi32_ND:
733 case X86::XOR32mi_ND:
734 case X86::XOR64mi32_ND:
735 case X86::ADC32mi_ND:
736 case X86::ADC64mi32_ND:
737 case X86::SBB32mi_ND:
738 case X86::SBB64mi32_ND: {
755 const MachineOperand &ImmOp =
756 MI.getOperand(
MI.getNumExplicitOperands() - 1);
771 if (getX86MCRegisterClass(X86::GR32RegClassID).
contains(
Base) ||
772 getX86MCRegisterClass(X86::GR32RegClassID).
contains(Index))
776 unsigned Opc, LoadOpc;
778#define MI_TO_RI(OP) \
779 case X86::OP##32mi_ND: \
780 Opc = X86::OP##32ri; \
781 LoadOpc = X86::MOV32rm; \
783 case X86::OP##64mi32_ND: \
784 Opc = X86::OP##64ri32; \
785 LoadOpc = X86::MOV64rm; \
805 for (
unsigned I =
MI.getNumImplicitOperands() + 1;
I != 0; --
I)
806 MI.removeOperand(
MI.getNumOperands() - 1);
807 MI.setDesc(
TII->get(LoadOpc));
828void X86ExpandPseudoImpl::expandVastartSaveXmmRegs(
829 MachineBasicBlock *EntryBlk,
831 assert(VAStartPseudoInstr->getOpcode() == X86::VASTART_SAVE_XMM_REGS);
835 const DebugLoc &
DL = VAStartPseudoInstr->getDebugLoc();
836 Register CountReg = VAStartPseudoInstr->getOperand(0).getReg();
842 LiveRegs.addLiveIns(*EntryBlk);
843 for (MachineInstr &
MI : EntryBlk->
instrs()) {
844 if (
MI.getOpcode() == VAStartPseudoInstr->getOpcode())
847 LiveRegs.stepForward(
MI, Clobbers);
855 MachineBasicBlock *GuardedRegsBlk =
Func->CreateMachineBasicBlock(LLVMBlk);
856 MachineBasicBlock *TailBlk =
Func->CreateMachineBasicBlock(LLVMBlk);
857 Func->insert(EntryBlkIter, GuardedRegsBlk);
858 Func->insert(EntryBlkIter, TailBlk);
866 uint64_t FrameOffset = VAStartPseudoInstr->getOperand(4).getImm();
867 uint64_t VarArgsRegsOffset = VAStartPseudoInstr->getOperand(6).getImm();
870 unsigned MOVOpc = STI->
hasAVX() ? X86::VMOVAPSmr : X86::MOVAPSmr;
873 for (int64_t OpndIdx = 7, RegIdx = 0;
874 OpndIdx < VAStartPseudoInstr->getNumOperands() - 1;
875 OpndIdx++, RegIdx++) {
876 auto NewMI =
BuildMI(GuardedRegsBlk,
DL,
TII->get(MOVOpc));
879 NewMI.addImm(FrameOffset + VarArgsRegsOffset + RegIdx * 16);
881 NewMI.add(VAStartPseudoInstr->getOperand(i + 1));
883 NewMI.addReg(VAStartPseudoInstr->getOperand(OpndIdx).getReg());
884 assert(VAStartPseudoInstr->getOperand(OpndIdx).getReg().isPhysical());
908 VAStartPseudoInstr->eraseFromParent();
913bool X86ExpandPseudoImpl::expandMBB(MachineBasicBlock &
MBB) {
927bool X86ExpandPseudoImpl::expandPseudosWhichAffectControlFlow(
928 MachineFunction &MF) {
933 if (
Instr.getOpcode() == X86::VASTART_SAVE_XMM_REGS) {
934 expandVastartSaveXmmRegs(&(MF.
front()), Instr);
942bool X86ExpandPseudoImpl::runOnMachineFunction(MachineFunction &MF) {
946 X86FI = MF.
getInfo<X86MachineFunctionInfo>();
949 bool Modified = expandPseudosWhichAffectControlFlow(MF);
951 for (MachineBasicBlock &
MBB : MF)
958 return new X86ExpandPseudoLegacy();
962 X86ExpandPseudoImpl Impl;
963 return Impl.runOnMachineFunction(MF);
969 X86ExpandPseudoImpl Impl;
970 bool Changed = Impl.runOnMachineFunction(MF);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const HexagonInstrInfo * TII
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
static Target * FirstTarget
#define GET_EGPR_IF_ENABLED(OPC)
#define X86_EXPAND_PSEUDO_NAME
Represent the analysis usage information of a pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
LLVM Basic Block Representation.
Represents analyses that only rely on functions' control flow.
FunctionPass class - This class is used to implement most global optimizations.
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
Emit instructions to copy a pair of physical registers.
LLVM_ABI void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
LLVM_ABI void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
LLVM_ABI void eraseFromParent()
This method unlinks 'this' from the containing function and deletes it.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
LLVM_ABI instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Properties which a MachineFunction may have at a given point in time.
void moveAdditionalCallInfo(const MachineInstr *Old, const MachineInstr *New)
Move the call site info from Old to \New call site info.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, Align base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
BasicBlockListType::iterator iterator
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MachineBasicBlock & front() const
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *BB=nullptr, std::optional< UniqueBBID > BBID=std::nullopt)
CreateMachineInstr - Allocate a new MachineInstr.
void insert(iterator MBBI, MachineBasicBlock *MBB)
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned TargetFlags=0) const
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addRegMask(const uint32_t *Mask) const
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned TargetFlags=0) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
MachineInstr * getInstr() const
If conversion operators fail, use this method to get the MachineInstr explicitly.
Representation of each machine instruction.
LLVM_ABI void setCFIType(MachineFunction &MF, uint32_t Type)
Set the CFI type for the instruction.
unsigned getNumOperands() const
Retuns the total number of operands.
LLVM_ABI void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
LLVM_ABI void copyImplicitOps(MachineFunction &MF, const MachineInstr &MI)
Copy implicit register operands from specified instruction to this instruction.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
void setIsKill(bool Val=true)
unsigned getTargetFlags() const
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
static MachineOperand CreateReg(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)
int64_t getOffset() const
Return the offset from the symbol in this operand.
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.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
Represent a constant reference to a string, i.e.
CodeModel::Model getCodeModel() const
Returns the code model.
Target - Wrapper for Target specific information.
bool isOSWindows() const
Tests whether the OS is Windows.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
int64_t mergeSPAdd(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, int64_t AddOffset, bool doMergeWithPrevious) const
Equivalent to: mergeSPUpdates(MBB, MBBI, [AddOffset](int64_t Offset) { return AddOffset + Offset; }...
void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &DL, int64_t NumBytes, bool InEpilogue) const
Emit a series of instructions to increment / decrement the stack pointer by a constant value.
X86MachineFunctionInfo - This class is derived from MachineFunction and contains private X86 target-s...
int getTCReturnAddrDelta() const
bool isTargetWin64() const
bool isTarget64BitLP64() const
Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
const Triple & getTargetTriple() const
const X86InstrInfo * getInstrInfo() const override
bool isCallingConvWin64(CallingConv::ID CC) const
bool isTargetUEFI64() const
const X86RegisterInfo * getRegisterInfo() const override
const X86FrameLowering * getFrameLowering() const override
self_iterator getIterator()
Pass manager infrastructure for declaring and invalidating analyses.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ BasicBlock
Various leaf nodes.
@ X86
Windows x64, Windows Itanium (IA-64)
bool needSIB(MCRegister BaseReg, MCRegister IndexReg, bool In64BitMode)
int getFirstAddrOperandIdx(const MachineInstr &MI)
Return the index of the instruction's first address operand, if it has a memory reference,...
NodeAddr< InstrNode * > Instr
NodeAddr< FuncNode * > Func
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
LLVM_ABI void finalizeBundle(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
finalizeBundle - Finalize a machine instruction bundle which includes a sequence of instructions star...
FunctionPass * createX86ExpandPseudoLegacyPass()
Returns an instance of the pseudo instruction expansion pass.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
static bool isMem(const MachineInstr &MI, unsigned Op)
constexpr RegState getKillRegState(bool B)
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
constexpr RegState getDeadRegState(bool B)
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
DWARFExpression::Operation Op
LLVM_ABI void addLiveIns(MachineBasicBlock &MBB, const LivePhysRegs &LiveRegs)
Adds registers contained in LiveRegs to the block live-in list of MBB.