projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move all of the header files which are involved in modelling the LLVM IR
[oota-llvm.git]
/
lib
/
Transforms
/
IPO
/
PartialInlining.cpp
diff --git
a/lib/Transforms/IPO/PartialInlining.cpp
b/lib/Transforms/IPO/PartialInlining.cpp
index 432f7c53a67d106454907cd1ef88f2030ef54aab..fa518cb0abb6dd5bd522a00a4332aadf02611600 100644
(file)
--- a/
lib/Transforms/IPO/PartialInlining.cpp
+++ b/
lib/Transforms/IPO/PartialInlining.cpp
@@
-14,14
+14,14
@@
#define DEBUG_TYPE "partialinlining"
#include "llvm/Transforms/IPO.h"
#define DEBUG_TYPE "partialinlining"
#include "llvm/Transforms/IPO.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Transforms/Utils/FunctionUtils.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/Analysis/Dominators.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Pass.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Transforms/Utils/Cloning.h"
+#include "llvm/Transforms/Utils/CodeExtractor.h"
using namespace llvm;
STATISTIC(NumPartialInlined, "Number of functions partially inlined");
using namespace llvm;
STATISTIC(NumPartialInlined, "Number of functions partially inlined");
@@
-30,7
+30,9
@@
namespace {
struct PartialInliner : public ModulePass {
virtual void getAnalysisUsage(AnalysisUsage &AU) const { }
static char ID; // Pass identification, replacement for typeid
struct PartialInliner : public ModulePass {
virtual void getAnalysisUsage(AnalysisUsage &AU) const { }
static char ID; // Pass identification, replacement for typeid
- PartialInliner() : ModulePass(ID) {}
+ PartialInliner() : ModulePass(ID) {
+ initializePartialInlinerPass(*PassRegistry::getPassRegistry());
+ }
bool runOnModule(Module& M);
bool runOnModule(Module& M);
@@
-41,7
+43,7
@@
namespace {
char PartialInliner::ID = 0;
INITIALIZE_PASS(PartialInliner, "partial-inliner",
char PartialInliner::ID = 0;
INITIALIZE_PASS(PartialInliner, "partial-inliner",
- "Partial Inliner", false, false)
;
+ "Partial Inliner", false, false)
ModulePass* llvm::createPartialInliningPass() { return new PartialInliner(); }
ModulePass* llvm::createPartialInliningPass() { return new PartialInliner(); }
@@
-67,7
+69,7
@@
Function* PartialInliner::unswitchFunction(Function* F) {
return 0;
// Clone the function, so that we can hack away on it.
return 0;
// Clone the function, so that we can hack away on it.
- Value
Map<const Value*, Value*>
VMap;
+ Value
ToValueMapTy
VMap;
Function* duplicateFunction = CloneFunction(F, VMap,
/*ModuleLevelChanges=*/false);
duplicateFunction->setLinkage(GlobalValue::InternalLinkage);
Function* duplicateFunction = CloneFunction(F, VMap,
/*ModuleLevelChanges=*/false);
duplicateFunction->setLinkage(GlobalValue::InternalLinkage);
@@
-93,7
+95,7
@@
Function* PartialInliner::unswitchFunction(Function* F) {
PHINode* OldPhi = dyn_cast<PHINode>(I);
if (!OldPhi) break;
PHINode* OldPhi = dyn_cast<PHINode>(I);
if (!OldPhi) break;
- PHINode* retPhi = PHINode::Create(OldPhi->getType(), "", Ins);
+ PHINode* retPhi = PHINode::Create(OldPhi->getType(),
2,
"", Ins);
OldPhi->replaceAllUsesWith(retPhi);
Ins = newReturnBlock->getFirstNonPHI();
OldPhi->replaceAllUsesWith(retPhi);
Ins = newReturnBlock->getFirstNonPHI();
@@
-120,7
+122,8
@@
Function* PartialInliner::unswitchFunction(Function* F) {
DT.runOnFunction(*duplicateFunction);
// Extract the body of the if.
DT.runOnFunction(*duplicateFunction);
// Extract the body of the if.
- Function* extractedFunction = ExtractCodeRegion(DT, toExtract);
+ Function* extractedFunction
+ = CodeExtractor(toExtract, &DT).extractCodeRegion();
InlineFunctionInfo IFI;
InlineFunctionInfo IFI;