1. [DAGCombiner] fold select-of-constants to shift (details)
Commit 7b904ce7246b7cde2d716eefafd4ef2ce2b3234a by spatel
[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)
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.
llvm-svn: 374397
The file was modifiedllvm/test/CodeGen/X86/selectcc-to-shiftand.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp