diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-12-22 04:39:45 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-12-22 04:39:45 +0000 |
commit | 485dacd90caf3de27bcc0ac069915085ed8458be (patch) | |
tree | e2a781561edd0351f0e35d2f15ba2e7e76090747 /llvm/lib/CodeGen | |
parent | 3de76b9dc801ad986bfb872b4f794592966b2b8f (diff) | |
download | bcm5719-llvm-485dacd90caf3de27bcc0ac069915085ed8458be.tar.gz bcm5719-llvm-485dacd90caf3de27bcc0ac069915085ed8458be.zip |
DAG: Add helper for testing constant values
There are helpers for testing for constant or constant build_vector,
and for splat ConstantFP vectors, but not for a constantfp or
non-splat ConstantFP vector.
llvm-svn: 290317
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index d5a5bf8e22d..c80509caf05 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -7517,6 +7517,16 @@ SDNode *SelectionDAG::isConstantIntBuildVectorOrConstantInt(SDValue N) { return nullptr; } +SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) { + if (isa<ConstantFPSDNode>(N)) + return N.getNode(); + + if (ISD::isBuildVectorOfConstantFPSDNodes(N.getNode())) + return N.getNode(); + + return nullptr; +} + #ifndef NDEBUG static void checkForCyclesHelper(const SDNode *N, SmallPtrSetImpl<const SDNode*> &Visited, |