[PATCH] D48754: recognize more abs pattern

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 3 21:40:31 PDT 2018


shchenz updated this revision to Diff 154047.
shchenz added a comment.

@spatel  Hi Sanjay, thanks for your comments. After investigation, I split this task into three parts:
1: find more abs pattern in matchSelectPattern and do canonicalization for abs/nabs pattern. (cmp + select). This is what this patch doing.
2: recognize ISD::ABS in selectionDAGBuilder to leverage platform abs instruction. (https://bugs.llvm.org/show_bug.cgi?id=36036). This will be done in next patch.
3: if no platform abs instructions, recognize canonicalized abs pattern (cmp + select) to shift + add + xor in DAGCombiner. This will be done in third patch.

What do you think about above proposal? And could you please help to do another review for this patch? Thanks.


https://reviews.llvm.org/D48754

Files:
  llvm/include/llvm/Analysis/ValueTracking.h
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/abs-1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48754.154047.patch
Type: text/x-patch
Size: 6428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180704/9d8a7ad1/attachment.bin>


More information about the llvm-commits mailing list