16 #define DEBUG_TYPE "si-i1-copies"
45 const char *getPassName()
const override {
46 return "SI Lower i1 Copies";
59 "SI Lower i1 Copies",
false,
false)
64 char SILowerI1Copies::
ID = 0;
69 return new SILowerI1Copies();
77 std::vector<unsigned> I1Defs;
84 for (I = MBB.
begin(); I != MBB.
end(); I = Next) {
91 if (RC == &AMDGPU::VReg_1RegClass)
109 if (DstRC == &AMDGPU::VReg_1RegClass &&
111 I1Defs.push_back(Dst.
getReg());
115 if (DefInst->
getOpcode() == AMDGPU::S_MOV_B64) {
117 I1Defs.push_back(Dst.
getReg());
120 assert(Val == 0 || Val == -1);
122 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::V_MOV_B32_e32))
130 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::V_CNDMASK_B32_e64))
137 SrcRC == &AMDGPU::VReg_1RegClass) {
147 for (
unsigned Reg : I1Defs)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
AMDGPU specific subclass of TargetSubtarget.
INITIALIZE_PASS_BEGIN(SILowerI1Copies, DEBUG_TYPE,"SI Lower i1 Copies", false, false) INITIALIZE_PASS_END(SILowerI1Copies
#define DEBUG_TYPE
i1 values are usually inserted by the CFG Structurize pass and they are unique in that they can be co...
static bool isVirtualRegister(unsigned Reg)
isVirtualRegister - Return true if the specified register number is in the virtual register namespace...
const TargetRegisterClass * getCommonSubClass(const TargetRegisterClass *A, const TargetRegisterClass *B) const
getCommonSubClass - find the largest common subclass of A and B.
COPY - Target-independent register copy.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
const TargetRegisterClass * getRegClass(unsigned Reg) const
getRegClass - Return the register class of the specified virtual register.
Reg
All possible values of the reg field in the ModR/M byte.
const MachineInstrBuilder & addImm(int64_t Val) const
addImm - Add a new immediate operand.
FunctionPass * createSILowerI1CopiesPass()
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
IMPLICIT_DEF - This is the MachineInstr-level equivalent of undef.
bundle_iterator< MachineInstr, instr_iterator > iterator
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const MachineOperand & getOperand(unsigned i) const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
BuildMI - Builder interface.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
MachineOperand class - Representation of each machine instruction operand.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
MachineInstr * getUniqueVRegDef(unsigned Reg) const
getUniqueVRegDef - Return the unique machine instr that defines the specified virtual register or nul...
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
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.
Interface definition for SIInstrInfo.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
unsigned getReg() const
getReg - Returns the register number.
virtual const TargetInstrInfo * getInstrInfo() const
const MachineInstrBuilder & addOperand(const MachineOperand &MO) const
BasicBlockListType::iterator iterator
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
void setRegClass(unsigned Reg, const TargetRegisterClass *RC)
setRegClass - Set the register class of the specified virtual register.
void initializeSILowerI1CopiesPass(PassRegistry &)
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...