Skip to content

Commit 30cacdf

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 99b1bba commit 30cacdf

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
@@ -457,6 +457,9 @@ bool swift::mayAccessPointer(SILInstruction *instruction) {
457457

458458
bool swift::mayLoadWeakOrUnowned(SILInstruction *instruction) {
459459
assert(!FullApplySite::isa(instruction));
460+
if (isa<BuiltinInst>(instruction)) {
461+
return instruction->mayReadOrWriteMemory();
462+
}
460463
return isa<LoadWeakInst>(instruction)
461464
|| isa<LoadUnownedInst>(instruction)
462465
|| isa<StrongCopyUnownedValueInst>(instruction)
@@ -467,6 +470,9 @@ bool swift::mayLoadWeakOrUnowned(SILInstruction *instruction) {
467470
/// point like a memory barrier, lock or syscall.
468471
bool swift::maySynchronize(SILInstruction *instruction) {
469472
assert(!FullApplySite::isa(instruction));
473+
if (isa<BuiltinInst>(instruction)) {
474+
return instruction->mayReadOrWriteMemory();
475+
}
470476
return isa<EndApplyInst>(instruction)
471477
|| isa<AbortApplyInst>(instruction)
472478
|| isa<HopToExecutorInst>(instruction);

0 commit comments

Comments
 (0)