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

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 10:19:03 PDT 2016

RKSimon added a comment.

I agree that all those similar predicates is a bit of pain!

We have issues with handling whether we permit opaque constants and whether UNDEF elements are allowable.

Comment at: include/llvm/CodeGen/SelectionDAGNodes.h:1419
+/// Returns the SDNode if it is a constant splat BuildVector or constant int.
+ConstantSDNode *isConstOrConstSplat(SDValue N);
Might this be a good time to add an 'AllowUndefs' argument so that we permit cases where there is at least one ConstantSDNode in the splat but other elements can be UNDEF.


More information about the llvm-commits mailing list