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

Unified Diff: src/IceOperand.cpp

Issue 490333003: Subzero: Fix address mode optimization involving phi temporaries. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review comments 1 Created 6 years, 4 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/IceDefs.h ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index d8a754b9e1c7ea2e441979d0aaa7987ca7be8572..b718ba50f445c15e801e3517d674022de3bf7e96 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -146,9 +146,16 @@ void Variable::setUse(const Inst *Inst, const CfgNode *Node) {
}
void Variable::setDefinition(Inst *Inst, const CfgNode *Node) {
+ if (DefInst && !DefInst->isDeleted() && DefInst != Inst) {
+ // Detect when a variable is being defined multiple times,
+ // particularly for Phi instruction lowering. If this happens, we
+ // need to lock DefInst to NULL.
+ DefInst = NULL;
+ DefNode = NULL;
+ return;
+ }
if (DefNode == NULL)
return;
- // Can first check preexisting DefInst if we care about multi-def vars.
DefInst = Inst;
if (Node != DefNode)
DefNode = NULL;
« no previous file with comments | « src/IceDefs.h ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698