From 647d3d24c935c2adb4e7bc5f1ecfe14ab12725d2 Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Mon, 12 Dec 2022 18:15:10 -0500 Subject: [PATCH] Fix LLVM update from google3 This CL imports a google3 fix for LLVM: https://critique.corp.google.com/cl/494101670/depot/google3/third_party/swiftshader/src/Reactor/LLVMJIT.cpp Bug: b/191050320 Change-Id: I1250459354dd8e783352f9acfaf59821be2a84f0 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/70328 Presubmit-Ready: Alexis Hétu Kokoro-Result: kokoro Commit-Queue: Alexis Hétu Reviewed-by: Shahbaz Youssefi Tested-by: Alexis Hétu --- diff --git src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp index d3dbdb9..fad747a 100644 --- src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp +++ src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp @@ -922,7 +922,11 @@ if(optimizationLevel > 0) { +#if LLVM_VERSION_MAJOR >= 16 + fpm.addPass(llvm::SROAPass(llvm::SROAOptions::PreserveCFG)); +#else fpm.addPass(llvm::SROAPass()); +#endif fpm.addPass(llvm::InstCombinePass()); }