Skip to content

Commit

Permalink
Support for LLVM 14 (#1492)
Browse files Browse the repository at this point in the history
API changes we had to take into account:
* TargetRegistry.h location
* No more DisableTailCalls field in PassManagerBuilder.

Needed to update the ref image for render-microfacet test, some sparklies changed.
Looks like the new LLVM probably JITs to ever so slightly different math code, tickling
some LSB differences that at 1 sample per pixel, results in some different sampling
directions leading to fireflies. We decided to just commit a new ref image and move on.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Apr 28, 2022
1 parent a056e18 commit 9cfca93
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -243,7 +243,7 @@ jobs:
setenvs: export LLVM_VERSION=10.0.0
OPENIMAGEIO_CMAKE_FLAGS="-DBUILD_FMT_VERSION=7.0.1"
PUGIXML_VERSION=v1.10
- desc: latest releases gcc11/C++17 llvm12 boost1.71 exr3.1 py3.8 avx2 batch-b16avx512
- desc: latest releases gcc11/C++17 llvm13 boost1.71 exr3.1 py3.8 avx2 batch-b16avx512
nametag: linux-latest-releases
os: ubuntu-20.04
cxx_compiler: g++-11
Expand All @@ -255,11 +255,11 @@ jobs:
python_ver: 3.8
simd: avx2,f16c
batched: b8_AVX2,b8_AVX512,b16_AVX512
setenvs: export LLVM_VERSION=12.0.0
setenvs: export LLVM_VERSION=13.0.0
LLVM_DISTRO_NAME=ubuntu-20.04
OPENCOLORIO_VERSION=v2.1.1
PUGIXML_VERSION=v1.11.4
- desc: bleeding edge gcc11/C++17 llvm13 oiio/ocio/exr/pybind-master boost1.71 py3.9 avx2 batch-b16avx512
- desc: bleeding edge gcc11/C++17 llvm14 oiio/ocio/exr/pybind-master boost1.71 py3.9 avx2 batch-b16avx512
nametag: linux-bleeding-edge
os: ubuntu-20.04
cxx_compiler: g++-11
Expand All @@ -271,8 +271,8 @@ jobs:
python_ver: 3.9
simd: avx2,f16c
batched: b8_AVX2,b8_AVX512,b16_AVX512
setenvs: export LLVM_VERSION=13.0.0
LLVM_DISTRO_NAME=ubuntu-20.04
setenvs: export LLVM_VERSION=14.0.0
LLVM_DISTRO_NAME=ubuntu-18.04
OPENCOLORIO_VERSION=main
PUGIXML_VERSION=master

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Expand Up @@ -40,7 +40,7 @@ NEW or CHANGED dependencies since the last major release are **bold**.
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
DYLD_LIBRARY_PATH on OS X).

* **[LLVM](http://www.llvm.org) 9, 10, 11, 12, or 13**, including clang
* **[LLVM](http://www.llvm.org) 9, 10, 11, 12, 13, or 14**, including clang
libraries.

* [Boost](https://www.boost.org) 1.55 or newer (tested through boost 1.78)
Expand Down
2 changes: 1 addition & 1 deletion src/build-scripts/build_llvm.bash
Expand Up @@ -29,7 +29,7 @@ if [[ `uname` == "Linux" ]] ; then
fi
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
echo LLVMTAR = $LLVMTAR
if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] || [[ "$LLVM_VERSION" == "13.0.0" ]] ; then
if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] || [[ "$LLVM_VERSION" == "13.0.0" ]] || [[ "$LLVM_VERSION" == "14.0.0" ]] || [[ "$LLVM_VERSION" == "14.0.1" ]] ; then
# new
curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
else
Expand Down
6 changes: 4 additions & 2 deletions src/liboslexec/llvm_util.cpp
Expand Up @@ -45,7 +45,11 @@
#include <llvm/Support/raw_os_ostream.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/ValueSymbolTable.h>
#if OSL_LLVM_VERSION < 140
#include <llvm/Support/TargetRegistry.h>
#else
#include <llvm/MC/TargetRegistry.h>
#endif

#include <llvm/Bitcode/BitcodeReader.h>
#include <llvm/Bitcode/BitcodeWriter.h>
Expand Down Expand Up @@ -1677,8 +1681,6 @@ LLVM_Util::setup_optimization_passes (int optlevel, bool target_host)
builder.DisableUnrollLoops = false;
builder.SLPVectorize = false;
builder.LoopVectorize = false;
builder.DisableTailCalls = false;

if (target_machine)
target_machine->adjustPassManager(builder);

Expand Down
Binary file added testsuite/render-microfacet/ref/out-llvm14.exr
Binary file not shown.

0 comments on commit 9cfca93

Please sign in to comment.