[PATCH] Added instcombine for 'ABS(ABS(X)) -> ABS(X)'

Dinesh Dwivedi dinesh.d at samsung.com
Wed May 7 12:53:37 PDT 2014


Hi nadav, chandlerc, rafael,

Tried implementing SPF_ABS and instcombine for ABS(ABS(X))

I left ABS(-X) -> ABS(X) from TODO comment because it was not
reducing instructions count. For calculating ABS(X), it generate 
instruction to negate X for select instruction.

http://reviews.llvm.org/D3658

Files:
  lib/Transforms/InstCombine/InstCombine.h
  lib/Transforms/InstCombine/InstCombineSelect.cpp
  test/Transforms/InstCombine/select.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3658.9187.patch
Type: text/x-patch
Size: 4120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140507/5ecf2625/attachment.bin>


More information about the llvm-commits mailing list