[llvm-commits] [PATCH] Replace SUB with CMP if possible on X86

Manman Ren mren at apple.com
Wed May 30 13:55:27 PDT 2012


SUB with memory operand should not be optimized.
Updated patch is attached.

Manman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert_sub_to_cmp.patch
Type: application/octet-stream
Size: 4786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120530/9963fe4f/attachment.obj>
-------------- next part --------------

On May 30, 2012, at 11:44 AM, Manman Ren wrote:

> 
> Hi All,
> 
> This patch is to optimize generated code from
> 	movq	%rdi, %rax
> 	subq	%rsi, %rax
> 	cmovsq	%rsi, %rdi
> 	movq	%rdi, %rax
> 	
> to
> 	cmpq	%rsi, %rdi
> 	cmovsq	%rsi, %rdi
> 	movq	%rdi, %rax
> 
> The only criterion to perform this optimization is that the actual result of SUB is not used.
> 
> Thanks,
> Manman
> 
> <convert_sub_to_cmp.patch>



More information about the llvm-commits mailing list