Skip to content

Commit 5440d21

Browse files
committed
Add the "internalize" and "add discriminators" passes
1 parent 58db28c commit 5440d21

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Sources/LLVM/PassManager.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ public enum Pass {
4444
/// %Z = add int 2, %X
4545
/// ```
4646
case instructionCombining
47+
/// Working in conjunction with the linker, iterate through all functions and
48+
/// global values in the module and attempt to change their linkage from
49+
/// external to internal.
50+
///
51+
/// To preserve the linkage of a global value, return `true` from the given
52+
/// callback.
53+
case internalize(mustPreserve: (IRGlobal) -> Bool)
54+
/// Working in conjunction with the linker, iterate through all functions and
55+
/// global values in the module and attempt to change their linkage from
56+
/// external to internal.
57+
///
58+
/// When a function with the name "main" is encountered, if the value of
59+
/// `preserveMain` is `true`, "main" will not be internalized.
60+
case internalizeAll(preserveMain: Bool)
4761
/// Thread control through mult-pred/multi-succ blocks where some preds
4862
/// always go to some succ. Thresholds other than minus one override the
4963
/// internal BB duplication default threshold.
@@ -92,6 +106,10 @@ public enum Pass {
92106
/// ret i32 42
93107
/// ```
94108
case promoteMemoryToRegister
109+
/// Adds DWARF discriminators to the IR. Discriminators are
110+
/// used to decide what CFG path was taken inside sub-graphs whose instructions
111+
/// share the same line and column number information.
112+
case addDiscriminators
95113
/// This pass reassociates commutative expressions in an order that
96114
/// is designed to promote better constant propagation, GCSE, LICM, PRE, etc.
97115
///

0 commit comments

Comments
 (0)