[Mesa-dev] [PATCH] swr: Fix include for createInstructionCombiningPass with llvm-7.0.

Kyriazis, George george.kyriazis at intel.com
Fri May 4 01:02:39 UTC 2018


It would be nice to avoid the extra #if LLVM_VERSION_MAJOR and include InstCombine.h into the same #if below, as follows:

--- a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
@@ -69,6 +69,7 @@ using PassManager = llvm::legacy::PassManager;
#include "llvm/Transforms/Scalar.h"
#if LLVM_VERSION_MAJOR >= 7
#include "llvm/Transforms/Utils.h"
+#include "llvm/Transforms/InstCombine/InstCombine.h"
#endif
#include "llvm/Support/Host.h"
#include "llvm/Support/DynamicLibrary.h”

With the above change

Reviewed-By: George Kyriazis <george.kyriazis at intel.com<mailto:george.kyriazis at intel.com>>

Thanks

George

On Apr 29, 2018, at 1:40 AM, Vinson Lee <vlee at freedesktop.org<mailto:vlee at freedesktop.org>> wrote:

Fix build error after llvm-7.0.0svn r330669 ("InstCombine: Fix layering
by not including Scalar.h in InstCombine").

 CXX      rasterizer/jitter/libmesaswr_la-blend_jit.lo
rasterizer/jitter/blend_jit.cpp:816:20: error: use of undeclared identifier 'createInstructionCombiningPass'; did you mean 'createInstructionSimplifierPass'?
       passes.add(createInstructionCombiningPass());
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  createInstructionSimplifierPass

Signed-off-by: Vinson Lee <vlee at freedesktop.org<mailto:vlee at freedesktop.org>>
---
src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
index 216938fa7b07..6e4d24dde8fa 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
@@ -66,6 +66,9 @@ using PassManager = llvm::legacy::PassManager;
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Transforms/IPO.h"
+#if LLVM_VERSION_MAJOR >= 7
+#include "llvm/Transforms/InstCombine/InstCombine.h"
+#endif
#include "llvm/Transforms/Scalar.h"
#if LLVM_VERSION_MAJOR >= 7
#include "llvm/Transforms/Utils.h"
--
2.17.0


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180504/3b4b4222/attachment.html>


More information about the mesa-dev mailing list