Skip to content

Commit 13e7b95

Browse files
authored
Merge pull request #16871 from gottesmm/pr-a3e66535385c13130292d0422b5be34cad234a13
2 parents ed6bcde + e0aaa5f commit 13e7b95

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

lib/SILOptimizer/Mandatory/PMOMemoryUseCollector.h

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,33 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//
13-
// This file declares logic used by definitive analysis related passes that look
14-
// at all the instructions that access a memory object. This is quite specific
15-
// to definitive analysis in that it is tuple element sensitive instead of
16-
// relying on SROA.
17-
//
12+
///
13+
/// \file
14+
///
15+
/// High Level Overview
16+
/// -------------------
17+
///
18+
/// This file declares logic that is used by the predictable memory optimization
19+
/// pass. Like definite initialization, it is tuple element sensitive instead of
20+
/// relying on an SROA optimization or the like to chop up structs.
21+
///
22+
/// NOTE: PMO is an abbreviation for "Predictable Memory Optimizations".
23+
///
24+
/// Historical Note
25+
/// ---------------
26+
///
27+
/// This file looks very similar to DIMemoryUseCollector.* and has many
28+
/// connections to Definite Initialization. This is because early in the
29+
/// development of Swift, Predictable Memory Optimizations and Definite
30+
/// Initialization were actually the same pass. The pass grew really big and the
31+
/// two passes were split, but still used similra utility code. This became the
32+
/// original DIMemoryUseCollector.*. This code was full of conditional logic for
33+
/// all of the various cases that made it difficult to understand which code was
34+
/// needed for Predictable Mem Opts and what was needed for DI. The introduction
35+
/// of the SIL ownership model to SIL was used as an opportunity to split the
36+
/// two, flatten the sphagetti conditional code so the logic was clear, and
37+
/// allow the two passes to diverge and hew their form closer to their function.
38+
///
1839
//===----------------------------------------------------------------------===//
1940

2041
#ifndef SWIFT_SILOPTIMIZER_MANDATORY_PMOMEMORYUSECOLLECTOR_H

0 commit comments

Comments
 (0)