mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get. Move a variety of predicates from TargetInstrInfo into TargetInstrDescriptor, which makes it much easier to query a predicate when you don't have TII around. Now you can use MI->getDesc()->isBranch() instead of going through TII, and this is much more efficient anyway. Not all of the predicates have been moved over yet. Update old code that used MI->getInstrDescriptor()->Flags to use the new predicates in many places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -462,8 +462,7 @@ MachineBasicBlock::iterator firstNonBranchInst(MachineBasicBlock *BB,
|
||||
MachineBasicBlock::iterator I = BB->end();
|
||||
while (I != BB->begin()) {
|
||||
--I;
|
||||
const TargetInstrDescriptor *TID = I->getInstrDescriptor();
|
||||
if ((TID->Flags & M_BRANCH_FLAG) == 0)
|
||||
if (!I->getDesc()->isBranch())
|
||||
break;
|
||||
}
|
||||
return I;
|
||||
@@ -522,7 +521,7 @@ bool IfConverter::ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
|
||||
|
||||
/// ScanInstructions - Scan all the instructions in the block to determine if
|
||||
/// the block is predicable. In most cases, that means all the instructions
|
||||
/// in the block has M_PREDICABLE flag. Also checks if the block contains any
|
||||
/// in the block are isPredicable(). Also checks if the block contains any
|
||||
/// instruction which can clobber a predicate (e.g. condition code register).
|
||||
/// If so, the block is not predicable unless it's the last instruction.
|
||||
void IfConverter::ScanInstructions(BBInfo &BBI) {
|
||||
@@ -551,13 +550,12 @@ void IfConverter::ScanInstructions(BBInfo &BBI) {
|
||||
bool SeenCondBr = false;
|
||||
for (MachineBasicBlock::iterator I = BBI.BB->begin(), E = BBI.BB->end();
|
||||
I != E; ++I) {
|
||||
const TargetInstrDescriptor *TID = I->getInstrDescriptor();
|
||||
if ((TID->Flags & M_NOT_DUPLICABLE) != 0)
|
||||
const TargetInstrDescriptor *TID = I->getDesc();
|
||||
if (TID->isNotDuplicable())
|
||||
BBI.CannotBeCopied = true;
|
||||
|
||||
bool isPredicated = TII->isPredicated(I);
|
||||
bool isCondBr = BBI.IsBrAnalyzable &&
|
||||
(TID->Flags & M_BRANCH_FLAG) != 0 && (TID->Flags & M_BARRIER_FLAG) == 0;
|
||||
bool isCondBr = BBI.IsBrAnalyzable && TID->isBranch() && !TID->isBarrier();
|
||||
|
||||
if (!isCondBr) {
|
||||
if (!isPredicated)
|
||||
@@ -594,7 +592,7 @@ void IfConverter::ScanInstructions(BBInfo &BBI) {
|
||||
if (TII->DefinesPredicate(I, PredDefs))
|
||||
BBI.ClobbersPred = true;
|
||||
|
||||
if ((TID->Flags & M_PREDICABLE) == 0) {
|
||||
if (!TID->isPredicable()) {
|
||||
BBI.IsUnpredicable = true;
|
||||
return;
|
||||
}
|
||||
@@ -1136,10 +1134,10 @@ void IfConverter::CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
|
||||
bool IgnoreBr) {
|
||||
for (MachineBasicBlock::iterator I = FromBBI.BB->begin(),
|
||||
E = FromBBI.BB->end(); I != E; ++I) {
|
||||
const TargetInstrDescriptor *TID = I->getInstrDescriptor();
|
||||
const TargetInstrDescriptor *TID = I->getDesc();
|
||||
bool isPredicated = TII->isPredicated(I);
|
||||
// Do not copy the end of the block branches.
|
||||
if (IgnoreBr && !isPredicated && (TID->Flags & M_BRANCH_FLAG) != 0)
|
||||
if (IgnoreBr && !isPredicated && TID->isBranch())
|
||||
break;
|
||||
|
||||
MachineInstr *MI = I->clone();
|
||||
|
Reference in New Issue
Block a user