| Index: src/IceInst.cpp
|
| diff --git a/src/IceInst.cpp b/src/IceInst.cpp
|
| index 090faba5ad997eb9e3366a91d89d8e70c93a9c07..6cbfc329b1b34524366a7533b63bb387be33e0ed 100644
|
| --- a/src/IceInst.cpp
|
| +++ b/src/IceInst.cpp
|
| @@ -457,9 +457,17 @@ InstFakeKill::InstFakeKill(Cfg *Func, const VarList &KilledRegs,
|
| : InstHighLevel(Func, Inst::FakeKill, 0, NULL), KilledRegs(KilledRegs),
|
| Linked(Linked) {}
|
|
|
| +Type InstCall::getReturnType() const {
|
| + if (Dest == NULL)
|
| + return IceType_void;
|
| + return Dest->getType();
|
| +}
|
| +
|
| // ======================== Dump routines ======================== //
|
|
|
| void Inst::dumpDecorated(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| if (!Func->getContext()->isVerbose(IceV_Deleted) &&
|
| (isDeleted() || isRedundantAssign()))
|
| @@ -482,6 +490,8 @@ void Inst::dumpDecorated(const Cfg *Func) const {
|
| }
|
|
|
| void Inst::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " =~ ";
|
| @@ -489,6 +499,8 @@ void Inst::dump(const Cfg *Func) const {
|
| }
|
|
|
| void Inst::dumpExtras(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| bool First = true;
|
| // Print "LIVEEND={a,b,c}" for all source operands whose live ranges
|
| @@ -515,6 +527,8 @@ void Inst::dumpExtras(const Cfg *Func) const {
|
| }
|
|
|
| void Inst::dumpSources(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| for (SizeT I = 0; I < getSrcSize(); ++I) {
|
| if (I > 0)
|
| @@ -524,6 +538,8 @@ void Inst::dumpSources(const Cfg *Func) const {
|
| }
|
|
|
| void Inst::emitSources(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrEmit();
|
| for (SizeT I = 0; I < getSrcSize(); ++I) {
|
| if (I > 0)
|
| @@ -533,11 +549,15 @@ void Inst::emitSources(const Cfg *Func) const {
|
| }
|
|
|
| void Inst::dumpDest(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| if (getDest())
|
| getDest()->dump(Func);
|
| }
|
|
|
| void InstAlloca::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = alloca i8, i32 ";
|
| @@ -547,6 +567,8 @@ void InstAlloca::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstArithmetic::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = " << InstArithmeticAttributes[getOp()].DisplayString << " "
|
| @@ -555,6 +577,8 @@ void InstArithmetic::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstAssign::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = " << getDest()->getType() << " ";
|
| @@ -562,6 +586,8 @@ void InstAssign::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstBr::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << "br ";
|
| @@ -573,13 +599,9 @@ void InstBr::dump(const Cfg *Func) const {
|
| Str << "label %" << getTargetFalse()->getName();
|
| }
|
|
|
| -Type InstCall::getReturnType() const {
|
| - if (Dest == NULL)
|
| - return IceType_void;
|
| - return Dest->getType();
|
| -}
|
| -
|
| void InstCall::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| if (getDest()) {
|
| dumpDest(Func);
|
| @@ -603,6 +625,8 @@ void InstCall::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstCast::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = " << InstCastAttributes[getCastKind()].DisplayString << " "
|
| @@ -612,6 +636,8 @@ void InstCast::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstIcmp::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = icmp " << InstIcmpAttributes[getCondition()].DisplayString << " "
|
| @@ -620,6 +646,8 @@ void InstIcmp::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstExtractElement::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = extractelement ";
|
| @@ -631,6 +659,8 @@ void InstExtractElement::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstInsertElement::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = insertelement ";
|
| @@ -645,6 +675,8 @@ void InstInsertElement::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstFcmp::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = fcmp " << InstFcmpAttributes[getCondition()].DisplayString << " "
|
| @@ -653,6 +685,8 @@ void InstFcmp::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstLoad::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Type Ty = getDest()->getType();
|
| @@ -662,6 +696,8 @@ void InstLoad::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstStore::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| Type Ty = getData()->getType();
|
| Str << "store " << Ty << " ";
|
| @@ -672,6 +708,8 @@ void InstStore::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstSwitch::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| Type Ty = getComparison()->getType();
|
| Str << "switch " << Ty << " ";
|
| @@ -685,6 +723,8 @@ void InstSwitch::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstPhi::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = phi " << getDest()->getType() << " ";
|
| @@ -698,6 +738,8 @@ void InstPhi::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstRet::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| Type Ty = hasRetValue() ? getRetValue()->getType() : IceType_void;
|
| Str << "ret " << Ty;
|
| @@ -708,6 +750,8 @@ void InstRet::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstSelect::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Operand *Condition = getCondition();
|
| @@ -722,11 +766,15 @@ void InstSelect::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstUnreachable::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| Str << "unreachable";
|
| }
|
|
|
| void InstFakeDef::emit(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| // Go ahead and "emit" these for now, since they are relatively
|
| // rare.
|
| Ostream &Str = Func->getContext()->getStrEmit();
|
| @@ -737,6 +785,8 @@ void InstFakeDef::emit(const Cfg *Func) const {
|
| }
|
|
|
| void InstFakeDef::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| dumpDest(Func);
|
| Str << " = def.pseudo ";
|
| @@ -746,6 +796,8 @@ void InstFakeDef::dump(const Cfg *Func) const {
|
| void InstFakeUse::emit(const Cfg *Func) const { (void)Func; }
|
|
|
| void InstFakeUse::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| Str << "use.pseudo ";
|
| dumpSources(Func);
|
| @@ -754,6 +806,8 @@ void InstFakeUse::dump(const Cfg *Func) const {
|
| void InstFakeKill::emit(const Cfg *Func) const { (void)Func; }
|
|
|
| void InstFakeKill::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| if (Linked->isDeleted())
|
| Str << "// ";
|
| @@ -768,6 +822,8 @@ void InstFakeKill::dump(const Cfg *Func) const {
|
| }
|
|
|
| void InstTarget::dump(const Cfg *Func) const {
|
| + if (!ALLOW_DUMP)
|
| + return;
|
| Ostream &Str = Func->getContext()->getStrDump();
|
| Str << "[TARGET] ";
|
| Inst::dump(Func);
|
|
|