[PATCH] D119793: [SelectionDAG] Add SPLAT_VECTOR to SelectionDAG::isConstantFPBuildVectorOrConstantFP.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 15:53:14 PST 2022


craig.topper created this revision.
craig.topper added reviewers: efriedma, sdesmalen, frasercrmck.
Herald added subscribers: ecnelises, hiraditya.
craig.topper requested review of this revision.
Herald added a project: LLVM.

Matches what is done for the int version.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119793

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -11107,6 +11107,10 @@
   if (ISD::isBuildVectorOfConstantFPSDNodes(N.getNode()))
     return N.getNode();
 
+  if ((N.getOpcode() == ISD::SPLAT_VECTOR) &&
+      isa<ConstantFPSDNode>(N.getOperand(0)))
+    return N.getNode();
+
   return nullptr;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119793.408659.patch
Type: text/x-patch
Size: 480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220214/2289c6fe/attachment.bin>


More information about the llvm-commits mailing list