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

Unified Diff: src/IceCfg.cpp

Issue 589003002: Subzero: Refactor tracking of Defs and block-local Variables. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Indicate args as non-multidef Created 6 years, 3 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.cpp » ('j') | src/IceConverter.cpp » ('J')
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 a08bebb31dbc86e66eea5777860e57b99e584791..640bc64ce75e9b9a08ff9fb1a78d6d088f54b18d 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -28,7 +28,7 @@ Cfg::Cfg(GlobalContext *Ctx)
IsInternalLinkage(false), HasError(false), ErrorMessage(""), Entry(NULL),
NextInstNumber(1), Live(NULL),
Target(TargetLowering::createLowering(Ctx->getTargetArch(), this)),
- CurrentNode(NULL) {}
+ VMetadata(new VariablesMetadata(this)), CurrentNode(NULL) {}
Cfg::~Cfg() {}
@@ -45,13 +45,12 @@ CfgNode *Cfg::makeNode(const IceString &Name) {
return Node;
}
-Variable *Cfg::makeVariable(Type Ty, const CfgNode *Node,
- const IceString &Name) {
- return makeVariable<Variable>(Ty, Node, Name);
+Variable *Cfg::makeVariable(Type Ty, const IceString &Name) {
+ return makeVariable<Variable>(Ty, Name);
}
void Cfg::addArg(Variable *Arg) {
- Arg->setIsArg(this);
+ Arg->setIsArg();
Args.push_back(Arg);
}
@@ -147,6 +146,7 @@ void Cfg::genFrame() {
// completely with a single block. It is a quick single pass and
// doesn't need to iterate until convergence.
void Cfg::livenessLightweight() {
+ getVMetadata()->init();
for (NodeList::iterator I = Nodes.begin(), E = Nodes.end(); I != E; ++I) {
(*I)->livenessLightweight();
}
@@ -154,6 +154,7 @@ void Cfg::livenessLightweight() {
void Cfg::liveness(LivenessMode Mode) {
Live.reset(new Liveness(this, Mode));
+ getVMetadata()->init();
Live->init();
// Initialize with all nodes needing to be processed.
llvm::BitVector NeedToProcess(Nodes.size(), true);
@@ -361,9 +362,12 @@ void Cfg::dump(const IceString &Message) {
for (VarList::const_iterator I = Variables.begin(), E = Variables.end();
I != E; ++I) {
Variable *Var = *I;
- Str << "//"
- << " multiblock=" << Var->isMultiblockLife() << " "
- << " weight=" << Var->getWeight() << " ";
+ Str << "// multiblock=";
+ if (getVMetadata()->isTracked(Var))
+ Str << getVMetadata()->isMultiBlock(Var);
+ else
+ Str << "?";
+ Str << " weight=" << Var->getWeight() << " ";
Var->dump(this);
if (Variable *Pref = Var->getPreferredRegister()) {
Str << " pref=";
« no previous file with comments | « src/IceCfg.h ('k') | src/IceCfgNode.cpp » ('j') | src/IceConverter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698