[llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp
Evan Cheng
evan.cheng at apple.com
Wed May 16 13:56:28 PDT 2007
Changes in directory llvm/lib/CodeGen:
IfConversion.cpp updated: 1.2 -> 1.3
---
Log message:
Rename M_PREDICATED to M_PREDICABLE; Moved isPredicable() to MachineInstr.
---
Diffs of the changes: (+12 -12)
IfConversion.cpp | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.2 llvm/lib/CodeGen/IfConversion.cpp:1.3
--- llvm/lib/CodeGen/IfConversion.cpp:1.2 Wed May 16 00:11:10 2007
+++ llvm/lib/CodeGen/IfConversion.cpp Wed May 16 15:56:08 2007
@@ -68,7 +68,7 @@
std::vector<int> &Candidates);
bool IfConvertDiamond(BBInfo &BBI);
bool IfConvertTriangle(BBInfo &BBI);
- bool isBlockPredicatable(MachineBasicBlock *BB,
+ bool isBlockPredicable(MachineBasicBlock *BB,
bool IgnoreTerm = false) const;
void PredicateBlock(MachineBasicBlock *BB,
std::vector<MachineOperand> &Cond,
@@ -190,7 +190,7 @@
}
bool IfConverter::IfConvertTriangle(BBInfo &BBI) {
- if (isBlockPredicatable(BBI.TBB, true)) {
+ if (isBlockPredicable(BBI.TBB, true)) {
// Predicate the 'true' block after removing its branch.
TII->RemoveBranch(*BBI.TBB);
PredicateBlock(BBI.TBB, BBI.Cond);
@@ -214,28 +214,28 @@
}
bool IfConverter::IfConvertDiamond(BBInfo &BBI) {
- if (isBlockPredicatable(BBI.TBB, true) &&
- isBlockPredicatable(BBI.FBB, true)) {
+ if (isBlockPredicable(BBI.TBB, true) &&
+ isBlockPredicable(BBI.FBB, true)) {
std::vector<MachineInstr*> Dups;
if (!BBI.CMBB) {
// No common merge block. Check if the terminators (e.g. return) are
- // the same or predicatable.
+ // the same or predicable.
MachineBasicBlock::iterator TT = BBI.TBB->getFirstTerminator();
MachineBasicBlock::iterator FT = BBI.FBB->getFirstTerminator();
while (TT != BBI.TBB->end() && FT != BBI.FBB->end()) {
if (TT->isIdenticalTo(FT))
Dups.push_back(TT); // Will erase these later.
- else if (!TII->isPredicatable(TT) && !TII->isPredicatable(FT))
+ else if (!TT->isPredicable() && !FT->isPredicable())
return false; // Can't if-convert. Abort!
++TT;
++FT;
}
while (TT != BBI.TBB->end())
- if (!TII->isPredicatable(TT))
+ if (!TT->isPredicable())
return false; // Can't if-convert. Abort!
while (FT != BBI.FBB->end())
- if (!TII->isPredicatable(FT))
+ if (!FT->isPredicable())
return false; // Can't if-convert. Abort!
}
@@ -270,17 +270,17 @@
return false;
}
-/// isBlockPredicatable - Returns true if the block is predicatable. In most
-/// cases, that means all the instructions in the block has M_PREDICATED flag.
+/// isBlockPredicable - Returns true if the block is predicable. In most
+/// cases, that means all the instructions in the block has M_PREDICABLE flag.
/// If IgnoreTerm is true, assume all the terminator instructions can be
/// converted or deleted.
-bool IfConverter::isBlockPredicatable(MachineBasicBlock *BB,
+bool IfConverter::isBlockPredicable(MachineBasicBlock *BB,
bool IgnoreTerm) const {
for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end();
I != E; ++I) {
if (IgnoreTerm && TII->isTerminatorInstr(I->getOpcode()))
continue;
- if (!TII->isPredicatable(I))
+ if (!I->isPredicable())
return false;
}
return true;
More information about the llvm-commits
mailing list