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

Unified Diff: src/IceRegAlloc.cpp

Issue 1323693002: Subzero: Provide a macro for iterating over instruction variables. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: "Addresses comments" Created 5 years, 4 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/IceTargetLowering.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 2c6d742c4dcd62c687892a06d438ce61279fc655..cad7fb582e8e329676d16e1916358e568047ed76 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -18,6 +18,7 @@
#include "IceCfg.h"
#include "IceCfgNode.h"
#include "IceInst.h"
+#include "IceInstVarIter.h"
#include "IceOperand.h"
#include "IceTargetLowering.h"
@@ -180,16 +181,11 @@ void LinearScan::initForInfOnly() {
}
}
}
- for (SizeT I = 0; I < Inst.getSrcSize(); ++I) {
- Operand *Src = Inst.getSrc(I);
- SizeT NumVars = Src->getNumVars();
- for (SizeT J = 0; J < NumVars; ++J) {
- const Variable *Var = Src->getVar(J);
- if (Var->getIgnoreLiveness())
- continue;
- if (Var->hasReg() || Var->mustHaveReg())
- LREnd[Var->getIndex()] = Inst.getNumber();
- }
+ FOREACH_VAR_IN_INST(Var, Inst) {
+ if (Var->getIgnoreLiveness())
+ continue;
+ if (Var->hasReg() || Var->mustHaveReg())
+ LREnd[Var->getIndex()] = Inst.getNumber();
}
}
}
@@ -298,14 +294,9 @@ void LinearScan::addSpillFill(IterationState &Iter) {
// Remove from RegMask any physical registers referenced during Cur's live
// range. Start looking after SpillPoint gets set, i.e. once Cur's live
// range begins.
- for (SizeT i = 0; i < I->getSrcSize(); ++i) {
- Operand *Src = I->getSrc(i);
- SizeT NumVars = Src->getNumVars();
- for (SizeT j = 0; j < NumVars; ++j) {
- const Variable *Var = Src->getVar(j);
- if (Var->hasRegTmp())
- Iter.RegMask[Var->getRegNumTmp()] = false;
- }
+ FOREACH_VAR_IN_INST(Var, *I) {
+ if (Var->hasRegTmp())
+ Iter.RegMask[Var->getRegNumTmp()] = false;
}
}
}
« no previous file with comments | « src/IceOperand.cpp ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698