mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Add hidden -verify-coalescing to run the machine code verifier before and after
register coalescing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -65,6 +65,11 @@ DisablePhysicalJoin("disable-physical-join",
|
|||||||
cl::desc("Avoid coalescing physical register copies"),
|
cl::desc("Avoid coalescing physical register copies"),
|
||||||
cl::init(false), cl::Hidden);
|
cl::init(false), cl::Hidden);
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
VerifyCoalescing("verify-coalescing",
|
||||||
|
cl::desc("Verify machine instrs before and after register coalescing"),
|
||||||
|
cl::Hidden);
|
||||||
|
|
||||||
INITIALIZE_AG_PASS_BEGIN(SimpleRegisterCoalescing, RegisterCoalescer,
|
INITIALIZE_AG_PASS_BEGIN(SimpleRegisterCoalescing, RegisterCoalescer,
|
||||||
"simple-register-coalescing", "Simple Register Coalescing",
|
"simple-register-coalescing", "Simple Register Coalescing",
|
||||||
false, false, true)
|
false, false, true)
|
||||||
@ -1635,6 +1640,9 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
|
|||||||
<< "********** Function: "
|
<< "********** Function: "
|
||||||
<< ((Value*)mf_->getFunction())->getName() << '\n');
|
<< ((Value*)mf_->getFunction())->getName() << '\n');
|
||||||
|
|
||||||
|
if (VerifyCoalescing)
|
||||||
|
mf_->verify(this, "Before register coalescing");
|
||||||
|
|
||||||
for (TargetRegisterInfo::regclass_iterator I = tri_->regclass_begin(),
|
for (TargetRegisterInfo::regclass_iterator I = tri_->regclass_begin(),
|
||||||
E = tri_->regclass_end(); I != E; ++I)
|
E = tri_->regclass_end(); I != E; ++I)
|
||||||
allocatableRCRegs_.insert(std::make_pair(*I,
|
allocatableRCRegs_.insert(std::make_pair(*I,
|
||||||
@ -1777,6 +1785,8 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
|
|||||||
|
|
||||||
DEBUG(dump());
|
DEBUG(dump());
|
||||||
DEBUG(ldv_->dump());
|
DEBUG(ldv_->dump());
|
||||||
|
if (VerifyCoalescing)
|
||||||
|
mf_->verify(this, "After register coalescing");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user