50#define DEBUG_TYPE "gcn-dpp-combine"
52STATISTIC(NumDPPMovsCombined,
"Number of DPP moves combined.");
68 bool IsShrinkable)
const;
72 bool IsShrinkable)
const;
75 int64_t Mask = -1)
const;
79 int getDPPOp(
unsigned Op,
bool IsShrinkable)
const;
90 GCNDPPCombineLegacy() : MachineFunctionPass(ID) {}
92 bool runOnMachineFunction(MachineFunction &MF)
override;
94 StringRef getPassName()
const override {
return "GCN DPP Combine"; }
96 void getAnalysisUsage(AnalysisUsage &AU)
const override {
101 MachineFunctionProperties getRequiredProperties()
const override {
102 return MachineFunctionProperties().setIsSSA();
111char GCNDPPCombineLegacy::
ID = 0;
116 return new GCNDPPCombineLegacy();
120 unsigned Op =
MI.getOpcode();
121 if (!
TII->isVOP3(
Op)) {
124 if (!
TII->hasVALU32BitEncoding(
Op)) {
132 if (
const auto *SDst =
TII->getNamedOperand(
MI, AMDGPU::OpName::sdst)) {
142 if (!hasNoImmOrEqual(
MI, AMDGPU::OpName::src0_modifiers, 0, Mask) ||
143 !hasNoImmOrEqual(
MI, AMDGPU::OpName::src1_modifiers, 0, Mask) ||
144 !hasNoImmOrEqual(
MI, AMDGPU::OpName::clamp, 0) ||
145 !hasNoImmOrEqual(
MI, AMDGPU::OpName::omod, 0) ||
146 !hasNoImmOrEqual(
MI, AMDGPU::OpName::byte_sel, 0)) {
153int GCNDPPCombine::getDPPOp(
unsigned Op,
bool IsShrinkable)
const {
158 DPP32 = (E32 == -1) ? -1 : AMDGPU::
getDPPOp32(E32);
160 if (DPP32 != -1 &&
TII->pseudoToMCOpcode(DPP32) != -1)
165 if (DPP64 != -1 &&
TII->pseudoToMCOpcode(DPP64) != -1)
174MachineOperand *GCNDPPCombine::getOldOpndValue(MachineOperand &OldOpnd)
const {
179 switch(
Def->getOpcode()) {
181 case AMDGPU::IMPLICIT_DEF:
184 case AMDGPU::V_MOV_B32_e32:
185 case AMDGPU::V_MOV_B64_PSEUDO:
186 case AMDGPU::V_MOV_B64_e32:
187 case AMDGPU::V_MOV_B64_e64: {
188 auto &Op1 =
Def->getOperand(1);
197MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI,
201 bool IsShrinkable)
const {
203 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_dpp ||
204 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO);
210 dbgs() <<
" failed: Did not expect any 16-bit uses of dpp values\n");
213 auto DPPOp = getDPPOp(OrigOp, IsShrinkable);
220 auto *RowMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::row_mask);
221 assert(RowMaskOpnd && RowMaskOpnd->isImm());
222 auto *BankMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::bank_mask);
223 assert(BankMaskOpnd && BankMaskOpnd->isImm());
224 const bool MaskAllLanes =
225 RowMaskOpnd->getImm() == 0xF && BankMaskOpnd->getImm() == 0xF;
228 !(
TII->isVOPC(DPPOp) || (
TII->isVOP3(DPPOp) && OrigOpE32 != -1 &&
229 TII->isVOPC(OrigOpE32)))) &&
230 "VOPC cannot form DPP unless mask is full");
239 if (
auto *Dst =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::vdst)) {
243 if (
auto *SDst =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::sdst)) {
251 const int OldIdx = AMDGPU::getNamedOperandIdx(DPPOp, AMDGPU::OpName::old);
253 assert(OldIdx == NumOperands);
257 TII->getNamedOperand(MovMI, AMDGPU::OpName::vdst)->getReg()),
263 }
else if (
TII->isVOPC(DPPOp) || (
TII->isVOP3(DPPOp) && OrigOpE32 != -1 &&
264 TII->isVOPC(OrigOpE32))) {
269 LLVM_DEBUG(
dbgs() <<
" failed: no old operand in DPP instruction,"
275 auto *Mod0 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src0_modifiers);
277 assert(NumOperands == AMDGPU::getNamedOperandIdx(DPPOp,
278 AMDGPU::OpName::src0_modifiers));
281 DPPInst.addImm(Mod0->getImm());
287 auto *Src0 =
TII->getNamedOperand(MovMI, AMDGPU::OpName::src0);
289 [[maybe_unused]]
int Src0Idx = NumOperands;
292 DPPInst->getOperand(NumOperands).setIsKill(
false);
295 auto *Mod1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1_modifiers);
297 assert(NumOperands == AMDGPU::getNamedOperandIdx(DPPOp,
298 AMDGPU::OpName::src1_modifiers));
301 DPPInst.addImm(Mod1->getImm());
307 auto *Src1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1);
310 "dpp version of instruction missing src1");
316 auto *Mod2 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src2_modifiers);
319 AMDGPU::getNamedOperandIdx(DPPOp, AMDGPU::OpName::src2_modifiers));
322 DPPInst.addImm(Mod2->getImm());
325 auto *Src2 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src2);
337 auto *ClampOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::clamp);
339 DPPInst.addImm(ClampOpr->getImm());
341 auto *VdstInOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::vdst_in);
344 DPPInst.add(*VdstInOpr);
346 auto *OmodOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::omod);
348 DPPInst.addImm(OmodOpr->getImm());
352 if (
TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel)) {
357 if (Mod0 &&
TII->isVOP3(OrigMI) && !
TII->isVOP3P(OrigMI))
366 DPPInst.addImm(OpSel);
368 if (
TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel_hi)) {
376 assert(Src2 &&
"Expected vop3p with 3 operands");
378 LLVM_DEBUG(
dbgs() <<
" failed: op_sel_hi must be all set to one\n");
383 DPPInst.addImm(OpSelHi);
385 auto *NegOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::neg_lo);
387 DPPInst.addImm(NegOpr->getImm());
389 auto *NegHiOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::neg_hi);
391 DPPInst.addImm(NegHiOpr->getImm());
393 auto *ByteSelOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::byte_sel);
396 DPPInst.addImm(ByteSelOpr->getImm());
398 if (MachineOperand *BitOp3 =
399 TII->getNamedOperand(OrigMI, AMDGPU::OpName::bitop3)) {
401 DPPInst.add(*BitOp3);
404 DPPInst.add(*
TII->getNamedOperand(MovMI, AMDGPU::OpName::dpp_ctrl));
405 DPPInst.add(*
TII->getNamedOperand(MovMI, AMDGPU::OpName::row_mask));
406 DPPInst.add(*
TII->getNamedOperand(MovMI, AMDGPU::OpName::bank_mask));
407 DPPInst.addImm(CombBCZ ? 1 : 0);
409 constexpr AMDGPU::OpName Srcs[] = {
410 AMDGPU::OpName::src0, AMDGPU::OpName::src1, AMDGPU::OpName::src2};
416 int OpIdx = AMDGPU::getNamedOperandIdx(DPPOp, OpName);
420 if (!
TII->isOperandLegal(*DPPInst,
OpIdx)) {
429 DPPInst.getInstr()->eraseFromParent();
433 return DPPInst.getInstr();
440 case AMDGPU::V_ADD_U32_e32:
441 case AMDGPU::V_ADD_U32_e64:
442 case AMDGPU::V_ADD_CO_U32_e32:
443 case AMDGPU::V_ADD_CO_U32_e64:
444 case AMDGPU::V_OR_B32_e32:
445 case AMDGPU::V_OR_B32_e64:
446 case AMDGPU::V_SUBREV_U32_e32:
447 case AMDGPU::V_SUBREV_U32_e64:
448 case AMDGPU::V_SUBREV_CO_U32_e32:
449 case AMDGPU::V_SUBREV_CO_U32_e64:
450 case AMDGPU::V_MAX_U32_e32:
451 case AMDGPU::V_MAX_U32_e64:
452 case AMDGPU::V_XOR_B32_e32:
453 case AMDGPU::V_XOR_B32_e64:
454 if (OldOpnd->
getImm() == 0)
457 case AMDGPU::V_AND_B32_e32:
458 case AMDGPU::V_AND_B32_e64:
459 case AMDGPU::V_MIN_U32_e32:
460 case AMDGPU::V_MIN_U32_e64:
462 std::numeric_limits<uint32_t>::max())
465 case AMDGPU::V_MIN_I32_e32:
466 case AMDGPU::V_MIN_I32_e64:
467 if (
static_cast<int32_t
>(OldOpnd->
getImm()) ==
468 std::numeric_limits<int32_t>::max())
471 case AMDGPU::V_MAX_I32_e32:
472 case AMDGPU::V_MAX_I32_e64:
473 if (
static_cast<int32_t
>(OldOpnd->
getImm()) ==
474 std::numeric_limits<int32_t>::min())
477 case AMDGPU::V_MUL_I32_I24_e32:
478 case AMDGPU::V_MUL_I32_I24_e64:
479 case AMDGPU::V_MUL_U32_U24_e32:
480 case AMDGPU::V_MUL_U32_U24_e64:
481 if (OldOpnd->
getImm() == 1)
484 case AMDGPU::V_MIN_F32_e32:
485 case AMDGPU::V_MIN_F32_e64:
489 case AMDGPU::V_MAX_F32_e32:
490 case AMDGPU::V_MAX_F32_e64:
494 case AMDGPU::V_MIN_F64_e64:
495 case AMDGPU::V_MIN_NUM_F64_e64:
496 if (
static_cast<uint64_t>(OldOpnd->
getImm()) == 0x7FF0000000000000)
499 case AMDGPU::V_MAX_F64_e64:
500 case AMDGPU::V_MAX_NUM_F64_e64:
501 if (
static_cast<uint64_t>(OldOpnd->
getImm()) == 0xFFF0000000000000)
504 case AMDGPU::V_MIN_F16_e32:
505 case AMDGPU::V_MIN_F16_e64:
506 case AMDGPU::V_MIN_F16_t16_e32:
507 case AMDGPU::V_MIN_F16_t16_e64:
508 case AMDGPU::V_MIN_F16_fake16_e32:
509 case AMDGPU::V_MIN_F16_fake16_e64:
513 case AMDGPU::V_MAX_F16_e32:
514 case AMDGPU::V_MAX_F16_e64:
515 case AMDGPU::V_MAX_F16_t16_e32:
516 case AMDGPU::V_MAX_F16_t16_e64:
517 case AMDGPU::V_MAX_F16_fake16_e32:
518 case AMDGPU::V_MAX_F16_fake16_e64:
526MachineInstr *GCNDPPCombine::createDPPInst(
527 MachineInstr &OrigMI, MachineInstr &MovMI,
RegSubRegPair CombOldVGPR,
528 MachineOperand *OldOpndValue,
bool CombBCZ,
bool IsShrinkable)
const {
530 if (!CombBCZ && OldOpndValue && OldOpndValue->
isImm()) {
531 auto *Src1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1);
532 if (!Src1 || !Src1->isReg()) {
533 LLVM_DEBUG(
dbgs() <<
" failed: no src1 or it isn't a register\n");
537 LLVM_DEBUG(
dbgs() <<
" failed: old immediate isn't an identity\n");
541 auto *MovDst =
TII->getNamedOperand(MovMI, AMDGPU::OpName::vdst);
542 const TargetRegisterClass *RC = MRI->
getRegClass(MovDst->getReg());
548 return createDPPInst(OrigMI, MovMI, CombOldVGPR, CombBCZ, IsShrinkable);
553bool GCNDPPCombine::hasNoImmOrEqual(MachineInstr &
MI, AMDGPU::OpName OpndName,
554 int64_t
Value, int64_t Mask)
const {
555 auto *
Imm =
TII->getNamedOperand(
MI, OpndName);
560 return (
Imm->getImm() & Mask) ==
Value;
563bool GCNDPPCombine::combineDPPMov(MachineInstr &MovMI)
const {
565 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_dpp ||
566 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO);
569 auto *DstOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::vdst);
570 assert(DstOpnd && DstOpnd->isReg());
571 auto DPPMovReg = DstOpnd->getReg();
572 if (DPPMovReg.isPhysical()) {
582 auto *
DppCtrl =
TII->getNamedOperand(MovMI, AMDGPU::OpName::dpp_ctrl);
584 unsigned DppCtrlVal =
DppCtrl->getImm();
585 if ((MovMI.
getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO ||
586 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_dpp)) {
587 if (!ST->hasFeature(AMDGPU::FeatureDPALU_DPP)) {
588 LLVM_DEBUG(
dbgs() <<
" failed: 64 bit dpp move is unsupported\n");
600 auto *RowMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::row_mask);
601 assert(RowMaskOpnd && RowMaskOpnd->isImm());
602 auto *BankMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::bank_mask);
603 assert(BankMaskOpnd && BankMaskOpnd->isImm());
604 const bool MaskAllLanes = RowMaskOpnd->getImm() == 0xF &&
605 BankMaskOpnd->getImm() == 0xF;
607 auto *BCZOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::bound_ctrl);
608 assert(BCZOpnd && BCZOpnd->isImm());
609 bool BoundCtrlZero = BCZOpnd->getImm();
611 auto *OldOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::old);
612 auto *SrcOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::src0);
614 assert(SrcOpnd && SrcOpnd->isReg());
620 auto *
const OldOpndValue = getOldOpndValue(*OldOpnd);
625 assert(!OldOpndValue || OldOpndValue->
isImm() || OldOpndValue == OldOpnd);
627 bool CombBCZ =
false;
629 if (MaskAllLanes && BoundCtrlZero) {
632 if (!OldOpndValue || !OldOpndValue->
isImm()) {
637 if (OldOpndValue->
getImm() == 0) {
642 }
else if (BoundCtrlZero) {
645 " failed: old!=0 and bctrl:0 and not all lanes isn't combinable\n");
654 dbgs() << *OldOpndValue;
655 dbgs() <<
", bound_ctrl=" << CombBCZ <<
'\n');
657 SmallVector<MachineInstr*, 4> OrigMIs, DPPMIs;
658 DenseMap<MachineInstr*, SmallVector<unsigned, 4>> RegSeqWithOpNos;
661 if (CombBCZ && OldOpndValue) {
662 const TargetRegisterClass *RC = MRI->
getRegClass(DPPMovReg);
666 TII->get(AMDGPU::IMPLICIT_DEF), CombOldVGPR.
Reg);
667 DPPMIs.push_back(UndefInst.getInstr());
670 OrigMIs.push_back(&MovMI);
671 bool Rollback =
true;
675 while (!
Uses.empty()) {
676 MachineOperand *
Use =
Uses.pop_back_val();
679 auto &OrigMI = *
Use->getParent();
684 "There should not be e32 True16 instructions pre-RA");
685 if (OrigOp == AMDGPU::REG_SEQUENCE) {
687 unsigned FwdSubReg = 0;
696 for (OpNo = 1; OpNo <
E; OpNo += 2) {
707 if (
Op.getSubReg() == FwdSubReg)
710 RegSeqWithOpNos[&OrigMI].push_back(OpNo);
714 bool IsShrinkable = isShrinkable(OrigMI);
715 if (!(IsShrinkable ||
716 ((
TII->isVOP3P(OrigOp) ||
TII->isVOPC(OrigOp) ||
717 TII->isVOP3(OrigOp)) &&
719 TII->isVOP1(OrigOp) ||
TII->isVOP2(OrigOp))) {
728 auto *Src0 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src0);
729 auto *Src1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1);
730 if (Use != Src0 && !(Use == Src1 && OrigMI.
isCommutable())) {
735 auto *Src2 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src2);
736 assert(Src0 &&
"Src1 without Src0?");
737 if ((Use == Src0 && ((Src1 && Src1->isIdenticalTo(*Src0)) ||
738 (Src2 && Src2->isIdenticalTo(*Src0)))) ||
739 (Use == Src1 && (Src1->isIdenticalTo(*Src0) ||
740 (Src2 && Src2->isIdenticalTo(*Src1))))) {
744 <<
" failed: DPP register is used more than once per instruction\n");
748 if (!ST->hasFeature(AMDGPU::FeatureDPALU_DPP) &&
751 <<
" failed: DPP ALU DPP is not supported\n");
758 <<
" failed: not valid 64-bit DPP control value\n");
764 if (
auto *DPPInst = createDPPInst(OrigMI, MovMI, CombOldVGPR,
765 OldOpndValue, CombBCZ, IsShrinkable)) {
766 DPPMIs.push_back(DPPInst);
772 auto *NewMI = BB->
getParent()->CloneMachineInstr(&OrigMI);
773 BB->
insert(OrigMI, NewMI);
774 if (
TII->commuteInstruction(*NewMI)) {
777 createDPPInst(*NewMI, MovMI, CombOldVGPR, OldOpndValue, CombBCZ,
779 DPPMIs.push_back(DPPInst);
784 NewMI->eraseFromParent();
788 OrigMIs.push_back(&OrigMI);
791 Rollback |= !
Uses.empty();
793 for (
auto *
MI : *(Rollback? &DPPMIs : &OrigMIs))
794 MI->eraseFromParent();
797 for (
auto &S : RegSeqWithOpNos) {
799 S.first->eraseFromParent();
802 while (!S.second.empty())
803 S.first->getOperand(S.second.pop_back_val()).setIsUndef();
810bool GCNDPPCombineLegacy::runOnMachineFunction(MachineFunction &MF) {
814 return GCNDPPCombine().run(MF);
817bool GCNDPPCombine::run(MachineFunction &MF) {
826 for (
auto &
MBB : MF) {
828 if (
MI.getOpcode() == AMDGPU::V_MOV_B32_dpp && combineDPPMov(
MI)) {
830 ++NumDPPMovsCombined;
831 }
else if (
MI.getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO ||
832 MI.getOpcode() == AMDGPU::V_MOV_B64_dpp) {
833 if (ST->hasDPALU_DPP() && combineDPPMov(
MI)) {
835 ++NumDPPMovsCombined;
839 if (M && combineDPPMov(*M))
840 ++NumDPPMovsCombined;
857 bool Changed = GCNDPPCombine().run(MF);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides AMDGPU specific target descriptions.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static bool isIdentityValue(unsigned OrigMIOp, MachineOperand *OldOpnd)
AMD GCN specific subclass of TargetSubtarget.
const HexagonInstrInfo * TII
TargetInstrInfo::RegSubRegPair RegSubRegPair
Promote Memory to Register
MachineInstr unsigned OpIdx
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Remove Loads Into Fake Uses
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Represents analyses that only rely on functions' control flow.
FunctionPass class - This class is used to implement most global optimizations.
bool hasOptNone() const
Do not optimize this function (-O0).
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MAM)
const SIInstrInfo * getInstrInfo() const override
const SIRegisterInfo * getRegisterInfo() const override
bool useRealTrue16Insts() const
Return true if real (non-fake) variants of True16 instructions using 16-bit registers should be code-...
unsigned getSize(const MachineInstr &MI) const
An RAII based helper class to modify MachineFunctionProperties when running pass.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
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.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
void insert(iterator MBBI, MachineBasicBlock *MBB)
const MachineInstrBuilder & setMIFlags(unsigned Flags) const
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.
bool modifiesRegister(Register Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr modifies (fully define or partially define) the specified register.
bool isCommutable(QueryType Type=IgnoreBundle) const
Return true if this may be a 2- or 3-address instruction (of the form "X = op Y, Z,...
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
uint32_t getFlags() const
Return the MI flags bitvector.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
const TargetRegisterClass * getRegClass(Register Reg) const
Return the register class of the specified virtual register.
iterator_range< use_nodbg_iterator > use_nodbg_operands(Register Reg) const
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...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
LLVM Value Representation.
LLVM_READONLY int32_t getDPPOp32(uint32_t Opcode)
LLVM_READNONE bool isLegalDPALU_DPPControl(const MCSubtargetInfo &ST, unsigned DC)
LLVM_READONLY bool hasNamedOperand(uint64_t Opcode, OpName NamedIdx)
bool isDPALU_DPP32BitOpc(unsigned Opc)
bool isTrue16Inst(unsigned Opc)
LLVM_READONLY int32_t getVOPe32(uint32_t Opcode)
LLVM_READONLY int32_t getDPPOp64(uint32_t Opcode)
bool isDPALU_DPP(const MCInstrDesc &OpDesc, const MCInstrInfo &MII, const MCSubtargetInfo &ST)
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.
NodeAddr< DefNode * > Def
NodeAddr< UseNode * > Use
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
TargetInstrInfo::RegSubRegPair getRegSubRegPair(const MachineOperand &O)
Create RegSubRegPair from a register MachineOperand.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
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...
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
auto reverse(ContainerTy &&C)
MachineInstr * getVRegSubRegDef(const TargetInstrInfo::RegSubRegPair &P, const MachineRegisterInfo &MRI)
Return the defining instruction for a given reg:subreg pair skipping copy like instructions and subre...
char & GCNDPPCombineLegacyID
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
DWARFExpression::Operation Op
iterator_range< pointer_iterator< WrappedIteratorT > > make_pointer_range(RangeT &&Range)
bool isOfRegClass(const TargetInstrInfo::RegSubRegPair &P, const TargetRegisterClass &TRC, MachineRegisterInfo &MRI)
Returns true if a reg:subreg pair P has a TRC class.
FunctionPass * createGCNDPPCombinePass()
constexpr RegState getUndefRegState(bool B)
bool execMayBeModifiedBeforeAnyUse(const MachineRegisterInfo &MRI, Register VReg, const MachineInstr &DefMI)
Return false if EXEC is not changed between the def of VReg at DefMI and all its uses.
A pair composed of a register and a sub-register index.