[DAGCombine] Improve (sra (sra x, c1), c2) -> (sra x, (add c1, c2)) folding
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 17 Aug 2018 10:52:49 +0000 (10:52 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 17 Aug 2018 10:52:49 +0000 (10:52 +0000)
commit5113b48798f99b569697ce39406ca7d484ffd9a1
tree922e1f4b0afc6219501fcca47039a44424bc7d15
parent24d3492aee82542dcce50702494ecc9210b93c89
[DAGCombine] Improve (sra (sra x, c1), c2) -> (sra x, (add c1, c2)) folding

Add support for cases where only some c1+c2 results exceed the max bitshift, clamping accordingly.

Differential Revision: https://reviews.llvm.org/D35722

llvm-svn: 340010
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/combine-sra.ll