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

Unified Diff: src/IceCfg.cpp

Issue 672393003: Subzero: Minor refactoring/additions in preparation for phi edge splitting. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove deprecated advanceBackward method Created 6 years, 2 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/IceCfg.h ('k') | src/IceCfgNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index ed962d151f43b11d980ede9898db01912ee843f7..04e7acd25a6c0286da9f9bad9b4b93361ddf226b 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -284,6 +284,19 @@ bool Cfg::validateLiveness() const {
return Valid;
}
+// Deletes redundant assignments like "var=var". This includes
+// architecturally redundant moves like "var1:eax=var2:eax". As such,
+// this needs to be done very late in the translation to avoid
+// liveness inconsistencies.
+void Cfg::deleteRedundantAssignments() {
+ for (CfgNode *Node : Nodes) {
+ // Ignore Phi instructions.
+ for (Inst *I : Node->getInsts())
+ if (I->isRedundantAssign())
+ I->setDeleted();
+ }
+}
+
void Cfg::doBranchOpt() {
TimerMarker T(TimerStack::TT_doBranchOpt, this);
for (auto I = Nodes.begin(), E = Nodes.end(); I != E; ++I) {
« no previous file with comments | « src/IceCfg.h ('k') | src/IceCfgNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698