/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===-- SystemZSubtarget.cpp - SystemZ subtarget information --------------===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | |
9 | | #include "SystemZSubtarget.h" |
10 | | #include "MCTargetDesc/SystemZMCTargetDesc.h" |
11 | | #include "llvm/IR/GlobalValue.h" |
12 | | |
13 | | using namespace llvm; |
14 | | |
15 | | #define DEBUG_TYPE "systemz-subtarget" |
16 | | |
17 | | #define GET_SUBTARGETINFO_TARGET_DESC |
18 | | #define GET_SUBTARGETINFO_CTOR |
19 | | #include "SystemZGenSubtargetInfo.inc" |
20 | | |
21 | | static cl::opt<bool> UseSubRegLiveness( |
22 | | "systemz-subreg-liveness", |
23 | | cl::desc("Enable subregister liveness tracking for SystemZ (experimental)"), |
24 | | cl::Hidden); |
25 | | |
26 | | // Pin the vtable to this file. |
27 | 0 | void SystemZSubtarget::anchor() {} |
28 | | |
29 | | SystemZSubtarget & |
30 | 1.09k | SystemZSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) { |
31 | 1.09k | std::string CPUName = CPU; |
32 | 1.09k | if (CPUName.empty()) |
33 | 475 | CPUName = "generic"; |
34 | 1.09k | // Parse features string. |
35 | 1.09k | ParseSubtargetFeatures(CPUName, FS); |
36 | 1.09k | return *this; |
37 | 1.09k | } |
38 | | |
39 | | SystemZSubtarget::SystemZSubtarget(const Triple &TT, const std::string &CPU, |
40 | | const std::string &FS, |
41 | | const TargetMachine &TM) |
42 | | : SystemZGenSubtargetInfo(TT, CPU, FS), HasDistinctOps(false), |
43 | | HasLoadStoreOnCond(false), HasHighWord(false), HasFPExtension(false), |
44 | | HasPopulationCount(false), HasMessageSecurityAssist3(false), |
45 | | HasMessageSecurityAssist4(false), HasResetReferenceBitsMultiple(false), |
46 | | HasFastSerialization(false), HasInterlockedAccess1(false), |
47 | | HasMiscellaneousExtensions(false), |
48 | | HasExecutionHint(false), HasLoadAndTrap(false), |
49 | | HasTransactionalExecution(false), HasProcessorAssist(false), |
50 | | HasDFPZonedConversion(false), HasEnhancedDAT2(false), |
51 | | HasVector(false), HasLoadStoreOnCond2(false), |
52 | | HasLoadAndZeroRightmostByte(false), HasMessageSecurityAssist5(false), |
53 | | HasDFPPackedConversion(false), |
54 | | HasMiscellaneousExtensions2(false), HasGuardedStorage(false), |
55 | | HasMessageSecurityAssist7(false), HasMessageSecurityAssist8(false), |
56 | | HasVectorEnhancements1(false), HasVectorPackedDecimal(false), |
57 | | HasInsertReferenceBitsMultiple(false), |
58 | | HasMiscellaneousExtensions3(false), HasMessageSecurityAssist9(false), |
59 | | HasVectorEnhancements2(false), HasVectorPackedDecimalEnhancement(false), |
60 | | HasEnhancedSort(false), HasDeflateConversion(false), |
61 | | TargetTriple(TT), InstrInfo(initializeSubtargetDependencies(CPU, FS)), |
62 | 1.09k | TLInfo(TM, *this), TSInfo(), FrameLowering() {} |
63 | | |
64 | | |
65 | 8.14k | bool SystemZSubtarget::enableSubRegLiveness() const { |
66 | 8.14k | return UseSubRegLiveness; |
67 | 8.14k | } |
68 | | |
69 | | bool SystemZSubtarget::isPC32DBLSymbol(const GlobalValue *GV, |
70 | 617 | CodeModel::Model CM) const { |
71 | 617 | // PC32DBL accesses require the low bit to be clear. Note that a zero |
72 | 617 | // value selects the default alignment and is therefore OK. |
73 | 617 | if (GV->getAlignment() == 1) |
74 | 12 | return false; |
75 | 605 | |
76 | 605 | // For the small model, all locally-binding symbols are in range. |
77 | 605 | if (CM == CodeModel::Small) |
78 | 589 | return TLInfo.getTargetMachine().shouldAssumeDSOLocal(*GV->getParent(), GV); |
79 | 16 | |
80 | 16 | // For Medium and above, assume that the symbol is not within the 4GB range. |
81 | 16 | // Taking the address of locally-defined text would be OK, but that |
82 | 16 | // case isn't easy to detect. |
83 | 16 | return false; |
84 | 16 | } |