mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Remove some dead variables.
Fix a nasty bug in the memcmp optimizer where we used the wrong variable! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28269 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -41,7 +41,6 @@ Inliner::Inliner() : InlineThreshold(InlineLimit) {}
|
|||||||
// do so and update the CallGraph for this operation.
|
// do so and update the CallGraph for this operation.
|
||||||
static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
|
static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
|
||||||
const std::set<Function*> &SCCFunctions) {
|
const std::set<Function*> &SCCFunctions) {
|
||||||
Function *Caller = CS.getInstruction()->getParent()->getParent();
|
|
||||||
Function *Callee = CS.getCalledFunction();
|
Function *Callee = CS.getCalledFunction();
|
||||||
if (!InlineFunction(CS, &CG)) return false;
|
if (!InlineFunction(CS, &CG)) return false;
|
||||||
|
|
||||||
|
@@ -386,7 +386,7 @@ struct ExitInMainOptimization : public LibCallOptimization {
|
|||||||
// Create a return instruction that we'll replace the call with.
|
// Create a return instruction that we'll replace the call with.
|
||||||
// Note that the argument of the return is the argument of the call
|
// Note that the argument of the return is the argument of the call
|
||||||
// instruction.
|
// 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
|
// Split the block at the call instruction which places it in a new
|
||||||
// basic block.
|
// basic block.
|
||||||
@@ -444,7 +444,6 @@ public:
|
|||||||
/// @brief Optimize the strcat library function
|
/// @brief Optimize the strcat library function
|
||||||
virtual bool OptimizeCall(CallInst* ci, SimplifyLibCalls& SLC) {
|
virtual bool OptimizeCall(CallInst* ci, SimplifyLibCalls& SLC) {
|
||||||
// Extract some information from the instruction
|
// Extract some information from the instruction
|
||||||
Module* M = ci->getParent()->getParent()->getParent();
|
|
||||||
Value* dest = ci->getOperand(1);
|
Value* dest = ci->getOperand(1);
|
||||||
Value* src = ci->getOperand(2);
|
Value* src = ci->getOperand(2);
|
||||||
|
|
||||||
@@ -807,9 +806,6 @@ public:
|
|||||||
// terminator as well.
|
// terminator as well.
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
// Extract some information from the instruction
|
|
||||||
Module* M = ci->getParent()->getParent()->getParent();
|
|
||||||
|
|
||||||
// We have enough information to now generate the memcpy call to
|
// We have enough information to now generate the memcpy call to
|
||||||
// do the concatenation for us.
|
// do the concatenation for us.
|
||||||
std::vector<Value*> vals;
|
std::vector<Value*> vals;
|
||||||
@@ -996,7 +992,7 @@ struct memcmpOptimization : public LibCallOptimization {
|
|||||||
Value *G1 = new GetElementPtrInst(Op1Cast, One, "next1v", CI);
|
Value *G1 = new GetElementPtrInst(Op1Cast, One, "next1v", CI);
|
||||||
Value *G2 = new GetElementPtrInst(Op2Cast, One, "next2v", CI);
|
Value *G2 = new GetElementPtrInst(Op2Cast, One, "next2v", CI);
|
||||||
Value *S1V2 = new LoadInst(G1, LHS->getName()+".val2", 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,
|
Value *D2 = BinaryOperator::createSub(S1V2, S2V2,
|
||||||
CI->getName()+".d1", CI);
|
CI->getName()+".d1", CI);
|
||||||
Value *Or = BinaryOperator::createOr(D1, D2, CI->getName()+".res", CI);
|
Value *Or = BinaryOperator::createOr(D1, D2, CI->getName()+".res", CI);
|
||||||
|
Reference in New Issue
Block a user