[llvm-commits] PATCH: Improve canonical combining of shifts

Chandler Carruth chandlerc at gmail.com
Sun Jan 15 03:14:11 PST 2012


Hello,

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.

This is the first break-out patch of an earlier patch that tried to do make
several extensions to shift canonicalization.

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.

This patch has passed both the regression test suite and a self-host.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120115/aa6afb82/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shift-combine1.patch
Type: text/x-patch
Size: 8440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120115/aa6afb82/attachment.bin>


More information about the llvm-commits mailing list