1 //===-------------- llvm/CodeGen/ProcessImplicitDefs.h ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_CODEGEN_PROCESSIMPLICITDEFS_H
12 #define LLVM_CODEGEN_PROCESSIMPLICITDEFS_H
14 #include "llvm/CodeGen/MachineFunctionPass.h"
15 #include "llvm/ADT/SmallSet.h"
20 class TargetInstrInfo;
21 class TargetRegisterInfo;
22 class MachineRegisterInfo;
25 /// Process IMPLICIT_DEF instructions and make sure there is one implicit_def
26 /// for each use. Add isUndef marker to implicit_def defs and their uses.
27 class ProcessImplicitDefs : public MachineFunctionPass {
28 const TargetInstrInfo *TII;
29 const TargetRegisterInfo *TRI;
30 MachineRegisterInfo *MRI;
33 bool CanTurnIntoImplicitDef(MachineInstr *MI, unsigned Reg,
35 SmallSet<unsigned, 8> &ImpDefRegs);
40 ProcessImplicitDefs() : MachineFunctionPass(ID) {
41 initializeProcessImplicitDefsPass(*PassRegistry::getPassRegistry());
44 virtual void getAnalysisUsage(AnalysisUsage &au) const;
46 virtual bool runOnMachineFunction(MachineFunction &fn);
51 #endif // LLVM_CODEGEN_PROCESSIMPLICITDEFS_H