Skip to content

Commit 22a5a39

Browse files
committed
[FSPrunedLiveness] Returned bitfield from isDef
1 parent 330f300 commit 22a5a39

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

include/swift/SIL/FieldSensitivePrunedLiveness.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,17 +1221,24 @@ class FieldSensitiveSSAPrunedLiveRange
12211221
return inst == defInst.first && defInst.second->contains(bit);
12221222
}
12231223

1224-
bool isDef(SILInstruction *inst, SmallBitVector const &bits) const {
1224+
void isDef(SILInstruction *inst, SmallBitVector const &bits,
1225+
SmallBitVector &bitsOut) const {
1226+
assert(bitsOut.none());
12251227
if (inst != defInst.first)
1226-
return false;
1227-
SmallBitVector defBits(bits.size());
1228-
defInst.second->setBits(defBits);
1229-
return (defBits & bits) == bits;
1228+
return;
1229+
defInst.second->setBits(bitsOut);
1230+
bitsOut &= bits;
12301231
}
12311232

1232-
bool isDef(SILInstruction *inst, TypeTreeLeafTypeRange span) const {
1233-
return inst == defInst.first &&
1234-
defInst.second->setIntersection(span).has_value();
1233+
void isDef(SILInstruction *inst, TypeTreeLeafTypeRange span,
1234+
SmallBitVector &bitsOut) const {
1235+
assert(bitsOut.none());
1236+
if (inst != defInst.first)
1237+
return;
1238+
auto intersection = defInst.second->setIntersection(span);
1239+
if (!intersection.has_value())
1240+
return;
1241+
intersection.value().setBits(bitsOut);
12351242
}
12361243

12371244
bool isDefBlock(SILBasicBlock *block, unsigned bit) const {

0 commit comments

Comments
 (0)