llvm.org GIT mirror llvm / 67f335d
Use StringRef in Pass/PassManager APIs (NFC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283004 91177308-0d34-0410-b5e6-96231b3b80d8 Mehdi Amini 3 years ago
216 changed file(s) with 262 addition(s) and 400 deletion(s). Raw diff Collapse all Expand all
106106 // LPPassManager needs LoopInfo.
107107 void getAnalysisUsage(AnalysisUsage &Info) const override;
108108
109 const char *getPassName() const override {
110 return "Loop Pass Manager";
111 }
109 StringRef getPassName() const override { return "Loop Pass Manager"; }
112110
113111 PMDataManager *getAsPMDataManager() override { return this; }
114112 Pass *getAsPass() override { return this; }
100100 /// RGPassManager needs RegionInfo.
101101 void getAnalysisUsage(AnalysisUsage &Info) const override;
102102
103 const char *getPassName() const override {
104 return "Region Pass Manager";
105 }
103 StringRef getPassName() const override { return "Region Pass Manager"; }
106104
107105 PMDataManager *getAsPMDataManager() override { return this; }
108106 Pass *getAsPass() override { return this; }
341341 // Ctor, nothing fancy.
342342 IRTranslator();
343343
344 const char *getPassName() const override {
345 return "IRTranslator";
346 }
344 StringRef getPassName() const override { return "IRTranslator"; }
347345
348346 void getAnalysisUsage(AnalysisUsage &AU) const override;
349347
2727 class InstructionSelect : public MachineFunctionPass {
2828 public:
2929 static char ID;
30 const char *getPassName() const override { return "InstructionSelect"; }
30 StringRef getPassName() const override { return "InstructionSelect"; }
3131
3232 void getAnalysisUsage(AnalysisUsage &AU) const override;
3333
4040 // Ctor, nothing fancy.
4141 MachineLegalizePass();
4242
43 const char *getPassName() const override {
44 return "MachineLegalizePass";
45 }
43 StringRef getPassName() const override { return "MachineLegalizePass"; }
4644
4745 void getAnalysisUsage(AnalysisUsage &AU) const override;
4846
585585 /// Create a RegBankSelect pass with the specified \p RunningMode.
586586 RegBankSelect(Mode RunningMode = Fast);
587587
588 const char *getPassName() const override {
589 return "RegBankSelect";
590 }
588 StringRef getPassName() const override { return "RegBankSelect"; }
591589
592590 void getAnalysisUsage(AnalysisUsage &AU) const override;
593591
457457 /// in BackendConsumer::OptimizationRemarkHandler).
458458 virtual bool isEnabled() const = 0;
459459
460 const char *getPassName() const { return PassName; }
460 StringRef getPassName() const { return PassName; }
461461 std::string getMsg() const;
462462 Optional getHotness() const { return Hotness; }
463463 void setHotness(Optional H) { Hotness = H; }
485485 // Print passes managed by this manager
486486 void dumpPassStructure(unsigned Offset) override;
487487
488 const char *getPassName() const override {
489 return "Function Pass Manager";
490 }
488 StringRef getPassName() const override { return "Function Pass Manager"; }
491489
492490 FunctionPass *getContainedPass(unsigned N) {
493491 assert ( N < PassVector.size() && "Pass number out of range!");
5959 inline bool ignorablePass(const PassInfo *P) const {
6060 // Ignore non-selectable and non-constructible passes! Ignore
6161 // non-optimizations.
62 return P->getPassArgument() == nullptr || *P->getPassArgument() == 0 ||
63 P->getNormalCtor() == nullptr || ignorablePassImpl(P);
62 return P->getPassArgument().empty() || P->getNormalCtor() == nullptr ||
63 ignorablePassImpl(P);
6464 }
6565
6666 // Implement the PassRegistrationListener callbacks used to populate our map
6767 //
6868 void passRegistered(const PassInfo *P) override {
6969 if (ignorablePass(P)) return;
70 if (findOption(P->getPassArgument()) != getNumOptions()) {
70 if (findOption(P->getPassArgument().data()) != getNumOptions()) {
7171 errs() << "Two passes with the same argument (-"
7272 << P->getPassArgument() << ") attempted to be registered!\n";
7373 llvm_unreachable(nullptr);
7474 }
75 addLiteralOption(P->getPassArgument(), P, P->getPassName());
75 addLiteralOption(P->getPassArgument().data(), P, P->getPassName().data());
7676 }
7777 void passEnumerate(const PassInfo *P) override { passRegistered(P); }
7878
8888 // ValLessThan - Provide a sorting comparator for Values elements...
8989 static int ValLessThan(const PassNameParser::OptionInfo *VT1,
9090 const PassNameParser::OptionInfo *VT2) {
91 return std::strcmp(VT1->Name, VT2->Name);
91 return VT1->Name < VT2->Name;
9292 }
9393 };
9494
129129 class PassArgFilter {
130130 public:
131131 bool operator()(const PassInfo &P) const {
132 return(std::strstr(Args, P.getPassArgument()));
132 return StringRef(Args).contains(P.getPassArgument());
133133 }
134134 };
135135
9696 /// implemented in terms of the name that is registered by one of the
9797 /// Registration templates, but can be overloaded directly.
9898 ///
99 virtual const char *getPassName() const;
99 virtual StringRef getPassName() const;
100100
101101 /// getPassID - Return the PassID number that corresponds to this pass.
102102 AnalysisID getPassID() const {
1111 //===----------------------------------------------------------------------===//
1212 #ifndef LLVM_PASSINFO_H
1313 #define LLVM_PASSINFO_H
14
15 #include "llvm/ADT/StringRef.h"
1416
1517 #include
1618 #include
3234 typedef Pass *(*TargetMachineCtor_t)(TargetMachine *);
3335
3436 private:
35 const char *const PassName; // Nice name for Pass
36 const char *const PassArgument; // Command Line argument to run this pass
37 StringRef PassName; // Nice name for Pass
38 StringRef PassArgument; // Command Line argument to run this pass
3739 const void *PassID;
3840 const bool IsCFGOnlyPass; // Pass only looks at the CFG.
3941 const bool IsAnalysis; // True if an analysis pass.
4648 public:
4749 /// PassInfo ctor - Do not call this directly, this should only be invoked
4850 /// through RegisterPass.
49 PassInfo(const char *name, const char *arg, const void *pi,
50 NormalCtor_t normal, bool isCFGOnly, bool is_analysis,
51 PassInfo(StringRef name, StringRef arg, const void *pi, NormalCtor_t normal,
52 bool isCFGOnly, bool is_analysis,
5153 TargetMachineCtor_t machine = nullptr)
5254 : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly),
5355 IsAnalysis(is_analysis), IsAnalysisGroup(false), NormalCtor(normal),
6264
6365 /// getPassName - Return the friendly name for the pass, never returns null
6466 ///
65 const char *getPassName() const { return PassName; }
67 StringRef getPassName() const { return PassName; }
6668
6769 /// getPassArgument - Return the command line option that may be passed to
6870 /// 'opt' that will cause this pass to be run. This will return null if there
6971 /// is no argument.
7072 ///
71 const char *getPassArgument() const { return PassArgument; }
73 StringRef getPassArgument() const { return PassArgument; }
7274
7375 /// getTypeInfo - Return the id object for the pass...
7476 /// TODO : Rename
6666 Info.setPreservesAll();
6767 }
6868
69 const char *getPassName() const override {
70 return "CallGraph Pass Manager";
71 }
69 StringRef getPassName() const override { return "CallGraph Pass Manager"; }
7270
7371 PMDataManager *getAsPMDataManager() override { return this; }
7472 Pass *getAsPass() override { return this; }
4747 initializeWriteBitcodePassPass(*PassRegistry::getPassRegistry());
4848 }
4949
50 const char *getPassName() const override { return "Bitcode Writer"; }
50 StringRef getPassName() const override { return "Bitcode Writer"; }
5151
5252 bool runOnModule(Module &M) override {
5353 const ModuleSummaryIndex *Index =
163163 }
164164 bool runOnFunction(Function &F) override;
165165
166 const char *getPassName() const override { return "CodeGen Prepare"; }
166 StringRef getPassName() const override { return "CodeGen Prepare"; }
167167
168168 void getAnalysisUsage(AnalysisUsage &AU) const override {
169169 // FIXME: When we can selectively preserve passes, preserve the domtree.
6262 static char ID;
6363 DetectDeadLanes() : MachineFunctionPass(ID) {}
6464
65 const char *getPassName() const override { return "Detect Dead Lanes"; }
65 StringRef getPassName() const override { return "Detect Dead Lanes"; }
6666
6767 void getAnalysisUsage(AnalysisUsage &AU) const override {
6868 AU.setPreservesCFG();
7070
7171 void getAnalysisUsage(AnalysisUsage &AU) const override;
7272
73 const char *getPassName() const override {
73 StringRef getPassName() const override {
7474 return "Exception handling preparation";
7575 }
7676 };
601601 EarlyIfConverter() : MachineFunctionPass(ID) {}
602602 void getAnalysisUsage(AnalysisUsage &AU) const override;
603603 bool runOnMachineFunction(MachineFunction &MF) override;
604 const char *getPassName() const override { return "Early If-Conversion"; }
604 StringRef getPassName() const override { return "Early If-Conversion"; }
605605
606606 private:
607607 bool tryConvertIf(MachineBasicBlock*);
174174 MachineFunctionProperties::Property::NoVRegs);
175175 }
176176
177 const char *getPassName() const override {
178 return "Execution dependency fix";
179 }
177 StringRef getPassName() const override { return "Execution dependency fix"; }
180178
181179 private:
182180 iterator_range::const_iterator>
3131 public:
3232 explicit Printer(raw_ostream &OS) : FunctionPass(ID), OS(OS) {}
3333
34 const char *getPassName() const override;
34 StringRef getPassName() const override;
3535 void getAnalysisUsage(AnalysisUsage &AU) const override;
3636
3737 bool runOnFunction(Function &F) override;
8686 return new Printer(OS);
8787 }
8888
89 const char *Printer::getPassName() const {
89 StringRef Printer::getPassName() const {
9090 return "Print Garbage Collector Information";
9191 }
9292
4444 static char ID;
4545
4646 LowerIntrinsics();
47 const char *getPassName() const override;
47 StringRef getPassName() const override;
4848 void getAnalysisUsage(AnalysisUsage &AU) const override;
4949
5050 bool doInitialization(Module &M) override;
9292 initializeLowerIntrinsicsPass(*PassRegistry::getPassRegistry());
9393 }
9494
95 const char *LowerIntrinsics::getPassName() const {
95 StringRef LowerIntrinsics::getPassName() const {
9696 return "Lower Garbage Collection Instructions";
9797 }
9898
181181 bool runOnFunction(Function &F) override;
182182 bool doFinalization(Module &M) override;
183183
184 const char *getPassName() const override {
185 return "Merge internal globals";
186 }
184 StringRef getPassName() const override { return "Merge internal globals"; }
187185
188186 void getAnalysisUsage(AnalysisUsage &AU) const override {
189187 AU.setPreservesCFG();
6969 initializeInterleavedAccessPass(*PassRegistry::getPassRegistry());
7070 }
7171
72 const char *getPassName() const override { return "Interleaved Access Pass"; }
72 StringRef getPassName() const override { return "Interleaved Access Pass"; }
7373
7474 bool runOnFunction(Function &F) override;
7575
3232 MIRPrintingPass() : MachineFunctionPass(ID), OS(dbgs()) {}
3333 MIRPrintingPass(raw_ostream &OS) : MachineFunctionPass(ID), OS(OS) {}
3434
35 const char *getPassName() const override { return "MIR Printing Pass"; }
35 StringRef getPassName() const override { return "MIR Printing Pass"; }
3636
3737 void getAnalysisUsage(AnalysisUsage &AU) const override {
3838 AU.setPreservesAll();
5555 }
5656 void getAnalysisUsage(AnalysisUsage &AU) const override;
5757 bool runOnMachineFunction(MachineFunction &MF) override;
58 const char *getPassName() const override { return "Machine InstCombiner"; }
58 StringRef getPassName() const override { return "Machine InstCombiner"; }
5959
6060 private:
6161 bool doSubstitute(unsigned NewSize, unsigned OldSize);
3333 MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner)
3434 : MachineFunctionPass(ID), OS(os), Banner(banner) {}
3535
36 const char *getPassName() const override { return "MachineFunction Printer"; }
36 StringRef getPassName() const override { return "MachineFunction Printer"; }
3737
3838 void getAnalysisUsage(AnalysisUsage &AU) const override {
3939 AU.setPreservesAll();
7575 RABasic();
7676
7777 /// Return the pass name.
78 const char* getPassName() const override {
79 return "Basic Register Allocator";
80 }
78 StringRef getPassName() const override { return "Basic Register Allocator"; }
8179
8280 /// RABasic analysis usage.
8381 void getAnalysisUsage(AnalysisUsage &AU) const override;
148148 spillImpossible = ~0u
149149 };
150150 public:
151 const char *getPassName() const override {
152 return "Fast Register Allocator";
153 }
151 StringRef getPassName() const override { return "Fast Register Allocator"; }
154152
155153 void getAnalysisUsage(AnalysisUsage &AU) const override {
156154 AU.setPreservesCFG();
317317 RAGreedy();
318318
319319 /// Return the pass name.
320 const char* getPassName() const override {
321 return "Greedy Register Allocator";
322 }
320 StringRef getPassName() const override { return "Greedy Register Allocator"; }
323321
324322 /// RAGreedy analysis usage.
325323 void getAnalysisUsage(AnalysisUsage &AU) const override;
9898 }
9999
100100 /// Return the pass name.
101 const char* getPassName() const override {
102 return "PBQP Register Allocator";
103 }
101 StringRef getPassName() const override { return "PBQP Register Allocator"; }
104102
105103 /// PBQP analysis usage.
106104 void getAnalysisUsage(AnalysisUsage &au) const override;
4747 initializeRegUsageInfoCollectorPass(Registry);
4848 }
4949
50 const char *getPassName() const override {
50 StringRef getPassName() const override {
5151 return "Register Usage Information Collector Pass";
5252 }
5353
5151 initializeRegUsageInfoPropagationPassPass(Registry);
5252 }
5353
54 const char *getPassName() const override { return RUIP_NAME; }
54 StringRef getPassName() const override { return RUIP_NAME; }
5555
5656 bool runOnMachineFunction(MachineFunction &MF) override;
5757
4747 static char ID;
4848 RenameIndependentSubregs() : MachineFunctionPass(ID) {}
4949
50 const char *getPassName() const override {
50 StringRef getPassName() const override {
5151 return "Rename Disconnected Subregister Components";
5252 }
5353
3535 ResetMachineFunction(bool EmitFallbackDiag = false)
3636 : MachineFunctionPass(ID), EmitFallbackDiag(EmitFallbackDiag) {}
3737
38 const char *getPassName() const override {
39 return "ResetMachineFunction";
40 }
38 StringRef getPassName() const override { return "ResetMachineFunction"; }
4139
4240 bool runOnMachineFunction(MachineFunction &MF) override {
4341 if (MF.getProperties().hasProperty(
198198 MachineFunctionPass::getAnalysisUsage(AU);
199199 }
200200
201 const char *getPassName() const override {
202 return "Shrink Wrapping analysis";
203 }
201 StringRef getPassName() const override { return "Shrink Wrapping analysis"; }
204202
205203 /// \brief Perform the shrink-wrapping analysis and update
206204 /// the MachineFrameInfo attached to \p MF with the results.
5757 bool runOnFunction(Function &F) override;
5858
5959 void getAnalysisUsage(AnalysisUsage &AU) const override {}
60 const char *getPassName() const override {
60 StringRef getPassName() const override {
6161 return "SJLJ Exception Handling preparation";
6262 }
6363
6161
6262 void getAnalysisUsage(AnalysisUsage &AU) const override;
6363
64 const char *getPassName() const override {
64 StringRef getPassName() const override {
6565 return "Windows exception handling preparation";
6666 }
6767
192192 PMDataManager *getAsPMDataManager() override { return this; }
193193 Pass *getAsPass() override { return this; }
194194
195 const char *getPassName() const override {
196 return "BasicBlock Pass Manager";
197 }
195 StringRef getPassName() const override { return "BasicBlock Pass Manager"; }
198196
199197 // Print passes managed by this manager
200198 void dumpPassStructure(unsigned Offset) override {
339337 /// its runOnFunction() for function F.
340338 Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F) override;
341339
342 const char *getPassName() const override {
343 return "Module Pass Manager";
344 }
340 StringRef getPassName() const override { return "Module Pass Manager"; }
345341
346342 PMDataManager *getAsPMDataManager() override { return this; }
347343 Pass *getAsPass() override { return this; }
683679
684680 if (PI && !PI->isAnalysis() && ShouldPrintBeforePass(PI)) {
685681 Pass *PP = P->createPrinterPass(
686 dbgs(), std::string("*** IR Dump Before ") + P->getPassName() + " ***");
682 dbgs(), ("*** IR Dump Before " + P->getPassName() + " ***").str());
687683 PP->assignPassManager(activeStack, getTopLevelPassManagerType());
688684 }
689685
692688
693689 if (PI && !PI->isAnalysis() && ShouldPrintAfterPass(PI)) {
694690 Pass *PP = P->createPrinterPass(
695 dbgs(), std::string("*** IR Dump After ") + P->getPassName() + " ***");
691 dbgs(), ("*** IR Dump After " + P->getPassName() + " ***").str());
696692 PP->assignPassManager(activeStack, getTopLevelPassManagerType());
697693 }
698694 }
6363 /// implemented in terms of the name that is registered by one of the
6464 /// Registration templates, but can be overloaded directly.
6565 ///
66 const char *Pass::getPassName() const {
66 StringRef Pass::getPassName() const {
6767 AnalysisID AID = getPassID();
6868 const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(AID);
6969 if (PI)
9292 MachineFunctionProperties::Property::NoVRegs);
9393 }
9494
95 const char *getPassName() const override {
95 StringRef getPassName() const override {
9696 return "Workaround A53 erratum 835769 pass";
9797 }
9898
124124 MachineFunctionProperties::Property::NoVRegs);
125125 }
126126
127 const char *getPassName() const override {
127 StringRef getPassName() const override {
128128 return "A57 FP Anti-dependency breaker";
129129 }
130130
6767 initializeAArch64AddressTypePromotionPass(*PassRegistry::getPassRegistry());
6868 }
6969
70 const char *getPassName() const override {
71 return AARCH64_TYPE_PROMO_NAME;
72 }
70 StringRef getPassName() const override { return AARCH64_TYPE_PROMO_NAME; }
7371
7472 /// Iterate over the functions and promote the computation of interesting
7573 // sext instructions.
8989
9090 bool runOnMachineFunction(MachineFunction &F) override;
9191
92 const char *getPassName() const override {
93 return AARCH64_ADVSIMD_NAME;
94 }
92 StringRef getPassName() const override { return AARCH64_ADVSIMD_NAME; }
9593
9694 void getAnalysisUsage(AnalysisUsage &AU) const override {
9795 AU.setPreservesCFG();
5555 : AsmPrinter(TM, std::move(Streamer)), MCInstLowering(OutContext, *this),
5656 SM(*this), AArch64FI(nullptr) {}
5757
58 const char *getPassName() const override {
59 return "AArch64 Assembly Printer";
60 }
58 StringRef getPassName() const override { return "AArch64 Assembly Printer"; }
6159
6260 /// \brief Wrapper for MCInstLowering.lowerOperand() for the
6361 /// tblgen'erated pseudo lowering.
8787
8888 bool runOnMachineFunction(MachineFunction &MF) override;
8989
90 const char *getPassName() const override {
91 return AARCH64_BR_RELAX_NAME;
92 }
90 StringRef getPassName() const override { return AARCH64_BR_RELAX_NAME; }
9391 };
9492 char AArch64BranchRelaxation::ID = 0;
9593 }
131131 return Copy;
132132 }
133133
134 const char *getPassName() const override { return TLSCLEANUP_PASS_NAME; }
134 StringRef getPassName() const override { return TLSCLEANUP_PASS_NAME; }
135135
136136 void getAnalysisUsage(AnalysisUsage &AU) const override {
137137 AU.setPreservesCFG();
183183 MachineFunctionProperties::Property::NoVRegs);
184184 }
185185
186 const char *getPassName() const override {
187 return AARCH64_COLLECT_LOH_NAME;
188 }
186 StringRef getPassName() const override { return AARCH64_COLLECT_LOH_NAME; }
189187
190188 void getAnalysisUsage(AnalysisUsage &AU) const override {
191189 AU.setPreservesAll();
104104 bool adjustTo(MachineInstr *CmpMI, AArch64CC::CondCode Cmp, MachineInstr *To,
105105 int ToImm);
106106 bool runOnMachineFunction(MachineFunction &MF) override;
107 const char *getPassName() const override {
107 StringRef getPassName() const override {
108108 return "AArch64 Condition Optimizer";
109109 }
110110 };
736736 }
737737 void getAnalysisUsage(AnalysisUsage &AU) const override;
738738 bool runOnMachineFunction(MachineFunction &MF) override;
739 const char *getPassName() const override {
739 StringRef getPassName() const override {
740740 return "AArch64 Conditional Compares";
741741 }
742742
4848 MachineFunctionProperties::Property::NoVRegs);
4949 }
5050
51 const char *getPassName() const override { return AARCH64_DEAD_REG_DEF_NAME; }
51 StringRef getPassName() const override { return AARCH64_DEAD_REG_DEF_NAME; }
5252
5353 void getAnalysisUsage(AnalysisUsage &AU) const override {
5454 AU.setPreservesCFG();
3636
3737 bool runOnMachineFunction(MachineFunction &Fn) override;
3838
39 const char *getPassName() const override {
40 return AARCH64_EXPAND_PSEUDO_NAME;
41 }
39 StringRef getPassName() const override { return AARCH64_EXPAND_PSEUDO_NAME; }
4240
4341 private:
4442 bool expandMBB(MachineBasicBlock &MBB);
4646 : SelectionDAGISel(tm, OptLevel), Subtarget(nullptr),
4747 ForCodeSize(false) {}
4848
49 const char *getPassName() const override {
49 StringRef getPassName() const override {
5050 return "AArch64 Instruction Selection";
5151 }
5252
164164 MachineFunctionProperties::Property::NoVRegs);
165165 }
166166
167 const char *getPassName() const override {
168 return AARCH64_LOAD_STORE_OPT_NAME;
169 }
167 StringRef getPassName() const override { return AARCH64_LOAD_STORE_OPT_NAME; }
170168 };
171169 char AArch64LoadStoreOpt::ID = 0;
172170 } // namespace
104104 initializeAArch64PromoteConstantPass(*PassRegistry::getPassRegistry());
105105 }
106106
107 const char *getPassName() const override { return "AArch64 Promote Constant"; }
107 StringRef getPassName() const override { return "AArch64 Promote Constant"; }
108108
109109 /// Iterate over the functions and promote the interesting constants into
110110 /// global variables with module scope.
5555 return MachineFunctionProperties().set(
5656 MachineFunctionProperties::Property::NoVRegs);
5757 }
58 const char *getPassName() const override {
58 StringRef getPassName() const override {
5959 return "AArch64 Redundant Copy Elimination";
6060 }
6161 };
4141 initializeAArch64StorePairSuppressPass(*PassRegistry::getPassRegistry());
4242 }
4343
44 const char *getPassName() const override { return STPSUPPRESS_PASS_NAME; }
44 StringRef getPassName() const override { return STPSUPPRESS_PASS_NAME; }
4545
4646 bool runOnMachineFunction(MachineFunction &F) override;
4747
2626 public:
2727 AMDGPUAlwaysInline() : ModulePass(ID) { }
2828 bool runOnModule(Module &M) override;
29 const char *getPassName() const override { return "AMDGPU Always Inline Pass"; }
29 StringRef getPassName() const override { return "AMDGPU Always Inline Pass"; }
3030 };
3131
3232 } // End anonymous namespace
3535
3636 AMDGPUAnnotateKernelFeatures() : ModulePass(ID) { }
3737 bool runOnModule(Module &M) override;
38 const char *getPassName() const override {
38 StringRef getPassName() const override {
3939 return "AMDGPU Annotate Kernel Features";
4040 }
4141
3636 FunctionPass(ID) { }
3737 bool doInitialization(Module &M) override;
3838 bool runOnFunction(Function &F) override;
39 const char *getPassName() const override { return "AMDGPU Annotate Uniform Values"; }
39 StringRef getPassName() const override {
40 return "AMDGPU Annotate Uniform Values";
41 }
4042 void getAnalysisUsage(AnalysisUsage &AU) const override {
4143 AU.addRequired();
4244 AU.setPreservesAll();
9494 std::unique_ptr Streamer)
9595 : AsmPrinter(TM, std::move(Streamer)) {}
9696
97 const char *AMDGPUAsmPrinter::getPassName() const {
97 StringRef AMDGPUAsmPrinter::getPassName() const {
9898 return "AMDGPU Assembly Printer";
9999 }
100100
117117
118118 bool runOnMachineFunction(MachineFunction &MF) override;
119119
120 const char *getPassName() const override;
120 StringRef getPassName() const override;
121121
122122 /// Implemented in AMDGPUMCInstLower.cpp
123123 void EmitInstruction(const MachineInstr *MI) override;
113113 bool doInitialization(Module &M) override;
114114 bool runOnFunction(Function &F) override;
115115
116 const char *getPassName() const override {
117 return "AMDGPU IR optimizations";
118 }
116 StringRef getPassName() const override { return "AMDGPU IR optimizations"; }
119117
120118 void getAnalysisUsage(AnalysisUsage &AU) const override {
121119 AU.addRequired();
4949 virtual ~AMDGPUDAGToDAGISel();
5050 bool runOnMachineFunction(MachineFunction &MF) override;
5151 void Select(SDNode *N) override;
52 const char *getPassName() const override;
52 StringRef getPassName() const override;
5353 void PostprocessISelDAG() override;
5454
5555 private:
493493 Term->getMetadata("structurizecfg.uniform");
494494 }
495495
496 const char *AMDGPUDAGToDAGISel::getPassName() const {
496 StringRef AMDGPUDAGToDAGISel::getPassName() const {
497497 return "AMDGPU DAG->DAG Pattern Instruction Selection";
498498 }
499499
357357 return transformKernels(M);
358358 }
359359
360 const char *getPassName() const override {
360 StringRef getPassName() const override {
361361 return "AMDGPU OpenCL Image Type Pass";
362362 }
363363 };
7575 bool doInitialization(Module &M) override;
7676 bool runOnFunction(Function &F) override;
7777
78 const char *getPassName() const override {
79 return "AMDGPU Promote Alloca";
80 }
78 StringRef getPassName() const override { return "AMDGPU Promote Alloca"; }
8179
8280 void handleAlloca(AllocaInst &I);
8381
137137 initializeAMDGPUCFGStructurizerPass(*PassRegistry::getPassRegistry());
138138 }
139139
140 const char *getPassName() const override {
140 StringRef getPassName() const override {
141141 return "AMDGPU Control Flow Graph structurizer Pass";
142142 }
143143
6565
6666 bool runOnMachineFunction(MachineFunction &MF) override;
6767
68 const char *getPassName() const override;
68 StringRef getPassName() const override;
6969 };
7070
7171 char R600ClauseMergePass::ID = 0;
200200 return false;
201201 }
202202
203 const char *R600ClauseMergePass::getPassName() const {
203 StringRef R600ClauseMergePass::getPassName() const {
204204 return "R600 Merge Clause Markers Pass";
205205 }
206206
683683 return false;
684684 }
685685
686 const char *getPassName() const override {
686 StringRef getPassName() const override {
687687 return "R600 Control Flow Finalizer Pass";
688688 }
689689 };
318318 return false;
319319 }
320320
321 const char *getPassName() const override {
321 StringRef getPassName() const override {
322322 return "R600 Emit Clause Markers Pass";
323323 }
324324 };
4141
4242 bool runOnMachineFunction(MachineFunction &MF) override;
4343
44 const char *getPassName() const override {
44 StringRef getPassName() const override {
4545 return "R600 Expand special instructions pass";
4646 }
4747 };
120120 MachineFunctionPass::getAnalysisUsage(AU);
121121 }
122122
123 const char *getPassName() const override {
123 StringRef getPassName() const override {
124124 return "R600 Vector Registers Merge Pass";
125125 }
126126
4646 MachineFunctionPass::getAnalysisUsage(AU);
4747 }
4848
49 const char *getPassName() const override {
50 return "R600 Packetizer";
51 }
49 StringRef getPassName() const override { return "R600 Packetizer"; }
5250
5351 bool runOnMachineFunction(MachineFunction &Fn) override;
5452 };
101101
102102 bool runOnFunction(Function &F) override;
103103
104 const char *getPassName() const override {
105 return "SI annotate control flow";
106 }
104 StringRef getPassName() const override { return "SI annotate control flow"; }
107105
108106 void getAnalysisUsage(AnalysisUsage &AU) const override {
109107 AU.addRequired();
3737 static char ID;
3838
3939 SIDebuggerInsertNops() : MachineFunctionPass(ID) { }
40 const char *getPassName() const override { return PASS_NAME; }
40 StringRef getPassName() const override { return PASS_NAME; }
4141
4242 void getAnalysisUsage(AnalysisUsage &AU) const override {
4343 AU.setPreservesCFG();
3636
3737 bool runOnMachineFunction(MachineFunction &MF) override;
3838
39 const char *getPassName() const override {
40 return "SI Fix CF Live Intervals";
41 }
39 StringRef getPassName() const override { return "SI Fix CF Live Intervals"; }
4240
4341 void getAnalysisUsage(AnalysisUsage &AU) const override {
4442 AU.addRequired();
8888
8989 bool runOnMachineFunction(MachineFunction &MF) override;
9090
91 const char *getPassName() const override {
92 return "SI Fix SGPR copies";
93 }
91 StringRef getPassName() const override { return "SI Fix SGPR copies"; }
9492
9593 void getAnalysisUsage(AnalysisUsage &AU) const override {
9694 AU.setPreservesCFG();
3535
3636 bool runOnMachineFunction(MachineFunction &MF) override;
3737
38 const char *getPassName() const override {
39 return "SI Fold Operands";
40 }
38 StringRef getPassName() const override { return "SI Fold Operands"; }
4139
4240 void getAnalysisUsage(AnalysisUsage &AU) const override {
4341 AU.setPreservesCFG();
5959
6060 bool runOnMachineFunction(MachineFunction &MF) override;
6161
62 const char *getPassName() const override {
62 StringRef getPassName() const override {
6363 return "SI insert s_cbranch_execz instructions";
6464 }
6565
147147
148148 bool runOnMachineFunction(MachineFunction &MF) override;
149149
150 const char *getPassName() const override {
150 StringRef getPassName() const override {
151151 return "SI insert wait instructions";
152152 }
153153
9797
9898 bool runOnMachineFunction(MachineFunction &MF) override;
9999
100 const char *getPassName() const override {
101 return "SI Load / Store Optimizer";
102 }
100 StringRef getPassName() const override { return "SI Load / Store Optimizer"; }
103101
104102 void getAnalysisUsage(AnalysisUsage &AU) const override {
105103 AU.setPreservesCFG();
9191
9292 bool runOnMachineFunction(MachineFunction &MF) override;
9393
94 const char *getPassName() const override {
94 StringRef getPassName() const override {
9595 return "SI Lower control flow pseudo instructions";
9696 }
9797
4040
4141 bool runOnMachineFunction(MachineFunction &MF) override;
4242
43 const char *getPassName() const override {
44 return "SI Lower i1 Copies";
45 }
43 StringRef getPassName() const override { return "SI Lower i1 Copies"; }
4644
4745 void getAnalysisUsage(AnalysisUsage &AU) const override {
4846 AU.setPreservesCFG();
3232
3333 bool runOnMachineFunction(MachineFunction &MF) override;
3434
35 const char *getPassName() const override {
35 StringRef getPassName() const override {
3636 return "SI optimize exec mask operations";
3737 }
3838
4444
4545 bool runOnMachineFunction(MachineFunction &MF) override;
4646
47 const char *getPassName() const override {
48 return "SI Shrink Instructions";
49 }
47 StringRef getPassName() const override { return "SI Shrink Instructions"; }
5048
5149 void getAnalysisUsage(AnalysisUsage &AU) const override {
5250 AU.setPreservesCFG();
4141 SITypeRewriter() : FunctionPass(ID) { }
4242 bool doInitialization(Module &M) override;
4343 bool runOnFunction(Function &F) override;
44 const char *getPassName() const override {
45 return "SI Type Rewriter";
46 }
44 StringRef getPassName() const override { return "SI Type Rewriter"; }
4745 void visitLoadInst(LoadInst &I);
4846 void visitCallInst(CallInst &I);
4947 void visitBitCast(BitCastInst &I);
152152
153153 bool runOnMachineFunction(MachineFunction &MF) override;
154154
155 const char *getPassName() const override {
156 return "SI Whole Quad Mode";
157 }
155 StringRef getPassName() const override { return "SI Whole Quad Mode"; }
158156
159157 void getAnalysisUsage(AnalysisUsage &AU) const override {
160158 AU.addRequired();
5151
5252 bool runOnMachineFunction(MachineFunction &Fn) override;
5353
54 const char *getPassName() const override {
55 return "ARM A15 S->D optimizer";
56 }
54 StringRef getPassName() const override { return "ARM A15 S->D optimizer"; }
5755
5856 private:
5957 const ARMBaseInstrInfo *TII;
6969 explicit ARMAsmPrinter(TargetMachine &TM,
7070 std::unique_ptr Streamer);
7171
72 const char *getPassName() const override {
72 StringRef getPassName() const override {
7373 return "ARM Assembly / Object Emitter";
7474 }
7575
199199 MachineFunctionProperties::Property::NoVRegs);
200200 }
201201
202 const char *getPassName() const override {
202 StringRef getPassName() const override {
203203 return "ARM constant island placement and branch shortening pass";
204204 }
205205
5555 MachineFunctionProperties::Property::NoVRegs);
5656 }
5757
58 const char *getPassName() const override {
58 StringRef getPassName() const override {
5959 return "ARM pseudo instruction expansion pass";
6060 }
6161
6969 return true;
7070 }
7171
72 const char *getPassName() const override {
73 return "ARM Instruction Selection";
74 }
72 StringRef getPassName() const override { return "ARM Instruction Selection"; }
7573
7674 void PreprocessISelDAG() override;
7775
9797 MachineFunctionProperties::Property::NoVRegs);
9898 }
9999
100 const char *getPassName() const override {
101 return ARM_LOAD_STORE_OPT_NAME;
102 }
100 StringRef getPassName() const override { return ARM_LOAD_STORE_OPT_NAME; }
103101
104102 private:
105103 /// A set of load/store MachineInstrs with same base register sorted by
19521950
19531951 bool runOnMachineFunction(MachineFunction &Fn) override;
19541952
1955 const char *getPassName() const override {
1953 StringRef getPassName() const override {
19561954 return ARM_PREALLOC_LOAD_STORE_OPT_NAME;
19571955 }
19581956
3131 MachineFunctionProperties::Property::NoVRegs);
3232 }
3333
34 const char *getPassName() const override {
35 return "optimise barriers pass";
36 }
34 StringRef getPassName() const override { return "optimise barriers pass"; }
3735 };
3836 char ARMOptimizeBarriersPass::ID = 0;
3937 }
4242
4343 bool runOnMachineFunction(MachineFunction &Fn) override;
4444
45 const char *getPassName() const override {
45 StringRef getPassName() const override {
4646 return "ARM MLA / MLS expansion pass";
4747 }
4848
4040 MachineFunctionProperties::Property::NoVRegs);
4141 }
4242
43 const char *getPassName() const override {
43 StringRef getPassName() const override {
4444 return "Thumb IT blocks insertion pass";
4545 }
4646
150150 MachineFunctionProperties::Property::NoVRegs);
151151 }
152152
153 const char *getPassName() const override {
153 StringRef getPassName() const override {
154154 return "Thumb2 instruction size reduction pass";
155155 }
156156
3737 explicit BPFAsmPrinter(TargetMachine &TM, std::unique_ptr Streamer)
3838 : AsmPrinter(TM, std::move(Streamer)) {}
3939
40 const char *getPassName() const override { return "BPF Assembly Printer"; }
40 StringRef getPassName() const override { return "BPF Assembly Printer"; }
4141
4242 void EmitInstruction(const MachineInstr *MI) override;
4343 };
3737 public:
3838 explicit BPFDAGToDAGISel(BPFTargetMachine &TM) : SelectionDAGISel(TM) {}
3939
40 const char *getPassName() const override {
40 StringRef getPassName() const override {
4141 return "BPF DAG->DAG Pattern Instruction Selection";
4242 }
4343
3232 return AsmPrinter::runOnMachineFunction(Fn);
3333 }
3434
35 const char *getPassName() const override {
35 StringRef getPassName() const override {
3636 return "Hexagon Assembly Printer";
3737 }
3838
143143 HexagonBitSimplify() : MachineFunctionPass(ID), MDT(0) {
144144 initializeHexagonBitSimplifyPass(*PassRegistry::getPassRegistry());
145145 }
146 virtual const char *getPassName() const {
146 virtual StringRef getPassName() const {
147147 return "Hexagon bit simplification";
148148 }
149149 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
4343
4444 bool runOnMachineFunction(MachineFunction &MF) override;
4545
46 const char *getPassName() const override {
46 StringRef getPassName() const override {
4747 return "Hexagon Branch Relaxation";
4848 }
4949
4444 initializeHexagonCFGOptimizerPass(*PassRegistry::getPassRegistry());
4545 }
4646
47 const char *getPassName() const override {
48 return "Hexagon CFG Optimizer";
49 }
47 StringRef getPassName() const override { return "Hexagon CFG Optimizer"; }
5048 bool runOnMachineFunction(MachineFunction &Fn) override;
5149 MachineFunctionProperties getRequiredProperties() const override {
5250 return MachineFunctionProperties().set(
8181 initializeHexagonCommonGEPPass(*PassRegistry::getPassRegistry());
8282 }
8383 virtual bool runOnFunction(Function &F);
84 virtual const char *getPassName() const {
85 return "Hexagon Common GEP";
86 }
84 virtual StringRef getPassName() const { return "Hexagon Common GEP"; }
8785
8886 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
8987 AU.addRequired();
18871887 PassRegistry &Registry = *PassRegistry::getPassRegistry();
18881888 initializeHexagonConstPropagationPass(Registry);
18891889 }
1890 const char *getPassName() const override {
1890 StringRef getPassName() const override {
18911891 return "Hexagon Constant Propagation";
18921892 }
18931893 bool runOnMachineFunction(MachineFunction &MF) override {
7676 MachineFunctionPass::getAnalysisUsage(AU);
7777 }
7878
79 const char *getPassName() const override {
79 StringRef getPassName() const override {
8080 return "Hexagon Copy-To-Combine Pass";
8181 }
8282
136136 HII(0), TRI(0), MFN(0), MRI(0), MDT(0), MLI(0) {
137137 initializeHexagonEarlyIfConversionPass(*PassRegistry::getPassRegistry());
138138 }
139 const char *getPassName() const override {
139 StringRef getPassName() const override {
140140 return "Hexagon early if conversion";
141141 }
142142 void getAnalysisUsage(AnalysisUsage &AU) const override {
135135 initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry());
136136 }
137137
138 const char *getPassName() const override {
139 return "Hexagon Expand Condsets";
140 }
138 StringRef getPassName() const override { return "Hexagon Expand Condsets"; }
141139 void getAnalysisUsage(AnalysisUsage &AU) const override {
142140 AU.addRequired();
143141 AU.addPreserved();
4949 MachineFunctionProperties::Property::NoVRegs);
5050 }
5151
52 const char *getPassName() const override {
52 StringRef getPassName() const override {
5353 return "Hexagon Hardware Loop Fixup";
5454 }
5555
5151 HexagonGenExtract() : FunctionPass(ID), ExtractCount(0) {
5252 initializeHexagonGenExtractPass(*PassRegistry::getPassRegistry());
5353 }
54 virtual const char *getPassName() const override {
54 virtual StringRef getPassName() const override {
5555 return "Hexagon generate \"extract\" instructions";
5656 }
5757 virtual bool runOnFunction(Function &F) override;
466466 HexagonGenInsert() : MachineFunctionPass(ID), HII(0), HRI(0) {
467467 initializeHexagonGenInsertPass(*PassRegistry::getPassRegistry());
468468 }
469 virtual const char *getPassName() const {
469 virtual StringRef getPassName() const {
470470 return "Hexagon generate \"insert\" instructions";
471471 }
472472 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
4141 HexagonGenMux() : MachineFunctionPass(ID), HII(0), HRI(0) {
4242 initializeHexagonGenMuxPass(*PassRegistry::getPassRegistry());
4343 }
44 const char *getPassName() const override {
44 StringRef getPassName() const override {
4545 return "Hexagon generate mux instructions";
4646 }
4747 void getAnalysisUsage(AnalysisUsage &AU) const override {
6363 HexagonGenPredicate() : MachineFunctionPass(ID), TII(0), TRI(0), MRI(0) {
6464 initializeHexagonGenPredicatePass(*PassRegistry::getPassRegistry());
6565 }
66 virtual const char *getPassName() const {
66 virtual StringRef getPassName() const {
6767 return "Hexagon generate predicate operations";
6868 }
6969 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
9393
9494 bool runOnMachineFunction(MachineFunction &MF) override;
9595
96 const char *getPassName() const override { return "Hexagon Hardware Loops"; }
96 StringRef getPassName() const override { return "Hexagon Hardware Loops"; }
9797
9898 void getAnalysisUsage(AnalysisUsage &AU) const override {
9999 AU.addRequired();
8181 bool SelectGlobalAddress(SDValue &N, SDValue &R, bool UseGP);
8282 bool SelectAddrFI(SDValue &N, SDValue &R);
8383
84 const char *getPassName() const override {
84 StringRef getPassName() const override {
8585 return "Hexagon DAG->DAG Pattern Instruction Selection";
8686 }
8787
7777 MachineFunctionPass::getAnalysisUsage(AU);
7878 }
7979
80 const char *getPassName() const override {
81 return "Hexagon NewValueJump";
82 }
80 StringRef getPassName() const override { return "Hexagon NewValueJump"; }
8381
8482 bool runOnMachineFunction(MachineFunction &Fn) override;
8583 MachineFunctionProperties getRequiredProperties() const override {
5151 PassRegistry &R = *PassRegistry::getPassRegistry();
5252 initializeHexagonOptAddrModePass(R);
5353 }
54 const char *getPassName() const override {
54 StringRef getPassName() const override {
5555 return "Optimize addressing mode of load/store";
5656 }
5757 void getAnalysisUsage(AnalysisUsage &AU) const override {
3636 }
3737 bool runOnFunction(Function &F) override;
3838
39 const char *getPassName() const override {
40 return "Remove sign extends";
41 }
39 StringRef getPassName() const override { return "Remove sign extends"; }
4240
4341 void getAnalysisUsage(AnalysisUsage &AU) const override {
4442 AU.addPreserved();
9292
9393 bool runOnMachineFunction(MachineFunction &MF) override;
9494
95 const char *getPassName() const override {
95 StringRef getPassName() const override {
9696 return "Hexagon optimize redundant zero and size extends";
9797 }
9898
4949 AU.setPreservesAll();
5050 MachineFunctionPass::getAnalysisUsage(AU);
5151 }
52 const char *getPassName() const override {
52 StringRef getPassName() const override {
5353 return "Hexagon RDF optimizations";
5454 }
5555 bool runOnMachineFunction(MachineFunction &MF) override;
4242 PassRegistry &R = *PassRegistry::getPassRegistry();
4343 initializeHexagonSplitConst32AndConst64Pass(R);
4444 }
45 const char *getPassName() const override {
45 StringRef getPassName() const override {
4646 return "Hexagon Split Const32s and Const64s";
4747 }
4848 bool runOnMachineFunction(MachineFunction &Fn) override;
4646 TII(nullptr) {
4747 initializeHexagonSplitDoubleRegsPass(*PassRegistry::getPassRegistry());
4848 }
49 const char *getPassName() const override {
49 StringRef getPassName() const override {
5050 return "Hexagon Split Double Registers";
5151 }
5252 void getAnalysisUsage(AnalysisUsage &AU) const override {
6464
6565 bool runOnMachineFunction(MachineFunction &MF) override;
6666
67 const char *getPassName() const override {
68 return "Hexagon Store Widening";
69 }
67 StringRef getPassName() const override { return "Hexagon Store Widening"; }
7068
7169 void getAnalysisUsage(AnalysisUsage &AU) const override {
7270 AU.addRequired();
7373 AU.addPreserved();
7474 MachineFunctionPass::getAnalysisUsage(AU);
7575 }
76 const char *getPassName() const override {
77 return "Hexagon Packetizer";
78 }
76 StringRef getPassName() const override { return "Hexagon Packetizer"; }
7977 bool runOnMachineFunction(MachineFunction &Fn) override;
8078 MachineFunctionProperties getRequiredProperties() const override {
8179 return MachineFunctionProperties().set(
4343 initializeHexagonVectorPrintPass(*PassRegistry::getPassRegistry());
4444 }
4545
46 const char *getPassName() const override {
46 StringRef getPassName() const override {
4747 return "Hexagon VectorPrint pass";
4848 }
4949 bool runOnMachineFunction(MachineFunction &Fn) override;
4444 std::unique_ptr Streamer)
4545 : AsmPrinter(TM, std::move(Streamer)) {}
4646
47 const char *getPassName() const override { return "Lanai Assembly Printer"; }
47 StringRef getPassName() const override { return "Lanai Assembly Printer"; }
4848
4949 void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &O);
5050 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
4141 static char ID;
4242 explicit Filler() : MachineFunctionPass(ID) {}
4343
44 const char *getPassName() const override { return "Lanai Delay Slot Filler"; }
44 StringRef getPassName() const override { return "Lanai Delay Slot Filler"; }
4545
4646 bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
4747
5555 }
5656
5757 // Pass Name
58 const char *getPassName() const override {
58 StringRef getPassName() const override {
5959 return "Lanai DAG->DAG Pattern Instruction Selection";
6060 }
6161
6060 initializeLanaiMemAluCombinerPass(*PassRegistry::getPassRegistry());
6161 }
6262
63 const char *getPassName() const override {
63 StringRef getPassName() const override {
6464 return "Lanai load / store optimization pass";
6565 }
6666
4141 MSP430AsmPrinter(TargetMachine &TM, std::unique_ptr Streamer)
4242 : AsmPrinter(TM, std::move(Streamer)) {}
4343
44 const char *getPassName() const override {
45 return "MSP430 Assembly Printer";
46 }
44 StringRef getPassName() const override { return "MSP430 Assembly Printer"; }
4745
4846 void printOperand(const MachineInstr *MI, int OpNum,
4947 raw_ostream &O, const char* Modifier = nullptr);
4343 MachineFunctionProperties::Property::NoVRegs);
4444 }
4545
46 const char *getPassName() const override {
47 return "MSP430 Branch Selector";
48 }
46 StringRef getPassName() const override { return "MSP430 Branch Selector"; }
4947 };
5048 char MSP430BSel::ID = 0;
5149 }
9494 MSP430DAGToDAGISel(MSP430TargetMachine &TM, CodeGenOpt::Level OptLevel)
9595 : SelectionDAGISel(TM, OptLevel) {}
9696
97 const char *getPassName() const override {
97 StringRef getPassName() const override {
9898 return "MSP430 DAG->DAG Pattern Instruction Selection";
9999 }
100100
2929
3030 Mips16HardFloat(MipsTargetMachine &TM_) : ModulePass(ID), TM(TM_) {}
3131
32 const char *getPassName() const override {
33 return "MIPS16 Hard Float Pass";
34 }
32 StringRef getPassName() const override { return "MIPS16 Hard Float Pass"; }
3533
3634 bool runOnModule(Module &M) override;
3735
102102 : AsmPrinter(TM, std::move(Streamer)), MCP(nullptr),
103103 InConstantPool(false), MCInstLowering(*this) {}
104104
105 const char *getPassName() const override {
106 return "Mips Assembly Printer";
107 }
105 StringRef getPassName() const override { return "Mips Assembly Printer"; }
108106
109107 bool runOnMachineFunction(MachineFunction &MF) override;
110108
355355 : MachineFunctionPass(ID), STI(nullptr), MF(nullptr), MCP(nullptr),
356356 PrescannedForConstants(false) {}
357357
358 const char *getPassName() const override {
359 return "Mips Constant Islands";
360 }
358 StringRef getPassName() const override { return "Mips Constant Islands"; }
361359
362360 bool runOnMachineFunction(MachineFunction &F) override;
363361
191191 Filler(TargetMachine &tm)
192192 : MachineFunctionPass(ID), TM(tm) { }
193193
194 const char *getPassName() const override {
195 return "Mips Delay Slot Filler";
196 }
194 StringRef getPassName() const override { return "Mips Delay Slot Filler"; }
197195
198196 bool runOnMachineFunction(MachineFunction &F) override {
199197 bool Changed = false;
6969 public:
7070 MipsHazardSchedule() : MachineFunctionPass(ID) {}
7171
72 const char *getPassName() const override { return "Mips Hazard Schedule"; }
72 StringRef getPassName() const override { return "Mips Hazard Schedule"; }
7373
7474 bool runOnMachineFunction(MachineFunction &F) override;
7575
3434 : SelectionDAGISel(TM, OL), Subtarget(nullptr) {}
3535
3636 // Pass Name
37 const char *getPassName() const override {
37 StringRef getPassName() const override {
3838 return "MIPS DAG->DAG Pattern Instruction Selection";
3939 }
4040
6565 : MachineFunctionPass(ID), TM(tm), IsPIC(TM.isPositionIndependent()),
6666 ABI(static_cast(TM).getABI()) {}
6767
68 const char *getPassName() const override {
69 return "Mips Long Branch";
70 }
68 StringRef getPassName() const override { return "Mips Long Branch"; }
7169
7270 bool runOnMachineFunction(MachineFunction &F) override;
7371
2525 : MachineFunctionPass(ID), TM(TM_) {}
2626
2727 // Pass Name
28 const char *getPassName() const override {
28 StringRef getPassName() const override {
2929 return "MIPS DAG->DAG Pattern Instruction Selection";
3030 }
3131
6060 public:
6161 OptimizePICCall(TargetMachine &tm) : MachineFunctionPass(ID) {}
6262
63 const char *getPassName() const override { return "Mips OptimizePICCall"; }
63 StringRef getPassName() const override { return "Mips OptimizePICCall"; }
6464
6565 bool runOnMachineFunction(MachineFunction &F) override;
6666
3434
3535 MipsOs16() : ModulePass(ID) {}
3636
37 const char *getPassName() const override {
38 return "MIPS Os16 Optimization";
39 }
37 StringRef getPassName() const override { return "MIPS Os16 Optimization"; }
4038
4139 bool runOnModule(Module &M) override;
4240 };
2929 AU.addPreserved();
3030 }
3131
32 const char *getPassName() const override {
32 StringRef getPassName() const override {
3333 return "NVPTX specific alloca hoisting";
3434 }
3535
194194 void emitSrcInText(StringRef filename, unsigned line);
195195
196196 private:
197 const char *getPassName() const override { return "NVPTX Assembly Printer"; }
197 StringRef getPassName() const override { return "NVPTX Assembly Printer"; }
198198
199199 const Function *F;
200200 std::string CurrentFnName;
3939 CodeGenOpt::Level OptLevel);
4040
4141 // Pass Name
42 const char *getPassName() const override {
42 StringRef getPassName() const override {
4343 return "NVPTX DAG->DAG Pattern Instruction Selection";
4444 }
4545 bool runOnMachineFunction(MachineFunction &MF) override;
4646
4747 static const unsigned MaxAggrCopySize = 128;
4848
49 const char *getPassName() const override {
49 StringRef getPassName() const override {
5050 return "Lower aggregate copies/intrinsics into loops";
5151 }
5252 };
4646 public:
4747 static char ID; // Pass identification, replacement for typeid
4848 NVPTXLowerAlloca() : BasicBlockPass(ID) {}
49 const char *getPassName() const override {
49 StringRef getPassName() const override {
5050 return "convert address space of alloca'ed memory to local";
5151 }
5252 };
123123 static char ID; // Pass identification, replacement for typeid
124124 NVPTXLowerArgs(const NVPTXTargetMachine *TM = nullptr)
125125 : FunctionPass(ID), TM(TM) {}
126 const char *getPassName() const override {
126 StringRef getPassName() const override {
127127 return "Lower pointer arguments of CUDA kernels";
128128 }
129129
5656
5757 bool runOnMachineFunction(MachineFunction &MF) override;
5858
59 const char *getPassName() const override {
59 StringRef getPassName() const override {
6060 return "NVPTX optimize redundant cvta.to.local instruction";
6161 }
6262
3535
3636 bool runOnMachineFunction(MachineFunction &MF) override;
3737
38 const char *getPassName() const override {
38 StringRef getPassName() const override {
3939 return "NVPTX Replace Image Handles";
4040 }
4141 private:
7373 std::unique_ptr Streamer)
7474 : AsmPrinter(TM, std::move(Streamer)), SM(*this) {}
7575
76 const char *getPassName() const override {
77 return "PowerPC Assembly Printer";
78 }
79
80 MCSymbol *lookUpOrCreateTOCEntry(MCSymbol *Sym);
81
82 virtual bool doInitialization(Module &M) override {
83 if (!TOC.empty())
84 TOC.clear();
85 return AsmPrinter::doInitialization(M);
76 StringRef getPassName() const override { return "PowerPC Assembly Printer"; }
77
78 MCSymbol *lookUpOrCreateTOCEntry(MCSymbol *Sym);
79
80 virtual bool doInitialization(Module &M) override {
81 if (!TOC.empty())
82 TOC.clear();
83 return AsmPrinter::doInitialization(M);
8684 }
8785
8886 void EmitInstruction(const MachineInstr *MI) override;
114112 std::unique_ptr Streamer)
115113 : PPCAsmPrinter(TM, std::move(Streamer)) {}
116114
117 const char *getPassName() const override {
115 StringRef getPassName() const override {
118116 return "Linux PPC Assembly Printer";
119117 }
120118
135133 std::unique_ptr Streamer)
136134 : PPCAsmPrinter(TM, std::move(Streamer)) {}
137135
138 const char *getPassName() const override {
136 StringRef getPassName() const override {
139137 return "Darwin PPC Assembly Printer";
140138 }
141139
5252 MachineFunctionProperties::Property::NoVRegs);
5353 }
5454
55 const char *getPassName() const override {
56 return "PowerPC Branch Selector";
57 }
55 StringRef getPassName() const override { return "PowerPC Branch Selector"; }
5856 };
5957 char PPCBSel::ID = 0;
6058 }
214214
215215 void InsertVRSaveCode(MachineFunction &MF);
216216
217 const char *getPassName() const override {
217 StringRef getPassName() const override {
218218 return "PowerPC DAG->DAG Pattern Instruction Selection";
219219 }
220220
4343
4444 bool runOnMachineFunction(MachineFunction &Fn) override;
4545
46 const char *getPassName() const override {
46 StringRef getPassName() const override {
4747 return "PowerPC QPX Load Splat Simplification";
4848 }
4949 };
4242 static char ID;
4343 Filler() : MachineFunctionPass(ID) {}
4444
45 const char *getPassName() const override {
46 return "SPARC Delay Slot Filler";
47 }
45 StringRef getPassName() const override { return "SPARC Delay Slot Filler"; }
4846
4947 bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
5048 bool runOnMachineFunction(MachineFunction &F) override {
5050 InsertNOPLoad(TargetMachine &tm);
5151 bool runOnMachineFunction(MachineFunction &MF) override;
5252
53 const char *getPassName() const override {
53 StringRef getPassName() const override {
5454 return "InsertNOPLoad: Erratum Fix LBR35: insert a NOP instruction after "
5555 "every single-cycle load instruction when the next instruction is "
5656 "another load/store instruction";
6464 FixFSMULD(TargetMachine &tm);
6565 bool runOnMachineFunction(MachineFunction &MF) override;
6666
67 const char *getPassName() const override {
67 StringRef getPassName() const override {
6868 return "FixFSMULD: Erratum Fix LBR31: do not select FSMULD";
6969 }
7070 };
7676 ReplaceFMULS(TargetMachine &tm);
7777 bool runOnMachineFunction(MachineFunction &MF) override;
7878
79 const char *getPassName() const override {
79 StringRef getPassName() const override {
8080 return "ReplaceFMULS: Erratum Fix LBR32: replace FMULS instruction with a "
8181 "routine using conversions/double precision operations to replace "
8282 "FMULS";
9090 FixAllFDIVSQRT(TargetMachine &tm);
9191 bool runOnMachineFunction(MachineFunction &MF) override;
9292
93 const char *getPassName() const override {
93 StringRef getPassName() const override {
9494 return "FixAllFDIVSQRT: Erratum Fix LBR34: fix FDIVS/FDIVD/FSQRTS/FSQRTD "
9595 "instructions with NOPs and floating-point store";
9696 }
4545 std::unique_ptr Streamer)
4646 : AsmPrinter(TM, std::move(Streamer)) {}
4747
48 const char *getPassName() const override {
49 return "Sparc Assembly Printer";
50 }
48 StringRef getPassName() const override { return "Sparc Assembly Printer"; }
5149
5250 void printOperand(const MachineInstr *MI, int opNum, raw_ostream &OS);
5351 void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &OS,
5252 unsigned ConstraintID,
5353 std::vector &OutOps) override;
5454
55 const char *getPassName() const override {
55 StringRef getPassName() const override {
5656 return "SPARC DAG->DAG Pattern Instruction Selection";
5757 }
5858
2626 : AsmPrinter(TM, std::move(Streamer)) {}
2727
2828 // Override AsmPrinter.
29 const char *getPassName() const override {
30 return "SystemZ Assembly Printer";
31 }
29 StringRef getPassName() const override { return "SystemZ Assembly Printer"; }
3230 void EmitInstruction(const MachineInstr *MI) override;
3331 void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
3432 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
5757 SystemZElimCompare(const SystemZTargetMachine &tm)
5858 : MachineFunctionPass(ID), TII(nullptr), TRI(nullptr) {}
5959
60 const char *getPassName() const override {
60 StringRef getPassName() const override {
6161 return "SystemZ Comparison Elimination";
6262 }
6363
338338 }
339339
340340 // Override MachineFunctionPass.
341 const char *getPassName() const override {
341 StringRef getPassName() const override {
342342 return "SystemZ DAG->DAG Pattern Instruction Selection";
343343 }
344344
3232 SystemZLDCleanup(const SystemZTargetMachine &tm)
3333 : MachineFunctionPass(ID), TII(nullptr), MF(nullptr) {}
3434
35 const char *getPassName() const override {
35 StringRef getPassName() const override {
3636 return "SystemZ Local Dynamic TLS Access Clean-up";
3737 }
3838
132132 SystemZLongBranch(const SystemZTargetMachine &tm)
133133 : MachineFunctionPass(ID), TII(nullptr) {}
134134
135 const char *getPassName() const override {
136 return "SystemZ Long Branch";
137 }
135 StringRef getPassName() const override { return "SystemZ Long Branch"; }
138136
139137 bool runOnMachineFunction(MachineFunction &F) override;
140138 MachineFunctionProperties getRequiredProperties() const override {
2828 static char ID;
2929 SystemZShortenInst(const SystemZTargetMachine &tm);
3030
31 const char *getPassName() const override {
31 StringRef getPassName() const override {
3232 return "SystemZ Instruction Shortening";
3333 }
3434
4444 static char ID; // Pass identification, replacement for typeid
4545 WebAssemblyArgumentMove() : MachineFunctionPass(ID) {}
4646
47 const char *getPassName() const override {
48 return "WebAssembly Argument Move";
49 }
47 StringRef getPassName() const override { return "WebAssembly Argument Move"; }
5048
5149 void getAnalysisUsage(AnalysisUsage &AU) const override {
5250 AU.setPreservesCFG();
4848 : AsmPrinter(TM, std::move(Streamer)), MRI(nullptr), MFI(nullptr) {}
4949
5050 private:
51 const char *getPassName() const override {
51 StringRef getPassName() const override {
5252 return "WebAssembly Assembly Printer";
5353 }
5454
4242
4343 namespace {
4444 class WebAssemblyCFGStackify final : public MachineFunctionPass {
45 const char *getPassName() const override {
46 return "WebAssembly CFG Stackify";
47 }
45 StringRef getPassName() const override { return "WebAssembly CFG Stackify"; }
4846
4947 void getAnalysisUsage(AnalysisUsage &AU) const override {
5048 AU.setPreservesCFG();
4646
4747 namespace {
4848 class WebAssemblyFixIrreducibleControlFlow final : public MachineFunctionPass {
49 const char *getPassName() const override {
49 StringRef getPassName() const override {
5050 return "WebAssembly Fix Irreducible Control Flow";
5151 }
5252
4141 : SelectionDAGISel(tm, OptLevel), Subtarget(nullptr), ForCodeSize(false) {
4242 }
4343
44 const char *getPassName() const override {
44 StringRef getPassName() const override {
4545 return "WebAssembly Instruction Selection";
4646 }
4747
2828
2929 namespace {
3030 class WebAssemblyLowerBrUnless final : public MachineFunctionPass {
31 const char *getPassName() const override {
31 StringRef getPassName() const override {
3232 return "WebAssembly Lower br_unless";
3333 }
3434
259259 // Set of whitelisted function names for exception handling
260260 std::set EHWhitelistSet;
261261
262 const char *getPassName() const override {
262 StringRef getPassName() const override {
263263 return "WebAssembly Lower Emscripten Exceptions";
264264 }
265265
3333
3434 namespace {
3535 class WebAssemblyOptimizeLiveIntervals final : public MachineFunctionPass {
36 const char *getPassName() const override {
36 StringRef getPassName() const override {
3737 return "WebAssembly Optimize Live Intervals";
3838 }
3939
2323 namespace {
2424 class OptimizeReturned final : public FunctionPass,
2525 public InstVisitor {
26 const char *getPassName() const override {
26 StringRef getPassName() const override {
2727 return "WebAssembly Optimize Returned";
2828 }
2929
3030
3131 namespace {
3232 class WebAssemblyPeephole final : public MachineFunctionPass {
33 const char *getPassName() const override {
33 StringRef getPassName() const override {
3434 return "WebAssembly late peephole optimizer";
3535 }
3636
3939 WebAssemblyPrepareForLiveIntervals() : MachineFunctionPass(ID) {}
4040
4141 private:
42 const char *getPassName() const override {
42 StringRef getPassName() const override {
4343 return "WebAssembly Prepare For LiveIntervals";
4444 }
4545
3434 static char ID; // Pass identification, replacement for typeid
3535 WebAssemblyRegColoring() : MachineFunctionPass(ID) {}
3636
37 const char *getPassName() const override {
37 StringRef getPassName() const override {
3838 return "WebAssembly Register Coloring";
3939 }
4040
3131
3232 namespace {
3333 class WebAssemblyRegNumbering final : public MachineFunctionPass {
34 const char *getPassName() const override {
34 StringRef getPassName() const override {
3535 return "WebAssembly Register Numbering";
3636 }
3737
3838
3939 namespace {
4040 class WebAssemblyRegStackify final : public MachineFunctionPass {
41 const char *getPassName() const override {
41 StringRef getPassName() const override {
4242 return "WebAssembly Register Stackify";
4343 }
4444
3838 WebAssemblyReplacePhysRegs() : MachineFunctionPass(ID) {}
3939
4040 private:
41 const char *getPassName() const override {
41 StringRef getPassName() const override {
4242 return "WebAssembly Replace Physical Registers";
4343 }
4444
2929 static char ID; // Pass identification, replacement for typeid
3030 WebAssemblySetP2AlignOperands() : MachineFunctionPass(ID) {}
3131
32 const char *getPassName() const override {
32 StringRef getPassName() const override {
3333 return "WebAssembly Set p2align Operands";
3434 }
3535
4545 static char ID; // Pass identification, replacement for typeid
4646 WebAssemblyStoreResults() : MachineFunctionPass(ID) {}
4747
48 const char *getPassName() const override {
49 return "WebAssembly Store Results";
50 }
48 StringRef getPassName() const override { return "WebAssembly Store Results"; }
5149
5250 void getAnalysisUsage(AnalysisUsage &AU) const override {
5351 AU.setPreservesCFG();
100100 std::unique_ptr Streamer)
101101 : AsmPrinter(TM, std::move(Streamer)), SM(*this), FM(*this) {}
102102
103 const char *getPassName() const override {
103 StringRef getPassName() const override {
104104 return "X86 Assembly / Object Emitter";
105105 }
106106
9999 const X86RegisterInfo &RegInfo,
100100 DenseSet &UsedRegs);
101101
102 const char *getPassName() const override { return "X86 Optimize Call Frame"; }
102 StringRef getPassName() const override { return "X86 Optimize Call Frame"; }
103103
104104 const TargetInstrInfo *TII;
105105 const X86FrameLowering *TFL;
5353 MachineFunctionProperties::Property::NoVRegs);
5454 }
5555
56 const char *getPassName() const override {
56 StringRef getPassName() const override {
5757 return "X86 pseudo instruction expansion pass";
5858 }
5959
101101 public:
102102 static char ID;
103103
104 const char *getPassName() const override {
105 return FIXUPBW_DESC;
106 }
104 StringRef getPassName() const override { return FIXUPBW_DESC; }
107105
108106 FixupBWInstPass() : MachineFunctionPass(ID) {
109107 initializeFixupBWInstPassPass(*PassRegistry::getPassRegistry());
3939 /// where appropriate.
4040 bool processBasicBlock(MachineFunction &MF, MachineFunction::iterator MFI);
4141
42 const char *getPassName() const override { return "X86 LEA Fixup"; }
42 StringRef getPassName() const override { return "X86 LEA Fixup"; }
4343
4444 /// \brief Given a machine register, look for the instruction
4545 /// which writes it in the current basic block. If found,
3838 public:
3939 X86FixupSetCCPass() : MachineFunctionPass(ID) {}
4040
41 const char *getPassName() const override { return "X86 Fixup SetCC"; }
41 StringRef getPassName() const override { return "X86 Fixup SetCC"; }
4242
4343 bool runOnMachineFunction(MachineFunction &MF) override;
4444
8080 MachineFunctionProperties::Property::NoVRegs);
8181 }
8282
83 const char *getPassName() const override { return "X86 FP Stackifier"; }
83 StringRef getPassName() const override { return "X86 FP Stackifier"; }
8484
8585 private:
8686 const TargetInstrInfo *TII; // Machine instruction info.
164164 : SelectionDAGISel(tm, OptLevel), OptForSize(false),
165165 OptForMinSize(false) {}
166166
167 const char *getPassName() const override {
167 StringRef getPassName() const override {
168168 return "X86 DAG->DAG Instruction Selection";
169169 }
170170
87128712 return true;
87138713 }
87148714
8715 const char *getPassName() const override {
8715 StringRef getPassName() const override {
87168716 return "X86 PIC Global Base Reg Initialization";
87178717 }
87188718
88268826 return Copy;
88278827 }
88288828
8829 const char *getPassName() const override {
8829 StringRef getPassName() const override {
88308830 return "Local Dynamic TLS Access Clean-up";
88318831 }
88328832
218218 public:
219219 OptimizeLEAPass() : MachineFunctionPass(ID) {}
220220
221 const char *getPassName() const override { return "X86 LEA Optimize"; }
221 StringRef getPassName() const override { return "X86 LEA Optimize"; }
222222
223223 /// \brief Loop over all of the basic blocks, replacing address
224224 /// calculations in load and store instructions, if it's already
5959 MachineFunctionProperties::Property::NoVRegs);
6060 }
6161
62 const char *getPassName() const override {
62 StringRef getPassName() const override {
6363 return "X86 Atom pad short functions";
6464 }
6565
4141 return MachineFunctionProperties().set(
4242 MachineFunctionProperties::Property::NoVRegs);
4343 }
44 const char *getPassName() const override {return "X86 vzeroupper inserter";}
44 StringRef getPassName() const override { return "X86 vzeroupper inserter"; }
4545
4646 private:
4747
6262 unsigned SlotSize;
6363 int64_t StackProbeSize;
6464
65 const char *getPassName() const override { return "X86 WinAlloca Expander"; }
65 StringRef getPassName() const override { return "X86 WinAlloca Expander"; }
6666 static char ID;
6767 };
6868
5656
5757 void getAnalysisUsage(AnalysisUsage &AU) const override;
5858
59 const char *getPassName() const override {
59 StringRef getPassName() const override {
6060 return "Windows 32-bit x86 EH state insertion";
6161 }
6262
5757 std::unique_ptr Streamer)
5858 : AsmPrinter(TM, std::move(Streamer)), MCInstLowering(*this) {}
5959
60 const char *getPassName() const override {
61 return "XCore Assembly Printer";
62 }
60 StringRef getPassName() const override { return "XCore Assembly Printer"; }
6361
6462 void printInlineJT(const MachineInstr *MI, int opNum, raw_ostream &O,
6563 const std::string &directive = ".jmptable");
3131 MachineFunctionProperties::Property::NoVRegs);
3232 }
3333
34 const char *getPassName() const override {
34 StringRef getPassName() const override {
3535 return "XCore FRAME_TO_ARGS_OFFSET Elimination";
3636 }
3737 };
6666 bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
6767 std::vector &OutOps) override;
6868
69 const char *getPassName() const override {
69 StringRef getPassName() const override {
7070 return "XCore DAG->DAG Pattern Instruction Selection";
7171 }
7272
813813 static char ID;
814814
815815 /// Specify pass name for debug output
816 const char *getPassName() const override { return "Function Importing"; }
816 StringRef getPassName() const override { return "Function Importing"; }
817817
818818 explicit FunctionImportLegacyPass(const ModuleSummaryIndex *Index = nullptr)
819819 : ModulePass(ID), Index(Index) {}
203203 bool doInitialization(Module &M) override {
204204 return SampleLoader.doInitialization(M);
205205 }
206 const char *getPassName() const override { return "Sample profile pass"; }
206 StringRef getPassName() const override { return "Sample profile pass"; }
207207 bool runOnModule(Module &M) override;
208208
209209 void getAnalysisUsage(AnalysisUsage &AU) const override {
481481 LocalDynamicShadow(nullptr) {
482482 initializeAddressSanitizerPass(*PassRegistry::getPassRegistry());
483483 }
484 const char *getPassName() const override {
484 StringRef getPassName() const override {
485485 return "AddressSanitizerFunctionPass";
486486 }
487487 void getAnalysisUsage(AnalysisUsage &AU) const override {
592592 Recover(Recover || ClRecover) {}
593593 bool runOnModule(Module &M) override;
594594 static char ID; // Pass identification, replacement for typeid
595 const char *getPassName() const override { return "AddressSanitizerModule"; }
596
597 private:
595 StringRef getPassName() const override { return "AddressSanitizerModule"; }
596
597 private:
598598 void initializeCallbacks(Module &M);
599599
600600 bool InstrumentGlobals(IRBuilder<> &IRB, Module &M);
153153 EfficiencySanitizer(
154154 const EfficiencySanitizerOptions &Opts = EfficiencySanitizerOptions())
155155 : ModulePass(ID), Options(OverrideOptionsFromCL(Opts)) {}
156 const char *getPassName() const override;
156 StringRef getPassName() const override;
157157 void getAnalysisUsage(AnalysisUsage &AU) const override;
158158 bool runOnModule(Module &M) override;
159159 static char ID;
230230 EfficiencySanitizer, "esan",
231231 "EfficiencySanitizer: finds performance issues.", false, false)
232232
233 const char *EfficiencySanitizer::getPassName() const {
233 StringRef EfficiencySanitizer::getPassName() const {
234234 return "EfficiencySanitizer";
235235 }
236236
141141 : ModulePass(ID), Profiler(Opts) {
142142 initializeGCOVProfilerLegacyPassPass(*PassRegistry::getPassRegistry());
143143 }
144 const char *getPassName() const override { return "GCOV Profiler"; }
144 StringRef getPassName() const override { return "GCOV Profiler"; }
145145
146146 bool runOnModule(Module &M) override { return Profiler.runOnModule(M); }
147147
110110 *PassRegistry::getPassRegistry());
111111 }
112112
113 const char *getPassName() const override {
114 return "PGOIndirectCallPromotion";
115 }
113 StringRef getPassName() const override { return "PGOIndirectCallPromotion"; }
116114
117115 private:
118116 bool runOnModule(Module &M) override;
5252 InstrProfilingLegacyPass() : ModulePass(ID), InstrProf() {}
5353 InstrProfilingLegacyPass(const InstrProfOptions &Options)
5454 : ModulePass(ID), InstrProf(Options) {}
55 const char *getPassName() const override {
55 StringRef getPassName() const override {
5656 return "Frontend instrumentation-based coverage lowering";
5757 }
5858
315315 : FunctionPass(ID),
316316 TrackOrigins(std::max(TrackOrigins, (int)ClTrackOrigins)),
317317 WarningFn(nullptr) {}
318 const char *getPassName() const override { return "MemorySanitizer"; }
318 StringRef getPassName() const override { return "MemorySanitizer"; }
319319 void getAnalysisUsage(AnalysisUsage &AU) const override {
320320 AU.addRequired();
321321 }
201201 *PassRegistry::getPassRegistry());
202202 }
203203
204 const char *getPassName() const override {
205 return "PGOInstrumentationGenPass";
206 }
204 StringRef getPassName() const override { return "PGOInstrumentationGenPass"; }
207205
208206 private:
209207 bool runOnModule(Module &M) override;
226224 *PassRegistry::getPassRegistry());
227225 }
228226
229 const char *getPassName() const override {
230 return "PGOInstrumentationUsePass";
231 }
227 StringRef getPassName() const override { return "PGOInstrumentationUsePass"; }
232228
233229 private:
234230 std::string ProfileFileName;
188188 bool runOnModule(Module &M) override;
189189 bool runOnFunction(Function &F);
190190 static char ID; // Pass identification, replacement for typeid
191 const char *getPassName() const override { return "SanitizerCoverageModule"; }
191 StringRef getPassName() const override { return "SanitizerCoverageModule"; }
192192
193193 void getAnalysisUsage(AnalysisUsage &AU) const override {
194194 AU.addRequired();
8282 /// ThreadSanitizer: instrument the code in module to find races.
8383 struct ThreadSanitizer : public FunctionPass {
8484 ThreadSanitizer() : FunctionPass(ID) {}
85 const char *getPassName() const override;
85 StringRef getPassName() const override;
8686 void getAnalysisUsage(AnalysisUsage &AU) const override;
8787 bool runOnFunction(Function &F) override;
8888 bool doInitialization(Module &M) override;
134134 "ThreadSanitizer: detects data races.",
135135 false, false)
136136
137 const char *ThreadSanitizer::getPassName() const {
138 return "ThreadSanitizer";
139 }
137 StringRef ThreadSanitizer::getPassName() const { return "ThreadSanitizer"; }
140138
141139 void ThreadSanitizer::getAnalysisUsage(AnalysisUsage &AU) const {
142140 AU.addRequired();
6363
6464 bool runOnFunction(Function &Fn) override;
6565
66 const char *getPassName() const override { return "Constant Hoisting"; }
66 StringRef getPassName() const override { return "Constant Hoisting"; }
6767
6868 void getAnalysisUsage(AnalysisUsage &AU) const override {
6969 AU.setPreservesCFG();
6767 AU.addPreserved();
6868 }
6969
70 const char *getPassName() const override { return LDCOMBINE_NAME; }
70 StringRef getPassName() const override { return LDCOMBINE_NAME; }
7171 static char ID;
7272
7373 typedef IRBuilder BuilderTy;
199199 bool isLoopAlreadyVisited();
200200 void setNoAliasToLoop(Loop *);
201201 bool instructionSafeForVersioning(Instruction *);
202 const char *getPassName() const override { return "Loop Versioning"; }
202 StringRef getPassName() const override { return "Loop Versioning"; }
203203 };
204204 }
205205
42734273 AU.setPreservesCFG();
42744274 }
42754275
4276 const char *getPassName() const override { return "SROA"; }
4276 StringRef getPassName() const override { return "SROA"; }
42774277 static char ID;
42784278 };
42794279
111111 void getAnalysisUsage(AnalysisUsage &AU) const override;
112112 bool runOnFunction(Function &F) override;
113113
114 const char *getPassName() const override {
114 StringRef getPassName() const override {
115115 if (OnlyIfDivergentTarget)
116116 return "Speculatively execute instructions if target has divergent "
117117 "branches";
255255
256256 bool runOnRegion(Region *R, RGPassManager &RGM) override;
257257
258 const char *getPassName() const override {
259 return "Structurize control flow";
260 }
258 StringRef getPassName() const override { return "Structurize control flow"; }
261259
262260 void getAnalysisUsage(AnalysisUsage &AU) const override {
263261 if (SkipUniformRegions)
9090 static char ID;
9191
9292 /// Specify pass name for debug output
93 const char *getPassName() const override { return "Name Anon Globals"; }
93 StringRef getPassName() const override { return "Name Anon Globals"; }
9494
9595 explicit NameAnonGlobalLegacyPass() : ModulePass(ID) {}
9696
147147
148148 bool runOnFunction(Function &F) override;
149149
150 const char *getPassName() const override {
150 StringRef getPassName() const override {
151151 return "GPU Load and Store Vectorizer";
152152 }
153153
4545 return false;
4646 }
4747
48 const char *getPassName() const override { return PassName.c_str(); }
48 StringRef getPassName() const override { return PassName.c_str(); }
4949
5050 void getAnalysisUsage(AnalysisUsage &AU) const override {
5151 AU.addRequiredID(PassToPrint->getTypeInfo());
8282 return false;
8383 }
8484
85 const char *getPassName() const override { return PassName.c_str(); }
85 StringRef getPassName() const override { return PassName.c_str(); }
8686
8787 void getAnalysisUsage(AnalysisUsage &AU) const override {
8888 AU.addRequiredID(PassToPrint->getTypeInfo());
114114 return false;
115115 }
116116
117 const char *getPassName() const override { return PassName.c_str(); }
117 StringRef getPassName() const override { return PassName.c_str(); }
118118
119119 void getAnalysisUsage(AnalysisUsage &AU) const override {
120120 AU.addRequiredID(PassToPrint->getTypeInfo());
147147 return false;
148148 }
149149
150 const char *getPassName() const override { return PassName.c_str(); }
150 StringRef getPassName() const override { return PassName.c_str(); }
151151
152152 void getAnalysisUsage(AnalysisUsage &AU) const override {
153153 AU.addRequiredID(PassToPrint->getTypeInfo());
182182 return false;
183183 }
184184
185 const char *getPassName() const override { return PassName.c_str(); }
185 StringRef getPassName() const override { return PassName.c_str(); }
186186
187187 void getAnalysisUsage(AnalysisUsage &AU) const override {
188188 AU.addRequiredID(PassToPrint->getTypeInfo());
216216 return false;
217217 }
218218
219 const char *getPassName() const override { return PassName.c_str(); }
219 StringRef getPassName() const override { return PassName.c_str(); }
220220
221221 void getAnalysisUsage(AnalysisUsage &AU) const override {
222222 AU.addRequiredID(PassToPrint->getTypeInfo());