mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-08 21:10:31 +00:00
[SelectionDAG] Pull out repeated getValueType calls. NFCI.
Noticed in D32391. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301308 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cda4399247
commit
70ad9d96e1
@ -523,16 +523,16 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_CONCAT_VECTORS(SDNode *N) {
|
||||
return DAG.getBuildVector(N->getValueType(0), SDLoc(N), Ops);
|
||||
}
|
||||
|
||||
/// If the input is a vector that needs to be scalarized, it must be <1 x ty>,
|
||||
/// so just return the element, ignoring the index.
|
||||
SDValue DAGTypeLegalizer::ScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
SDValue Res = GetScalarizedVector(N->getOperand(0));
|
||||
if (Res.getValueType() != N->getValueType(0))
|
||||
Res = DAG.getNode(ISD::ANY_EXTEND, SDLoc(N), N->getValueType(0),
|
||||
Res);
|
||||
return Res;
|
||||
}
|
||||
|
||||
/// If the input is a vector that needs to be scalarized, it must be <1 x ty>,
|
||||
/// so just return the element, ignoring the index.
|
||||
SDValue DAGTypeLegalizer::ScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
EVT VT = N->getValueType(0);
|
||||
SDValue Res = GetScalarizedVector(N->getOperand(0));
|
||||
if (Res.getValueType() != VT)
|
||||
Res = DAG.getNode(ISD::ANY_EXTEND, SDLoc(N), VT, Res);
|
||||
return Res;
|
||||
}
|
||||
|
||||
|
||||
/// If the input condition is a vector that needs to be scalarized, it must be
|
||||
/// <1 x i1>, so just convert to a normal ISD::SELECT
|
||||
|
@ -362,9 +362,9 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, const SDLoc &DL,
|
||||
return DAG.getUNDEF(ValueVT);
|
||||
}
|
||||
|
||||
if (ValueVT.getVectorNumElements() == 1 &&
|
||||
ValueVT.getVectorElementType() != PartEVT)
|
||||
Val = DAG.getAnyExtOrTrunc(Val, DL, ValueVT.getScalarType());
|
||||
EVT ValueSVT = ValueVT.getVectorElementType();
|
||||
if (ValueVT.getVectorNumElements() == 1 && ValueSVT != PartEVT)
|
||||
Val = DAG.getAnyExtOrTrunc(Val, DL, ValueSVT);
|
||||
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, DL, ValueVT, Val);
|
||||
}
|
||||
@ -4896,11 +4896,11 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
|
||||
|
||||
Entry.Node = Src;
|
||||
Args.push_back(Entry);
|
||||
|
||||
|
||||
Entry.Ty = I.getArgOperand(2)->getType();
|
||||
Entry.Node = NumElements;
|
||||
Args.push_back(Entry);
|
||||
|
||||
|
||||
Entry.Ty = Type::getInt32Ty(*DAG.getContext());
|
||||
Entry.Node = ElementSize;
|
||||
Args.push_back(Entry);
|
||||
@ -5743,7 +5743,7 @@ void SelectionDAGBuilder::visitConstrainedFPIntrinsic(const CallInst &I,
|
||||
unsigned Opcode;
|
||||
switch (Intrinsic) {
|
||||
default: llvm_unreachable("Impossible intrinsic"); // Can't reach here.
|
||||
case Intrinsic::experimental_constrained_fadd:
|
||||
case Intrinsic::experimental_constrained_fadd:
|
||||
Opcode = ISD::STRICT_FADD;
|
||||
break;
|
||||
case Intrinsic::experimental_constrained_fsub:
|
||||
|
Loading…
Reference in New Issue
Block a user