Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {

if (isa<ArrayType>(CDS->getType()))
return DAG.getMergeValues(Ops, getCurSDLoc());
return NodeMap[V] = DAG.getBuildVector(VT, getCurSDLoc(), Ops);
return DAG.getBuildVector(VT, getCurSDLoc(), Ops);
}

if (C->getType()->isStructTy() || C->getType()->isArrayTy()) {
Expand Down Expand Up @@ -1898,14 +1898,13 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {

if (VT.isRISCVVectorTuple()) {
assert(C->isNullValue() && "Can only zero this target type!");
return NodeMap[V] = DAG.getNode(
ISD::BITCAST, getCurSDLoc(), VT,
DAG.getNode(
ISD::SPLAT_VECTOR, getCurSDLoc(),
EVT::getVectorVT(*DAG.getContext(), MVT::i8,
VT.getSizeInBits().getKnownMinValue() / 8,
true),
DAG.getConstant(0, getCurSDLoc(), MVT::getIntegerVT(8))));
return DAG.getNode(
ISD::BITCAST, getCurSDLoc(), VT,
DAG.getNode(
ISD::SPLAT_VECTOR, getCurSDLoc(),
EVT::getVectorVT(*DAG.getContext(), MVT::i8,
VT.getSizeInBits().getKnownMinValue() / 8, true),
DAG.getConstant(0, getCurSDLoc(), MVT::getIntegerVT(8))));
}

VectorType *VecTy = cast<VectorType>(V->getType());
Expand All @@ -1918,7 +1917,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
for (unsigned i = 0; i != NumElements; ++i)
Ops.push_back(getValue(CV->getOperand(i)));

return NodeMap[V] = DAG.getBuildVector(VT, getCurSDLoc(), Ops);
return DAG.getBuildVector(VT, getCurSDLoc(), Ops);
}

if (isa<ConstantAggregateZero>(C)) {
Expand All @@ -1931,7 +1930,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
else
Op = DAG.getConstant(0, getCurSDLoc(), EltVT);

return NodeMap[V] = DAG.getSplat(VT, getCurSDLoc(), Op);
return DAG.getSplat(VT, getCurSDLoc(), Op);
}

llvm_unreachable("Unknown vector constant");
Expand Down