[DAGCombine] Mask doesn't have to be (EltSize - 1) exactly when combining rotation
authorwangpc <pc.wang@linux.alibaba.com>
Tue, 26 Jul 2022 13:11:39 +0000 (21:11 +0800)
committerwangpc <pc.wang@linux.alibaba.com>
Tue, 26 Jul 2022 13:14:45 +0000 (21:14 +0800)
commit1a7078d1064b4bac6a6b3ac66682b8a76852bf94
treeb7505ec5c71685e72ca5f3ae7186ef2bb87597b7
parent628fbbef81c5ac806e6dbf2bce18dd44980051b1
[DAGCombine] Mask doesn't have to be (EltSize - 1) exactly when combining rotation

I think what we need is the least Log2(EltSize) significant bits are known to be ones.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D130251
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/RISCV/rotl-rotr.ll