15#ifndef LLVM_LIB_TARGET_ARM_MVETAILPREDUTILS_H
16#define LLVM_LIB_TARGET_ARM_MVETAILPREDUTILS_H
31 return IsDoLoop ? ARM::MVE_DLSTP_8 : ARM::MVE_WLSTP_8;
33 return IsDoLoop ? ARM::MVE_DLSTP_16 : ARM::MVE_WLSTP_16;
35 return IsDoLoop ? ARM::MVE_DLSTP_32 : ARM::MVE_WLSTP_32;
37 return IsDoLoop ? ARM::MVE_DLSTP_64 : ARM::MVE_WLSTP_64;
59 switch (
MI->getOpcode()) {
72 return MI.getOpcode() == ARM::t2DoLoopStart ||
73 MI.getOpcode() == ARM::t2DoLoopStartTP;
77 return MI.getOpcode() == ARM::t2WhileLoopStart ||
78 MI.getOpcode() == ARM::t2WhileLoopStartLR ||
79 MI.getOpcode() == ARM::t2WhileLoopStartTP;
89 unsigned Op =
MI.getOpcode() == ARM::t2WhileLoopStartTP ? 3 : 2;
90 return MI.getOperand(
Op).getMBB();
99 unsigned BrOpc = ARM::t2Bcc,
100 bool UseCmp =
false) {
102 assert((
MI->getOpcode() == ARM::t2WhileLoopStartLR ||
103 MI->getOpcode() == ARM::t2WhileLoopStartTP) &&
104 "Only expected a t2WhileLoopStartLR/TP in RevertWhileLoopStartLR!");
110 MIB.
add(
MI->getOperand(1));
113 MIB.
addReg(ARM::NoRegister);
117 MIB.
add(
MI->getOperand(0));
118 MIB.
add(
MI->getOperand(1));
121 MIB.
addReg(ARM::NoRegister);
132 MI->eraseFromParent();
138 .
add(
MI->getOperand(0))
139 .
add(
MI->getOperand(1))
142 MI->eraseFromParent();
146 bool SetFlags =
false) {
151 MIB.
add(
MI->getOperand(0));
152 MIB.
add(
MI->getOperand(1));
153 MIB.
add(
MI->getOperand(2));
163 MI->eraseFromParent();
168 unsigned BrOpc = ARM::t2Bcc,
bool SkipCmp =
false) {
175 MIB.
add(
MI->getOperand(0));
178 MIB.
addReg(ARM::NoRegister);
184 MIB.
add(
MI->getOperand(1));
187 MI->eraseFromParent();
const HexagonInstrInfo * TII
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class represents an Operation in the Expression.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
Representation of each machine instruction.
const MachineOperand & getOperand(unsigned i) const
void setIsDef(bool Val=true)
Change a def to a use, or a use to a def.
TargetInstrInfo - Interface to description of machine instruction set.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Define
Register definition.
This is an optimization pass for GlobalISel generic memory operations.
static bool isDoLoopStart(const MachineInstr &MI)
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static bool isVCTP(const MachineInstr *MI)
static unsigned getTailPredVectorWidth(unsigned Opcode)
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
static bool isLoopStart(const MachineInstr &MI)
void RevertWhileLoopStartLR(MachineInstr *MI, const TargetInstrInfo *TII, unsigned BrOpc=ARM::t2Bcc, bool UseCmp=false)
static unsigned VCTPOpcodeToLSTP(unsigned Opcode, bool IsDoLoop)
void RevertLoopEnd(MachineInstr *MI, const TargetInstrInfo *TII, unsigned BrOpc=ARM::t2Bcc, bool SkipCmp=false)
void RevertLoopDec(MachineInstr *MI, const TargetInstrInfo *TII, bool SetFlags=false)
MachineBasicBlock * getWhileLoopStartTargetBB(const MachineInstr &MI)
static bool isWhileLoopStart(const MachineInstr &MI)
void RevertDoLoopStart(MachineInstr *MI, const TargetInstrInfo *TII)