[DAGCombiner] fold select-of-constants to shift
This reverses the scalar canonicalization proposed in D63382.
Pre: isPowerOf2(C1)
%r = select i1 %cond, i32 C1, i32 0
=>
%z = zext i1 %cond to i32
%r = shl i32 %z, log2(C1)
https://rise4fun.com/Alive/Z50
x86 already tries to fold this pattern, but it isn't done
uniformly, so we still see a diff. AArch64 probably should
enable the TLI hook to benefit too, but that's a follow-on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374397
91177308-0d34-0410-b5e6-
96231b3b80d8