From 1c6031a02a852d3b908c3ff0ea19eddacd6b0004 Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Wed, 7 Feb 2024 16:45:58 +0100 Subject: [PATCH] Explicitly disable `RelLookupTableConvertedPass` Before the passmanager update, the function `populateModulePassManager` was called instead of `buildPerModuleDefaultPipeline` to set the default passes. But the former did not have `RelLookupTableConverterPass` turned on by default. --- lib/Interpreter/BackendPasses.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Interpreter/BackendPasses.cpp b/lib/Interpreter/BackendPasses.cpp index 2f8249e132..172e7eb2bf 100644 --- a/lib/Interpreter/BackendPasses.cpp +++ b/lib/Interpreter/BackendPasses.cpp @@ -378,6 +378,7 @@ void BackendPasses::CreatePasses(int OptLevel, llvm::ModulePassManager& MPM, P.equals("ModuleInlinerPass") || P.equals("InlinerPass") || P.equals("InlineAdvisorAnalysis") || P.equals("PartiallyInlineLibCallsPass") || + P.equals("RelLookupTableConverterPass") || P.equals("InlineCostAnnotationPrinterPass") || P.equals("InlineSizeEstimatorAnalysisPrinterPass") || P.equals("InlineSizeEstimatorAnalysis")) @@ -385,6 +386,11 @@ void BackendPasses::CreatePasses(int OptLevel, llvm::ModulePassManager& MPM, return true; }); + } else { + // Register a callback for disabling RelLookupTableConverterPass. + PIC.registerShouldRunOptionalPassCallback([](StringRef P, Any) { + return !P.equals("RelLookupTableConverterPass"); + }); } SI.registerCallbacks(PIC, &FAM);