blob: 8cbefc855d99b535e57cabb5ad4e7dbfbf2cc925 [file] [log] [blame]
Chris Lattner2a365452010-08-26 01:13:54 +00001//===-- StructRetPromotion.cpp - Promote sret arguments -------------------===//
Devang Patelca891ec2008-02-29 23:34:08 +00002//
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//===----------------------------------------------------------------------===//
9//
Gordon Henriksena8a118b2008-05-08 17:46:35 +000010// This pass finds functions that return a struct (using a pointer to the struct
11// as the first argument of the function, marked with the 'sret' attribute) and
12// replaces them with a new function that simply returns each of the elements of
13// that struct (using multiple return values).
14//
15// This pass works under a number of conditions:
16// 1. The returned struct must not contain other structs
17// 2. The returned struct must only be used to load values from
18// 3. The placeholder struct passed in is the result of an alloca
19//
Devang Patelca891ec2008-02-29 23:34:08 +000020//===----------------------------------------------------------------------===//
21
22#define DEBUG_TYPE "sretpromotion"
23#include "llvm/Transforms/IPO.h"
24#include "llvm/Constants.h"
25#include "llvm/DerivedTypes.h"
Owen Anderson14ce9ef2009-07-06 01:34:54 +000026#include "llvm/LLVMContext.h"
Devang Patelca891ec2008-02-29 23:34:08 +000027#include "llvm/Module.h"
28#include "llvm/CallGraphSCCPass.h"
29#include "llvm/Instructions.h"
30#include "llvm/Analysis/CallGraph.h"
31#include "llvm/Support/CallSite.h"
32#include "llvm/Support/CFG.h"
33#include "llvm/Support/Debug.h"
34#include "llvm/ADT/Statistic.h"
35#include "llvm/ADT/SmallVector.h"
Devang Patel98a6e062008-03-04 17:44:37 +000036#include "llvm/ADT/Statistic.h"
Daniel Dunbar460f6562009-07-26 09:48:23 +000037#include "llvm/Support/raw_ostream.h"
Devang Patelca891ec2008-02-29 23:34:08 +000038using namespace llvm;
39
Devang Patel98a6e062008-03-04 17:44:37 +000040STATISTIC(NumRejectedSRETUses , "Number of sret rejected due to unexpected uses");
41STATISTIC(NumSRET , "Number of sret promoted");
Devang Patelca891ec2008-02-29 23:34:08 +000042namespace {
43 /// SRETPromotion - This pass removes sret parameter and updates
44 /// function to use multiple return value.
45 ///
Nick Lewycky6726b6d2009-10-25 06:33:48 +000046 struct SRETPromotion : public CallGraphSCCPass {
Devang Patelca891ec2008-02-29 23:34:08 +000047 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
48 CallGraphSCCPass::getAnalysisUsage(AU);
49 }
50
Chris Lattner2decb222010-04-16 22:42:17 +000051 virtual bool runOnSCC(CallGraphSCC &SCC);
Devang Patelca891ec2008-02-29 23:34:08 +000052 static char ID; // Pass identification, replacement for typeid
Owen Anderson90c579d2010-08-06 18:33:48 +000053 SRETPromotion() : CallGraphSCCPass(ID) {}
Devang Patelca891ec2008-02-29 23:34:08 +000054
55 private:
Chris Lattner5095e3d2009-08-31 00:19:58 +000056 CallGraphNode *PromoteReturn(CallGraphNode *CGN);
Devang Patelca891ec2008-02-29 23:34:08 +000057 bool isSafeToUpdateAllCallers(Function *F);
58 Function *cloneFunctionBody(Function *F, const StructType *STy);
Chris Lattner5095e3d2009-08-31 00:19:58 +000059 CallGraphNode *updateCallSites(Function *F, Function *NF);
Devang Patelca891ec2008-02-29 23:34:08 +000060 };
Devang Patelca891ec2008-02-29 23:34:08 +000061}
62
Dan Gohman844731a2008-05-13 00:00:25 +000063char SRETPromotion::ID = 0;
Owen Andersonae0a7bc2010-10-13 22:00:45 +000064INITIALIZE_PASS_BEGIN(SRETPromotion, "sretpromotion",
65 "Promote sret arguments to multiple ret values", false, false)
66INITIALIZE_AG_DEPENDENCY(CallGraph)
67INITIALIZE_PASS_END(SRETPromotion, "sretpromotion",
Owen Andersonce665bd2010-10-07 22:25:06 +000068 "Promote sret arguments to multiple ret values", false, false)
Dan Gohman844731a2008-05-13 00:00:25 +000069
Devang Patelca891ec2008-02-29 23:34:08 +000070Pass *llvm::createStructRetPromotionPass() {
71 return new SRETPromotion();
72}
73
Chris Lattner2decb222010-04-16 22:42:17 +000074bool SRETPromotion::runOnSCC(CallGraphSCC &SCC) {
Devang Patelca891ec2008-02-29 23:34:08 +000075 bool Changed = false;
76
Chris Lattner2decb222010-04-16 22:42:17 +000077 for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I)
78 if (CallGraphNode *NewNode = PromoteReturn(*I)) {
79 SCC.ReplaceNode(*I, NewNode);
Chris Lattner5095e3d2009-08-31 00:19:58 +000080 Changed = true;
81 }
Devang Patelca891ec2008-02-29 23:34:08 +000082
83 return Changed;
84}
85
86/// PromoteReturn - This method promotes function that uses StructRet paramater
Chris Lattner5095e3d2009-08-31 00:19:58 +000087/// into a function that uses multiple return values.
88CallGraphNode *SRETPromotion::PromoteReturn(CallGraphNode *CGN) {
Devang Patelca891ec2008-02-29 23:34:08 +000089 Function *F = CGN->getFunction();
90
Rafael Espindolabb46f522009-01-15 20:18:42 +000091 if (!F || F->isDeclaration() || !F->hasLocalLinkage())
Chris Lattner5095e3d2009-08-31 00:19:58 +000092 return 0;
Devang Patelca891ec2008-02-29 23:34:08 +000093
94 // Make sure that function returns struct.
Devang Patel41e23972008-03-03 21:46:28 +000095 if (F->arg_size() == 0 || !F->hasStructRetAttr() || F->doesNotReturn())
Chris Lattner5095e3d2009-08-31 00:19:58 +000096 return 0;
Devang Patelca891ec2008-02-29 23:34:08 +000097
David Greene09d70db2010-01-05 01:27:54 +000098 DEBUG(dbgs() << "SretPromotion: Looking at sret function "
Daniel Dunbar460f6562009-07-26 09:48:23 +000099 << F->getName() << "\n");
Matthijs Kooijman81ec2482008-08-07 15:14:04 +0000100
Benjamin Kramerf0127052010-01-05 13:12:22 +0000101 assert(F->getReturnType()->isVoidTy() && "Invalid function return type");
Devang Patelca891ec2008-02-29 23:34:08 +0000102 Function::arg_iterator AI = F->arg_begin();
103 const llvm::PointerType *FArgType = dyn_cast<PointerType>(AI->getType());
Chris Lattner5095e3d2009-08-31 00:19:58 +0000104 assert(FArgType && "Invalid sret parameter type");
Devang Patelca891ec2008-02-29 23:34:08 +0000105 const llvm::StructType *STy =
106 dyn_cast<StructType>(FArgType->getElementType());
Chris Lattner5095e3d2009-08-31 00:19:58 +0000107 assert(STy && "Invalid sret parameter element type");
Devang Patelca891ec2008-02-29 23:34:08 +0000108
109 // Check if it is ok to perform this promotion.
Devang Patel98a6e062008-03-04 17:44:37 +0000110 if (isSafeToUpdateAllCallers(F) == false) {
David Greene09d70db2010-01-05 01:27:54 +0000111 DEBUG(dbgs() << "SretPromotion: Not all callers can be updated\n");
Dan Gohmanfe601042010-06-22 15:08:57 +0000112 ++NumRejectedSRETUses;
Chris Lattner5095e3d2009-08-31 00:19:58 +0000113 return 0;
Devang Patel98a6e062008-03-04 17:44:37 +0000114 }
Devang Patelca891ec2008-02-29 23:34:08 +0000115
David Greene09d70db2010-01-05 01:27:54 +0000116 DEBUG(dbgs() << "SretPromotion: sret argument will be promoted\n");
Dan Gohmanfe601042010-06-22 15:08:57 +0000117 ++NumSRET;
Devang Patelca891ec2008-02-29 23:34:08 +0000118 // [1] Replace use of sret parameter
Owen Anderson50dead02009-07-15 23:53:25 +0000119 AllocaInst *TheAlloca = new AllocaInst(STy, NULL, "mrv",
120 F->getEntryBlock().begin());
Devang Patelca891ec2008-02-29 23:34:08 +0000121 Value *NFirstArg = F->arg_begin();
122 NFirstArg->replaceAllUsesWith(TheAlloca);
123
Devang Patel98a6e062008-03-04 17:44:37 +0000124 // [2] Find and replace ret instructions
Devang Patelca891ec2008-02-29 23:34:08 +0000125 for (Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI)
126 for(BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ) {
127 Instruction *I = BI;
128 ++BI;
129 if (isa<ReturnInst>(I)) {
Dan Gohmanfc74abf2008-07-23 00:34:11 +0000130 Value *NV = new LoadInst(TheAlloca, "mrv.ld", I);
Owen Anderson1d0be152009-08-13 21:58:54 +0000131 ReturnInst *NR = ReturnInst::Create(F->getContext(), NV, I);
Devang Patelca891ec2008-02-29 23:34:08 +0000132 I->replaceAllUsesWith(NR);
133 I->eraseFromParent();
134 }
135 }
136
Devang Patel98a6e062008-03-04 17:44:37 +0000137 // [3] Create the new function body and insert it into the module.
Devang Patelca891ec2008-02-29 23:34:08 +0000138 Function *NF = cloneFunctionBody(F, STy);
139
Devang Patel98a6e062008-03-04 17:44:37 +0000140 // [4] Update all call sites to use new function
Chris Lattner5095e3d2009-08-31 00:19:58 +0000141 CallGraphNode *NF_CFN = updateCallSites(F, NF);
Devang Patelca891ec2008-02-29 23:34:08 +0000142
Chris Lattner5095e3d2009-08-31 00:19:58 +0000143 CallGraph &CG = getAnalysis<CallGraph>();
144 NF_CFN->stealCalledFunctionsFrom(CG[F]);
145
146 delete CG.removeFunctionFromModule(F);
147 return NF_CFN;
Devang Patelca891ec2008-02-29 23:34:08 +0000148}
149
Duncan Sands33af59d2008-05-09 12:20:10 +0000150// Check if it is ok to perform this promotion.
Devang Patelca891ec2008-02-29 23:34:08 +0000151bool SRETPromotion::isSafeToUpdateAllCallers(Function *F) {
152
153 if (F->use_empty())
154 // No users. OK to modify signature.
155 return true;
156
157 for (Value::use_iterator FnUseI = F->use_begin(), FnUseE = F->use_end();
158 FnUseI != FnUseE; ++FnUseI) {
Matthijs Kooijman257da0a2008-06-05 08:48:32 +0000159 // The function is passed in as an argument to (possibly) another function,
160 // we can't change it!
Gabor Greif7d3056b2010-07-28 22:50:26 +0000161 CallSite CS(*FnUseI);
Devang Patelca891ec2008-02-29 23:34:08 +0000162 Instruction *Call = CS.getInstruction();
Matthijs Kooijman47c6fd72008-06-05 08:57:20 +0000163 // The function is used by something else than a call or invoke instruction,
164 // we can't change it!
Gabor Greifedc4d692009-01-22 21:35:57 +0000165 if (!Call || !CS.isCallee(FnUseI))
Matthijs Kooijman47c6fd72008-06-05 08:57:20 +0000166 return false;
Devang Patelca891ec2008-02-29 23:34:08 +0000167 CallSite::arg_iterator AI = CS.arg_begin();
168 Value *FirstArg = *AI;
169
170 if (!isa<AllocaInst>(FirstArg))
171 return false;
172
173 // Check FirstArg's users.
174 for (Value::use_iterator ArgI = FirstArg->use_begin(),
175 ArgE = FirstArg->use_end(); ArgI != ArgE; ++ArgI) {
Gabor Greiffc41f902010-07-12 11:19:24 +0000176 User *U = *ArgI;
Devang Patelca891ec2008-02-29 23:34:08 +0000177 // If FirstArg user is a CallInst that does not correspond to current
178 // call site then this function F is not suitable for sret promotion.
Gabor Greiffc41f902010-07-12 11:19:24 +0000179 if (CallInst *CI = dyn_cast<CallInst>(U)) {
Devang Patelca891ec2008-02-29 23:34:08 +0000180 if (CI != Call)
181 return false;
182 }
183 // If FirstArg user is a GEP whose all users are not LoadInst then
184 // this function F is not suitable for sret promotion.
Gabor Greiffc41f902010-07-12 11:19:24 +0000185 else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
Devang Patele0a6a3f2008-03-05 23:39:23 +0000186 // TODO : Use dom info and insert PHINodes to collect get results
187 // from multiple call sites for this GEP.
188 if (GEP->getParent() != Call->getParent())
189 return false;
Devang Patelca891ec2008-02-29 23:34:08 +0000190 for (Value::use_iterator GEPI = GEP->use_begin(), GEPE = GEP->use_end();
191 GEPI != GEPE; ++GEPI)
Gabor Greif96f1d8e2010-07-22 13:36:47 +0000192 if (!isa<LoadInst>(*GEPI))
Devang Patelca891ec2008-02-29 23:34:08 +0000193 return false;
194 }
195 // Any other FirstArg users make this function unsuitable for sret
196 // promotion.
197 else
198 return false;
199 }
200 }
201
202 return true;
203}
204
205/// cloneFunctionBody - Create a new function based on F and
206/// insert it into module. Remove first argument. Use STy as
207/// the return type for new function.
208Function *SRETPromotion::cloneFunctionBody(Function *F,
209 const StructType *STy) {
210
Devang Patelca891ec2008-02-29 23:34:08 +0000211 const FunctionType *FTy = F->getFunctionType();
212 std::vector<const Type*> Params;
213
Devang Patel05988662008-09-25 21:00:45 +0000214 // Attributes - Keep track of the parameter attributes for the arguments.
215 SmallVector<AttributeWithIndex, 8> AttributesVec;
216 const AttrListPtr &PAL = F->getAttributes();
Devang Patel2a4821b2008-03-03 18:36:03 +0000217
218 // Add any return attributes.
Devang Patel19c87462008-09-26 22:53:05 +0000219 if (Attributes attrs = PAL.getRetAttributes())
Devang Patel05988662008-09-25 21:00:45 +0000220 AttributesVec.push_back(AttributeWithIndex::get(0, attrs));
Devang Patel2a4821b2008-03-03 18:36:03 +0000221
Devang Patelca891ec2008-02-29 23:34:08 +0000222 // Skip first argument.
223 Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
224 ++I;
Devang Patel8f9b5512008-03-12 00:07:03 +0000225 // 0th parameter attribute is reserved for return type.
226 // 1th parameter attribute is for first 1st sret argument.
227 unsigned ParamIndex = 2;
Devang Patelca891ec2008-02-29 23:34:08 +0000228 while (I != E) {
229 Params.push_back(I->getType());
Devang Patel19c87462008-09-26 22:53:05 +0000230 if (Attributes Attrs = PAL.getParamAttributes(ParamIndex))
Devang Patel05988662008-09-25 21:00:45 +0000231 AttributesVec.push_back(AttributeWithIndex::get(ParamIndex - 1, Attrs));
Devang Patelca891ec2008-02-29 23:34:08 +0000232 ++I;
Devang Patel2a4821b2008-03-03 18:36:03 +0000233 ++ParamIndex;
Devang Patelca891ec2008-02-29 23:34:08 +0000234 }
235
Devang Patel19c87462008-09-26 22:53:05 +0000236 // Add any fn attributes.
237 if (Attributes attrs = PAL.getFnAttributes())
238 AttributesVec.push_back(AttributeWithIndex::get(~0, attrs));
239
240
Owen Andersondebcb012009-07-29 22:17:13 +0000241 FunctionType *NFTy = FunctionType::get(STy, Params, FTy->isVarArg());
Matthijs Kooijman7d942002008-08-07 16:01:23 +0000242 Function *NF = Function::Create(NFTy, F->getLinkage());
243 NF->takeName(F);
Duncan Sands28c3cff2008-05-26 19:58:59 +0000244 NF->copyAttributesFrom(F);
Devang Patel05988662008-09-25 21:00:45 +0000245 NF->setAttributes(AttrListPtr::get(AttributesVec.begin(), AttributesVec.end()));
Devang Patelca891ec2008-02-29 23:34:08 +0000246 F->getParent()->getFunctionList().insert(F, NF);
247 NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());
248
249 // Replace arguments
250 I = F->arg_begin();
251 E = F->arg_end();
252 Function::arg_iterator NI = NF->arg_begin();
253 ++I;
254 while (I != E) {
Chris Lattner5095e3d2009-08-31 00:19:58 +0000255 I->replaceAllUsesWith(NI);
256 NI->takeName(I);
257 ++I;
258 ++NI;
Devang Patelca891ec2008-02-29 23:34:08 +0000259 }
260
261 return NF;
262}
263
264/// updateCallSites - Update all sites that call F to use NF.
Chris Lattner5095e3d2009-08-31 00:19:58 +0000265CallGraphNode *SRETPromotion::updateCallSites(Function *F, Function *NF) {
Duncan Sandsa9c32512008-09-08 11:08:09 +0000266 CallGraph &CG = getAnalysis<CallGraph>();
Devang Patelca891ec2008-02-29 23:34:08 +0000267 SmallVector<Value*, 16> Args;
268
Devang Patel05988662008-09-25 21:00:45 +0000269 // Attributes - Keep track of the parameter attributes for the arguments.
270 SmallVector<AttributeWithIndex, 8> ArgAttrsVec;
Devang Patel2a4821b2008-03-03 18:36:03 +0000271
Chris Lattner5095e3d2009-08-31 00:19:58 +0000272 // Get a new callgraph node for NF.
273 CallGraphNode *NF_CGN = CG.getOrInsertFunction(NF);
274
Matthijs Kooijmanc1f1d462008-08-14 15:03:05 +0000275 while (!F->use_empty()) {
Gabor Greif7d3056b2010-07-28 22:50:26 +0000276 CallSite CS(*F->use_begin());
Devang Patelca891ec2008-02-29 23:34:08 +0000277 Instruction *Call = CS.getInstruction();
278
Devang Patel05988662008-09-25 21:00:45 +0000279 const AttrListPtr &PAL = F->getAttributes();
Devang Patel2a4821b2008-03-03 18:36:03 +0000280 // Add any return attributes.
Devang Patel19c87462008-09-26 22:53:05 +0000281 if (Attributes attrs = PAL.getRetAttributes())
Devang Patel05988662008-09-25 21:00:45 +0000282 ArgAttrsVec.push_back(AttributeWithIndex::get(0, attrs));
Devang Patel2a4821b2008-03-03 18:36:03 +0000283
Devang Patelca891ec2008-02-29 23:34:08 +0000284 // Copy arguments, however skip first one.
285 CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
286 Value *FirstCArg = *AI;
287 ++AI;
Devang Patel8f9b5512008-03-12 00:07:03 +0000288 // 0th parameter attribute is reserved for return type.
289 // 1th parameter attribute is for first 1st sret argument.
290 unsigned ParamIndex = 2;
Devang Patelca891ec2008-02-29 23:34:08 +0000291 while (AI != AE) {
292 Args.push_back(*AI);
Devang Patel19c87462008-09-26 22:53:05 +0000293 if (Attributes Attrs = PAL.getParamAttributes(ParamIndex))
Devang Patel05988662008-09-25 21:00:45 +0000294 ArgAttrsVec.push_back(AttributeWithIndex::get(ParamIndex - 1, Attrs));
Devang Patel2a4821b2008-03-03 18:36:03 +0000295 ++ParamIndex;
Devang Patelca891ec2008-02-29 23:34:08 +0000296 ++AI;
297 }
298
Devang Patel19c87462008-09-26 22:53:05 +0000299 // Add any function attributes.
300 if (Attributes attrs = PAL.getFnAttributes())
301 ArgAttrsVec.push_back(AttributeWithIndex::get(~0, attrs));
Chris Lattner58d74912008-03-12 17:45:29 +0000302
Devang Patel05988662008-09-25 21:00:45 +0000303 AttrListPtr NewPAL = AttrListPtr::get(ArgAttrsVec.begin(), ArgAttrsVec.end());
Chris Lattner58d74912008-03-12 17:45:29 +0000304
Devang Patelca891ec2008-02-29 23:34:08 +0000305 // Build new call instruction.
306 Instruction *New;
307 if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
Gabor Greif051a9502008-04-06 20:25:17 +0000308 New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
309 Args.begin(), Args.end(), "", Call);
Devang Patelca891ec2008-02-29 23:34:08 +0000310 cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
Devang Patel05988662008-09-25 21:00:45 +0000311 cast<InvokeInst>(New)->setAttributes(NewPAL);
Devang Patelca891ec2008-02-29 23:34:08 +0000312 } else {
Gabor Greif051a9502008-04-06 20:25:17 +0000313 New = CallInst::Create(NF, Args.begin(), Args.end(), "", Call);
Devang Patelca891ec2008-02-29 23:34:08 +0000314 cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
Devang Patel05988662008-09-25 21:00:45 +0000315 cast<CallInst>(New)->setAttributes(NewPAL);
Devang Patelca891ec2008-02-29 23:34:08 +0000316 if (cast<CallInst>(Call)->isTailCall())
317 cast<CallInst>(New)->setTailCall();
318 }
319 Args.clear();
Devang Patel544b92b2008-03-04 19:12:58 +0000320 ArgAttrsVec.clear();
Devang Patelca891ec2008-02-29 23:34:08 +0000321 New->takeName(Call);
322
Duncan Sandsa9c32512008-09-08 11:08:09 +0000323 // Update the callgraph to know that the callsite has been transformed.
Chris Lattnerda230cb2009-09-01 18:52:39 +0000324 CallGraphNode *CalleeNode = CG[Call->getParent()->getParent()];
325 CalleeNode->removeCallEdgeFor(Call);
326 CalleeNode->addCalledFunction(New, NF_CGN);
Chris Lattner7c8c1ba2009-09-01 18:50:55 +0000327
Dan Gohmanfc74abf2008-07-23 00:34:11 +0000328 // Update all users of sret parameter to extract value using extractvalue.
Devang Patelca891ec2008-02-29 23:34:08 +0000329 for (Value::use_iterator UI = FirstCArg->use_begin(),
330 UE = FirstCArg->use_end(); UI != UE; ) {
331 User *U2 = *UI++;
332 CallInst *C2 = dyn_cast<CallInst>(U2);
333 if (C2 && (C2 == Call))
334 continue;
Chris Lattner5095e3d2009-08-31 00:19:58 +0000335
Chris Lattner7c8c1ba2009-09-01 18:50:55 +0000336 GetElementPtrInst *UGEP = cast<GetElementPtrInst>(U2);
337 ConstantInt *Idx = cast<ConstantInt>(UGEP->getOperand(2));
338 Value *GR = ExtractValueInst::Create(New, Idx->getZExtValue(),
339 "evi", UGEP);
340 while(!UGEP->use_empty()) {
341 // isSafeToUpdateAllCallers has checked that all GEP uses are
342 // LoadInsts
343 LoadInst *L = cast<LoadInst>(*UGEP->use_begin());
344 L->replaceAllUsesWith(GR);
345 L->eraseFromParent();
Devang Patelca891ec2008-02-29 23:34:08 +0000346 }
Chris Lattner7c8c1ba2009-09-01 18:50:55 +0000347 UGEP->eraseFromParent();
348 continue;
Devang Patelca891ec2008-02-29 23:34:08 +0000349 }
350 Call->eraseFromParent();
351 }
Chris Lattner5095e3d2009-08-31 00:19:58 +0000352
353 return NF_CGN;
Devang Patelca891ec2008-02-29 23:34:08 +0000354}
Devang Patela9fe8bb2008-03-04 21:32:09 +0000355