Skip to content

Commit b286373

Browse files
committed
[rbi] Make a confusing comment clearer.
From talking with @dgregor, it became clear that this comment was easily interpreted as saying that AssignFresh always introduced a disconnected value... which is not the case. Instead, AssignFresh just introduces a new value that could have any form of isolation. The actual isolation of the value is assigned via tryToTrackValue and eventually SILIsolationInfo::get().
1 parent 0b8efc9 commit b286373

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

include/swift/SILOptimizer/Utils/PartitionUtils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ enum class PartitionOpKind : uint8_t {
428428
Assign,
429429

430430
/// Assign one value to a fresh region, takes one arg.
431+
///
432+
/// NOTE: This just produces a new value that is tracked by the dataflow. The
433+
/// isolation characteristics of the value are actually decided by
434+
/// tryToTrackValue and SILIsolationInfo::get().
431435
AssignFresh,
432436

433437
/// Merge the regions of two values, takes two args, both must be from

lib/SILOptimizer/Analysis/RegionAnalysis.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,8 +1553,13 @@ enum class TranslationSemantics {
15531553
Ignored,
15541554

15551555
/// An instruction whose result produces a completely new region. E.x.:
1556-
/// alloc_box, alloc_pack, key_path. This results in the translator
1557-
/// producing a partition op that introduces the new region.
1556+
/// alloc_box, alloc_pack, key_path, a function without any parameters. This
1557+
/// results in the translator producing a partition op that introduces the new
1558+
/// region.
1559+
///
1560+
/// NOTE: This just introduces a new value and must always occur before a
1561+
/// value is actually used. The isolation of the value is actually determined
1562+
/// by invoking tryToTrackValue and SILIsolationInfo::get().
15581563
AssignFresh,
15591564

15601565
/// An instruction that merges together all of its operands regions and

0 commit comments

Comments
 (0)