2009-11-03 23:52:08 +00:00
|
|
|
//===-------------- llvm/CodeGen/ProcessImplicitDefs.h ----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_PROCESSIMPLICITDEFS_H
|
|
|
|
#define LLVM_CODEGEN_PROCESSIMPLICITDEFS_H
|
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
2010-07-14 01:22:19 +00:00
|
|
|
#include "llvm/ADT/SmallSet.h"
|
2009-11-03 23:52:08 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class MachineInstr;
|
|
|
|
class TargetInstrInfo;
|
|
|
|
|
|
|
|
/// Process IMPLICIT_DEF instructions and make sure there is one implicit_def
|
|
|
|
/// for each use. Add isUndef marker to implicit_def defs and their uses.
|
|
|
|
class ProcessImplicitDefs : public MachineFunctionPass {
|
|
|
|
private:
|
|
|
|
|
|
|
|
bool CanTurnIntoImplicitDef(MachineInstr *MI, unsigned Reg,
|
2010-07-14 01:22:19 +00:00
|
|
|
unsigned OpIdx, const TargetInstrInfo *tii_,
|
|
|
|
SmallSet<unsigned, 8> &ImpDefRegs);
|
2009-11-03 23:52:08 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
static char ID;
|
|
|
|
|
2010-10-19 17:21:58 +00:00
|
|
|
ProcessImplicitDefs() : MachineFunctionPass(ID) {
|
|
|
|
initializeProcessImplicitDefsPass(*PassRegistry::getPassRegistry());
|
|
|
|
}
|
2009-11-03 23:52:08 +00:00
|
|
|
|
|
|
|
virtual void getAnalysisUsage(AnalysisUsage &au) const;
|
|
|
|
|
|
|
|
virtual bool runOnMachineFunction(MachineFunction &fn);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // LLVM_CODEGEN_PROCESSIMPLICITDEFS_H
|