[llvm-commits] [Patch] Teach SimplifySetCC that comparing AssertZext i1 against 1 can be rewritten as a compare against 0

Craig Topper craig.topper at gmail.com
Tue Dec 18 21:08:54 PST 2012


This patch teachs SimplifySetCC that an AssertZext from i1 compared against
1 can be rewritten to compare against 0 with the opposite condition. This
allows X86 to use test %al, %al instead of cmp $1, %al. In particular, when
branching on the result of a function that returns a bool as seen in the
included test case.

-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121218/ba0edde2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assertzext.patch
Type: application/octet-stream
Size: 2174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121218/ba0edde2/attachment.obj>


More information about the llvm-commits mailing list