mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
DEBUG got moved to Support/Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -10,6 +10,7 @@
|
|||||||
#include "llvm/Analysis/DataStructure.h"
|
#include "llvm/Analysis/DataStructure.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "DSCallSiteIterator.h"
|
#include "DSCallSiteIterator.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
#include "Support/Timer.h"
|
#include "Support/Timer.h"
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "Support/Statistic.h"
|
|
||||||
#include "Support/Timer.h"
|
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
|
#include "Support/Timer.h"
|
||||||
|
|
||||||
// FIXME: This should eventually be a FunctionPass that is automatically
|
// FIXME: This should eventually be a FunctionPass that is automatically
|
||||||
// aggregated into a Pass.
|
// aggregated into a Pass.
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "llvm/Analysis/DSGraph.h"
|
#include "llvm/Analysis/DSGraph.h"
|
||||||
#include "llvm/Analysis/AliasAnalysis.h"
|
#include "llvm/Analysis/AliasAnalysis.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class Steens : public Pass, public AliasAnalysis {
|
class Steens : public Pass, public AliasAnalysis {
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "llvm/Analysis/DataStructure.h"
|
#include "llvm/Analysis/DataStructure.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
#include "DSCallSiteIterator.h"
|
#include "DSCallSiteIterator.h"
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
|
|
||||||
static bool isLoopInvariant(const Value *V, const Loop *L) {
|
static bool isLoopInvariant(const Value *V, const Loop *L) {
|
||||||
if (isa<Constant>(V) || isa<Argument>(V) || isa<GlobalValue>(V))
|
if (isa<Constant>(V) || isa<Argument>(V) || isa<GlobalValue>(V))
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "llvm/ConstantHandling.h"
|
#include "llvm/ConstantHandling.h"
|
||||||
#include "llvm/Analysis/Expressions.h"
|
#include "llvm/Analysis/Expressions.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/Support/CallSite.h"
|
#include "llvm/Support/CallSite.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
#include "Support/iterator"
|
#include "Support/iterator"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "Support/Statistic.h"
|
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
|
#include "Support/Statistic.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
#include "llvm/Transforms/IPO.h"
|
#include "llvm/Transforms/IPO.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "Support/Statistic.h"
|
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
|
#include "Support/Statistic.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
// ValuePlaceHolder - A stupid little marker value. It appears as an
|
// ValuePlaceHolder - A stupid little marker value. It appears as an
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
#include "Support/VectorExtras.h"
|
#include "Support/VectorExtras.h"
|
||||||
using namespace PA;
|
using namespace PA;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "Graph.h"
|
#include "Graph.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using std::map;
|
using std::map;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "Graph.h"
|
#include "Graph.h"
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Debug.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "Graph.h"
|
#include "Graph.h"
|
||||||
|
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
#include "llvm/Analysis/Expressions.h"
|
#include "llvm/Analysis/Expressions.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
|
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
|
||||||
#include "Support/STLExtras.h"
|
|
||||||
#include "Support/Statistic.h"
|
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
|
#include "Support/Statistic.h"
|
||||||
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using std::cerr;
|
|
||||||
|
|
||||||
// StartInst - This enables the -raise-start-inst=foo option to cause the level
|
// StartInst - This enables the -raise-start-inst=foo option to cause the level
|
||||||
// raising pass to start at instruction "foo", which is immensely useful for
|
// raising pass to start at instruction "foo", which is immensely useful for
|
||||||
@ -274,7 +274,7 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
|
|||||||
if (ExpressionConvertibleToType(Src, DestTy, ConvertedTypes, TD)) {
|
if (ExpressionConvertibleToType(Src, DestTy, ConvertedTypes, TD)) {
|
||||||
PRINT_PEEPHOLE3("CAST-SRC-EXPR-CONV:in ", Src, CI, BB->getParent());
|
PRINT_PEEPHOLE3("CAST-SRC-EXPR-CONV:in ", Src, CI, BB->getParent());
|
||||||
|
|
||||||
DEBUG(cerr << "\nCONVERTING SRC EXPR TYPE:\n");
|
DEBUG(std::cerr << "\nCONVERTING SRC EXPR TYPE:\n");
|
||||||
{ // ValueMap must be destroyed before function verified!
|
{ // ValueMap must be destroyed before function verified!
|
||||||
ValueMapCache ValueMap;
|
ValueMapCache ValueMap;
|
||||||
Value *E = ConvertExpressionToType(Src, DestTy, ValueMap, TD);
|
Value *E = ConvertExpressionToType(Src, DestTy, ValueMap, TD);
|
||||||
@ -283,7 +283,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
|
|||||||
CI->replaceAllUsesWith(CPV);
|
CI->replaceAllUsesWith(CPV);
|
||||||
|
|
||||||
PRINT_PEEPHOLE1("CAST-SRC-EXPR-CONV:out", E);
|
PRINT_PEEPHOLE1("CAST-SRC-EXPR-CONV:out", E);
|
||||||
DEBUG(cerr << "DONE CONVERTING SRC EXPR TYPE: \n" << BB->getParent());
|
DEBUG(std::cerr << "DONE CONVERTING SRC EXPR TYPE: \n"
|
||||||
|
<< BB->getParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(assert(verifyFunction(*BB->getParent()) == false &&
|
DEBUG(assert(verifyFunction(*BB->getParent()) == false &&
|
||||||
@ -302,14 +303,14 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
|
|||||||
if (ValueConvertibleToType(CI, Src->getType(), ConvertedTypes, TD)) {
|
if (ValueConvertibleToType(CI, Src->getType(), ConvertedTypes, TD)) {
|
||||||
PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", Src, CI, BB->getParent());
|
PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", Src, CI, BB->getParent());
|
||||||
|
|
||||||
DEBUG(cerr << "\nCONVERTING EXPR TYPE:\n");
|
DEBUG(std::cerr << "\nCONVERTING EXPR TYPE:\n");
|
||||||
{ // ValueMap must be destroyed before function verified!
|
{ // ValueMap must be destroyed before function verified!
|
||||||
ValueMapCache ValueMap;
|
ValueMapCache ValueMap;
|
||||||
ConvertValueToNewType(CI, Src, ValueMap, TD); // This will delete CI!
|
ConvertValueToNewType(CI, Src, ValueMap, TD); // This will delete CI!
|
||||||
}
|
}
|
||||||
|
|
||||||
PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", Src);
|
PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", Src);
|
||||||
DEBUG(cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent());
|
DEBUG(std::cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent());
|
||||||
|
|
||||||
DEBUG(assert(verifyFunction(*BB->getParent()) == false &&
|
DEBUG(assert(verifyFunction(*BB->getParent()) == false &&
|
||||||
"Function broken!"));
|
"Function broken!"));
|
||||||
@ -556,11 +557,11 @@ bool RPR::DoRaisePass(Function &F) {
|
|||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
for (Function::iterator BB = F.begin(), BBE = F.end(); BB != BBE; ++BB)
|
for (Function::iterator BB = F.begin(), BBE = F.end(); BB != BBE; ++BB)
|
||||||
for (BasicBlock::iterator BI = BB->begin(); BI != BB->end();) {
|
for (BasicBlock::iterator BI = BB->begin(); BI != BB->end();) {
|
||||||
DEBUG(cerr << "Processing: " << *BI);
|
DEBUG(std::cerr << "Processing: " << *BI);
|
||||||
if (dceInstruction(BI) || doConstantPropagation(BI)) {
|
if (dceInstruction(BI) || doConstantPropagation(BI)) {
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumDCEorCP;
|
++NumDCEorCP;
|
||||||
DEBUG(cerr << "***\t\t^^-- Dead code eliminated!\n");
|
DEBUG(std::cerr << "***\t\t^^-- Dead code eliminated!\n");
|
||||||
} else if (PeepholeOptimize(BB, BI)) {
|
} else if (PeepholeOptimize(BB, BI)) {
|
||||||
Changed = true;
|
Changed = true;
|
||||||
} else {
|
} else {
|
||||||
@ -574,7 +575,8 @@ bool RPR::DoRaisePass(Function &F) {
|
|||||||
|
|
||||||
// runOnFunction - Raise a function representation to a higher level.
|
// runOnFunction - Raise a function representation to a higher level.
|
||||||
bool RPR::runOnFunction(Function &F) {
|
bool RPR::runOnFunction(Function &F) {
|
||||||
DEBUG(cerr << "\n\n\nStarting to work on Function '" << F.getName() << "'\n");
|
DEBUG(std::cerr << "\n\n\nStarting to work on Function '" << F.getName()
|
||||||
|
<< "'\n");
|
||||||
|
|
||||||
// Insert casts for all incoming pointer pointer values that are treated as
|
// Insert casts for all incoming pointer pointer values that are treated as
|
||||||
// arrays...
|
// arrays...
|
||||||
@ -596,7 +598,7 @@ bool RPR::runOnFunction(Function &F) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
DEBUG(cerr << "Looping: \n" << F);
|
DEBUG(std::cerr << "Looping: \n" << F);
|
||||||
|
|
||||||
// Iterate over the function, refining it, until it converges on a stable
|
// Iterate over the function, refining it, until it converges on a stable
|
||||||
// state
|
// state
|
||||||
|
@ -15,9 +15,10 @@
|
|||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Constant.h"
|
#include "llvm/Constant.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/Debug.h"
|
||||||
#include "Support/DepthFirstIterator.h"
|
#include "Support/DepthFirstIterator.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "llvm/Transforms/Utils/Local.h"
|
#include "llvm/Transforms/Utils/Local.h"
|
||||||
#include "llvm/Support/ConstantRange.h"
|
#include "llvm/Support/ConstantRange.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "Support/PostOrderIterator.h"
|
#include "Support/PostOrderIterator.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/Debug.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
#include "Support/STLExtras.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
Statistic<> NumRemoved ("indvars", "Number of aux indvars removed");
|
Statistic<> NumRemoved ("indvars", "Number of aux indvars removed");
|
||||||
|
@ -31,8 +31,9 @@
|
|||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "Support/Statistic.h"
|
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
|
#include "Support/Statistic.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "llvm/Analysis/PostDominators.h"
|
#include "llvm/Analysis/PostDominators.h"
|
||||||
#include "llvm/Analysis/ValueNumbering.h"
|
#include "llvm/Analysis/ValueNumbering.h"
|
||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "Support/DepthFirstIterator.h"
|
#include "Support/DepthFirstIterator.h"
|
||||||
#include "Support/PostOrderIterator.h"
|
#include "Support/PostOrderIterator.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Constant.h"
|
#include "llvm/Constant.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "Support/PostOrderIterator.h"
|
#include "Support/PostOrderIterator.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
|
||||||
|
@ -20,8 +20,9 @@
|
|||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/Debug.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/Debug.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
#include "Support/StringExtras.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
Statistic<> NumReplaced("scalarrepl", "Number of alloca's broken up");
|
Statistic<> NumReplaced("scalarrepl", "Number of alloca's broken up");
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Transforms/Utils/Local.h"
|
#include "llvm/Transforms/Utils/Local.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
Reference in New Issue
Block a user