Skip to content

Commit

Permalink
[X86] Add a check for SSE2 to the top of combineReductionToHorizontal.
Browse files Browse the repository at this point in the history
Without this, we can create a PSADBW node that isn't legal.
  • Loading branch information
topperc committed Oct 25, 2019
1 parent e6c145e commit 3dd0a89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36266,6 +36266,10 @@ static SDValue combineReductionToHorizontal(SDNode *ExtElt, SelectionDAG &DAG,
const X86Subtarget &Subtarget) {
assert(ExtElt->getOpcode() == ISD::EXTRACT_VECTOR_ELT && "Unexpected caller");

// We need at least SSE2 to anything here.
if (!Subtarget.hasSSE2())
return SDValue();

ISD::NodeType Opc;
SDValue Rdx =
DAG.matchBinOpReduction(ExtElt, Opc, {ISD::ADD, ISD::FADD}, true);
Expand Down

0 comments on commit 3dd0a89

Please sign in to comment.