[InstCombine] Transform `(shift X,Or(Y,BitWidth-1))` -> `(shift X,BitWidth-1)`
authorNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 7 Mar 2023 00:13:21 +0000 (18:13 -0600)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 7 Mar 2023 02:30:06 +0000 (20:30 -0600)
commit5a3d9e06170a8a8aadee4a6db1ed61732537d076
treec6852f5e2e571147feb817780a471d12a793e13c
parent9bb409ff1d0c21bca5981b9f3e0dbf668d320c3c
[InstCombine] Transform `(shift X,Or(Y,BitWidth-1))` -> `(shift X,BitWidth-1)`

shl : https://alive2.llvm.org/ce/z/_B7Qca
lshr: https://alive2.llvm.org/ce/z/6eXz_W
ashr: https://alive2.llvm.org/ce/z/oGEx-q

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D145326
llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
llvm/test/Transforms/InstCombine/shift.ll