diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2019-03-27 22:24:03 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2019-03-27 22:24:03 +0000 |
| commit | 704817912a2d7ea3c95b5194480c4c62b789043d (patch) | |
| tree | 57975e0af4b4b8379112a8e6e48f0e4ee29378c0 /llvm/lib | |
| parent | 039be787914610c28cba45c4557454e0a96939ab (diff) | |
| download | bcm5719-llvm-704817912a2d7ea3c95b5194480c4c62b789043d.tar.gz bcm5719-llvm-704817912a2d7ea3c95b5194480c4c62b789043d.zip | |
[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
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 67631f72be4..17a93274d83 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -40900,7 +40900,7 @@ static SDValue combineMOVMSK(SDNode *N, SelectionDAG &DAG, // Perform constant folding. if (ISD::isBuildVectorOfConstantSDNodes(Src.getNode())) { - assert(VT== MVT::i32 && "Unexpected result type"); + assert(VT == MVT::i32 && "Unexpected result type"); APInt Imm(32, 0); for (unsigned Idx = 0, e = Src.getNumOperands(); Idx < e; ++Idx) { 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. - if (Src.getOpcode() == ISD::BITCAST && Src.hasOneUse() && - SrcVT.isFloatingPoint() && - Src.getOperand(0).getValueType() == - EVT(SrcVT).changeVectorElementTypeToInteger()) - Src = Src.getOperand(0); + unsigned EltWidth = SrcVT.getScalarSizeInBits(); + if (Src.getOpcode() == ISD::BITCAST && + Src.getOperand(0).getScalarValueSizeInBits() == EltWidth) + return DAG.getNode(X86ISD::MOVMSK, SDLoc(N), VT, Src.getOperand(0)); // Simplify the inputs. const TargetLowering &TLI = DAG.getTargetLoweringInfo(); |

