summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2019-03-28 13:23:04 -0700
committerSergey Andreenko <seandree@microsoft.com>2019-04-09 16:42:15 -0700
commit325bfa4890a069c4060116f81ef8753be3b828c9 (patch)
treed6054b65282bd2fdadaf4154c5200736dff830a3
parentc6dbbf050b2a532bfc3e1b0a228da4d42f5e79e9 (diff)
downloadcoreclr-325bfa4890a069c4060116f81ef8753be3b828c9.tar.gz
coreclr-325bfa4890a069c4060116f81ef8753be3b828c9.tar.bz2
coreclr-325bfa4890a069c4060116f81ef8753be3b828c9.zip
Clarify some unsupported cases in `optVNConstantPropOnTree`.
-rw-r--r--src/jit/assertionprop.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp
index 7b11b017f5..c66dcc0617 100644
--- a/src/jit/assertionprop.cpp
+++ b/src/jit/assertionprop.cpp
@@ -2475,7 +2475,7 @@ GenTree* Compiler::optVNConstantPropOnTree(BasicBlock* block, GenTree* tree)
break;
default:
- // Can't optimize.
+ // Do not support such optimization.
break;
}
}
@@ -2484,15 +2484,15 @@ GenTree* Compiler::optVNConstantPropOnTree(BasicBlock* block, GenTree* tree)
case TYP_REF:
{
- if (tree->TypeGet() != TYP_REF) // TODO seandree: what are other cases here?
+ assert(vnStore->ConstantValue<size_t>(vnCns) == 0);
+ if (tree->TypeGet() == TYP_REF)
{
- // Can't optimize.
- break;
+ conValTree = gtNewIconNode(0, TYP_REF);
+ }
+ else
+ {
+ // Do not support such optimization (e.g byref(ref(0)).
}
-
- assert(vnStore->ConstantValue<size_t>(vnCns) == 0);
-
- conValTree = gtNewIconNode(0, TYP_REF);
}
break;
@@ -2537,15 +2537,20 @@ GenTree* Compiler::optVNConstantPropOnTree(BasicBlock* block, GenTree* tree)
break;
default:
- // Can't optimize.
+ // Do not support (e.g. bool(const int)).
break;
}
}
}
break;
+ case TYP_BYREF:
+ // Do not support const byref optimization.
+ break;
+
default:
- // Can't optimize.
+ // We do not record constants of other types.
+ unreached();
break;
}