mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 16:56:39 +00:00
s/Method/Function
Remove extraneous #includes of llvm/Assembly/Writer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2178 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4d669b510c
commit
237e6d10f2
@ -21,8 +21,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
|
|
||||||
//#define DEBUG_EXPR_CONVERT 1
|
//#define DEBUG_EXPR_CONVERT 1
|
||||||
|
|
||||||
static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
|
static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
|
||||||
|
@ -22,13 +22,12 @@
|
|||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
|
#include "llvm/Type.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
|
|
||||||
// RemapInstruction - Convert the instruction operands from referencing the
|
// RemapInstruction - Convert the instruction operands from referencing the
|
||||||
// current values into those specified by ValueMap.
|
// current values into those specified by ValueMap.
|
||||||
//
|
//
|
||||||
|
@ -35,9 +35,7 @@ using std::vector;
|
|||||||
// To enable debugging, uncomment this...
|
// To enable debugging, uncomment this...
|
||||||
//#define DEBUG_MST(x) x
|
//#define DEBUG_MST(x) x
|
||||||
|
|
||||||
#ifdef DEBUG_MST
|
#ifndef DEBUG_MST
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
#else
|
|
||||||
#define DEBUG_MST(x) // Disable debug code
|
#define DEBUG_MST(x) // Disable debug code
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -17,8 +17,6 @@ using std::vector;
|
|||||||
using std::set;
|
using std::set;
|
||||||
using std::pair;
|
using std::pair;
|
||||||
|
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class SimpleStructMutation : public MutateStructTypes {
|
class SimpleStructMutation : public MutateStructTypes {
|
||||||
public:
|
public:
|
||||||
|
@ -22,7 +22,7 @@ using std::vector;
|
|||||||
//This is determined from cond (1-6)
|
//This is determined from cond (1-6)
|
||||||
void getEdgeCode::getCode(Instruction *rInst,
|
void getEdgeCode::getCode(Instruction *rInst,
|
||||||
Instruction *countInst,
|
Instruction *countInst,
|
||||||
Method *M,
|
Function *M,
|
||||||
BasicBlock *BB){
|
BasicBlock *BB){
|
||||||
|
|
||||||
BasicBlock::InstListType& instList=BB->getInstList();
|
BasicBlock::InstListType& instList=BB->getInstList();
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
|
|
||||||
//#define DEBUG_PEEPHOLE_INSTS 1
|
//#define DEBUG_PEEPHOLE_INSTS 1
|
||||||
|
|
||||||
#ifdef DEBUG_PEEPHOLE_INSTS
|
#ifdef DEBUG_PEEPHOLE_INSTS
|
||||||
@ -419,7 +417,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
|
|||||||
|
|
||||||
static bool DoRaisePass(Function *F) {
|
static bool DoRaisePass(Function *F) {
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
for (Method::iterator MI = F->begin(), ME = F->end(); MI != ME; ++MI) {
|
for (Function::iterator MI = F->begin(), ME = F->end(); MI != ME; ++MI) {
|
||||||
BasicBlock *BB = *MI;
|
BasicBlock *BB = *MI;
|
||||||
BasicBlock::InstListType &BIL = BB->getInstList();
|
BasicBlock::InstListType &BIL = BB->getInstList();
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ using std::cerr;
|
|||||||
// It's public interface consists of a constructor and a doADCE() method.
|
// It's public interface consists of a constructor and a doADCE() method.
|
||||||
//
|
//
|
||||||
class ADCE {
|
class ADCE {
|
||||||
Method *M; // The method that we are working on...
|
Function *M; // The method that we are working on...
|
||||||
std::vector<Instruction*> WorkList; // Instructions that just became live
|
std::vector<Instruction*> WorkList; // Instructions that just became live
|
||||||
std::set<Instruction*> LiveSet; // The set of live instructions
|
std::set<Instruction*> LiveSet; // The set of live instructions
|
||||||
bool MadeChanges;
|
bool MadeChanges;
|
||||||
@ -39,7 +39,7 @@ class ADCE {
|
|||||||
//
|
//
|
||||||
public:
|
public:
|
||||||
// ADCE Ctor - Save the method to operate on...
|
// ADCE Ctor - Save the method to operate on...
|
||||||
inline ADCE(Method *m) : M(m), MadeChanges(false) {}
|
inline ADCE(Function *m) : M(m), MadeChanges(false) {}
|
||||||
|
|
||||||
// doADCE() - Run the Agressive Dead Code Elimination algorithm, returning
|
// doADCE() - Run the Agressive Dead Code Elimination algorithm, returning
|
||||||
// true if the method was modified.
|
// true if the method was modified.
|
||||||
@ -79,7 +79,7 @@ private:
|
|||||||
//
|
//
|
||||||
bool ADCE::doADCE(cfg::DominanceFrontier &CDG) {
|
bool ADCE::doADCE(cfg::DominanceFrontier &CDG) {
|
||||||
#ifdef DEBUG_ADCE
|
#ifdef DEBUG_ADCE
|
||||||
cerr << "Method: " << M;
|
cerr << "Function: " << M;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Iterate over all of the instructions in the method, eliminating trivially
|
// Iterate over all of the instructions in the method, eliminating trivially
|
||||||
@ -88,8 +88,8 @@ bool ADCE::doADCE(cfg::DominanceFrontier &CDG) {
|
|||||||
// instructions live in basic blocks that are unreachable. These blocks will
|
// instructions live in basic blocks that are unreachable. These blocks will
|
||||||
// be eliminated later, along with the instructions inside.
|
// be eliminated later, along with the instructions inside.
|
||||||
//
|
//
|
||||||
for (df_iterator<Method*> BBI = df_begin(M),
|
for (df_iterator<Function*> BBI = df_begin(M),
|
||||||
BBE = df_end(M);
|
BBE = df_end(M);
|
||||||
BBI != BBE; ++BBI) {
|
BBI != BBE; ++BBI) {
|
||||||
BasicBlock *BB = *BBI;
|
BasicBlock *BB = *BBI;
|
||||||
for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
|
for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
|
||||||
@ -156,8 +156,8 @@ bool ADCE::doADCE(cfg::DominanceFrontier &CDG) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_ADCE
|
#ifdef DEBUG_ADCE
|
||||||
cerr << "Current Method: X = Live\n";
|
cerr << "Current Function: X = Live\n";
|
||||||
for (Method::iterator I = M->begin(), E = M->end(); I != E; ++I)
|
for (Function::iterator I = M->begin(), E = M->end(); I != E; ++I)
|
||||||
for (BasicBlock::iterator BI = (*I)->begin(), BE = (*I)->end();
|
for (BasicBlock::iterator BI = (*I)->begin(), BE = (*I)->end();
|
||||||
BI != BE; ++BI) {
|
BI != BE; ++BI) {
|
||||||
if (LiveSet.count(*BI)) cerr << "X ";
|
if (LiveSet.count(*BI)) cerr << "X ";
|
||||||
@ -192,7 +192,7 @@ bool ADCE::doADCE(cfg::DominanceFrontier &CDG) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// We need to move the new entry block to be the first bb of the method.
|
// We need to move the new entry block to be the first bb of the method.
|
||||||
Method::iterator EBI = find(M->begin(), M->end(), EntryBlock);
|
Function::iterator EBI = find(M->begin(), M->end(), EntryBlock);
|
||||||
std::swap(*EBI, *M->begin());// Exchange old location with start of method
|
std::swap(*EBI, *M->begin());// Exchange old location with start of method
|
||||||
MadeChanges = true;
|
MadeChanges = true;
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ bool ADCE::doADCE(cfg::DominanceFrontier &CDG) {
|
|||||||
// Now go through and tell dead blocks to drop all of their references so they
|
// Now go through and tell dead blocks to drop all of their references so they
|
||||||
// can be safely deleted.
|
// can be safely deleted.
|
||||||
//
|
//
|
||||||
for (Method::iterator BI = M->begin(), BE = M->end(); BI != BE; ++BI) {
|
for (Function::iterator BI = M->begin(), BE = M->end(); BI != BE; ++BI) {
|
||||||
BasicBlock *BB = *BI;
|
BasicBlock *BB = *BI;
|
||||||
if (!AliveBlocks.count(BB)) {
|
if (!AliveBlocks.count(BB)) {
|
||||||
BB->dropAllReferences();
|
BB->dropAllReferences();
|
||||||
@ -212,7 +212,7 @@ bool ADCE::doADCE(cfg::DominanceFrontier &CDG) {
|
|||||||
// now because we know that there are no references to dead blocks (because
|
// now because we know that there are no references to dead blocks (because
|
||||||
// they have dropped all of their references...
|
// they have dropped all of their references...
|
||||||
//
|
//
|
||||||
for (Method::iterator BI = M->begin(); BI != M->end();) {
|
for (Function::iterator BI = M->begin(); BI != M->end();) {
|
||||||
if (!AliveBlocks.count(*BI)) {
|
if (!AliveBlocks.count(*BI)) {
|
||||||
delete M->getBasicBlocks().remove(BI);
|
delete M->getBasicBlocks().remove(BI);
|
||||||
MadeChanges = true;
|
MadeChanges = true;
|
||||||
@ -292,7 +292,7 @@ namespace {
|
|||||||
struct AgressiveDCE : public MethodPass {
|
struct AgressiveDCE : public MethodPass {
|
||||||
// doADCE - Execute the Agressive Dead Code Elimination Algorithm
|
// doADCE - Execute the Agressive Dead Code Elimination Algorithm
|
||||||
//
|
//
|
||||||
virtual bool runOnMethod(Method *M) {
|
virtual bool runOnMethod(Function *M) {
|
||||||
return ADCE(M).doADCE(
|
return ADCE(M).doADCE(
|
||||||
getAnalysis<cfg::DominanceFrontier>(cfg::DominanceFrontier::PostDomID));
|
getAnalysis<cfg::DominanceFrontier>(cfg::DominanceFrontier::PostDomID));
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &II) {
|
|||||||
static bool DoConstPropPass(Function *F) {
|
static bool DoConstPropPass(Function *F) {
|
||||||
bool SomethingChanged = false;
|
bool SomethingChanged = false;
|
||||||
|
|
||||||
for (Method::iterator BBI = F->begin(); BBI != F->end(); ++BBI) {
|
for (Function::iterator BBI = F->begin(); BBI != F->end(); ++BBI) {
|
||||||
BasicBlock *BB = *BBI;
|
BasicBlock *BB = *BBI;
|
||||||
for (BasicBlock::iterator I = BB->begin(); I != BB->end(); )
|
for (BasicBlock::iterator I = BB->begin(); I != BB->end(); )
|
||||||
if (doConstantPropogation(BB, I))
|
if (doConstantPropogation(BB, I))
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
|
@ -153,7 +153,7 @@ doDecomposeMultiDimRefs(Function *F)
|
|||||||
{
|
{
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
for (Method::iterator BI = F->begin(), BE = F->end(); BI != BE; ++BI)
|
for (Function::iterator BI = F->begin(), BE = F->end(); BI != BE; ++BI)
|
||||||
for (BasicBlock::iterator newI, II = (*BI)->begin();
|
for (BasicBlock::iterator newI, II = (*BI)->begin();
|
||||||
II != (*BI)->end(); II = ++newI)
|
II != (*BI)->end(); II = ++newI)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +187,7 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) {
|
|||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool doit(Method *M, cfg::LoopInfo &Loops) {
|
static bool doit(Function *M, cfg::LoopInfo &Loops) {
|
||||||
// Induction Variables live in the header nodes of the loops of the method...
|
// Induction Variables live in the header nodes of the loops of the method...
|
||||||
return reduce_apply_bool(Loops.getTopLevelLoops().begin(),
|
return reduce_apply_bool(Loops.getTopLevelLoops().begin(),
|
||||||
Loops.getTopLevelLoops().end(),
|
Loops.getTopLevelLoops().end(),
|
||||||
@ -197,8 +197,8 @@ static bool doit(Method *M, cfg::LoopInfo &Loops) {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct InductionVariableSimplify : public MethodPass {
|
struct InductionVariableSimplify : public MethodPass {
|
||||||
virtual bool runOnMethod(Method *M) {
|
virtual bool runOnMethod(Function *F) {
|
||||||
return doit(M, getAnalysis<cfg::LoopInfo>());
|
return doit(F, getAnalysis<cfg::LoopInfo>());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Required,
|
virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Required,
|
||||||
|
@ -22,12 +22,11 @@
|
|||||||
#include "llvm/Transforms/Scalar/InductionVars.h"
|
#include "llvm/Transforms/Scalar/InductionVars.h"
|
||||||
#include "llvm/ConstantVals.h"
|
#include "llvm/ConstantVals.h"
|
||||||
#include "llvm/Analysis/IntervalPartition.h"
|
#include "llvm/Analysis/IntervalPartition.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
#include "llvm/SymbolTable.h"
|
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/InstrTypes.h"
|
#include "llvm/InstrTypes.h"
|
||||||
|
#include "llvm/Type.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -185,8 +184,8 @@ static PHINode *InjectSimpleInductionVariable(cfg::Interval *Int) {
|
|||||||
|
|
||||||
if (M->hasSymbolTable()) {
|
if (M->hasSymbolTable()) {
|
||||||
// Only name the induction variable if the method isn't stripped.
|
// Only name the induction variable if the method isn't stripped.
|
||||||
PHIName = M->getSymbolTable()->getUniqueName(Type::UIntTy, "ind_var");
|
PHIName = "ind_var";
|
||||||
AddName = M->getSymbolTable()->getUniqueName(Type::UIntTy, "ind_var_next");
|
AddName = "ind_var_next";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the neccesary instructions...
|
// Create the neccesary instructions...
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/Assembly/Writer.h" // For debugging
|
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user