< prev index next >
src/hotspot/share/opto/vector.cpp
Print this page
@@ -31,13 +31,13 @@
#include "utilities/macros.hpp"
void PhaseVector::optimize_vector_boxes() {
Compile::TracePhase tp("vector_elimination", &timers[_t_vector_elimination]);
+ // Signal GraphKit it's post-parse phase.
assert(C->inlining_incrementally() == false, "sanity");
-
- C->set_inlining_incrementally(true); // FIXME another way to signal GraphKit it's post-parsing phase?
+ C->set_inlining_incrementally(true);
C->for_igvn()->clear();
C->initial_gvn()->replace_with(&_igvn);
expand_vunbox_nodes();
@@ -46,30 +46,30 @@
C->inline_vector_reboxing_calls();
expand_vbox_nodes();
eliminate_vbox_alloc_nodes();
- C->set_inlining_incrementally(false); // FIXME another way to signal GraphKit it's post-parsing phase?
+ C->set_inlining_incrementally(false);
do_cleanup();
}
void PhaseVector::do_cleanup() {
if (C->failing()) return;
{
Compile::TracePhase tp("vector_pru", &timers[_t_vector_pru]);
ResourceMark rm;
PhaseRemoveUseless pru(C->initial_gvn(), C->for_igvn());
- }
-
if (C->failing()) return;
-
+ }
{
Compile::TracePhase tp("incrementalInline_igvn", &timers[_t_vector_igvn]);
_igvn = PhaseIterGVN(C->initial_gvn());
_igvn.optimize();
+ if (C->failing()) return;
}
+ C->print_method(PHASE_ITER_GVN_BEFORE_EA, 3);
}
void PhaseVector::scalarize_vbox_nodes() {
if (C->failing()) return;
@@ -101,11 +101,10 @@
assert(n->is_macro(), "only macro nodes expected here");
if (n->Opcode() == Op_VectorBox) {
VectorBoxNode* vbox = static_cast<VectorBoxNode*>(n);
expand_vbox_node(vbox);
if (C->failing()) return;
- C->print_method(PHASE_EXPAND_VBOX, vbox, 3);
}
if (C->failing()) return;
macro_idx = MIN2(macro_idx - 1, C->macro_count() - 1);
}
}
@@ -270,10 +269,11 @@
if (vec_box->outcnt() > 0) {
Node* vbox = vec_box->in(VectorBoxNode::Box);
Node* vect = vec_box->in(VectorBoxNode::Value);
Node* result = expand_vbox_node_helper(vbox, vect, vec_box->box_type(), vec_box->vec_type());
C->gvn_replace_by(vec_box, result);
+ C->print_method(PHASE_EXPAND_VBOX, vec_box, 3);
}
C->remove_macro_node(vec_box);
}
Node* PhaseVector::expand_vbox_node_helper(Node* vbox,
@@ -292,11 +292,11 @@
} else if (vbox->is_Proj() && vbox->in(0)->Opcode() == Op_VectorBoxAllocate) {
VectorBoxAllocateNode* vbox_alloc = static_cast<VectorBoxAllocateNode*>(vbox->in(0));
return expand_vbox_alloc_node(vbox_alloc, vect, box_type, vect_type);
} else {
assert(!vbox->is_Phi(), "");
- // TODO: ensure that expanded vbox is initialized with the same value (vect).
+ // TODO: assert that expanded vbox is initialized with the same value (vect).
return vbox; // already expanded
}
}
static bool is_vector_mask(ciKlass* klass) {
@@ -319,11 +319,11 @@
BasicType bt = vect_type->element_basic_type();
int num_elem = vect_type->length();
bool is_mask = is_vector_mask(box_klass);
if (is_mask && bt != T_BOOLEAN) {
- value = gvn.transform(new VectorStoreMaskNode(value, bt, num_elem));
+ value = gvn.transform(VectorStoreMaskNode::make(gvn, value, bt, num_elem));
// Although type of mask depends on its definition, in terms of storage everything is stored in boolean array.
bt = T_BOOLEAN;
assert(value->as_Vector()->bottom_type()->is_vect()->element_basic_type() == bt,
"must be consistent with mask representation");
}
@@ -371,10 +371,11 @@
IN_HEAP));
kit.set_memory(field_store, vec_adr_type);
kit.replace_call(vbox_alloc, vec_obj, true);
C->remove_macro_node(vbox_alloc);
+
return vec_obj;
}
void PhaseVector::expand_vunbox_node(VectorUnboxNode* vec_unbox) {
if (vec_unbox->outcnt() > 0) {
< prev index next >