121 #define DEBUG_TYPE "expand-condsets" 123 using namespace llvm;
151 StringRef getPassName()
const override {
return "Hexagon Expand Condsets"; }
170 bool CoaLimitActive =
false;
171 bool TfrLimitActive =
false;
174 unsigned CoaCounter = 0;
175 unsigned TfrCounter = 0;
179 Sub(Op.getSubReg()) {}
180 RegisterRef(
unsigned R = 0,
unsigned S = 0) :
Reg(R), Sub(S) {}
183 return Reg == RR.Reg && Sub == RR.Sub;
187 return Reg < RR.Reg || (
Reg == RR.Reg && Sub < RR.Sub);
194 enum { Sub_Low = 0x1, Sub_High = 0x2, Sub_None = (Sub_Low | Sub_High) };
195 enum { Exec_Then = 0x10, Exec_Else = 0x20 };
197 unsigned getMaskForSub(
unsigned Sub);
201 void addRefToMap(RegisterRef RR, ReferenceMap &Map,
unsigned Exec);
202 bool isRefInMap(RegisterRef, ReferenceMap &Map,
unsigned Exec);
205 void updateKillFlags(
unsigned Reg);
206 void updateDeadFlags(
unsigned Reg);
207 void recalculateLiveInterval(
unsigned Reg);
210 bool UpdateKills,
bool UpdateDeads);
216 bool ReadUndef,
bool ImpUse);
222 bool canMoveOver(
MachineInstr &
MI, ReferenceMap &Defs, ReferenceMap &Uses);
227 std::set<unsigned> &UpdRegs);
228 void renameInRange(RegisterRef RO, RegisterRef
RN,
unsigned PredR,
231 bool predicate(
MachineInstr &TfrI,
bool Cond, std::set<unsigned> &UpdRegs);
233 std::set<unsigned> &UpdRegs);
235 bool isIntReg(RegisterRef RR,
unsigned &BW);
237 bool coalesceRegisters(RegisterRef R1, RegisterRef
R2);
239 std::set<unsigned> &UpdRegs);
253 "Hexagon Expand Condsets",
false,
false)
260 unsigned HexagonExpandCondsets::getMaskForSub(
unsigned Sub) {
262 case Hexagon::isub_lo:
263 case Hexagon::vsub_lo:
265 case Hexagon::isub_hi:
266 case Hexagon::vsub_hi:
268 case Hexagon::NoSubRegister:
277 case Hexagon::C2_mux:
278 case Hexagon::C2_muxii:
279 case Hexagon::C2_muxir:
280 case Hexagon::C2_muxri:
281 case Hexagon::PS_pselect:
288 LaneBitmask HexagonExpandCondsets::getLaneMask(
unsigned Reg,
unsigned Sub) {
290 return Sub != 0 ?
TRI->getSubRegIndexLaneMask(Sub)
291 :
MRI->getMaxLaneMaskForVReg(Reg);
294 void HexagonExpandCondsets::addRefToMap(RegisterRef RR, ReferenceMap &Map,
296 unsigned Mask = getMaskForSub(RR.Sub) | Exec;
297 ReferenceMap::iterator
F = Map.find(RR.Reg);
299 Map.insert(std::make_pair(RR.Reg, Mask));
304 bool HexagonExpandCondsets::isRefInMap(RegisterRef RR, ReferenceMap &Map,
306 ReferenceMap::iterator
F = Map.find(RR.Reg);
309 unsigned Mask = getMaskForSub(RR.Sub) | Exec;
310 if (Mask & F->second)
315 void HexagonExpandCondsets::updateKillFlags(
unsigned Reg) {
325 if ((SLM & LM) == SLM) {
336 if (!
I->end.isRegister())
340 auto NextI = std::next(
I);
341 if (NextI !=
E && NextI->start.isRegister()) {
342 MachineInstr *DefI = LIS->getInstructionFromIndex(NextI->start);
343 if (HII->isPredicated(*DefI))
346 bool WholeReg =
true;
350 return F != S.end() &&
I->end == F->end;
356 KillAt(
I->end, S.LaneMask);
362 KillAt(
I->end,
MRI->getMaxLaneMaskForVReg(Reg));
366 void HexagonExpandCondsets::updateDeadsInRange(
unsigned Reg,
LaneBitmask LM,
374 if (!
Op.isReg() || !
Op.isDef())
375 return {
false,
false };
376 unsigned DR =
Op.getReg(), DSR =
Op.getSubReg();
378 return {
false,
false };
381 return { A.
any(), A == SLM };
394 if (
D != Dest && MDT->dominates(
D, Dest))
399 for (
unsigned i = 0; i < Work.size(); ++i) {
416 for (
auto &Seg : Range) {
417 if (!Seg.start.isRegister())
419 MachineInstr *DefI = LIS->getInstructionFromIndex(Seg.start);
421 if (HII->isPredicated(*DefI))
429 for (
auto &
SI : PredDefs) {
431 auto P = Range.extendInBlock(Undefs, LIS->getMBBStartIdx(BB),
SI);
432 if (
P.first !=
nullptr ||
P.second)
439 for (
auto &
SI : PredDefs) {
455 if (Dominate(Defs, BB))
460 LIS->extendToIndices(Range, ExtTo, Undefs);
469 std::set<RegisterRef> DefRegs;
470 for (
auto &Seg : Range) {
471 if (!Seg.start.isRegister())
473 MachineInstr *DefI = LIS->getInstructionFromIndex(Seg.start);
475 auto P = IsRegDef(
Op);
476 if (
P.second && Seg.end.isDead()) {
478 }
else if (
P.first) {
487 for (
auto &Seg : Range) {
488 if (!Seg.start.isRegister() || !Range.liveAt(Seg.start.getPrevSlot()))
490 MachineInstr *DefI = LIS->getInstructionFromIndex(Seg.start);
491 if (!HII->isPredicated(*DefI))
496 std::map<RegisterRef,unsigned> ImpUses;
499 if (!Op.
isReg() || !DefRegs.count(Op))
505 ImpUses.insert({Op, i});
519 for (std::pair<RegisterRef, unsigned>
P : ImpUses) {
520 RegisterRef R =
P.first;
527 void HexagonExpandCondsets::updateDeadFlags(
unsigned Reg) {
531 updateDeadsInRange(Reg, S.LaneMask, S);
532 LIS->shrinkToUses(S, Reg);
535 LIS->constructMainRangeFromSubranges(LI);
537 updateDeadsInRange(Reg,
MRI->getMaxLaneMaskForVReg(Reg), LI);
541 void HexagonExpandCondsets::recalculateLiveInterval(
unsigned Reg) {
542 LIS->removeInterval(Reg);
543 LIS->createAndComputeVirtRegInterval(Reg);
546 void HexagonExpandCondsets::removeInstr(
MachineInstr &MI) {
547 LIS->RemoveMachineInstrFromMaps(MI);
552 bool Recalc,
bool UpdateKills,
bool UpdateDeads) {
553 UpdateKills |= UpdateDeads;
554 for (
unsigned R : RegSet) {
563 recalculateLiveInterval(R);
565 MRI->clearKillFlags(R);
572 LIS->getInterval(R).verify();
578 unsigned HexagonExpandCondsets::getCondTfrOpcode(
const MachineOperand &SO,
580 using namespace Hexagon;
588 PhysR = *VC->
begin();
593 unsigned PhysS = (RS.Sub == 0) ? PhysR :
TRI->getSubReg(PhysR, RS.Sub);
595 switch (
TRI->getRegSizeInBits(*RC)) {
597 return IfTrue ? A2_tfrt : A2_tfrf;
599 return IfTrue ? A2_tfrpt : A2_tfrpf;
612 return IfTrue ? C2_cmoveit : C2_cmoveif;
626 bool PredSense,
bool ReadUndef,
bool ImpUse) {
637 unsigned Opc = getCondTfrOpcode(SrcOp, PredSense);
644 if (RegisterRef(SrcOp) == RegisterRef(DstR, DstSR))
645 SrcState &= ~RegState
::Kill;
647 .addReg(DstR, DstState, DstSR)
652 .addReg(DstR, DstState, DstSR)
664 std::set<unsigned> &UpdRegs) {
665 if (TfrLimitActive) {
666 if (TfrCounter >= TfrLimit)
682 UpdRegs.insert(
Op.getReg());
692 if (RT == RegisterRef(SF)) {
695 MI.
setDesc(HII->get(TargetOpcode::COPY));
709 genCondTfrFor(ST, At, DR, DSR, MP,
true, ReadUndef,
false);
711 genCondTfrFor(SF, At, DR, DSR, MP,
false, ReadUndef,
true);
712 LIS->InsertMachineInstrInMaps(*TfrT);
713 LIS->InsertMachineInstrInMaps(*TfrF);
722 bool HexagonExpandCondsets::isPredicable(
MachineInstr *MI) {
723 if (HII->isPredicated(*MI) || !HII->isPredicable(*MI))
730 if (!
Op.isReg() || !
Op.isDef())
737 if (Mo->isVolatile())
745 MachineInstr *HexagonExpandCondsets::getReachingDefForPred(RegisterRef RD,
752 bool PredValid =
true;
758 if (PredValid && HII->isPredicated(*MI)) {
759 if (MI->
readsRegister(PredR) && (Cond != HII->isPredicatedTrue(*MI)))
766 if (!
Op.isReg() || !
Op.isDef())
769 if (RR.Reg == PredR) {
773 if (RR.Reg != RD.Reg)
778 if (RR.Sub == RD.Sub)
780 if (RR.Sub == 0 || RD.Sub == 0)
794 bool HexagonExpandCondsets::canMoveOver(
MachineInstr &MI, ReferenceMap &Defs,
795 ReferenceMap &Uses) {
809 if (isRefInMap(RR, Defs, Exec_Then))
812 if (
Op.isDef() && isRefInMap(RR, Uses, Exec_Then))
823 if (!IsLoad && !IsStore)
825 if (HII->areMemAccessesTriviallyDisjoint(TheI, ToI))
845 bool Conflict = (L && IsStore) || S;
854 void HexagonExpandCondsets::predicateAt(
const MachineOperand &DefOp,
858 std::set<unsigned> &UpdRegs) {
873 unsigned PredOpc = HII->getCondOpcode(Opc, !Cond);
899 for (
unsigned i = 0; i < NR; ++i)
905 LIS->InsertMachineInstrInMaps(*NewI);
909 UpdRegs.insert(
Op.getReg());
915 void HexagonExpandCondsets::renameInRange(RegisterRef RO, RegisterRef
RN,
923 if (!HII->isPredicated(*MI))
925 if (!MI->
readsRegister(PredR) || (Cond != HII->isPredicatedTrue(*MI)))
929 if (!
Op.isReg() || RO != RegisterRef(
Op))
932 Op.setSubReg(RN.Sub);
934 assert(!
Op.isDef() &&
"Not expecting a def");
942 bool HexagonExpandCondsets::predicate(
MachineInstr &TfrI,
bool Cond,
943 std::set<unsigned> &UpdRegs) {
947 assert(Opc == Hexagon::A2_tfrt || Opc == Hexagon::A2_tfrf);
948 LLVM_DEBUG(
dbgs() <<
"\nattempt to predicate if-" << (Cond ?
"true" :
"false")
965 unsigned PredR = MP.
getReg();
966 MachineInstr *DefI = getReachingDefForPred(RT, TfrI, PredR, Cond);
967 if (!DefI || !isPredicable(DefI))
975 ReferenceMap Uses, Defs;
981 bool PredValid =
true;
983 if (!
I->modifiesRegister(PredR,
nullptr))
995 unsigned Exec = Exec_Then | Exec_Else;
996 if (PredValid && HII->isPredicated(*MI) && MI->
readsRegister(PredR))
997 Exec = (Cond == HII->isPredicatedTrue(*MI)) ? Exec_Then : Exec_Else;
1009 RegisterRef RR =
Op;
1013 ReferenceMap &Map =
Op.isDef() ? Defs : Uses;
1014 if (
Op.isDef() &&
Op.isUndef()) {
1015 assert(RR.Sub &&
"Expecting a subregister on <def,read-undef>");
1021 addRefToMap(RR, Map, Exec);
1038 if (isRefInMap(RT, Defs, Exec_Then) || isRefInMap(RT, Uses, Exec_Else))
1040 RegisterRef RD = MD;
1047 bool CanUp = canMoveOver(TfrI, Defs, Uses);
1048 bool CanDown = canMoveOver(*DefI, Defs, Uses);
1052 if (!canMoveMemTo(*DefI, TfrI,
true))
1056 <<
", can move down: " << (CanDown ?
"yes\n" :
"no\n"));
1059 predicateAt(MD, *DefI, PastDefIt, MP, Cond, UpdRegs);
1061 predicateAt(MD, *DefI, TfrIt, MP, Cond, UpdRegs);
1066 renameInRange(RT, RD, PredR, Cond, PastDefIt, TfrIt);
1067 UpdRegs.insert(RT.Reg);
1077 std::set<unsigned> &UpdRegs) {
1078 bool Changed =
false;
1080 for (I = B.
begin(), E = B.
end(); I !=
E; I = NextI) {
1081 NextI = std::next(I);
1082 unsigned Opc = I->getOpcode();
1083 if (Opc == Hexagon::A2_tfrt || Opc == Hexagon::A2_tfrf) {
1084 bool Done = predicate(*I, (Opc == Hexagon::A2_tfrt), UpdRegs);
1088 if (RegisterRef(I->getOperand(0)) == RegisterRef(I->getOperand(2))) {
1089 for (
auto &
Op : I->operands())
1091 UpdRegs.insert(
Op.getReg());
1105 if (RC == &Hexagon::IntRegsRegClass) {
1109 if (RC == &Hexagon::DoubleRegsRegClass) {
1110 BW = (RR.Sub != 0) ? 32 : 64;
1116 bool HexagonExpandCondsets::isIntraBlocks(
LiveInterval &LI) {
1129 bool HexagonExpandCondsets::coalesceRegisters(RegisterRef R1, RegisterRef
R2) {
1130 if (CoaLimitActive) {
1131 if (CoaCounter >= CoaLimit)
1138 if (
MRI->isLiveIn(R1.Reg))
1140 if (
MRI->isLiveIn(R2.Reg))
1152 << (Overlap ?
"overlap" :
"disjoint") <<
")\n " 1153 <<
printReg(R1.Reg,
TRI, R1.Sub) <<
" " << L1 <<
"\n " 1154 <<
printReg(R2.Reg,
TRI, R2.Sub) <<
" " << L2 <<
"\n");
1155 if (R1.Sub || R2.Sub)
1163 if (!isIntraBlocks(L1) && !isIntraBlocks(L2))
1166 MRI->replaceRegWith(R2.Reg, R1.Reg);
1172 VNInfo *NewVN, *OldVN =
I->valno;
1173 ValueInfoMap::iterator
F = VM.find(OldVN);
1174 if (F == VM.end()) {
1175 NewVN = L1.
getNextValue(
I->valno->def, LIS->getVNInfoAllocator());
1176 VM.insert(std::make_pair(OldVN, NewVN));
1184 LIS->removeInterval(R2.Reg);
1186 updateKillFlags(R1.Reg);
1196 bool HexagonExpandCondsets::coalesceSegments(
1198 std::set<unsigned> &UpdRegs) {
1202 if (!S1.
isReg() && !S2.isReg())
1207 bool Changed =
false;
1209 RegisterRef RD = CI->getOperand(0);
1210 RegisterRef
RP = CI->getOperand(1);
1232 RegisterRef RS = S1;
1233 MachineInstr *RDef = getReachingDefForPred(RS, CI, RP.Reg,
true);
1235 Done = coalesceRegisters(RD, RegisterRef(S1));
1237 UpdRegs.insert(RD.Reg);
1238 UpdRegs.insert(S1.
getReg());
1242 if (!Done && S2.isReg()) {
1243 RegisterRef RS = S2;
1244 MachineInstr *RDef = getReachingDefForPred(RS, CI, RP.Reg,
false);
1246 Done = coalesceRegisters(RD, RegisterRef(S2));
1248 UpdRegs.insert(RD.Reg);
1249 UpdRegs.insert(S2.getReg());
1258 bool HexagonExpandCondsets::runOnMachineFunction(
MachineFunction &MF) {
1264 MDT = &getAnalysis<MachineDominatorTree>();
1265 LIS = &getAnalysis<LiveIntervals>();
1271 bool Changed =
false;
1272 std::set<unsigned> CoalUpd, PredUpd;
1282 Changed |= coalesceSegments(Condsets, CoalUpd);
1289 std::set<unsigned> KillUpd;
1292 if (
Op.isReg() &&
Op.isUse())
1293 if (!CoalUpd.count(
Op.getReg()))
1294 KillUpd.insert(
Op.getReg());
1297 LIS->print(
dbgs() <<
"After coalescing\n", MF.getFunction().getParent()));
1304 Changed |=
split(*MI, PredUpd);
1314 LIS->print(
dbgs() <<
"After splitting\n", MF.getFunction().getParent()));
1321 Changed |= predicateInBlock(B, PredUpd);
1323 MF.getFunction().getParent()));
1325 PredUpd.insert(CoalUpd.begin(), CoalUpd.end());
1330 LIS->print(
dbgs() <<
"After expand-condsets\n",
1331 MF.getFunction().getParent());
1341 return new HexagonExpandCondsets();
void push_back(const T &Elt)
bool isRegister() const
isRegister - Returns true if this is a normal register use/def slot.
const MachineInstrBuilder & add(const MachineOperand &MO) const
A common definition of LaneBitmask for use in TableGen and CodeGen.
char & HexagonExpandCondsetsID
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
unsigned getRegState(const MachineOperand &RegOp)
Get all register state flags from machine operand RegOp.
Compute iterated dominance frontiers using a linear time algorithm.
iterator begin() const
begin/end - Return all of the registers in this class.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
static void updateLiveness(MachineFunction &MF)
Helper function to update the liveness information for the callee-saved registers.
Segments::iterator iterator
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
LiveInterval - This class represents the liveness of a register, or stack slot.
unsigned getReg() const
getReg - Returns the register number.
FunctionPass * createHexagonExpandCondsets()
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
Address of indexed Jump Table for switch.
unsigned getSubReg() const
bool isPredicable(QueryType Type=AllInBundle) const
Return true if this instruction has a predicate operand that controls execution.
bool isDead() const
isDead - Returns true if this is a dead def kill slot.
A live range for subregisters.
This represents a simple continuous liveness interval for a value.
unsigned const TargetRegisterInfo * TRI
static std::pair< StringRef, StringRef > split(StringRef Str, char Separator)
Checked version of split, to ensure mandatory subparts.
iterator_range< mmo_iterator > memoperands()
VNInfo - Value Number Information.
iterator_range< mop_iterator > operands()
This class represents the liveness of a register, stack slot, etc.
void clearKillInfo()
Clears kill flags on all operands.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
A description of a memory reference used in the backend.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
expand Hexagon Expand Condsets
unsigned getNumOperands() const
Access to explicit operands of the instruction.
Printable printReg(unsigned Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
Target-dependent index+offset operand.
iterator_range< subrange_iterator > subranges()
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
Name of external global symbol.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
bool hasSubRanges() const
Returns true if subregister liveness information is available.
bool insert(const value_type &X)
Insert a new element into the SetVector.
iterator addSegment(Segment S)
Add the specified Segment to this range, merging segments as appropriate.
virtual const TargetInstrInfo * getInstrInfo() const
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
Address of a global value.
INITIALIZE_PASS_BEGIN(HexagonExpandCondsets, "expand-condsets", "Hexagon Expand Condsets", false, false) INITIALIZE_PASS_END(HexagonExpandCondsets
initializer< Ty > init(const Ty &Val)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned const MachineRegisterInfo * MRI
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void verify(const MachineRegisterInfo *MRI=nullptr) const
Walks the interval and assert if any invariants fail to hold.
Represent the analysis usage information of a pass.
Address of a basic block.
static cl::opt< unsigned > OptCoaLimit("expand-condsets-coa-limit", cl::init(~0U), cl::Hidden, cl::desc("Max number of segment coalescings"))
FunctionPass class - This class is used to implement most global optimizations.
bool isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx=nullptr) const
Return true if the use operand of the specified index is tied to a def operand.
iterator_range< pred_iterator > predecessors()
static Expected< BitVector > expand(StringRef S, StringRef Original)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
const MachineBasicBlock & front() const
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void setIsKill(bool Val=true)
void removeSegment(SlotIndex Start, SlotIndex End, bool RemoveDeadValNo=false)
Remove the specified segment from this range.
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
bool hasOrderedMemoryRef() const
Return true if this instruction may have an ordered or volatile memory reference, or if the informati...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
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 ...
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr reads the specified register.
static cl::opt< unsigned > OptTfrLimit("expand-condsets-tfr-limit", cl::init(~0U), cl::Hidden, cl::desc("Max number of mux expansions"))
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
bool operator!=(uint64_t V1, const APInt &V2)
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool overlaps(const LiveRange &other) const
overlaps - Return true if the intersection of the two live ranges is not empty.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
LLVM_NODISCARD bool empty() const
constexpr bool any() const
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
VNInfo * getNextValue(SlotIndex def, VNInfo::Allocator &VNInfoAllocator)
getNextValue - Create a new value number and return it.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool operator<(int64_t V1, const APSInt &V2)
Module * getParent()
Get the module that this global value is contained inside of...
Floating-point immediate operand.
A vector that has set insertion semantics.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore...
bool isIntReg(unsigned Reg)
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
void RemoveOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
Address of indexed Constant in Constant Pool.
bool operator==(uint64_t V1, const APInt &V2)
const MachineInstrBuilder & setMemRefs(MachineInstr::mmo_iterator b, MachineInstr::mmo_iterator e) const
const MachineOperand & getOperand(unsigned i) const
SlotIndex - An opaque wrapper around machine indexes.
void initializeHexagonExpandCondsetsPass(PassRegistry &)
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num)
allocateMemRefsArray - Allocate an array to hold MachineMemOperand pointers.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
mmo_iterator memoperands_end() const
void tieOperands(unsigned DefIdx, unsigned UseIdx)
Add a tie between the register operands at DefIdx and UseIdx.