diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-08-01 12:43:51 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-01 12:43:51 +0800 |
| commit | c34a7b6627d4c07531daf7d99dceaf7f89bd1c0a (patch) | |
| tree | 36eef7ee055c3706bce32493f47fddb5c0af3a4f /source/compiler-core | |
| parent | 5349241098076bead63f638daf2e4b9a9cb3e496 (diff) | |
Generalize collectInductionValues (#3031)
* Generalize collectInductionValues
* Support affine transformations of loop index as induction variables
* Test for generalized induction value collection
* Neaten inductive variable finding
* Store the type of implication success when finding inductive variables
* Test that loop induction finding does not alway succeed
* Support chains of additions and branches of additions in induction variable finding
* Use c++17 for downstream compilers
Diffstat (limited to 'source/compiler-core')
| -rw-r--r-- | source/compiler-core/slang-gcc-compiler-util.cpp | 15 | ||||
| -rw-r--r-- | source/compiler-core/slang-nvrtc-compiler.cpp | 5 |
2 files changed, 9 insertions, 11 deletions
diff --git a/source/compiler-core/slang-gcc-compiler-util.cpp b/source/compiler-core/slang-gcc-compiler-util.cpp index f003ffb0f..c4354f40e 100644 --- a/source/compiler-core/slang-gcc-compiler-util.cpp +++ b/source/compiler-core/slang-gcc-compiler-util.cpp @@ -466,8 +466,8 @@ static SlangResult _parseGCCFamilyLine(SliceAllocator& allocator, const UnownedS { cmdLine.addArg("-fvisibility=hidden"); - // Need C++14 for partial specialization - cmdLine.addArg("-std=c++14"); + // C++17 since we share headers with slang itself (which uses c++17) + cmdLine.addArg("-std=c++17"); } // TODO(JS): Here we always set -m32 on x86. It could be argued it is only necessary when creating a shared library @@ -696,19 +696,16 @@ static SlangResult _parseGCCFamilyLine(SliceAllocator& allocator, const UnownedS ComPtr<IDownstreamCompiler> compiler; if (SLANG_SUCCEEDED(createCompiler(ExecutableLocation(path, "g++"), compiler))) { - // A downstream compiler for Slang must currently support C++14 - such that + // A downstream compiler for Slang must currently support C++17 - such that // the prelude and generated code works. // - // The first version of gcc that supports `-std=c++14` is 5.0 + // The first version of gcc that supports stable `-std=c++17` is 9.0 // https://gcc.gnu.org/projects/cxx-status.html - // - // If could be argued to allow C/C++ compilations via older versions through an older version - // but that requires some more complex behavior, so we don't allow for now. auto desc = compiler->getDesc(); - if (desc.version.m_major < 5) + if (desc.version.m_major < 9) { - // If the version isn't 5 or higher, we don't add this version of the compiler. + // If the version isn't 9 or higher, we don't add this version of the compiler. return SLANG_OK; } diff --git a/source/compiler-core/slang-nvrtc-compiler.cpp b/source/compiler-core/slang-nvrtc-compiler.cpp index e2f3e678c..c756955ec 100644 --- a/source/compiler-core/slang-nvrtc-compiler.cpp +++ b/source/compiler-core/slang-nvrtc-compiler.cpp @@ -784,8 +784,9 @@ SlangResult NVRTCDownstreamCompiler::compile(const DownstreamCompileOptions& inO // Neither of these options are strictly required, for general use of nvrtc, // but are enabled to make use withing Slang work more smoothly { - // Require c++14, as makes initialization construction with {} available and so simplifies code generation - cmdLine.addArg("-std=c++14"); + // Require c++17, the default at the time of writing, since we share + // some functionality between slang itself and the compiled code + cmdLine.addArg("-std=c++17"); // Disable all warnings // This is arguably too much - but nvrtc does not appear to have a mechanism to switch off individual warnings. |
