[llvm-commits] [PATCH] Peephole optimization to remove redundant cmp instruction for X86

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu May 31 11:21:48 PDT 2012


On May 31, 2012, at 8:42 AM, Manman Ren <mren at apple.com> wrote:

>> Also, I wonder if the backend should have a model for equivalent instruction forms where one does set EFLAGS and the other doesn't so that we can flip instructions back and forth as needed.
>> 
> For X86, I don't know equivalent instruction pairs where one set EFLAGS and the other does not, like sub and subs for ARM.

We can turn MOV32r0 (which is an xor in disguise) into MOV32ri in X86InstrInfo::reMaterialize().

However, I don't think that is relevant to this patch. The flags coming out of 'xorl %eax, %eax' are not very interesting, and I can't imagine we would ever use them.

/jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120531/08c3a08b/attachment.html>


More information about the llvm-commits mailing list