[Info-vax] C compiler stuff (Re: Anyone still around ? :-))

Craig A. Berry craigberry at nospam.mac.com
Wed Oct 9 20:07:27 EDT 2019


On 10/8/19 9:19 AM, osuvman50 at gmail.com wrote:
> I was considering making a post about the failure of the C compiler's optimizer
> to recognize and optimize the pattern:
> 
>       choice = permutation % (CARDS_IN_DECK-i);
>       permutation = permutation / (CARDS_IN_DECK-i);
> 
> but didn't think I'd get any constructive responses. (refactoring to eliminate a
> divide makes the whole program run 18% faster on both alpha and IA64).

I have been pleasantly surprised by responses here to complaints about C
and CRTL stuff since development moved to VSI.  You might be too.

For your particular complaint, do you have evidence that other compilers
do this optimization?  If so, which ones?  It may make a difference
where the optimization happens.  If the LLVM back end would already do
this on x86 despite the GEM-alike front end, then it's hard to see why
VSI would make it a priority to change in the existing GEM compilers.
On the other hand, if it's something that needs to happen before things
get to LLVM IR, then it might be a reasonable enhancement request for
all platforms.




More information about the Info-vax mailing list