PartialInlining.cpp (221345) | PartialInlining.cpp (239462) |
---|---|
1//===- PartialInlining.cpp - Inline parts of functions --------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 5 unchanged lines hidden (view full) --- 14 15#define DEBUG_TYPE "partialinlining" 16#include "llvm/Transforms/IPO.h" 17#include "llvm/Instructions.h" 18#include "llvm/Module.h" 19#include "llvm/Pass.h" 20#include "llvm/Analysis/Dominators.h" 21#include "llvm/Transforms/Utils/Cloning.h" | 1//===- PartialInlining.cpp - Inline parts of functions --------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 5 unchanged lines hidden (view full) --- 14 15#define DEBUG_TYPE "partialinlining" 16#include "llvm/Transforms/IPO.h" 17#include "llvm/Instructions.h" 18#include "llvm/Module.h" 19#include "llvm/Pass.h" 20#include "llvm/Analysis/Dominators.h" 21#include "llvm/Transforms/Utils/Cloning.h" |
22#include "llvm/Transforms/Utils/FunctionUtils.h" | 22#include "llvm/Transforms/Utils/CodeExtractor.h" |
23#include "llvm/ADT/Statistic.h" 24#include "llvm/Support/CFG.h" 25using namespace llvm; 26 27STATISTIC(NumPartialInlined, "Number of functions partially inlined"); 28 29namespace { 30 struct PartialInliner : public ModulePass { --- 86 unchanged lines hidden (view full) --- 117 &*FI != newNonReturnBlock) 118 toExtract.push_back(FI); 119 120 // The CodeExtractor needs a dominator tree. 121 DominatorTree DT; 122 DT.runOnFunction(*duplicateFunction); 123 124 // Extract the body of the if. | 23#include "llvm/ADT/Statistic.h" 24#include "llvm/Support/CFG.h" 25using namespace llvm; 26 27STATISTIC(NumPartialInlined, "Number of functions partially inlined"); 28 29namespace { 30 struct PartialInliner : public ModulePass { --- 86 unchanged lines hidden (view full) --- 117 &*FI != newNonReturnBlock) 118 toExtract.push_back(FI); 119 120 // The CodeExtractor needs a dominator tree. 121 DominatorTree DT; 122 DT.runOnFunction(*duplicateFunction); 123 124 // Extract the body of the if. |
125 Function* extractedFunction = ExtractCodeRegion(DT, toExtract); | 125 Function* extractedFunction 126 = CodeExtractor(toExtract, &DT).extractCodeRegion(); |
126 127 InlineFunctionInfo IFI; 128 129 // Inline the top-level if test into all callers. 130 std::vector<User*> Users(duplicateFunction->use_begin(), 131 duplicateFunction->use_end()); 132 for (std::vector<User*>::iterator UI = Users.begin(), UE = Users.end(); 133 UI != UE; ++UI) --- 49 unchanged lines hidden --- | 127 128 InlineFunctionInfo IFI; 129 130 // Inline the top-level if test into all callers. 131 std::vector<User*> Users(duplicateFunction->use_begin(), 132 duplicateFunction->use_end()); 133 for (std::vector<User*>::iterator UI = Users.begin(), UE = Users.end(); 134 UI != UE; ++UI) --- 49 unchanged lines hidden --- |