llvm.org GIT mirror llvm / 7372d44
[PM] Give slightly less horrible names to the utility pass templates for requiring and invalidating specific analyses. Also make their printed names match their class names. Writing these out as prose really doesn't make sense to me any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225346 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 4 years ago
3 changed file(s) with 33 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
780780 ///
781781 /// This is a no-op pass which simply forces a specific analysis pass's result
782782 /// to be available when it is run.
783 template struct NoopAnalysisRequirementPass {
783 template struct RequireAnalysisPass {
784784 /// \brief Run this pass over some unit of IR.
785785 ///
786786 /// This pass can be run over any unit of IR and use any analysis manager
795795 return PreservedAnalyses::all();
796796 }
797797
798 static StringRef name() { return "No-op Analysis Requirement Pass"; }
798 static StringRef name() { return "RequireAnalysisPass"; }
799799 };
800800
801801 /// \brief A template utility pass to force an analysis result to be
803803 ///
804804 /// This is a no-op pass which simply forces a specific analysis result to be
805805 /// invalidated when it is run.
806 template struct NoopAnalysisInvalidationPass {
806 template struct InvalidateAnalysisPass {
807807 /// \brief Run this pass over some unit of IR.
808808 ///
809809 /// This pass can be run over any unit of IR and use any analysis manager
820820 return PreservedAnalyses::all();
821821 }
822822
823 static StringRef name() { return "No-op Analysis Invalidation Pass"; }
823 static StringRef name() { return "InvalidateAnalysisPass"; }
824824 };
825825
826826 /// \brief A utility pass that does nothing but preserves no analyses.
125125 ; RUN: -passes='require,cgscc(require,function(require))' %s 2>&1 \
126126 ; RUN: | FileCheck %s --check-prefix=CHECK-ANALYSES
127127 ; CHECK-ANALYSES: Starting module pass manager
128 ; CHECK-ANALYSES: Running module pass: No-op Analysis Requirement Pass
128 ; CHECK-ANALYSES: Running module pass: RequireAnalysisPass
129129 ; CHECK-ANALYSES: Running module analysis: NoOpModuleAnalysis
130130 ; CHECK-ANALYSES: Starting CGSCC pass manager
131 ; CHECK-ANALYSES: Running CGSCC pass: No-op Analysis Requirement Pass
131 ; CHECK-ANALYSES: Running CGSCC pass: RequireAnalysisPass
132132 ; CHECK-ANALYSES: Running CGSCC analysis: NoOpCGSCCAnalysis
133133 ; CHECK-ANALYSES: Starting function pass manager
134 ; CHECK-ANALYSES: Running function pass: No-op Analysis Requirement Pass
134 ; CHECK-ANALYSES: Running function pass: RequireAnalysisPass
135135 ; CHECK-ANALYSES: Running function analysis: NoOpFunctionAnalysis
136136
137137 ; Make sure no-op passes that preserve all analyses don't even try to do any
146146 ; RUN: -passes='require,require,require' %s 2>&1 \
147147 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS
148148 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Starting module pass manager
149 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running module pass: No-op Analysis Requirement Pass
149 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running module pass: RequireAnalysisPass
150150 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running module analysis: NoOpModuleAnalysis
151151 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS-NOT: Running module analysis: NoOpModuleAnalysis
152152
154154 ; RUN: -passes='require,invalidate,require' %s 2>&1 \
155155 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS
156156 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Starting module pass manager
157 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module pass: No-op Analysis Requirement Pass
157 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module pass: RequireAnalysisPass
158158 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module analysis: NoOpModuleAnalysis
159159 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Invalidating module analysis: NoOpModuleAnalysis
160160 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module analysis: NoOpModuleAnalysis
163163 ; RUN: -passes='cgscc(require,require,require)' %s 2>&1 \
164164 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS
165165 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Starting CGSCC pass manager
166 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: No-op Analysis Requirement Pass
166 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: RequireAnalysisPass
167167 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running CGSCC analysis: NoOpCGSCCAnalysis
168168 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS-NOT: Running CGSCC analysis: NoOpCGSCCAnalysis
169169
171171 ; RUN: -passes='cgscc(require,invalidate,require)' %s 2>&1 \
172172 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS
173173 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Starting CGSCC pass manager
174 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: No-op Analysis Requirement Pass
174 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: RequireAnalysisPass
175175 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC analysis: NoOpCGSCCAnalysis
176176 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Invalidating CGSCC analysis: NoOpCGSCCAnalysis
177177 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC analysis: NoOpCGSCCAnalysis
180180 ; RUN: -passes='function(require,require,require)' %s 2>&1 \
181181 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS
182182 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Starting function pass manager
183 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running function pass: No-op Analysis Requirement Pass
183 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running function pass: RequireAnalysisPass
184184 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running function analysis: NoOpFunctionAnalysis
185185 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS-NOT: Running function analysis: NoOpFunctionAnalysis
186186
188188 ; RUN: -passes='function(require,invalidate,require)' %s 2>&1 \
189189 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS
190190 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Starting function pass manager
191 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function pass: No-op Analysis Requirement Pass
191 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function pass: RequireAnalysisPass
192192 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function analysis: NoOpFunctionAnalysis
193193 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Invalidating function analysis: NoOpFunctionAnalysis
194194 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function analysis: NoOpFunctionAnalysis
197197 ; RUN: -passes='require,module(require,function(require,invalidate,require),require),require' %s 2>&1 \
198198 ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL
199199 ; CHECK-INVALIDATE-ALL: Starting module pass manager run.
200 ; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
200 ; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
201201 ; CHECK-INVALIDATE-ALL: Running module analysis: NoOpModuleAnalysis
202202 ; CHECK-INVALIDATE-ALL: Starting module pass manager run.
203 ; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
203 ; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
204204 ; CHECK-INVALIDATE-ALL-NOT: Running module analysis: NoOpModuleAnalysis
205205 ; CHECK-INVALIDATE-ALL: Starting function pass manager run.
206 ; CHECK-INVALIDATE-ALL: Running function pass: No-op Analysis Requirement Pass
206 ; CHECK-INVALIDATE-ALL: Running function pass: RequireAnalysisPass
207207 ; CHECK-INVALIDATE-ALL: Running function analysis: NoOpFunctionAnalysis
208208 ; CHECK-INVALIDATE-ALL: Running function pass: InvalidateAllAnalysesPass
209209 ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for function
210210 ; CHECK-INVALIDATE-ALL: Invalidating function analysis: NoOpFunctionAnalysis
211 ; CHECK-INVALIDATE-ALL: Running function pass: No-op Analysis Requirement Pass
211 ; CHECK-INVALIDATE-ALL: Running function pass: RequireAnalysisPass
212212 ; CHECK-INVALIDATE-ALL: Running function analysis: NoOpFunctionAnalysis
213213 ; CHECK-INVALIDATE-ALL: Finished function pass manager run.
214214 ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for function
215215 ; CHECK-INVALIDATE-ALL-NOT: Running function analysis: NoOpFunctionAnalysis
216216 ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for module
217217 ; CHECK-INVALIDATE-ALL: Invalidating module analysis: NoOpModuleAnalysis
218 ; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
218 ; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
219219 ; CHECK-INVALIDATE-ALL: Running module analysis: NoOpModuleAnalysis
220220 ; CHECK-INVALIDATE-ALL: Finished module pass manager run.
221221 ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for module
222222 ; CHECK-INVALIDATE-ALL-NOT: Invalidating module analysis: NoOpModuleAnalysis
223 ; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
223 ; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
224224 ; CHECK-INVALIDATE-ALL-NOT: Running module analysis: NoOpModuleAnalysis
225225 ; CHECK-INVALIDATE-ALL: Finished module pass manager run.
226226
228228 ; RUN: -passes='require,module(require,cgscc(require,function(require,invalidate,require),require),require),require' %s 2>&1 \
229229 ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL-CG
230230 ; CHECK-INVALIDATE-ALL-CG: Starting module pass manager run.
231 ; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
231 ; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
232232 ; CHECK-INVALIDATE-ALL-CG: Running module analysis: NoOpModuleAnalysis
233233 ; CHECK-INVALIDATE-ALL-CG: Starting module pass manager run.
234 ; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
234 ; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
235235 ; CHECK-INVALIDATE-ALL-CG-NOT: Running module analysis: NoOpModuleAnalysis
236236 ; CHECK-INVALIDATE-ALL-CG: Starting CGSCC pass manager run.
237 ; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: No-op Analysis Requirement Pass
237 ; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: RequireAnalysisPass
238238 ; CHECK-INVALIDATE-ALL-CG: Running CGSCC analysis: NoOpCGSCCAnalysis
239239 ; CHECK-INVALIDATE-ALL-CG: Starting function pass manager run.
240 ; CHECK-INVALIDATE-ALL-CG: Running function pass: No-op Analysis Requirement Pass
240 ; CHECK-INVALIDATE-ALL-CG: Running function pass: RequireAnalysisPass
241241 ; CHECK-INVALIDATE-ALL-CG: Running function analysis: NoOpFunctionAnalysis
242242 ; CHECK-INVALIDATE-ALL-CG: Running function pass: InvalidateAllAnalysesPass
243243 ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for function
244244 ; CHECK-INVALIDATE-ALL-CG: Invalidating function analysis: NoOpFunctionAnalysis
245 ; CHECK-INVALIDATE-ALL-CG: Running function pass: No-op Analysis Requirement Pass
245 ; CHECK-INVALIDATE-ALL-CG: Running function pass: RequireAnalysisPass
246246 ; CHECK-INVALIDATE-ALL-CG: Running function analysis: NoOpFunctionAnalysis
247247 ; CHECK-INVALIDATE-ALL-CG: Finished function pass manager run.
248248 ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for function
249249 ; CHECK-INVALIDATE-ALL-CG-NOT: Running function analysis: NoOpFunctionAnalysis
250250 ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for SCC
251251 ; CHECK-INVALIDATE-ALL-CG: Invalidating CGSCC analysis: NoOpCGSCCAnalysis
252 ; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: No-op Analysis Requirement Pass
252 ; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: RequireAnalysisPass
253253 ; CHECK-INVALIDATE-ALL-CG: Running CGSCC analysis: NoOpCGSCCAnalysis
254254 ; CHECK-INVALIDATE-ALL-CG: Finished CGSCC pass manager run.
255255 ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for SCC
256256 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating CGSCC analysis: NoOpCGSCCAnalysis
257257 ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for module
258258 ; CHECK-INVALIDATE-ALL-CG: Invalidating module analysis: NoOpModuleAnalysis
259 ; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
259 ; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
260260 ; CHECK-INVALIDATE-ALL-CG: Running module analysis: NoOpModuleAnalysis
261261 ; CHECK-INVALIDATE-ALL-CG: Finished module pass manager run.
262262 ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for module
263263 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating module analysis: NoOpModuleAnalysis
264 ; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
264 ; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
265265 ; CHECK-INVALIDATE-ALL-CG-NOT: Running module analysis: NoOpModuleAnalysis
266266 ; CHECK-INVALIDATE-ALL-CG: Finished module pass manager run.
267267
141141 }
142142 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \
143143 if (Name == "require<" NAME ">") { \
144 MPM.addPass(NoopAnalysisRequirementPass()); \
144 MPM.addPass(RequireAnalysisPass()); \
145145 return true; \
146146 } \
147147 if (Name == "invalidate<" NAME ">") { \
148 MPM.addPass(NoopAnalysisInvalidationPass()); \
148 MPM.addPass(InvalidateAnalysisPass()); \
149149 return true; \
150150 }
151151 #include "PassRegistry.def"
161161 }
162162 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
163163 if (Name == "require<" NAME ">") { \
164 CGPM.addPass(NoopAnalysisRequirementPass()); \
164 CGPM.addPass(RequireAnalysisPass()); \
165165 return true; \
166166 } \
167167 if (Name == "invalidate<" NAME ">") { \
168 CGPM.addPass(NoopAnalysisInvalidationPass()); \
168 CGPM.addPass(InvalidateAnalysisPass()); \
169169 return true; \
170170 }
171171 #include "PassRegistry.def"
181181 }
182182 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
183183 if (Name == "require<" NAME ">") { \
184 FPM.addPass(NoopAnalysisRequirementPass()); \
184 FPM.addPass(RequireAnalysisPass()); \
185185 return true; \
186186 } \
187187 if (Name == "invalidate<" NAME ">") { \
188 FPM.addPass(NoopAnalysisInvalidationPass()); \
188 FPM.addPass(InvalidateAnalysisPass()); \
189189 return true; \
190190 }
191191 #include "PassRegistry.def"