[SelectionDAG] Correctly determine the VECREDUCE_SEQ_FMUL action
authorFraser Cormack <fraser@codeplay.com>
Wed, 4 Aug 2021 16:38:27 +0000 (17:38 +0100)
committerFraser Cormack <fraser@codeplay.com>
Thu, 5 Aug 2021 08:42:33 +0000 (09:42 +0100)
The LegalizeAction for this node should follow the logic for
`VECREDUCE_SEQ_FADD` and be determined using the vector operand's type.

here isn't an in-tree target that makes use of this, but I think it's safe to
say this is how it should behave, should a target want to customize the action
for this node.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D107478

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index d92b23f..2732c96 100644 (file)
@@ -1181,6 +1181,7 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
         Node->getOpcode(), Node->getOperand(0).getValueType());
     break;
   case ISD::VECREDUCE_SEQ_FADD:
+  case ISD::VECREDUCE_SEQ_FMUL:
     Action = TLI.getOperationAction(
         Node->getOpcode(), Node->getOperand(1).getValueType());
     break;