summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-12 23:35:26 +0000
committerChris Lattner <sabre@nondot.org>2006-05-12 23:35:26 +0000
commitcd60d38b3017e6433d5eddea5263921fa3f7cc24 (patch)
treeb919cd7fcd51afdd2e912d6a43573340ca5e95c9 /llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
parent94acc476542c692d2bad45f6f85d47dbe0d88d57 (diff)
downloadbcm5719-llvm-cd60d38b3017e6433d5eddea5263921fa3f7cc24.tar.gz
bcm5719-llvm-cd60d38b3017e6433d5eddea5263921fa3f7cc24.zip
Remove some dead variables.
Fix a nasty bug in the memcmp optimizer where we used the wrong variable! llvm-svn: 28269
Diffstat (limited to 'llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
index f4650be9877..fefb100c37f 100644
--- a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -386,7 +386,7 @@ struct ExitInMainOptimization : public LibCallOptimization {
// Create a return instruction that we'll replace the call with.
// Note that the argument of the return is the argument of the call
// instruction.
- ReturnInst* ri = new ReturnInst(ci->getOperand(1), ci);
+ new ReturnInst(ci->getOperand(1), ci);
// Split the block at the call instruction which places it in a new
// basic block.
@@ -444,7 +444,6 @@ public:
/// @brief Optimize the strcat library function
virtual bool OptimizeCall(CallInst* ci, SimplifyLibCalls& SLC) {
// Extract some information from the instruction
- Module* M = ci->getParent()->getParent()->getParent();
Value* dest = ci->getOperand(1);
Value* src = ci->getOperand(2);
@@ -807,9 +806,6 @@ public:
// terminator as well.
len++;
- // Extract some information from the instruction
- Module* M = ci->getParent()->getParent()->getParent();
-
// We have enough information to now generate the memcpy call to
// do the concatenation for us.
std::vector<Value*> vals;
@@ -996,7 +992,7 @@ struct memcmpOptimization : public LibCallOptimization {
Value *G1 = new GetElementPtrInst(Op1Cast, One, "next1v", CI);
Value *G2 = new GetElementPtrInst(Op2Cast, One, "next2v", CI);
Value *S1V2 = new LoadInst(G1, LHS->getName()+".val2", CI);
- Value *S2V2 = new LoadInst(G1, RHS->getName()+".val2", CI);
+ Value *S2V2 = new LoadInst(G2, RHS->getName()+".val2", CI);
Value *D2 = BinaryOperator::createSub(S1V2, S2V2,
CI->getName()+".d1", CI);
Value *Or = BinaryOperator::createOr(D1, D2, CI->getName()+".res", CI);
OpenPOWER on IntegriCloud