[PATCH] D25685: [DAG] use isConstOrConstSplat in ComputeNumSignBits to optimize SRA

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 10:01:32 PDT 2016


spatel created this revision.
spatel added reviewers: mkuper, RKSimon, efriedma.
spatel added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

This is the minimum patch needed to solve the missed SRA fold that was noted in:
https://reviews.llvm.org/D25485

and partially fixed with:
https://reviews.llvm.org/rL284395

Of course, we could move more of the related analysis functions in DAGCombiner that are currently static/local  to have a more unified approach.

Ie, move all of these (some were recently added in https://reviews.llvm.org/D25374)?
isConstantFPBuildVectorOrConstantFP
isConstOrConstSplatFP
isConstantOrConstantVector
isNullConstantOrNullSplatConstant
isOneConstantOrOneSplatConstant
isAllOnesConstantOrAllOnesSplatConstant

It's not clear to me exactly where the handling of undef elements is different and where that is intentional.


https://reviews.llvm.org/D25685

Files:
  include/llvm/CodeGen/SelectionDAGNodes.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  test/CodeGen/X86/sar_fold64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25685.74865.patch
Type: text/x-patch
Size: 4390 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161017/4bb34a9b/attachment.bin>


More information about the llvm-commits mailing list