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

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Sat Sep 17 14:12:07 PDT 2011


Hi Ana,

On Fri, Sep 16, 2011 at 10:12 AM, Ana Pazos <apazos at codeaurora.org> wrote:
> 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.

It seems that you have sent the same message again, are the patches
the same too? If they are, could you please follow Eli's and Evan's
comments and resend the patch?
Thanks

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc




More information about the llvm-commits mailing list