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

Unified Diff: src/IceInst.cpp

Issue 1182603004: Subzero: Transform suitable Load/Arith/Store sequences into RMW ops. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 years, 6 months 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/IceInstX8632.h » ('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 de082bbb111e67d2f559f495d3c97656c40f8463..30d50662c165c9a2322c3978c3f2721a5c782459 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -422,9 +422,16 @@ InstSelect::InstSelect(Cfg *Func, Variable *Dest, Operand *Condition,
}
InstStore::InstStore(Cfg *Func, Operand *Data, Operand *Addr)
- : InstHighLevel(Func, Inst::Store, 2, nullptr) {
+ : InstHighLevel(Func, Inst::Store, 3, nullptr) {
addSource(Data);
addSource(Addr);
+ // The 3rd operand is a dummy placeholder for the RMW beacon.
+ addSource(Data);
+}
+
+void InstStore::setRmwBeacon(Variable *Beacon) {
+ Dest = llvm::dyn_cast<Variable>(getData());
+ Srcs[2] = Beacon;
}
InstSwitch::InstSwitch(Cfg *Func, SizeT NumCases, Operand *Source,
@@ -747,11 +754,18 @@ void InstStore::dump(const Cfg *Func) const {
return;
Ostream &Str = Func->getContext()->getStrDump();
Type Ty = getData()->getType();
+ dumpDest(Func);
+ if (Dest)
+ Str << " = ";
Str << "store " << Ty << " ";
getData()->dump(Func);
Str << ", " << Ty << "* ";
getAddr()->dump(Func);
Str << ", align " << typeAlignInBytes(Ty);
+ if (getRmwBeacon()) {
+ Str << ", beacon ";
+ getRmwBeacon()->dump(Func);
+ }
}
void InstSwitch::dump(const Cfg *Func) const {
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698