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