Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 0867c84

Browse files
committed
Temporarily disable LLVM opaque pointers
This can be reverted once opaque pointer support is added.
1 parent c0d1fce commit 0867c84

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

omniscidb/QueryEngine/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ set(hdk_default_runtime_functions_module_dependencies
185185
GroupByRuntime.cpp
186186
TopKRuntime.cpp)
187187

188+
list(APPEND DISABLE_OPAQUE_POINTERS_CMD "")
189+
if(${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "15")
190+
list(APPEND DISABLE_OPAQUE_POINTERS_CMD "-Xclang" "-no-opaque-pointers")
191+
endif()
192+
188193
# Adds a custom command for producing llvm bitcode modules out of a .cpp source.
189194
# Any additional arguments are treated as clang args and bypassed as-is.
190195
function(precompile_llvm_module SOURCE_FILE SUFFIX)
@@ -195,7 +200,7 @@ function(precompile_llvm_module SOURCE_FILE SUFFIX)
195200
DEPENDS ${hdk_default_runtime_functions_module_dependencies} ${SOURCE_FILE}
196201
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${result_module_name}
197202
COMMAND ${llvm_clangpp_cmd}
198-
ARGS -std=c++17 ${RT_OPT_FLAGS} ${ARGN} -c -emit-llvm
203+
ARGS -std=c++17 ${RT_OPT_FLAGS} ${ARGN} -c -emit-llvm ${DISABLE_OPAQUE_POINTERS_CMD}
199204
${CLANG_SDK_INC} ${CLANG_CRT_INC} ${MAPD_DEFINITIONS} -DEXECUTE_INCLUDE
200205
-o ${CMAKE_CURRENT_BINARY_DIR}/${result_module_name}
201206
-I ${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -272,7 +277,7 @@ add_custom_command(
272277
DEPENDS ExtensionFunctions.hpp ExtensionFunctionsArray.hpp ExtensionFunctionsTesting.hpp
273278
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ExtensionFunctions.ast.raw
274279
COMMAND ${llvm_clangpp_cmd}
275-
ARGS -DNO_BOOST -std=c++17 -fsyntax-only -Xclang -ast-dump -fno-diagnostics-color -Wno-return-type-c-linkage
280+
ARGS -DNO_BOOST -std=c++17 -fsyntax-only -Xclang -ast-dump -fno-diagnostics-color -Wno-return-type-c-linkage ${DISABLE_OPAQUE_POINTERS_CMD}
276281
-I ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/ExtensionFunctions.hpp > ${CMAKE_CURRENT_BINARY_DIR}/ExtensionFunctions.ast.raw)
277282

278283
add_custom_command(

omniscidb/QueryEngine/Execute.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ Executor::Executor(const ExecutorId executor_id,
156156
, temporary_tables_(nullptr)
157157
, input_table_info_cache_(this)
158158
, thread_id_(logger::thread_id()) {
159+
#if LLVM_VERSION_MAJOR > 14
160+
// temporarily disable opaque pointers
161+
context_->setOpaquePointers(false);
162+
#endif
163+
159164
if (executor_id_ > INVALID_EXECUTOR_ID - 1) {
160165
throw std::runtime_error("Too many executors!");
161166
}

omniscidb/Tests/L0MgrExecuteTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ std::string SPIRVExecuteTest::generateSimpleSPIRV() {
2727
using namespace llvm;
2828
// See source at https://github.com/kurapov-peter/L0Snippets
2929
LLVMContext ctx;
30+
#if LLVM_VERSION_MAJOR > 14
31+
// temporarily disable opaque pointers
32+
ctx.setOpaquePointers(false);
33+
#endif
3034
std::unique_ptr<Module> module = std::make_unique<Module>("code_generated", ctx);
3135
module->setTargetTriple("spir-unknown-unknown");
3236
IRBuilder<> builder(ctx);
@@ -157,7 +161,12 @@ std::unique_ptr<llvm::Module> read_gen_module_from_bc(const std::string& bc_file
157161
std::string mangle_spirv_builtin(const llvm::Function& func) {
158162
CHECK(func.getName().startswith("__spirv_"));
159163
std::string new_name;
164+
#if LLVM_VERSION_MAJOR > 14
165+
mangleOpenClBuiltin(
166+
func.getName().str(), func.getArg(0)->getType(), /*pointer_types=*/{}, new_name);
167+
#else
160168
mangleOpenClBuiltin(func.getName().str(), func.getArg(0)->getType(), new_name);
169+
#endif
161170
return new_name;
162171
}
163172
} // namespace

omniscidb/Tests/SpirvBuildTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ TEST(SPIRVBuildTest, TranslateSimple) {
2323
using namespace llvm;
2424
// See source at https://github.com/kurapov-peter/L0Snippets
2525
LLVMContext ctx;
26+
#if LLVM_VERSION_MAJOR > 14
27+
// temporarily disable opaque pointers
28+
ctx.setOpaquePointers(false);
29+
#endif
2630
std::unique_ptr<Module> module = std::make_unique<Module>("code_generated", ctx);
2731
module->setTargetTriple("spir-unknown-unknown");
2832
IRBuilder<> builder(ctx);

0 commit comments

Comments
 (0)