mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Avoid using subtarget features when initializing the pass pipeline
on PPC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209376 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
58d9172bb4
commit
6ccae2df5b
@ -1813,9 +1813,14 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool runOnMachineFunction(MachineFunction &MF) override {
|
bool runOnMachineFunction(MachineFunction &MF) override {
|
||||||
|
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
||||||
|
// If we don't have VSX then go ahead and return without doing
|
||||||
|
// anything.
|
||||||
|
if (!TM->getSubtargetImpl()->hasVSX())
|
||||||
|
return false;
|
||||||
|
|
||||||
LIS = &getAnalysis<LiveIntervals>();
|
LIS = &getAnalysis<LiveIntervals>();
|
||||||
|
|
||||||
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
|
||||||
TII = TM->getInstrInfo();
|
TII = TM->getInstrInfo();
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
@ -1966,6 +1971,9 @@ protected:
|
|||||||
public:
|
public:
|
||||||
bool runOnMachineFunction(MachineFunction &MF) override {
|
bool runOnMachineFunction(MachineFunction &MF) override {
|
||||||
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
||||||
|
// If we don't have VSX on the subtarget, don't do anything.
|
||||||
|
if (!TM->getSubtargetImpl()->hasVSX())
|
||||||
|
return false;
|
||||||
TII = TM->getInstrInfo();
|
TII = TM->getInstrInfo();
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
@ -2040,6 +2048,9 @@ protected:
|
|||||||
public:
|
public:
|
||||||
bool runOnMachineFunction(MachineFunction &MF) override {
|
bool runOnMachineFunction(MachineFunction &MF) override {
|
||||||
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
||||||
|
// If we don't have VSX don't bother doing anything here.
|
||||||
|
if (!TM->getSubtargetImpl()->hasVSX())
|
||||||
|
return false;
|
||||||
TII = TM->getInstrInfo();
|
TII = TM->getInstrInfo();
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
@ -161,25 +161,19 @@ bool PPCPassConfig::addInstSelector() {
|
|||||||
addPass(createPPCCTRLoopsVerify());
|
addPass(createPPCCTRLoopsVerify());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (getPPCSubtarget().hasVSX())
|
addPass(createPPCVSXCopyPass());
|
||||||
addPass(createPPCVSXCopyPass());
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PPCPassConfig::addPreRegAlloc() {
|
bool PPCPassConfig::addPreRegAlloc() {
|
||||||
if (getPPCSubtarget().hasVSX()) {
|
initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
|
||||||
initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
|
insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID,
|
||||||
insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID,
|
&PPCVSXFMAMutateID);
|
||||||
&PPCVSXFMAMutateID);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PPCPassConfig::addPreSched2() {
|
bool PPCPassConfig::addPreSched2() {
|
||||||
if (getPPCSubtarget().hasVSX())
|
addPass(createPPCVSXCopyCleanupPass());
|
||||||
addPass(createPPCVSXCopyCleanupPass());
|
|
||||||
|
|
||||||
if (getOptLevel() != CodeGenOpt::None)
|
if (getOptLevel() != CodeGenOpt::None)
|
||||||
addPass(&IfConverterID);
|
addPass(&IfConverterID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user