Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: src/IceInst.cpp

Issue 691693003: Subzero: Improve the representation and handling of the FakeKill instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add an assert Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInst.h ('k') | src/IceOperand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 70b54b6006cfa875814dfb13f95b0fc810afaaec..090faba5ad997eb9e3366a91d89d8e70c93a9c07 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -454,11 +454,8 @@ InstFakeUse::InstFakeUse(Cfg *Func, Variable *Src)
InstFakeKill::InstFakeKill(Cfg *Func, const VarList &KilledRegs,
const Inst *Linked)
- : InstHighLevel(Func, Inst::FakeKill, KilledRegs.size(), NULL),
- Linked(Linked) {
- for (Variable *Var : KilledRegs)
- addSource(Var);
-}
+ : InstHighLevel(Func, Inst::FakeKill, 0, NULL), KilledRegs(KilledRegs),
+ Linked(Linked) {}
// ======================== Dump routines ======================== //
@@ -730,6 +727,8 @@ void InstUnreachable::dump(const Cfg *Func) const {
}
void InstFakeDef::emit(const Cfg *Func) const {
+ // Go ahead and "emit" these for now, since they are relatively
+ // rare.
Ostream &Str = Func->getContext()->getStrEmit();
Str << "\t# ";
getDest()->emit(Func);
@@ -744,12 +743,7 @@ void InstFakeDef::dump(const Cfg *Func) const {
dumpSources(Func);
}
-void InstFakeUse::emit(const Cfg *Func) const {
- Ostream &Str = Func->getContext()->getStrEmit();
- Str << "\t# ";
- Str << "use.pseudo ";
- emitSources(Func);
-}
+void InstFakeUse::emit(const Cfg *Func) const { (void)Func; }
void InstFakeUse::dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
@@ -757,21 +751,20 @@ void InstFakeUse::dump(const Cfg *Func) const {
dumpSources(Func);
}
-void InstFakeKill::emit(const Cfg *Func) const {
- Ostream &Str = Func->getContext()->getStrEmit();
- Str << "\t# ";
- if (Linked->isDeleted())
- Str << "// ";
- Str << "kill.pseudo ";
- emitSources(Func);
-}
+void InstFakeKill::emit(const Cfg *Func) const { (void)Func; }
void InstFakeKill::dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
if (Linked->isDeleted())
Str << "// ";
Str << "kill.pseudo ";
- dumpSources(Func);
+ bool First = true;
+ for (Variable *Var : KilledRegs) {
+ if (!First)
+ Str << ", ";
+ First = false;
+ Var->dump(Func);
+ }
}
void InstTarget::dump(const Cfg *Func) const {
« no previous file with comments | « src/IceInst.h ('k') | src/IceOperand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698