This is a fix for PR25543:
https://llvm.org/bugs/show_bug.cgi?id=25543
The idea is to take the existing fold of:
bitcast ( trunc ( lshr ( bitcast X))) --> extractelement (bitcast X)
( http://reviews.llvm.org/rL112232 )
And break it into 2 less specific transforms so we'll catch more cases such as the example in the bug report:
bitcast ( trunc ( lshr ( bitcast X))) --> bitcast ( extractelement (bitcast X)) --> extractelement (bitcast X)
D14879 handles the 2nd transform: folding of bitcasts around the extractelement.