Nate Begeman | 6cca84e | 2005-10-16 05:39:50 +0000 | [diff] [blame] | 1 | //===-- PPCTargetMachine.cpp - Define TargetMachine for PowerPC -----------===// |
Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 2 | // |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 7 | // |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 9 | // |
Chris Lattner | 73785d2 | 2005-08-15 23:47:04 +0000 | [diff] [blame] | 10 | // Top-level implementation for the PowerPC target. |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Chris Lattner | 6f3b954 | 2005-10-14 23:59:06 +0000 | [diff] [blame] | 14 | #include "PPCTargetMachine.h" |
Craig Topper | b25fda9 | 2012-03-17 18:46:09 +0000 | [diff] [blame] | 15 | #include "PPC.h" |
Chandler Carruth | d990388 | 2015-01-14 11:23:27 +0000 | [diff] [blame] | 16 | #include "PPCTargetObjectFile.h" |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 17 | #include "llvm/CodeGen/Passes.h" |
Eric Christopher | 3faf2f1 | 2014-10-06 06:45:36 +0000 | [diff] [blame] | 18 | #include "llvm/IR/Function.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 19 | #include "llvm/MC/MCStreamer.h" |
| 20 | #include "llvm/PassManager.h" |
Hal Finkel | 96c2d4d | 2012-06-08 15:38:21 +0000 | [diff] [blame] | 21 | #include "llvm/Support/CommandLine.h" |
David Greene | a31f96c | 2009-07-14 20:18:05 +0000 | [diff] [blame] | 22 | #include "llvm/Support/FormattedStream.h" |
Evan Cheng | 2bb4035 | 2011-08-24 18:08:43 +0000 | [diff] [blame] | 23 | #include "llvm/Support/TargetRegistry.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 24 | #include "llvm/Target/TargetOptions.h" |
Hal Finkel | f413be1 | 2014-11-21 04:35:51 +0000 | [diff] [blame] | 25 | #include "llvm/Transforms/Scalar.h" |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 26 | using namespace llvm; |
| 27 | |
Hal Finkel | 96c2d4d | 2012-06-08 15:38:21 +0000 | [diff] [blame] | 28 | static cl:: |
Hal Finkel | c6b5deb | 2012-06-08 19:19:53 +0000 | [diff] [blame] | 29 | opt<bool> DisableCTRLoops("disable-ppc-ctrloops", cl::Hidden, |
| 30 | cl::desc("Disable CTR loops for PPC")); |
Hal Finkel | 96c2d4d | 2012-06-08 15:38:21 +0000 | [diff] [blame] | 31 | |
Hal Finkel | 174e590 | 2014-03-25 23:29:21 +0000 | [diff] [blame] | 32 | static cl::opt<bool> |
| 33 | VSXFMAMutateEarly("schedule-ppc-vsx-fma-mutation-early", |
| 34 | cl::Hidden, cl::desc("Schedule VSX FMA instruction mutation early")); |
| 35 | |
Hal Finkel | f413be1 | 2014-11-21 04:35:51 +0000 | [diff] [blame] | 36 | static cl::opt<bool> |
| 37 | EnableGEPOpt("ppc-gep-opt", cl::Hidden, |
| 38 | cl::desc("Enable optimizations on complex GEPs"), |
| 39 | cl::init(true)); |
| 40 | |
Daniel Dunbar | 5680b4f | 2009-07-25 06:49:55 +0000 | [diff] [blame] | 41 | extern "C" void LLVMInitializePowerPCTarget() { |
| 42 | // Register the targets |
Andrew Trick | 808a7a6 | 2012-02-03 05:12:30 +0000 | [diff] [blame] | 43 | RegisterTargetMachine<PPC32TargetMachine> A(ThePPC32Target); |
Daniel Dunbar | 5680b4f | 2009-07-25 06:49:55 +0000 | [diff] [blame] | 44 | RegisterTargetMachine<PPC64TargetMachine> B(ThePPC64Target); |
Bill Schmidt | 0a9170d | 2013-07-26 01:35:43 +0000 | [diff] [blame] | 45 | RegisterTargetMachine<PPC64TargetMachine> C(ThePPC64LETarget); |
Daniel Dunbar | 5680b4f | 2009-07-25 06:49:55 +0000 | [diff] [blame] | 46 | } |
Douglas Gregor | 1b731d5 | 2009-06-16 20:12:29 +0000 | [diff] [blame] | 47 | |
Eric Christopher | 8b77065 | 2015-01-26 19:03:15 +0000 | [diff] [blame^] | 48 | /// Return the datalayout string of a subtarget. |
| 49 | static std::string getDataLayoutString(const Triple &T) { |
| 50 | bool is64Bit = T.getArch() == Triple::ppc64 || T.getArch() == Triple::ppc64le; |
| 51 | std::string Ret; |
| 52 | |
| 53 | // Most PPC* platforms are big endian, PPC64LE is little endian. |
| 54 | if (T.getArch() == Triple::ppc64le) |
| 55 | Ret = "e"; |
| 56 | else |
| 57 | Ret = "E"; |
| 58 | |
| 59 | Ret += DataLayout::getManglingComponent(T); |
| 60 | |
| 61 | // PPC32 has 32 bit pointers. The PS3 (OS Lv2) is a PPC64 machine with 32 bit |
| 62 | // pointers. |
| 63 | if (!is64Bit || T.getOS() == Triple::Lv2) |
| 64 | Ret += "-p:32:32"; |
| 65 | |
| 66 | // Note, the alignment values for f64 and i64 on ppc64 in Darwin |
| 67 | // documentation are wrong; these are correct (i.e. "what gcc does"). |
| 68 | if (is64Bit || !T.isOSDarwin()) |
| 69 | Ret += "-i64:64"; |
| 70 | else |
| 71 | Ret += "-f64:32:64"; |
| 72 | |
| 73 | // PPC64 has 32 and 64 bit registers, PPC32 has only 32 bit ones. |
| 74 | if (is64Bit) |
| 75 | Ret += "-n32:64"; |
| 76 | else |
| 77 | Ret += "-n32"; |
| 78 | |
| 79 | return Ret; |
| 80 | } |
| 81 | |
Eric Christopher | 36448af | 2014-10-01 20:38:26 +0000 | [diff] [blame] | 82 | static std::string computeFSAdditions(StringRef FS, CodeGenOpt::Level OL, StringRef TT) { |
| 83 | std::string FullFS = FS; |
| 84 | Triple TargetTriple(TT); |
| 85 | |
| 86 | // Make sure 64-bit features are available when CPUname is generic |
| 87 | if (TargetTriple.getArch() == Triple::ppc64 || |
| 88 | TargetTriple.getArch() == Triple::ppc64le) { |
| 89 | if (!FullFS.empty()) |
| 90 | FullFS = "+64bit," + FullFS; |
| 91 | else |
| 92 | FullFS = "+64bit"; |
| 93 | } |
| 94 | |
| 95 | if (OL >= CodeGenOpt::Default) { |
| 96 | if (!FullFS.empty()) |
| 97 | FullFS = "+crbits," + FullFS; |
| 98 | else |
| 99 | FullFS = "+crbits"; |
| 100 | } |
Hal Finkel | e2ab0f1 | 2015-01-15 21:17:34 +0000 | [diff] [blame] | 101 | |
| 102 | if (OL != CodeGenOpt::None) { |
| 103 | if (!FullFS.empty()) |
| 104 | FullFS = "+invariant-function-descriptors," + FullFS; |
| 105 | else |
| 106 | FullFS = "+invariant-function-descriptors"; |
| 107 | } |
| 108 | |
Eric Christopher | 36448af | 2014-10-01 20:38:26 +0000 | [diff] [blame] | 109 | return FullFS; |
| 110 | } |
| 111 | |
Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 112 | static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) { |
| 113 | // If it isn't a Mach-O file then it's going to be a linux ELF |
| 114 | // object file. |
| 115 | if (TT.isOSDarwin()) |
| 116 | return make_unique<TargetLoweringObjectFileMachO>(); |
| 117 | |
| 118 | return make_unique<PPC64LinuxTargetObjectFile>(); |
| 119 | } |
| 120 | |
Eric Christopher | 36448af | 2014-10-01 20:38:26 +0000 | [diff] [blame] | 121 | // The FeatureString here is a little subtle. We are modifying the feature string |
| 122 | // with what are (currently) non-function specific overrides as it goes into the |
| 123 | // LLVMTargetMachine constructor and then using the stored value in the |
| 124 | // Subtarget constructor below it. |
Eric Christopher | a475d5c | 2014-06-11 00:53:17 +0000 | [diff] [blame] | 125 | PPCTargetMachine::PPCTargetMachine(const Target &T, StringRef TT, StringRef CPU, |
| 126 | StringRef FS, const TargetOptions &Options, |
Evan Cheng | efd9b42 | 2011-07-20 07:51:56 +0000 | [diff] [blame] | 127 | Reloc::Model RM, CodeModel::Model CM, |
Eric Christopher | 3770cf5 | 2014-08-09 04:38:56 +0000 | [diff] [blame] | 128 | CodeGenOpt::Level OL) |
Eric Christopher | 36448af | 2014-10-01 20:38:26 +0000 | [diff] [blame] | 129 | : LLVMTargetMachine(T, TT, CPU, computeFSAdditions(FS, OL, TT), Options, RM, |
| 130 | CM, OL), |
Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 131 | TLOF(createTLOF(Triple(getTargetTriple()))), |
Eric Christopher | 8b77065 | 2015-01-26 19:03:15 +0000 | [diff] [blame^] | 132 | DL(getDataLayoutString(Triple(TT))), Subtarget(TT, CPU, TargetFS, *this) { |
Rafael Espindola | 227144c | 2013-05-13 01:16:13 +0000 | [diff] [blame] | 133 | initAsmInfo(); |
Nate Begeman | 6cca84e | 2005-10-16 05:39:50 +0000 | [diff] [blame] | 134 | } |
| 135 | |
Reid Kleckner | 357600e | 2014-11-20 23:37:18 +0000 | [diff] [blame] | 136 | PPCTargetMachine::~PPCTargetMachine() {} |
| 137 | |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 138 | void PPC32TargetMachine::anchor() { } |
| 139 | |
Andrew Trick | 808a7a6 | 2012-02-03 05:12:30 +0000 | [diff] [blame] | 140 | PPC32TargetMachine::PPC32TargetMachine(const Target &T, StringRef TT, |
Evan Cheng | efd9b42 | 2011-07-20 07:51:56 +0000 | [diff] [blame] | 141 | StringRef CPU, StringRef FS, |
Nick Lewycky | 50f02cb | 2011-12-02 22:16:29 +0000 | [diff] [blame] | 142 | const TargetOptions &Options, |
Evan Cheng | ecb2908 | 2011-11-16 08:38:26 +0000 | [diff] [blame] | 143 | Reloc::Model RM, CodeModel::Model CM, |
| 144 | CodeGenOpt::Level OL) |
Eric Christopher | 3770cf5 | 2014-08-09 04:38:56 +0000 | [diff] [blame] | 145 | : PPCTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL) { |
Chris Lattner | 0c4aa14 | 2006-06-16 01:37:27 +0000 | [diff] [blame] | 146 | } |
| 147 | |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 148 | void PPC64TargetMachine::anchor() { } |
Chris Lattner | 0c4aa14 | 2006-06-16 01:37:27 +0000 | [diff] [blame] | 149 | |
Andrew Trick | 808a7a6 | 2012-02-03 05:12:30 +0000 | [diff] [blame] | 150 | PPC64TargetMachine::PPC64TargetMachine(const Target &T, StringRef TT, |
Evan Cheng | efd9b42 | 2011-07-20 07:51:56 +0000 | [diff] [blame] | 151 | StringRef CPU, StringRef FS, |
Nick Lewycky | 50f02cb | 2011-12-02 22:16:29 +0000 | [diff] [blame] | 152 | const TargetOptions &Options, |
Evan Cheng | ecb2908 | 2011-11-16 08:38:26 +0000 | [diff] [blame] | 153 | Reloc::Model RM, CodeModel::Model CM, |
| 154 | CodeGenOpt::Level OL) |
Eric Christopher | 3770cf5 | 2014-08-09 04:38:56 +0000 | [diff] [blame] | 155 | : PPCTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL) { |
Chris Lattner | 0c4aa14 | 2006-06-16 01:37:27 +0000 | [diff] [blame] | 156 | } |
| 157 | |
Eric Christopher | 3faf2f1 | 2014-10-06 06:45:36 +0000 | [diff] [blame] | 158 | const PPCSubtarget * |
| 159 | PPCTargetMachine::getSubtargetImpl(const Function &F) const { |
| 160 | AttributeSet FnAttrs = F.getAttributes(); |
| 161 | Attribute CPUAttr = |
| 162 | FnAttrs.getAttribute(AttributeSet::FunctionIndex, "target-cpu"); |
| 163 | Attribute FSAttr = |
| 164 | FnAttrs.getAttribute(AttributeSet::FunctionIndex, "target-features"); |
| 165 | |
| 166 | std::string CPU = !CPUAttr.hasAttribute(Attribute::None) |
| 167 | ? CPUAttr.getValueAsString().str() |
| 168 | : TargetCPU; |
| 169 | std::string FS = !FSAttr.hasAttribute(Attribute::None) |
| 170 | ? FSAttr.getValueAsString().str() |
| 171 | : TargetFS; |
| 172 | |
| 173 | auto &I = SubtargetMap[CPU + FS]; |
| 174 | if (!I) { |
| 175 | // This needs to be done before we create a new subtarget since any |
| 176 | // creation will depend on the TM and the code generation flags on the |
| 177 | // function that reside in TargetOptions. |
| 178 | resetTargetOptions(F); |
| 179 | I = llvm::make_unique<PPCSubtarget>(TargetTriple, CPU, FS, *this); |
| 180 | } |
| 181 | return I.get(); |
| 182 | } |
Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 183 | |
Chris Lattner | 12e9730 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 184 | //===----------------------------------------------------------------------===// |
| 185 | // Pass Pipeline Configuration |
| 186 | //===----------------------------------------------------------------------===// |
Nate Begeman | f17ea0f | 2004-08-11 07:40:04 +0000 | [diff] [blame] | 187 | |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 188 | namespace { |
| 189 | /// PPC Code Generator Pass Configuration Options. |
| 190 | class PPCPassConfig : public TargetPassConfig { |
| 191 | public: |
Andrew Trick | f8ea108 | 2012-02-04 02:56:59 +0000 | [diff] [blame] | 192 | PPCPassConfig(PPCTargetMachine *TM, PassManagerBase &PM) |
| 193 | : TargetPassConfig(TM, PM) {} |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 194 | |
| 195 | PPCTargetMachine &getPPCTargetMachine() const { |
| 196 | return getTM<PPCTargetMachine>(); |
| 197 | } |
| 198 | |
Hal Finkel | ed6a285 | 2013-04-05 23:29:01 +0000 | [diff] [blame] | 199 | const PPCSubtarget &getPPCSubtarget() const { |
| 200 | return *getPPCTargetMachine().getSubtargetImpl(); |
| 201 | } |
| 202 | |
Robin Morisset | 2212996 | 2014-09-23 20:46:49 +0000 | [diff] [blame] | 203 | void addIRPasses() override; |
Craig Topper | 0d3fa92 | 2014-04-29 07:57:37 +0000 | [diff] [blame] | 204 | bool addPreISel() override; |
| 205 | bool addILPOpts() override; |
| 206 | bool addInstSelector() override; |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 207 | void addPreRegAlloc() override; |
| 208 | void addPreSched2() override; |
| 209 | void addPreEmitPass() override; |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 210 | }; |
| 211 | } // namespace |
| 212 | |
Andrew Trick | f8ea108 | 2012-02-04 02:56:59 +0000 | [diff] [blame] | 213 | TargetPassConfig *PPCTargetMachine::createPassConfig(PassManagerBase &PM) { |
Hal Finkel | eb50c2d | 2012-06-09 03:14:50 +0000 | [diff] [blame] | 214 | return new PPCPassConfig(this, PM); |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 215 | } |
| 216 | |
Robin Morisset | 2212996 | 2014-09-23 20:46:49 +0000 | [diff] [blame] | 217 | void PPCPassConfig::addIRPasses() { |
| 218 | addPass(createAtomicExpandPass(&getPPCTargetMachine())); |
Hal Finkel | f413be1 | 2014-11-21 04:35:51 +0000 | [diff] [blame] | 219 | |
| 220 | if (TM->getOptLevel() == CodeGenOpt::Aggressive && EnableGEPOpt) { |
| 221 | // Call SeparateConstOffsetFromGEP pass to extract constants within indices |
| 222 | // and lower a GEP with multiple indices to either arithmetic operations or |
| 223 | // multiple GEPs with single index. |
| 224 | addPass(createSeparateConstOffsetFromGEPPass(TM, true)); |
| 225 | // Call EarlyCSE pass to find and remove subexpressions in the lowered |
| 226 | // result. |
| 227 | addPass(createEarlyCSEPass()); |
| 228 | // Do loop invariant code motion in case part of the lowered result is |
| 229 | // invariant. |
| 230 | addPass(createLICMPass()); |
| 231 | } |
| 232 | |
Robin Morisset | 2212996 | 2014-09-23 20:46:49 +0000 | [diff] [blame] | 233 | TargetPassConfig::addIRPasses(); |
| 234 | } |
| 235 | |
Hal Finkel | 25c1992 | 2013-05-15 21:37:41 +0000 | [diff] [blame] | 236 | bool PPCPassConfig::addPreISel() { |
Hal Finkel | c6b5deb | 2012-06-08 19:19:53 +0000 | [diff] [blame] | 237 | if (!DisableCTRLoops && getOptLevel() != CodeGenOpt::None) |
Hal Finkel | 25c1992 | 2013-05-15 21:37:41 +0000 | [diff] [blame] | 238 | addPass(createPPCCTRLoops(getPPCTargetMachine())); |
Hal Finkel | 96c2d4d | 2012-06-08 15:38:21 +0000 | [diff] [blame] | 239 | |
| 240 | return false; |
| 241 | } |
| 242 | |
Hal Finkel | ed6a285 | 2013-04-05 23:29:01 +0000 | [diff] [blame] | 243 | bool PPCPassConfig::addILPOpts() { |
Eric Christopher | 6b0fcfe | 2014-05-21 23:40:26 +0000 | [diff] [blame] | 244 | addPass(&EarlyIfConverterID); |
| 245 | return true; |
Hal Finkel | ed6a285 | 2013-04-05 23:29:01 +0000 | [diff] [blame] | 246 | } |
| 247 | |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 248 | bool PPCPassConfig::addInstSelector() { |
Chris Lattner | c6aa806 | 2005-08-17 19:33:30 +0000 | [diff] [blame] | 249 | // Install an instruction selector. |
Bob Wilson | bbd38dd | 2012-07-02 19:48:31 +0000 | [diff] [blame] | 250 | addPass(createPPCISelDag(getPPCTargetMachine())); |
Hal Finkel | 8ca3884 | 2013-05-20 16:08:17 +0000 | [diff] [blame] | 251 | |
| 252 | #ifndef NDEBUG |
| 253 | if (!DisableCTRLoops && getOptLevel() != CodeGenOpt::None) |
| 254 | addPass(createPPCCTRLoopsVerify()); |
| 255 | #endif |
| 256 | |
Eric Christopher | d71e444 | 2014-05-22 01:21:35 +0000 | [diff] [blame] | 257 | addPass(createPPCVSXCopyPass()); |
Nate Begeman | f17ea0f | 2004-08-11 07:40:04 +0000 | [diff] [blame] | 258 | return false; |
| 259 | } |
| 260 | |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 261 | void PPCPassConfig::addPreRegAlloc() { |
Eric Christopher | d71e444 | 2014-05-22 01:21:35 +0000 | [diff] [blame] | 262 | initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry()); |
| 263 | insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID, |
| 264 | &PPCVSXFMAMutateID); |
Hal Finkel | 174e590 | 2014-03-25 23:29:21 +0000 | [diff] [blame] | 265 | } |
| 266 | |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 267 | void PPCPassConfig::addPreSched2() { |
| 268 | addPass(createPPCVSXCopyCleanupPass(), false); |
Hal Finkel | c6fc9b8 | 2014-03-27 23:12:31 +0000 | [diff] [blame] | 269 | |
Hal Finkel | 5711eca | 2013-04-09 22:58:37 +0000 | [diff] [blame] | 270 | if (getOptLevel() != CodeGenOpt::None) |
| 271 | addPass(&IfConverterID); |
Hal Finkel | 5711eca | 2013-04-09 22:58:37 +0000 | [diff] [blame] | 272 | } |
| 273 | |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 274 | void PPCPassConfig::addPreEmitPass() { |
Hal Finkel | b5aa7e5 | 2013-04-08 16:24:03 +0000 | [diff] [blame] | 275 | if (getOptLevel() != CodeGenOpt::None) |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 276 | addPass(createPPCEarlyReturnPass(), false); |
Chris Lattner | 12e9730 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 277 | // Must run branch selection immediately preceding the asm printer. |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 278 | addPass(createPPCBranchSelectionPass(), false); |
Chris Lattner | 12e9730 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 279 | } |
| 280 | |
Hal Finkel | 4e5ca9e | 2013-01-25 23:05:59 +0000 | [diff] [blame] | 281 | void PPCTargetMachine::addAnalysisPasses(PassManagerBase &PM) { |
| 282 | // Add first the target-independent BasicTTI pass, then our PPC pass. This |
| 283 | // allows the PPC pass to delegate to the target independent layer when |
| 284 | // appropriate. |
Bill Wendling | afc1036 | 2013-06-19 20:51:24 +0000 | [diff] [blame] | 285 | PM.add(createBasicTargetTransformInfoPass(this)); |
Hal Finkel | 4e5ca9e | 2013-01-25 23:05:59 +0000 | [diff] [blame] | 286 | PM.add(createPPCTargetTransformInfoPass(this)); |
| 287 | } |