mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Fix a couple of places where changes are made but not tracked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129287 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e679d3331b
commit
cfea985f53
@ -365,6 +365,8 @@ bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) {
|
||||
if (!FoundCSE) {
|
||||
// Look for trivial copy coalescing opportunities.
|
||||
if (PerformTrivialCoalescing(MI, MBB)) {
|
||||
Changed = true;
|
||||
|
||||
// After coalescing MI itself may become a copy.
|
||||
if (MI->isCopyLike())
|
||||
continue;
|
||||
@ -379,10 +381,11 @@ bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) {
|
||||
if (NewMI) {
|
||||
Commuted = true;
|
||||
FoundCSE = VNT.count(NewMI);
|
||||
if (NewMI != MI)
|
||||
if (NewMI != MI) {
|
||||
// New instruction. It doesn't need to be kept.
|
||||
NewMI->eraseFromParent();
|
||||
else if (!FoundCSE)
|
||||
Changed = true;
|
||||
} else if (!FoundCSE)
|
||||
// MI was changed but it didn't help, commute it back!
|
||||
(void)TII->commuteInstruction(MI);
|
||||
}
|
||||
@ -450,6 +453,7 @@ bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) {
|
||||
++NumPhysCSEs;
|
||||
if (Commuted)
|
||||
++NumCommutes;
|
||||
Changed = true;
|
||||
} else {
|
||||
DEBUG(dbgs() << "*** Not profitable, avoid CSE!\n");
|
||||
VNT.insert(MI, CurrVN++);
|
||||
|
@ -265,8 +265,11 @@ bool MachineSinking::ProcessBlock(MachineBasicBlock &MBB) {
|
||||
if (MI->isDebugValue())
|
||||
continue;
|
||||
|
||||
if (PerformTrivialForwardCoalescing(MI, &MBB))
|
||||
bool Joined = PerformTrivialForwardCoalescing(MI, &MBB);
|
||||
if (Joined) {
|
||||
MadeChange = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SinkInstruction(MI, SawStore))
|
||||
++NumSunk, MadeChange = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user