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

Unified Diff: src/IceRegAlloc.cpp

Issue 1381563004: Subzero: Fix a bug in register allocator overlap computation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix the asserts() guard Created 5 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/IceOperand.cpp ('k') | src/PNaClTranslator.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 dacbc009bda6846fed013fb345dd1d7621032918..50e014aa5f2018f522a910f519c16d20b46f1294 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -38,9 +38,8 @@ bool overlapsDefs(const Cfg *Func, const Variable *Item, const Variable *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))
+ for (const Inst *Def : VMetadata->getLatterDefinitions(Var)) {
+ if (Item->getLiveRange().overlapsInst(Def->getNumber(), UseTrimmed))
return true;
}
return false;
@@ -463,7 +462,8 @@ void LinearScan::findRegisterPreference(IterationState &Iter) {
if (FindPreference) {
VariablesMetadata *VMetadata = Func->getVMetadata();
- if (const Inst *DefInst = VMetadata->getFirstDefinition(Iter.Cur)) {
+ if (const Inst *DefInst =
+ VMetadata->getFirstDefinitionSingleBlock(Iter.Cur)) {
assert(DefInst->getDest() == Iter.Cur);
bool IsAssign = DefInst->isSimpleAssign();
bool IsSingleDef = !VMetadata->isMultiDef(Iter.Cur);
« no previous file with comments | « src/IceOperand.cpp ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698