mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
If the target has V9 instructions, this pass is a noop, don't bother
running it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -12,8 +12,10 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "SparcV8.h"
|
#include "SparcV8.h"
|
||||||
|
#include "SparcV8Subtarget.h"
|
||||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -36,14 +38,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
|
bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
|
||||||
bool runOnMachineFunction(MachineFunction &F) {
|
bool runOnMachineFunction(MachineFunction &F);
|
||||||
bool Changed = false;
|
|
||||||
for (MachineFunction::iterator FI = F.begin(), FE = F.end();
|
|
||||||
FI != FE; ++FI)
|
|
||||||
Changed |= runOnMachineBasicBlock(*FI);
|
|
||||||
return Changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
@@ -122,3 +117,16 @@ bool FPMover::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
}
|
}
|
||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FPMover::runOnMachineFunction(MachineFunction &F) {
|
||||||
|
// If the target has V9 instructions, the fp-mover pseudos will never be
|
||||||
|
// emitted. Avoid a scan of the instructions to improve compile time.
|
||||||
|
if (TM.getSubtarget<SparcV8Subtarget>().isV9())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool Changed = false;
|
||||||
|
for (MachineFunction::iterator FI = F.begin(), FE = F.end();
|
||||||
|
FI != FE; ++FI)
|
||||||
|
Changed |= runOnMachineBasicBlock(*FI);
|
||||||
|
return Changed;
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,8 +12,10 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "SparcV8.h"
|
#include "SparcV8.h"
|
||||||
|
#include "SparcV8Subtarget.h"
|
||||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -36,14 +38,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
|
bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
|
||||||
bool runOnMachineFunction(MachineFunction &F) {
|
bool runOnMachineFunction(MachineFunction &F);
|
||||||
bool Changed = false;
|
|
||||||
for (MachineFunction::iterator FI = F.begin(), FE = F.end();
|
|
||||||
FI != FE; ++FI)
|
|
||||||
Changed |= runOnMachineBasicBlock(*FI);
|
|
||||||
return Changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
@@ -122,3 +117,16 @@ bool FPMover::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
}
|
}
|
||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FPMover::runOnMachineFunction(MachineFunction &F) {
|
||||||
|
// If the target has V9 instructions, the fp-mover pseudos will never be
|
||||||
|
// emitted. Avoid a scan of the instructions to improve compile time.
|
||||||
|
if (TM.getSubtarget<SparcV8Subtarget>().isV9())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool Changed = false;
|
||||||
|
for (MachineFunction::iterator FI = F.begin(), FE = F.end();
|
||||||
|
FI != FE; ++FI)
|
||||||
|
Changed |= runOnMachineBasicBlock(*FI);
|
||||||
|
return Changed;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user