1.1 --- a/src/share/vm/opto/ifg.cpp Thu Jun 14 14:59:52 2012 -0700 1.2 +++ b/src/share/vm/opto/ifg.cpp Fri Jun 15 01:25:19 2012 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -416,6 +416,7 @@ 1.11 if( lrgs(lidx).mask().is_UP() && 1.12 lrgs(lidx).mask_size() && 1.13 !lrgs(lidx)._is_float && 1.14 + !lrgs(lidx)._is_vector && 1.15 lrgs(lidx).mask().overlap(*Matcher::idealreg2regmask[Op_RegI]) ) 1.16 cnt += lrgs(lidx).reg_pressure(); 1.17 } 1.18 @@ -430,7 +431,7 @@ 1.19 while ((lidx = elements.next()) != 0) { 1.20 if( lrgs(lidx).mask().is_UP() && 1.21 lrgs(lidx).mask_size() && 1.22 - lrgs(lidx)._is_float ) 1.23 + (lrgs(lidx)._is_float || lrgs(lidx)._is_vector)) 1.24 cnt += lrgs(lidx).reg_pressure(); 1.25 } 1.26 return cnt; 1.27 @@ -439,8 +440,8 @@ 1.28 //------------------------------lower_pressure--------------------------------- 1.29 // Adjust register pressure down by 1. Capture last hi-to-low transition, 1.30 static void lower_pressure( LRG *lrg, uint where, Block *b, uint *pressure, uint *hrp_index ) { 1.31 - if( lrg->mask().is_UP() && lrg->mask_size() ) { 1.32 - if( lrg->_is_float ) { 1.33 + if (lrg->mask().is_UP() && lrg->mask_size()) { 1.34 + if (lrg->_is_float || lrg->_is_vector) { 1.35 pressure[1] -= lrg->reg_pressure(); 1.36 if( pressure[1] == (uint)FLOATPRESSURE ) { 1.37 hrp_index[1] = where; 1.38 @@ -522,8 +523,8 @@ 1.39 LRG &lrg = lrgs(lidx); 1.40 lrg._area += cost; 1.41 // Compute initial register pressure 1.42 - if( lrg.mask().is_UP() && lrg.mask_size() ) { 1.43 - if( lrg._is_float ) { // Count float pressure 1.44 + if (lrg.mask().is_UP() && lrg.mask_size()) { 1.45 + if (lrg._is_float || lrg._is_vector) { // Count float pressure 1.46 pressure[1] += lrg.reg_pressure(); 1.47 #ifdef EXACT_PRESSURE 1.48 if( pressure[1] > b->_freg_pressure ) 1.49 @@ -681,13 +682,10 @@ 1.50 // according to its bindings. 1.51 const RegMask &rmask = lrgs(r).mask(); 1.52 if( lrgs(r).is_bound() && !(n->rematerialize()) && rmask.is_NotEmpty() ) { 1.53 - // Smear odd bits; leave only aligned pairs of bits. 1.54 - RegMask r2mask = rmask; 1.55 - r2mask.SmearToPairs(); 1.56 // Check for common case 1.57 int r_size = lrgs(r).num_regs(); 1.58 OptoReg::Name r_reg = (r_size == 1) ? rmask.find_first_elem() : OptoReg::Physical; 1.59 - 1.60 + // Smear odd bits 1.61 IndexSetIterator elements(&liveout); 1.62 uint l; 1.63 while ((l = elements.next()) != 0) { 1.64 @@ -701,10 +699,15 @@ 1.65 // Remove the bits from LRG 'r' from LRG 'l' so 'l' no 1.66 // longer interferes with 'r'. If 'l' requires aligned 1.67 // adjacent pairs, subtract out bit pairs. 1.68 - if( lrg.num_regs() == 2 && !lrg._fat_proj ) { 1.69 + assert(!lrg._is_vector || !lrg._fat_proj, "sanity"); 1.70 + if (lrg.num_regs() > 1 && !lrg._fat_proj) { 1.71 + RegMask r2mask = rmask; 1.72 + // Leave only aligned set of bits. 1.73 + r2mask.smear_to_sets(lrg.num_regs()); 1.74 + // It includes vector case. 1.75 lrg.SUBTRACT( r2mask ); 1.76 lrg.compute_set_mask_size(); 1.77 - } else if( r_size != 1 ) { 1.78 + } else if( r_size != 1 ) { // fat proj 1.79 lrg.SUBTRACT( rmask ); 1.80 lrg.compute_set_mask_size(); 1.81 } else { // Common case: size 1 bound removal 1.82 @@ -763,8 +766,8 @@ 1.83 // Newly live things assumed live from here to top of block 1.84 lrg._area += cost; 1.85 // Adjust register pressure 1.86 - if( lrg.mask().is_UP() && lrg.mask_size() ) { 1.87 - if( lrg._is_float ) { 1.88 + if (lrg.mask().is_UP() && lrg.mask_size()) { 1.89 + if (lrg._is_float || lrg._is_vector) { 1.90 pressure[1] += lrg.reg_pressure(); 1.91 #ifdef EXACT_PRESSURE 1.92 if( pressure[1] > b->_freg_pressure )