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,
|
||||
BitVector *UndefElements) const {
|
||||
unsigned NumOps = getNumOperands();
|
||||
if (UndefElements) {
|
||||
UndefElements->clear();
|
||||
UndefElements->resize(getNumOperands());
|
||||
UndefElements->resize(NumOps);
|
||||
}
|
||||
assert(getNumOperands() == DemandedElts.getBitWidth() &&
|
||||
"Unexpected vector size");
|
||||
assert(NumOps == DemandedElts.getBitWidth() && "Unexpected vector size");
|
||||
if (!DemandedElts)
|
||||
return SDValue();
|
||||
SDValue Splatted;
|
||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
if (!DemandedElts[i])
|
||||
continue;
|
||||
SDValue Op = getOperand(i);
|
||||
|
Loading…
Reference in New Issue
Block a user