Skip to content

Commit 3dd0a89

Browse files
committed
[X86] Add a check for SSE2 to the top of combineReductionToHorizontal.
Without this, we can create a PSADBW node that isn't legal.
1 parent e6c145e commit 3dd0a89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36266,6 +36266,10 @@ static SDValue combineReductionToHorizontal(SDNode *ExtElt, SelectionDAG &DAG,
3626636266
const X86Subtarget &Subtarget) {
3626736267
assert(ExtElt->getOpcode() == ISD::EXTRACT_VECTOR_ELT && "Unexpected caller");
3626836268

36269+
// We need at least SSE2 to anything here.
36270+
if (!Subtarget.hasSSE2())
36271+
return SDValue();
36272+
3626936273
ISD::NodeType Opc;
3627036274
SDValue Rdx =
3627136275
DAG.matchBinOpReduction(ExtElt, Opc, {ISD::ADD, ISD::FADD}, true);

0 commit comments

Comments
 (0)