[SCCP] convert ashr to lshr for non-negative shift value
authorSanjay Patel <spatel@rotateright.com>
Thu, 15 Sep 2022 17:42:30 +0000 (13:42 -0400)
committerSanjay Patel <spatel@rotateright.com>
Thu, 15 Sep 2022 17:54:52 +0000 (13:54 -0400)
commitaafaa2f4fc52a132321e02683ea0d8f7ec190490
tree3419b0f3f904e9c6053861c1ff4b5ad1d1defd61
parent204a2fff1f1837d3072726d2ef32a125b4f8d7c1
[SCCP] convert ashr to lshr for non-negative shift value

This is similar to the existing signed instruction folds.
We get the obvious minimal patterns in other passes, but
this avoids potential missed folds when the multi-block
tests are converted to selects.
llvm/lib/Transforms/Scalar/SCCP.cpp
llvm/test/Transforms/SCCP/ashr.ll