File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 9
9
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
+ // /
13
+ // / Note: Unreachable blocks must always be eliminated before simplifying
14
+ // / useless phis. Otherwise self-loops will result in invalid SIL:
15
+ // /
16
+ // / bb1(%phi):
17
+ // / apply %use(%phi)
18
+ // / %def = apply %getValue()
19
+ // / br bb1(%def)
20
+ // /
21
+ // / When bb1 is unreachable, %phi will be removed as useless:
22
+ // / bb1:
23
+ // / apply %use(%def)
24
+ // / %def = apply %getValue()
25
+ // / br bb1(%def)
26
+ // /
27
+ // / This is considered invalid SIL because SIL has a special SSA dominance rule
28
+ // / that does not allow a use above a def in the same block.
29
+ // ===----------------------------------------------------------------------===//
12
30
13
31
#define DEBUG_TYPE " sil-simplify-cfg"
14
32
You can’t perform that action at this time.
0 commit comments