From d71e4441c96c0762d4b192763e9377176e393275 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 22 May 2014 01:21:35 +0000 Subject: Avoid using subtarget features when initializing the pass pipeline on PPC. llvm-svn: 209376 --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/PowerPC/PPCInstrInfo.cpp') 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(&MF.getTarget()); + // If we don't have VSX then go ahead and return without doing + // anything. + if (!TM->getSubtargetImpl()->hasVSX()) + return false; + LIS = &getAnalysis(); - TM = static_cast(&MF.getTarget()); TII = TM->getInstrInfo(); bool Changed = false; @@ -1966,6 +1971,9 @@ protected: public: bool runOnMachineFunction(MachineFunction &MF) override { TM = static_cast(&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(&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; -- cgit v1.2.3