< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page

        

*** 66,75 **** --- 66,76 ---- #include "opto/phaseX.hpp" #include "opto/rootnode.hpp" #include "opto/runtime.hpp" #include "opto/stringopts.hpp" #include "opto/type.hpp" + #include "opto/vector.hpp" #include "opto/vectornode.hpp" #include "runtime/arguments.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "runtime/stubRoutines.hpp"
*** 409,418 **** --- 410,420 ---- bs->eliminate_useless_gc_barriers(useful, this); // clean up the late inline lists remove_useless_late_inlines(&_string_late_inlines, useful); remove_useless_late_inlines(&_boxing_late_inlines, useful); remove_useless_late_inlines(&_late_inlines, useful); + remove_useless_late_inlines(&_vector_reboxing_late_inlines, useful); debug_only(verify_graph_edges(true/*check for no_dead_code*/);) } // ============================================================================ //------------------------------CompileWrapper---------------------------------
*** 541,550 **** --- 543,553 ---- _for_igvn(NULL), _warm_calls(NULL), _late_inlines(comp_arena(), 2, 0, NULL), _string_late_inlines(comp_arena(), 2, 0, NULL), _boxing_late_inlines(comp_arena(), 2, 0, NULL), + _vector_reboxing_late_inlines(comp_arena(), 2, 0, NULL), _late_inlines_pos(0), _number_of_mh_late_inlines(0), _print_inlining_stream(NULL), _print_inlining_list(NULL), _print_inlining_idx(0),
*** 1944,1953 **** --- 1947,1958 ---- if (failing()) return; inline_incrementally_cleanup(igvn); + print_method(PHASE_INCREMENTAL_INLINE_STEP, 3); + if (failing()) return; } assert( igvn._worklist.size() == 0, "should be done with igvn" ); if (_string_late_inlines.length() > 0) {
*** 2078,2087 **** --- 2083,2102 ---- // No more new expensive nodes will be added to the list from here // so keep only the actual candidates for optimizations. cleanup_expensive_nodes(igvn); + assert(EnableVectorSupport || !has_vbox_nodes(), "sanity"); + if (EnableVectorSupport && has_vbox_nodes()) { + TracePhase tp("", &timers[_t_vector]); + PhaseVector pv(igvn); + pv.optimize_vector_boxes(); + + print_method(PHASE_ITER_GVN_AFTER_VECTOR, 2); + } + assert(!has_vbox_nodes(), "sanity"); + if (!failing() && RenumberLiveNodes && live_nodes() + NodeLimitFudgeFactor < unique()) { Compile::TracePhase tp("", &timers[_t_renumberLive]); initial_gvn()->replace_with(&igvn); for_igvn()->clear(); Unique_Node_List new_worklist(C->comp_arena());
*** 2532,2541 **** --- 2547,2584 ---- return (partition.size() == 2 || partition.size() == 3) && (inputs.size() == 2 || inputs.size() == 3); } + void Compile::inline_vector_reboxing_calls() { + if (C->_vector_reboxing_late_inlines.length() > 0) { + PhaseGVN* gvn = C->initial_gvn(); + + _late_inlines_pos = C->_late_inlines.length(); + while (_vector_reboxing_late_inlines.length() > 0) { + CallGenerator* cg = _vector_reboxing_late_inlines.pop(); + cg->do_late_inline(); + if (failing()) return; + print_method(PHASE_INLINE_VECTOR_REBOX, cg->call_node()); + } + _vector_reboxing_late_inlines.trunc_to(0); + } + } + + bool Compile::has_vbox_nodes() { + if (C->_vector_reboxing_late_inlines.length() > 0) { + return true; + } + for (int macro_idx = C->macro_count() - 1; macro_idx >= 0; macro_idx--) { + Node * n = C->macro_node(macro_idx); + assert(n->is_macro(), "only macro nodes expected here"); + if (n->Opcode() == Op_VectorUnbox || n->Opcode() == Op_VectorBox || n->Opcode() == Op_VectorBoxAllocate) { + return true; + } + } + return false; + } void Compile::process_logic_cone_root(PhaseIterGVN &igvn, Node *n, VectorSet &visited) { assert(is_vector_bitwise_op(n), "not a root"); visited.set(n->_idx);
*** 2600,2611 **** TracePhase tp("matcher", &timers[_t_matcher]); matcher.match(); if (failing()) { return; } } - // In debug mode can dump m._nodes.dump() for mapping of ideal to machine // nodes. Mapping is only valid at the root of each matched subtree. NOT_PRODUCT( verify_graph_edges(); ) // If you have too many nodes, or if matching has failed, bail out --- 2643,2654 ---- TracePhase tp("matcher", &timers[_t_matcher]); matcher.match(); if (failing()) { return; } + print_method(PHASE_AFTER_MATCHING, 3); } // In debug mode can dump m._nodes.dump() for mapping of ideal to machine // nodes. Mapping is only valid at the root of each matched subtree. NOT_PRODUCT( verify_graph_edges(); ) // If you have too many nodes, or if matching has failed, bail out
*** 2789,2799 **** n->in(2)->outcnt() == 1 &&// right use IS a last use !n->in(2)->is_Con() ) { // right use is not a constant // Check for commutative opcode switch( nop ) { case Op_AddI: case Op_AddF: case Op_AddD: case Op_AddL: ! case Op_MaxI: case Op_MinI: case Op_MulI: case Op_MulF: case Op_MulD: case Op_MulL: case Op_AndL: case Op_XorL: case Op_OrL: case Op_AndI: case Op_XorI: case Op_OrI: { // Move "last use" input to left by swapping inputs n->swap_edges(1, 2); --- 2832,2843 ---- n->in(2)->outcnt() == 1 &&// right use IS a last use !n->in(2)->is_Con() ) { // right use is not a constant // Check for commutative opcode switch( nop ) { case Op_AddI: case Op_AddF: case Op_AddD: case Op_AddL: ! case Op_MaxI: case Op_MaxL: case Op_MaxF: case Op_MaxD: ! case Op_MinI: case Op_MinL: case Op_MinF: case Op_MinD: case Op_MulI: case Op_MulF: case Op_MulD: case Op_MulL: case Op_AndL: case Op_XorL: case Op_OrL: case Op_AndI: case Op_XorI: case Op_OrI: { // Move "last use" input to left by swapping inputs n->swap_edges(1, 2);
*** 3354,3363 **** --- 3398,3409 ---- } break; case Op_LoadVector: case Op_StoreVector: + case Op_LoadVectorGather: + case Op_StoreVectorScatter: break; case Op_AddReductionVI: case Op_AddReductionVL: case Op_AddReductionVF:
*** 4569,4596 **** allocates++; } } } ! void Compile::print_method(CompilerPhaseType cpt, int level, int idx) { EventCompilerPhase event; if (event.should_commit()) { CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, cpt, C->_compile_id, level); } - #ifndef PRODUCT if (should_print(level)) { char output[1024]; if (idx != 0) { jio_snprintf(output, sizeof(output), "%s:%d", CompilerPhaseTypeHelper::to_string(cpt), idx); } else { jio_snprintf(output, sizeof(output), "%s", CompilerPhaseTypeHelper::to_string(cpt)); } - _printer->print_method(output, level); - } #endif ! C->_latest_stage_start_counter.stamp(); } void Compile::end_method(int level) { EventCompilerPhase event; if (event.should_commit()) { --- 4615,4659 ---- allocates++; } } } ! void Compile::print_method(CompilerPhaseType cpt, const char *name, int level, int idx) { EventCompilerPhase event; if (event.should_commit()) { CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, cpt, C->_compile_id, level); } #ifndef PRODUCT if (should_print(level)) { + _printer->print_method(name, level); + } + #endif + C->_latest_stage_start_counter.stamp(); + } + + void Compile::print_method(CompilerPhaseType cpt, int level, int idx) { char output[1024]; + #ifndef PRODUCT if (idx != 0) { jio_snprintf(output, sizeof(output), "%s:%d", CompilerPhaseTypeHelper::to_string(cpt), idx); } else { jio_snprintf(output, sizeof(output), "%s", CompilerPhaseTypeHelper::to_string(cpt)); } #endif ! print_method(cpt, output, level, idx); ! } ! ! void Compile::print_method(CompilerPhaseType cpt, Node* n, int level) { ! ResourceMark rm; ! stringStream ss; ! ss.print_raw(CompilerPhaseTypeHelper::to_string(cpt)); ! if (n != NULL) { ! ss.print(": %d %s ", n->_idx, NodeClassNames[n->Opcode()]); ! } else { ! ss.print_raw(": NULL"); ! } ! C->print_method(cpt, ss.as_string(), level); } void Compile::end_method(int level) { EventCompilerPhase event; if (event.should_commit()) {
< prev index next >