From 04d707a7baaea6129a941a18bb2c4b629c29d22e Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Mon, 25 Sep 2023 19:19:27 +0000 Subject: Mon Sep 25 19:19:27 UTC 2023 ap/man-db-2.12.0-x86_64-1.txz: Upgraded. ap/mpg123-1.32.1-x86_64-1.txz: Upgraded. d/llvm-17.0.1-x86_64-1.txz: Upgraded. Shared library .so-version bump. d/lua-5.4.6-x86_64-4.txz: Rebuilt. Fixed prefix and $LIBDIRSUFFIX in lua.pc. Thanks to ArTourter. d/parallel-20230922-noarch-1.txz: Upgraded. kde/kdevelop-23.08.1-x86_64-2.txz: Rebuilt. Recompiled against llvm-17.0.1. l/imagemagick-7.1.1_18-x86_64-1.txz: Upgraded. l/libclc-17.0.1-x86_64-1.txz: Upgraded. l/qt5-5.15.10_20230923_6e8e373e-x86_64-1.txz: Upgraded. Compiled against llvm-17.0.1. l/spirv-llvm-translator-17.0.0-x86_64-1.txz: Upgraded. Compiled against llvm-17.0.1. x/mesa-23.2.0_rc4-x86_64-1.txz: Upgraded. Compiled against llvm-17.0.1. --- .../2d4fe5f229791fde52846b3f583c12508b5109d6.patch | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 source/x/mesa/patches/2d4fe5f229791fde52846b3f583c12508b5109d6.patch (limited to 'source/x/mesa/patches/2d4fe5f229791fde52846b3f583c12508b5109d6.patch') diff --git a/source/x/mesa/patches/2d4fe5f229791fde52846b3f583c12508b5109d6.patch b/source/x/mesa/patches/2d4fe5f229791fde52846b3f583c12508b5109d6.patch new file mode 100644 index 000000000..3fa3282f2 --- /dev/null +++ b/source/x/mesa/patches/2d4fe5f229791fde52846b3f583c12508b5109d6.patch @@ -0,0 +1,127 @@ +From 2d4fe5f229791fde52846b3f583c12508b5109d6 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Fri, 25 Aug 2023 12:43:44 +1000 +Subject: clover/llvm: move to modern pass manager. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This seems like it should work, but I haven't tested it yet. + +Tested-by: Dieter Nützel +Part-of: +--- + src/gallium/frontends/clover/llvm/invocation.cpp | 64 +++++++++++++++++++----- + 1 file changed, 51 insertions(+), 13 deletions(-) + +diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp +index 7a50fea3323..43d26fe1abb 100644 +--- a/src/gallium/frontends/clover/llvm/invocation.cpp ++++ b/src/gallium/frontends/clover/llvm/invocation.cpp +@@ -27,13 +27,17 @@ + #include + #include + #include ++#include + #include +-#include ++#include + #include + #ifdef HAVE_CLOVER_SPIRV + #include + #endif + ++#include ++#include ++#include + #include + #include + #include +@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source, + + namespace { + void +- optimize(Module &mod, unsigned optimization_level, ++ optimize(Module &mod, ++ const std::string& ir_target, ++ unsigned optimization_level, + bool internalize_symbols) { +- ::llvm::legacy::PassManager pm; +- + // By default, the function internalizer pass will look for a function + // called "main" and then mark all other functions as internal. Marking + // functions as internal enables the optimizer to perform optimizations +@@ -458,19 +462,53 @@ namespace { + if (internalize_symbols) { + std::vector names = + map(std::mem_fn(&Function::getName), get_kernels(mod)); +- pm.add(::llvm::createInternalizePass( ++ internalizeModule(mod, + [=](const ::llvm::GlobalValue &gv) { + return std::find(names.begin(), names.end(), + gv.getName()) != names.end(); +- })); ++ }); + } + +- ::llvm::PassManagerBuilder pmb; +- pmb.OptLevel = optimization_level; +- pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl( +- ::llvm::Triple(mod.getTargetTriple())); +- pmb.populateModulePassManager(pm); +- pm.run(mod); ++ ++ const char *opt_str = NULL; ++ LLVMCodeGenOptLevel level; ++ switch (optimization_level) { ++ case 0: ++ default: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelNone; ++ break; ++ case 1: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelLess; ++ break; ++ case 2: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelDefault; ++ break; ++ case 3: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelAggressive; ++ break; ++ } ++ ++ const target &target = ir_target; ++ LLVMTargetRef targ; ++ char *err_message; ++ ++ if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message)) ++ return; ++ LLVMTargetMachineRef tm = ++ LLVMCreateTargetMachine(targ, target.triple.c_str(), ++ target.cpu.c_str(), "", level, ++ LLVMRelocDefault, LLVMCodeModelDefault); ++ ++ if (!tm) ++ return; ++ LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions(); ++ LLVMRunPasses(wrap(&mod), opt_str, tm, opts); ++ ++ LLVMDisposeTargetMachine(tm); + } + + std::unique_ptr +@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector &binaries, + auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log); + auto mod = link(*ctx, *c, binaries, r_log); + +- optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library); ++ optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library); + + static std::atomic_uint seq(0); + const std::string id = "." + mod->getModuleIdentifier() + "-" + +-- +cgit v1.2.1 + -- cgit v1.2.3-65-gdbad