2001-10-15 17:31:51 +00:00
|
|
|
//===- llvm/Transforms/HoistPHIConstants.h - Normalize PHI nodes -*- C++ -*--=//
|
|
|
|
//
|
|
|
|
// HoistPHIConstants - Remove literal constants that are arguments of PHI nodes
|
|
|
|
// by inserting cast instructions in the preceeding basic blocks, and changing
|
|
|
|
// constant references into references of the casted value.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TRANSFORMS_HOISTPHICONSTANTS_H
|
|
|
|
#define LLVM_TRANSFORMS_HOISTPHICONSTANTS_H
|
|
|
|
|
2001-10-18 20:19:09 +00:00
|
|
|
#include "llvm/Pass.h"
|
2001-10-15 17:31:51 +00:00
|
|
|
|
2002-01-21 07:31:50 +00:00
|
|
|
struct HoistPHIConstants : public MethodPass {
|
2001-10-18 20:19:09 +00:00
|
|
|
// doHoistPHIConstants - Hoist constants out of PHI instructions
|
|
|
|
//
|
2001-10-18 05:22:15 +00:00
|
|
|
static bool doHoistPHIConstants(Method *M);
|
|
|
|
|
2002-01-21 07:31:50 +00:00
|
|
|
virtual bool runOnMethod(Method *M) { return doHoistPHIConstants(M); }
|
2001-10-15 17:31:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|