[InstCombine] add helper function for shift-shift optimization (NFCI)
[InstCombine] add helper function for shift-shift optimization (NFCI)

This is step 2 of refactoring to solve PR26760:
https://llvm.org/bugs/show_bug.cgi?id=26760

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@265951 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 98198fca40e018b75fef3d156960cb1fe8b22498)

apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm