提交 7e4585a5 编写于 作者: K kvn

7032696: Fix for 7029152 broke VM

Summary: StrIntrinsicNode::Ideal() should not optimize memory during Parse.
Reviewed-by: jrose, never
上级 41b2893c
...@@ -432,6 +432,12 @@ bool IdealLoopTree::policy_maximally_unroll( PhaseIdealLoop *phase ) const { ...@@ -432,6 +432,12 @@ bool IdealLoopTree::policy_maximally_unroll( PhaseIdealLoop *phase ) const {
return false; return false;
} }
// Currently we don't have policy to optimize one iteration loops.
// Maximally unrolling transformation is used for that:
// it is peeled and the original loop become non reachable (dead).
if (trip_count == 1)
return true;
// Do not unroll a loop with String intrinsics code. // Do not unroll a loop with String intrinsics code.
// String intrinsics are large and have loops. // String intrinsics are large and have loops.
for (uint k = 0; k < _body.size(); k++) { for (uint k = 0; k < _body.size(); k++) {
......
...@@ -2628,12 +2628,16 @@ uint StrIntrinsicNode::match_edge(uint idx) const { ...@@ -2628,12 +2628,16 @@ uint StrIntrinsicNode::match_edge(uint idx) const {
Node *StrIntrinsicNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node *StrIntrinsicNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if (remove_dead_region(phase, can_reshape)) return this; if (remove_dead_region(phase, can_reshape)) return this;
Node* mem = phase->transform(in(MemNode::Memory)); if (can_reshape) {
// If transformed to a MergeMem, get the desired slice Node* mem = phase->transform(in(MemNode::Memory));
uint alias_idx = phase->C->get_alias_index(adr_type()); // If transformed to a MergeMem, get the desired slice
mem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(alias_idx) : mem; uint alias_idx = phase->C->get_alias_index(adr_type());
if (mem != in(MemNode::Memory)) mem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(alias_idx) : mem;
set_req(MemNode::Memory, mem); if (mem != in(MemNode::Memory)) {
set_req(MemNode::Memory, mem);
return this;
}
}
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册