[llvm-commits] [PATCH] Update peephole optimization for ARM: modified OptimizeCompare
Stephen Canon
scanon at apple.com
Wed May 9 14:41:36 PDT 2012
Assuming that I understand what is really happening here[1], this does not suffer from the problem that caused <rdar://problem/11081762> and is safe. That said, a little more clarity about exactly what you're optimizing would be helpful for those playing along at home, Manman.
- Steve
1) based on a conversation with Evan, my understanding is that we're looking at a peephole transformation to replace something like:
sub r0, r1, r3
cmp r1, r3
with
subs r0, r1, r3
-- is that correct, manman?
On May 9, 2012, at 2:04 PM, Jim Grosbach <grosbach at apple.com> wrote:
> Hi Manman,
>
> There are subtleties here. See <rdar://problem/11081762>.
>
> -Jim
>
> On May 8, 2012, at 6:05 PM, Manman Ren wrote:
>
>>
>> The purpose is to optimize the following cases:
>> // sub r1, r3
>> // cmp r3, r1 or cmp r1, r3
>> // bge L1
>>
>> // sub r1, imm
>> // cmp r1, imm
>> // bge L1
>>
>> // If the branch instruction can use flag from "sub", then we can eliminate
>> // the "cmp" instruction.
>>
>>
>> Comments are welcome.
>>
>> Thanks,
>> Manman
>> <peephole_sub_cmp.patch>_______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list