aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkvn <none@none>2009-03-26 15:04:55 -0700
committerkvn <none@none>2009-03-26 15:04:55 -0700
commit3d00035fe9c244c7d7bc73dfb5fb672a55d8be80 (patch)
tree3b3bf8570641103fcb7eb88b4be7fd44fba96289 /src
parent2ca9f5ff0568af0c5fd11581b2ddd1a4210e2159 (diff)
6810845: Performance regression in mpegaudio on x64
Summary: Used the outer loop frequency in frequencies checks in RA. Reviewed-by: never, twisti
Diffstat (limited to 'src')
-rw-r--r--src/share/vm/opto/block.hpp2
-rw-r--r--src/share/vm/opto/c2_globals.hpp4
-rw-r--r--src/share/vm/opto/chaitin.cpp3
-rw-r--r--src/share/vm/opto/chaitin.hpp4
-rw-r--r--src/share/vm/opto/coalesce.cpp4
-rw-r--r--src/share/vm/opto/gcm.cpp12
-rw-r--r--src/share/vm/opto/machnode.cpp5
7 files changed, 30 insertions, 4 deletions
diff --git a/src/share/vm/opto/block.hpp b/src/share/vm/opto/block.hpp
index f4c46ba2a..aac5105d6 100644
--- a/src/share/vm/opto/block.hpp
+++ b/src/share/vm/opto/block.hpp
@@ -371,6 +371,7 @@ class PhaseCFG : public Phase {
Block *_broot; // Basic block of root
uint _rpo_ctr;
CFGLoop* _root_loop;
+ float _outer_loop_freq; // Outmost loop frequency
// Per node latency estimation, valid only during GCM
GrowableArray<uint> _node_latency;
@@ -537,6 +538,7 @@ class CFGLoop : public CFGElement {
void compute_loop_depth(int depth);
void compute_freq(); // compute frequency with loop assuming head freq 1.0f
void scale_freq(); // scale frequency by loop trip count (including outer loops)
+ float outer_loop_freq() const; // frequency of outer loop
bool in_loop_nest(Block* b);
float trip_count() const { return 1.0f / _exit_prob; }
virtual bool is_loop() { return true; }
diff --git a/src/share/vm/opto/c2_globals.hpp b/src/share/vm/opto/c2_globals.hpp
index 6734321d8..425a66a42 100644
--- a/src/share/vm/opto/c2_globals.hpp
+++ b/src/share/vm/opto/c2_globals.hpp
@@ -391,7 +391,7 @@
product(intx, EliminateAllocationArraySizeLimit, 64, \
"Array size (number of elements) limit for scalar replacement") \
\
- product(bool, UseOptoBiasInlining, true, \
+ product(bool, UseOptoBiasInlining, true, \
"Generate biased locking code in C2 ideal graph") \
\
product(intx, ValueSearchLimit, 1000, \
@@ -410,7 +410,7 @@
"Miniumum %% of a successor (predecessor) for which block layout "\
"a will allow a fork (join) in a single chain") \
\
- product(bool, BlockLayoutRotateLoops, false, \
+ product(bool, BlockLayoutRotateLoops, true, \
"Allow back branches to be fall throughs in the block layour") \
C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)
diff --git a/src/share/vm/opto/chaitin.cpp b/src/share/vm/opto/chaitin.cpp
index e890c4ae3..4ad220d41 100644
--- a/src/share/vm/opto/chaitin.cpp
+++ b/src/share/vm/opto/chaitin.cpp
@@ -149,6 +149,9 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
#endif
{
NOT_PRODUCT( Compile::TracePhase t3("ctorChaitin", &_t_ctorChaitin, TimeCompiler); )
+
+ _high_frequency_lrg = MIN2(float(OPTO_LRG_HIGH_FREQ), _cfg._outer_loop_freq);
+
uint i,j;
// Build a list of basic blocks, sorted by frequency
_blks = NEW_RESOURCE_ARRAY( Block *, _cfg._num_blocks );
diff --git a/src/share/vm/opto/chaitin.hpp b/src/share/vm/opto/chaitin.hpp
index 0de7dd41e..1cea37e34 100644
--- a/src/share/vm/opto/chaitin.hpp
+++ b/src/share/vm/opto/chaitin.hpp
@@ -338,6 +338,8 @@ class PhaseChaitin : public PhaseRegAlloc {
Block **_blks; // Array of blocks sorted by frequency for coalescing
+ float _high_frequency_lrg; // Frequency at which LRG will be spilled for debug info
+
#ifndef PRODUCT
bool _trace_spilling;
#endif
@@ -360,6 +362,8 @@ public:
uint n2lidx( const Node *n ) const { return _names[n->_idx]; }
+ float high_frequency_lrg() const { return _high_frequency_lrg; }
+
#ifndef PRODUCT
bool trace_spilling() const { return _trace_spilling; }
#endif
diff --git a/src/share/vm/opto/coalesce.cpp b/src/share/vm/opto/coalesce.cpp
index 52c009927..99584ca16 100644
--- a/src/share/vm/opto/coalesce.cpp
+++ b/src/share/vm/opto/coalesce.cpp
@@ -473,7 +473,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
} // End of is two-adr
// Insert a copy at a debug use for a lrg which has high frequency
- if( (b->_freq < OPTO_DEBUG_SPLIT_FREQ) && n->is_MachSafePoint() ) {
+ if( b->_freq < OPTO_DEBUG_SPLIT_FREQ || b->is_uncommon(_phc._cfg._bbs) ) {
// Walk the debug inputs to the node and check for lrg freq
JVMState* jvms = n->jvms();
uint debug_start = jvms ? jvms->debug_start() : 999999;
@@ -487,7 +487,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
LRG &lrg = lrgs(nidx);
// If this lrg has a high frequency use/def
- if( lrg._maxfreq >= OPTO_LRG_HIGH_FREQ ) {
+ if( lrg._maxfreq >= _phc.high_frequency_lrg() ) {
// If the live range is also live out of this block (like it
// would be for a fast/slow idiom), the normal spill mechanism
// does an excellent job. If it is not live out of this block
diff --git a/src/share/vm/opto/gcm.cpp b/src/share/vm/opto/gcm.cpp
index 85263fcb3..df6484551 100644
--- a/src/share/vm/opto/gcm.cpp
+++ b/src/share/vm/opto/gcm.cpp
@@ -1374,6 +1374,9 @@ void PhaseCFG::Estimate_Block_Frequency() {
_root_loop->_freq = 1.0;
_root_loop->scale_freq();
+ // Save outmost loop frequency for LRG frequency threshold
+ _outer_loop_freq = _root_loop->outer_loop_freq();
+
// force paths ending at uncommon traps to be infrequent
if (!C->do_freq_based_layout()) {
Block_List worklist;
@@ -1898,6 +1901,7 @@ bool CFGLoop::in_loop_nest(Block* b) {
// Do a top down traversal of loop tree (visit outer loops first.)
void CFGLoop::scale_freq() {
float loop_freq = _freq * trip_count();
+ _freq = loop_freq;
for (int i = 0; i < _members.length(); i++) {
CFGElement* s = _members.at(i);
float block_freq = s->_freq * loop_freq;
@@ -1912,6 +1916,14 @@ void CFGLoop::scale_freq() {
}
}
+// Frequency of outer loop
+float CFGLoop::outer_loop_freq() const {
+ if (_child != NULL) {
+ return _child->_freq;
+ }
+ return _freq;
+}
+
#ifndef PRODUCT
//------------------------------dump_tree--------------------------------------
void CFGLoop::dump_tree() const {
diff --git a/src/share/vm/opto/machnode.cpp b/src/share/vm/opto/machnode.cpp
index adb7ecb98..b7357f86a 100644
--- a/src/share/vm/opto/machnode.cpp
+++ b/src/share/vm/opto/machnode.cpp
@@ -340,6 +340,10 @@ const class TypePtr *MachNode::adr_type() const {
if (base == NodeSentinel) return TypePtr::BOTTOM;
const Type* t = base->bottom_type();
+ if (UseCompressedOops && Universe::narrow_oop_shift() == 0) {
+ // 32-bit unscaled narrow oop can be the base of any address expression
+ t = t->make_ptr();
+ }
if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) {
// We cannot assert that the offset does not look oop-ish here.
// Depending on the heap layout the cardmark base could land
@@ -353,6 +357,7 @@ const class TypePtr *MachNode::adr_type() const {
// be conservative if we do not recognize the type
if (tp == NULL) {
+ assert(false, "this path may produce not optimal code");
return TypePtr::BOTTOM;
}
assert(tp->base() != Type::AnyPtr, "not a bare pointer");