51#define DEBUG_TYPE "gcn-dpp-combine"
53STATISTIC(NumDPPMovsCombined,
"Number of DPP moves combined.");
69 bool IsShrinkable)
const;
73 bool IsShrinkable)
const;
76 int64_t Mask = -1)
const;
80 int getDPPOp(
unsigned Op,
bool IsShrinkable)
const;
91 GCNDPPCombineLegacy() : MachineFunctionPass(ID) {}
93 bool runOnMachineFunction(MachineFunction &MF)
override;
95 StringRef getPassName()
const override {
return "GCN DPP Combine"; }
97 void getAnalysisUsage(AnalysisUsage &AU)
const override {
103 MachineFunctionProperties getRequiredProperties()
const override {
104 return MachineFunctionProperties().setIsSSA();
113char GCNDPPCombineLegacy::
ID = 0;
118 return new GCNDPPCombineLegacy();
122 unsigned Op =
MI.getOpcode();
123 if (!
TII->isVOP3(
Op)) {
126 if (!
TII->hasVALU32BitEncoding(
Op)) {
134 if (
const auto *SDst =
TII->getNamedOperand(
MI, AMDGPU::OpName::sdst)) {
144 if (!hasNoImmOrEqual(
MI, AMDGPU::OpName::src0_modifiers, 0, Mask) ||
145 !hasNoImmOrEqual(
MI, AMDGPU::OpName::src1_modifiers, 0, Mask) ||
146 !hasNoImmOrEqual(
MI, AMDGPU::OpName::clamp, 0) ||
147 !hasNoImmOrEqual(
MI, AMDGPU::OpName::omod, 0) ||
148 !hasNoImmOrEqual(
MI, AMDGPU::OpName::byte_sel, 0)) {
155int GCNDPPCombine::getDPPOp(
unsigned Op,
bool IsShrinkable)
const {
160 DPP32 = (E32 == -1) ? -1 : AMDGPU::
getDPPOp32(E32);
162 if (DPP32 != -1 &&
TII->pseudoToMCOpcode(DPP32) != -1)
167 if (DPP64 != -1 &&
TII->pseudoToMCOpcode(DPP64) != -1)
176MachineOperand *GCNDPPCombine::getOldOpndValue(MachineOperand &OldOpnd)
const {
181 switch(
Def->getOpcode()) {
183 case AMDGPU::IMPLICIT_DEF:
186 case AMDGPU::V_MOV_B32_e32:
187 case AMDGPU::V_MOV_B64_PSEUDO:
188 case AMDGPU::V_MOV_B64_e32:
189 case AMDGPU::V_MOV_B64_e64: {
190 auto &Op1 =
Def->getOperand(1);
199MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI,
203 bool IsShrinkable)
const {
205 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_dpp ||
206 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO);
212 dbgs() <<
" failed: Did not expect any 16-bit uses of dpp values\n");
215 auto DPPOp = getDPPOp(OrigOp, IsShrinkable);
222 auto *RowMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::row_mask);
223 assert(RowMaskOpnd && RowMaskOpnd->isImm());
224 auto *BankMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::bank_mask);
225 assert(BankMaskOpnd && BankMaskOpnd->isImm());
226 const bool MaskAllLanes =
227 RowMaskOpnd->getImm() == 0xF && BankMaskOpnd->getImm() == 0xF;
230 !(
TII->isVOPC(DPPOp) || (
TII->isVOP3(DPPOp) && OrigOpE32 != -1 &&
231 TII->isVOPC(OrigOpE32)))) &&
232 "VOPC cannot form DPP unless mask is full");
241 if (
auto *Dst =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::vdst)) {
245 if (
auto *SDst =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::sdst)) {
253 const int OldIdx = AMDGPU::getNamedOperandIdx(DPPOp, AMDGPU::OpName::old);
255 assert(OldIdx == NumOperands);
259 TII->getNamedOperand(MovMI, AMDGPU::OpName::vdst)->getReg()),
265 }
else if (
TII->isVOPC(DPPOp) || (
TII->isVOP3(DPPOp) && OrigOpE32 != -1 &&
266 TII->isVOPC(OrigOpE32))) {
271 LLVM_DEBUG(
dbgs() <<
" failed: no old operand in DPP instruction,"
277 auto *Mod0 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src0_modifiers);
279 assert(NumOperands == AMDGPU::getNamedOperandIdx(DPPOp,
280 AMDGPU::OpName::src0_modifiers));
283 DPPInst.addImm(Mod0->getImm());
289 auto *Src0 =
TII->getNamedOperand(MovMI, AMDGPU::OpName::src0);
291 [[maybe_unused]]
int Src0Idx = NumOperands;
294 DPPInst->getOperand(NumOperands).setIsKill(
false);
297 auto *Mod1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1_modifiers);
299 assert(NumOperands == AMDGPU::getNamedOperandIdx(DPPOp,
300 AMDGPU::OpName::src1_modifiers));
303 DPPInst.addImm(Mod1->getImm());
309 auto *Src1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1);
312 "dpp version of instruction missing src1");
318 auto *Mod2 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src2_modifiers);
321 AMDGPU::getNamedOperandIdx(DPPOp, AMDGPU::OpName::src2_modifiers));
324 DPPInst.addImm(Mod2->getImm());
327 auto *Src2 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src2);
339 auto *ClampOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::clamp);
341 DPPInst.addImm(ClampOpr->getImm());
343 auto *VdstInOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::vdst_in);
346 DPPInst.add(*VdstInOpr);
348 auto *OmodOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::omod);
350 DPPInst.addImm(OmodOpr->getImm());
354 if (
TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel)) {
359 if (Mod0 &&
TII->isVOP3(OrigMI) && !
TII->isVOP3P(OrigMI))
368 DPPInst.addImm(OpSel);
370 if (
TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel_hi)) {
378 assert(Src2 &&
"Expected vop3p with 3 operands");
380 LLVM_DEBUG(
dbgs() <<
" failed: op_sel_hi must be all set to one\n");
385 DPPInst.addImm(OpSelHi);
387 auto *NegOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::neg_lo);
389 DPPInst.addImm(NegOpr->getImm());
391 auto *NegHiOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::neg_hi);
393 DPPInst.addImm(NegHiOpr->getImm());
395 auto *ByteSelOpr =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::byte_sel);
398 DPPInst.addImm(ByteSelOpr->getImm());
400 if (MachineOperand *BitOp3 =
401 TII->getNamedOperand(OrigMI, AMDGPU::OpName::bitop3)) {
403 DPPInst.add(*BitOp3);
406 DPPInst.add(*
TII->getNamedOperand(MovMI, AMDGPU::OpName::dpp_ctrl));
407 DPPInst.add(*
TII->getNamedOperand(MovMI, AMDGPU::OpName::row_mask));
408 DPPInst.add(*
TII->getNamedOperand(MovMI, AMDGPU::OpName::bank_mask));
409 DPPInst.addImm(CombBCZ ? 1 : 0);
411 constexpr AMDGPU::OpName Srcs[] = {
412 AMDGPU::OpName::src0, AMDGPU::OpName::src1, AMDGPU::OpName::src2};
418 int OpIdx = AMDGPU::getNamedOperandIdx(DPPOp, OpName);
422 if (!
TII->isOperandLegal(*DPPInst,
OpIdx)) {
431 DPPInst.getInstr()->eraseFromParent();
435 return DPPInst.getInstr();
442 case AMDGPU::V_ADD_U32_e32:
443 case AMDGPU::V_ADD_U32_e64:
444 case AMDGPU::V_ADD_CO_U32_e32:
445 case AMDGPU::V_ADD_CO_U32_e64:
446 case AMDGPU::V_OR_B32_e32:
447 case AMDGPU::V_OR_B32_e64:
448 case AMDGPU::V_SUBREV_U32_e32:
449 case AMDGPU::V_SUBREV_U32_e64:
450 case AMDGPU::V_SUBREV_CO_U32_e32:
451 case AMDGPU::V_SUBREV_CO_U32_e64:
452 case AMDGPU::V_MAX_U32_e32:
453 case AMDGPU::V_MAX_U32_e64:
454 case AMDGPU::V_XOR_B32_e32:
455 case AMDGPU::V_XOR_B32_e64:
456 if (OldOpnd->
getImm() == 0)
459 case AMDGPU::V_AND_B32_e32:
460 case AMDGPU::V_AND_B32_e64:
461 case AMDGPU::V_MIN_U32_e32:
462 case AMDGPU::V_MIN_U32_e64:
464 std::numeric_limits<uint32_t>::max())
467 case AMDGPU::V_MIN_I32_e32:
468 case AMDGPU::V_MIN_I32_e64:
469 if (
static_cast<int32_t
>(OldOpnd->
getImm()) ==
470 std::numeric_limits<int32_t>::max())
473 case AMDGPU::V_MAX_I32_e32:
474 case AMDGPU::V_MAX_I32_e64:
475 if (
static_cast<int32_t
>(OldOpnd->
getImm()) ==
476 std::numeric_limits<int32_t>::min())
479 case AMDGPU::V_MUL_I32_I24_e32:
480 case AMDGPU::V_MUL_I32_I24_e64:
481 case AMDGPU::V_MUL_U32_U24_e32:
482 case AMDGPU::V_MUL_U32_U24_e64:
483 if (OldOpnd->
getImm() == 1)
486 case AMDGPU::V_MIN_F32_e32:
487 case AMDGPU::V_MIN_F32_e64:
491 case AMDGPU::V_MAX_F32_e32:
492 case AMDGPU::V_MAX_F32_e64:
496 case AMDGPU::V_MIN_F64_e64:
497 case AMDGPU::V_MIN_NUM_F64_e64:
498 if (
static_cast<uint64_t>(OldOpnd->
getImm()) == 0x7FF0000000000000)
501 case AMDGPU::V_MAX_F64_e64:
502 case AMDGPU::V_MAX_NUM_F64_e64:
503 if (
static_cast<uint64_t>(OldOpnd->
getImm()) == 0xFFF0000000000000)
506 case AMDGPU::V_MIN_F16_e32:
507 case AMDGPU::V_MIN_F16_e64:
508 case AMDGPU::V_MIN_F16_t16_e32:
509 case AMDGPU::V_MIN_F16_t16_e64:
510 case AMDGPU::V_MIN_F16_fake16_e32:
511 case AMDGPU::V_MIN_F16_fake16_e64:
515 case AMDGPU::V_MAX_F16_e32:
516 case AMDGPU::V_MAX_F16_e64:
517 case AMDGPU::V_MAX_F16_t16_e32:
518 case AMDGPU::V_MAX_F16_t16_e64:
519 case AMDGPU::V_MAX_F16_fake16_e32:
520 case AMDGPU::V_MAX_F16_fake16_e64:
528MachineInstr *GCNDPPCombine::createDPPInst(
529 MachineInstr &OrigMI, MachineInstr &MovMI,
RegSubRegPair CombOldVGPR,
530 MachineOperand *OldOpndValue,
bool CombBCZ,
bool IsShrinkable)
const {
532 if (!CombBCZ && OldOpndValue && OldOpndValue->
isImm()) {
533 auto *Src1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1);
534 if (!Src1 || !Src1->isReg()) {
535 LLVM_DEBUG(
dbgs() <<
" failed: no src1 or it isn't a register\n");
539 LLVM_DEBUG(
dbgs() <<
" failed: old immediate isn't an identity\n");
543 auto *MovDst =
TII->getNamedOperand(MovMI, AMDGPU::OpName::vdst);
550 return createDPPInst(OrigMI, MovMI, CombOldVGPR, CombBCZ, IsShrinkable);
555bool GCNDPPCombine::hasNoImmOrEqual(MachineInstr &
MI, AMDGPU::OpName OpndName,
556 int64_t
Value, int64_t Mask)
const {
557 auto *
Imm =
TII->getNamedOperand(
MI, OpndName);
562 return (
Imm->getImm() & Mask) ==
Value;
565bool GCNDPPCombine::combineDPPMov(MachineInstr &MovMI)
const {
567 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_dpp ||
568 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO);
571 auto *DstOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::vdst);
572 assert(DstOpnd && DstOpnd->isReg());
573 auto DPPMovReg = DstOpnd->getReg();
574 if (DPPMovReg.isPhysical()) {
584 auto *
DppCtrl =
TII->getNamedOperand(MovMI, AMDGPU::OpName::dpp_ctrl);
586 unsigned DppCtrlVal =
DppCtrl->getImm();
587 if ((MovMI.
getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO ||
588 MovMI.
getOpcode() == AMDGPU::V_MOV_B64_dpp)) {
589 if (!ST->hasFeature(AMDGPU::FeatureDPALU_DPP)) {
590 LLVM_DEBUG(
dbgs() <<
" failed: 64 bit dpp move is unsupported\n");
602 auto *RowMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::row_mask);
603 assert(RowMaskOpnd && RowMaskOpnd->isImm());
604 auto *BankMaskOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::bank_mask);
605 assert(BankMaskOpnd && BankMaskOpnd->isImm());
606 const bool MaskAllLanes = RowMaskOpnd->getImm() == 0xF &&
607 BankMaskOpnd->getImm() == 0xF;
609 auto *BCZOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::bound_ctrl);
610 assert(BCZOpnd && BCZOpnd->isImm());
611 bool BoundCtrlZero = BCZOpnd->getImm();
613 auto *OldOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::old);
614 auto *SrcOpnd =
TII->getNamedOperand(MovMI, AMDGPU::OpName::src0);
616 assert(SrcOpnd && SrcOpnd->isReg());
622 auto *
const OldOpndValue = getOldOpndValue(*OldOpnd);
627 assert(!OldOpndValue || OldOpndValue->
isImm() || OldOpndValue == OldOpnd);
629 bool CombBCZ =
false;
631 if (MaskAllLanes && BoundCtrlZero) {
634 if (!OldOpndValue || !OldOpndValue->
isImm()) {
639 if (OldOpndValue->
getImm() == 0) {
644 }
else if (BoundCtrlZero) {
647 " failed: old!=0 and bctrl:0 and not all lanes isn't combinable\n");
656 dbgs() << *OldOpndValue;
657 dbgs() <<
", bound_ctrl=" << CombBCZ <<
'\n');
659 SmallVector<MachineInstr*, 4> OrigMIs, DPPMIs;
660 DenseMap<MachineInstr*, SmallVector<unsigned, 4>> RegSeqWithOpNos;
663 if (CombBCZ && OldOpndValue) {
668 TII->get(AMDGPU::IMPLICIT_DEF), CombOldVGPR.
Reg);
669 DPPMIs.push_back(UndefInst.getInstr());
672 OrigMIs.push_back(&MovMI);
673 bool Rollback =
true;
677 while (!
Uses.empty()) {
678 MachineOperand *
Use =
Uses.pop_back_val();
681 auto &OrigMI = *
Use->getParent();
686 "There should not be e32 True16 instructions pre-RA");
687 if (OrigOp == AMDGPU::REG_SEQUENCE) {
689 unsigned FwdSubReg = 0;
698 for (OpNo = 1; OpNo <
E; OpNo += 2) {
709 if (
Op.getSubReg() == FwdSubReg)
712 RegSeqWithOpNos[&OrigMI].push_back(OpNo);
716 bool IsShrinkable = isShrinkable(OrigMI);
717 if (!(IsShrinkable ||
718 ((
TII->isVOP3P(OrigOp) ||
TII->isVOPC(OrigOp) ||
719 TII->isVOP3(OrigOp)) &&
721 TII->isVOP1(OrigOp) ||
TII->isVOP2(OrigOp))) {
730 auto *Src0 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src0);
731 auto *Src1 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1);
732 if (Use != Src0 && !(Use == Src1 && OrigMI.
isCommutable())) {
737 auto *Src2 =
TII->getNamedOperand(OrigMI, AMDGPU::OpName::src2);
738 assert(Src0 &&
"Src1 without Src0?");
739 if ((Use == Src0 && ((Src1 && Src1->isIdenticalTo(*Src0)) ||
740 (Src2 && Src2->isIdenticalTo(*Src0)))) ||
741 (Use == Src1 && (Src1->isIdenticalTo(*Src0) ||
742 (Src2 && Src2->isIdenticalTo(*Src1))))) {
746 <<
" failed: DPP register is used more than once per instruction\n");
750 if (!ST->hasFeature(AMDGPU::FeatureDPALU_DPP) &&
753 <<
" failed: DPP ALU DPP is not supported\n");
760 <<
" failed: not valid 64-bit DPP control value\n");
766 if (
auto *DPPInst = createDPPInst(OrigMI, MovMI, CombOldVGPR,
767 OldOpndValue, CombBCZ, IsShrinkable)) {
768 DPPMIs.push_back(DPPInst);
774 auto *NewMI = BB->
getParent()->CloneMachineInstr(&OrigMI);
775 BB->
insert(OrigMI, NewMI);
776 if (
TII->commuteInstruction(*NewMI)) {
779 createDPPInst(*NewMI, MovMI, CombOldVGPR, OldOpndValue, CombBCZ,
781 DPPMIs.push_back(DPPInst);
786 NewMI->eraseFromParent();
790 OrigMIs.push_back(&OrigMI);
793 Rollback |= !
Uses.empty();
795 for (
auto *
MI : *(Rollback? &DPPMIs : &OrigMIs))
796 MI->eraseFromParent();
799 for (
auto &S : RegSeqWithOpNos) {
801 S.first->eraseFromParent();
804 while (!S.second.empty())
805 S.first->getOperand(S.second.pop_back_val()).setIsUndef();
812bool GCNDPPCombineLegacy::runOnMachineFunction(MachineFunction &MF) {
816 return GCNDPPCombine().run(MF);
819bool GCNDPPCombine::run(MachineFunction &MF) {
828 for (
auto &
MBB : MF) {
830 if (
MI.getOpcode() == AMDGPU::V_MOV_B32_dpp && combineDPPMov(
MI)) {
832 ++NumDPPMovsCombined;
833 }
else if (
MI.getOpcode() == AMDGPU::V_MOV_B64_DPP_PSEUDO ||
834 MI.getOpcode() == AMDGPU::V_MOV_B64_dpp) {
835 if (ST->hasDPALU_DPP() && combineDPPMov(
MI)) {
837 ++NumDPPMovsCombined;
841 if (M && combineDPPMov(*M))
842 ++NumDPPMovsCombined;
859 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)
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
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.
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
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
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.
MCRegisterClass TargetRegisterClass
A pair composed of a register and a sub-register index.