122#define DEBUG_TYPE "expand-condsets"
171 bool CoaLimitActive =
false;
172 bool TfrLimitActive =
false;
175 unsigned CoaCounter = 0;
176 unsigned TfrCounter = 0;
181 Sub(
Op.getSubReg()) {}
182 RegisterRef(
unsigned R = 0,
unsigned S = 0) :
Reg(
R), Sub(S) {}
184 bool operator== (RegisterRef RR)
const {
185 return Reg == RR.Reg && Sub == RR.Sub;
189 return Reg < RR.Reg || (
Reg == RR.Reg && Sub < RR.Sub);
197 enum { Sub_Low = 0x1, Sub_High = 0x2, Sub_None = (Sub_Low | Sub_High) };
198 enum { Exec_Then = 0x10, Exec_Else = 0x20 };
200 unsigned getMaskForSub(
unsigned Sub);
204 void addRefToMap(RegisterRef RR, ReferenceMap &Map,
unsigned Exec);
205 bool isRefInMap(RegisterRef, ReferenceMap &Map,
unsigned Exec);
210 void recalculateLiveInterval(
Register Reg);
212 void updateLiveness(
const std::set<Register> &RegSet,
bool Recalc,
213 bool UpdateKills,
bool UpdateDeads);
214 void distributeLiveIntervals(
const std::set<Register> &Regs);
220 bool ReadUndef,
bool ImpUse);
231 std::set<Register> &UpdRegs);
232 void renameInRange(RegisterRef RO, RegisterRef RN,
unsigned PredR,
238 bool isIntReg(RegisterRef RR,
unsigned &BW);
240 bool coalesceRegisters(RegisterRef R1, RegisterRef
R2);
242 std::set<Register> &UpdRegs);
247char HexagonExpandCondsets::ID = 0;
256 "Hexagon Expand Condsets",
false,
false)
263unsigned HexagonExpandCondsets::getMaskForSub(
unsigned Sub) {
265 case Hexagon::isub_lo:
266 case Hexagon::vsub_lo:
268 case Hexagon::isub_hi:
269 case Hexagon::vsub_hi:
271 case Hexagon::NoSubRegister:
278 unsigned Opc =
MI.getOpcode();
280 case Hexagon::C2_mux:
281 case Hexagon::C2_muxii:
282 case Hexagon::C2_muxir:
283 case Hexagon::C2_muxri:
284 case Hexagon::PS_pselect:
293 return Sub != 0 ?
TRI->getSubRegIndexLaneMask(Sub)
294 :
MRI->getMaxLaneMaskForVReg(Reg);
297void HexagonExpandCondsets::addRefToMap(RegisterRef RR, ReferenceMap &Map,
299 unsigned Mask = getMaskForSub(RR.Sub) |
Exec;
303bool HexagonExpandCondsets::isRefInMap(RegisterRef RR, ReferenceMap &Map,
305 ReferenceMap::iterator
F =
Map.find(RR.Reg);
308 unsigned Mask = getMaskForSub(RR.Sub) |
Exec;
309 if (Mask &
F->second)
314void HexagonExpandCondsets::updateKillFlags(
Register Reg) {
318 for (
unsigned i = 0, e =
MI->getNumOperands(); i !=
e; ++i) {
320 if (!
Op.isReg() || !
Op.isUse() ||
Op.getReg() !=
Reg ||
321 MI->isRegTiedToDefOperand(i))
324 if ((SLM & LM) == SLM) {
334 for (
auto I = LI.
begin(), E = LI.
end();
I != E; ++
I) {
335 if (!
I->end.isRegister())
339 auto NextI = std::next(
I);
340 if (NextI != E && NextI->start.isRegister()) {
341 MachineInstr *DefI = LIS->getInstructionFromIndex(NextI->start);
342 if (HII->isPredicated(*DefI))
345 bool WholeReg =
true;
349 return F != S.end() &&
I->end ==
F->end;
355 KillAt(
I->end, S.LaneMask);
361 KillAt(
I->end,
MRI->getMaxLaneMaskForVReg(Reg));
373 if (!
Op.isReg() || !
Op.isDef())
374 return {
false,
false };
377 return {
false,
false };
380 return {
A.any(),
A == SLM };
393 if (
D != Dest && MDT->dominates(
D, Dest))
398 for (
unsigned i = 0; i < Work.size(); ++i) {
404 for (
auto *
P :
B->predecessors())
415 for (
auto &Seg :
Range) {
416 if (!Seg.start.isRegister())
418 MachineInstr *DefI = LIS->getInstructionFromIndex(Seg.start);
420 if (HII->isPredicated(*DefI))
428 for (
auto &SI : PredDefs) {
430 auto P =
Range.extendInBlock(Undefs, LIS->getMBBStartIdx(BB), SI);
431 if (
P.first !=
nullptr ||
P.second)
438 for (
auto &SI : PredDefs) {
454 if (Dominate(Defs, BB))
459 LIS->extendToIndices(
Range, ExtTo, Undefs);
468 std::set<RegisterRef> DefRegs;
469 for (
auto &Seg :
Range) {
470 if (!Seg.start.isRegister())
472 MachineInstr *DefI = LIS->getInstructionFromIndex(Seg.start);
474 auto P = IsRegDef(
Op);
475 if (
P.second && Seg.end.isDead()) {
477 }
else if (
P.first) {
486 for (
auto &Seg :
Range) {
487 if (!Seg.start.isRegister() || !
Range.liveAt(Seg.start.getPrevSlot()))
489 MachineInstr *DefI = LIS->getInstructionFromIndex(Seg.start);
490 if (!HII->isPredicated(*DefI))
495 std::map<RegisterRef,unsigned> ImpUses;
498 if (!
Op.isReg() || !DefRegs.count(
Op))
504 ImpUses.insert({
Op, i});
518 for (
auto [R, DefIdx] : ImpUses) {
525void HexagonExpandCondsets::updateDeadFlags(
Register Reg) {
529 updateDeadsInRange(Reg, S.LaneMask, S);
530 LIS->shrinkToUses(S, Reg);
533 LIS->constructMainRangeFromSubranges(LI);
535 updateDeadsInRange(Reg,
MRI->getMaxLaneMaskForVReg(Reg), LI);
539void HexagonExpandCondsets::recalculateLiveInterval(
Register Reg) {
540 LIS->removeInterval(Reg);
541 LIS->createAndComputeVirtRegInterval(Reg);
545 LIS->RemoveMachineInstrFromMaps(
MI);
546 MI.eraseFromParent();
549void HexagonExpandCondsets::updateLiveness(
const std::set<Register> &RegSet,
550 bool Recalc,
bool UpdateKills,
552 UpdateKills |= UpdateDeads;
554 if (!
R.isVirtual()) {
562 recalculateLiveInterval(R);
564 MRI->clearKillFlags(R);
571 assert(LIS->getInterval(R).verify());
575void HexagonExpandCondsets::distributeLiveIntervals(
576 const std::set<Register> &Regs) {
582 unsigned NumComp = EQC.Classify(LI);
588 for (
unsigned I = 1;
I < NumComp; ++
I) {
590 NewLIs.
push_back(&LIS->createEmptyInterval(NewR));
592 EQC.Distribute(LI, NewLIs.
begin(), *
MRI);
598unsigned HexagonExpandCondsets::getCondTfrOpcode(
const MachineOperand &SO,
603 if (RS.Reg.isVirtual()) {
605 assert(
VC->begin() !=
VC->end() &&
"Empty register class");
606 PhysR = *
VC->begin();
610 MCRegister PhysS = (RS.Sub == 0) ? PhysR :
TRI->getSubReg(PhysR, RS.Sub);
612 switch (
TRI->getRegSizeInBits(*RC)) {
614 return IfTrue ? Hexagon::A2_tfrt : Hexagon::A2_tfrf;
616 return IfTrue ? Hexagon::A2_tfrpt : Hexagon::A2_tfrpf;
629 return IfTrue ? Hexagon::C2_cmoveit : Hexagon::C2_cmoveif;
643 bool PredSense,
bool ReadUndef,
bool ImpUse) {
654 unsigned Opc = getCondTfrOpcode(
SrcOp, PredSense);
656 unsigned PredState =
getRegState(PredOp) & ~RegState::Kill;
661 if (RegisterRef(
SrcOp) == RegisterRef(DstR, DstSR))
662 SrcState &= ~RegState::Kill;
664 .
addReg(DstR, DstState, DstSR)
669 .
addReg(DstR, DstState, DstSR)
681 std::set<Register> &UpdRegs) {
682 if (TfrLimitActive) {
683 if (TfrCounter >= TfrLimit)
697 for (
auto &
Op :
MI.operands()) {
699 UpdRegs.insert(
Op.getReg());
708 if (
ST.isReg() && SF.
isReg()) {
710 if (RT == RegisterRef(SF)) {
713 MI.setDesc(HII->get(TargetOpcode::COPY));
715 while (
MI.getNumOperands() > 1)
716 MI.removeOperand(
MI.getNumOperands()-1);
727 genCondTfrFor(ST, At, DR, DSR, MP,
true, ReadUndef,
false);
729 genCondTfrFor(SF, At, DR, DSR, MP,
false, ReadUndef,
true);
730 LIS->InsertMachineInstrInMaps(*TfrT);
731 LIS->InsertMachineInstrInMaps(*TfrF);
741 if (HII->isPredicated(*
MI) || !HII->isPredicable(*
MI))
743 if (
MI->hasUnmodeledSideEffects() ||
MI->mayStore())
747 for (
auto &
Op :
MI->operands()) {
748 if (!
Op.isReg() || !
Op.isDef())
754 for (
auto &Mo :
MI->memoperands()) {
755 if (Mo->isVolatile() || Mo->isAtomic())
764MachineInstr *HexagonExpandCondsets::getReachingDefForPred(RegisterRef RD,
771 bool PredValid =
true;
777 if (PredValid && HII->isPredicated(*
MI)) {
778 if (
MI->readsRegister(PredR,
nullptr) &&
779 (
Cond != HII->isPredicatedTrue(*
MI)))
785 for (
auto &
Op :
MI->operands()) {
786 if (!
Op.isReg() || !
Op.isDef())
789 if (RR.Reg == PredR) {
793 if (RR.Reg != RD.Reg)
798 if (RR.Sub == RD.Sub)
800 if (RR.Sub == 0 || RD.Sub == 0)
814bool HexagonExpandCondsets::canMoveOver(
MachineInstr &
MI, ReferenceMap &Defs,
815 ReferenceMap &
Uses) {
819 for (
auto &
Op :
MI.operands()) {
826 if (!RR.Reg.isVirtual())
829 if (isRefInMap(RR, Defs, Exec_Then))
832 if (
Op.isDef() && isRefInMap(RR,
Uses, Exec_Then))
843 if (!IsLoad && !IsStore)
845 if (HII->areMemAccessesTriviallyDisjoint(TheI, ToI))
856 if (
MI.hasUnmodeledSideEffects())
858 bool L =
MI.mayLoad(), S =
MI.mayStore();
861 if (Ordered &&
MI.hasOrderedMemoryRef())
864 bool Conflict = (
L && IsStore) || S;
873void HexagonExpandCondsets::predicateAt(
const MachineOperand &DefOp,
877 std::set<Register> &UpdRegs) {
891 unsigned Opc =
MI.getOpcode();
892 unsigned PredOpc = HII->getCondOpcode(Opc, !
Cond);
894 unsigned Ox = 0, NP =
MI.getNumOperands();
917 LIS->InsertMachineInstrInMaps(*NewI);
921 UpdRegs.insert(
Op.getReg());
928void HexagonExpandCondsets::renameInRange(RegisterRef RO, RegisterRef RN,
935 if (!HII->isPredicated(
MI))
937 if (!
MI.readsRegister(PredR,
nullptr) ||
938 (
Cond != HII->isPredicatedTrue(
MI)))
941 for (
auto &
Op :
MI.operands()) {
942 if (!
Op.isReg() || RO != RegisterRef(
Op))
945 Op.setSubReg(
RN.Sub);
947 assert(!
Op.isDef() &&
"Not expecting a def");
956 std::set<Register> &UpdRegs) {
960 assert(Opc == Hexagon::A2_tfrt || Opc == Hexagon::A2_tfrf);
980 if (!DefI || !isPredicable(DefI))
988 ReferenceMap
Uses, Defs;
994 bool PredValid =
true;
996 if (!
MI.modifiesRegister(PredR,
nullptr))
1007 unsigned Exec = Exec_Then | Exec_Else;
1008 if (PredValid && HII->isPredicated(
MI) &&
1009 MI.readsRegister(PredR,
nullptr))
1010 Exec = (
Cond == HII->isPredicatedTrue(
MI)) ? Exec_Then : Exec_Else;
1012 for (
auto &
Op :
MI.operands()) {
1022 RegisterRef RR =
Op;
1023 if (!RR.Reg.isVirtual())
1026 ReferenceMap &
Map =
Op.isDef() ? Defs :
Uses;
1027 if (
Op.isDef() &&
Op.isUndef()) {
1028 assert(RR.Sub &&
"Expecting a subregister on <def,read-undef>");
1034 addRefToMap(RR, Map, Exec);
1051 if (isRefInMap(RT, Defs, Exec_Then) || isRefInMap(RT,
Uses, Exec_Else))
1053 RegisterRef RD = MD;
1060 bool CanUp = canMoveOver(TfrI, Defs,
Uses);
1061 bool CanDown = canMoveOver(*DefI, Defs,
Uses);
1065 if (!canMoveMemTo(*DefI, TfrI,
true))
1070 <<
", can move down: " << (CanDown ?
"yes\n" :
"no\n"));
1073 predicateAt(MD, *DefI, PastDefIt, MP,
Cond, UpdRegs);
1075 predicateAt(MD, *DefI, TfrIt, MP,
Cond, UpdRegs);
1080 renameInRange(RT, RD, PredR,
Cond, PastDefIt, TfrIt);
1081 UpdRegs.insert(RT.Reg);
1091 std::set<Register> &UpdRegs) {
1092 bool Changed =
false;
1094 unsigned Opc =
MI.getOpcode();
1095 if (Opc == Hexagon::A2_tfrt || Opc == Hexagon::A2_tfrf) {
1096 bool Done = predicate(
MI, (Opc == Hexagon::A2_tfrt), UpdRegs);
1100 if (RegisterRef(
MI.getOperand(0)) == RegisterRef(
MI.getOperand(2))) {
1101 for (
auto &
Op :
MI.operands()) {
1103 UpdRegs.insert(
Op.getReg());
1114bool HexagonExpandCondsets::isIntReg(RegisterRef RR,
unsigned &BW) {
1115 if (!RR.Reg.isVirtual())
1118 if (RC == &Hexagon::IntRegsRegClass) {
1122 if (RC == &Hexagon::DoubleRegsRegClass) {
1123 BW = (RR.Sub != 0) ? 32 : 64;
1129bool HexagonExpandCondsets::isIntraBlocks(
LiveInterval &LI) {
1132 if (!LR.start.isRegister())
1135 if (!LR.end.isRegister() && !LR.end.isDead())
1141bool HexagonExpandCondsets::coalesceRegisters(RegisterRef R1, RegisterRef
R2) {
1142 if (CoaLimitActive) {
1143 if (CoaCounter >= CoaLimit)
1150 if (
MRI->isLiveIn(R1.Reg))
1152 if (
MRI->isLiveIn(
R2.Reg))
1164 << (Overlap ?
"overlap" :
"disjoint") <<
")\n "
1165 <<
printReg(R1.Reg,
TRI, R1.Sub) <<
" " << L1 <<
"\n "
1167 if (R1.Sub ||
R2.Sub)
1175 if (!isIntraBlocks(L1) && !isIntraBlocks(L2))
1178 MRI->replaceRegWith(
R2.Reg, R1.Reg);
1184 VNInfo *NewVN, *OldVN =
I.valno;
1185 ValueInfoMap::iterator
F = VM.find(OldVN);
1186 if (
F == VM.end()) {
1187 NewVN = L1.
getNextValue(
I.valno->def, LIS->getVNInfoAllocator());
1188 VM.insert(std::make_pair(OldVN, NewVN));
1195 L2.removeSegment(*L2.begin());
1196 LIS->removeInterval(
R2.Reg);
1198 updateKillFlags(R1.Reg);
1208bool HexagonExpandCondsets::coalesceSegments(
1210 std::set<Register> &UpdRegs) {
1214 if (!
S1.isReg() && !S2.isReg())
1219 bool Changed =
false;
1221 RegisterRef RD = CI->getOperand(0);
1222 RegisterRef
RP = CI->getOperand(1);
1244 RegisterRef RS =
S1;
1245 MachineInstr *RDef = getReachingDefForPred(RS, CI,
RP.Reg,
true);
1246 if (!RDef || !HII->isPredicable(*RDef)) {
1247 Done = coalesceRegisters(RD, RegisterRef(
S1));
1249 UpdRegs.insert(RD.Reg);
1250 UpdRegs.insert(
S1.getReg());
1254 if (!
Done && S2.isReg()) {
1255 RegisterRef RS = S2;
1256 MachineInstr *RDef = getReachingDefForPred(RS, CI,
RP.Reg,
false);
1257 if (!RDef || !HII->isPredicable(*RDef)) {
1258 Done = coalesceRegisters(RD, RegisterRef(S2));
1260 UpdRegs.insert(RD.Reg);
1261 UpdRegs.insert(S2.getReg());
1270bool HexagonExpandCondsets::runOnMachineFunction(
MachineFunction &MF) {
1276 MDT = &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
1277 LIS = &getAnalysis<LiveIntervalsWrapperPass>().getLIS();
1282 bool Changed =
false;
1283 std::set<Register> CoalUpd, PredUpd;
1286 for (
auto &
B : MF) {
1295 Changed |= coalesceSegments(
Condsets, CoalUpd);
1302 std::set<Register> KillUpd;
1305 if (
Op.isReg() &&
Op.isUse()) {
1306 if (!CoalUpd.count(
Op.getReg()))
1307 KillUpd.insert(
Op.getReg());
1319 Changed |= split(*
MI, PredUpd);
1335 Changed |= predicateInBlock(
B, PredUpd);
1338 PredUpd.insert(CoalUpd.begin(), CoalUpd.end());
1342 distributeLiveIntervals(PredUpd);
1346 LIS->print(
dbgs() <<
"After expand-condsets\n");
1356 return new HexagonExpandCondsets();
unsigned const MachineRegisterInfo * MRI
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This file defines the DenseMap class.
static Expected< BitVector > expand(StringRef S, StringRef Original)
static cl::opt< unsigned > OptCoaLimit("expand-condsets-coa-limit", cl::init(~0U), cl::Hidden, cl::desc("Max number of segment coalescings"))
static cl::opt< unsigned > OptTfrLimit("expand-condsets-tfr-limit", cl::init(~0U), cl::Hidden, cl::desc("Max number of mux expansions"))
expand Hexagon Expand Condsets
A common definition of LaneBitmask for use in TableGen and CodeGen.
unsigned const TargetRegisterInfo * TRI
static unsigned getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo)
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
static void updateLiveness(MachineFunction &MF)
Helper function to update the liveness information for the callee-saved registers.
const SmallVectorImpl< MachineOperand > & Cond
Remove Loads Into Fake Uses
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallVector class.
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.
ConnectedVNInfoEqClasses - Helper class that can divide VNInfos in a LiveInterval into equivalence cl...
This class represents an Operation in the Expression.
FunctionPass class - This class is used to implement most global optimizations.
A live range for subregisters.
LiveInterval - This class represents the liveness of a register, or stack slot.
bool hasSubRanges() const
Returns true if subregister liveness information is available.
iterator_range< subrange_iterator > subranges()
bool verify(const MachineRegisterInfo *MRI=nullptr) const
Walks the interval and assert if any invariants fail to hold.
void computeSubRangeUndefs(SmallVectorImpl< SlotIndex > &Undefs, LaneBitmask LaneMask, const MachineRegisterInfo &MRI, const SlotIndexes &Indexes) const
For a given lane mask LaneMask, compute indexes at which the lane is marked undefined by subregister ...
This class represents the liveness of a register, stack slot, etc.
iterator addSegment(Segment S)
Add the specified Segment to this range, merging segments as appropriate.
bool overlaps(const LiveRange &other) const
overlaps - Return true if the intersection of the two live ranges is not empty.
VNInfo * getNextValue(SlotIndex Def, VNInfo::Allocator &VNInfoAllocator)
getNextValue - Create a new value number and return it.
Wrapper class representing physical registers. Should be passed by value.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
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.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
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 & cloneMemRefs(const MachineInstr &OtherMI) const
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
bool mayLoadOrStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read or modify memory.
const MachineBasicBlock * getParent() const
unsigned getNumOperands() const
Retuns the total number of operands.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore,...
iterator_range< mop_iterator > operands()
void tieOperands(unsigned DefIdx, unsigned UseIdx)
Add a tie between the register operands at DefIdx and UseIdx.
bool hasOrderedMemoryRef() const
Return true if this instruction may have an ordered or volatile memory reference, or if the informati...
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
const MachineOperand & getOperand(unsigned i) const
void clearKillInfo()
Clears kill flags on all operands.
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Register getReg() const
getReg - Returns the register number.
@ MO_Immediate
Immediate operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_GlobalAddress
Address of a global value.
@ MO_BlockAddress
Address of a basic block.
@ MO_ExternalSymbol
Name of external global symbol.
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
@ MO_TargetIndex
Target-dependent index+offset operand.
@ MO_FPImmediate
Floating-point immediate operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
A vector that has set insertion semantics.
bool insert(const value_type &X)
Insert a new element into the SetVector.
SlotIndex - An opaque wrapper around machine indexes.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
virtual const TargetInstrInfo * getInstrInfo() const
VNInfo - Value Number Information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
bool isIntReg(MCRegister Reg)
@ Implicit
Not emitted register (e.g. carry, or temporary result).
@ Define
Register definition.
@ Undef
Value of the register doesn't matter.
Reg
All possible values of the reg field in the ModR/M byte.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
bool operator<(int64_t V1, const APSInt &V2)
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
bool operator!=(uint64_t V1, const APInt &V2)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
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...
FunctionPass * createHexagonExpandCondsets()
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
void initializeHexagonExpandCondsetsPass(PassRegistry &)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
unsigned getRegState(const MachineOperand &RegOp)
Get all register state flags from machine operand RegOp.
char & HexagonExpandCondsetsID
DWARFExpression::Operation Op
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.
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
This represents a simple continuous liveness interval for a value.