Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 6928dfa

Browse files
committed
[X86] Teach combineShuffle to avoid creating floating point operations with integer types and integer operations with floating point types. Seems isOperationLegal lies for mismatched types and operations.
Fixes PR30511. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282341 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1e23cc8 commit 6928dfa

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

lib/Target/X86/X86ISelLowering.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26424,13 +26424,18 @@ static SDValue combineShuffle(SDNode *N, SelectionDAG &DAG,
2642426424
bool CanFold = false;
2642526425
switch (Opcode) {
2642626426
default : break;
26427-
case ISD::ADD :
26428-
case ISD::FADD :
26429-
case ISD::SUB :
26430-
case ISD::FSUB :
26431-
case ISD::MUL :
26432-
case ISD::FMUL :
26433-
CanFold = true;
26427+
case ISD::ADD:
26428+
case ISD::SUB:
26429+
case ISD::MUL:
26430+
// isOperationLegal lies for integer ops on floating point types.
26431+
CanFold = VT.isInteger();
26432+
break;
26433+
case ISD::FADD:
26434+
case ISD::FSUB:
26435+
case ISD::FMUL:
26436+
// isOperationLegal lies for floating point ops on integer types.
26437+
CanFold = VT.isFloatingPoint();
26438+
break;
2643426439
}
2643526440

2643626441
unsigned SVTNumElts = SVT.getVectorNumElements();

0 commit comments

Comments
 (0)