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/IceOperand.h

Issue 2177033002: Subzero: Local variable splitting. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 4 years, 5 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
« src/IceInst.h ('K') | « src/IceInstX86Base.h ('k') | src/IceOperand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 041adfd1556716e6e2b1acd4a7122782fa0eb0fd..dc223400d250ac744827774e7293c3334467906f 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -729,6 +729,7 @@ public:
bool mustNotHaveReg() const {
return RegRequirement == RR_MustNotHaveRegister;
}
+ bool mayHaveReg() const { return RegRequirement == RR_MayHaveRegister; }
void setRematerializable(RegNumT NewRegNum, int32_t NewOffset) {
IsRematerializable = true;
setRegNum(NewRegNum);
@@ -789,6 +790,17 @@ public:
Root = Root->LinkedTo;
return Root;
}
+ /// Follow the LinkedTo chain up to the furthest stack-allocated ancestor.
+ /// This only makes sense after register allocation is complete.
Eric Holk 2016/07/25 19:59:22 Is there an assertion you could add to make sure r
Jim Stichnoth 2016/07/26 05:59:09 I don't really think it could be done cleanly and
+ Variable *getLinkedToStackRoot() const {
+ Variable *FurthestStackVar = nullptr;
+ for (Variable *Root = LinkedTo; Root != nullptr; Root = Root->LinkedTo) {
+ if (!Root->hasReg()) {
+ FurthestStackVar = Root;
+ }
+ }
+ return FurthestStackVar;
+ }
static bool classof(const Operand *Operand) {
OperandKind Kind = Operand->getKind();
« src/IceInst.h ('K') | « src/IceInstX86Base.h ('k') | src/IceOperand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698