Update llvm to release_39 branch r279689.
This commit is contained in:
parent
57e762fbe3
commit
4354b878f3
@ -1538,17 +1538,6 @@ static bool tryToReplaceWithConstant(SCCPSolver &Solver, Value *V) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool tryToReplaceInstWithConstant(SCCPSolver &Solver, Instruction *Inst,
|
|
||||||
bool shouldEraseFromParent) {
|
|
||||||
if (!tryToReplaceWithConstant(Solver, Inst))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Delete the instruction.
|
|
||||||
if (shouldEraseFromParent)
|
|
||||||
Inst->eraseFromParent();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// runSCCP() - Run the Sparse Conditional Constant Propagation algorithm,
|
// runSCCP() - Run the Sparse Conditional Constant Propagation algorithm,
|
||||||
// and return true if the function was modified.
|
// and return true if the function was modified.
|
||||||
//
|
//
|
||||||
@ -1597,8 +1586,9 @@ static bool runSCCP(Function &F, const DataLayout &DL,
|
|||||||
if (Inst->getType()->isVoidTy() || isa<TerminatorInst>(Inst))
|
if (Inst->getType()->isVoidTy() || isa<TerminatorInst>(Inst))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (tryToReplaceInstWithConstant(Solver, Inst,
|
if (tryToReplaceWithConstant(Solver, Inst)) {
|
||||||
true /* shouldEraseFromParent */)) {
|
if (isInstructionTriviallyDead(Inst))
|
||||||
|
Inst->eraseFromParent();
|
||||||
// Hey, we just changed something!
|
// Hey, we just changed something!
|
||||||
MadeChanges = true;
|
MadeChanges = true;
|
||||||
++NumInstRemoved;
|
++NumInstRemoved;
|
||||||
@ -1789,10 +1779,9 @@ static bool runIPSCCP(Module &M, const DataLayout &DL,
|
|||||||
Instruction *Inst = &*BI++;
|
Instruction *Inst = &*BI++;
|
||||||
if (Inst->getType()->isVoidTy())
|
if (Inst->getType()->isVoidTy())
|
||||||
continue;
|
continue;
|
||||||
if (tryToReplaceInstWithConstant(
|
if (tryToReplaceWithConstant(Solver, Inst)) {
|
||||||
Solver, Inst,
|
if (!isa<CallInst>(Inst) && !isa<TerminatorInst>(Inst))
|
||||||
!isa<CallInst>(Inst) &&
|
Inst->eraseFromParent();
|
||||||
!isa<TerminatorInst>(Inst) /* shouldEraseFromParent */)) {
|
|
||||||
// Hey, we just changed something!
|
// Hey, we just changed something!
|
||||||
MadeChanges = true;
|
MadeChanges = true;
|
||||||
++IPNumInstRemoved;
|
++IPNumInstRemoved;
|
||||||
|
@ -7,4 +7,4 @@
|
|||||||
|
|
||||||
#define CLANG_VENDOR "FreeBSD "
|
#define CLANG_VENDOR "FreeBSD "
|
||||||
|
|
||||||
#define SVN_REVISION "279477"
|
#define SVN_REVISION "279689"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user