mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227638 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -55,7 +55,6 @@ namespace {
|
||||
|
||||
class SILoadStoreOptimizer : public MachineFunctionPass {
|
||||
private:
|
||||
const TargetMachine *TM;
|
||||
const SIInstrInfo *TII;
|
||||
const SIRegisterInfo *TRI;
|
||||
MachineRegisterInfo *MRI;
|
||||
@@ -86,20 +85,11 @@ private:
|
||||
public:
|
||||
static char ID;
|
||||
|
||||
SILoadStoreOptimizer() :
|
||||
MachineFunctionPass(ID),
|
||||
TM(nullptr),
|
||||
TII(nullptr),
|
||||
TRI(nullptr),
|
||||
MRI(nullptr),
|
||||
LIS(nullptr) {
|
||||
SILoadStoreOptimizer()
|
||||
: MachineFunctionPass(ID), TII(nullptr), TRI(nullptr), MRI(nullptr),
|
||||
LIS(nullptr) {}
|
||||
|
||||
}
|
||||
|
||||
SILoadStoreOptimizer(const TargetMachine &TM_) :
|
||||
MachineFunctionPass(ID),
|
||||
TM(&TM_),
|
||||
TII(static_cast<const SIInstrInfo*>(TM->getSubtargetImpl()->getInstrInfo())) {
|
||||
SILoadStoreOptimizer(const TargetMachine &TM_) : MachineFunctionPass(ID) {
|
||||
initializeSILoadStoreOptimizerPass(*PassRegistry::getPassRegistry());
|
||||
}
|
||||
|
||||
@@ -414,9 +404,9 @@ bool SILoadStoreOptimizer::optimizeBlock(MachineBasicBlock &MBB) {
|
||||
}
|
||||
|
||||
bool SILoadStoreOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
||||
const TargetSubtargetInfo *STM = MF.getTarget().getSubtargetImpl();
|
||||
TRI = static_cast<const SIRegisterInfo*>(STM->getRegisterInfo());
|
||||
TII = static_cast<const SIInstrInfo*>(STM->getInstrInfo());
|
||||
const TargetSubtargetInfo &STM = MF.getSubtarget();
|
||||
TRI = static_cast<const SIRegisterInfo *>(STM.getRegisterInfo());
|
||||
TII = static_cast<const SIInstrInfo *>(STM.getInstrInfo());
|
||||
MRI = &MF.getRegInfo();
|
||||
|
||||
LIS = &getAnalysis<LiveIntervals>();
|
||||
|
Reference in New Issue
Block a user