forked from OSchip/llvm-project
Avoid using subtarget features when initializing the pass pipeline
on PPC. llvm-svn: 209376
This commit is contained in:
parent
1b8e763630
commit
d71e4441c9
|
@ -1813,9 +1813,14 @@ protected:
|
|||
|
||||
public:
|
||||
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>();
|
||||
|
||||
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
||||
TII = TM->getInstrInfo();
|
||||
|
||||
bool Changed = false;
|
||||
|
@ -1966,6 +1971,9 @@ protected:
|
|||
public:
|
||||
bool runOnMachineFunction(MachineFunction &MF) override {
|
||||
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();
|
||||
|
||||
bool Changed = false;
|
||||
|
@ -2040,6 +2048,9 @@ protected:
|
|||
public:
|
||||
bool runOnMachineFunction(MachineFunction &MF) override {
|
||||
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();
|
||||
|
||||
bool Changed = false;
|
||||
|
|
|
@ -161,25 +161,19 @@ bool PPCPassConfig::addInstSelector() {
|
|||
addPass(createPPCCTRLoopsVerify());
|
||||
#endif
|
||||
|
||||
if (getPPCSubtarget().hasVSX())
|
||||
addPass(createPPCVSXCopyPass());
|
||||
|
||||
addPass(createPPCVSXCopyPass());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PPCPassConfig::addPreRegAlloc() {
|
||||
if (getPPCSubtarget().hasVSX()) {
|
||||
initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
|
||||
insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID,
|
||||
&PPCVSXFMAMutateID);
|
||||
}
|
||||
|
||||
initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
|
||||
insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID,
|
||||
&PPCVSXFMAMutateID);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PPCPassConfig::addPreSched2() {
|
||||
if (getPPCSubtarget().hasVSX())
|
||||
addPass(createPPCVSXCopyCleanupPass());
|
||||
addPass(createPPCVSXCopyCleanupPass());
|
||||
|
||||
if (getOptLevel() != CodeGenOpt::None)
|
||||
addPass(&IfConverterID);
|
||||
|
|
Loading…
Reference in New Issue