> That's all fine, but I think you may not have got my point. Any if-then-else
> at the Java source level will contain 1 forward branch. I don't see why we
I agree. Static prediction in hardware is equally as arbitrary. This
profile information. Trying to carry around that a branch prediction
wasn't from a profile would be quite a mess. My understanding is that
> Ian Rogers <
ian.rogers@...> wrote on 01/29/2009 10:05:09 AM:
>
>> [image removed]
>>
>> Re: [rvm-core] [rvm-commits] SF.net SVN: jikesrvm:[15303] rvmroot/
>> branches/RVM-658-Quarantine/rvm/src
>>
>> Ian Rogers
>>
>> to:
>>
>> Discussion of day-to-day development and design among JikesRVM core
>> team members
>>
>> 01/29/2009 10:10 AM
>>
>> Please respond to Discussion of day-to-day development and design
>> among JikesRVM core team members
>
>>
>> 2009/1/29 David P Grove <
groved@...>:
>> > Doesn't this cause us to bias basic if-then-else blocks as if they were
>> > loops? I'd suggest rather than playing with the static prediction here
>> > it
>> > would make more sense to tune the thresholds for cmov conversion.
>> >
>> > --dave
>>
>> I'd like to see what the change to performance is. Currently we
>> statically predict that backward branches are taken 90% of the time
>> and forward branches 50% of the time. We want to use cmovs when the
>> probability is about 50% (currently 33% to 66% - 1% to 99% in 3.0.1)
>> according to Intel's optimization guide. This change predicts forward
>> branches are less likely (10%) and therefore means we don't create
>> cmovs for unprofiled branches. Predicting forward branches aren't
>> taken is common in hardware. I can't find any reference for Java. For
>> C there are some simple heuristics based on negative values in a
>> compare usually implying errors (and therefore that forward branches
>> should be predicted taken), that in Java would be less likely to hold
>> due to the use of exceptions.
>>
>> NB. the change was prompted by seeing the read barrier in x86 code in
>> Steve/Tony's barriers friend or foe paper. Instead of testing the
>> overhead for the branch predictor the work tests the overhead of cmov.
>> Not only is the generated x86 code an inefficient implementation of
>> the cmov, almost certainly read barriers should be proper compare and
>> branch sequences.
>>
>> Regards,
>> Ian
>>
>> >
captain5050@... wrote on 01/29/2009 09:16:59 AM:
>> >
>> >>
>> >> Log Message:
>> >> -----------
>> >> Make static branch prediction values configurable. Change static
>> >> prediction of forward bracnhes value to 10% rather than 50% thereby
>> >> preventing such branches becoming conditional moves.
>> >>
>> >> Modified Paths:
>> >> --------------
>> >> rvmroot/branches/RVM-658-Quarantine/rvm/src/org/jikesrvm/
>> >> compilers/opt/bc2ir/GenerationContext.java
>> >> rvmroot/branches/RVM-658-Quarantine/rvm/src-generated/options/
>> >> ValueOptions.opt.dat
>> >>
>> >> Modified: rvmroot/branches/RVM-658-Quarantine/rvm/src/org/jikesrvm/
>> >> compilers/opt/bc2ir/GenerationContext.java
>> >> ===================================================================
>> >> --- rvmroot/branches/RVM-658-Quarantine/rvm/src/org/jikesrvm/
>> >> compilers/opt/bc2ir/GenerationContext.java 2009-01-29 13:29:47 UTC
>> >> (rev 15302)
>> >> +++ rvmroot/branches/RVM-658-Quarantine/rvm/src/org/jikesrvm/
>> >> compilers/opt/bc2ir/GenerationContext.java 2009-01-29 14:16:59 UTC
>> >> (rev 15303)
>> >> @@ -616,9 +616,9 @@
>> >> BranchProfile bp = branchProfiles.getEntry(bcIndex);
>> >> prob = ((ConditionalBranchProfile) bp).getTakenProbability();
>> >> } else if (backwards) {
>> >> - prob = 0.9f;
>> >> + prob = options.PROFILE_BACKWARD_BRANCH_PROB;
>> >> } else {
>> >> - prob = 0.5f;
>> >> + prob = options.PROFILE_FORWARD_BRANCH_PROB;
>> >> }
>> >> // experimental option: flip the probablity to see how bad
>> >> things would be if
>> >> // we were completely wrong.
>> >>
>> >> Modified: rvmroot/branches/RVM-658-Quarantine/rvm/src-generated/
>> >> options/ValueOptions.opt.dat
>> >> ===================================================================
>> >> --- rvmroot/branches/RVM-658-Quarantine/rvm/src-generated/options/
>> >> ValueOptions.opt.dat 2009-01-29 13:29:47 UTC (rev 15302)
>> >> +++ rvmroot/branches/RVM-658-Quarantine/rvm/src-generated/options/
>> >> ValueOptions.opt.dat 2009-01-29 14:16:59 UTC (rev 15303)
>> >> @@ -45,6 +45,14 @@
>> >> Threshold at which a conditional branch is considered to be skewed
>> >>
>> >>
>> >> +V PROFILE_FORWARD_BRANCH_PROB float 0.1f
>> >> +Static probability an unknown forward branch will be taken
>> >> +
>> >> +
>> >> +V PROFILE_BACKWARD_BRANCH_PROB float 0.9f
>> >> +Static probability an unknown backward branch will be taken
>> >> +
>> >> +
>> >> V ESCAPE_MAX_ARRAY_SIZE int 5
>> >> Maximum size of array to replaced with registers by simple escape
>> >> analysis
>> >>
>> >>
>> >>
>> >> This was sent by the SourceForge.net collaborative development
>> >> platform, the world's largest Open Source development site.
>> >>
>> >>
>> >>
>>
>> ------------------------------------------------------------------------------
>> >> This SF.net email is sponsored by:
>> >> SourcForge Community
>> >> SourceForge wants to tell your story.
>> >>
http://p.sf.net/sfu/sf-spreadtheword>> >> _______________________________________________
>> >> Jikesrvm-commits mailing list
>> >>
Jikesrvm-commits@...
>> >>
https://lists.sourceforge.net/lists/listinfo/jikesrvm-commits>> >
>> >
>>
>> ------------------------------------------------------------------------------
>> > This SF.net email is sponsored by:
>> > SourcForge Community
>> > SourceForge wants to tell your story.
>> >
http://p.sf.net/sfu/sf-spreadtheword>> > _______________________________________________
>> > Jikesrvm-core mailing list
>> >
Jikesrvm-core@...
>> >
https://lists.sourceforge.net/lists/listinfo/jikesrvm-core>> >
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> SourcForge Community
>> SourceForge wants to tell your story.
>>
http://p.sf.net/sfu/sf-spreadtheword>> _______________________________________________
>> Jikesrvm-core mailing list
>>
Jikesrvm-core@...
>>
https://lists.sourceforge.net/lists/listinfo/jikesrvm-core>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
>
http://p.sf.net/sfu/sf-spreadtheword> _______________________________________________
> Jikesrvm-core mailing list
>
Jikesrvm-core@...
>
https://lists.sourceforge.net/lists/listinfo/jikesrvm-core>
>