mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
[DAG] BuildVectorSDNode::getSplatValue - pull out repeated getNumOperands() calls. NFCI.
This commit is contained in:
parent
655fbd5c46
commit
99d78e28b2
@ -9766,16 +9766,16 @@ bool BuildVectorSDNode::isConstantSplat(APInt &SplatValue, APInt &SplatUndef,
|
|||||||
|
|
||||||
SDValue BuildVectorSDNode::getSplatValue(const APInt &DemandedElts,
|
SDValue BuildVectorSDNode::getSplatValue(const APInt &DemandedElts,
|
||||||
BitVector *UndefElements) const {
|
BitVector *UndefElements) const {
|
||||||
|
unsigned NumOps = getNumOperands();
|
||||||
if (UndefElements) {
|
if (UndefElements) {
|
||||||
UndefElements->clear();
|
UndefElements->clear();
|
||||||
UndefElements->resize(getNumOperands());
|
UndefElements->resize(NumOps);
|
||||||
}
|
}
|
||||||
assert(getNumOperands() == DemandedElts.getBitWidth() &&
|
assert(NumOps == DemandedElts.getBitWidth() && "Unexpected vector size");
|
||||||
"Unexpected vector size");
|
|
||||||
if (!DemandedElts)
|
if (!DemandedElts)
|
||||||
return SDValue();
|
return SDValue();
|
||||||
SDValue Splatted;
|
SDValue Splatted;
|
||||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0; i != NumOps; ++i) {
|
||||||
if (!DemandedElts[i])
|
if (!DemandedElts[i])
|
||||||
continue;
|
continue;
|
||||||
SDValue Op = getOperand(i);
|
SDValue Op = getOperand(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user