[X86] Prevent (bitcast (broadcast_load)) combine from producing vXf16 broadcast instructions.

The combine tries to put the broadcast in either the integer or
fp domain to match the bitcast domain. But we can only do this
if the broadcast size is 32 or larger.
This commit is contained in:
Craig Topper 2020-03-20 08:57:28 -07:00
parent ce5173c0e1
commit 32fbea1548
1 changed files with 15 additions and 12 deletions

View File

@ -37385,6 +37385,8 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG,
auto *BCast = cast<MemIntrinsicSDNode>(N0); auto *BCast = cast<MemIntrinsicSDNode>(N0);
unsigned SrcVTSize = SrcVT.getScalarSizeInBits(); unsigned SrcVTSize = SrcVT.getScalarSizeInBits();
unsigned MemSize = BCast->getMemoryVT().getScalarSizeInBits(); unsigned MemSize = BCast->getMemoryVT().getScalarSizeInBits();
// Don't swap i8/i16 since don't have fp types that size.
if (MemSize >= 32) {
MVT MemVT = VT.isFloatingPoint() ? MVT::getFloatingPointVT(MemSize) MVT MemVT = VT.isFloatingPoint() ? MVT::getFloatingPointVT(MemSize)
: MVT::getIntegerVT(MemSize); : MVT::getIntegerVT(MemSize);
MVT LoadVT = VT.isFloatingPoint() ? MVT::getFloatingPointVT(SrcVTSize) MVT LoadVT = VT.isFloatingPoint() ? MVT::getFloatingPointVT(SrcVTSize)
@ -37399,6 +37401,7 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG,
DAG.ReplaceAllUsesOfValueWith(SDValue(BCast, 1), ResNode.getValue(1)); DAG.ReplaceAllUsesOfValueWith(SDValue(BCast, 1), ResNode.getValue(1));
return DAG.getBitcast(VT, ResNode); return DAG.getBitcast(VT, ResNode);
} }
}
// Since MMX types are special and don't usually play with other vector types, // Since MMX types are special and don't usually play with other vector types,
// it's better to handle them early to be sure we emit efficient code by // it's better to handle them early to be sure we emit efficient code by