From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott A Crosby To: Joern Rennecke Cc: hubicka@atrey.karlin.mff.cuni.cz, egcs@cygnus.com Subject: Re: Benchmark suite... Date: Wed, 11 Nov 1998 19:15:00 -0000 Message-id: References: <199811050731.HAA25613@phal.cygnus.co.uk> X-SW-Source: 1998-11/msg00563.html On Thu, 5 Nov 1998, Joern Rennecke wrote: > > Another micro-benchmark to measure how well the compiler performs register > > assignment: > > > > // Test register assignment, passing reg_assignXX an array of XX values. > > reg_assign1_8(int *a, int *b) > > b[0] = 1*a[1] + 2*a[2] + 3*a[3] + 4*a[4] .... 7*a[7]; > > b[1] = 0*a[0] + 1*a[2] + 2*a[3] .... 6*a[7]; > > .. > > .. > > b[7] = 0*a[0] + ... + 1*a[7]; > > } > > > > Here, the constants in the right hand sides were chosen so that a simple > > CSE would not work well on them, so this would test how well the compiler > > performs register assignment.. (It could also test a much more advanced > > CSE that could simplify this.) Again, a list of functons reg_assign1_16(), > > reg_assign1_32(), are created... > > This does not work. a and b can be aliased. > Whoops.. :-) How about: // Test register assignment, passing reg_assignXX an array of XX values. reg_assign1_8(int *a) { b = a; a = a+10; b[0] = 1*a[1] + 2*a[2] + 3*a[3] + 4*a[4] .... 7*a[7]; b[1] = 0*a[0] + 1*a[2] + 2*a[3] .... 6*a[7]; .. .. b[7] = 0*a[0] + ... + 1*a[7]; }