Skip to content

Commit 54340d5

Browse files
committed
Add vectorization optimization passes
1 parent 5789b4d commit 54340d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/LLVM/PassManager.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ public enum FunctionPass {
166166
/// These functions removes symbols from functions and modules without
167167
/// touching symbols for debugging information.
168168
case stripSymbols
169+
/// Performs a loop vectorization pass to widen instructions in loops to
170+
/// operate on multiple consecutive iterations.
171+
case loopVectorize
172+
/// This pass performs a superword-level parallelism pass to combine
173+
/// similar independent instructions into vector instructions.
174+
case slpVectorize
169175
}
170176

171177
/// A `FunctionPassManager` is an object that collects a sequence of passes
@@ -225,7 +231,8 @@ public class FunctionPassManager {
225231
.pruneEH: LLVMAddPruneEHPass,
226232
.stripDeadPrototypes: LLVMAddStripDeadPrototypesPass,
227233
.stripSymbols: LLVMAddStripSymbolsPass,
228-
234+
.loopVectorize: LLVMAddLoopVectorizePass,
235+
.slpVectorize: LLVMAddSLPVectorizePass,
229236
// .internalize: LLVMAddInternalizePass,
230237
// .sroaWithThreshhold: LLVMAddScalarReplAggregatesPassWithThreshold,
231238
]

0 commit comments

Comments
 (0)