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

Unified Diff: src/IceInstVarIter.h

Issue 1392383003: Subzero: Consider all instruction variables for register preference. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 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/IceInstARM32.h ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstVarIter.h
diff --git a/src/IceInstVarIter.h b/src/IceInstVarIter.h
index 35cee005111a031b3a5ebe09b391575da0fd21bc..4a2c31b5ad0acdd45761d67b912616cc4f57010c 100644
--- a/src/IceInstVarIter.h
+++ b/src/IceInstVarIter.h
@@ -145,8 +145,8 @@
#define FOREACH_VAR_IN_INST(Var, Instr) \
for (SizeT Sz_I##Var##_ = 0, Sz_##Var##Index_ = 0, \
Sz_SrcSize##Var##_ = (Instr).getSrcSize(), Sz_J##Var##_ = 0, \
- Sz_NumVars##Var##_ = 0; \
- Sz_I##Var##_ < Sz_SrcSize##Var##_; ++Sz_I##Var##_) \
+ Sz_NumVars##Var##_ = 0, Sz_Foreach_Break = 0; \
+ !Sz_Foreach_Break && Sz_I##Var##_ < Sz_SrcSize##Var##_; ++Sz_I##Var##_) \
if (Operand *Sz_Op##Var##_ = nullptr) \
/*nothing*/; \
else \
@@ -154,7 +154,7 @@
(Sz_J##Var##_ = 0, \
Sz_Op##Var##_ = (Instr).getSrc(Sz_I##Var##_), \
Sz_NumVars##Var##_ = Sz_Op##Var##_->getNumVars(), nullptr); \
- Sz_J##Var##_ < Sz_NumVars##Var##_ && \
+ !Sz_Foreach_Break && Sz_J##Var##_ < Sz_NumVars##Var##_ && \
((Var = Sz_Op##Var##_->getVar(Sz_J##Var##_)), true); \
++Sz_J##Var##_, ++Sz_##Var##Index_)
@@ -162,6 +162,12 @@
(static_cast<const SizeT>(Sz_##V##_))
#define IndexOfVarInInst(Var) IsOnlyValidInFOREACH_VAR_IN_INST(Var##Index)
#define IndexOfVarOperandInInst(Var) IsOnlyValidInFOREACH_VAR_IN_INST(I##Var)
+#define FOREACH_VAR_IN_INST_BREAK \
+ if (true) { \
+ Sz_Foreach_Break = 1; \
+ continue; \
+ } else { \
+ }
#undef OnlyValidIn_FOREACH_VAR_IN_INSTS
#endif // SUBZERO_SRC_ICEINSTVARITER_H
« no previous file with comments | « src/IceInstARM32.h ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698