Skip to content

Commit 45f13ce

Browse files
committed
Add new optimizer passes
1 parent 01f7e08 commit 45f13ce

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/LLVM/PassManager.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public enum FunctionPass {
6464
case loopUnrollAndJam
6565
/// This pass is a simple loop unswitching pass.
6666
case loopUnswitch
67+
/// This pass lowers atomic intrinsics to non-atomic form for use in a known
68+
/// non-preemptible environment.
69+
case lowerAtomic
6770
/// This pass performs optimizations related to eliminating `memcpy` calls
6871
/// and/or combining multiple stores into memset's.
6972
case memCpyOpt
@@ -126,6 +129,10 @@ public enum FunctionPass {
126129
case scopedNoAliasAA
127130
/// LLVM's primary stateless and local alias analysis.
128131
case basicAliasAnalysis
132+
/// This pass is used to ensure that functions have at most one return
133+
/// instruction in them. Additionally, it keeps track of which node is
134+
/// the new exit node of the CFG.
135+
case unifyFunctionExitNodes
129136
/// Runs the LLVM IR Verifier to sanity check the results of passes.
130137
case verifier
131138
/// A pass to inline and remove functions marked as "always_inline".
@@ -202,6 +209,7 @@ public class FunctionPassManager {
202209
.loopUnroll: LLVMAddLoopUnrollPass,
203210
.loopUnrollAndJam: LLVMAddLoopUnrollAndJamPass,
204211
.loopUnswitch: LLVMAddLoopUnswitchPass,
212+
.lowerAtomic: LLVMAddLowerAtomicPass,
205213
.memCpyOpt: LLVMAddMemCpyOptPass,
206214
.partiallyInlineLibCalls: LLVMAddPartiallyInlineLibCallsPass,
207215
.lowerSwitch: LLVMAddLowerSwitchPass,
@@ -221,6 +229,7 @@ public class FunctionPassManager {
221229
.typeBasedAliasAnalysis: LLVMAddTypeBasedAliasAnalysisPass,
222230
.scopedNoAliasAA: LLVMAddScopedNoAliasAAPass,
223231
.basicAliasAnalysis: LLVMAddBasicAliasAnalysisPass,
232+
.unifyFunctionExitNodes: LLVMAddUnifyFunctionExitNodesPass,
224233
.alwaysInliner: LLVMAddAlwaysInlinerPass,
225234
.argumentPromotion: LLVMAddArgumentPromotionPass,
226235
.constantMerge: LLVMAddConstantMergePass,

0 commit comments

Comments
 (0)