diff options
Diffstat (limited to 'contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp')
| -rw-r--r-- | contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp | 47 | 
1 files changed, 20 insertions, 27 deletions
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp index ccf0f80c336b..c0cbfd779cb9 100644 --- a/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp @@ -65,6 +65,7 @@ void PPCSubtarget::initializeEnvironment() {    HasHardFloat = false;    HasAltivec = false;    HasSPE = false; +  HasFPU = false;    HasQPX = false;    HasVSX = false;    HasP8Vector = false; @@ -106,6 +107,7 @@ void PPCSubtarget::initializeEnvironment() {    HasFloat128 = false;    IsISA3_0 = false;    UseLongCalls = false; +  SecurePlt = false;    HasPOPCNTD = POPCNTD_Unavailable;  } @@ -136,6 +138,16 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {    if (isDarwin())      HasLazyResolverStubs = true; +  if (HasSPE && IsPPC64) +    report_fatal_error( "SPE is only supported for 32-bit targets.\n", false); +  if (HasSPE && (HasAltivec || HasQPX || HasVSX || HasFPU)) +    report_fatal_error( +        "SPE and traditional floating point cannot both be enabled.\n", false); + +  // If not SPE, set standard FPU +  if (!HasSPE) +    HasFPU = true; +    // QPX requires a 32-byte aligned stack. Note that we need to do this if    // we're compiling for a BG/Q system regardless of whether or not QPX    // is enabled because external functions will assume this alignment. @@ -163,27 +175,8 @@ bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV) const {    return false;  } -// Embedded cores need aggressive scheduling (and some others also benefit). -static bool needsAggressiveScheduling(unsigned Directive) { -  switch (Directive) { -  default: return false; -  case PPC::DIR_440: -  case PPC::DIR_A2: -  case PPC::DIR_E500mc: -  case PPC::DIR_E5500: -  case PPC::DIR_PWR7: -  case PPC::DIR_PWR8: -  // FIXME: Same as P8 until POWER9 scheduling info is available -  case PPC::DIR_PWR9: -    return true; -  } -} -  bool PPCSubtarget::enableMachineScheduler() const { -  // Enable MI scheduling for the embedded cores. -  // FIXME: Enable this for all cores (some additional modeling -  // may be necessary). -  return needsAggressiveScheduling(DarwinDirective); +  return true;  }  // This overrides the PostRAScheduler bit in the SchedModel for each CPU. @@ -201,19 +194,19 @@ void PPCSubtarget::getCriticalPathRCs(RegClassVector &CriticalPathRCs) const {  void PPCSubtarget::overrideSchedPolicy(MachineSchedPolicy &Policy,                                         unsigned NumRegionInstrs) const { -  if (needsAggressiveScheduling(DarwinDirective)) { -    Policy.OnlyTopDown = false; -    Policy.OnlyBottomUp = false; -  } - +  // The GenericScheduler that we use defaults to scheduling bottom up only. +  // We want to schedule from both the top and the bottom and so we set +  // OnlyBottomUp to false. +  // We want to do bi-directional scheduling since it provides a more balanced +  // schedule leading to better performance. +  Policy.OnlyBottomUp = false;    // Spilling is generally expensive on all PPC cores, so always enable    // register-pressure tracking.    Policy.ShouldTrackPressure = true;  }  bool PPCSubtarget::useAA() const { -  // Use AA during code generation for the embedded cores. -  return needsAggressiveScheduling(DarwinDirective); +  return true;  }  bool PPCSubtarget::enableSubRegLiveness() const {  | 
