diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCSubtarget.cpp | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp index 0997f68bd999..3836cc960394 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp @@ -78,6 +78,9 @@ void PPCSubtarget::initializeEnvironment() { HasP8Crypto = false; HasP9Vector = false; HasP9Altivec = false; + HasP10Vector = false; + HasPrefixInstrs = false; + HasPCRelativeMemops = false; HasFCPSGN = false; HasFSQRT = false; HasFRE = false; @@ -102,7 +105,6 @@ void PPCSubtarget::initializeEnvironment() { FeatureMFTB = false; AllowsUnalignedFPAccess = false; DeprecatedDST = false; - HasLazyResolverStubs = false; HasICBT = false; HasInvariantFunctionDescriptors = false; HasPartwordAtomics = false; @@ -110,19 +112,24 @@ void PPCSubtarget::initializeEnvironment() { IsQPXStackUnaligned = false; HasHTM = false; HasFloat128 = false; + HasFusion = false; + HasAddiLoadFusion = false; + HasAddisLoadFusion = false; IsISA3_0 = false; + IsISA3_1 = false; UseLongCalls = false; SecurePlt = false; VectorsUseTwoUnits = false; UsePPCPreRASchedStrategy = false; UsePPCPostRASchedStrategy = false; + PredictableSelectIsExpensive = false; HasPOPCNTD = POPCNTD_Unavailable; } void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { // Determine default and user specified characteristics - std::string CPUName = CPU; + std::string CPUName = std::string(CPU); if (CPUName.empty() || CPU == "generic") { // If cross-compiling with -march=ppc64le without -mcpu if (TargetTriple.getArch() == Triple::ppc64le) @@ -144,10 +151,6 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { if (IsPPC64 && has64BitSupport()) Use64BitRegs = true; - // Set up darwin-specific properties. - if (isDarwin()) - HasLazyResolverStubs = true; - if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) || TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() || TargetTriple.isMusl()) @@ -174,26 +177,10 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { IsLittleEndian = (TargetTriple.getArch() == Triple::ppc64le); } -/// Return true if accesses to the specified global have to go through a dyld -/// lazy resolution stub. This means that an extra load is required to get the -/// address of the global. -bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV) const { - if (!HasLazyResolverStubs) - return false; - if (!TM.shouldAssumeDSOLocal(*GV->getParent(), GV)) - return true; - // 32 bit macho has no relocation for a-b if a is undefined, even if b is in - // the section that is being relocated. This means we have to use o load even - // for GVs that are known to be local to the dso. - if (GV->isDeclarationForLinker() || GV->hasCommonLinkage()) - return true; - return false; -} - bool PPCSubtarget::enableMachineScheduler() const { return true; } bool PPCSubtarget::enableMachinePipeliner() const { - return (CPUDirective == PPC::DIR_PWR9) && EnableMachinePipeliner; + return getSchedModel().hasInstrSchedModel() && EnableMachinePipeliner; } bool PPCSubtarget::useDFAforSMS() const { return false; } @@ -243,3 +230,8 @@ bool PPCSubtarget::isGVIndirectSymbol(const GlobalValue *GV) const { bool PPCSubtarget::isELFv2ABI() const { return TM.isELFv2ABI(); } bool PPCSubtarget::isPPC64() const { return TM.isPPC64(); } + +bool PPCSubtarget::isUsingPCRelativeCalls() const { + return isPPC64() && hasPCRelativeMemops() && isELFv2ABI() && + CodeModel::Medium == getTargetMachine().getCodeModel(); +} |