Skip to content

Commit 9ed0612

Browse files
msdataeikamaub
authored andcommitted
Add InjectTLIMappings pass to new pass manager
This pass is created in d6de5f1 and tested for new and legacy pass manager but never added to new pass manager pipeline. I am adding it to new pass manager pipeline. This pass is get used in Vector Function Database (VFDatabase) and without this pass in new pass manager pipeline, none of the vector libraries are work ing with new pass manager. Related passes: 66c120f https://reviews.llvm.org/D74944 Differential revision: https://reviews.llvm.org/D75354
1 parent ae9edbc commit 9ed0612

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,10 @@ ModulePassManager PassBuilder::buildModuleOptimizationPipeline(
972972
// llvm.loop.distribute=true or when -enable-loop-distribute is specified.
973973
OptimizePM.addPass(LoopDistributePass());
974974

975+
// Populates the VFABI attribute with the scalar-to-vector mappings
976+
// from the TargetLibraryInfo.
977+
OptimizePM.addPass(InjectTLIMappings());
978+
975979
// Now run the core loop vectorizer.
976980
OptimizePM.addPass(LoopVectorizePass(
977981
LoopVectorizeOptions(!PTO.LoopInterleaving, !PTO.LoopVectorization)));

llvm/test/Other/new-pm-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@
245245
; CHECK-O-NEXT: Running pass: LCSSAPass
246246
; CHECK-O-NEXT: Finished llvm::Function pass manager run.
247247
; CHECK-O-NEXT: Running pass: LoopDistributePass
248+
; CHECK-O-NEXT: Running pass: InjectTLIMappings
248249
; CHECK-O-NEXT: Running pass: LoopVectorizePass
249250
; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis
250251
; CHECK-O-NEXT: Running analysis: BranchProbabilityAnalysis

llvm/test/Other/new-pm-thinlto-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215
; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
216216
; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run
217217
; CHECK-POSTLINK-O-NEXT: Running pass: LoopDistributePass
218+
; CHECK-POSTLINK-O-NEXT: Running pass: InjectTLIMappings
218219
; CHECK-POSTLINK-O-NEXT: Running pass: LoopVectorizePass
219220
; CHECK-POSTLINK-O-NEXT: Running analysis: BlockFrequencyAnalysis
220221
; CHECK-POSTLINK-O-NEXT: Running analysis: BranchProbabilityAnalysis

llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
; CHECK-O-NEXT: Running pass: LCSSAPass
186186
; CHECK-O-NEXT: Finished {{.*}}Function pass manager run
187187
; CHECK-O-NEXT: Running pass: LoopDistributePass
188+
; CHECK-O-NEXT: Running pass: InjectTLIMappings
188189
; CHECK-O-NEXT: Running pass: LoopVectorizePass
189190
; CHECK-O-NEXT: Running pass: VectorCombinePass
190191
; CHECK-O-NEXT: Running pass: EarlyCSEPass

llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
; CHECK-O-NEXT: Running pass: LCSSAPass
197197
; CHECK-O-NEXT: Finished {{.*}}Function pass manager run
198198
; CHECK-O-NEXT: Running pass: LoopDistributePass
199+
; CHECK-O-NEXT: Running pass: InjectTLIMappings
199200
; CHECK-O-NEXT: Running pass: LoopVectorizePass
200201
; CHECK-O-NEXT: Running pass: VectorCombinePass
201202
; CHECK-O-NEXT: Running pass: EarlyCSEPass

0 commit comments

Comments
 (0)