mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Use SmallPtrSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -14,7 +14,7 @@
|
|||||||
#ifndef INLINECOST_H
|
#ifndef INLINECOST_H
|
||||||
#define INLINECOST_H
|
#define INLINECOST_H
|
||||||
|
|
||||||
#include <set>
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ namespace llvm {
|
|||||||
// getInlineCost - The heuristic used to determine if we should inline the
|
// getInlineCost - The heuristic used to determine if we should inline the
|
||||||
// function call or not.
|
// function call or not.
|
||||||
//
|
//
|
||||||
int getInlineCost(CallSite CS, std::set<const Function *> &NeverInline);
|
int getInlineCost(CallSite CS, SmallPtrSet<const Function *, 16> &NeverInline);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,14 +23,15 @@
|
|||||||
#include "llvm/Transforms/IPO.h"
|
#include "llvm/Transforms/IPO.h"
|
||||||
#include "llvm/Transforms/IPO/InlinerPass.h"
|
#include "llvm/Transforms/IPO/InlinerPass.h"
|
||||||
#include "llvm/Transforms/Utils/InlineCost.h"
|
#include "llvm/Transforms/Utils/InlineCost.h"
|
||||||
#include <set>
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class VISIBILITY_HIDDEN SimpleInliner : public Inliner {
|
class VISIBILITY_HIDDEN SimpleInliner : public Inliner {
|
||||||
std::set<const Function*> NeverInline; // Functions that are never inlined
|
// Functions that are never inlined
|
||||||
|
SmallPtrSet<const Function*, 16> NeverInline;
|
||||||
InlineCostAnalyzer CA;
|
InlineCostAnalyzer CA;
|
||||||
public:
|
public:
|
||||||
SimpleInliner() : Inliner(&ID) {}
|
SimpleInliner() : Inliner(&ID) {}
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ namespace llvm {
|
|||||||
private:
|
private:
|
||||||
TargetData *TD;
|
TargetData *TD;
|
||||||
std::vector<Function *> Functions;
|
std::vector<Function *> Functions;
|
||||||
std::set<const Function *> NeverInline;
|
SmallPtrSet<const Function *, 16> NeverInline;
|
||||||
SmallPtrSet<Function *, 8> DeadFunctions;
|
SmallPtrSet<Function *, 8> DeadFunctions;
|
||||||
InlineCostAnalyzer CA;
|
InlineCostAnalyzer CA;
|
||||||
};
|
};
|
||||||
|
@ -141,7 +141,7 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
|
|||||||
// getInlineCost - The heuristic used to determine if we should inline the
|
// getInlineCost - The heuristic used to determine if we should inline the
|
||||||
// function call or not.
|
// function call or not.
|
||||||
//
|
//
|
||||||
int InlineCostAnalyzer::getInlineCost(CallSite CS, std::set<const Function *> &NeverInline) {
|
int InlineCostAnalyzer::getInlineCost(CallSite CS, SmallPtrSet<const Function *, 16> &NeverInline) {
|
||||||
Instruction *TheCall = CS.getInstruction();
|
Instruction *TheCall = CS.getInstruction();
|
||||||
Function *Callee = CS.getCalledFunction();
|
Function *Callee = CS.getCalledFunction();
|
||||||
const Function *Caller = TheCall->getParent()->getParent();
|
const Function *Caller = TheCall->getParent()->getParent();
|
||||||
|
Reference in New Issue
Block a user