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

Unified Diff: src/IceOperand.cpp

Issue 652633002: Subzero: Improve performance of liveness analysis and live range construction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove TODO 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.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index 9ecfd317d3872d5bf1d1223f5c35bdea535d9492..3f7d0bff8d05027e7607a4e4817a167dbd3b1159 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -151,10 +151,13 @@ bool LiveRange::overlapsInst(InstNumberT OtherBegin, bool UseTrimmed) const {
// Returns true if the live range contains the given instruction
// number. This is only used for validating the live range
-// calculation.
-bool LiveRange::containsValue(InstNumberT Value) const {
+// calculation. The IsDest argument indicates whether the Variable
+// being tested is used in the Dest position (as opposed to a Src
+// position).
+bool LiveRange::containsValue(InstNumberT Value, bool IsDest) const {
for (const RangeElementType &I : Range) {
- if (I.first <= Value && Value <= I.second)
+ if (I.first <= Value &&
+ (Value < I.second || (!IsDest && Value == I.second)))
return true;
}
return false;
@@ -184,6 +187,8 @@ Variable Variable::asType(Type Ty) {
void VariableTracking::markUse(const Inst *Instr, const CfgNode *Node,
bool IsFromDef, bool IsImplicit) {
+ if (MultiBlock == MBS_MultiBlock)
+ return;
// TODO(stichnot): If the use occurs as a source operand in the
// first instruction of the block, and its definition is in this
// block's only predecessor, we might consider not marking this as a
@@ -301,9 +306,7 @@ void VariablesMetadata::init() {
Metadata[Var->getIndex()].markUse(NoInst, EntryNode, IsFromDef, IsImplicit);
}
- SizeT NumNodes = Func->getNumNodes();
- for (SizeT N = 0; N < NumNodes; ++N) {
- CfgNode *Node = Func->getNodes()[N];
+ for (CfgNode *Node : Func->getNodes()) {
for (Inst *I : Node->getInsts()) {
if (I->isDeleted())
continue;
« no previous file with comments | « src/IceOperand.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698