aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2007-02-22 16:39:03 +0000
committerJim Laskey <jlaskey@mac.com>2007-02-22 16:39:03 +0000
commit033c9715d9bf7ce59ad2e466bf0720811b34da08 (patch)
tree6898e30b4530ac3362a3207a437cd085a5d5d33a /lib/CodeGen/BranchFolding.cpp
parenta4e7cd947e378aa3ffe633be227138d8f859c9e3 (diff)
downloadexternal_llvm-033c9715d9bf7ce59ad2e466bf0720811b34da08.zip
external_llvm-033c9715d9bf7ce59ad2e466bf0720811b34da08.tar.gz
external_llvm-033c9715d9bf7ce59ad2e466bf0720811b34da08.tar.bz2
Remove isAccessable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 6c04341..d6bedb8 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -67,7 +67,7 @@ FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); }
/// RemoveDeadBlock - Remove the specified dead machine basic block from the
/// function, updating the CFG.
void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) {
- assert(!MBB->isAccessable() && "MBB must be dead!");
+ assert(MBB->pred_empty() && "MBB must be dead!");
DOUT << "\nRemoving MBB: " << *MBB;
MachineFunction *MF = MBB->getParent();
@@ -440,7 +440,7 @@ bool BranchFolder::OptimizeBranches(MachineFunction &MF) {
OptimizeBlock(MBB);
// If it is dead, remove it.
- if (!MBB->isAccessable()) {
+ if (MBB->pred_empty()) {
RemoveDeadBlock(MBB);
MadeChange = true;
++NumDeadBlocks;
@@ -618,14 +618,14 @@ void BranchFolder::OptimizeBlock(MachineBasicBlock *MBB) {
// explicitly.
if (MBB->empty()) {
// Dead block? Leave for cleanup later.
- if (!MBB->isAccessable()) return;
+ if (MBB->pred_empty()) return;
if (FallThrough == MBB->getParent()->end()) {
// TODO: Simplify preds to not branch here if possible!
} else {
// Rewrite all predecessors of the old block to go to the fallthrough
// instead.
- while (MBB->isAccessable()) {
+ while (!MBB->pred_empty()) {
MachineBasicBlock *Pred = *(MBB->pred_end()-1);
ReplaceUsesOfBlockWith(Pred, MBB, FallThrough, TII);
}