Hello,<div><br></div><div>Attached is a patch which improves the canonicalizing logic for shifts. The caution taken in this transform to track the high bit doesn't appear to be necessary. See the patch and the proposed commit message for details. I'm looking at getting some of the math behind this into the comments as well, but I'd like to make some more cleanups first. All credit for getting the math here nicely explained and reasoned about goes to Richard Smith. =] I did the easy part of deleting lines of code.</div>
<div><br></div><div>This is the first break-out patch of an earlier patch that tried to do make several extensions to shift canonicalization.</div><div><br></div><div>I've also extended the shift-combine tests to be much more comprehensive, checking the various forms this transform is supposed to apply to. Notably, arithmetic shift right transforms are tested as they now get canonicalized in the expected way.</div>
<div><br></div><div>This patch has passed both the regression test suite and a self-host.</div>