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

Unified Diff: src/IceRegAlloc.cpp

Issue 650613003: Subzero: Speed up VariablesMetadata initialization. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Split Definitions[] into first plus the rest 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/IceOperand.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegAlloc.cpp
diff --git a/src/IceRegAlloc.cpp b/src/IceRegAlloc.cpp
index b5c3315c4218636ffe05fa7bb559b265853cf2c4..1b4d0c249d0d872f2aecb705081dce83e25a04c8 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -32,7 +32,10 @@ namespace {
bool overlapsDefs(const Cfg *Func, const Variable *Item, const Variable *Var) {
const bool UseTrimmed = true;
VariablesMetadata *VMetadata = Func->getVMetadata();
- const InstDefList &Defs = VMetadata->getDefinitions(Var);
+ if (const Inst *FirstDef = VMetadata->getFirstDefinition(Var))
+ if (Item->getLiveRange().overlapsInst(FirstDef->getNumber(), UseTrimmed))
+ return true;
+ const InstDefList &Defs = VMetadata->getLatterDefinitions(Var);
for (size_t i = 0; i < Defs.size(); ++i) {
if (Item->getLiveRange().overlapsInst(Defs[i]->getNumber(), UseTrimmed))
return true;
@@ -47,11 +50,11 @@ void dumpDisableOverlap(const Cfg *Func, const Variable *Var,
Ostream &Str = Func->getContext()->getStrDump();
Str << "Disabling Overlap due to " << Reason << " " << *Var
<< " LIVE=" << Var->getLiveRange() << " Defs=";
- const InstDefList &Defs = VMetadata->getDefinitions(Var);
+ if (const Inst *FirstDef = VMetadata->getFirstDefinition(Var))
+ Str << FirstDef->getNumber();
+ const InstDefList &Defs = VMetadata->getLatterDefinitions(Var);
for (size_t i = 0; i < Defs.size(); ++i) {
jvoung (off chromium) 2014/10/15 22:10:37 Might be able to use a range-based for-loop now th
Jim Stichnoth 2014/10/15 22:12:44 Yeah, though I was thinking of making one big pass
- if (i > 0)
- Str << ",";
- Str << Defs[i]->getNumber();
+ Str << "," << Defs[i]->getNumber();
}
Str << "\n";
}
« no previous file with comments | « src/IceOperand.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698