mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-12 07:37:34 +00:00
[X86] Simplify code. NFC.
Replaced some logic that checked if a build_vector node is doing a splat of a non-undef value with a call to method BuildVectorSDNode::getSplatValue(). No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223354 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d27b0b9489
commit
e6cb70164e
@ -18447,22 +18447,12 @@ static SDValue LowerScalarVariableShift(SDValue Op, SelectionDAG &DAG,
|
||||
SDValue BaseShAmt;
|
||||
EVT EltVT = VT.getVectorElementType();
|
||||
|
||||
if (Amt.getOpcode() == ISD::BUILD_VECTOR) {
|
||||
unsigned NumElts = VT.getVectorNumElements();
|
||||
unsigned i, j;
|
||||
for (i = 0; i != NumElts; ++i) {
|
||||
if (Amt.getOperand(i).getOpcode() == ISD::UNDEF)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
for (j = i; j != NumElts; ++j) {
|
||||
SDValue Arg = Amt.getOperand(j);
|
||||
if (Arg.getOpcode() == ISD::UNDEF) continue;
|
||||
if (Arg != Amt.getOperand(i))
|
||||
break;
|
||||
}
|
||||
if (i != NumElts && j == NumElts)
|
||||
BaseShAmt = Amt.getOperand(i);
|
||||
if (BuildVectorSDNode *BV = dyn_cast<BuildVectorSDNode>(Amt)) {
|
||||
// Check if this build_vector node is doing a splat.
|
||||
// If so, then set BaseShAmt equal to the splat value.
|
||||
BaseShAmt = BV->getSplatValue();
|
||||
if (BaseShAmt && BaseShAmt.getOpcode() == ISD::UNDEF)
|
||||
BaseShAmt = SDValue();
|
||||
} else {
|
||||
if (Amt.getOpcode() == ISD::EXTRACT_SUBVECTOR)
|
||||
Amt = Amt.getOperand(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user