diff options
author | Manman Ren <mren@apple.com> | 2012-06-07 22:39:10 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2012-06-07 22:39:10 +0000 |
commit | 2cdc8afccf10218189bc653bcd5ba368e2f9bdaa (patch) | |
tree | dd7f7923803cb4034399980e2b75722272aa6072 /clang/lib/Basic/SourceManager.cpp | |
parent | cb8cf4916f80d933181f85ea8b6d6738c3e3319e (diff) | |
download | llvm-2cdc8afccf10218189bc653bcd5ba368e2f9bdaa.zip llvm-2cdc8afccf10218189bc653bcd5ba368e2f9bdaa.tar.gz llvm-2cdc8afccf10218189bc653bcd5ba368e2f9bdaa.tar.bz2 |
X86: optimize generated code for integer ABS
This patch will generate the following for integer ABS:
movl %edi, %eax
negl %eax
cmovll %edi, %eax
INSTEAD OF
movl %edi, %ecx
sarl $31, %ecx
leal (%rdi,%rcx), %eax
xorl %ecx, %eax
There exists a target-independent DAG combine for integer ABS, which converts
integer ABS to sar+add+xor. For X86, we match this pattern back to neg+cmov.
This is implemented in PerformXorCombine.
rdar://10695237
llvm-svn: 158175
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions