Deleted Added
full compact
PPCSubtarget.cpp (208954) PPCSubtarget.cpp (212904)
1//===- PowerPCSubtarget.cpp - PPC Subtarget Information -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 55 unchanged lines hidden (view full) ---

64 , IsGigaProcessor(false)
65 , Has64BitSupport(false)
66 , Use64BitRegs(false)
67 , IsPPC64(is64Bit)
68 , HasAltivec(false)
69 , HasFSQRT(false)
70 , HasSTFIWX(false)
71 , HasLazyResolverStubs(false)
1//===- PowerPCSubtarget.cpp - PPC Subtarget Information -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 55 unchanged lines hidden (view full) ---

64 , IsGigaProcessor(false)
65 , Has64BitSupport(false)
66 , Use64BitRegs(false)
67 , IsPPC64(is64Bit)
68 , HasAltivec(false)
69 , HasFSQRT(false)
70 , HasSTFIWX(false)
71 , HasLazyResolverStubs(false)
72 , IsJITCodeModel(false)
72 , DarwinVers(0) {
73
74 // Determine default and user specified characteristics
75 std::string CPU = "generic";
76#if defined(__APPLE__)
77 CPU = GetCurrentPowerPCCPU();
78#endif
79

--- 32 unchanged lines hidden (view full) ---

112
113/// SetJITMode - This is called to inform the subtarget info that we are
114/// producing code for the JIT.
115void PPCSubtarget::SetJITMode() {
116 // JIT mode doesn't want lazy resolver stubs, it knows exactly where
117 // everything is. This matters for PPC64, which codegens in PIC mode without
118 // stubs.
119 HasLazyResolverStubs = false;
73 , DarwinVers(0) {
74
75 // Determine default and user specified characteristics
76 std::string CPU = "generic";
77#if defined(__APPLE__)
78 CPU = GetCurrentPowerPCCPU();
79#endif
80

--- 32 unchanged lines hidden (view full) ---

113
114/// SetJITMode - This is called to inform the subtarget info that we are
115/// producing code for the JIT.
116void PPCSubtarget::SetJITMode() {
117 // JIT mode doesn't want lazy resolver stubs, it knows exactly where
118 // everything is. This matters for PPC64, which codegens in PIC mode without
119 // stubs.
120 HasLazyResolverStubs = false;
121
122 // Calls to external functions need to use indirect calls
123 IsJITCodeModel = true;
120}
121
122
123/// hasLazyResolverStub - Return true if accesses to the specified global have
124/// to go through a dyld lazy resolution stub. This means that an extra load
125/// is required to get the address of the global.
126bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV,
127 const TargetMachine &TM) const {
128 // We never hae stubs if HasLazyResolverStubs=false or if in static mode.
129 if (!HasLazyResolverStubs || TM.getRelocationModel() == Reloc::Static)
130 return false;
131 // If symbol visibility is hidden, the extra load is not needed if
132 // the symbol is definitely defined in the current translation unit.
133 bool isDecl = GV->isDeclaration() && !GV->isMaterializable();
134 if (GV->hasHiddenVisibility() && !isDecl && !GV->hasCommonLinkage())
135 return false;
136 return GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
137 GV->hasCommonLinkage() || isDecl;
138}
124}
125
126
127/// hasLazyResolverStub - Return true if accesses to the specified global have
128/// to go through a dyld lazy resolution stub. This means that an extra load
129/// is required to get the address of the global.
130bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV,
131 const TargetMachine &TM) const {
132 // We never hae stubs if HasLazyResolverStubs=false or if in static mode.
133 if (!HasLazyResolverStubs || TM.getRelocationModel() == Reloc::Static)
134 return false;
135 // If symbol visibility is hidden, the extra load is not needed if
136 // the symbol is definitely defined in the current translation unit.
137 bool isDecl = GV->isDeclaration() && !GV->isMaterializable();
138 if (GV->hasHiddenVisibility() && !isDecl && !GV->hasCommonLinkage())
139 return false;
140 return GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
141 GV->hasCommonLinkage() || isDecl;
142}