Skip to content

[CI] Drop DPCPP_ENABLE_OPAQUE_POINTERS cmake flag #8286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/sycl_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
build_cache_root: "/__w/"
build_cache_suffix: opaque_pointers
build_artifact_suffix: opaque_pointers
build_configure_extra_args: "--hip --cuda --enable-esimd-emulator --cmake-opt=-DDPCPP_ENABLE_OPAQUE_POINTERS=TRUE --cmake-opt=-DSPIRV_ENABLE_OPAQUE_POINTERS=TRUE"
build_configure_extra_args: "--hip --cuda --enable-esimd-emulator --cmake-opt=-DSPIRV_ENABLE_OPAQUE_POINTERS=TRUE"

ubuntu2204_opaque_pointers_build_test:
if: github.repository == 'intel/llvm'
Expand All @@ -58,7 +58,7 @@ jobs:
build_cache_root: "/__w/"
build_cache_suffix: opaque_pointers
build_artifact_suffix: opaque_pointers
build_configure_extra_args: "--hip --cuda --enable-esimd-emulator --cmake-opt=-DDPCPP_ENABLE_OPAQUE_POINTERS=TRUE --cmake-opt=-DSPIRV_ENABLE_OPAQUE_POINTERS=TRUE"
build_configure_extra_args: "--hip --cuda --enable-esimd-emulator --cmake-opt=-DSPIRV_ENABLE_OPAQUE_POINTERS=TRUE"
build_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest"

windows_default:
Expand Down
6 changes: 6 additions & 0 deletions libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
# have to be explicity declared in the soruce.
list( APPEND flags -Xclang -fdeclare-spirv-builtins)

if(NOT SPIRV_ENABLE_OPAQUE_POINTERS)
list(APPEND flags "-UENABLE_OPAQUE_POINTERS")
list(APPEND flags "SHELL:-Xclang -no-opaque-pointers")
list(APPEND opt_flags "-opaque-pointers=0")
endif()

# OpenCL 3.0 extensions
list( APPEND flags -cl-std=CL3.0 "SHELL:-Xclang" )
string(CONCAT CL_3_0_EXTENSIONS
Expand Down
5 changes: 5 additions & 0 deletions libclc/utils/libclc-remangler/LibclcRemangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,11 @@ class LibCLCRemangler : public ASTConsumer {
void Initialize(ASTContext &C) override {
ASTCtx = &C;
SMDiagnostic Err;
#if SPIRV_ENABLE_OPAQUE_POINTERS
LLVMCtx.setOpaquePointers(true);
#else
LLVMCtx.setOpaquePointers(false);
#endif
std::unique_ptr<MemoryBuffer> const Buff = ExitOnErr(
errorOrToExpected(MemoryBuffer::getFileOrSTDIN(InputIRFilename)));
std::unique_ptr<llvm::Module> const M =
Expand Down
2 changes: 1 addition & 1 deletion llvm-spirv/tools/llvm-spirv/llvm-spirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static cl::opt<bool>
SPIRVToolsDis("spirv-tools-dis", cl::init(false),
cl::desc("Emit textual assembly using SPIRV-Tools"));

#if ENABLE_OPAQUE_POINTERS
#if SPIRV_ENABLE_OPAQUE_POINTERS
constexpr static bool SPIRVOpaquePointersDefault = true;
#else
constexpr static bool SPIRVOpaquePointersDefault = false;
Expand Down
2 changes: 1 addition & 1 deletion llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ if(NOT LLVM_ENABLE_NEW_PASS_MANAGER)
" no longer supported.")
endif()

set(DPCPP_ENABLE_OPAQUE_POINTERS FALSE CACHE BOOL
set(DPCPP_ENABLE_OPAQUE_POINTERS TRUE CACHE BOOL
"Enable opaque pointers by default.")
if (DPCPP_ENABLE_OPAQUE_POINTERS)
add_definitions("-DENABLE_OPAQUE_POINTERS=1")
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2355,6 +2355,8 @@ Error BitcodeReader::parseTypeTableBody() {
// [pointee type, address space]
if (Record.empty())
return error("Invalid pointer record");
if (LLVM_UNLIKELY(!Context.hasSetOpaquePointersValue()))
Context.setOpaquePointers(false);
unsigned AddressSpace = 0;
if (Record.size() == 2)
AddressSpace = Record[1];
Expand Down