mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
[x86] look through bitcast operand of MOVMSK
This is not exactly NFC because it should make further combines of MOVMSK easier to match, but there should be no outward differences because we have isel patterns in place specifically to allow this. See: // Also support integer VTs to avoid a int->fp bitcast in the DAG. llvm-svn: 357128
This commit is contained in:
parent
91e0aa1c0c
commit
d986d4473c
@ -40900,7 +40900,7 @@ static SDValue combineMOVMSK(SDNode *N, SelectionDAG &DAG,
|
|||||||
|
|
||||||
// Perform constant folding.
|
// Perform constant folding.
|
||||||
if (ISD::isBuildVectorOfConstantSDNodes(Src.getNode())) {
|
if (ISD::isBuildVectorOfConstantSDNodes(Src.getNode())) {
|
||||||
assert(VT== MVT::i32 && "Unexpected result type");
|
assert(VT == MVT::i32 && "Unexpected result type");
|
||||||
APInt Imm(32, 0);
|
APInt Imm(32, 0);
|
||||||
for (unsigned Idx = 0, e = Src.getNumOperands(); Idx < e; ++Idx) {
|
for (unsigned Idx = 0, e = Src.getNumOperands(); Idx < e; ++Idx) {
|
||||||
if (!Src.getOperand(Idx).isUndef() &&
|
if (!Src.getOperand(Idx).isUndef() &&
|
||||||
@ -40911,11 +40911,10 @@ static SDValue combineMOVMSK(SDNode *N, SelectionDAG &DAG,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Look through int->fp bitcasts that don't change the element width.
|
// Look through int->fp bitcasts that don't change the element width.
|
||||||
if (Src.getOpcode() == ISD::BITCAST && Src.hasOneUse() &&
|
unsigned EltWidth = SrcVT.getScalarSizeInBits();
|
||||||
SrcVT.isFloatingPoint() &&
|
if (Src.getOpcode() == ISD::BITCAST &&
|
||||||
Src.getOperand(0).getValueType() ==
|
Src.getOperand(0).getScalarValueSizeInBits() == EltWidth)
|
||||||
EVT(SrcVT).changeVectorElementTypeToInteger())
|
return DAG.getNode(X86ISD::MOVMSK, SDLoc(N), VT, Src.getOperand(0));
|
||||||
Src = Src.getOperand(0);
|
|
||||||
|
|
||||||
// Simplify the inputs.
|
// Simplify the inputs.
|
||||||
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
|
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
|
||||||
|
Loading…
Reference in New Issue
Block a user