@@ -1362,27 +1362,26 @@ class FieldSensitiveMultiDefPrunedLiveRange
1362
1362
}
1363
1363
}
1364
1364
1365
- bool isDef (SILInstruction *inst , unsigned bit) const {
1365
+ bool isDef (SILNode *node , unsigned bit) const {
1366
1366
assert (isInitialized ());
1367
- auto iter = defs.find (cast<SILNode>(inst) );
1367
+ auto iter = defs.find (node );
1368
1368
if (!iter)
1369
1369
return false ;
1370
1370
return llvm::any_of (
1371
1371
*iter, [&](TypeTreeLeafTypeRange span) { return span.contains (bit); });
1372
1372
}
1373
1373
1374
+ bool isDef (SILInstruction *inst, unsigned bit) const {
1375
+ return isDef (cast<SILNode>(inst), bit);
1376
+ }
1377
+
1374
1378
bool isDef (SILValue value, unsigned bit) const {
1375
- assert (isInitialized ());
1376
- auto iter = defs.find (cast<SILNode>(value));
1377
- if (!iter)
1378
- return false ;
1379
- return llvm::any_of (
1380
- *iter, [&](TypeTreeLeafTypeRange span) { return span.contains (bit); });
1379
+ return isDef (cast<SILNode>(value), bit);
1381
1380
}
1382
1381
1383
- bool isDef (SILValue value , SmallBitVector const &bits) const {
1382
+ bool isDef (SILNode *node , SmallBitVector const &bits) const {
1384
1383
assert (isInitialized ());
1385
- auto iter = defs.find (cast<SILNode>(value) );
1384
+ auto iter = defs.find (node );
1386
1385
if (!iter)
1387
1386
return false ;
1388
1387
SmallBitVector allBits (bits.size ());
@@ -1392,36 +1391,30 @@ class FieldSensitiveMultiDefPrunedLiveRange
1392
1391
return (bits & allBits) == bits;
1393
1392
}
1394
1393
1394
+ bool isDef (SILValue value, SmallBitVector const &bits) const {
1395
+ return isDef (cast<SILNode>(value), bits);
1396
+ }
1397
+
1395
1398
bool isDef (SILInstruction *inst, SmallBitVector const &bits) const {
1396
- assert (isInitialized ());
1397
- auto iter = defs.find (cast<SILNode>(inst));
1398
- if (!iter)
1399
- return false ;
1400
- SmallBitVector allBits (bits.size ());
1401
- for (auto range : *iter) {
1402
- range.setBits (allBits);
1403
- }
1404
- return (bits & allBits) == bits;
1399
+ return isDef (cast<SILNode>(inst), bits);
1405
1400
}
1406
1401
1407
- bool isDef (SILInstruction *inst , TypeTreeLeafTypeRange span) const {
1402
+ bool isDef (SILNode *node , TypeTreeLeafTypeRange span) const {
1408
1403
assert (isInitialized ());
1409
- auto iter = defs.find (cast<SILNode>(inst) );
1404
+ auto iter = defs.find (node );
1410
1405
if (!iter)
1411
1406
return false ;
1412
1407
return llvm::any_of (*iter, [&](TypeTreeLeafTypeRange storedSpan) {
1413
1408
return span.setIntersection (storedSpan).has_value ();
1414
1409
});
1415
1410
}
1416
1411
1412
+ bool isDef (SILInstruction *inst, TypeTreeLeafTypeRange span) const {
1413
+ return isDef (cast<SILNode>(inst), span);
1414
+ }
1415
+
1417
1416
bool isDef (SILValue value, TypeTreeLeafTypeRange span) const {
1418
- assert (isInitialized ());
1419
- auto iter = defs.find (cast<SILNode>(value));
1420
- if (!iter)
1421
- return false ;
1422
- return llvm::any_of (*iter, [&](TypeTreeLeafTypeRange storedSpan) {
1423
- return span.setIntersection (storedSpan).has_value ();
1424
- });
1417
+ return isDef (cast<SILNode>(value), span);
1425
1418
}
1426
1419
1427
1420
void
0 commit comments