forked from OSchip/llvm-project
[llc] Use -filetype=null to disable MIR printing
If you use -stop-after or similar options, llc will normally print MIR. This patch checks for -filetype=null as a special case to disable MIR printing. As the comment says, "The Null output is intended for use for performance analysis ...", and I found this useful for timing a subset of the passes that llc runs without the significant overhead of printing MIR just to send it to /dev/null. Differential Revision: https://reviews.llvm.org/D89476
This commit is contained in:
parent
7dff6b818b
commit
0c1381d795
|
@ -196,11 +196,14 @@ bool LLVMTargetMachine::addPassesToEmitFile(
|
|||
if (!PassConfig)
|
||||
return true;
|
||||
|
||||
if (!TargetPassConfig::willCompleteCodeGenPipeline())
|
||||
PM.add(createPrintMIRPass(Out));
|
||||
else if (addAsmPrinter(PM, Out, DwoOut, FileType,
|
||||
MMIWP->getMMI().getContext()))
|
||||
return true;
|
||||
if (TargetPassConfig::willCompleteCodeGenPipeline()) {
|
||||
if (addAsmPrinter(PM, Out, DwoOut, FileType, MMIWP->getMMI().getContext()))
|
||||
return true;
|
||||
} else {
|
||||
// MIR printing is redundant with -filetype=null.
|
||||
if (FileType != CGFT_Null)
|
||||
PM.add(createPrintMIRPass(Out));
|
||||
}
|
||||
|
||||
PM.add(createFreeMachineFunctionPass());
|
||||
return false;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
; -stop-after would normally dump MIR, but with -filetype=null as well check
|
||||
; there's no output at all.
|
||||
; RUN: llc -filetype=null -stop-after=finalize-isel -o - %s | count 0
|
Loading…
Reference in New Issue