-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8355574: Fatal error in abort_verify_int_in_range due to Invalid CastII #25284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,53 +204,46 @@ void PhaseMacroExpand::generate_limit_guard(Node** ctrl, Node* offset, Node* sub | |
void PhaseMacroExpand::generate_partial_inlining_block(Node** ctrl, MergeMemNode** mem, const TypePtr* adr_type, | ||
RegionNode** exit_block, Node** result_memory, Node* length, | ||
Node* src_start, Node* dst_start, BasicType type) { | ||
const TypePtr *src_adr_type = _igvn.type(src_start)->isa_ptr(); | ||
Node* inline_block = nullptr; | ||
Node* stub_block = nullptr; | ||
|
||
int const_len = -1; | ||
const TypeInt* lty = nullptr; | ||
uint shift = exact_log2(type2aelembytes(type)); | ||
if (length->Opcode() == Op_ConvI2L) { | ||
lty = _igvn.type(length->in(1))->isa_int(); | ||
} else { | ||
lty = _igvn.type(length)->isa_int(); | ||
} | ||
if (lty && lty->is_con()) { | ||
const_len = lty->get_con() << shift; | ||
int inline_limit = ArrayOperationPartialInlineSize / type2aelembytes(type); | ||
|
||
const TypeLong* length_type = _igvn.type(length)->isa_long(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any particular benefit in eagerly pruning the block? It duplicates post-expansion GVN checks of the branch condition. (If it were normal parsing with prompt GVN analysis, you could detect the branch is dead right after Alternatively, the checks are equivalent to checking that join of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is a trivial check and it is much more efficient than creating a bunch of nodes and removing them later. |
||
if (length_type == nullptr) { | ||
assert(_igvn.type(length) == Type::TOP, ""); | ||
return; | ||
} else if (length_type->_hi <= 0) { | ||
// Nothing to copy | ||
return; | ||
} else if (length_type->_lo > inline_limit) { | ||
// Cannot inline | ||
return; | ||
} | ||
|
||
// Return if copy length is greater than partial inline size limit or | ||
// target does not supports masked load/stores. | ||
int lane_count = ArrayCopyNode::get_partial_inline_vector_lane_count(type, const_len); | ||
if ( const_len > ArrayOperationPartialInlineSize || | ||
!Matcher::match_rule_supported_vector(Op_LoadVectorMasked, lane_count, type) || | ||
// Return if the target does not supports masked load/stores. | ||
int lane_count = ArrayCopyNode::get_partial_inline_vector_lane_count(type, length_type->_hi); | ||
if (!Matcher::match_rule_supported_vector(Op_LoadVectorMasked, lane_count, type) || | ||
!Matcher::match_rule_supported_vector(Op_StoreVectorMasked, lane_count, type) || | ||
!Matcher::match_rule_supported_vector(Op_VectorMaskGen, lane_count, type)) { | ||
return; | ||
} | ||
|
||
int inline_limit = ArrayOperationPartialInlineSize / type2aelembytes(type); | ||
Node* casted_length = new CastLLNode(*ctrl, length, TypeLong::make(0, inline_limit, Type::WidenMin)); | ||
transform_later(casted_length); | ||
Node* copy_bytes = new LShiftXNode(length, intcon(shift)); | ||
transform_later(copy_bytes); | ||
|
||
Node* cmp_le = new CmpULNode(copy_bytes, longcon(ArrayOperationPartialInlineSize)); | ||
Node* cmp_le = new CmpULNode(length, longcon(inline_limit)); | ||
transform_later(cmp_le); | ||
Node* bol_le = new BoolNode(cmp_le, BoolTest::le); | ||
transform_later(bol_le); | ||
inline_block = generate_guard(ctrl, bol_le, nullptr, PROB_FAIR); | ||
stub_block = *ctrl; | ||
Node* inline_block = generate_guard(ctrl, bol_le, nullptr, PROB_FAIR); | ||
Node* stub_block = *ctrl; | ||
|
||
Node* casted_length = new CastLLNode(inline_block, length, TypeLong::make(0, inline_limit, Type::WidenMin), ConstraintCastNode::RegularDependency); | ||
transform_later(casted_length); | ||
Node* mask_gen = VectorMaskGenNode::make(casted_length, type); | ||
transform_later(mask_gen); | ||
|
||
unsigned vec_size = lane_count * type2aelembytes(type); | ||
unsigned vec_size = lane_count * type2aelembytes(type); | ||
if (C->max_vector_size() < vec_size) { | ||
C->set_max_vector_size(vec_size); | ||
} | ||
|
||
const TypePtr* src_adr_type = _igvn.type(src_start)->isa_ptr(); | ||
const TypeVect * vt = TypeVect::make(type, lane_count); | ||
Node* mm = (*mem)->memory_at(C->get_alias_index(src_adr_type)); | ||
Node* masked_load = new LoadVectorMaskedNode(inline_block, mm, src_start, | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jatin-bhateja you wrote this code. What do you think of the proposed change?