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

Unified Diff: src/IceInst.h

Issue 680733002: Subzero: Allow delaying Phi lowering until after register allocation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix vector const undef lowering for phis. 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/IceDefs.h ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.h
diff --git a/src/IceInst.h b/src/IceInst.h
index 0a47e1a50821880994e1c52fc139221abc612973..e6edb4c6d6f62d7a82fd1a81e30c3da198ddc3b6 100644
--- a/src/IceInst.h
+++ b/src/IceInst.h
@@ -100,11 +100,27 @@ public:
"getTerminatorEdges() called on a non-terminator instruction");
return NodeList();
}
+ virtual bool isUnconditionalBranch() const { return false; }
+ // If the instruction is a branch-type instruction with OldNode as a
+ // target, repoint it to NewNode and return true, otherwise return
+ // false. Only repoint one instance, even if the instruction has
+ // multiple instances of OldNode as a target.
+ virtual bool repointEdge(CfgNode *OldNode, CfgNode *NewNode) {
+ (void)OldNode;
+ (void)NewNode;
+ return false;
+ }
virtual bool isSimpleAssign() const { return false; }
void livenessLightweight(Cfg *Func, LivenessBV &Live);
- void liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness,
+ // Calculates liveness for this instruction. Returns true if this
+ // instruction is (tentatively) still live and should be retained,
+ // and false if this instruction is (tentatively) dead and should be
+ // deleted. The decision is tentative until the liveness dataflow
+ // algorithm has converged, and then a separate pass permanently
+ // deletes dead instructions.
+ bool liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness,
LiveBeginEndMap *LiveBegin, LiveBeginEndMap *LiveEnd);
// Get the number of native instructions that this instruction
@@ -304,6 +320,8 @@ public:
return getTargetFalse();
}
NodeList getTerminatorEdges() const override;
+ bool isUnconditionalBranch() const override { return isUnconditional(); }
+ bool repointEdge(CfgNode *OldNode, CfgNode *NewNode) override;
void dump(const Cfg *Func) const override;
static bool classof(const Inst *Inst) { return Inst->getKind() == Br; }
@@ -314,8 +332,8 @@ private:
InstBr(Cfg *Func, CfgNode *Target);
~InstBr() override {}
- CfgNode *const TargetFalse; // Doubles as unconditional branch target
- CfgNode *const TargetTrue; // NULL if unconditional branch
+ CfgNode *TargetFalse; // Doubles as unconditional branch target
+ CfgNode *TargetTrue; // NULL if unconditional branch
};
// Call instruction. The call target is captured as getSrc(0), and
@@ -671,6 +689,7 @@ public:
}
void addBranch(SizeT CaseIndex, uint64_t Value, CfgNode *Label);
NodeList getTerminatorEdges() const override;
+ bool repointEdge(CfgNode *OldNode, CfgNode *NewNode) override;
void dump(const Cfg *Func) const override;
static bool classof(const Inst *Inst) { return Inst->getKind() == Switch; }
« no previous file with comments | « src/IceDefs.h ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698