I tried the analysis on the MatMul example, but the algorithm of http://stackoverflow.com/questions/13834364/how-to-get-loop-bounds-in-llvm did not return any trip count for any of the loops in MatMul using LLVM 3.4.2, which is quite old (complete sample analysis is here: https://github.com/analysis-examples/trip-counter), even if the bitcode input has been processed by mem2reg, as suggested here:https://groups.google.com/forum/#!topic/llvm-dev/1oNNBPMSqBg
I have not tried InnerLoopVectorizer::getOrCreateTripCount(), which is not there in LLVM 3.4.2.
I suppose I should first try using the latest LLVM release, but atm I'm having problems accessing llvm.org for download.
For the paper on SCEV, I have read
O. Bachmann, P. S. Wang, and E. V. Zima. Chains of recurrences–to expedite the
evaluation of closed-form functions. In ISSAC ’94, pages 242–249. ACM, July 1994.