Add lshr (sext i1 X to iN), C --> select (X, -1 >> C, 0) case. This expands
C == N-1 case to arbitrary C.
Fixes PR52078
Differential D111330
[InstCombine] Support arbitrary const shift amount for `lshr (sext i1 ...)` anton-afanasyev on Oct 7 2021, 11:59 AM. Authored by
Details Add lshr (sext i1 X to iN), C --> select (X, -1 >> C, 0) case. This expands Fixes PR52078
Diff Detail
Event TimelineComment Actions Can you add the instcombine tests to the file(s) where the existing transform's tests are ("lshr.ll")? It's easier to see the variations that we handle in one look that way.
Comment Actions LGTM - see inline test comments.
|
We don't need the shouldChangeType restriction for the fold to select / zext, do we?
(I'm not sure that we need it for the fold that creates a shift either; that was conservatively added back in D33879.)