Skip to content

Commit 04307c7

Browse files
authored
deps: Raise llvm minimum to 14.0 (#2019)
Drop support for llvm 11, 12, 13. Simplify lots of conditional compilation. With 14 as the minimum, the new pass manager and opaque pointers are both supported, so we are able to get rid of all code related to support of the legacy pass manager, as well as typed pointers. This is a lot of removed code! We also simplify the testing matrix as a result of having a less expansive range of LLVM versions to consider. When updating INSTALL.md, I noticed that we still had **bold** for "new minimum dependencies" left over from when we first released 1.14. So I'm unbolding them now, except for the ones we actually have changed for 1.15. I had originally intended to pull the minimum to 15, but actually that makes it more difficult to continue CI testing vs VFX Platform 2022, since the ASWF-docker container for 2022 only support up to LLVM 14. And simultaneously, once I removed the code for legacy PM and typed pointers, there was, in comparison, only a small amount of additional simplification we could squeeze out of moving the minimum to llvm 15. So for OSL 1.15, we will have a minimum llvm 14, and then for OSL 1.16 when we would feel more comfortable droping all VFX Platform 2022 support and move to the 2023 containers as our oldest testing environment, we can bump to llvm 15. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 89fc3a2 commit 04307c7

File tree

11 files changed

+107
-664
lines changed

11 files changed

+107
-664
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,10 @@ jobs:
5151
fail-fast: false
5252
matrix:
5353
include:
54-
# - desc: gcc9/C++17 llvm11 py3.7 oiio2.5 sse4 batch-b8avx2
55-
# nametag: linux-vfx2021
56-
# runner: ubuntu-latest
57-
# container: aswftesting/ci-osl:2021-clang11
58-
# vfxyear: 2021
59-
# old_node: 1
60-
# cxx_std: 17
61-
# openexr_ver: v3.1.3
62-
# openimageio_ver: v2.5.4.0
63-
# python_ver: 3.7
64-
# pybind11_ver: v2.7.0
65-
# simd: sse4.2
66-
# batched: b8_AVX2_noFMA
67-
# setenvs: export USE_OPENVDB=0
68-
- desc: gcc9/C++17 llvm13 py3.9 exr3.1 oiio-rel avx2
54+
- desc: gcc9/C++17 llvm14 py3.9 exr3.1 oiio-rel avx2
6955
nametag: linux-vfx2022
7056
runner: ubuntu-latest
71-
container: aswftesting/ci-osl:2022-clang13
57+
container: aswftesting/ci-osl:2022-clang14
7258
vfxyear: 2022
7359
old_node: 1
7460
cxx_std: 17
@@ -77,10 +63,10 @@ jobs:
7763
pybind11_ver: v2.9.0
7864
simd: avx2,f16c
7965
batched: b8_AVX2
80-
- desc: clang12/C++17 llvm12 oiio-main py3.9 avx2 batch-avx512
81-
nametag: linux-clang12-llvm12-batch
66+
- desc: clang14/C++17 llvm14 oiio-main py3.9 avx2 batch-avx512
67+
nametag: linux-clang14-llvm14-batch
8268
runner: ubuntu-latest
83-
container: aswftesting/ci-osl:2022-clang12
69+
container: aswftesting/ci-osl:2022-clang14
8470
vfxyear: 2022
8571
old_node: 1
8672
cxx_std: 17
@@ -91,10 +77,10 @@ jobs:
9177
simd: avx2,f16c
9278
batched: b8_AVX2,b8_AVX512,b16_AVX512
9379
setenvs: USE_OPENVDB=0
94-
- desc: gcc9/C++17 llvm11 py3.9 exr3.1 oiio3.0 sse2 batch-b4sse2
80+
- desc: gcc9/C++17 llvm14 py3.9 exr3.1 oiio3.0 sse2 batch-b4sse2
9581
nametag: linux-vfx2022-clang
9682
runner: ubuntu-latest
97-
container: aswftesting/ci-osl:2022-clang13
83+
container: aswftesting/ci-osl:2022-clang14
9884
vfxyear: 2022
9985
old_node: 1
10086
cxx_std: 17
@@ -104,10 +90,10 @@ jobs:
10490
pybind11_ver: v2.9.0
10591
simd: sse2
10692
batched: b4_SSE2
107-
- desc: oldest everything gcc9/C++17 llvm11 py3.9 oiio2.5 no-simd
93+
- desc: oldest everything gcc9/C++17 llvm14 py3.9 oiio2.5 no-simd
10894
nametag: linux-oldest
10995
runner: ubuntu-latest
110-
container: aswftesting/ci-osl:2022-clang11
96+
container: aswftesting/ci-osl:2022-clang14
11197
vfxyear: 2022
11298
old_node: 1
11399
cxx_std: 17
@@ -280,7 +266,7 @@ jobs:
280266
# ^^ exclude python-oslquery test until the ASWF container properly
281267
# includes OIIO's python bindings, then we can remove that.
282268

283-
# Address and leak sanitizers
269+
# Address and leak sanitizers (debug build)
284270
- desc: sanitizers
285271
nametag: sanitizer
286272
runner: ubuntu-latest
@@ -386,8 +372,8 @@ jobs:
386372
USE_OPENVDB=0
387373
OPENCOLORIO_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=g++"
388374

389-
- desc: Debug gcc9/C++17 llvm11 py3.10 oiio2.5 exr3.1 sse4
390-
nametag: linux-debug-gcc7-llvm11
375+
- desc: Debug gcc9/C++17 llvm14 py3.10 oiio2.5 exr3.1 sse4
376+
nametag: linux-debug-gcc9-llvm14
391377
runner: ubuntu-22.04
392378
cxx_compiler: g++-9
393379
cxx_std: 17
@@ -397,11 +383,11 @@ jobs:
397383
python_ver: "3.10"
398384
simd: sse4.2
399385
setenvs: export CMAKE_BUILD_TYPE=Debug
400-
LLVM_VERSION=11.0.0 LLVM_DISTRO_NAME=ubuntu-20.04
386+
LLVM_VERSION=14.0.0 LLVM_DISTRO_NAME=ubuntu-18.04
401387
PUGIXML_VERSION=v1.9
402388
CTEST_TEST_TIMEOUT=240
403-
- desc: gcc10/C++17 llvm11 oiio-2.5 avx2
404-
nametag: linux-2021ish-gcc10-llvm11
389+
- desc: gcc10/C++17 llvm14 oiio-2.5 avx2
390+
nametag: linux-2021ish-gcc10-llvm14
405391
runner: ubuntu-22.04
406392
cxx_compiler: g++-10
407393
cxx_std: 17
@@ -411,7 +397,7 @@ jobs:
411397
pybind11_ver: v2.8.1
412398
python_ver: "3.10"
413399
simd: avx2,f16c
414-
setenvs: export LLVM_VERSION=11.0.0 LLVM_DISTRO_NAME=ubuntu-20.04
400+
setenvs: export LLVM_VERSION=14.0.0 LLVM_DISTRO_NAME=ubuntu-18.04
415401
OPENIMAGEIO_CMAKE_FLAGS="-DBUILD_FMT_VERSION=7.0.1"
416402
PUGIXML_VERSION=v1.10
417403
- desc: latest releases gcc11/C++17 llvm17 oiio-3.0 exr3.2 py3.12 avx2 batch-b16avx512

INSTALL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ Dependencies
1919
OSL requires the following dependencies or tools.
2020
NEW or CHANGED minimum dependencies since the last major release are **bold**.
2121

22-
* Build system: [CMake](https://cmake.org/) **3.19 or newer** (tested
22+
* Build system: [CMake](https://cmake.org/) 3.19 or newer (tested
2323
through 4.0)
2424

2525
* A suitable C++17 compiler to build OSL itself, which may be any of:
26-
- **GCC 9.3** or newer (tested through gcc 13.1)
27-
- **Clang 5** or newer (tested through clang 19)
26+
- GCC 9.3 or newer (tested through gcc 13.1)
27+
- Clang 5 or newer (tested through clang 20)
2828
- Microsoft Visual Studio 2017 or newer
29-
- Intel C++ compiler **icc version 19** or newer or LLVM-based icx compiler
29+
- Intel C++ compiler icc version 19 or newer or LLVM-based icx compiler
3030
version 2022 or newer.
3131

32-
* **[OpenImageIO](http://openimageio.org) 2.5 or newer** (tested through 3.0
32+
* [OpenImageIO](http://openimageio.org) 2.5 or newer (tested through 3.0
3333
and main)
3434

3535
OSL uses OIIO both for its texture mapping functionality as well as
@@ -49,15 +49,15 @@ NEW or CHANGED minimum dependencies since the last major release are **bold**.
4949
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
5050
DYLD_LIBRARY_PATH on OS X).
5151

52-
* [LLVM](http://www.llvm.org) 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, including
53-
clang libraries.
52+
* [LLVM](http://www.llvm.org) **14.0 or newer**, 15, 16, 17, 18, 19, 20,
53+
including clang libraries.
5454

5555
* (optional) For GPU rendering on NVIDIA GPUs:
5656
* [OptiX](https://developer.nvidia.com/rtx/ray-tracing/optix) 7.0 or higher.
5757
* [Cuda](https://developer.nvidia.com/cuda-downloads) 9.0 or higher. It is
5858
recommended that you use 11.0 or higher.
5959

60-
* [Imath](https://github.com/AcademySoftwareFoundation/Imath) **3.1 or newer**.
60+
* [Imath](https://github.com/AcademySoftwareFoundation/Imath) 3.1 or newer.
6161
* [Flex](https://github.com/westes/flex) 2.5.35 or newer and
6262
[GNU Bison](https://www.gnu.org/software/bison/) 2.7 or newer.
6363
Note that on some MacOS/xcode releases, the system-installed Bison is too
@@ -70,7 +70,7 @@ NEW or CHANGED minimum dependencies since the last major release are **bold**.
7070
* (optional) Python: If you are building the Python bindings or running the
7171
testsuite:
7272
* **Python >= 3.9** (tested through 3.13)
73-
* **pybind11 >= 2.7** (tested through 3.0)
73+
* pybind11 >= 2.7 (tested through 3.0)
7474
* NumPy (tested through 2.2.4)
7575
* (optional) Qt5 >= 5.6 or Qt6 (tested Qt5 through 5.15 and Qt6 through 6.8).
7676
If not found at build time, the `osltoy` application will be disabled.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ help:
359359
@echo " Finding and Using Dependencies:"
360360
@echo " USE_QT=0 Skip anything that needs Qt"
361361
@echo " LLVM-related options:"
362-
@echo " LLVM_VERSION=12.0 Specify which LLVM version to use"
362+
@echo " LLVM_VERSION=19.0 Specify which LLVM version to use"
363363
@echo " LLVM_DIRECTORY=xx Specify where LLVM lives"
364364
@echo " LLVM_NAMESPACE=xx Specify custom LLVM namespace"
365365
@echo " LLVM_STATIC=1 Use static LLVM libraries"

src/cmake/cuda_macros.cmake

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
134134
set (CLANG_MSVC_FIX -Wno-ignored-attributes -Wno-unknown-attributes)
135135
endif ()
136136

137-
if (NOT LLVM_OPAQUE_POINTERS AND ${LLVM_VERSION} VERSION_GREATER_EQUAL 15.0)
138-
# Until we fully support opaque pointers, we need to disable
139-
# them when using LLVM 15.
140-
list (APPEND LLVM_COMPILE_FLAGS -Xclang -no-opaque-pointers)
141-
endif ()
142-
143137
if (NOT CUDA_NO_FTZ)
144138
set (CLANG_FTZ_FLAG "-fcuda-flush-denormals-to-zero")
145139
endif ()
@@ -221,14 +215,10 @@ function ( CUDA_SHADEOPS_COMPILE prefix output_bc output_ptx input_srcs headers
221215
list ( APPEND shadeops_bc_list ${shadeops_bc} )
222216
endforeach ()
223217

224-
if (LLVM_NEW_PASS_MANAGER)
225-
# There is no --nvptx-assign-valid-global-names flag for the new
226-
# pass manager, but it appears to run this pass by default.
227-
string(REPLACE "-O" "O" opt_tool_flags ${CUDA_OPT_FLAG_CLANG})
228-
set (opt_tool_flags -passes="default<${opt_tool_flags}>")
229-
else()
230-
set (opt_tool_flags ${CUDA_OPT_FLAG_CLANG} --nvptx-assign-valid-global-names)
231-
endif ()
218+
# There is no --nvptx-assign-valid-global-names flag for the new
219+
# pass manager, but it appears to run this pass by default.
220+
string(REPLACE "-O" "O" opt_tool_flags ${CUDA_OPT_FLAG_CLANG})
221+
set (opt_tool_flags -passes="default<${opt_tool_flags}>")
232222

233223
# Link all of the individual LLVM bitcode files, and emit PTX for the linked bitcode
234224
add_custom_command ( OUTPUT ${linked_bc} ${linked_ptx}

src/cmake/externalpackages.cmake

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ checked_find_package (pugixml REQUIRED
5757

5858
# LLVM library setup
5959
checked_find_package (LLVM REQUIRED
60-
VERSION_MIN 11.0
60+
VERSION_MIN 14.0
6161
VERSION_MAX 20.9
6262
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES
6363
LLVM_SHARED_MODE)
@@ -79,36 +79,7 @@ if (LLVM_VERSION VERSION_GREATER_EQUAL 15.0 AND CMAKE_COMPILER_IS_CLANG
7979
"If you are using LLVM 15 or higher, you should also use clang version "
8080
"15 or higher, or you may get build errors.${ColorReset}\n")
8181
endif ()
82-
if (LLVM_VERSION VERSION_GREATER_EQUAL 16.0)
83-
if (CMAKE_CXX_STANDARD VERSION_LESS 17)
84-
message (WARNING "${ColorYellow}LLVM 16+ requires C++17 or higher. "
85-
"Please set CMAKE_CXX_STANDARD to 17 or higher.${ColorReset}\n")
86-
endif ()
87-
if (CMAKE_COMPILER_IS_GNUCC AND (GCC_VERSION VERSION_LESS 7.0))
88-
message (WARNING "${ColorYellow}LLVM 16+ requires gcc 7.0 or higher.${ColorReset}\n")
89-
endif ()
90-
if (CMAKE_COMPILER_IS_CLANG
91-
AND NOT (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 5.0
92-
OR APPLECLANG_VERSION_STRING VERSION_GREATER_EQUAL 5.0))
93-
message (WARNING "${ColorYellow}LLVM 16+ requires clang 5.0 or higher.${ColorReset}\n")
94-
endif ()
95-
endif ()
9682

97-
# Use opaque pointers starting with LLVM 16
98-
if (${LLVM_VERSION} VERSION_GREATER_EQUAL 16.0)
99-
set(LLVM_OPAQUE_POINTERS ON)
100-
add_compile_definitions (OSL_LLVM_OPAQUE_POINTERS)
101-
else()
102-
set(LLVM_OPAQUE_POINTERS OFF)
103-
endif()
104-
105-
# Enable new pass manager for LLVM 16+
106-
if (${LLVM_VERSION} VERSION_GREATER_EQUAL 16.0)
107-
set(LLVM_NEW_PASS_MANAGER ON)
108-
add_compile_definitions (OSL_LLVM_NEW_PASS_MANAGER)
109-
else()
110-
set(LLVM_NEW_PASS_MANAGER OFF)
111-
endif()
11283

11384

11485
checked_find_package (partio)

src/cmake/llvm_macros.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ function ( EMBED_LLVM_BITCODE_IN_CPP src_list suffix output_name list_to_append_
7474
list (TRANSFORM include_dirs PREPEND -I
7575
OUTPUT_VARIABLE ALL_INCLUDE_DIRS)
7676

77-
if (NOT LLVM_OPAQUE_POINTERS AND ${LLVM_VERSION} VERSION_GREATER_EQUAL 15.0)
78-
# Until we fully support opaque pointers, we need to disable
79-
# them when using LLVM 15.
80-
list (APPEND LLVM_COMPILE_FLAGS -Xclang -no-opaque-pointers)
81-
endif ()
82-
8377
# Command to turn the .cpp file into LLVM assembly language .s, into
8478
# LLVM bitcode .bc, then back into a C++ file with the bc embedded!
8579
add_custom_command ( OUTPUT ${src_bc}

src/include/OSL/llvm_util.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,6 @@ class OSLEXECPUBLIC LLVM_Util {
12401240
llvm::Value* op_combine_4x_vectors(llvm::Value* half_vec_1,
12411241
llvm::Value* half_vec_2);
12421242

1243-
void setup_legacy_optimization_passes(int optlevel, bool target_host);
12441243
void setup_new_optimization_passes(int optlevel, bool target_host);
12451244
};
12461245

src/liboslexec/batched_backendllvm.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,25 +1304,6 @@ BatchedBackendLLVM::llvm_store_value(llvm::Value* new_val, llvm::Value* dst_ptr,
13041304
if (!type.is_closure_based() && t.aggregate > 1)
13051305
dst_ptr = ll.GEP(dst_type, dst_ptr, 0, component);
13061306

1307-
#ifndef OSL_LLVM_OPAQUE_POINTERS
1308-
if ((const llvm::Type*)ll.type_ptr(ll.llvm_typeof(new_val))
1309-
!= ll.llvm_typeof(dst_ptr)) {
1310-
std::cerr << " new_val type=";
1311-
{
1312-
llvm::raw_os_ostream os_cerr(std::cerr);
1313-
ll.llvm_typeof(new_val)->print(os_cerr);
1314-
}
1315-
std::cerr << " dest_ptr type=";
1316-
{
1317-
llvm::raw_os_ostream os_cerr(std::cerr);
1318-
ll.llvm_typeof(dst_ptr)->print(os_cerr);
1319-
}
1320-
std::cerr << std::endl;
1321-
}
1322-
OSL_ASSERT((const llvm::Type*)ll.type_ptr(ll.llvm_typeof(new_val))
1323-
== ll.llvm_typeof(dst_ptr));
1324-
#endif
1325-
13261307
// Finally, store the value.
13271308
ll.op_store(new_val, dst_ptr);
13281309
return true;

src/liboslexec/batched_llvm_gen.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,18 +1056,6 @@ LLVMGEN(llvm_gen_andor)
10561056
// sometimes we could not force the data type to be an bool and it remains
10571057
// an int, for those cases we will need to convert the boolean to int
10581058
if (!result.forced_llvm_bool()) {
1059-
#ifndef OSL_LLVM_OPAQUE_POINTERS
1060-
llvm::Type* resultType = rop.ll.llvm_typeof(
1061-
rop.llvm_get_pointer(result));
1062-
OSL_ASSERT(
1063-
(resultType
1064-
== reinterpret_cast<llvm::Type*>(rop.ll.type_wide_int_ptr()))
1065-
|| (resultType
1066-
== reinterpret_cast<llvm::Type*>(rop.ll.type_int_ptr())));
1067-
llvm::Type* typeOfR = rop.ll.llvm_typeof(i1_res);
1068-
OSL_ASSERT(typeOfR == rop.ll.type_wide_bool()
1069-
|| typeOfR == rop.ll.type_bool());
1070-
#endif
10711059
i1_res = rop.ll.op_bool_to_int(i1_res);
10721060
}
10731061

@@ -2170,15 +2158,6 @@ LLVMGEN(llvm_gen_bitwise_binary_op)
21702158
// We allowed boolean values to pass through or,and,xor
21712159
// so we might need to promote to integer before storage
21722160
if (!Result.forced_llvm_bool()) {
2173-
#ifndef OSL_LLVM_OPAQUE_POINTERS
2174-
llvm::Type* resultType = rop.ll.llvm_typeof(
2175-
rop.llvm_get_pointer(Result));
2176-
OSL_ASSERT(
2177-
(resultType
2178-
== reinterpret_cast<llvm::Type*>(rop.ll.type_wide_int_ptr()))
2179-
|| (resultType
2180-
== reinterpret_cast<llvm::Type*>(rop.ll.type_int_ptr())));
2181-
#endif
21822161
llvm::Type* typeOfR = rop.ll.llvm_typeof(r);
21832162
if (typeOfR == rop.ll.type_wide_bool()
21842163
|| typeOfR == rop.ll.type_bool()) {
@@ -3075,15 +3054,6 @@ LLVMGEN(llvm_gen_compare_op)
30753054
final_result = rop.ll.llvm_mask_to_native(final_result);
30763055
}
30773056
} else {
3078-
#ifndef OSL_LLVM_OPAQUE_POINTERS
3079-
llvm::Type* resultType = rop.ll.llvm_typeof(
3080-
rop.llvm_get_pointer(Result));
3081-
OSL_ASSERT(
3082-
(resultType
3083-
== reinterpret_cast<llvm::Type*>(rop.ll.type_wide_int_ptr()))
3084-
|| (resultType
3085-
== reinterpret_cast<llvm::Type*>(rop.ll.type_int_ptr())));
3086-
#endif
30873057
final_result = rop.ll.op_bool_to_int(final_result);
30883058
}
30893059

0 commit comments

Comments
 (0)