| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 1 | //===- Standard pass instrumentations handling ----------------*- C++ -*--===// |
| 2 | // |
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// \file |
| 9 | /// |
| 10 | /// This file defines IR-printing pass instrumentation callbacks as well as |
| 11 | /// StandardInstrumentations class that manages standard pass instrumentations. |
| 12 | /// |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "llvm/Passes/StandardInstrumentations.h" |
| Arthur Eubanks | b13b858 | 2020-07-21 09:48:22 -0700 | [diff] [blame] | 16 | #include "llvm/ADT/Any.h" |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 17 | #include "llvm/ADT/Optional.h" |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 18 | #include "llvm/Analysis/CallGraphSCCPass.h" |
| 19 | #include "llvm/Analysis/LazyCallGraph.h" |
| 20 | #include "llvm/Analysis/LoopInfo.h" |
| 21 | #include "llvm/IR/Function.h" |
| 22 | #include "llvm/IR/IRPrintingPasses.h" |
| 23 | #include "llvm/IR/Module.h" |
| 24 | #include "llvm/IR/PassInstrumentation.h" |
| Arthur Eubanks | b13b858 | 2020-07-21 09:48:22 -0700 | [diff] [blame] | 25 | #include "llvm/Support/CommandLine.h" |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 26 | #include "llvm/Support/Debug.h" |
| 27 | #include "llvm/Support/FormatVariadic.h" |
| 28 | #include "llvm/Support/raw_ostream.h" |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 29 | #include <vector> |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 30 | |
| 31 | using namespace llvm; |
| 32 | |
| Arthur Eubanks | b13b858 | 2020-07-21 09:48:22 -0700 | [diff] [blame] | 33 | // TODO: remove once all required passes are marked as such. |
| 34 | static cl::opt<bool> |
| 35 | EnableOptnone("enable-npm-optnone", cl::init(false), |
| 36 | cl::desc("Enable skipping optional passes optnone functions " |
| 37 | "under new pass manager")); |
| 38 | |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 39 | // FIXME: Change `-debug-pass-manager` from boolean to enum type. Similar to |
| 40 | // `-debug-pass` in legacy PM. |
| 41 | static cl::opt<bool> |
| 42 | DebugPMVerbose("debug-pass-manager-verbose", cl::Hidden, cl::init(false), |
| 43 | cl::desc("Print all pass management debugging information. " |
| 44 | "`-debug-pass-manager` must also be specified")); |
| 45 | |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 46 | namespace { |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 47 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 48 | /// Extracting Module out of \p IR unit. Also fills a textual description |
| 49 | /// of \p IR for use in header when printing. |
| 50 | Optional<std::pair<const Module *, std::string>> unwrapModule(Any IR) { |
| 51 | if (any_isa<const Module *>(IR)) |
| 52 | return std::make_pair(any_cast<const Module *>(IR), std::string()); |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 53 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 54 | if (any_isa<const Function *>(IR)) { |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 55 | const Function *F = any_cast<const Function *>(IR); |
| 56 | if (!llvm::isFunctionInPrintList(F->getName())) |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 57 | return None; |
| 58 | const Module *M = F->getParent(); |
| 59 | return std::make_pair(M, formatv(" (function: {0})", F->getName()).str()); |
| 60 | } |
| 61 | |
| 62 | if (any_isa<const LazyCallGraph::SCC *>(IR)) { |
| Fedor Sergeev | 0dc6ac9 | 2018-10-15 10:46:35 +0000 | [diff] [blame] | 63 | const LazyCallGraph::SCC *C = any_cast<const LazyCallGraph::SCC *>(IR); |
| Fedor Sergeev | 0dc6ac9 | 2018-10-15 10:46:35 +0000 | [diff] [blame] | 64 | for (const LazyCallGraph::Node &N : *C) { |
| 65 | const Function &F = N.getFunction(); |
| 66 | if (!F.isDeclaration() && isFunctionInPrintList(F.getName())) { |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 67 | const Module *M = F.getParent(); |
| 68 | return std::make_pair(M, formatv(" (scc: {0})", C->getName()).str()); |
| Fedor Sergeev | 0dc6ac9 | 2018-10-15 10:46:35 +0000 | [diff] [blame] | 69 | } |
| 70 | } |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 71 | return None; |
| 72 | } |
| 73 | |
| 74 | if (any_isa<const Loop *>(IR)) { |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 75 | const Loop *L = any_cast<const Loop *>(IR); |
| 76 | const Function *F = L->getHeader()->getParent(); |
| 77 | if (!isFunctionInPrintList(F->getName())) |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 78 | return None; |
| 79 | const Module *M = F->getParent(); |
| 80 | std::string LoopName; |
| 81 | raw_string_ostream ss(LoopName); |
| 82 | L->getHeader()->printAsOperand(ss, false); |
| 83 | return std::make_pair(M, formatv(" (loop: {0})", ss.str()).str()); |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 84 | } |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 85 | |
| 86 | llvm_unreachable("Unknown IR unit"); |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 87 | } |
| 88 | |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 89 | void printIR(const Function *F, StringRef Banner, StringRef Extra = StringRef(), |
| 90 | bool Brief = false) { |
| 91 | if (Brief) { |
| 92 | dbgs() << F->getName() << '\n'; |
| 93 | return; |
| 94 | } |
| 95 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 96 | if (!llvm::isFunctionInPrintList(F->getName())) |
| 97 | return; |
| 98 | dbgs() << Banner << Extra << "\n" << static_cast<const Value &>(*F); |
| 99 | } |
| Hongtao Yu | bae33a7 | 2020-02-23 15:13:27 -0800 | [diff] [blame] | 100 | |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 101 | void printIR(const Module *M, StringRef Banner, StringRef Extra = StringRef(), |
| 102 | bool Brief = false) { |
| 103 | if (Brief) { |
| 104 | dbgs() << M->getName() << '\n'; |
| 105 | return; |
| 106 | } |
| 107 | |
| Hongtao Yu | bae33a7 | 2020-02-23 15:13:27 -0800 | [diff] [blame] | 108 | if (llvm::isFunctionInPrintList("*") || llvm::forcePrintModuleIR()) { |
| 109 | dbgs() << Banner << Extra << "\n"; |
| 110 | M->print(dbgs(), nullptr, false); |
| 111 | } else { |
| 112 | for (const auto &F : M->functions()) { |
| 113 | printIR(&F, Banner, Extra); |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 118 | void printIR(const LazyCallGraph::SCC *C, StringRef Banner, |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 119 | StringRef Extra = StringRef(), bool Brief = false) { |
| 120 | if (Brief) { |
| 121 | dbgs() << *C << '\n'; |
| 122 | return; |
| 123 | } |
| 124 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 125 | bool BannerPrinted = false; |
| 126 | for (const LazyCallGraph::Node &N : *C) { |
| 127 | const Function &F = N.getFunction(); |
| 128 | if (!F.isDeclaration() && llvm::isFunctionInPrintList(F.getName())) { |
| 129 | if (!BannerPrinted) { |
| 130 | dbgs() << Banner << Extra << "\n"; |
| 131 | BannerPrinted = true; |
| 132 | } |
| 133 | F.print(dbgs()); |
| 134 | } |
| 135 | } |
| 136 | } |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 137 | |
| 138 | void printIR(const Loop *L, StringRef Banner, bool Brief = false) { |
| 139 | if (Brief) { |
| 140 | dbgs() << *L; |
| 141 | return; |
| 142 | } |
| 143 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 144 | const Function *F = L->getHeader()->getParent(); |
| 145 | if (!llvm::isFunctionInPrintList(F->getName())) |
| 146 | return; |
| Benjamin Kramer | adcd026 | 2020-01-28 20:23:46 +0100 | [diff] [blame] | 147 | llvm::printLoop(const_cast<Loop &>(*L), dbgs(), std::string(Banner)); |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | /// Generic IR-printing helper that unpacks a pointer to IRUnit wrapped into |
| 151 | /// llvm::Any and does actual print job. |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 152 | void unwrapAndPrint(Any IR, StringRef Banner, bool ForceModule = false, |
| 153 | bool Brief = false) { |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 154 | if (ForceModule) { |
| 155 | if (auto UnwrappedModule = unwrapModule(IR)) |
| 156 | printIR(UnwrappedModule->first, Banner, UnwrappedModule->second); |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | if (any_isa<const Module *>(IR)) { |
| 161 | const Module *M = any_cast<const Module *>(IR); |
| 162 | assert(M && "module should be valid for printing"); |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 163 | printIR(M, Banner, "", Brief); |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 164 | return; |
| 165 | } |
| 166 | |
| 167 | if (any_isa<const Function *>(IR)) { |
| 168 | const Function *F = any_cast<const Function *>(IR); |
| 169 | assert(F && "function should be valid for printing"); |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 170 | printIR(F, Banner, "", Brief); |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 171 | return; |
| 172 | } |
| 173 | |
| 174 | if (any_isa<const LazyCallGraph::SCC *>(IR)) { |
| 175 | const LazyCallGraph::SCC *C = any_cast<const LazyCallGraph::SCC *>(IR); |
| 176 | assert(C && "scc should be valid for printing"); |
| Benjamin Kramer | adcd026 | 2020-01-28 20:23:46 +0100 | [diff] [blame] | 177 | std::string Extra = std::string(formatv(" (scc: {0})", C->getName())); |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 178 | printIR(C, Banner, Extra, Brief); |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 179 | return; |
| 180 | } |
| 181 | |
| 182 | if (any_isa<const Loop *>(IR)) { |
| 183 | const Loop *L = any_cast<const Loop *>(IR); |
| 184 | assert(L && "Loop should be valid for printing"); |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 185 | printIR(L, Banner, Brief); |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 186 | return; |
| 187 | } |
| 188 | llvm_unreachable("Unknown wrapped IR type"); |
| 189 | } |
| 190 | |
| 191 | } // namespace |
| 192 | |
| 193 | PrintIRInstrumentation::~PrintIRInstrumentation() { |
| 194 | assert(ModuleDescStack.empty() && "ModuleDescStack is not empty at exit"); |
| 195 | } |
| 196 | |
| 197 | void PrintIRInstrumentation::pushModuleDesc(StringRef PassID, Any IR) { |
| 198 | assert(StoreModuleDesc); |
| 199 | const Module *M = nullptr; |
| 200 | std::string Extra; |
| 201 | if (auto UnwrappedModule = unwrapModule(IR)) |
| 202 | std::tie(M, Extra) = UnwrappedModule.getValue(); |
| 203 | ModuleDescStack.emplace_back(M, Extra, PassID); |
| 204 | } |
| 205 | |
| 206 | PrintIRInstrumentation::PrintModuleDesc |
| 207 | PrintIRInstrumentation::popModuleDesc(StringRef PassID) { |
| 208 | assert(!ModuleDescStack.empty() && "empty ModuleDescStack"); |
| 209 | PrintModuleDesc ModuleDesc = ModuleDescStack.pop_back_val(); |
| 210 | assert(std::get<2>(ModuleDesc).equals(PassID) && "malformed ModuleDescStack"); |
| 211 | return ModuleDesc; |
| 212 | } |
| 213 | |
| Yuanfang Chen | 7a2e112 | 2020-07-28 16:31:46 -0700 | [diff] [blame] | 214 | void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) { |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 215 | if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) |
| Yuanfang Chen | 7a2e112 | 2020-07-28 16:31:46 -0700 | [diff] [blame] | 216 | return; |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 217 | |
| 218 | // Saving Module for AfterPassInvalidated operations. |
| 219 | // Note: here we rely on a fact that we do not change modules while |
| 220 | // traversing the pipeline, so the latest captured module is good |
| 221 | // for all print operations that has not happen yet. |
| 222 | if (StoreModuleDesc && llvm::shouldPrintAfterPass(PassID)) |
| 223 | pushModuleDesc(PassID, IR); |
| 224 | |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 225 | if (!llvm::shouldPrintBeforePass(PassID)) |
| Yuanfang Chen | 7a2e112 | 2020-07-28 16:31:46 -0700 | [diff] [blame] | 226 | return; |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 227 | |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 228 | SmallString<20> Banner = formatv("*** IR Dump Before {0} ***", PassID); |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 229 | unwrapAndPrint(IR, Banner, llvm::forcePrintModuleIR()); |
| Yuanfang Chen | 7a2e112 | 2020-07-28 16:31:46 -0700 | [diff] [blame] | 230 | return; |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 233 | void PrintIRInstrumentation::printAfterPass(StringRef PassID, Any IR) { |
| 234 | if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) |
| 235 | return; |
| 236 | |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 237 | if (!llvm::shouldPrintAfterPass(PassID)) |
| 238 | return; |
| 239 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 240 | if (StoreModuleDesc) |
| 241 | popModuleDesc(PassID); |
| 242 | |
| 243 | SmallString<20> Banner = formatv("*** IR Dump After {0} ***", PassID); |
| 244 | unwrapAndPrint(IR, Banner, llvm::forcePrintModuleIR()); |
| 245 | } |
| 246 | |
| 247 | void PrintIRInstrumentation::printAfterPassInvalidated(StringRef PassID) { |
| 248 | if (!StoreModuleDesc || !llvm::shouldPrintAfterPass(PassID)) |
| 249 | return; |
| 250 | |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 251 | if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) |
| 252 | return; |
| 253 | |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 254 | const Module *M; |
| 255 | std::string Extra; |
| 256 | StringRef StoredPassID; |
| 257 | std::tie(M, Extra, StoredPassID) = popModuleDesc(PassID); |
| 258 | // Additional filtering (e.g. -filter-print-func) can lead to module |
| 259 | // printing being skipped. |
| 260 | if (!M) |
| 261 | return; |
| 262 | |
| 263 | SmallString<20> Banner = |
| 264 | formatv("*** IR Dump After {0} *** invalidated: ", PassID); |
| 265 | printIR(M, Banner, Extra); |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 266 | } |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 267 | |
| 268 | void PrintIRInstrumentation::registerCallbacks( |
| 269 | PassInstrumentationCallbacks &PIC) { |
| 270 | // BeforePass callback is not just for printing, it also saves a Module |
| 271 | // for later use in AfterPassInvalidated. |
| 272 | StoreModuleDesc = llvm::forcePrintModuleIR() && llvm::shouldPrintAfterPass(); |
| 273 | if (llvm::shouldPrintBeforePass() || StoreModuleDesc) |
| Yuanfang Chen | 7a2e112 | 2020-07-28 16:31:46 -0700 | [diff] [blame] | 274 | PIC.registerBeforeNonSkippedPassCallback( |
| 275 | [this](StringRef P, Any IR) { this->printBeforePass(P, IR); }); |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 276 | |
| 277 | if (llvm::shouldPrintAfterPass()) { |
| 278 | PIC.registerAfterPassCallback( |
| 279 | [this](StringRef P, Any IR) { this->printAfterPass(P, IR); }); |
| 280 | PIC.registerAfterPassInvalidatedCallback( |
| 281 | [this](StringRef P) { this->printAfterPassInvalidated(P); }); |
| 282 | } |
| 283 | } |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 284 | |
| Arthur Eubanks | b13b858 | 2020-07-21 09:48:22 -0700 | [diff] [blame] | 285 | void OptNoneInstrumentation::registerCallbacks( |
| 286 | PassInstrumentationCallbacks &PIC) { |
| 287 | PIC.registerBeforePassCallback( |
| 288 | [this](StringRef P, Any IR) { return this->skip(P, IR); }); |
| 289 | } |
| 290 | |
| 291 | bool OptNoneInstrumentation::skip(StringRef PassID, Any IR) { |
| 292 | if (!EnableOptnone) |
| 293 | return true; |
| 294 | const Function *F = nullptr; |
| 295 | if (any_isa<const Function *>(IR)) { |
| 296 | F = any_cast<const Function *>(IR); |
| 297 | } else if (any_isa<const Loop *>(IR)) { |
| 298 | F = any_cast<const Loop *>(IR)->getHeader()->getParent(); |
| 299 | } |
| 300 | if (F && F->hasOptNone()) { |
| 301 | if (DebugLogging) |
| 302 | dbgs() << "Skipping pass: " << PassID << " (optnone)\n"; |
| 303 | return false; |
| 304 | } |
| 305 | return true; |
| 306 | } |
| 307 | |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 308 | void PrintPassInstrumentation::registerCallbacks( |
| 309 | PassInstrumentationCallbacks &PIC) { |
| 310 | if (!DebugLogging) |
| 311 | return; |
| 312 | |
| 313 | std::vector<StringRef> SpecialPasses = {"PassManager"}; |
| 314 | if (!DebugPMVerbose) |
| 315 | SpecialPasses.emplace_back("PassAdaptor"); |
| 316 | |
| 317 | PIC.registerBeforeNonSkippedPassCallback( |
| 318 | [SpecialPasses](StringRef PassID, Any IR) { |
| 319 | if (isSpecialPass(PassID, SpecialPasses)) |
| 320 | return; |
| 321 | |
| 322 | dbgs() << "Running pass: " << PassID << " on "; |
| 323 | unwrapAndPrint(IR, "", false, true); |
| 324 | }); |
| 325 | |
| 326 | PIC.registerBeforeAnalysisCallback([](StringRef PassID, Any IR) { |
| 327 | dbgs() << "Running analysis: " << PassID << " on "; |
| 328 | unwrapAndPrint(IR, "", false, true); |
| 329 | }); |
| 330 | } |
| 331 | |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 332 | void StandardInstrumentations::registerCallbacks( |
| 333 | PassInstrumentationCallbacks &PIC) { |
| Fedor Sergeev | 2d94c22 | 2018-12-21 11:49:05 +0000 | [diff] [blame] | 334 | PrintIR.registerCallbacks(PIC); |
| Yuanfang Chen | 555cf42 | 2020-07-28 17:08:24 -0700 | [diff] [blame^] | 335 | PrintPass.registerCallbacks(PIC); |
| Fedor Sergeev | 884e52a | 2018-10-05 22:32:01 +0000 | [diff] [blame] | 336 | TimePasses.registerCallbacks(PIC); |
| Arthur Eubanks | b13b858 | 2020-07-21 09:48:22 -0700 | [diff] [blame] | 337 | OptNone.registerCallbacks(PIC); |
| Fedor Sergeev | 662e568 | 2018-09-24 16:08:15 +0000 | [diff] [blame] | 338 | } |