diff options
author | Eli Bendersky <eliben@chromium.org> | 2013-03-25 09:11:06 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@chromium.org> | 2013-03-25 09:11:06 -0700 |
commit | 719b445bea2bd32804075bb21edcec00b04cf682 (patch) | |
tree | 743d70b5938a86900f83edca83337fe1f9e99538 | |
parent | 7216560b2f1e66a7c9bb9a1b344ae6e9f0f89b7b (diff) |
Add -time-ir-parsing flag to llc.
This is in the process of being added upstream but the exact location
is still debated and will take some time to settle. In the mean-time
I'm adding it as a localmod so we can run our benchmarks effectively.
Later this should be switched to the upstream implementation (or move
to our own llc-replacement-driver).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3349
-rw-r--r-- | tools/llc/llc.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 45bb92f424..64bb6991d8 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -46,6 +46,7 @@ #include <memory> // @LOCALMOD-BEGIN +#include "llvm/Support/Timer.h" #include "StubMaker.h" #include "TextStubWriter.h" // @LOCALMOD-END @@ -69,6 +70,15 @@ DataStreamer* NaClBitcodeStreamer; #endif // @LOCALMOD-END +// @LOCALMOD-BEGIN +const char *TimeIRParsingGroupName = "LLVM IR Parsing"; +const char *TimeIRParsingName = "Parse IR"; + +bool TimeIRParsingIsEnabled = false; +static cl::opt<bool,true> +EnableTimeIRParsing("time-ir-parsing", cl::location(TimeIRParsingIsEnabled), + cl::desc("Measure the time IR parsing takes")); +// @LOCALMOD-END // General options for llc. Other pass-specific options are specified // within the corresponding llc passes, and target-specific options @@ -360,7 +370,12 @@ static int compileModule(char **argv, LLVMContext &Context) { llvm_unreachable("native client SRPC only supports streaming"); } #else - M.reset(ParseIRFile(InputFilename, Err, Context)); + { + // @LOCALMOD: timing is temporary, until it gets properly added upstream + NamedRegionTimer T(TimeIRParsingName, TimeIRParsingGroupName, + TimeIRParsingIsEnabled); + M.reset(ParseIRFile(InputFilename, Err, Context)); + } #endif // @LOCALMOD-END |