From 0ae9f44665b0eda2e3a2bd0601dbdee5aec821ab Mon Sep 17 00:00:00 2001 From: Eric Schweitz Date: Thu, 21 Sep 2023 11:55:18 -0700 Subject: [PATCH] Fix #633: Bump the LLVM version to 16.0.6. (#676) * Fix #633: Bump the LLVM version to 16.0.6. This changes the internal llvm (tpls/llvm) to point to a SHA on the release/16.x branch. This SHA corresponds to version 16.0.6. Documentation should be updated to refer to LLVM 16.0.6 as the latest version supported. Add workaround for unsigned integer constants as template arguments. Move the subdirectory up in the file to avoid it getting "lost". It's not clear what the bug is towards the end of the file that was causing it to be omitted in my workspace setup. * Update lib/Frontend/nvqpp/ConvertDecl.cpp Co-authored-by: Ben Howe <141149032+bmhowe23@users.noreply.github.com> --------- Co-authored-by: Ben Howe <141149032+bmhowe23@users.noreply.github.com> --- lib/Frontend/nvqpp/ConvertDecl.cpp | 7 ++++++- tpls/llvm | 2 +- unittests/CMakeLists.txt | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/Frontend/nvqpp/ConvertDecl.cpp b/lib/Frontend/nvqpp/ConvertDecl.cpp index 1e75f6dedd..b116383498 100644 --- a/lib/Frontend/nvqpp/ConvertDecl.cpp +++ b/lib/Frontend/nvqpp/ConvertDecl.cpp @@ -157,7 +157,12 @@ bool QuakeBridgeVisitor::interceptRecordDecl(clang::RecordDecl *x) { auto templArg = tempSpec->getTemplateArgs()[0]; assert(templArg.getKind() == clang::TemplateArgument::ArgKind::Integral); - std::int64_t size = templArg.getAsIntegral().getExtValue(); + auto getExtValueHelper = [](auto v) -> std::int64_t { + if (v.isUnsigned()) + return static_cast(v.getZExtValue()); + return v.getSExtValue(); + }; + std::int64_t size = getExtValueHelper(templArg.getAsIntegral()); if (size != static_cast(std::dynamic_extent)) return pushType(quake::VeqType::get(ctx, size)); } diff --git a/tpls/llvm b/tpls/llvm index c0b45fef15..7cbf1a2591 160000 --- a/tpls/llvm +++ b/tpls/llvm @@ -1 +1 @@ -Subproject commit c0b45fef155fbe3f17f9a6f99074682c69545488 +Subproject commit 7cbf1a2591520c2491aa35339f227775f4d3adf6 diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index c6de856e3e..bbd058f653 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -133,6 +133,8 @@ target_link_libraries(test_spin gtest_main) gtest_discover_tests(test_spin) +add_subdirectory(plugin) + # build the test qudit execution manager add_subdirectory(qudit) add_executable(test_qudit main.cpp qudit/SimpleQuditTester.cpp) @@ -183,5 +185,3 @@ if (CUDAQ_ENABLE_PYTHON) TEST_SUFFIX _Sampling PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/python") endif() -add_subdirectory(plugin) -