[llvm-commits] LLVM patch to optimize integer ABS idiom for ARM target

Ana Pazos apazos at codeaurora.org
Fri Sep 16 10:12:05 PDT 2011


Hello,

 

I worked on an LLVM patch to optimize integer ABS idiom for the ARM target
and would like to submit it to your review.

 

I experimented with EEMBC benchmarks, in particular MPEG encoding, and noted
integer ABS computation happens frequently. Significant speed up was
achieved with the  optimized idiom for ARM (20% for MPEG encoding).

 

Patch details:

 

LLVM lowers SELECT_CC nodes that represent an integer ABS pattern into
ASR/ADD/XOR instructions. 

 

It is possible to create an optimized machine idiom for integer ABS on ARM
formed by MOVs/RSBmi predicated instructions.

 

This patch modifies ARM-specific files to implement the above optimized
machine idiom for integer ABS.

 

Generation of the optimized integer ABS idiom is turned on by default. To
turn this feature off set -disable-arm-int-abs feature flag.

 

abspatch.diff 

Changes to ARM-specific files to implement optimized integer ABS idiom.

 

abstestpatch.diff 

ARM/iabs.ll and Thumb/iabs.ll tests check for the non-optimized integer ABS
idiom (ASR/ADD/XOR).

When applying abspatch.diff these tests fail. So patched the tests to set
-disable-arm-int-abs flag to prevent the compiler from generating optimized
integer ABS pattern and allow the non-optimized idiom to be checked.

 

iabsopt.ll 

Similar to ARM/iabs.ll and Thumb/iabs.ll tests except that it checks for the
optimized integer ABS idiom and checks for all possible test conditions.

 

failures.txt

Failure report and explanation from running llvm/test and
projects/test-suite on ARM.

I noted failures running llvm/test (svn version 139318) and
projects/test-suite (svn revision 139319) on ARM. Are these failures
expected?

 

Thank you,

Ana.

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110916/37836d34/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abspatch.diff
Type: application/octet-stream
Size: 6964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110916/37836d34/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abstestpatch.diff
Type: application/octet-stream
Size: 849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110916/37836d34/attachment-0001.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: failures.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110916/37836d34/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iabsopt.ll
Type: application/octet-stream
Size: 1573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110916/37836d34/attachment-0002.obj>


More information about the llvm-commits mailing list