[llvm-commits] [PATCH] Emit andl instructions instead of andq instructions if possible

David Majnemer david.majnemer at gmail.com
Sun Dec 9 01:06:38 PST 2012


There are cases where LLVM chooses to emit andq instructions where an andl
instruction would suffice. The latter instruction is advantageous because
it is a single byte smaller.

LLVM already had entries in X86InstrCompiler.td to perform this
optimization, however another pattern was being preferred. The attached
patch increases the priorities of two patterns so that they will
be preferred is they match.

The attached patch passes all regressions and includes a test to verify
that the fix is working.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121209/54503794/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smaller-and.ll
Type: application/octet-stream
Size: 3649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121209/54503794/attachment.obj>


More information about the llvm-commits mailing list