Skip to content

Commit f765f55

Browse files
committed
[NFC] SIL: Define deinit barrier preds on builtins
The three predicates are all now defined and defined correctly on builtins to return true whenever mayReadOrWriteMemory is true.
1 parent 77fd37b commit f765f55

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ bool swift::mayAccessPointer(SILInstruction *instruction) {
455455
}
456456

457457
bool swift::mayLoadWeakOrUnowned(SILInstruction *instruction) {
458+
if (isa<BuiltinInst>(instruction)) {
459+
return instruction->mayReadOrWriteMemory();
460+
}
458461
return isa<LoadWeakInst>(instruction)
459462
|| isa<LoadUnownedInst>(instruction)
460463
|| isa<StrongCopyUnownedValueInst>(instruction)
@@ -464,6 +467,9 @@ bool swift::mayLoadWeakOrUnowned(SILInstruction *instruction) {
464467
/// Conservatively, whether this instruction could involve a synchronization
465468
/// point like a memory barrier, lock or syscall.
466469
bool swift::maySynchronize(SILInstruction *instruction) {
470+
if (isa<BuiltinInst>(instruction)) {
471+
return instruction->mayReadOrWriteMemory();
472+
}
467473
return FullApplySite::isa(instruction)
468474
|| isa<EndApplyInst>(instruction)
469475
|| isa<AbortApplyInst>(instruction)

0 commit comments

Comments
 (0)