Commit a5229659 by Jim Stichnoth

Subzero: Add "--verbose=status" option.

This just prints the function being translated, once per function. This is useful if there is a crash or fatal error somewhere, and you want to quickly discover which function to set -verbose-focus on. Also, fixes some warnings/errors in the MINIMAL build. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/1439983002 .
parent 799ba673
......@@ -181,6 +181,8 @@ void Cfg::translate() {
FunctionTimer.reset(new TimerMarker(
getContext()->getTimerID(GlobalContext::TSK_Funcs, Name),
getContext(), GlobalContext::TSK_Funcs));
if (isVerbose(IceV_Status))
getContext()->getStrDump() << ">>>Translating " << Name << "\n";
}
TimerMarker T(TimerStack::TT_translate, this);
......
......@@ -50,10 +50,15 @@ public:
GlobalContext *getContext() const { return Ctx; }
uint32_t getSequenceNumber() const { return SequenceNumber; }
static constexpr VerboseMask defaultVerboseMask() {
return IceV_All & ~IceV_Status;
}
/// Returns true if any of the specified options in the verbose mask are set.
/// If the argument is omitted, it checks if any verbose options at all are
/// set.
bool isVerbose(VerboseMask Mask = IceV_All) const { return VMask & Mask; }
bool isVerbose(VerboseMask Mask = defaultVerboseMask()) const {
return VMask & Mask;
}
void setVerbose(VerboseMask Mask) { VMask = Mask; }
/// \name Manage the name and return type of the function being translated.
......
......@@ -269,6 +269,8 @@ cl::list<Ice::VerboseItem> VerboseList(
clEnumValN(Ice::IceV_Folding, "fold", "Instruction folding details"),
clEnumValN(Ice::IceV_RMW, "rmw", "ReadModifyWrite optimization"),
clEnumValN(Ice::IceV_Loop, "loop", "Loop nest depth analysis"),
clEnumValN(Ice::IceV_Status, "status",
"Print the name of the function being translated"),
clEnumValN(Ice::IceV_All, "all", "Use all verbose options"),
clEnumValN(Ice::IceV_Most, "most",
"Use all verbose options except 'regalloc'"),
......
......@@ -239,6 +239,7 @@ enum VerboseItem {
IceV_Folding = 1 << 11,
IceV_RMW = 1 << 12,
IceV_Loop = 1 << 13,
IceV_Status = 1 << 14,
IceV_All = ~IceV_None,
IceV_Most = IceV_All & ~IceV_LinearScan
};
......
......@@ -379,8 +379,9 @@ void GlobalContext::lowerJumpTables() { DataLowering->lowerJumpTables(); }
void GlobalContext::lowerGlobals(const IceString &SectionSuffix) {
TimerMarker T(TimerStack::TT_emitGlobalInitializers, this);
const bool DumpGlobalVariables = BuildDefs::dump() && Flags.getVerbose() &&
Flags.getVerboseFocusOn().empty();
const bool DumpGlobalVariables =
BuildDefs::dump() && (Flags.getVerbose() & Cfg::defaultVerboseMask()) &&
Flags.getVerboseFocusOn().empty();
if (DumpGlobalVariables) {
OstreamLocker L(this);
Ostream &Stream = getStrDump();
......
......@@ -1237,6 +1237,7 @@ void InstX86Blendvps<Machine>::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
Target)
->getInstructionSet() >= InstX86Base<Machine>::Traits::SSE4_1);
......@@ -1246,6 +1247,7 @@ void InstX86Blendvps<Machine>::emit(const Cfg *Func) const {
template <class Machine>
void InstX86Blendvps<Machine>::emitIAS(const Cfg *Func) const {
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
Target)
->getInstructionSet() >= InstX86Base<Machine>::Traits::SSE4_1);
......@@ -1260,6 +1262,7 @@ void InstX86Pblendvb<Machine>::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
Target)
->getInstructionSet() >= InstX86Base<Machine>::Traits::SSE4_1);
......@@ -1269,6 +1272,7 @@ void InstX86Pblendvb<Machine>::emit(const Cfg *Func) const {
template <class Machine>
void InstX86Pblendvb<Machine>::emitIAS(const Cfg *Func) const {
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
Target)
->getInstructionSet() >= InstX86Base<Machine>::Traits::SSE4_1);
......@@ -1376,6 +1380,7 @@ template <class Machine>
void InstX86Insertps<Machine>::emitIAS(const Cfg *Func) const {
assert(this->getSrcSize() == 3);
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
Target)
->getInstructionSet() >= InstX86Base<Machine>::Traits::SSE4_1);
......@@ -2308,6 +2313,7 @@ template <class Machine> void InstX86Mov<Machine>::emit(const Cfg *Func) const {
// point value between a vector and a scalar (which movss is used for). Clean
// this up.
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(Target->typeWidthInBytesOnStack(DestTy) ==
Target->typeWidthInBytesOnStack(SrcTy));
const Operand *NewSrc = Src;
......@@ -2786,6 +2792,7 @@ void InstX86Pextr<Machine>::emit(const Cfg *Func) const {
assert(this->getSrcSize() == 2);
// pextrb and pextrd are SSE4.1 instructions.
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(this->getSrc(0)->getType() == IceType_v8i16 ||
this->getSrc(0)->getType() == IceType_v8i1 ||
static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
......@@ -2815,6 +2822,7 @@ void InstX86Pextr<Machine>::emitIAS(const Cfg *Func) const {
Type DispatchTy = InstX86Base<Machine>::Traits::getInVectorElementType(
this->getSrc(0)->getType());
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(DispatchTy == IceType_i16 ||
static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
Target)
......@@ -2846,6 +2854,7 @@ void InstX86Pinsr<Machine>::emit(const Cfg *Func) const {
assert(this->getSrcSize() == 3);
// pinsrb and pinsrd are SSE4.1 instructions.
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(this->getDest()->getType() == IceType_v8i16 ||
this->getDest()->getType() == IceType_v8i1 ||
static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
......@@ -2883,6 +2892,7 @@ void InstX86Pinsr<Machine>::emitIAS(const Cfg *Func) const {
const Operand *Src0 = this->getSrc(1);
Type DispatchTy = Src0->getType();
TargetLowering *Target = Func->getTarget();
(void)Target;
assert(DispatchTy == IceType_i16 ||
static_cast<typename InstX86Base<Machine>::Traits::TargetLowering *>(
Target)
......
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