[PATCH] D41793: [Debugify] Add a mode to opt to enable faster testing
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 23 12:45:46 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL323256: [Debugify] Add a mode to opt to enable faster testing (authored by vedantk, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41793?vs=129023&id=131130#toc
Repository:
rL LLVM
https://reviews.llvm.org/D41793
Files:
llvm/trunk/test/DebugInfo/debugify.ll
llvm/trunk/tools/opt/Debugify.cpp
llvm/trunk/tools/opt/opt.cpp
Index: llvm/trunk/tools/opt/opt.cpp
===================================================================
--- llvm/trunk/tools/opt/opt.cpp
+++ llvm/trunk/tools/opt/opt.cpp
@@ -203,6 +203,11 @@
static cl::opt<bool>
AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization"));
+static cl::opt<bool> EnableDebugify(
+ "enable-debugify",
+ cl::desc(
+ "Start the pipeline with debugify and end it with check-debugify"));
+
static cl::opt<bool>
PrintBreakpoints("print-breakpoints-for-testing",
cl::desc("Print select breakpoints location for testing"));
@@ -252,6 +257,9 @@
cl::desc("YAML output filename for pass remarks"),
cl::value_desc("filename"));
+extern ModulePass *createDebugifyPass();
+extern ModulePass *createCheckDebugifyPass();
+
static inline void addPass(legacy::PassManagerBase &PM, Pass *P) {
// Add the pass to the pass manager...
PM.add(P);
@@ -570,6 +578,9 @@
Passes.add(createTargetTransformInfoWrapperPass(TM ? TM->getTargetIRAnalysis()
: TargetIRAnalysis()));
+ if (EnableDebugify)
+ Passes.add(createDebugifyPass());
+
std::unique_ptr<legacy::FunctionPassManager> FPasses;
if (OptLevelO0 || OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz ||
OptLevelO3) {
@@ -715,6 +726,9 @@
if (!NoVerify && !VerifyEach)
Passes.add(createVerifierPass());
+ if (EnableDebugify)
+ Passes.add(createCheckDebugifyPass());
+
// In run twice mode, we want to make sure the output is bit-by-bit
// equivalent if we run the pass manager again, so setup two buffers and
// a stream to write to them. Note that llc does something similar and it
Index: llvm/trunk/tools/opt/Debugify.cpp
===================================================================
--- llvm/trunk/tools/opt/Debugify.cpp
+++ llvm/trunk/tools/opt/Debugify.cpp
@@ -204,6 +204,10 @@
} // end anonymous namespace
+ModulePass *createDebugifyPass() { return new DebugifyPass(); }
+
+ModulePass *createCheckDebugifyPass() { return new CheckDebugifyPass(); }
+
char DebugifyPass::ID = 0;
static RegisterPass<DebugifyPass> X("debugify",
"Attach debug info to everything");
Index: llvm/trunk/test/DebugInfo/debugify.ll
===================================================================
--- llvm/trunk/test/DebugInfo/debugify.ll
+++ llvm/trunk/test/DebugInfo/debugify.ll
@@ -9,6 +9,9 @@
; RUN: opt -debugify -strip -check-debugify -S -o - < %s | \
; RUN: FileCheck %s -check-prefix=CHECK-FAIL
+; RUN: opt -enable-debugify -strip -S -o - < %s | \
+; RUN: FileCheck %s -check-prefix=CHECK-FAIL
+
; CHECK-LABEL: define void @foo
define void @foo() {
; CHECK: ret void, !dbg ![[RET1:.*]]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41793.131130.patch
Type: text/x-patch
Size: 2802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180123/10454819/attachment.bin>
More information about the llvm-commits
mailing list