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 .
diff --git a/Makefile.standalone-help/check-lit.txt b/Makefile.standalone-help/check-lit.txt
index 0f6dacd..472a8fc 100644
--- a/Makefile.standalone-help/check-lit.txt
+++ b/Makefile.standalone-help/check-lit.txt
@@ -1,4 +1,4 @@
 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
diff --git a/pydir/run-pnacl-sz.py b/pydir/run-pnacl-sz.py
index aecfbed..b11ca60 100755
--- a/pydir/run-pnacl-sz.py
+++ b/pydir/run-pnacl-sz.py
@@ -148,7 +148,7 @@
       # 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:
diff --git a/src/IceClFlags.cpp b/src/IceClFlags.cpp
index 36f53ee..279af1e 100644
--- a/src/IceClFlags.cpp
+++ b/src/IceClFlags.cpp
@@ -336,9 +336,10 @@
         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.
diff --git a/src/IceDefs.h b/src/IceDefs.h
index b8047b4..f85c364 100644
--- a/src/IceDefs.h
+++ b/src/IceDefs.h
@@ -214,8 +214,9 @@
   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;
 
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 79177c2..3bec3c3 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -394,7 +394,8 @@
 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);
diff --git a/tests_lit/llvm2ice_tests/globalrelocs.ll b/tests_lit/llvm2ice_tests/globalrelocs.ll
index 1b6b3a3..0a528dc 100644
--- a/tests_lit/llvm2ice_tests/globalrelocs.ll
+++ b/tests_lit/llvm2ice_tests/globalrelocs.ll
@@ -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"