Commit b6dcf3c5 by Jim Stichnoth

Subzero: Add "-verbose init" to control global initializer dumping.

One is rarely interested in seeing dump output regarding global initializers, so we add an additional verbose flag, and don't include it in the "-verbose most" set. BUG= none R=jpp@chromium.org Review URL: https://codereview.chromium.org/1744913002 .
parent c4ed549e
check-lit - run the lit tests
To check a specific test, override CHECK_LIT_TESTS, e.g.:
make -f Makefile.standalone check-lit \
CHECK_LIT_TESTS=tests_lit/llvm2ice_tests/arith.lll
CHECK_LIT_TESTS=tests_lit/llvm2ice_tests/arith.ll
......@@ -148,7 +148,7 @@ def main():
# If the tests are based on '-verbose inst' output, force
# single-threaded translation because dump output does not get
# reassembled into order.
cmd += ['-verbose', 'inst', '-notranslate', '-threads=0']
cmd += ['-verbose', 'inst,global_init', '-notranslate', '-threads=0']
if not args.llvm_source:
cmd += ['--bitcode-format=pnacl']
if not args.no_local_syms:
......
......@@ -336,9 +336,10 @@ cl::list<Ice::VerboseItem> VerboseList(
clEnumValN(Ice::IceV_AvailableRegs, "registers",
"Show available registers for register allocation"),
clEnumValN(Ice::IceV_Mem, "mem", "Memory usage details"),
clEnumValN(Ice::IceV_GlobalInit, "global_init", "Global initializers"),
clEnumValN(Ice::IceV_All, "all", "Use all verbose options"),
clEnumValN(Ice::IceV_Most, "most",
"Use all verbose options except 'regalloc'"),
"Use all verbose options except 'regalloc,global_init'"),
clEnumValN(Ice::IceV_None, "none", "No verbosity"), clEnumValEnd));
// Options not captured in Ice::ClFlags and propagated.
......
......@@ -214,8 +214,9 @@ enum VerboseItem {
IceV_Status = 1 << 14,
IceV_AvailableRegs = 1 << 15,
IceV_Mem = 1 << 16,
IceV_GlobalInit = 1 << 17,
IceV_All = ~IceV_None,
IceV_Most = IceV_All & ~IceV_LinearScan
IceV_Most = IceV_All & ~IceV_LinearScan & ~IceV_GlobalInit
};
using VerboseMask = uint32_t;
......
......@@ -394,7 +394,8 @@ void GlobalContext::addBlockInfoPtrs(VariableDeclaration *ProfileBlockInfo) {
void GlobalContext::lowerGlobals(const IceString &SectionSuffix) {
TimerMarker T(TimerStack::TT_emitGlobalInitializers, this);
const bool DumpGlobalVariables =
BuildDefs::dump() && (Flags.getVerbose() & Cfg::defaultVerboseMask()) &&
BuildDefs::dump() &&
(Flags.getVerbose() & IceV_GlobalInit & Cfg::defaultVerboseMask()) &&
Flags.getVerboseFocusOn().empty();
if (DumpGlobalVariables) {
OstreamLocker L(this);
......
......@@ -5,13 +5,13 @@
; Test that we handle it in the ICE converter.
; RUN: %lc2i -i %s --args -verbose inst -threads=0 \
; RUN: | %iflc FileCheck %s
; RUN: %lc2i -i %s --args -verbose inst -threads=0 \
; RUN: %lc2i -i %s --args -verbose inst,global_init -threads=0 \
; RUN: | %iflc FileCheck --check-prefix=DUMP %s
; Test that we handle it using Subzero's bitcode reader.
; RUN: %p2i -i %s --args -verbose inst -threads=0 \
; RUN: | FileCheck %s
; RUN: %p2i -i %s --args -verbose inst -threads=0 \
; RUN: %p2i -i %s --args -verbose inst,global_init -threads=0 \
; RUN: | FileCheck --check-prefix=DUMP %s
@bytes = internal global [7 x i8] c"abcdefg"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment