Rather than checking for the SCEV type prior to calling getContantPart, perform the checks in the function. This reduces the number of places where the checks have been added.
This was a suggestion made during the review for http://reviews.llvm.org/D18718