This is the mail archive of the gcc@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: GCC-4.5.0 comparison with previous releases and LLVM-2.7 on SPEC2000 for x86/x86_64


> On Sun, May 2, 2010 at 6:45 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> That depends. The following cases exist in vortex:
> 
> 1) the value is runtime constant -- it is read from input file but
> never changed -- e.g.: QueBug. Nothing can be done by the compiler in
> this case;
> 
> 2) Global variable written only once in the program, e.g
> StrucAlignment.   Compiler needs to prove that the definition
> dominates (interprocedurally) all uses. Sjeng has similar cases.
> 
> 3) The simplest case -- global variable only initialized statically
> and never written in the program -- compiler should be able to
> recognize it.
We handle this in ipa-reference already.
> 
> 4) Local variable with known constant value sets -- AllocSize -- can
> be handled by compiler with the help of static prediction.

Yep, I was basically interested if vortex case is 1) or not.  I am thinking
about extending my ipa-ref collecting code to collect list of known constants
variable is initialized with and feed it into some local optimization passes
(value range profiling is good case) as well as implement expansion for
division and modulo to something like:

switch (divisor)
{
  case known_cst1:
    res = a/known_cst1;
  case known_cst2:
    res = a/known_cst2;
...
}

special casing 0 as impossible value.  I know this can handle well parser in
spec2000, but I am curious if it is worth the (relatively little) effort to 
implement this.

Given how easy is to get this done, I guess I will do so.
Also ipa-cp can be extended to handle static vars used in function as parameters
and propagate across them that can get some of this with flow sensitivity.

Honza


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