mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Add some statistics to StrongPHIElimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125477 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
||||||
#include "llvm/Target/TargetInstrInfo.h"
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@@ -187,6 +188,10 @@ namespace {
|
|||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
STATISTIC(NumPHIsLowered, "Number of PHIs lowered");
|
||||||
|
STATISTIC(NumDestCopiesInserted, "Number of destination copies inserted");
|
||||||
|
STATISTIC(NumSrcCopiesInserted, "Number of source copies inserted");
|
||||||
|
|
||||||
char StrongPHIElimination::ID = 0;
|
char StrongPHIElimination::ID = 0;
|
||||||
INITIALIZE_PASS_BEGIN(StrongPHIElimination, "strong-phi-node-elimination",
|
INITIALIZE_PASS_BEGIN(StrongPHIElimination, "strong-phi-node-elimination",
|
||||||
"Eliminate PHI nodes for register allocation, intelligently", false, false)
|
"Eliminate PHI nodes for register allocation, intelligently", false, false)
|
||||||
@@ -645,6 +650,7 @@ StrongPHIElimination::SplitInterferencesForBasicBlock(
|
|||||||
void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI,
|
void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI,
|
||||||
MachineBasicBlock *MBB) {
|
MachineBasicBlock *MBB) {
|
||||||
assert(PHI->isPHI());
|
assert(PHI->isPHI());
|
||||||
|
++NumPHIsLowered;
|
||||||
unsigned PHIColor = getPHIColor(PHI);
|
unsigned PHIColor = getPHIColor(PHI);
|
||||||
|
|
||||||
for (unsigned i = 1; i < PHI->getNumOperands(); i += 2) {
|
for (unsigned i = 1; i < PHI->getNumOperands(); i += 2) {
|
||||||
@@ -694,6 +700,7 @@ void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI,
|
|||||||
TII->get(TargetOpcode::COPY),
|
TII->get(TargetOpcode::COPY),
|
||||||
CopyReg).addReg(SrcReg, 0, SrcSubReg);
|
CopyReg).addReg(SrcReg, 0, SrcSubReg);
|
||||||
LI->InsertMachineInstrInMaps(CopyInstr);
|
LI->InsertMachineInstrInMaps(CopyInstr);
|
||||||
|
++NumSrcCopiesInserted;
|
||||||
|
|
||||||
// addLiveRangeToEndOfBlock() also adds the phikill flag to the VNInfo for
|
// addLiveRangeToEndOfBlock() also adds the phikill flag to the VNInfo for
|
||||||
// the newly added range.
|
// the newly added range.
|
||||||
@@ -763,6 +770,7 @@ void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI,
|
|||||||
DestReg).addReg(CopyReg);
|
DestReg).addReg(CopyReg);
|
||||||
LI->InsertMachineInstrInMaps(CopyInstr);
|
LI->InsertMachineInstrInMaps(CopyInstr);
|
||||||
PHI->getOperand(0).setReg(CopyReg);
|
PHI->getOperand(0).setReg(CopyReg);
|
||||||
|
++NumDestCopiesInserted;
|
||||||
|
|
||||||
// Add the region from the beginning of MBB to the copy instruction to
|
// Add the region from the beginning of MBB to the copy instruction to
|
||||||
// CopyReg's live interval, and give the VNInfo the phidef flag.
|
// CopyReg's live interval, and give the VNInfo the phidef flag.
|
||||||
|
Reference in New Issue
Block a user