@@ -1379,42 +1379,52 @@ class FieldSensitiveMultiDefPrunedLiveRange
1379
1379
return isDef (cast<SILNode>(value), bit);
1380
1380
}
1381
1381
1382
- bool isDef (SILNode *node, SmallBitVector const &bits) const {
1382
+ void isDef (SILNode *node, SmallBitVector const &bits,
1383
+ SmallBitVector &bitsOut) const {
1383
1384
assert (isInitialized ());
1385
+ assert (bitsOut.none ());
1384
1386
auto iter = defs.find (node);
1385
1387
if (!iter)
1386
- return false ;
1387
- SmallBitVector allBits (bits.size ());
1388
+ return ;
1388
1389
for (auto range : *iter) {
1389
- range.setBits (allBits );
1390
+ range.setBits (bitsOut );
1390
1391
}
1391
- return (bits & allBits) = = bits;
1392
+ bitsOut & = bits;
1392
1393
}
1393
1394
1394
- bool isDef (SILValue value, SmallBitVector const &bits) const {
1395
- return isDef (cast<SILNode>(value), bits);
1395
+ void isDef (SILValue value, SmallBitVector const &bits,
1396
+ SmallBitVector &bitsOut) const {
1397
+ isDef (cast<SILNode>(value), bits, bitsOut);
1396
1398
}
1397
1399
1398
- bool isDef (SILInstruction *inst, SmallBitVector const &bits) const {
1399
- return isDef (cast<SILNode>(inst), bits);
1400
+ void isDef (SILInstruction *inst, SmallBitVector const &bits,
1401
+ SmallBitVector &bitsOut) const {
1402
+ isDef (cast<SILNode>(inst), bits, bitsOut);
1400
1403
}
1401
1404
1402
- bool isDef (SILNode *node, TypeTreeLeafTypeRange span) const {
1405
+ void isDef (SILNode *node, TypeTreeLeafTypeRange span,
1406
+ SmallBitVector &bitsOut) const {
1403
1407
assert (isInitialized ());
1408
+ assert (bitsOut.none ());
1404
1409
auto iter = defs.find (node);
1405
1410
if (!iter)
1406
- return false ;
1407
- return llvm::any_of (*iter, [&](TypeTreeLeafTypeRange storedSpan) {
1408
- return span.setIntersection (storedSpan).has_value ();
1409
- });
1411
+ return ;
1412
+ for (auto defSpan : *iter) {
1413
+ auto intersection = span.setIntersection (defSpan);
1414
+ if (!intersection.has_value ())
1415
+ continue ;
1416
+ span.setBits (bitsOut);
1417
+ }
1410
1418
}
1411
1419
1412
- bool isDef (SILInstruction *inst, TypeTreeLeafTypeRange span) const {
1413
- return isDef (cast<SILNode>(inst), span);
1420
+ void isDef (SILInstruction *inst, TypeTreeLeafTypeRange span,
1421
+ SmallBitVector &bitsOut) const {
1422
+ return isDef (cast<SILNode>(inst), span, bitsOut);
1414
1423
}
1415
1424
1416
- bool isDef (SILValue value, TypeTreeLeafTypeRange span) const {
1417
- return isDef (cast<SILNode>(value), span);
1425
+ void isDef (SILValue value, TypeTreeLeafTypeRange span,
1426
+ SmallBitVector &bitsOut) const {
1427
+ return isDef (cast<SILNode>(value), span, bitsOut);
1418
1428
}
1419
1429
1420
1430
void
0 commit comments