Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4db549061 | ||
|
|
4debd96adc | ||
|
|
30a4a95b7e | ||
|
|
a38aa58c0e | ||
|
|
e126a20df7 | ||
|
|
52cf2ee418 | ||
|
|
83a1e7e74b |
@@ -19,6 +19,11 @@ on:
|
||||
|
||||
permissions: read-all
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -30,9 +35,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- desc: sonary gcc9/C++14 llvm13 py3.9 boost1.76 exr3.1 oiio2.3 avx2
|
||||
- desc: sonar gcc9/C++14 llvm13 py3.9 boost1.76 exr3.1 oiio2.3 avx2
|
||||
nametag: static-analysis-sonar
|
||||
os: ubuntu-latest
|
||||
os: ubuntu-20.04-8c-32g-300h
|
||||
# os: ubuntu-latest
|
||||
vfxyear: 2022
|
||||
vfxsuffix: -clang13
|
||||
cxx_std: 14
|
||||
@@ -40,7 +46,7 @@ jobs:
|
||||
python_ver: 3.9
|
||||
pybind11_ver: v2.9.0
|
||||
simd: avx2,f16c
|
||||
batched: b8_AVX2
|
||||
batched: b8_AVX2,b16_AVX512
|
||||
coverage: 1
|
||||
# skip_tests: 1
|
||||
sonar: 1
|
||||
@@ -71,6 +77,7 @@ jobs:
|
||||
PYTHON_VERSION: ${{matrix.python_ver}}
|
||||
USE_BATCHED: ${{matrix.batched}}
|
||||
USE_SIMD: ${{matrix.simd}}
|
||||
PARALLEL: 24
|
||||
# DEBUG_CI: 1
|
||||
steps:
|
||||
# We would like to use harden-runner, but it flags too many false
|
||||
|
||||
@@ -25,6 +25,11 @@ on:
|
||||
|
||||
permissions: read-all
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ echo "uname -a: " `uname -a`
|
||||
echo "uname -m: " `uname -m`
|
||||
echo "uname -s: " `uname -s`
|
||||
echo "uname -n: " `uname -n`
|
||||
echo "nproc " `nproc`
|
||||
pwd
|
||||
ls
|
||||
env | sort
|
||||
|
||||
@@ -154,15 +154,6 @@ public:
|
||||
void debug_pop_inlined_function();
|
||||
void debug_set_location(OIIO::ustring sourcefile, int sourceline);
|
||||
|
||||
/// Create a new function (that will later be populated with
|
||||
/// instructions) with up to 4 args.
|
||||
OSL_DEPRECATED("Use make_function flavor that takes a cspan (1.12)")
|
||||
llvm::Function* make_function(const std::string& name, bool fastcall,
|
||||
llvm::Type* rettype, llvm::Type* arg1 = NULL,
|
||||
llvm::Type* arg2 = NULL,
|
||||
llvm::Type* arg3 = NULL,
|
||||
llvm::Type* arg4 = NULL);
|
||||
|
||||
/// Create a new function (that will later be populated with
|
||||
/// instructions) with a cspan of args.
|
||||
llvm::Function* make_function(const std::string& name, bool fastcall,
|
||||
|
||||
@@ -1589,29 +1589,26 @@ LLVM_Util::make_jit_execengine(std::string* err, TargetISA requestedISA,
|
||||
|
||||
|
||||
|
||||
namespace /*anonymous*/ {
|
||||
#ifdef OSL_DEV
|
||||
// The return value of llvm::StructLayout::getAlignment()
|
||||
// changed from an int to llvm::Align, hide with accessor function
|
||||
#if OSL_LLVM_VERSION < 100
|
||||
uint64_t
|
||||
inline uint64_t
|
||||
get_alignment(const llvm::StructLayout* layout)
|
||||
{
|
||||
# if OSL_LLVM_VERSION < 100
|
||||
return layout->getAlignment();
|
||||
}
|
||||
#else
|
||||
uint64_t
|
||||
get_alignment(const llvm::StructLayout* layout)
|
||||
{
|
||||
# else
|
||||
return layout->getAlignment().value();
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
|
||||
|
||||
void
|
||||
LLVM_Util::dump_struct_data_layout(llvm::Type* Ty)
|
||||
LLVM_Util::dump_struct_data_layout(llvm::Type* Ty OSL_MAYBE_UNUSED)
|
||||
{
|
||||
#ifdef OSL_DEV
|
||||
OSL_ASSERT(Ty);
|
||||
OSL_ASSERT(Ty->isStructTy());
|
||||
|
||||
@@ -1635,6 +1632,7 @@ LLVM_Util::dump_struct_data_layout(llvm::Type* Ty)
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2449,25 +2447,6 @@ LLVM_Util::internalize_module_functions(
|
||||
|
||||
|
||||
|
||||
llvm::Function*
|
||||
LLVM_Util::make_function(const std::string& name, bool fastcall,
|
||||
llvm::Type* rettype, llvm::Type* arg1,
|
||||
llvm::Type* arg2, llvm::Type* arg3, llvm::Type* arg4)
|
||||
{
|
||||
std::vector<llvm::Type*> argtypes;
|
||||
if (arg1)
|
||||
argtypes.emplace_back(arg1);
|
||||
if (arg2)
|
||||
argtypes.emplace_back(arg2);
|
||||
if (arg3)
|
||||
argtypes.emplace_back(arg3);
|
||||
if (arg4)
|
||||
argtypes.emplace_back(arg4);
|
||||
return make_function(name, fastcall, rettype, argtypes, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
llvm::Function*
|
||||
LLVM_Util::make_function(const std::string& name, bool fastcall,
|
||||
llvm::Type* rettype, cspan<llvm::Type*> params,
|
||||
@@ -5831,6 +5810,7 @@ bool
|
||||
LLVM_Util::ptx_compile_group(llvm::Module* lib_module, const std::string& name,
|
||||
std::string& out)
|
||||
{
|
||||
#ifdef OSL_USE_OPTIX
|
||||
std::string target_triple = module()->getTargetTriple();
|
||||
|
||||
OSL_ASSERT(
|
||||
@@ -5874,9 +5854,9 @@ LLVM_Util::ptx_compile_group(llvm::Module* lib_module, const std::string& name,
|
||||
options.AllowFPOpFusion = llvm::FPOpFusion::Fast;
|
||||
options.NoZerosInBSS = 0;
|
||||
options.GuaranteedTailCallOpt = 0;
|
||||
#if OSL_LLVM_VERSION < 120
|
||||
# if OSL_LLVM_VERSION < 120
|
||||
options.StackAlignmentOverride = 0;
|
||||
#endif
|
||||
# endif
|
||||
options.UseInitArray = 0;
|
||||
|
||||
llvm::TargetMachine* target_machine = llvm_target->createTargetMachine(
|
||||
@@ -5908,15 +5888,15 @@ LLVM_Util::ptx_compile_group(llvm::Module* lib_module, const std::string& name,
|
||||
llvm::raw_svector_ostream assembly_stream(assembly);
|
||||
|
||||
// TODO: Make sure rounding modes, etc., are set correctly
|
||||
#if OSL_LLVM_VERSION >= 100
|
||||
# if OSL_LLVM_VERSION >= 100
|
||||
target_machine->addPassesToEmitFile(mod_pm, assembly_stream,
|
||||
nullptr, // FIXME: Correct?
|
||||
llvm::CGFT_AssemblyFile);
|
||||
#else
|
||||
# else
|
||||
target_machine->addPassesToEmitFile(mod_pm, assembly_stream,
|
||||
nullptr, // FIXME: Correct?
|
||||
llvm::TargetMachine::CGFT_AssemblyFile);
|
||||
#endif
|
||||
# endif
|
||||
|
||||
// Run the optimization passes on the functions
|
||||
fn_pm.doInitialization();
|
||||
@@ -5942,6 +5922,9 @@ LLVM_Util::ptx_compile_group(llvm::Module* lib_module, const std::string& name,
|
||||
delete linked_module;
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ static bool saveptx = false;
|
||||
static bool warmup = false;
|
||||
static bool profile = false;
|
||||
static bool O0 = false, O1 = false, O2 = false;
|
||||
static int llvm_opt = 1; // LLVM optimization level
|
||||
static bool debugnan = false;
|
||||
static bool debug_uninit = false;
|
||||
static bool userdata_isconnected = false;
|
||||
@@ -76,6 +77,15 @@ set_shadingsys_options()
|
||||
if (const char* opt_env = getenv("TESTSHADE_OPT")) // overrides opt
|
||||
opt = atoi(opt_env);
|
||||
shadingsys->attribute("optimize", opt);
|
||||
|
||||
// The cost of more optimization passes usually pays for itself by
|
||||
// reducing the number of instructions JIT ultimately has to lower to
|
||||
// the target ISA.
|
||||
if (const char* llvm_opt_env = getenv(
|
||||
"TESTSHADE_LLVM_OPT")) // overrides llvm_opt
|
||||
llvm_opt = atoi(llvm_opt_env);
|
||||
shadingsys->attribute("llvm_optimize", llvm_opt);
|
||||
|
||||
shadingsys->attribute("profile", int(profile));
|
||||
shadingsys->attribute("lockgeom", 1);
|
||||
shadingsys->attribute("debug_nan", debugnan);
|
||||
@@ -149,6 +159,8 @@ getargs(int argc, const char* argv[])
|
||||
.help("Do a little runtime shader optimization");
|
||||
ap.arg("-O2", &O2)
|
||||
.help("Do lots of runtime shader optimization");
|
||||
ap.arg("--llvm_opt %d:LEVEL", &llvm_opt)
|
||||
.help("LLVM JIT optimization level");
|
||||
ap.arg("--debugnan", &debugnan)
|
||||
.help("Turn on 'debugnan' mode");
|
||||
ap.arg("--path SEARCHPATH", &shaderpath)
|
||||
|
||||
@@ -5,4 +5,6 @@
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
outputs = [ "out.exr" ]
|
||||
command = testrender("-r 256 256 -aa 4 bumptest.xml out.exr")
|
||||
command = testrender("-r 256 256 -aa 4 --llvm_opt 13 bumptest.xml out.exr")
|
||||
|
||||
# Note: we pick this test arbitrarily as the one to verify llvm_opt=13 works
|
||||
|
||||
@@ -7,4 +7,6 @@
|
||||
failthresh = 0.01
|
||||
failpercent = 1
|
||||
outputs = [ "out.exr" ]
|
||||
command = testrender("-r 256 256 -aa 4 cornell.xml out.exr")
|
||||
command = testrender("-r 256 256 -aa 4 --llvm_opt 12 cornell.xml out.exr")
|
||||
|
||||
# Note: we pick this test arbitrarily as the one to verify llvm_opt=12 works
|
||||
|
||||
Reference in New Issue
Block a user