45 return "NVPTX Proxy Register Instruction Erasure";
55char NVPTXProxyRegErasure::ID = 0;
58 "NVPTX ProxyReg Erasure",
false,
false)
69 switch (
MI.getOpcode()) {
70 case NVPTX::ProxyRegI1:
71 case NVPTX::ProxyRegI16:
72 case NVPTX::ProxyRegI32:
73 case NVPTX::ProxyRegI64:
74 case NVPTX::ProxyRegF32:
75 case NVPTX::ProxyRegF64: {
76 auto &InOp = *
MI.uses().begin();
77 auto &OutOp = *
MI.defs().begin();
78 assert(InOp.isReg() &&
"ProxyReg input should be a register.");
79 assert(OutOp.isReg() &&
"ProxyReg output should be a register.");
81 RAUWBatch.
try_emplace(OutOp.getReg(), InOp.getReg());
89 if (RemoveList.
empty())
93 for (
auto *
MI : RemoveList) {
94 MI->eraseFromParent();
100 for (
auto &
Op :
MI.uses()) {
103 auto it = RAUWBatch.
find(
Op.getReg());
104 if (it != RAUWBatch.
end())
105 Op.setReg(it->second);
114 return new NVPTXProxyRegErasure();
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represent the analysis usage information of a pass.
This class represents an Operation in the Expression.
iterator find(const_arg_type_t< KeyT > Val)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&... Args)
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.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
MachineFunctionPass * createNVPTXProxyRegErasurePass()
void initializeNVPTXProxyRegErasurePass(PassRegistry &)