mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
improve encapsulation of the BBExecutable set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -224,10 +224,8 @@ public:
|
|||||||
/// should be rerun.
|
/// should be rerun.
|
||||||
bool ResolvedUndefsIn(Function &F);
|
bool ResolvedUndefsIn(Function &F);
|
||||||
|
|
||||||
/// getExecutableBlocks - Once we have solved for constants, return the set of
|
bool isBlockExecutable(BasicBlock *BB) const {
|
||||||
/// blocks that is known to be executable.
|
return BBExecutable.count(BB);
|
||||||
DenseSet<BasicBlock*> &getExecutableBlocks() {
|
|
||||||
return BBExecutable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getValueMapping - Once we have solved for constants, return the mapping of
|
/// getValueMapping - Once we have solved for constants, return the mapping of
|
||||||
@ -1550,12 +1548,11 @@ bool SCCP::runOnFunction(Function &F) {
|
|||||||
// delete their contents now. Note that we cannot actually delete the blocks,
|
// delete their contents now. Note that we cannot actually delete the blocks,
|
||||||
// as we cannot modify the CFG of the function.
|
// as we cannot modify the CFG of the function.
|
||||||
//
|
//
|
||||||
DenseSet<BasicBlock*> &ExecutableBBs = Solver.getExecutableBlocks();
|
|
||||||
SmallVector<Instruction*, 512> Insts;
|
SmallVector<Instruction*, 512> Insts;
|
||||||
std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
|
std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
|
||||||
|
|
||||||
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
|
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
|
||||||
if (!ExecutableBBs.count(BB)) {
|
if (!Solver.isBlockExecutable(BB)) {
|
||||||
DOUT << " BasicBlock Dead:" << *BB;
|
DOUT << " BasicBlock Dead:" << *BB;
|
||||||
++NumDeadBlocks;
|
++NumDeadBlocks;
|
||||||
|
|
||||||
@ -1695,7 +1692,6 @@ bool IPSCCP::runOnModule(Module &M) {
|
|||||||
// Iterate over all of the instructions in the module, replacing them with
|
// Iterate over all of the instructions in the module, replacing them with
|
||||||
// constants if we have found them to be of constant values.
|
// constants if we have found them to be of constant values.
|
||||||
//
|
//
|
||||||
DenseSet<BasicBlock*> &ExecutableBBs = Solver.getExecutableBlocks();
|
|
||||||
SmallVector<Instruction*, 512> Insts;
|
SmallVector<Instruction*, 512> Insts;
|
||||||
SmallVector<BasicBlock*, 512> BlocksToErase;
|
SmallVector<BasicBlock*, 512> BlocksToErase;
|
||||||
std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
|
std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
|
||||||
@ -1718,7 +1714,7 @@ bool IPSCCP::runOnModule(Module &M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
|
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
|
||||||
if (!ExecutableBBs.count(BB)) {
|
if (!Solver.isBlockExecutable(BB)) {
|
||||||
DOUT << " BasicBlock Dead:" << *BB;
|
DOUT << " BasicBlock Dead:" << *BB;
|
||||||
++IPNumDeadBlocks;
|
++IPNumDeadBlocks;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user