mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-12 06:06:19 +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:
|
||||
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
Block a user