HomePhabricator

[RISCV] Teach targetShrinkDemandedConstant to preserve (and X, 0xffffffff).

Authored by craig.topper on Mar 24 2021, 11:23 PM.

Description

[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