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);
898 LIS->InsertMachineInstrInMaps(*NewI);
902 UpdRegs.insert(
Op.getReg());
908 void HexagonExpandCondsets::renameInRange(RegisterRef RO, RegisterRef
RN,
916 if (!HII->isPredicated(*MI))
918 if (!MI->
readsRegister(PredR) || (Cond != HII->isPredicatedTrue(*MI)))
922 if (!
Op.isReg() || RO != RegisterRef(
Op))
925 Op.setSubReg(RN.Sub);
927 assert(!
Op.isDef() &&
"Not expecting a def");
935 bool HexagonExpandCondsets::predicate(
MachineInstr &TfrI,
bool Cond,
936 std::set<unsigned> &UpdRegs) {
940 assert(Opc == Hexagon::A2_tfrt || Opc == Hexagon::A2_tfrf);
941 LLVM_DEBUG(
dbgs() <<
"\nattempt to predicate if-" << (Cond ?
"true" :
"false")
958 unsigned PredR = MP.
getReg();
959 MachineInstr *DefI = getReachingDefForPred(RT, TfrI, PredR, Cond);
960 if (!DefI || !isPredicable(DefI))
968 ReferenceMap Uses, Defs;
974 bool PredValid =
true;
976 if (!
I->modifiesRegister(PredR,
nullptr))
988 unsigned Exec = Exec_Then | Exec_Else;
989 if (PredValid && HII->isPredicated(*MI) && MI->
readsRegister(PredR))
990 Exec = (Cond == HII->isPredicatedTrue(*MI)) ? Exec_Then : Exec_Else;
1002 RegisterRef RR =
Op;
1006 ReferenceMap &Map =
Op.isDef() ? Defs : Uses;
1007 if (
Op.isDef() &&
Op.isUndef()) {
1008 assert(RR.Sub &&
"Expecting a subregister on <def,read-undef>");
1014 addRefToMap(RR, Map, Exec);
1031 if (isRefInMap(RT, Defs, Exec_Then) || isRefInMap(RT, Uses, Exec_Else))
1033 RegisterRef RD = MD;
1040 bool CanUp = canMoveOver(TfrI, Defs, Uses);
1041 bool CanDown = canMoveOver(*DefI, Defs, Uses);
1045 if (!canMoveMemTo(*DefI, TfrI,
true))
1049 <<
", can move down: " << (CanDown ?
"yes\n" :
"no\n"));
1052 predicateAt(MD, *DefI, PastDefIt, MP, Cond, UpdRegs);
1054 predicateAt(MD, *DefI, TfrIt, MP, Cond, UpdRegs);
1059 renameInRange(RT, RD, PredR, Cond, PastDefIt, TfrIt);
1060 UpdRegs.insert(RT.Reg);
1070 std::set<unsigned> &UpdRegs) {
1071 bool Changed =
false;
1073 for (I = B.
begin(), E = B.
end(); I !=
E; I = NextI) {
1074 NextI = std::next(I);
1075 unsigned Opc = I->getOpcode();
1076 if (Opc == Hexagon::A2_tfrt || Opc == Hexagon::A2_tfrf) {
1077 bool Done = predicate(*I, (Opc == Hexagon::A2_tfrt), UpdRegs);
1081 if (RegisterRef(I->getOperand(0)) == RegisterRef(I->getOperand(2))) {
1082 for (
auto &
Op : I->operands())
1084 UpdRegs.insert(
Op.getReg());
1098 if (RC == &Hexagon::IntRegsRegClass) {
1102 if (RC == &Hexagon::DoubleRegsRegClass) {
1103 BW = (RR.Sub != 0) ? 32 : 64;
1109 bool HexagonExpandCondsets::isIntraBlocks(
LiveInterval &LI) {
1122 bool HexagonExpandCondsets::coalesceRegisters(RegisterRef R1, RegisterRef
R2) {
1123 if (CoaLimitActive) {
1124 if (CoaCounter >= CoaLimit)
1131 if (
MRI->isLiveIn(R1.Reg))
1133 if (
MRI->isLiveIn(R2.Reg))
1145 << (Overlap ?
"overlap" :
"disjoint") <<
")\n " 1146 <<
printReg(R1.Reg,
TRI, R1.Sub) <<
" " << L1 <<
"\n " 1147 <<
printReg(R2.Reg,
TRI, R2.Sub) <<
" " << L2 <<
"\n");
1148 if (R1.Sub || R2.Sub)
1156 if (!isIntraBlocks(L1) && !isIntraBlocks(L2))
1159 MRI->replaceRegWith(R2.Reg, R1.Reg);
1165 VNInfo *NewVN, *OldVN =
I->valno;
1166 ValueInfoMap::iterator
F = VM.find(OldVN);
1167 if (F == VM.end()) {
1168 NewVN = L1.
getNextValue(
I->valno->def, LIS->getVNInfoAllocator());
1169 VM.insert(std::make_pair(OldVN, NewVN));
1177 LIS->removeInterval(R2.Reg);
1179 updateKillFlags(R1.Reg);
1189 bool HexagonExpandCondsets::coalesceSegments(
1191 std::set<unsigned> &UpdRegs) {
1195 if (!S1.
isReg() && !S2.isReg())
1200 bool Changed =
false;
1202 RegisterRef RD = CI->getOperand(0);
1203 RegisterRef
RP = CI->getOperand(1);
1225 RegisterRef RS = S1;
1226 MachineInstr *RDef = getReachingDefForPred(RS, CI, RP.Reg,
true);
1228 Done = coalesceRegisters(RD, RegisterRef(S1));
1230 UpdRegs.insert(RD.Reg);
1231 UpdRegs.insert(S1.
getReg());
1235 if (!Done && S2.isReg()) {
1236 RegisterRef RS = S2;
1237 MachineInstr *RDef = getReachingDefForPred(RS, CI, RP.Reg,
false);
1239 Done = coalesceRegisters(RD, RegisterRef(S2));
1241 UpdRegs.insert(RD.Reg);
1242 UpdRegs.insert(S2.getReg());
1251 bool HexagonExpandCondsets::runOnMachineFunction(
MachineFunction &MF) {
1257 MDT = &getAnalysis<MachineDominatorTree>();
1258 LIS = &getAnalysis<LiveIntervals>();
1264 bool Changed =
false;
1265 std::set<unsigned> CoalUpd, PredUpd;
1275 Changed |= coalesceSegments(Condsets, CoalUpd);
1282 std::set<unsigned> KillUpd;
1285 if (
Op.isReg() &&
Op.isUse())
1286 if (!CoalUpd.count(
Op.getReg()))
1287 KillUpd.insert(
Op.getReg());
1290 LIS->print(
dbgs() <<
"After coalescing\n", MF.getFunction().getParent()));
1297 Changed |=
split(*MI, PredUpd);
1307 LIS->print(
dbgs() <<
"After splitting\n", MF.getFunction().getParent()));
1314 Changed |= predicateInBlock(B, PredUpd);
1316 MF.getFunction().getParent()));
1318 PredUpd.insert(CoalUpd.begin(), CoalUpd.end());
1323 LIS->print(
dbgs() <<
"After expand-condsets\n",
1324 MF.getFunction().getParent());
1334 return new HexagonExpandCondsets();
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.
This class represents lattice values for constants.
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
void push_back(const T &Elt)
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.
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)
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
Retuns the total number of operands.
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
ArrayRef< MachineMemOperand * > memoperands() const
Access to memory operands of the instruction.
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...
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 & cloneMemRefs(const MachineInstr &OtherMI) 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 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.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
void tieOperands(unsigned DefIdx, unsigned UseIdx)
Add a tie between the register operands at DefIdx and UseIdx.