Skip to content

Commit

Permalink
[JIT] Backport 8318446: C2: optimize stores into primitive arrays by …
Browse files Browse the repository at this point in the history
…combining values into larger store
  • Loading branch information
kuaiwei committed Jan 6, 2025
1 parent 46a012b commit 01d9f44
Show file tree
Hide file tree
Showing 7 changed files with 1,439 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/opto/addnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,9 @@ Node* AddPNode::Ideal_base_and_offset(Node* ptr, PhaseTransform* phase,
//------------------------------unpack_offsets----------------------------------
// Collect the AddP offset values into the elements array, giving up
// if there are more than length.
int AddPNode::unpack_offsets(Node* elements[], int length) {
int AddPNode::unpack_offsets(Node* elements[], int length) const {
int count = 0;
Node* addr = this;
Node const* addr = this;
Node* base = addr->in(AddPNode::Base);
while (addr->is_AddP()) {
if (addr->in(AddPNode::Base) != base) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/addnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class AddPNode : public Node {

// Collect the AddP offset values into the elements array, giving up
// if there are more than length.
int unpack_offsets(Node* elements[], int length);
int unpack_offsets(Node* elements[], int length) const;

// Do not match base-ptr edge
virtual uint match_edge(uint idx) const;
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/share/opto/c2_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@
notproduct(bool, TraceNewVectors, false, \
"Trace creation of Vector nodes") \
\
diagnostic(bool, MergeStores, true, \
"Optimize stores by combining values into larger store") \
\
develop(bool, TraceMergeStores, false, \
"Trace creation of merged stores") \
\
product_pd(bool, OptoBundling, \
"Generate nops to fill i-cache lines") \
\
Expand Down
Loading

0 comments on commit 01d9f44

Please sign in to comment.