2004-05-23 21:19:22 +00:00
|
|
|
//===-- LowerGC.cpp - Provide GC support for targets that don't -----------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements lowering for the llvm.gc* intrinsics for targets that do
|
|
|
|
// not natively support them (which includes the C backend). Note that the code
|
|
|
|
// generated is not as efficient as it would be for targets that natively
|
|
|
|
// support the GC intrinsics, but it is useful for getting new targets
|
|
|
|
// up-and-running quickly.
|
|
|
|
//
|
|
|
|
// This pass implements the code transformation described in this paper:
|
|
|
|
// "Accurate Garbage Collection in an Uncooperative Environment"
|
2004-05-23 21:27:29 +00:00
|
|
|
// Fergus Henderson, ISMM, 2002
|
2004-05-23 21:19:22 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#define DEBUG_TYPE "lowergc"
|
|
|
|
#include "llvm/Transforms/Scalar.h"
|
|
|
|
#include "llvm/Constants.h"
|
|
|
|
#include "llvm/DerivedTypes.h"
|
|
|
|
#include "llvm/Instructions.h"
|
|
|
|
#include "llvm/Module.h"
|
|
|
|
#include "llvm/Pass.h"
|
2006-08-27 12:54:02 +00:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2007-08-01 03:43:44 +00:00
|
|
|
#include "llvm/ADT/SmallVector.h"
|
2004-05-23 21:19:22 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
2006-06-28 22:08:15 +00:00
|
|
|
class VISIBILITY_HIDDEN LowerGC : public FunctionPass {
|
2004-05-23 21:19:22 +00:00
|
|
|
/// GCRootInt, GCReadInt, GCWriteInt - The function prototypes for the
|
|
|
|
/// llvm.gcread/llvm.gcwrite/llvm.gcroot intrinsics.
|
|
|
|
Function *GCRootInt, *GCReadInt, *GCWriteInt;
|
|
|
|
|
|
|
|
/// GCRead/GCWrite - These are the functions provided by the garbage
|
|
|
|
/// collector for read/write barriers.
|
2007-01-07 06:58:05 +00:00
|
|
|
Constant *GCRead, *GCWrite;
|
2004-05-23 21:19:22 +00:00
|
|
|
|
|
|
|
/// RootChain - This is the global linked-list that contains the chain of GC
|
|
|
|
/// roots.
|
|
|
|
GlobalVariable *RootChain;
|
|
|
|
|
|
|
|
/// MainRootRecordType - This is the type for a function root entry if it
|
|
|
|
/// had zero roots.
|
|
|
|
const Type *MainRootRecordType;
|
|
|
|
public:
|
2007-05-06 13:37:16 +00:00
|
|
|
static char ID; // Pass identification, replacement for typeid
|
2007-05-01 21:15:47 +00:00
|
|
|
LowerGC() : FunctionPass((intptr_t)&ID),
|
|
|
|
GCRootInt(0), GCReadInt(0), GCWriteInt(0),
|
2004-05-23 21:19:22 +00:00
|
|
|
GCRead(0), GCWrite(0), RootChain(0), MainRootRecordType(0) {}
|
|
|
|
virtual bool doInitialization(Module &M);
|
|
|
|
virtual bool runOnFunction(Function &F);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const StructType *getRootRecordType(unsigned NumRoots);
|
|
|
|
};
|
|
|
|
|
2007-05-03 01:11:54 +00:00
|
|
|
char LowerGC::ID = 0;
|
2006-08-27 22:42:52 +00:00
|
|
|
RegisterPass<LowerGC>
|
2004-05-23 21:19:22 +00:00
|
|
|
X("lowergc", "Lower GC intrinsics, for GCless code generators");
|
|
|
|
}
|
|
|
|
|
|
|
|
/// createLowerGCPass - This function returns an instance of the "lowergc"
|
|
|
|
/// pass, which lowers garbage collection intrinsics to normal LLVM code.
|
|
|
|
FunctionPass *llvm::createLowerGCPass() {
|
|
|
|
return new LowerGC();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// getRootRecordType - This function creates and returns the type for a root
|
|
|
|
/// record containing 'NumRoots' roots.
|
|
|
|
const StructType *LowerGC::getRootRecordType(unsigned NumRoots) {
|
|
|
|
// Build a struct that is a type used for meta-data/root pairs.
|
|
|
|
std::vector<const Type *> ST;
|
|
|
|
ST.push_back(GCRootInt->getFunctionType()->getParamType(0));
|
|
|
|
ST.push_back(GCRootInt->getFunctionType()->getParamType(1));
|
|
|
|
StructType *PairTy = StructType::get(ST);
|
|
|
|
|
|
|
|
// Build the array of pairs.
|
|
|
|
ArrayType *PairArrTy = ArrayType::get(PairTy, NumRoots);
|
|
|
|
|
|
|
|
// Now build the recursive list type.
|
|
|
|
PATypeHolder RootListH =
|
|
|
|
MainRootRecordType ? (Type*)MainRootRecordType : (Type*)OpaqueType::get();
|
|
|
|
ST.clear();
|
|
|
|
ST.push_back(PointerType::get(RootListH)); // Prev pointer
|
2006-12-31 05:48:39 +00:00
|
|
|
ST.push_back(Type::Int32Ty); // NumElements in array
|
2004-05-23 21:19:22 +00:00
|
|
|
ST.push_back(PairArrTy); // The pairs
|
|
|
|
StructType *RootList = StructType::get(ST);
|
|
|
|
if (MainRootRecordType)
|
|
|
|
return RootList;
|
|
|
|
|
|
|
|
assert(NumRoots == 0 && "The main struct type should have zero entries!");
|
|
|
|
cast<OpaqueType>((Type*)RootListH.get())->refineAbstractTypeTo(RootList);
|
|
|
|
MainRootRecordType = RootListH;
|
|
|
|
return cast<StructType>(RootListH.get());
|
|
|
|
}
|
|
|
|
|
|
|
|
/// doInitialization - If this module uses the GC intrinsics, find them now. If
|
|
|
|
/// not, this pass does not do anything.
|
|
|
|
bool LowerGC::doInitialization(Module &M) {
|
2007-02-05 21:19:13 +00:00
|
|
|
GCRootInt = M.getFunction("llvm.gcroot");
|
|
|
|
GCReadInt = M.getFunction("llvm.gcread");
|
|
|
|
GCWriteInt = M.getFunction("llvm.gcwrite");
|
2004-05-23 21:19:22 +00:00
|
|
|
if (!GCRootInt && !GCReadInt && !GCWriteInt) return false;
|
|
|
|
|
2006-12-31 05:48:39 +00:00
|
|
|
PointerType *VoidPtr = PointerType::get(Type::Int8Ty);
|
2004-05-23 21:19:22 +00:00
|
|
|
PointerType *VoidPtrPtr = PointerType::get(VoidPtr);
|
|
|
|
|
|
|
|
// If the program is using read/write barriers, find the implementations of
|
|
|
|
// them from the GC runtime library.
|
|
|
|
if (GCReadInt) // Make: sbyte* %llvm_gc_read(sbyte**)
|
2005-10-23 04:37:20 +00:00
|
|
|
GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtr, VoidPtrPtr,
|
|
|
|
(Type *)0);
|
2004-05-23 21:19:22 +00:00
|
|
|
if (GCWriteInt) // Make: void %llvm_gc_write(sbyte*, sbyte**)
|
|
|
|
GCWrite = M.getOrInsertFunction("llvm_gc_write", Type::VoidTy,
|
2005-10-23 04:37:20 +00:00
|
|
|
VoidPtr, VoidPtr, VoidPtrPtr, (Type *)0);
|
2004-05-23 21:19:22 +00:00
|
|
|
|
|
|
|
// If the program has GC roots, get or create the global root list.
|
|
|
|
if (GCRootInt) {
|
|
|
|
const StructType *RootListTy = getRootRecordType(0);
|
|
|
|
const Type *PRLTy = PointerType::get(RootListTy);
|
|
|
|
M.addTypeName("llvm_gc_root_ty", RootListTy);
|
|
|
|
|
|
|
|
// Get the root chain if it already exists.
|
|
|
|
RootChain = M.getGlobalVariable("llvm_gc_root_chain", PRLTy);
|
|
|
|
if (RootChain == 0) {
|
|
|
|
// If the root chain does not exist, insert a new one with linkonce
|
|
|
|
// linkage!
|
2005-04-21 23:48:37 +00:00
|
|
|
RootChain = new GlobalVariable(PRLTy, false,
|
2004-10-27 03:55:24 +00:00
|
|
|
GlobalValue::LinkOnceLinkage,
|
|
|
|
Constant::getNullValue(PRLTy),
|
2004-05-23 21:19:22 +00:00
|
|
|
"llvm_gc_root_chain", &M);
|
2007-01-30 20:08:39 +00:00
|
|
|
} else if (RootChain->hasExternalLinkage() && RootChain->isDeclaration()) {
|
2004-05-23 21:19:22 +00:00
|
|
|
RootChain->setInitializer(Constant::getNullValue(PRLTy));
|
|
|
|
RootChain->setLinkage(GlobalValue::LinkOnceLinkage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Coerce - If the specified operand number of the specified instruction does
|
2006-11-27 01:05:10 +00:00
|
|
|
/// not have the specified type, insert a cast. Note that this only uses BitCast
|
|
|
|
/// because the types involved are all pointers.
|
2004-05-23 21:19:22 +00:00
|
|
|
static void Coerce(Instruction *I, unsigned OpNum, Type *Ty) {
|
|
|
|
if (I->getOperand(OpNum)->getType() != Ty) {
|
2005-04-21 23:48:37 +00:00
|
|
|
if (Constant *C = dyn_cast<Constant>(I->getOperand(OpNum)))
|
2006-11-27 01:05:10 +00:00
|
|
|
I->setOperand(OpNum, ConstantExpr::getBitCast(C, Ty));
|
2004-05-23 21:19:22 +00:00
|
|
|
else {
|
2006-12-13 00:50:17 +00:00
|
|
|
CastInst *CI = new BitCastInst(I->getOperand(OpNum), Ty, "", I);
|
2004-10-18 14:38:48 +00:00
|
|
|
I->setOperand(OpNum, CI);
|
2004-05-23 21:19:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// runOnFunction - If the program is using GC intrinsics, replace any
|
|
|
|
/// read/write intrinsics with the appropriate read/write barrier calls, then
|
2005-04-21 23:48:37 +00:00
|
|
|
/// inline them. Finally, build the data structures for
|
2004-05-23 21:19:22 +00:00
|
|
|
bool LowerGC::runOnFunction(Function &F) {
|
|
|
|
// Quick exit for programs that are not using GC mechanisms.
|
|
|
|
if (!GCRootInt && !GCReadInt && !GCWriteInt) return false;
|
|
|
|
|
2006-12-31 05:48:39 +00:00
|
|
|
PointerType *VoidPtr = PointerType::get(Type::Int8Ty);
|
2004-05-23 21:19:22 +00:00
|
|
|
PointerType *VoidPtrPtr = PointerType::get(VoidPtr);
|
|
|
|
|
|
|
|
// If there are read/write barriers in the program, perform a quick pass over
|
|
|
|
// the function eliminating them. While we are at it, remember where we see
|
|
|
|
// calls to llvm.gcroot.
|
|
|
|
std::vector<CallInst*> GCRoots;
|
|
|
|
std::vector<CallInst*> NormalCalls;
|
|
|
|
|
|
|
|
bool MadeChange = false;
|
|
|
|
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
|
|
|
|
for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E;)
|
|
|
|
if (CallInst *CI = dyn_cast<CallInst>(II++)) {
|
|
|
|
if (!CI->getCalledFunction() ||
|
|
|
|
!CI->getCalledFunction()->getIntrinsicID())
|
|
|
|
NormalCalls.push_back(CI); // Remember all normal function calls.
|
|
|
|
|
|
|
|
if (Function *F = CI->getCalledFunction())
|
|
|
|
if (F == GCRootInt)
|
|
|
|
GCRoots.push_back(CI);
|
|
|
|
else if (F == GCReadInt || F == GCWriteInt) {
|
|
|
|
if (F == GCWriteInt) {
|
|
|
|
// Change a llvm.gcwrite call to call llvm_gc_write instead.
|
|
|
|
CI->setOperand(0, GCWrite);
|
|
|
|
// Insert casts of the operands as needed.
|
|
|
|
Coerce(CI, 1, VoidPtr);
|
2004-07-22 05:51:13 +00:00
|
|
|
Coerce(CI, 2, VoidPtr);
|
|
|
|
Coerce(CI, 3, VoidPtrPtr);
|
2004-05-23 21:19:22 +00:00
|
|
|
} else {
|
2004-07-22 05:51:13 +00:00
|
|
|
Coerce(CI, 1, VoidPtr);
|
|
|
|
Coerce(CI, 2, VoidPtrPtr);
|
2004-05-23 21:19:22 +00:00
|
|
|
if (CI->getType() == VoidPtr) {
|
|
|
|
CI->setOperand(0, GCRead);
|
|
|
|
} else {
|
|
|
|
// Create a whole new call to replace the old one.
|
2007-08-01 03:43:44 +00:00
|
|
|
|
|
|
|
// It sure would be nice to pass op_begin()+1,
|
|
|
|
// op_begin()+2 but it runs into trouble with
|
2007-08-07 16:52:03 +00:00
|
|
|
// CallInst::init's &*iterator, which requires a
|
2007-08-01 03:43:44 +00:00
|
|
|
// conversion from Use* to Value*. The conversion
|
|
|
|
// from Use to Value * is not useful because the
|
|
|
|
// memory for Value * won't be contiguous.
|
2007-08-06 15:09:17 +00:00
|
|
|
Value* Args[] = {
|
|
|
|
CI->getOperand(1),
|
|
|
|
CI->getOperand(2)
|
|
|
|
};
|
|
|
|
CallInst *NC = new CallInst(GCRead, Args, Args + 2,
|
2004-05-23 21:19:22 +00:00
|
|
|
CI->getName(), CI);
|
2006-11-27 01:05:10 +00:00
|
|
|
// These functions only deal with ptr type results so BitCast
|
|
|
|
// is the correct kind of cast (no-op cast).
|
|
|
|
Value *NV = new BitCastInst(NC, CI->getType(), "", CI);
|
2004-05-23 21:19:22 +00:00
|
|
|
CI->replaceAllUsesWith(NV);
|
|
|
|
BB->getInstList().erase(CI);
|
|
|
|
CI = NC;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MadeChange = true;
|
|
|
|
}
|
|
|
|
}
|
2005-04-21 23:48:37 +00:00
|
|
|
|
2004-05-23 21:19:22 +00:00
|
|
|
// If there are no GC roots in this function, then there is no need to create
|
|
|
|
// a GC list record for it.
|
|
|
|
if (GCRoots.empty()) return MadeChange;
|
|
|
|
|
|
|
|
// Okay, there are GC roots in this function. On entry to the function, add a
|
|
|
|
// record to the llvm_gc_root_chain, and remove it on exit.
|
|
|
|
|
|
|
|
// Create the alloca, and zero it out.
|
|
|
|
const StructType *RootListTy = getRootRecordType(GCRoots.size());
|
|
|
|
AllocaInst *AI = new AllocaInst(RootListTy, 0, "gcroots", F.begin()->begin());
|
|
|
|
|
|
|
|
// Insert the memset call after all of the allocas in the function.
|
|
|
|
BasicBlock::iterator IP = AI;
|
|
|
|
while (isa<AllocaInst>(IP)) ++IP;
|
|
|
|
|
2006-12-31 05:48:39 +00:00
|
|
|
Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
|
|
|
|
Constant *One = ConstantInt::get(Type::Int32Ty, 1);
|
2004-05-23 21:19:22 +00:00
|
|
|
|
2007-09-04 15:46:09 +00:00
|
|
|
Value *Idx[2] = { Zero, Zero };
|
|
|
|
|
2004-05-23 21:19:22 +00:00
|
|
|
// Get a pointer to the prev pointer.
|
2007-09-04 15:46:09 +00:00
|
|
|
Value *PrevPtrPtr = new GetElementPtrInst(AI, Idx, Idx + 2,
|
|
|
|
"prevptrptr", IP);
|
2004-05-23 21:19:22 +00:00
|
|
|
|
|
|
|
// Load the previous pointer.
|
|
|
|
Value *PrevPtr = new LoadInst(RootChain, "prevptr", IP);
|
|
|
|
// Store the previous pointer into the prevptrptr
|
|
|
|
new StoreInst(PrevPtr, PrevPtrPtr, IP);
|
|
|
|
|
|
|
|
// Set the number of elements in this record.
|
2007-09-04 15:46:09 +00:00
|
|
|
Idx[1] = One;
|
|
|
|
Value *NumEltsPtr = new GetElementPtrInst(AI, Idx, Idx + 2,
|
|
|
|
"numeltsptr", IP);
|
2006-12-31 05:48:39 +00:00
|
|
|
new StoreInst(ConstantInt::get(Type::Int32Ty, GCRoots.size()), NumEltsPtr,IP);
|
2004-05-23 21:19:22 +00:00
|
|
|
|
2007-01-31 20:08:52 +00:00
|
|
|
Value* Par[4];
|
|
|
|
Par[0] = Zero;
|
2006-12-31 05:48:39 +00:00
|
|
|
Par[1] = ConstantInt::get(Type::Int32Ty, 2);
|
2004-05-23 21:19:22 +00:00
|
|
|
|
|
|
|
const PointerType *PtrLocTy =
|
|
|
|
cast<PointerType>(GCRootInt->getFunctionType()->getParamType(0));
|
|
|
|
Constant *Null = ConstantPointerNull::get(PtrLocTy);
|
|
|
|
|
2007-09-01 02:00:51 +00:00
|
|
|
// Initialize all of the gcroot records now.
|
2004-05-23 21:19:22 +00:00
|
|
|
for (unsigned i = 0, e = GCRoots.size(); i != e; ++i) {
|
|
|
|
// Initialize the meta-data pointer.
|
2006-12-31 05:48:39 +00:00
|
|
|
Par[2] = ConstantInt::get(Type::Int32Ty, i);
|
2004-05-23 21:19:22 +00:00
|
|
|
Par[3] = One;
|
2007-09-04 15:46:09 +00:00
|
|
|
Value *MetaDataPtr = new GetElementPtrInst(AI, Par, Par + 4,
|
|
|
|
"MetaDataPtr", IP);
|
2004-07-18 00:29:57 +00:00
|
|
|
assert(isa<Constant>(GCRoots[i]->getOperand(2)) && "Must be a constant");
|
2004-05-23 21:19:22 +00:00
|
|
|
new StoreInst(GCRoots[i]->getOperand(2), MetaDataPtr, IP);
|
|
|
|
|
|
|
|
// Initialize the root pointer to null on entry to the function.
|
|
|
|
Par[3] = Zero;
|
2007-09-04 15:46:09 +00:00
|
|
|
Value *RootPtrPtr = new GetElementPtrInst(AI, Par, Par + 4,
|
|
|
|
"RootEntPtr", IP);
|
2004-05-23 21:19:22 +00:00
|
|
|
new StoreInst(Null, RootPtrPtr, IP);
|
2005-04-21 23:48:37 +00:00
|
|
|
|
2004-05-23 21:19:22 +00:00
|
|
|
// Each occurrance of the llvm.gcroot intrinsic now turns into an
|
2007-09-12 17:53:10 +00:00
|
|
|
// initialization of the slot with the address.
|
2004-05-23 21:19:22 +00:00
|
|
|
new StoreInst(GCRoots[i]->getOperand(1), RootPtrPtr, GCRoots[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now that the record is all initialized, store the pointer into the global
|
|
|
|
// pointer.
|
2006-11-27 01:05:10 +00:00
|
|
|
Value *C = new BitCastInst(AI, PointerType::get(MainRootRecordType), "", IP);
|
2004-05-23 21:19:22 +00:00
|
|
|
new StoreInst(C, RootChain, IP);
|
|
|
|
|
2007-09-01 02:00:51 +00:00
|
|
|
// Eliminate all the gcroot records now.
|
|
|
|
for (unsigned i = 0, e = GCRoots.size(); i != e; ++i)
|
|
|
|
GCRoots[i]->getParent()->getInstList().erase(GCRoots[i]);
|
|
|
|
|
2004-05-23 21:19:22 +00:00
|
|
|
// On exit from the function we have to remove the entry from the GC root
|
|
|
|
// chain. Doing this is straight-forward for return and unwind instructions:
|
|
|
|
// just insert the appropriate copy.
|
|
|
|
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
|
|
|
|
if (isa<UnwindInst>(BB->getTerminator()) ||
|
|
|
|
isa<ReturnInst>(BB->getTerminator())) {
|
|
|
|
// We could reuse the PrevPtr loaded on entry to the function, but this
|
|
|
|
// would make the value live for the whole function, which is probably a
|
|
|
|
// bad idea. Just reload the value out of our stack entry.
|
|
|
|
PrevPtr = new LoadInst(PrevPtrPtr, "prevptr", BB->getTerminator());
|
|
|
|
new StoreInst(PrevPtr, RootChain, BB->getTerminator());
|
|
|
|
}
|
|
|
|
|
|
|
|
// If an exception is thrown from a callee we have to make sure to
|
|
|
|
// unconditionally take the record off the stack. For this reason, we turn
|
|
|
|
// all call instructions into invoke whose cleanup pops the entry off the
|
|
|
|
// stack. We only insert one cleanup block, which is shared by all invokes.
|
|
|
|
if (!NormalCalls.empty()) {
|
|
|
|
// Create the shared cleanup block.
|
|
|
|
BasicBlock *Cleanup = new BasicBlock("gc_cleanup", &F);
|
|
|
|
UnwindInst *UI = new UnwindInst(Cleanup);
|
|
|
|
PrevPtr = new LoadInst(PrevPtrPtr, "prevptr", UI);
|
|
|
|
new StoreInst(PrevPtr, RootChain, UI);
|
2005-04-21 23:48:37 +00:00
|
|
|
|
2004-05-23 21:19:22 +00:00
|
|
|
// Loop over all of the function calls, turning them into invokes.
|
|
|
|
while (!NormalCalls.empty()) {
|
|
|
|
CallInst *CI = NormalCalls.back();
|
|
|
|
BasicBlock *CBB = CI->getParent();
|
|
|
|
NormalCalls.pop_back();
|
|
|
|
|
|
|
|
// Split the basic block containing the function call.
|
|
|
|
BasicBlock *NewBB = CBB->splitBasicBlock(CI, CBB->getName()+".cont");
|
|
|
|
|
|
|
|
// Remove the unconditional branch inserted at the end of the CBB.
|
|
|
|
CBB->getInstList().pop_back();
|
|
|
|
NewBB->getInstList().remove(CI);
|
2005-04-21 23:48:37 +00:00
|
|
|
|
2004-05-23 21:19:22 +00:00
|
|
|
// Create a new invoke instruction.
|
2007-02-13 02:10:56 +00:00
|
|
|
std::vector<Value*> Args(CI->op_begin()+1, CI->op_end());
|
|
|
|
|
2004-05-23 21:19:22 +00:00
|
|
|
Value *II = new InvokeInst(CI->getCalledValue(), NewBB, Cleanup,
|
2007-08-27 19:04:21 +00:00
|
|
|
Args.begin(), Args.end(), CI->getName(), CBB);
|
2004-05-23 21:19:22 +00:00
|
|
|
CI->replaceAllUsesWith(II);
|
|
|
|
delete CI;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|