[PATCH] D85493: [NewPM] Print 'Skipping pass' as pass instrumentation
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 7 15:02:16 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7abef4167424: [NewPM] Print 'Skipping pass' as pass instrumentation (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85493/new/
https://reviews.llvm.org/D85493
Files:
llvm/include/llvm/Passes/StandardInstrumentations.h
llvm/lib/Passes/StandardInstrumentations.cpp
llvm/test/Feature/optnone-opt.ll
Index: llvm/test/Feature/optnone-opt.ll
===================================================================
--- llvm/test/Feature/optnone-opt.ll
+++ llvm/test/Feature/optnone-opt.ll
@@ -50,7 +50,7 @@
; O1-DAG: Skipping pass 'Reassociate expressions'
; O1-DAG: Skipping pass 'Simplify the CFG'
; O1-DAG: Skipping pass 'Sparse Conditional Constant Propagation'
-; NPM-O1-DAG: Skipping pass: SimplifyCFGPass
+; NPM-O1-DAG: Skipping pass: SimplifyCFGPass on {{.*}}foo
; NPM-O1-DAG: Skipping pass: SROA
; NPM-O1-DAG: Skipping pass: EarlyCSEPass
; NPM-O1-DAG: Skipping pass: LowerExpectIntrinsicPass
@@ -80,7 +80,9 @@
; LOOP-DAG: Skipping pass 'Simplify instructions in loops'
; LOOP-DAG: Skipping pass 'Unroll loops'
; LOOP-DAG: Skipping pass 'Unswitch loops'
-; NPM-LOOP-DAG: Skipping pass: LoopSimplifyPass
+; LoopPassManager should not be skipped over an optnone function
+; NPM-LOOP-NOT: Skipping pass: PassManager
+; NPM-LOOP-DAG: Skipping pass: LoopSimplifyPass on {{.*}}foo
; NPM-LOOP-DAG: Skipping pass: LCSSAPass
; NPM-LOOP-DAG: Skipping pass: IndVarSimplifyPass
; NPM-LOOP-DAG: Skipping pass: SimpleLoopUnswitchPass
Index: llvm/lib/Passes/StandardInstrumentations.cpp
===================================================================
--- llvm/lib/Passes/StandardInstrumentations.cpp
+++ llvm/lib/Passes/StandardInstrumentations.cpp
@@ -297,12 +297,7 @@
} else if (any_isa<const Loop *>(IR)) {
F = any_cast<const Loop *>(IR)->getHeader()->getParent();
}
- if (F && F->hasOptNone()) {
- if (DebugLogging)
- dbgs() << "Skipping pass: " << PassID << " (optnone)\n";
- return false;
- }
- return true;
+ return !(F && F->hasOptNone());
}
void PrintPassInstrumentation::registerCallbacks(
@@ -314,6 +309,15 @@
if (!DebugPMVerbose)
SpecialPasses.emplace_back("PassAdaptor");
+ PIC.registerBeforeSkippedPassCallback(
+ [SpecialPasses](StringRef PassID, Any IR) {
+ assert(!isSpecialPass(PassID, SpecialPasses) &&
+ "Unexpectedly skipping special pass");
+
+ dbgs() << "Skipping pass: " << PassID << " on ";
+ unwrapAndPrint(IR, "", false, true);
+ });
+
PIC.registerBeforeNonSkippedPassCallback(
[SpecialPasses](StringRef PassID, Any IR) {
if (isSpecialPass(PassID, SpecialPasses))
Index: llvm/include/llvm/Passes/StandardInstrumentations.h
===================================================================
--- llvm/include/llvm/Passes/StandardInstrumentations.h
+++ llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -56,12 +56,11 @@
class OptNoneInstrumentation {
public:
- OptNoneInstrumentation(bool DebugLogging) : DebugLogging(DebugLogging) {}
+ OptNoneInstrumentation() {}
void registerCallbacks(PassInstrumentationCallbacks &PIC);
private:
bool skip(StringRef PassID, Any IR);
- bool DebugLogging;
};
// Debug logging for transformation and analysis passes.
@@ -83,8 +82,7 @@
OptNoneInstrumentation OptNone;
public:
- StandardInstrumentations(bool DebugLogging)
- : PrintPass(DebugLogging), OptNone(DebugLogging) {}
+ StandardInstrumentations(bool DebugLogging) : PrintPass(DebugLogging) {}
void registerCallbacks(PassInstrumentationCallbacks &PIC);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85493.284070.patch
Type: text/x-patch
Size: 3220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200807/06ad6ca0/attachment.bin>
More information about the llvm-commits
mailing list