diff options
author | Eric Christopher <echristo@gmail.com> | 2014-05-22 01:21:35 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-05-22 01:21:35 +0000 |
commit | d71e4441c96c0762d4b192763e9377176e393275 (patch) | |
tree | 4ba72986c62c61dbc363627692fe01adb4264254 /llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | 1b8e76363087a78a868687ad7e294d2eb86a063a (diff) | |
download | bcm5719-llvm-d71e4441c96c0762d4b192763e9377176e393275.tar.gz bcm5719-llvm-d71e4441c96c0762d4b192763e9377176e393275.zip |
Avoid using subtarget features when initializing the pass pipeline
on PPC.
llvm-svn: 209376
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index 0c15e2d0232..fd7238401bb 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -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; |