29#include "llvm/IR/IntrinsicsAMDGPU.h"
32#define GET_GICOMBINER_DEPS
33#include "AMDGPUGenPreLegalizeGICombiner.inc"
34#undef GET_GICOMBINER_DEPS
36#define DEBUG_TYPE "amdgpu-regbank-combiner"
42#define GET_GICOMBINER_TYPES
43#include "AMDGPUGenRegBankGICombiner.inc"
44#undef GET_GICOMBINER_TYPES
46class AMDGPURegBankCombinerImpl :
public Combiner {
48 const AMDGPURegBankCombinerImplRuleConfig &RuleConfig;
56 AMDGPURegBankCombinerImpl(
59 const AMDGPURegBankCombinerImplRuleConfig &RuleConfig,
63 static const char *
getName() {
return "AMDGPURegBankCombinerImpl"; }
71 unsigned Min, Max, Med;
74 struct Med3MatchInfo {
79 struct MinMaxToMinMax3MatchInfo {
84 MinMaxMedOpc getMinMaxPair(
unsigned Opc)
const;
86 template <
class m_Cst,
typename CstTy>
88 Register &Val, CstTy &K0, CstTy &K1)
const;
90 bool matchIntMinMaxToMed3(
MachineInstr &
MI, Med3MatchInfo &MatchInfo)
const;
91 bool matchFPMinMaxToMed3(
MachineInstr &
MI, Med3MatchInfo &MatchInfo)
const;
105 MinMaxToMinMax3MatchInfo &MatchInfo)
const;
107 MinMaxToMinMax3MatchInfo &MatchInfo)
const;
114 bool getIEEE()
const;
115 bool getDX10Clamp()
const;
122#define GET_GICOMBINER_CLASS_MEMBERS
123#define AMDGPUSubtarget GCNSubtarget
124#include "AMDGPUGenRegBankGICombiner.inc"
125#undef GET_GICOMBINER_CLASS_MEMBERS
126#undef AMDGPUSubtarget
129#define GET_GICOMBINER_IMPL
130#define AMDGPUSubtarget GCNSubtarget
131#include "AMDGPUGenRegBankGICombiner.inc"
132#undef AMDGPUSubtarget
133#undef GET_GICOMBINER_IMPL
135AMDGPURegBankCombinerImpl::AMDGPURegBankCombinerImpl(
138 const AMDGPURegBankCombinerImplRuleConfig &RuleConfig,
140 :
Combiner(MF, CInfo, &VT, CSEInfo), RuleConfig(RuleConfig), STI(STI),
141 RBI(*STI.getRegBankInfo()),
TRI(*STI.getRegisterInfo()),
142 TII(*STI.getInstrInfo()),
143 Helper(Observer,
B,
false, &VT, MDT, LI),
145#include
"AMDGPUGenRegBankGICombiner.inc"
150bool AMDGPURegBankCombinerImpl::isVgprRegBank(
Register Reg)
const {
155 if (isVgprRegBank(
Reg))
161 if (
Use.getOpcode() == AMDGPU::COPY && isVgprRegBank(Def))
171AMDGPURegBankCombinerImpl::MinMaxMedOpc
172AMDGPURegBankCombinerImpl::getMinMaxPair(
unsigned Opc)
const {
178 return {AMDGPU::G_SMIN, AMDGPU::G_SMAX, AMDGPU::G_AMDGPU_SMED3};
181 return {AMDGPU::G_UMIN, AMDGPU::G_UMAX, AMDGPU::G_AMDGPU_UMED3};
182 case AMDGPU::G_FMAXNUM:
183 case AMDGPU::G_FMINNUM:
184 return {AMDGPU::G_FMINNUM, AMDGPU::G_FMAXNUM, AMDGPU::G_AMDGPU_FMED3};
185 case AMDGPU::G_FMAXNUM_IEEE:
186 case AMDGPU::G_FMINNUM_IEEE:
187 return {AMDGPU::G_FMINNUM_IEEE, AMDGPU::G_FMAXNUM_IEEE,
188 AMDGPU::G_AMDGPU_FMED3};
192template <
class m_Cst,
typename CstTy>
193bool AMDGPURegBankCombinerImpl::matchMed(MachineInstr &
MI,
194 MachineRegisterInfo &
MRI,
196 CstTy &K0, CstTy &K1)
const {
214bool AMDGPURegBankCombinerImpl::matchIntMinMaxToMed3(
215 MachineInstr &
MI, Med3MatchInfo &MatchInfo)
const {
217 if (!isVgprRegBank(Dst))
225 MinMaxMedOpc OpcodeTriple = getMinMaxPair(
MI.getOpcode());
227 std::optional<ValueAndVReg> K0, K1;
229 if (!matchMed<GCstAndRegMatch>(
MI,
MRI, OpcodeTriple, Val, K0, K1))
232 if (OpcodeTriple.Med == AMDGPU::G_AMDGPU_SMED3 && K0->Value.sgt(K1->Value))
234 if (OpcodeTriple.Med == AMDGPU::G_AMDGPU_UMED3 && K0->Value.ugt(K1->Value))
237 MatchInfo = {OpcodeTriple.Med, Val, K0->VReg, K1->VReg};
259bool AMDGPURegBankCombinerImpl::matchFPMinMaxToMed3(
260 MachineInstr &
MI, Med3MatchInfo &MatchInfo)
const {
263 if (!isVgprRegBank(Dst))
272 auto OpcodeTriple = getMinMaxPair(
MI.getOpcode());
275 std::optional<FPValueAndVReg> K0, K1;
277 if (!matchMed<GFCstAndRegMatch>(
MI,
MRI, OpcodeTriple, Val, K0, K1))
280 if (K0->Value > K1->Value)
290 if ((getIEEE() && isFminnumLike(
MI)) || VT->isKnownNeverNaN(Dst)) {
294 MatchInfo = {OpcodeTriple.Med, Val, K0->VReg, K1->VReg};
302bool AMDGPURegBankCombinerImpl::matchFPMinMaxToClamp(MachineInstr &
MI,
305 if (!isVgprRegBank(
MI.getOperand(0).getReg()))
309 auto OpcodeTriple = getMinMaxPair(
MI.getOpcode());
311 std::optional<FPValueAndVReg> K0, K1;
313 if (!matchMed<GFCstOrSplatGFCstMatch>(
MI,
MRI, OpcodeTriple, Val, K0, K1))
316 if (!K0->Value.isPosZero() || !K1->Value.isOne())
323 if ((getIEEE() && getDX10Clamp() && isFminnumLike(
MI) &&
324 VT->isKnownNeverSNaN(Val)) ||
325 VT->isKnownNeverNaN(
MI.getOperand(0).getReg())) {
342bool AMDGPURegBankCombinerImpl::matchFPMed3ToClamp(MachineInstr &
MI,
345 if (!isVgprRegBank(
MI.getOperand(0).getReg()))
354 if (isFCst(Src0) && !isFCst(Src1))
356 if (isFCst(Src1) && !isFCst(Src2))
358 if (isFCst(Src0) && !isFCst(Src1))
365 auto isOp3Zero = [&]() {
367 if (Op3->
getOpcode() == TargetOpcode::G_FCONSTANT)
375 if (VT->isKnownNeverNaN(
MI.getOperand(0).getReg()) ||
376 (getIEEE() && getDX10Clamp() &&
377 (VT->isKnownNeverSNaN(Val) || isOp3Zero()))) {
385void AMDGPURegBankCombinerImpl::applyClamp(MachineInstr &
MI,
387 B.buildInstr(AMDGPU::G_AMDGPU_CLAMP, {
MI.getOperand(0)}, {
Reg},
389 MI.eraseFromParent();
392void AMDGPURegBankCombinerImpl::applyMed3(MachineInstr &
MI,
393 Med3MatchInfo &MatchInfo)
const {
394 B.buildInstr(MatchInfo.Opc, {MI.getOperand(0)},
395 {getAsVgpr(MatchInfo.Val0), getAsVgpr(MatchInfo.Val1),
396 getAsVgpr(MatchInfo.Val2)},
398 MI.eraseFromParent();
401void AMDGPURegBankCombinerImpl::applyCanonicalizeZextShiftAmt(
402 MachineInstr &
MI, MachineInstr &Ext)
const {
403 unsigned ShOpc =
MI.getOpcode();
404 assert(ShOpc == AMDGPU::G_SHL || ShOpc == AMDGPU::G_LSHR ||
405 ShOpc == AMDGPU::G_ASHR);
417 auto NewExt =
B.buildAnyExt(ExtAmtTy, AmtReg);
418 auto Mask =
B.buildConstant(
420 auto And =
B.buildAnd(ExtAmtTy, NewExt, Mask);
421 B.buildInstr(ShOpc, {ShDst}, {ShSrc,
And});
426 MI.eraseFromParent();
429bool AMDGPURegBankCombinerImpl::combineD16Load(MachineInstr &
MI)
const {
434 const MachineMemOperand *MMO;
435 const int64_t CleanLo16 = 0xFFFFFFFFFFFF0000;
436 const int64_t CleanHi16 = 0x000000000000FFFF;
438 auto TryApplyD16Load = [&](
unsigned D16Opc, GAnyLoad *SmallLoad) {
445 MachineInstr *InsertPt = SmallLoad;
446 if (SmallLoad->isSimple() && isObviouslySafeToFold(*SmallLoad,
MI))
448 else if (!Helper.
dominates(*DstDef, *SmallLoad))
451 applyD16Load(D16Opc,
MI, SmallLoad, Dst, *InsertPt);
463 return TryApplyD16Load(AMDGPU::G_AMDGPU_LOAD_D16_LO_U8, ZextLoad);
465 return TryApplyD16Load(AMDGPU::G_AMDGPU_LOAD_D16_LO, ZextLoad);
481 return TryApplyD16Load(AMDGPU::G_AMDGPU_LOAD_D16_LO_I8, SextLoad);
496 return TryApplyD16Load(AMDGPU::G_AMDGPU_LOAD_D16_HI_U8, ZextLoad);
498 return TryApplyD16Load(AMDGPU::G_AMDGPU_LOAD_D16_HI, ZextLoad);
513 return TryApplyD16Load(AMDGPU::G_AMDGPU_LOAD_D16_HI_I8, SextLoad);
522void AMDGPURegBankCombinerImpl::applyMinMaxToMinMax3(
523 MachineInstr &
MI, MinMaxToMinMax3MatchInfo &MatchInfo)
const {
524 B.buildInstr(MatchInfo.Opc, {MI.getOperand(0)},
525 {MatchInfo.Val0, MatchInfo.Val1, MatchInfo.Val2},
MI.getFlags());
526 MI.eraseFromParent();
530bool AMDGPURegBankCombinerImpl::matchCombine_mul24(MachineInstr &
MI)
const {
536 if (STI.
hasMulU24() && VT->getKnownBits(Src0).countMinLeadingZeros() >= 8 &&
537 VT->getKnownBits(Src1).countMinLeadingZeros() >= 8)
539 return STI.
hasMulI24() && VT->computeNumSignBits(Src0) >= 9 &&
540 VT->computeNumSignBits(Src1) >= 9;
543void AMDGPURegBankCombinerImpl::applyCombine_mul24(MachineInstr &
MI)
const {
548 (STI.
hasMulU24() && VT->getKnownBits(Src0).countMinLeadingZeros() >= 8 &&
549 VT->getKnownBits(Src1).countMinLeadingZeros() >= 8)
550 ? Intrinsic::amdgcn_mul_u24
551 : Intrinsic::amdgcn_mul_i24;
553 MI.eraseFromParent();
558bool AMDGPURegBankCombinerImpl::matchMinMaxToMinMax3(
559 MachineInstr &
MI, MinMaxToMinMax3MatchInfo &MatchInfo)
const {
564 if (!(isVgprRegBank(Dst) && isVgprRegBank(Src1) && isVgprRegBank(Src2))) {
569 unsigned Opc =
MI.getOpcode();
582 unsigned AMDGPUOpc = 0;
585 AMDGPUOpc = AMDGPU::G_AMDGPU_SMAX3;
588 AMDGPUOpc = AMDGPU::G_AMDGPU_SMIN3;
591 AMDGPUOpc = AMDGPU::G_AMDGPU_UMAX3;
594 AMDGPUOpc = AMDGPU::G_AMDGPU_UMIN3;
596 case AMDGPU::G_FMAXNUM:
597 case AMDGPU::G_FMAXNUM_IEEE:
598 case AMDGPU::G_FMAXIMUMNUM:
599 AMDGPUOpc = AMDGPU::G_AMDGPU_FMAX3;
601 case AMDGPU::G_FMINNUM:
602 case AMDGPU::G_FMINNUM_IEEE:
603 case AMDGPU::G_FMINIMUMNUM:
604 AMDGPUOpc = AMDGPU::G_AMDGPU_FMIN3;
606 case AMDGPU::G_FMAXIMUM:
607 AMDGPUOpc = AMDGPU::G_AMDGPU_FMAXIMUM3;
609 case AMDGPU::G_FMINIMUM:
610 AMDGPUOpc = AMDGPU::G_AMDGPU_FMINIMUM3;
616 MatchInfo = {AMDGPUOpc, R0, R1,
R2};
620void AMDGPURegBankCombinerImpl::applyD16Load(
unsigned D16Opc,
622 MachineInstr *SmallLoad,
624 MachineInstr &InsertPt)
const {
626 LLT SrcTy =
MRI.
getType(SrcReg32ToOverwriteD16);
634 B.setInstrAndDebugLoc(InsertPt);
636 B.buildInstr(D16Opc, {D16Dst},
640 if (D16Dst != DstReg)
641 B.buildBitcast(DstReg, D16Dst);
651SIModeRegisterDefaults AMDGPURegBankCombinerImpl::getMode()
const {
652 return MF.getInfo<SIMachineFunctionInfo>()->getMode();
655bool AMDGPURegBankCombinerImpl::getIEEE()
const {
return getMode().IEEE; }
657bool AMDGPURegBankCombinerImpl::getDX10Clamp()
const {
658 return getMode().DX10Clamp;
661bool AMDGPURegBankCombinerImpl::isFminnumIeee(
const MachineInstr &
MI)
const {
662 return MI.getOpcode() == AMDGPU::G_FMINNUM_IEEE;
665bool AMDGPURegBankCombinerImpl::isFminnum(
const MachineInstr &
MI)
const {
666 return MI.getOpcode() == AMDGPU::G_FMINNUM;
669bool AMDGPURegBankCombinerImpl::isFminnumLike(
const MachineInstr &
MI)
const {
670 return isFminnumIeee(
MI) || isFminnum(
MI);
673bool AMDGPURegBankCombinerImpl::isFCst(MachineInstr *
MI)
const {
674 return MI->getOpcode() == AMDGPU::G_FCONSTANT;
677bool AMDGPURegBankCombinerImpl::isClampZeroToOne(MachineInstr *K0,
678 MachineInstr *K1)
const {
679 if (isFCst(K0) && isFCst(K1)) {
689 function_ref<GISelValueTracking *()> GetVT,
690 function_ref<MachineDominatorTree *()> GetMDT,
692 AMDGPURegBankCombinerImplRuleConfig RuleConfig;
693 if (!RuleConfig.parseCommandLineOption())
701 const auto *LI =
ST.getLegalizerInfo();
703 CombinerInfo CInfo(
false,
true,
704 LI, EnableOpt,
F.hasOptSize(),
F.hasMinSize());
706 CInfo.MaxIterations = 1;
707 CInfo.ObserverLvl = CombinerInfo::ObserverLevel::SinglePass;
710 CInfo.EnableFullDCE =
false;
712 GISelValueTracking *VT = GetVT();
713 MachineDominatorTree *MDT = GetMDT();
714 AMDGPURegBankCombinerImpl Impl(MF, CInfo, *VT,
nullptr,
715 RuleConfig, ST, MDT, LI);
716 return Impl.combineMachineInstrs();
722class AMDGPURegBankCombinerLegacy :
public MachineFunctionPass {
726 AMDGPURegBankCombinerLegacy(
bool IsOptLevelNone =
false)
727 : MachineFunctionPass(
ID), IsOptLevelNone(IsOptLevelNone) {}
729 StringRef getPassName()
const override {
return "AMDGPURegBankCombiner"; }
733 void getAnalysisUsage(AnalysisUsage &AU)
const override;
740void AMDGPURegBankCombinerLegacy::getAnalysisUsage(AnalysisUsage &AU)
const {
743 AU.
addRequired<GISelValueTrackingAnalysisLegacy>();
745 if (!IsOptLevelNone) {
751bool AMDGPURegBankCombinerLegacy::runOnMachineFunction(
MachineFunction &MF) {
759 return &getAnalysis<GISelValueTrackingAnalysisLegacy>().get(MF);
761 [&]() -> MachineDominatorTree * {
762 return IsOptLevelNone ? nullptr
763 : &getAnalysis<MachineDominatorTreeWrapperPass>()
769char AMDGPURegBankCombinerLegacy::ID = 0;
771 "Combine AMDGPU machine instrs after regbankselect",
775 "Combine AMDGPU machine instrs after regbankselect",
false,
779 return new AMDGPURegBankCombinerLegacy(IsOptLevelNone);
783 : IsOptLevelNone(IsOptLevelNone) {}
795 return IsOptLevelNone
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define GET_GICOMBINER_CONSTRUCTOR_INITS
This file declares the targeting of the Machinelegalizer class for AMDGPU.
This file declares the targeting of the RegisterBankInfo class for AMDGPU.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This contains common combine transformations that may be used in a combine pass,or by the target else...
Option class for Targets to specify which operations are combined how and when.
This contains the base class for all Combiners generated by TableGen.
AMD GCN specific subclass of TargetSubtarget.
Provides analysis for querying information about KnownBits during GISel passes.
const HexagonInstrInfo * TII
Contains matchers for matching SSA Machine Instructions.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
static StringRef getName(Value *V)
MachineRegisterInfo & MRI
static bool isClampZeroToOne(SDValue A, SDValue B)
Target-Independent Code Generator Pass Configuration Options pass.
AMDGPURegBankCombinerPass(bool IsOptLevelNone=false)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
AnalysisUsage & addRequired()
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.
LLVM_ABI bool dominates(const MachineInstr &DefMI, const MachineInstr &UseMI) const
Returns true if DefMI dominates UseMI.
bool isPosZero() const
Return true if the value is positive zero.
bool isOne() const
Returns true if this value is exactly +1.0.
FunctionPass class - This class is used to implement most global optimizations.
bool hasMin3Max3_16() const
To use KnownBitsInfo analysis in a pass, KnownBitsInfo &Info = getAnalysis<GISelValueTrackingInfoAnal...
constexpr unsigned getScalarSizeInBits() const
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
static constexpr LLT float16()
Get a 16-bit IEEE half value.
static constexpr LLT fixed_vector(unsigned NumElements, unsigned ScalarSizeInBits)
Get a low-level fixed-width vector of some number of elements and element width.
static LLT integer(unsigned SizeInBits)
TypeSize getValue() const
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
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.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineFunctionProperties & getProperties() const
Get the function properties.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
ArrayRef< MachineMemOperand * > memoperands() const
Access to memory operands of the instruction.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
LocationSize getSizeInBits() const
Return the size in bits of the memory reference.
Register getReg() const
getReg - Returns the register number.
const ConstantFP * getFPImm() const
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
LLVM_ABI bool hasOneNonDBGUse(Register RegNo) const
hasOneNonDBGUse - Return true if there is exactly one non-Debug use of the specified register.
LLVM_ABI LLVM_READONLY MachineInstr * getVRegDef(Register Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
const RegisterBank * getRegBank(Register Reg) const
Return the register bank of Reg.
LLVM_ABI Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
LLT getType(Register Reg) const
Get the low-level type of Reg or LLT{} if Reg is not a generic (target independent) virtual register.
LLVM_ABI void setRegBank(Register Reg, const RegisterBank &RegBank)
Set the register bank to RegBank for Reg.
iterator_range< use_instr_iterator > use_instructions(Register Reg) const
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.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
PreservedAnalyses & preserve()
Mark an analysis as preserved.
Holds all the information related to register banks.
const RegisterBank & getRegBank(unsigned ID)
Get the register bank identified by ID.
unsigned getID() const
Get the identifier of this register bank.
Wrapper class representing virtual and physical registers.
CodeGenOptLevel getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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.
operand_type_match m_Reg()
SpecificConstantMatch m_SpecificICst(const APInt &RequestedValue)
Matches a constant equal to RequestedValue.
UnaryOp_match< SrcTy, TargetOpcode::COPY > m_Copy(SrcTy &&Src)
UnaryOp_match< SrcTy, TargetOpcode::G_ZEXT > m_GZExt(const SrcTy &Src)
LoadOp_match< GZExtLoad, operand_type_match > m_GZExtLoad(GZExtLoad *&Inst)
LoadOp_match< GSExtLoad, operand_type_match > m_GSExtLoad(GSExtLoad *&Inst)
BinaryOp_match< LHS, RHS, TargetOpcode::G_OR, true > m_GOr(const LHS &L, const RHS &R)
CheckType m_SpecificType(LLT Ty)
BinaryOpc_match< LHS, RHS, true > m_CommutativeBinOp(unsigned Opcode, const LHS &L, const RHS &R)
MMORef m_MMO(const MachineMemOperand *&MMO)
bool mi_match(Reg R, const MachineRegisterInfo &MRI, Pattern &&P)
BinaryOp_match< LHS, RHS, TargetOpcode::G_SHL, false > m_GShl(const LHS &L, const RHS &R)
Or< Preds... > m_any_of(Preds &&... preds)
BinaryOp_match< LHS, RHS, TargetOpcode::G_AND, true > m_GAnd(const LHS &L, const RHS &R)
UnaryOp_match< SrcTy, TargetOpcode::G_BITCAST > m_GBitcast(const SrcTy &Src)
bind_ty< MachineInstr * > m_MInstr(MachineInstr *&MI)
And< Preds... > m_all_of(Preds &&... preds)
OneUse_match< SubPat > m_OneUse(const SubPat &SP)
auto m_BinOp()
Match an arbitrary binary operation and ignore it.
NodeAddr< DefNode * > Def
NodeAddr< UseNode * > Use
This is an optimization pass for GlobalISel generic memory operations.
@ Load
The value being inserted comes from a load (InsertElement only).
FunctionPass * createAMDGPURegBankCombinerLegacy(bool IsOptLevelNone)
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI MachineInstr * getDefIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the def instruction for Reg, folding away any trivial copies.
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
@ And
Bitwise or logical AND of integers.
ArrayRef(const T &OneElt) -> ArrayRef< T >
LLVM_ABI void eraseInstr(MachineInstr &MI, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver=nullptr)
constexpr T maskTrailingOnes(unsigned N)
Create a bitmask with the N right-most bits set to 1, and all other bits set to 0.
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
bool shouldSkipOptimizationForOptBisect(IRUnitRef IR)