From 3b1913ac57420af2c665c6f1c3847a6e63774ecd Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Tue, 19 Sep 2023 22:37:44 +0200 Subject: all: use the new LLVM pass manager The old LLVM pass manager is deprecated and should not be used anymore. Moreover, the pass manager builder (which we used to set up a pass pipeline) is actually removed from LLVM entirely in LLVM 17: https://reviews.llvm.org/D145387 https://reviews.llvm.org/D145835 The new pass manager does change the binary size in many cases: both growing and shrinking it. However, on average the binary size remains more or less the same. This is needed as a preparation for LLVM 17. --- interp/interp_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'interp') diff --git a/interp/interp_test.go b/interp/interp_test.go index fc567af20..cac565087 100644 --- a/interp/interp_test.go +++ b/interp/interp_test.go @@ -77,12 +77,9 @@ func runTest(t *testing.T, pathPrefix string) { } // Run some cleanup passes to get easy-to-read outputs. - pm := llvm.NewPassManager() - defer pm.Dispose() - pm.AddGlobalOptimizerPass() - pm.AddDeadStoreEliminationPass() - pm.AddAggressiveDCEPass() - pm.Run(mod) + to := llvm.NewPassBuilderOptions() + defer to.Dispose() + mod.RunPasses("globalopt,dse,adce", llvm.TargetMachine{}, to) // Read the expected output IR. out, err := os.ReadFile(pathPrefix + ".out.ll") -- cgit v1.2.3