diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-11-18 15:52:08 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-11-18 15:52:08 +0000 |
commit | fec9f8657b5cea6ad99cf95ef3524d98ae975b97 (patch) | |
tree | 0938e5343033ad3b5f74faadd5501e54a29e539b /llvm/lib/Target | |
parent | 40509997ebce38b00c3abf441ec1f620ada4012e (diff) | |
download | bcm5719-llvm-fec9f8657b5cea6ad99cf95ef3524d98ae975b97.tar.gz bcm5719-llvm-fec9f8657b5cea6ad99cf95ef3524d98ae975b97.zip |
[X86][SSE] Relax IsSplatValue - remove the 'variable shift' limit on subtracts.
Means we don't use the per-lane-shifts as much when we can cheaply use the older splat-variable-shifts.
llvm-svn: 347162
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index d2a5f396d64..b505cc77af2 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -23902,10 +23902,10 @@ static SDValue LowerScalarImmediateShift(SDValue Op, SelectionDAG &DAG, } // Determine if V is a splat value, and return the scalar. +// TODO - can we make this generic and move to SelectionDAG? static SDValue IsSplatValue(MVT VT, SDValue V, const SDLoc &dl, - SelectionDAG &DAG, const X86Subtarget &Subtarget, - unsigned Opcode) { - V = peekThroughEXTRACT_SUBVECTORs(V); + SelectionDAG &DAG) { + V = peekThroughEXTRACT_SUBVECTORs(V); // Check if this is a splat build_vector node. if (BuildVectorSDNode *BV = dyn_cast<BuildVectorSDNode>(V)) { @@ -23916,8 +23916,7 @@ static SDValue IsSplatValue(MVT VT, SDValue V, const SDLoc &dl, } // Check for SUB(SPLAT_BV, SPLAT) cases from rotate patterns. - if (V.getOpcode() == ISD::SUB && - !SupportedVectorVarShift(VT, Subtarget, Opcode)) { + if (V.getOpcode() == ISD::SUB) { SDValue LHS = peekThroughEXTRACT_SUBVECTORs(V.getOperand(0)); SDValue RHS = peekThroughEXTRACT_SUBVECTORs(V.getOperand(1)); @@ -23969,7 +23968,7 @@ static SDValue LowerScalarVariableShift(SDValue Op, SelectionDAG &DAG, Amt = peekThroughEXTRACT_SUBVECTORs(Amt); - if (SDValue BaseShAmt = IsSplatValue(VT, Amt, dl, DAG, Subtarget, Opcode)) { + if (SDValue BaseShAmt = IsSplatValue(VT, Amt, dl, DAG)) { if (SupportedVectorShiftWithBaseAmnt(VT, Subtarget, Opcode)) { MVT EltVT = VT.getVectorElementType(); assert(EltVT.bitsLE(MVT::i64) && "Unexpected element type!"); @@ -24672,7 +24671,7 @@ static SDValue LowerRotate(SDValue Op, const X86Subtarget &Subtarget, // Rotate by splat - expand back to shifts. // TODO - legalizers should be able to handle this. if ((EltSizeInBits >= 16 || Subtarget.hasBWI()) && - IsSplatValue(VT, Amt, DL, DAG, Subtarget, Opcode)) { + IsSplatValue(VT, Amt, DL, DAG)) { SDValue AmtR = DAG.getConstant(EltSizeInBits, DL, VT); AmtR = DAG.getNode(ISD::SUB, DL, VT, AmtR, Amt); SDValue SHL = DAG.getNode(ISD::SHL, DL, VT, R, Amt); |