This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Speedup CSE by 5%


On Thu, 2005-01-27 at 16:57 -0700, Jeffrey A Law wrote:
> On Thu, 2005-01-27 at 18:33 -0500, Kazu Hirata wrote:
> 
> > 
> > In case you wonder where three occurrences in the MINUS case come
> > from, I've filed a PR 19643.
> FWIW, this is a trivial folder oversight.
And one that we really should fix.  We don't get a ton on the mainline
anymore because of the recent bitmap revamping.  But the old bitmap code
triggered this enough to make me believe that GCC isn't the only code
base that liked to do stuff like 0 % <something> on a regular basis due
to the implementation of EXECUTE_IF_SET_IN_BITMAP:

ancient/cfgcleanup.i:  do { bitmap_element *ptr_ = (nonequal)->first;
unsigned int indx_ = (0) / ((unsigned) (((128 + (8 * 4) - 1) / (8 * 4))
* (unsigned) (8 * 4))); unsigned bit_num_ = (0) % (unsigned) (8 * 4);
unsigned word_num_ = (0) / (unsigned) (8 * 4) % ((128 + (8 * 4) - 1) /
(8 * 4)); while (ptr_ != 0 && ptr_->indx < indx_) ptr_ = ptr_->next; if
(ptr_ != 0 && ptr_->indx != indx_) { bit_num_ = 0; word_num_ = 0; } for
(; ptr_ != 0; ptr_ = ptr_->next) { for (; word_num_ < ((128 + (8 * 4) -
1) / (8 * 4)); word_num_++) { BITMAP_WORD word_ = ptr_->bits[word_num_];
if (word_ != 0) { for (; bit_num_ < (unsigned) (8 * 4); bit_num_++)
{ BITMAP_WORD mask_ = ((BITMAP_WORD) 1) << bit_num_; if ((word_ &
mask_) != 0) { word_ &= ~ mask_; (i) = (ptr_->indx * ((unsigned) (((128
+ (8 * 4) - 1) / (8 * 4)) * (unsigned) (8 * 4))) + word_num_ *
(unsigned) (8 * 4) + bit_num_); goto failed_exit;; if (word_ == 0)
break; } } } bit_num_ = 0; } word_num_ = 0; } } while (0);


Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]