how to let loop induction variable count down

Hi all!
I am new to llvm, writing a backend.

The documentation for -indvars ( says:
'Additionally, on targets where it is profitable, the loop could be transformed to count down to zero (the "do loop" optimization). '

Does this mean that

void fn(void) {
   volatile int temp;
   int i;

   for(i = 0; i != 100; ++i) {
     temp = 99 - i;

can be optimized to

void fn(void) {
   volatile int temp;
   int i = 100;

   while(--i >= 0) {
     temp = i;


This "do loop" optimization would be profitable for my target, so how is it performed?
Is there another pass available or an option for the command line?
Or do I have to write this pass by myself?