[LLVMdev] getTripCount requires which optimization passes?

Trevor Harmon Trevor.W.Harmon at nasa.gov
Thu May 6 17:59:17 PDT 2010


Hi,

For me, getTripCount always returns null, even for trivial loops such  
as:

void simple(int j) {
     for (int i = 0; i < 10; i++) {
         j++;
     }
}

Looking through the mailing list archive, it appears that getTripCount  
requires certain optimization passes to run first, but it's not clear  
which ones. There doesn't seem to be any documentation on this. Does  
anybody know exactly which passes must run in order for getTripCount  
to work?

Thanks,

Trevor




More information about the llvm-dev mailing list