Deps: Update llvm to 15.0.7 + OSL Update #110708

Closed
Ray molenkamp wants to merge 4 commits from LazyDodo/blender:tmp_llvm_15_update into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 13 additions and 64 deletions

View File

@ -154,9 +154,9 @@ set(MINIZIPNG_HASH 09dcc8a9def348e1be9659e384c2cd55)
set(MINIZIPNG_HASH_TYPE MD5)
set(MINIZIPNG_FILE minizip-ng-${MINIZIPNG_VERSION}.tar.gz)
set(LLVM_VERSION 12.0.0)
set(LLVM_VERSION 15.0.7)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
set(LLVM_HASH 5a4fab4d7fc84aefffb118ac2c8a4fc0)
set(LLVM_HASH bac436dbd5d37e38d3da75b03629053c)
set(LLVM_HASH_TYPE MD5)
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
set(LLVM_CPE "cpe:2.3:a:llvm:compiler:${LLVM_VERSION}:*:*:*:*:*:*:*")
@ -208,9 +208,9 @@ set(TIFF_HOMEPAGE http://www.simplesystems.org/libtiff/)
# Recent commit from 1.13.0.2 under development, which includes string table
# changes that make the Cycles OptiX implementation work. Official 1.12 OSL
# releases should also build but without OptiX support.
set(OSL_VERSION 1a7670600c8b08c2443a78d03c8c27e9a1149140)
set(OSL_VERSION 8d1d9f0cf6336ad20a4ed148b8696117258c2b40)
set(OSL_URI https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/${OSL_VERSION}.tar.gz)
set(OSL_HASH 7b6d6716b05d1addb92a8f47280bf77f)
set(OSL_HASH 2c20e3c5ce1259b2359c9f6b8dcea31c)
set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)

View File

@ -1,13 +1,14 @@
--- a/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:24:26.000000000 +0100
+++ b/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:26:25.000000000 +0100
@@ -1200,7 +1200,9 @@
/// implementation.
diff -Naur ll.org/llvm/lib/Support/Unix/Path.inc ll/llvm/lib/Support/Unix/Path.inc
--- ll.org/llvm/lib/Support/Unix/Path.inc 2023-08-01 06:41:14.360891600 -0600
+++ ll/llvm/lib/Support/Unix/Path.inc 2023-08-01 07:20:02.063130200 -0600
@@ -1476,7 +1476,9 @@
std::error_code copy_file(const Twine &From, const Twine &To) {
uint32_t Flag = COPYFILE_DATA;
-#if __has_builtin(__builtin_available) && defined(COPYFILE_CLONE)
std::string FromS = From.str();
std::string ToS = To.str();
-#if __has_builtin(__builtin_available)
+ // BLENDER: This optimization makes LLVM not build on older Xcode versions,
+ // just disable until everyone has new enough Xcode versions.
+#if 0
if (__builtin_available(macos 10.12, *)) {
bool IsSymlink;
if (std::error_code Error = is_symlink_file(From, IsSymlink))
// Optimistically try to use clonefile() and handle errors, rather than
// calling stat() to see if it'll work.

View File

@ -44,37 +44,6 @@ index 8c2e77b..211b8a7 100644
#include <clang/Basic/TargetInfo.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/TextDiagnosticPrinter.h>
diff --git a/src/liboslexec/llvm_instance.cpp b/src/liboslexec/llvm_instance.cpp
index 8f52546..8c2d0c7 100644
--- a/src/liboslexec/llvm_instance.cpp
+++ b/src/liboslexec/llvm_instance.cpp
@@ -1363,6 +1363,10 @@ BackendLLVM::run()
#ifdef OSL_LLVM_NO_BITCODE
OSL_ASSERT(!use_rs_bitcode());
ll.module(ll.new_module("llvm_ops"));
+ if (use_optix()) {
+ ll.module()->setDataLayout("e-i64:64-i128:128-v16:16-v32:32-n16:32:64");
+ ll.module()->setTargetTriple("nvptx64-nvidia-cuda");
+ }
#else
if (!use_optix()) {
if (use_rs_bitcode()) {
diff --git a/src/liboslexec/shadingsys.cpp b/src/liboslexec/shadingsys.cpp
index 46e4529..8e86486 100644
--- a/src/liboslexec/shadingsys.cpp
+++ b/src/liboslexec/shadingsys.cpp
@@ -2121,6 +2121,11 @@ ShadingSystemImpl::getattribute(ShaderGroup* group, string_view name,
return true;
}
+ if (name == "groupdata_size" && type == TypeDesc::TypeInt) {
+ *(int*)val = (int)group->m_llvm_groupdata_size;
+ return true;
+ }
+
return false;
}
diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt
index 6bb0d175..19f13513 100644
--- a/src/liboslexec/CMakeLists.txt
@ -90,24 +59,3 @@ index 6bb0d175..19f13513 100644
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" )
diff --git a/src/include/OSL/mask.h b/src/include/OSL/mask.h
index 24197af..b9275f6 100644
--- a/src/include/OSL/mask.h
+++ b/src/include/OSL/mask.h
@@ -4,7 +4,6 @@
#pragma once
-#include <immintrin.h>
#include <type_traits>
#include <OSL/oslconfig.h>
@@ -23,6 +22,8 @@ using std::countr_zero;
#elif OSL_INTEL_CLASSIC_COMPILER_VERSION
+#include <immintrin.h>
+
OSL_FORCEINLINE int popcount(uint32_t x) noexcept { return _mm_popcnt_u32(x);}
OSL_FORCEINLINE int popcount(uint64_t x) noexcept { return _mm_popcnt_u64(x); }
OSL_FORCEINLINE int countr_zero(uint32_t x) noexcept { return _bit_scan_forward(x); }