[llvm] 4423a7a - [NewPM] Disable RelLookupTableConverter pass in LTO
Gulfem Savrun Yeniceri via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 30 14:24:19 PDT 2021
Author: Gulfem Savrun Yeniceri
Date: 2021-04-30T21:23:40Z
New Revision: 4423a7a09b1b0dc8558e06e1f84f144b28466d9b
URL: https://github.com/llvm/llvm-project/commit/4423a7a09b1b0dc8558e06e1f84f144b28466d9b
DIFF: https://github.com/llvm/llvm-project/commit/4423a7a09b1b0dc8558e06e1f84f144b28466d9b.diff
LOG: [NewPM] Disable RelLookupTableConverter pass in LTO
Relative look table converter pass caused an issue when full lto
is enabled (reported in https://reviews.llvm.org/D94355).
This patch disables that pass from full lto pre-link phase optimization
pipeline until the issue is fixed.
Differential Revision: https://reviews.llvm.org/D101664
Added:
Modified:
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/new-pm-defaults.ll
Removed:
################################################################################
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 31e9e14a25e9..8a694cd63a7e 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1425,7 +1425,11 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
MPM.addPass(GlobalDCEPass());
MPM.addPass(ConstantMergePass());
- MPM.addPass(RelLookupTableConverterPass());
+ // TODO: Relative look table converter pass caused an issue when full lto is
+ // enabled. See https://reviews.llvm.org/D94355 for more details.
+ // Until the issue fixed, disable this pass during pre-linking phase.
+ if (!LTOPreLink)
+ MPM.addPass(RelLookupTableConverterPass());
return MPM;
}
diff --git a/llvm/test/Other/new-pm-defaults.ll b/llvm/test/Other/new-pm-defaults.ll
index c934bb9978aa..7e7f2653b98b 100644
--- a/llvm/test/Other/new-pm-defaults.ll
+++ b/llvm/test/Other/new-pm-defaults.ll
@@ -260,8 +260,10 @@
; CHECK-O-NEXT: Running pass: CGProfilePass
; CHECK-O-NEXT: Running pass: GlobalDCEPass
; CHECK-O-NEXT: Running pass: ConstantMergePass
-; CHECK-O-NEXT: Running pass: RelLookupTableConverterPass
-; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
+; CHECK-DEFAULT-NEXT: Running pass: RelLookupTableConverterPass
+; CHECK-LTO-NOT: Running pass: RelLookupTableConverterPass
+; CHECK-DEFAULT-NEXT: Running analysis: TargetIRAnalysis
+; CHECK-LTO-NOT: Running analysis: TargetIRAnalysis
; CHECK-O-NEXT: Running pass: AnnotationRemarksPass on foo
; CHECK-LTO-NEXT: Running pass: CanonicalizeAliasesPass
; CHECK-LTO-NEXT: Running pass: NameAnonGlobalPass
More information about the llvm-commits
mailing list