10 #define DEBUG_TYPE "hsdr"
57 cl::desc(
"Maximum number of split partitions"));
59 cl::desc(
"Do not split loads or stores"));
71 return "Hexagon Split Double Registers";
90 typedef std::set<unsigned> USet;
91 typedef std::map<unsigned,USet> UUSetMap;
92 typedef std::pair<unsigned,unsigned> UUPair;
93 typedef std::map<unsigned,UUPair> UUPairMap;
94 typedef std::map<const MachineLoop*,USet> LoopRegMap;
96 bool isInduction(
unsigned Reg, LoopRegMap &IRM)
const;
99 void partitionRegisters(UUSetMap &P2Rs);
101 bool isProfitable(
const USet &Part, LoopRegMap &IRM)
const;
103 void collectIndRegsForLoop(
const MachineLoop *
L, USet &Rs);
104 void collectIndRegs(LoopRegMap &IRM);
107 const UUPairMap &PairMap,
unsigned SubR);
115 void replaceSubregUses(
MachineInstr *
MI,
const UUPairMap &PairMap);
116 void collapseRegPairs(
MachineInstr *
MI,
const UUPairMap &PairMap);
117 bool splitPartition(
const USet &Part);
120 static void dump_partition(
raw_ostream&,
const USet&,
127 = &Hexagon::DoubleRegsRegClass;
132 "Hexagon Split Double Registers",
false,
false)
134 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
144 bool HexagonSplitDoubleRegs::isInduction(
unsigned Reg, LoopRegMap &IRM)
const {
146 const USet &Rs =
I.second;
147 if (Rs.find(Reg) != Rs.end())
153 bool HexagonSplitDoubleRegs::isVolatileInstr(
const MachineInstr *
MI)
const {
160 bool HexagonSplitDoubleRegs::isFixedInstr(
const MachineInstr *MI)
const {
162 if (MemRefsFixed || isVolatileInstr(MI))
172 case TargetOpcode::PHI:
173 case TargetOpcode::COPY:
176 case Hexagon::L2_loadrd_io:
181 case Hexagon::S2_storerd_io:
186 case Hexagon::L2_loadrd_pi:
187 case Hexagon::S2_storerd_pi:
189 case Hexagon::A2_tfrpi:
190 case Hexagon::A2_combineii:
191 case Hexagon::A4_combineir:
192 case Hexagon::A4_combineii:
193 case Hexagon::A4_combineri:
194 case Hexagon::A2_combinew:
195 case Hexagon::CONST64:
197 case Hexagon::A2_sxtw:
199 case Hexagon::A2_andp:
200 case Hexagon::A2_orp:
201 case Hexagon::A2_xorp:
202 case Hexagon::S2_asl_i_p_or:
203 case Hexagon::S2_asl_i_p:
204 case Hexagon::S2_asr_i_p:
205 case Hexagon::S2_lsr_i_p:
212 unsigned R =
Op.getReg();
219 void HexagonSplitDoubleRegs::partitionRegisters(UUSetMap &P2Rs) {
220 typedef std::map<unsigned,unsigned> UUMap;
221 typedef std::vector<unsigned> UVect;
223 unsigned NumRegs =
MRI->getNumVirtRegs();
225 for (
unsigned i = 0; i < NumRegs; ++i) {
227 if (
MRI->getRegClass(R) == DoubleRC)
238 if (!DefI || isFixedInstr(DefI))
248 USet &Asc = AssocMap[R];
249 for (
auto U =
MRI->use_nodbg_begin(R),
Z =
MRI->use_nodbg_end();
253 if (isFixedInstr(UseI))
265 if (
MRI->getRegClass(T) != DoubleRC)
273 AssocMap[
T].insert(R);
284 if (Visited.count(R))
287 unsigned ThisP = FixedRegs[x] ? 0 : NextP++;
290 for (
unsigned i = 0; i < WorkQ.size(); ++i) {
291 unsigned T = WorkQ[i];
292 if (Visited.count(T))
297 USet &Asc = AssocMap[
T];
298 for (USet::iterator J = Asc.begin(),
F = Asc.end(); J !=
F; ++J)
304 P2Rs[
I.second].insert(
I.first);
309 bool LoZ1 =
false, HiZ1 =
false;
310 if (Lo == 0 || Lo == 0xFFFFFFFF)
311 P += 10, LoZ1 =
true;
312 if (Hi == 0 || Hi == 0xFFFFFFFF)
313 P += 10, HiZ1 =
true;
314 if (!LoZ1 && !HiZ1 && Lo == Hi)
319 int32_t HexagonSplitDoubleRegs::profit(
const MachineInstr *MI)
const {
323 case TargetOpcode::PHI:
324 for (
const auto &Op : MI->
operands())
328 case TargetOpcode::COPY:
333 case Hexagon::L2_loadrd_io:
334 case Hexagon::S2_storerd_io:
336 case Hexagon::L2_loadrd_pi:
337 case Hexagon::S2_storerd_pi:
340 case Hexagon::A2_tfrpi:
341 case Hexagon::CONST64: {
343 unsigned Lo = D & 0xFFFFFFFFULL;
344 unsigned Hi = D >> 32;
347 case Hexagon::A2_combineii:
348 case Hexagon::A4_combineii:
351 case Hexagon::A4_combineri:
355 case Hexagon::A4_combineir: {
358 if (V == 0 || V == -1)
363 case Hexagon::A2_combinew:
366 case Hexagon::A2_sxtw:
369 case Hexagon::A2_andp:
370 case Hexagon::A2_orp:
371 case Hexagon::A2_xorp:
374 case Hexagon::S2_asl_i_p_or: {
376 if (S == 0 || S == 32)
380 case Hexagon::S2_asl_i_p:
381 case Hexagon::S2_asr_i_p:
382 case Hexagon::S2_lsr_i_p:
384 if (S == 0 || S == 32)
396 bool HexagonSplitDoubleRegs::isProfitable(
const USet &Part, LoopRegMap &IRM)
398 unsigned FixedNum = 0, LoopPhiNum = 0;
401 for (
unsigned DR : Part) {
403 int32_t
P = profit(DefI);
408 if (isInduction(DR, IRM))
411 for (
auto U =
MRI->use_nodbg_begin(DR), W =
MRI->use_nodbg_end();
414 if (isFixedInstr(UseI)) {
435 int32_t P = profit(UseI);
442 if (FixedNum > 0 && LoopPhiNum > 0)
443 TotalP -= 20*LoopPhiNum;
445 DEBUG(
dbgs() <<
"Partition profit: " << TotalP <<
'\n');
449 void HexagonSplitDoubleRegs::collectIndRegsForLoop(
const MachineLoop *L,
465 if (BadLB || Cond.
size() != 2)
471 if (TB != HB && FB != HB)
473 assert(Cond[1].
isReg() &&
"Unexpected Cond vector from analyzeBranch");
475 unsigned PR = Cond[1].getReg();
476 assert(
MRI->getRegClass(PR) == &Hexagon::PredRegsRegClass);
480 unsigned CmpR1 = 0, CmpR2 = 0;
482 while (CmpI->
getOpcode() == Hexagon::C2_not)
485 int Mask = 0, Val = 0;
490 if (CmpR1 &&
MRI->getRegClass(CmpR1) != DoubleRC)
492 if (CmpR2 &&
MRI->getRegClass(CmpR2) != DoubleRC)
494 if (!CmpR1 && !CmpR2)
504 typedef std::vector<unsigned> UVect;
506 for (
auto &MI : *HB) {
511 if (
MRI->getRegClass(R) == DoubleRC)
517 auto NoIndOp = [
this, CmpR1, CmpR2] (
unsigned R) ->
bool {
518 for (
auto I =
MRI->use_nodbg_begin(R),
E =
MRI->use_nodbg_end();
521 if (UseI->
getOpcode() != Hexagon::A2_addp)
527 if (T == CmpR1 || T == CmpR2)
533 Rs.insert(DP.begin(),
End);
538 dbgs() <<
"For loop at BB#" << HB->getNumber() <<
" ind regs: ";
539 dump_partition(
dbgs(), Rs, *TRI);
544 void HexagonSplitDoubleRegs::collectIndRegs(LoopRegMap &IRM) {
545 typedef std::vector<MachineLoop*> LoopVector;
550 for (
unsigned i = 0; i < WorkQ.size(); ++i) {
551 for (
auto I : *WorkQ[i])
556 for (
unsigned i = 0, n = WorkQ.size(); i < n; ++i) {
559 collectIndRegsForLoop(L, Rs);
561 IRM.insert(std::make_pair(L, Rs));
565 void HexagonSplitDoubleRegs::createHalfInstr(
unsigned Opc,
MachineInstr *MI,
566 const UUPairMap &PairMap,
unsigned SubR) {
580 bool isKill = Op.
isKill();
581 if (isVirtReg &&
MRI->getRegClass(R) == DoubleRC) {
583 UUPairMap::const_iterator
F = PairMap.find(R);
584 if (F == PairMap.end()) {
587 const UUPair &P = F->second;
588 R = (SubR == Hexagon::isub_lo) ? P.first : P.second;
599 void HexagonSplitDoubleRegs::splitMemRef(
MachineInstr *MI,
600 const UUPairMap &PairMap) {
603 bool PostInc = (OrigOpc == Hexagon::L2_loadrd_pi ||
604 OrigOpc == Hexagon::S2_storerd_pi);
610 unsigned AdrX = PostInc ? (Load ? 2 : 1)
617 UUPairMap::const_iterator F = PairMap.find(ValOp.
getReg());
618 assert(F != PairMap.end());
621 const UUPair &P = F->second;
623 LowI =
BuildMI(B, MI, DL,
TII->get(Hexagon::L2_loadri_io), P.first)
626 HighI =
BuildMI(B, MI, DL,
TII->get(Hexagon::L2_loadri_io), P.second)
630 const UUPair &P = F->second;
632 LowI =
BuildMI(B, MI, DL,
TII->get(Hexagon::S2_storeri_io))
636 HighI =
BuildMI(B, MI, DL,
TII->get(Hexagon::S2_storeri_io))
648 unsigned NewR =
MRI->createVirtualRegister(RC);
650 BuildMI(B, MI, DL,
TII->get(Hexagon::A2_addi), NewR)
651 .addReg(AdrOp.
getReg(), RSA)
653 MRI->replaceRegWith(UpdOp.
getReg(), NewR);
662 int A = MO->getAlignment();
671 void HexagonSplitDoubleRegs::splitImmediate(
MachineInstr *MI,
672 const UUPairMap &PairMap) {
676 uint64_t V = Op1.
getImm();
680 UUPairMap::const_iterator F = PairMap.find(Op0.
getReg());
681 assert(F != PairMap.end());
682 const UUPair &P = F->second;
692 BuildMI(B, MI, DL,
TII->get(Hexagon::A2_tfrsi), P.first)
693 .addImm(int32_t(V & 0xFFFFFFFFULL));
694 BuildMI(B, MI, DL,
TII->get(Hexagon::A2_tfrsi), P.second)
695 .addImm(int32_t(V >> 32));
698 void HexagonSplitDoubleRegs::splitCombine(
MachineInstr *MI,
699 const UUPairMap &PairMap) {
707 UUPairMap::const_iterator F = PairMap.find(Op0.
getReg());
708 assert(F != PairMap.end());
709 const UUPair &P = F->second;
712 BuildMI(B, MI, DL,
TII->get(Hexagon::A2_tfrsi), P.second)
714 }
else if (Op1.
isReg()) {
715 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), P.second)
721 BuildMI(B, MI, DL,
TII->get(Hexagon::A2_tfrsi), P.first)
723 }
else if (Op2.
isReg()) {
724 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), P.first)
731 const UUPairMap &PairMap) {
738 UUPairMap::const_iterator F = PairMap.find(Op0.
getReg());
739 assert(F != PairMap.end());
740 const UUPair &P = F->second;
743 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), P.first)
745 BuildMI(B, MI, DL,
TII->get(Hexagon::S2_asr_i_r), P.second)
750 void HexagonSplitDoubleRegs::splitShift(
MachineInstr *MI,
751 const UUPairMap &PairMap) {
752 using namespace Hexagon;
758 int64_t Sh64 = Op2.
getImm();
759 assert(Sh64 >= 0 && Sh64 < 64);
762 UUPairMap::const_iterator F = PairMap.find(Op0.
getReg());
763 assert(F != PairMap.end());
764 const UUPair &P = F->second;
765 unsigned LoR = P.first;
766 unsigned HiR = P.second;
769 bool Right = (Opc == S2_lsr_i_p || Opc == S2_asr_i_p);
771 bool Signed = (Opc == S2_asr_i_p);
777 : (
Signed ? S2_asr_i_r : S2_lsr_i_r);
778 unsigned LoSR = isub_lo;
779 unsigned HiSR = isub_hi;
783 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), LoR)
785 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), HiR)
786 .addReg(Op1.
getReg(), RS, HiSR);
789 unsigned TmpR =
MRI->createVirtualRegister(IntRC);
810 else if (S == 16 &&
Signed)
820 BuildMI(B, MI, DL,
TII->get(S2_extractu), TmpR)
825 BuildMI(B, MI, DL,
TII->get(S2_asl_i_r_or), HiR)
841 }
else if (S == 32) {
842 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), (
Left ? HiR : LoR))
849 .addReg(Op1.
getReg(), RS, HiSR)
856 else if (S == 16 &&
Signed)
866 .addReg(Op1.
getReg(), RS, HiSR)
874 void HexagonSplitDoubleRegs::splitAslOr(
MachineInstr *MI,
875 const UUPairMap &PairMap) {
876 using namespace Hexagon;
883 int64_t Sh64 = Op3.getImm();
884 assert(Sh64 >= 0 && Sh64 < 64);
887 UUPairMap::const_iterator F = PairMap.find(Op0.
getReg());
888 assert(F != PairMap.end());
889 const UUPair &P = F->second;
890 unsigned LoR = P.first;
891 unsigned HiR = P.second;
899 unsigned LoSR = isub_lo;
900 unsigned HiSR = isub_hi;
922 .addReg(Op1.
getReg(), RS1, HiSR)
923 .addReg(Op2.
getReg(), RS2, HiSR);
925 BuildMI(B, MI, DL,
TII->get(S2_asl_i_r_or), LoR)
929 unsigned TmpR1 =
MRI->createVirtualRegister(IntRC);
930 BuildMI(B, MI, DL,
TII->get(S2_extractu), TmpR1)
934 unsigned TmpR2 =
MRI->createVirtualRegister(IntRC);
936 .addReg(Op1.
getReg(), RS1, HiSR)
938 BuildMI(B, MI, DL,
TII->get(S2_asl_i_r_or), HiR)
942 }
else if (S == 32) {
947 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), LoR)
950 .addReg(Op1.
getReg(), RS1, HiSR)
951 .addReg(Op2.
getReg(), RS2, LoSR);
958 BuildMI(B, MI, DL,
TII->get(TargetOpcode::COPY), LoR)
960 BuildMI(B, MI, DL,
TII->get(S2_asl_i_r_or), HiR)
961 .addReg(Op1.
getReg(), RS1, HiSR)
962 .addReg(Op2.
getReg(), RS2, LoSR)
967 bool HexagonSplitDoubleRegs::splitInstr(
MachineInstr *MI,
968 const UUPairMap &PairMap) {
969 using namespace Hexagon;
976 case TargetOpcode::PHI:
977 case TargetOpcode::COPY: {
979 if (
MRI->getRegClass(DstR) == DoubleRC) {
980 createHalfInstr(Opc, MI, PairMap, isub_lo);
981 createHalfInstr(Opc, MI, PairMap, isub_hi);
987 createHalfInstr(A2_and, MI, PairMap, isub_lo);
988 createHalfInstr(A2_and, MI, PairMap, isub_hi);
992 createHalfInstr(A2_or, MI, PairMap, isub_lo);
993 createHalfInstr(A2_or, MI, PairMap, isub_hi);
997 createHalfInstr(A2_xor, MI, PairMap, isub_lo);
998 createHalfInstr(A2_xor, MI, PairMap, isub_hi);
1006 splitMemRef(MI, PairMap);
1012 splitImmediate(MI, PairMap);
1021 splitCombine(MI, PairMap);
1026 splitExt(MI, PairMap);
1033 splitShift(MI, PairMap);
1038 splitAslOr(MI, PairMap);
1050 void HexagonSplitDoubleRegs::replaceSubregUses(
MachineInstr *MI,
1051 const UUPairMap &PairMap) {
1055 unsigned R = Op.
getReg();
1056 UUPairMap::const_iterator F = PairMap.find(R);
1057 if (F == PairMap.end())
1059 const UUPair &P = F->second;
1061 case Hexagon::isub_lo:
1064 case Hexagon::isub_hi:
1072 void HexagonSplitDoubleRegs::collapseRegPairs(
MachineInstr *MI,
1073 const UUPairMap &PairMap) {
1080 unsigned R = Op.
getReg();
1085 UUPairMap::const_iterator F = PairMap.find(R);
1086 if (F == PairMap.end())
1088 const UUPair &Pr = F->second;
1089 unsigned NewDR =
MRI->createVirtualRegister(DoubleRC);
1090 BuildMI(B, MI, DL,
TII->get(TargetOpcode::REG_SEQUENCE), NewDR)
1092 .
addImm(Hexagon::isub_lo)
1094 .
addImm(Hexagon::isub_hi);
1099 bool HexagonSplitDoubleRegs::splitPartition(
const USet &Part) {
1101 typedef std::set<MachineInstr*> MISet;
1102 bool Changed =
false;
1104 DEBUG(
dbgs() <<
"Splitting partition: "; dump_partition(
dbgs(), Part, *TRI);
1110 for (
unsigned DR : Part) {
1112 SplitIns.insert(DefI);
1116 for (
auto U =
MRI->use_nodbg_begin(DR), W =
MRI->use_nodbg_end();
1118 SplitIns.insert(U->getParent());
1120 unsigned LoR =
MRI->createVirtualRegister(IntRC);
1121 unsigned HiR =
MRI->createVirtualRegister(IntRC);
1124 PairMap.insert(std::make_pair(DR, UUPair(LoR, HiR)));
1128 for (
auto MI : SplitIns) {
1129 if (isFixedInstr(MI)) {
1130 collapseRegPairs(MI, PairMap);
1132 bool Done = splitInstr(MI, PairMap);
1139 for (
unsigned DR : Part) {
1144 for (
auto U =
MRI->use_nodbg_begin(DR), W =
MRI->use_nodbg_end();
1146 Uses.insert(U->getParent());
1148 replaceSubregUses(M, PairMap);
1151 for (
auto MI : Erase) {
1159 bool HexagonSplitDoubleRegs::runOnMachineFunction(
MachineFunction &MF) {
1160 DEBUG(
dbgs() <<
"Splitting double registers in function: "
1167 TRI =
ST.getRegisterInfo();
1168 TII =
ST.getInstrInfo();
1170 MLI = &getAnalysis<MachineLoopInfo>();
1175 collectIndRegs(IRM);
1176 partitionRegisters(P2Rs);
1179 dbgs() <<
"Register partitioning: (partition #0 is fixed)\n";
1180 for (UUSetMap::iterator
I = P2Rs.begin(),
E = P2Rs.end();
I !=
E; ++
I) {
1181 dbgs() <<
'#' <<
I->first <<
" -> ";
1182 dump_partition(
dbgs(),
I->second, *TRI);
1187 bool Changed =
false;
1188 int Limit = MaxHSDR;
1190 for (UUSetMap::iterator
I = P2Rs.begin(),
E = P2Rs.end();
I !=
E; ++
I) {
1193 if (Limit >= 0 &&
Counter >= Limit)
1195 USet &Part =
I->second;
1196 DEBUG(
dbgs() <<
"Calculating profit for partition #" <<
I->first <<
'\n');
1197 if (!isProfitable(Part, IRM))
1200 Changed |= splitPartition(Part);
1207 return new HexagonSplitDoubleRegs();
static bool isReg(const MCInst &MI, unsigned OpNo)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
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.
static unsigned virtReg2Index(unsigned Reg)
Convert a virtual register number to a 0-based index.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
static unsigned index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
auto remove_if(R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly...
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
bool PredOpcodeHasJMP_c(unsigned Opcode) const
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
iterator_range< mmo_iterator > memoperands()
iterator_range< mop_iterator > operands()
BlockT * getHeader() const
BlockT * getLoopLatch() const
If there is a single latch block for this loop, return it.
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Analyze the branching code at the end of MBB, returning true if it cannot be understood (e...
AnalysisUsage & addRequired()
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false)
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
INITIALIZE_PASS(HexagonSplitDoubleRegs,"hexagon-split-double","Hexagon Split Double Registers", false, false) LLVM_DUMP_METHOD void HexagonSplitDoubleRegs
Reg
All possible values of the reg field in the ModR/M byte.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
zlib-gnu style compression
unsigned getNumOperands() const
Access to explicit operands of the instruction.
void addMemOperand(MachineFunction &MF, MachineMemOperand *MO)
Add a MachineMemOperand to the machine instruction.
Printable PrintReg(unsigned Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubRegIdx=0)
Prints virtual and physical registers with or without a TRI instance.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineBasicBlock * getParent() const
bool isDebugValue() const
bool isEarlyClobber() const
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
initializer< Ty > init(const Ty &Val)
unsigned const MachineRegisterInfo * MRI
bool analyzeCompare(const MachineInstr &MI, unsigned &SrcReg, unsigned &SrcReg2, int &Mask, int &Value) const override
For a comparison instruction, return the source registers in SrcReg and SrcReg2 if having two registe...
const MachineOperand & getOperand(unsigned i) const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Represent the analysis usage information of a pass.
static const unsigned End
FunctionPass class - This class is used to implement most global optimizations.
FunctionPass * createHexagonSplitDoubleRegs()
static int32_t profitImm(unsigned Lo, unsigned Hi)
unsigned getSubReg() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This class contains a discriminated union of information about pointers in memory operands...
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to 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...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Flags
Flags values. These may be or'd together.
llvm_unreachable("Unknown RegBank!")
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
void setReg(unsigned Reg)
Change the register this operand corresponds to.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
void setSubReg(unsigned subReg)
unsigned getReg() const
getReg - Returns the register number.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void initializeHexagonSplitDoubleRegsPass(PassRegistry &)
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
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.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
static void Split(std::vector< std::string > &V, StringRef S)
Splits a string of comma separated items in to a vector of strings.
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
bool isInternalRead() const
static const MCPhysReg DoubleRegs[32]