[RISCV] Teach targetShrinkDemandedConstant to preserve (and X, 0xffffffff).
authorCraig Topper <craig.topper@sifive.com>
Thu, 25 Mar 2021 06:23:16 +0000 (23:23 -0700)
committerCraig Topper <craig.topper@sifive.com>
Thu, 25 Mar 2021 16:03:25 +0000 (09:03 -0700)
commitc40cea6f083a8a67ea950e058e16d37bb04e8c4b
tree4783797402320e59db2eb51aa99bb27384b3dd68
parentf5349922c06fec0feec53f9eab90aaaa5fe6ed17
[RISCV] Teach targetShrinkDemandedConstant to preserve (and X, 0xffffffff).

We look for this pattern frequently in isel patterns so its a
good idea to try to preserve it.

This also let's us remove our special isel handling for srliw
and use a direct pattern match of (srl (and X, 0xffffffff), C)
since no bits will be removed from the and mask.

Differential Revision: https://reviews.llvm.org/D99042
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/alu32.ll
llvm/test/CodeGen/RISCV/rv64zba.ll