36#define DEBUG_TYPE "arm-mve-vpt-opts"
59 return "ARM MVE TailPred and VPT Optimisation Pass";
79char MVETPAndVPTOptimisations::ID = 0;
84 "ARM MVE TailPred and VPT Optimisations pass",
false,
89 "ARM MVE TailPred and VPT Optimisations pass",
false,
false)
93 while (
MI &&
MI->getOpcode() == TargetOpcode::COPY &&
94 MI->getOperand(1).getReg().isVirtual())
95 MI =
MRI->getVRegDef(
MI->getOperand(1).getReg());
107 if (!Header || !Latch) {
115 if (
T.getOpcode() == ARM::t2LoopEnd &&
T.getOperand(1).getMBB() == Header) {
119 if (
T.getOpcode() == ARM::t2LoopEndDec &&
120 T.getOperand(2).getMBB() == Header) {
140 if (LoopEnd->
getOpcode() == ARM::t2LoopEndDec)
145 if (!LoopDec || LoopDec->
getOpcode() != ARM::t2LoopDec) {
146 LLVM_DEBUG(
dbgs() <<
" didn't find LoopDec where we expected!\n");
154 if (!LoopPhi || LoopPhi->
getOpcode() != TargetOpcode::PHI ||
167 if (!LoopStart || (LoopStart->
getOpcode() != ARM::t2DoLoopStart &&
168 LoopStart->
getOpcode() != ARM::t2WhileLoopSetup &&
169 LoopStart->
getOpcode() != ARM::t2WhileLoopStartLR)) {
180 assert(
MI->getOpcode() == ARM::t2WhileLoopSetup &&
181 "Only expected a t2WhileLoopSetup in RevertWhileLoopStart!");
186 MIB.
add(
MI->getOperand(0));
187 MIB.
add(
MI->getOperand(1));
195 if (
I.getOpcode() == ARM::t2WhileLoopStart) {
198 MIB.
add(
MI->getOperand(1));
206 MI->eraseFromParent();
219bool MVETPAndVPTOptimisations::LowerWhileLoopStart(
MachineLoop *
ML) {
221 <<
ML->getHeader()->getName() <<
"\n");
223 MachineInstr *LoopEnd, *LoopPhi, *LoopStart, *LoopDec;
227 if (LoopStart->
getOpcode() != ARM::t2WhileLoopSetup)
232 return MI.getOpcode() == ARM::t2WhileLoopStart;
234 if (!
TII->getSubtarget().getCLOpts().merge_loopenddec ||
242 MachineInstrBuilder
MI =
243 BuildMI(*WLSIt->getParent(), *WLSIt, WLSIt->getDebugLoc(),
244 TII->get(ARM::t2WhileLoopStartLR), LR)
246 .
add(WLSIt->getOperand(1))
251 WLSIt->eraseFromParent();
266MachineInstr *MVETPAndVPTOptimisations::CheckForLRUseInPredecessors(
267 MachineBasicBlock *PreHeader, MachineInstr *LoopStart) {
269 SmallPtrSet<MachineBasicBlock *, 4> Visited;
273 while (!Worklist.
empty()) {
278 for (MachineInstr &
MI : *
MBB) {
287 MachineInstrBuilder MIB =
297 for (MachineOperand &MO :
299 if (MO.getParent()->getOpcode() == TargetOpcode::COPY)
318bool MVETPAndVPTOptimisations::MergeLoopEnd(MachineLoop *
ML) {
319 if (!
TII->getSubtarget().getCLOpts().merge_loopenddec)
325 MachineInstr *LoopEnd, *LoopPhi, *LoopStart, *LoopDec;
332 auto *PreHeader =
ML->getLoopPreheader();
333 if (LoopStart->
getOpcode() == ARM::t2WhileLoopStartLR && PreHeader)
334 LoopStart = CheckForLRUseInPredecessors(PreHeader, LoopStart);
336 for (MachineBasicBlock *
MBB :
ML->blocks()) {
337 for (MachineInstr &
MI : *
MBB) {
340 if (LoopStart->
getOpcode() == ARM::t2DoLoopStart)
358 SmallVector<MachineInstr *, 4>
Copies;
361 MachineRegisterInfo *
MRI) {
364 while (!Worklist.
empty()) {
369 if (
MI.getOpcode() != TargetOpcode::COPY ||
370 !
MI.getOperand(0).getReg().isVirtual()) {
380 if (!CheckUsers(PhiReg, {LoopDec},
MRI) ||
381 !CheckUsers(DecReg, {LoopPhi, LoopEnd},
MRI) ||
382 !CheckUsers(StartReg, {LoopPhi},
MRI)) {
384 if (LoopStart->
getOpcode() == ARM::t2WhileLoopStartLR) {
405 SmallVector<MachineOperand, 4>
Cond;
406 MachineBasicBlock *
TBB =
nullptr, *FBB =
nullptr;
417 MachineInstrBuilder
MI =
419 TII->get(ARM::t2LoopEndDec), DecReg)
429 MI->eraseFromParent();
437bool MVETPAndVPTOptimisations::ConvertTailPredLoop(MachineLoop *
ML,
438 MachineDominatorTree *DT) {
440 <<
ML->getHeader()->getName() <<
"\n");
444 MachineInstr *LoopEnd, *LoopPhi, *LoopStart, *LoopDec;
447 if (LoopDec != LoopEnd || (LoopStart->
getOpcode() != ARM::t2DoLoopStart &&
448 LoopStart->
getOpcode() != ARM::t2WhileLoopStartLR))
451 SmallVector<MachineInstr *, 4> VCTPs;
452 SmallVector<MachineInstr *, 4> MVEInstrs;
453 for (MachineBasicBlock *BB :
ML->blocks()) {
454 for (MachineInstr &
MI : *BB)
467 MachineInstr *FirstVCTP = *VCTPs.
begin();
468 for (MachineInstr *VCTP : VCTPs) {
470 if (VCTP->getOpcode() != FirstVCTP->
getOpcode() ||
493 if (!Phi ||
Phi->getOpcode() != TargetOpcode::PHI ||
494 Phi->getNumOperands() != 5 ||
495 (
Phi->getOperand(2).getMBB() !=
ML->getLoopLatch() &&
496 Phi->getOperand(4).getMBB() !=
ML->getLoopLatch())) {
500 CountReg =
Phi->getOperand(2).getMBB() ==
ML->getLoopLatch()
501 ?
Phi->getOperand(3).getReg()
502 :
Phi->getOperand(1).getReg();
509 for (MachineInstr &Use :
517 unsigned NewOpc = LoopStart->
getOpcode() == ARM::t2DoLoopStart
518 ? ARM::t2DoLoopStartTP
519 : ARM::t2WhileLoopStartTP;
520 MachineInstrBuilder
MI =
525 if (NewOpc == ARM::t2WhileLoopStartTP)
532 if (
TII->getSubtarget().getCLOpts().set_lr_predicate) {
536 for (MachineInstr *
MI : MVEInstrs) {
538 MI->getOperand(Idx + ARM::SUBOP_vpred_n_tp_reg).setReg(LR);
555 case ARM::MVE_VCMPf32:
556 case ARM::MVE_VCMPf16:
557 case ARM::MVE_VCMPf32r:
558 case ARM::MVE_VCMPf16r:
559 case ARM::MVE_VCMPi8r:
560 case ARM::MVE_VCMPi16r:
561 case ARM::MVE_VCMPi32r:
562 case ARM::MVE_VCMPu8r:
563 case ARM::MVE_VCMPu16r:
564 case ARM::MVE_VCMPu32r:
565 case ARM::MVE_VCMPs8r:
566 case ARM::MVE_VCMPs16r:
567 case ARM::MVE_VCMPs32r:
574 assert(
IsVCMP(Instr.getOpcode()) &&
"Inst must be a VCMP");
595 if (CondOP1.
isIdenticalTo(PrevOP1) && CondOP2.isIdenticalTo(PrevOP2))
602 CondOP2.isIdenticalTo(PrevOP1);
607 if (Instr.getNumOperands() == 0)
617 return RegClass && (RegClass->
getID() == ARM::VCCRRegClassID);
628MachineInstr &MVETPAndVPTOptimisations::ReplaceRegisterUseWithVPNOT(
629 MachineBasicBlock &
MBB, MachineInstr &Instr, MachineOperand &User,
633 MachineInstrBuilder MIBuilder =
640 User.setReg(NewResult);
654 assert(Iter->getOpcode() == ARM::MVE_VPNOT &&
"Not a VPNOT!");
656 "The VPNOT cannot be predicated");
663 bool MustMove =
false, HasUser =
false;
664 for (; Iter !=
MBB.end(); ++Iter) {
665 if (Iter->findRegisterUseOperandIdx(
Reg,
nullptr) != -1) {
670 if (Iter->findRegisterUseOperandIdx(VPNOTResult,
nullptr) == -1)
699bool MVETPAndVPTOptimisations::ReduceOldVCCRValueUses(MachineBasicBlock &
MBB) {
701 SmallVector<MachineInstr *, 4> DeadInstructions;
704 while (Iter !=
End) {
705 Register VCCRValue, OppositeVCCRValue;
709 for (; Iter !=
End; ++Iter) {
714 Register Dst = Iter->getOperand(0).getReg();
718 if (VCCRValue && Iter->getOpcode() == ARM::MVE_VPNOT &&
719 Iter->findRegisterUseOperandIdx(VCCRValue,
nullptr) != -1) {
725 OppositeVCCRValue = Dst;
738 assert(VCCRValue && OppositeVCCRValue &&
739 "VCCRValue and OppositeVCCRValue shouldn't be empty if the loop "
740 "stopped before the end of the block!");
741 assert(VCCRValue != OppositeVCCRValue &&
742 "VCCRValue should not be equal to OppositeVCCRValue!");
745 Register LastVPNOTResult = OppositeVCCRValue;
748 for (; Iter !=
End; ++Iter) {
749 bool IsInteresting =
false;
751 if (MachineOperand *MO =
752 Iter->findRegisterUseOperand(VCCRValue,
nullptr)) {
753 IsInteresting =
true;
758 if (Iter->getOpcode() == ARM::MVE_VPNOT) {
766 <<
"Replacing all uses of '" <<
printReg(Result)
767 <<
"' with '" <<
printReg(LastVPNOTResult) <<
"'\n");
769 MachineInstr &VPNOT =
770 ReplaceRegisterUseWithVPNOT(
MBB, *Iter, *MO, LastVPNOTResult);
777 <<
"' with '" <<
printReg(LastVPNOTResult)
778 <<
"' in instr: " << *Iter);
783 if (MachineOperand *MO = Iter->findRegisterUseOperand(
784 OppositeVCCRValue,
nullptr)) {
785 IsInteresting =
true;
788 if (LastVPNOTResult != OppositeVCCRValue) {
790 <<
printReg(OppositeVCCRValue) <<
"' with '"
791 <<
printReg(LastVPNOTResult) <<
" for instr: ";
793 MO->setReg(LastVPNOTResult);
800 if (Iter->getOpcode() == ARM::MVE_VPNOT &&
802 Register VPNOTOperand = Iter->getOperand(1).getReg();
803 if (VPNOTOperand == LastVPNOTResult ||
804 VPNOTOperand == OppositeVCCRValue) {
805 IsInteresting =
true;
808 LastVPNOTResult = Iter->getOperand(0).getReg();
819 for (MachineInstr *DeadInstruction : DeadInstructions)
820 DeadInstruction->eraseFromParent();
826bool MVETPAndVPTOptimisations::ReplaceVCMPsByVPNOTs(MachineBasicBlock &
MBB) {
827 SmallVector<MachineInstr *, 4> DeadInstructions;
834 MachineInstr *PrevVCMP =
nullptr;
836 for (MachineInstr &Instr :
MBB.
instrs()) {
859 MachineInstrBuilder MIBuilder =
862 .
addReg(PrevVCMPResultReg);
873 for (MachineInstr *DeadInstruction : DeadInstructions)
874 DeadInstruction->eraseFromParent();
876 return !DeadInstructions.empty();
879bool MVETPAndVPTOptimisations::ReplaceConstByVPNOTs(MachineBasicBlock &
MBB,
880 MachineDominatorTree *DT) {
886 unsigned LastVPTImm = 0;
888 SmallPtrSet<MachineInstr *, 4> DeadInstructions;
890 for (MachineInstr &Instr :
MBB.
instrs()) {
901 if (!Copy ||
Copy->getOpcode() != TargetOpcode::COPY ||
902 !
Copy->getOperand(1).getReg().isVirtual() ||
912 if (Def && (
Def->getOpcode() == ARM::t2MOVi ||
913 Def->getOpcode() == ARM::t2MOVi16))
914 return Def->getOperand(1).getImm();
923 unsigned NotImm = ~Imm & 0xffff;
924 if (LastVPTReg != 0 && LastVPTReg != VPR && LastVPTImm ==
Imm) {
925 Instr.getOperand(PIdx + 1).setReg(LastVPTReg);
927 DeadInstructions.
insert(Copy);
933 }
else if (LastVPTReg != 0 && LastVPTImm == NotImm) {
938 TII->get(ARM::MVE_VPNOT), NewVPR)
943 Instr.getOperand(PIdx + 1).setReg(NewVPR);
945 DeadInstructions.
insert(Copy);
949 LLVM_DEBUG(
dbgs() <<
"Adding VPNot: " << *VPNot <<
" to replace use at "
958 for (MachineInstr *DI : DeadInstructions)
959 DI->eraseFromParent();
961 return !DeadInstructions.empty();
969bool MVETPAndVPTOptimisations::ConvertVPSEL(MachineBasicBlock &
MBB) {
970 bool HasVCTP =
false;
971 SmallVector<MachineInstr *, 4> DeadInstructions;
979 if (!HasVCTP ||
MI.getOpcode() != ARM::MVE_VPSEL)
982 MachineInstrBuilder MIBuilder =
984 .
add(
MI.getOperand(0))
985 .
add(
MI.getOperand(1))
986 .
add(
MI.getOperand(1))
988 .
add(
MI.getOperand(4))
989 .
add(
MI.getOperand(5))
990 .
add(
MI.getOperand(2));
998 for (MachineInstr *DeadInstruction : DeadInstructions)
999 DeadInstruction->eraseFromParent();
1001 return !DeadInstructions.empty();
1006bool MVETPAndVPTOptimisations::HintDoLoopStartReg(MachineBasicBlock &
MBB) {
1009 if (
MI.getOpcode() != ARM::t2DoLoopStart)
1019bool MVETPAndVPTOptimisations::runOnMachineFunction(
MachineFunction &Fn) {
1020 const ARMSubtarget &STI = Fn.
getSubtarget<ARMSubtarget>();
1022 if (!STI.
isThumb2() || !STI.hasLOB())
1027 MachineLoopInfo *MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
1028 MachineDominatorTree *DT =
1029 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
1031 LLVM_DEBUG(
dbgs() <<
"********** ARM MVE VPT Optimisations **********\n"
1032 <<
"********** Function: " << Fn.
getName() <<
'\n');
1041 for (MachineBasicBlock &
MBB : Fn) {
1049 LLVM_DEBUG(
dbgs() <<
"**************************************\n");
1055 return new MVETPAndVPTOptimisations();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
const AArch64InstrInfo MachineBasicBlock::iterator InsertPt
const AArch64InstrInfo & TII
MachineBasicBlock MachineBasicBlock::iterator MBBI
SmallVector< MachineOperand, 4 > Cond
ARM MVE TailPred and VPT Optimisations static false MachineInstr * LookThroughCOPY(MachineInstr *MI, MachineRegisterInfo *MRI)
static void RevertWhileLoopSetup(MachineInstr *MI, const TargetInstrInfo *TII)
static bool findLoopComponents(MachineLoop *ML, MachineRegisterInfo *MRI, MachineInstr *&LoopStart, MachineInstr *&LoopPhi, MachineInstr *&LoopDec, MachineInstr *&LoopEnd)
static bool MoveVPNOTBeforeFirstUser(MachineBasicBlock &MBB, MachineBasicBlock::iterator Iter, Register Reg)
static ARMCC::CondCodes GetCondCode(MachineInstr &Instr)
static bool IsVPNOTEquivalent(MachineInstr &Cond, MachineInstr &Prev)
static bool IsInvalidTPInstruction(MachineInstr &MI)
static bool IsVCMP(unsigned Opcode)
static bool IsWritingToVCCR(MachineInstr &Instr)
static bool CanHaveSwappedOperands(unsigned Opcode)
Promote Memory to Register
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
MachineRegisterInfo & MRI
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
This file defines the SmallVector class.
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
const ARMBaseInstrInfo * getInstrInfo() const override
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
FunctionPass class - This class is used to implement most global optimizations.
SmallVector< LoopT *, 4 > getLoopsInPreorder() const
Return all of the loops in the function in preorder across the loop nests, with siblings in forward p...
unsigned getID() const
getID() - Return the register class ID number.
LLVM_ABI iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
iterator_range< iterator > terminators()
iterator_range< pred_iterator > predecessors()
MachineInstrBundleIterator< MachineInstr > iterator
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
bool dominates(const MachineInstr *A, const MachineInstr *B) const
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.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
BasicBlockListType::iterator iterator
const MachineInstrBuilder & setOperandDead(unsigned OpIdx) 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 & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
const MachineInstrBuilder & addDef(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a virtual register definition operand.
MachineInstr * getInstr() const
If conversion operators fail, use this method to get the MachineInstr explicitly.
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineBasicBlock * getParent() const
unsigned getNumOperands() const
Retuns the total number of operands.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
LLVM_ABI void dump() const
const MachineOperand & getOperand(unsigned i) const
LLVM_ABI MachineInstrBundleIterator< MachineInstr > eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
MachineOperand class - Representation of each machine instruction operand.
MachineBasicBlock * getMBB() const
LLVM_ABI void setReg(Register Reg)
Change the register this operand corresponds to.
Register getReg() const
getReg - Returns the register number.
LLVM_ABI bool isIdenticalTo(const MachineOperand &Other) const
Returns true if this operand is identical to the specified operand except for liveness related flags ...
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
LLVM_ABI bool hasOneNonDBGUse(Register RegNo) const
hasOneNonDBGUse - Return true if there is exactly one non-Debug use of the specified register.
const TargetRegisterClass * getRegClass(Register Reg) const
Return the register class of the specified virtual register.
LLVM_ABI LLVM_READONLY MachineInstr * getVRegDef(Register Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
bool use_nodbg_empty(Register RegNo) const
use_nodbg_empty - Return true if there are no non-Debug instructions using the specified register.
LLVM_ABI Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
iterator_range< use_instr_nodbg_iterator > use_nodbg_instructions(Register Reg) const
void setRegAllocationHint(Register VReg, unsigned Type, Register PrefReg)
setRegAllocationHint - Specify a register allocation hint for the specified virtual register.
iterator_range< use_instr_iterator > use_instructions(Register Reg) const
LLVM_ABI const TargetRegisterClass * constrainRegClass(Register Reg, const TargetRegisterClass *RC, unsigned MinNumRegs=0)
constrainRegClass - Constrain the register class of the specified virtual register to be a common sub...
iterator_range< use_iterator > use_operands(Register Reg) const
LLVM_ABI void replaceRegWith(Register FromReg, Register ToReg)
replaceRegWith - Replace all instances of FromReg with ToReg in the machine function.
static use_instr_nodbg_iterator use_instr_nodbg_end()
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
void push_back(const T &Elt)
LLVM_NO_SANITIZE_CFI_UNRELATED_CAST iterator begin()
Represent a constant reference to a string, i.e.
TargetInstrInfo - Interface to description of machine instruction set.
Target - Wrapper for Target specific information.
self_iterator getIterator()
static CondCodes getOppositeCondition(CondCodes CC)
static ARMCC::CondCodes getSwappedCondition(ARMCC::CondCodes CC)
getSwappedCondition - assume the flags are set by MI(a,b), return the condition code if we modify the...
@ User
could "use" a pointer
NodeAddr< DefNode * > Def
NodeAddr< InstrNode * > Instr
NodeAddr< PhiNode * > Phi
NodeAddr< UseNode * > Use
BaseReg
Stack frame base register. Bit 0 of FREInfo.Info.
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
int findFirstVPTPredOperandIdx(const MachineInstr &MI)
FunctionPass * createMVETPAndVPTOptimisationsPass()
createMVETPAndVPTOptimisationsPass
ARMVCC::VPTCodes getVPTInstrPredicate(const MachineInstr &MI, Register &PredReg)
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)
@ Define
Register definition.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static bool isLoopStart(const MachineInstr &MI)
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
void RevertWhileLoopStartLR(MachineInstr *MI, const TargetInstrInfo *TII, unsigned BrOpc=ARM::t2Bcc, bool UseCmp=false)
ArrayRef(const T &OneElt) -> ArrayRef< T >
void RevertLoopEnd(MachineInstr *MI, const TargetInstrInfo *TII, unsigned BrOpc=ARM::t2Bcc, bool SkipCmp=false)
void RevertLoopDec(MachineInstr *MI, const TargetInstrInfo *TII, bool SetFlags=false)
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
static unsigned VCMPOpcodeToVPT(unsigned Opcode)
void RevertDoLoopStart(MachineInstr *MI, const TargetInstrInfo *TII)
@ End
Run the machine verifier once, at the end of the pipeline.
void addUnpredicatedMveVpredNOp(MachineInstrBuilder &MIB)
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.
MCRegisterClass TargetRegisterClass
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.