From d7c53d58017f72de5c174e96e6d5048bef3dd725 Mon Sep 17 00:00:00 2001 From: Michail Boulasikis Date: Wed, 22 Oct 2025 15:17:26 +0900 Subject: [PATCH 1/7] added LLVM 21 support - semantics remain to be checked --- pass/Raptor.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/pass/Raptor.cpp b/pass/Raptor.cpp index d9922510..3f11d5d7 100644 --- a/pass/Raptor.cpp +++ b/pass/Raptor.cpp @@ -109,7 +109,11 @@ bool attributeKnownFunctions(llvm::Function &F) { if (F.getName() == "fprintf") { for (auto &arg : F.args()) { if (arg.getType()->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + arg.addAttr(Attribute::get(F.getContext(), "captures", "none")); +#else arg.addAttr(Attribute::NoCapture); +#endif changed = true; } } @@ -132,7 +136,11 @@ bool attributeKnownFunctions(llvm::Function &F) { for (auto &arg : F.args()) { if (arg.getType()->isPointerTy()) { arg.addAttr(Attribute::ReadNone); +#if LLVM_VERSION_MAJOR >= 21 + arg.addAttr(Attribute::get(F.getContext(), "captures", "none")); +#else arg.addAttr(Attribute::NoCapture); +#endif } } } @@ -152,7 +160,11 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); for (int i = 0; i < 2; i++) if (F.getFunctionType()->getParamType(i)->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + F.addParamAttr(i, Attribute::get(F.getContext(), "captures", "none")); +#else F.addParamAttr(i, Attribute::NoCapture); +#endif F.addParamAttr(i, Attribute::WriteOnly); } } @@ -176,7 +188,11 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); F.addParamAttr(0, Attribute::WriteOnly); if (F.getFunctionType()->getParamType(2)->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + F.addParamAttr(2, Attribute::get(F.getContext(), "captures", "none")); +#else F.addParamAttr(2, Attribute::NoCapture); +#endif F.addParamAttr(2, Attribute::WriteOnly); } F.addParamAttr(6, Attribute::WriteOnly); @@ -195,7 +211,11 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); F.addParamAttr(0, Attribute::ReadOnly); if (F.getFunctionType()->getParamType(2)->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + F.addParamAttr(2, Attribute::get(F.getContext(), "captures", "none")); +#else F.addParamAttr(2, Attribute::NoCapture); +#endif F.addParamAttr(2, Attribute::ReadOnly); } F.addParamAttr(6, Attribute::WriteOnly); @@ -215,12 +235,20 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); if (F.getFunctionType()->getParamType(0)->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + F.addParamAttr(0, Attribute::get(F.getContext(), "captures", "none")); +#else F.addParamAttr(0, Attribute::NoCapture); +#endif F.addParamAttr(0, Attribute::ReadOnly); } if (F.getFunctionType()->getParamType(1)->isPointerTy()) { F.addParamAttr(1, Attribute::WriteOnly); +#if LLVM_VERSION_MAJOR >= 21 + F.addParamAttr(1, Attribute::get(F.getContext(), "captures", "none")); +#else F.addParamAttr(1, Attribute::NoCapture); +#endif } } if (F.getName() == "MPI_Wait" || F.getName() == "PMPI_Wait") { @@ -230,9 +258,14 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::WillReturn); F.addFnAttr(Attribute::NoFree); F.addFnAttr(Attribute::NoSync); +#if LLVM_VERSION_MAJOR >= 21 + F.addParamAttr(0, Attribute::get(F.getContext(), "captures", "none")); + F.addParamAttr(1, Attribute::get(F.getContext(), "captures", "none")); +#else F.addParamAttr(0, Attribute::NoCapture); - F.addParamAttr(1, Attribute::WriteOnly); F.addParamAttr(1, Attribute::NoCapture); +#endif + F.addParamAttr(1, Attribute::WriteOnly); } if (F.getName() == "MPI_Waitall" || F.getName() == "PMPI_Waitall") { changed = true; @@ -241,9 +274,14 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::WillReturn); F.addFnAttr(Attribute::NoFree); F.addFnAttr(Attribute::NoSync); +#if LLVM_VERSION_MAJOR >= 21 + F.addParamAttr(1, Attribute::get(F.getContext(), "captures", "none")); + F.addParamAttr(2, Attribute::get(F.getContext(), "captures", "none")); +#else F.addParamAttr(1, Attribute::NoCapture); - F.addParamAttr(2, Attribute::WriteOnly); F.addParamAttr(2, Attribute::NoCapture); +#endif + F.addParamAttr(2, Attribute::WriteOnly); } // Map of MPI function name to the arg index of its type argument std::map MPI_TYPE_ARGS = { @@ -825,9 +863,14 @@ class RaptorBase { CI->addAttribute(AttributeList::FunctionIndex, Attribute::ReadOnly); #endif CI->addParamAttr(1, Attribute::ReadOnly); - CI->addParamAttr(1, Attribute::NoCapture); CI->addParamAttr(3, Attribute::ReadOnly); +#if LLVM_VERSION_MAJOR >= 21 + CI->addParamAttr(1, Attribute::get(CI->getContext(), "captures", "none")); + CI->addParamAttr(3, Attribute::get(CI->getContext(), "captures", "none")); +#else + CI->addParamAttr(1, Attribute::NoCapture); CI->addParamAttr(3, Attribute::NoCapture); +#endif } if (Fn->getName() == "frexp" || Fn->getName() == "frexpf" || Fn->getName() == "frexpl") { @@ -888,7 +931,11 @@ class RaptorBase { for (size_t i : {0, 1}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); +#else CI->addParamAttr(i, Attribute::NoCapture); +#endif } } } @@ -913,7 +960,11 @@ class RaptorBase { for (size_t i : {0, 2}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); +#else CI->addParamAttr(i, Attribute::NoCapture); +#endif } } } @@ -939,7 +990,11 @@ class RaptorBase { for (size_t i : {0, 1, 2, 3}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); +#else CI->addParamAttr(i, Attribute::NoCapture); +#endif } } } @@ -965,7 +1020,11 @@ class RaptorBase { for (size_t i : {0}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { +#if LLVM_VERSION_MAJOR >= 21 + CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); +#else CI->addParamAttr(i, Attribute::NoCapture); +#endif } } } @@ -987,7 +1046,11 @@ class RaptorBase { for (size_t i = 0; i < num_args; ++i) { if (CI->getArgOperand(i)->getType()->isPointerTy()) { CI->addParamAttr(i, Attribute::ReadOnly); +#if LLVM_VERSION_MAJOR >= 21 + CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); +#else CI->addParamAttr(i, Attribute::NoCapture); +#endif } } } From 2659dc306838abd1840a8a2bff48aa67e9a81cf6 Mon Sep 17 00:00:00 2001 From: Michail Boulasikis Date: Wed, 22 Oct 2025 16:53:35 +0900 Subject: [PATCH 2/7] Small Readme.md fixes --- Readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 1dccb84e..0032f1d3 100644 --- a/Readme.md +++ b/Readme.md @@ -118,16 +118,16 @@ or if using `lld` directly: Suppose your original code looks like this: ``` c++ -void bar(float a, float b) { +float bar(float a, float b) { return a + b; } -void foo(float *a, float b) { +float foo(float *a, float b) { a[0] = sqrt(b); return bar(a[1], b); } ... - foo(a, b) + foo(a, b); ... ``` From 74d123548cb06f14e3ac1800c17f803cdfd75d1d Mon Sep 17 00:00:00 2001 From: Michail Boulasikis Date: Thu, 23 Oct 2025 09:35:06 +0900 Subject: [PATCH 3/7] Refactored new version code with functions, added testing matrix case --- .github/workflows/check-all.yml | 2 +- pass/Raptor.cpp | 124 +++++++++++--------------------- 2 files changed, 43 insertions(+), 83 deletions(-) diff --git a/.github/workflows/check-all.yml b/.github/workflows/check-all.yml index 7dae7547..64f84c3b 100644 --- a/.github/workflows/check-all.yml +++ b/.github/workflows/check-all.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - llvm: ["20"] + llvm: ["20", "21"] build: ["Release"] #, "Debug"] #, "RelWithDebInfo"] os: [ubuntu-22.04] diff --git a/pass/Raptor.cpp b/pass/Raptor.cpp index 3f11d5d7..e94da9c5 100644 --- a/pass/Raptor.cpp +++ b/pass/Raptor.cpp @@ -102,6 +102,30 @@ llvm::cl::opt RaptorTruncateAccessCount( "raptor-truncate-access-count", cl::init(false), cl::Hidden, cl::desc("Count all floating-point loads and stores.")); +void addNoCapture(CallInst *CI, unsigned ArgNo) { +#if LLVM_VERSION_MAJOR >= 21 + CI->addParamAttr(ArgNo, Attribute::get(CI->getContext(), "captures", "none")); +#else + CI->addParamAttr(ArgNo, Attribute::NoCapture); +#endif +} + +void addNoCapture(llvm::Function *F, llvm::Argument &Arg) { +#if LLVM_VERSION_MAJOR >= 21 + Arg.addAttr(Attribute::get(F->getContext(), "captures", "none")); +#else + Arg.addAttr(Attribute::NoCapture); +#endif +} + +void addNoCapture(llvm::Function *F, unsigned ArgNo) { +#if LLVM_VERSION_MAJOR >= 21 + F->addParamAttr(ArgNo, Attribute::get(F->getContext(), "captures", "none")); +#else + F->addParamAttr(ArgNo, Attribute::NoCapture); +#endif +} + #define addAttribute addAttributeAtIndex #define getAttribute getAttributeAtIndex bool attributeKnownFunctions(llvm::Function &F) { @@ -109,11 +133,7 @@ bool attributeKnownFunctions(llvm::Function &F) { if (F.getName() == "fprintf") { for (auto &arg : F.args()) { if (arg.getType()->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - arg.addAttr(Attribute::get(F.getContext(), "captures", "none")); -#else - arg.addAttr(Attribute::NoCapture); -#endif + addNoCapture(&F, arg); changed = true; } } @@ -136,11 +156,7 @@ bool attributeKnownFunctions(llvm::Function &F) { for (auto &arg : F.args()) { if (arg.getType()->isPointerTy()) { arg.addAttr(Attribute::ReadNone); -#if LLVM_VERSION_MAJOR >= 21 - arg.addAttr(Attribute::get(F.getContext(), "captures", "none")); -#else - arg.addAttr(Attribute::NoCapture); -#endif + addNoCapture(&F, arg); } } } @@ -160,11 +176,7 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); for (int i = 0; i < 2; i++) if (F.getFunctionType()->getParamType(i)->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - F.addParamAttr(i, Attribute::get(F.getContext(), "captures", "none")); -#else - F.addParamAttr(i, Attribute::NoCapture); -#endif + addNoCapture(&F, i); F.addParamAttr(i, Attribute::WriteOnly); } } @@ -188,11 +200,7 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); F.addParamAttr(0, Attribute::WriteOnly); if (F.getFunctionType()->getParamType(2)->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - F.addParamAttr(2, Attribute::get(F.getContext(), "captures", "none")); -#else - F.addParamAttr(2, Attribute::NoCapture); -#endif + addNoCapture(&F, 2); F.addParamAttr(2, Attribute::WriteOnly); } F.addParamAttr(6, Attribute::WriteOnly); @@ -211,11 +219,7 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); F.addParamAttr(0, Attribute::ReadOnly); if (F.getFunctionType()->getParamType(2)->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - F.addParamAttr(2, Attribute::get(F.getContext(), "captures", "none")); -#else - F.addParamAttr(2, Attribute::NoCapture); -#endif + addNoCapture(&F, 2); F.addParamAttr(2, Attribute::ReadOnly); } F.addParamAttr(6, Attribute::WriteOnly); @@ -235,20 +239,12 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::NoSync); if (F.getFunctionType()->getParamType(0)->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - F.addParamAttr(0, Attribute::get(F.getContext(), "captures", "none")); -#else - F.addParamAttr(0, Attribute::NoCapture); -#endif + addNoCapture(&F, 0); F.addParamAttr(0, Attribute::ReadOnly); } if (F.getFunctionType()->getParamType(1)->isPointerTy()) { F.addParamAttr(1, Attribute::WriteOnly); -#if LLVM_VERSION_MAJOR >= 21 - F.addParamAttr(1, Attribute::get(F.getContext(), "captures", "none")); -#else - F.addParamAttr(1, Attribute::NoCapture); -#endif + addNoCapture(&F, 1); } } if (F.getName() == "MPI_Wait" || F.getName() == "PMPI_Wait") { @@ -258,13 +254,8 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::WillReturn); F.addFnAttr(Attribute::NoFree); F.addFnAttr(Attribute::NoSync); -#if LLVM_VERSION_MAJOR >= 21 - F.addParamAttr(0, Attribute::get(F.getContext(), "captures", "none")); - F.addParamAttr(1, Attribute::get(F.getContext(), "captures", "none")); -#else - F.addParamAttr(0, Attribute::NoCapture); - F.addParamAttr(1, Attribute::NoCapture); -#endif + addNoCapture(&F, 0); + addNoCapture(&F, 1); F.addParamAttr(1, Attribute::WriteOnly); } if (F.getName() == "MPI_Waitall" || F.getName() == "PMPI_Waitall") { @@ -274,13 +265,8 @@ bool attributeKnownFunctions(llvm::Function &F) { F.addFnAttr(Attribute::WillReturn); F.addFnAttr(Attribute::NoFree); F.addFnAttr(Attribute::NoSync); -#if LLVM_VERSION_MAJOR >= 21 - F.addParamAttr(1, Attribute::get(F.getContext(), "captures", "none")); - F.addParamAttr(2, Attribute::get(F.getContext(), "captures", "none")); -#else - F.addParamAttr(1, Attribute::NoCapture); - F.addParamAttr(2, Attribute::NoCapture); -#endif + addNoCapture(&F, 1); + addNoCapture(&F, 2); F.addParamAttr(2, Attribute::WriteOnly); } // Map of MPI function name to the arg index of its type argument @@ -864,13 +850,8 @@ class RaptorBase { #endif CI->addParamAttr(1, Attribute::ReadOnly); CI->addParamAttr(3, Attribute::ReadOnly); -#if LLVM_VERSION_MAJOR >= 21 - CI->addParamAttr(1, Attribute::get(CI->getContext(), "captures", "none")); - CI->addParamAttr(3, Attribute::get(CI->getContext(), "captures", "none")); -#else - CI->addParamAttr(1, Attribute::NoCapture); - CI->addParamAttr(3, Attribute::NoCapture); -#endif + addNoCapture(CI, 1); + addNoCapture(CI, 3); } if (Fn->getName() == "frexp" || Fn->getName() == "frexpf" || Fn->getName() == "frexpl") { @@ -931,11 +912,7 @@ class RaptorBase { for (size_t i : {0, 1}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); -#else - CI->addParamAttr(i, Attribute::NoCapture); -#endif + addNoCapture(CI, i); } } } @@ -960,11 +937,7 @@ class RaptorBase { for (size_t i : {0, 2}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); -#else - CI->addParamAttr(i, Attribute::NoCapture); -#endif + addNoCapture(CI, i); } } } @@ -990,11 +963,7 @@ class RaptorBase { for (size_t i : {0, 1, 2, 3}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); -#else - CI->addParamAttr(i, Attribute::NoCapture); -#endif + addNoCapture(CI, i); } } } @@ -1020,11 +989,7 @@ class RaptorBase { for (size_t i : {0}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { -#if LLVM_VERSION_MAJOR >= 21 - CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); -#else - CI->addParamAttr(i, Attribute::NoCapture); -#endif + addNoCapture(CI, i); } } } @@ -1046,11 +1011,7 @@ class RaptorBase { for (size_t i = 0; i < num_args; ++i) { if (CI->getArgOperand(i)->getType()->isPointerTy()) { CI->addParamAttr(i, Attribute::ReadOnly); -#if LLVM_VERSION_MAJOR >= 21 - CI->addParamAttr(i, Attribute::get(CI->getContext(), "captures", "none")); -#else - CI->addParamAttr(i, Attribute::NoCapture); -#endif + addNoCapture(CI, i); } } } @@ -1548,7 +1509,6 @@ void augmentPassBuilder(llvm::PassBuilder &PB) { FPM.addPass(JumpThreadingPass()); - // Break up allocas FPM.addPass(SROAPass(SROAOptions::ModifyCFG)); From 9962e78bb264d6358667f628baa511bf86c4b486 Mon Sep 17 00:00:00 2001 From: Michail Boulasikis Date: Thu, 23 Oct 2025 10:58:01 +0900 Subject: [PATCH 4/7] Skipping fortran integration tests in LLVM versions 21 and 22 due to external flang issues --- pass/Raptor.cpp | 2 +- test/Integration/Truncate/Fortran/simple-no-bindc.f90 | 3 +++ test/Integration/Truncate/Fortran/simple.f90 | 3 +++ test/lit.site.cfg.py.in | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pass/Raptor.cpp b/pass/Raptor.cpp index e94da9c5..532b215f 100644 --- a/pass/Raptor.cpp +++ b/pass/Raptor.cpp @@ -937,7 +937,7 @@ class RaptorBase { for (size_t i : {0, 2}) { if (i < num_args && CI->getArgOperand(i)->getType()->isPointerTy()) { - addNoCapture(CI, i); + addNoCapture(CI, i); } } } diff --git a/test/Integration/Truncate/Fortran/simple-no-bindc.f90 b/test/Integration/Truncate/Fortran/simple-no-bindc.f90 index 2ac8b5f5..d4c19433 100644 --- a/test/Integration/Truncate/Fortran/simple-no-bindc.f90 +++ b/test/Integration/Truncate/Fortran/simple-no-bindc.f90 @@ -1,3 +1,6 @@ +! ! Circumvent tests in versions where LLVM ships with a non-functional flang +! ! (see https://github.com/llvm/llvm-project/issues/138340 ) +! XFAIL: %LLVM_MAJOR == 21 || %LLVM_MAJOR == 22 ! RUN: %flang -O1 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O2 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O3 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s diff --git a/test/Integration/Truncate/Fortran/simple.f90 b/test/Integration/Truncate/Fortran/simple.f90 index 3befb534..6053fb67 100644 --- a/test/Integration/Truncate/Fortran/simple.f90 +++ b/test/Integration/Truncate/Fortran/simple.f90 @@ -1,3 +1,6 @@ +! ! Circumvent tests in versions where LLVM ships with a non-functional flang +! ! (see https://github.com/llvm/llvm-project/issues/138340 ) +! XFAIL: %LLVM_MAJOR == 21 || %LLVM_MAJOR == 22 ! RUN: %flang -O0 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O1 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O2 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s diff --git a/test/lit.site.cfg.py.in b/test/lit.site.cfg.py.in index 47597b65..22c444d4 100644 --- a/test/lit.site.cfg.py.in +++ b/test/lit.site.cfg.py.in @@ -44,6 +44,9 @@ except KeyError: # directories. config.excludes = ['Inputs'] +# Used when checking for major LLVM versions if tests are expected to fail +config.substitutions.append(('%LLVM_MAJOR', config.llvm_ver)) + config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) config.substitutions.append(('%lli', config.llvm_tools_dir + "/lli" + (" --jit-kind=mcjit" if int(config.llvm_ver) >= 13 else "") )) From 1dc890d31e09fb48b5f2cb069ec3f57a4371acab Mon Sep 17 00:00:00 2001 From: Michail Boulasikis Date: Thu, 23 Oct 2025 10:58:58 +0900 Subject: [PATCH 5/7] Added support for new barrier intrinsics in LLVM 21+ --- test/Unit/Truncate/intrinsic.ll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Unit/Truncate/intrinsic.ll b/test/Unit/Truncate/intrinsic.ll index 6d59328d..16d2d1a7 100644 --- a/test/Unit/Truncate/intrinsic.ll +++ b/test/Unit/Truncate/intrinsic.ll @@ -45,7 +45,7 @@ entry: ; CHECK-DAG: call double @__raptor_fprt_ieee_64_intr_llvm_pow_f64( ; CHECK-DAG: call double @__raptor_fprt_ieee_64_intr_llvm_powi_f64_i16( ; CHECK-DAG: call double @__raptor_fprt_ieee_64_binop_fadd( -; CHECK-DAG: call void @llvm.nvvm.barrier0() +; CHECK-DAG: call void @llvm.nvvm.barrier ; CHECK: define internal double @__raptor_done_truncate_op_func_ieee_64_to_ieee_32_0_0_0_f( ; CHECK-DAG: fptrunc @@ -58,4 +58,4 @@ entry: ; CHECK-DAG: call double @__raptor_fprt_ieee_64_intr_llvm_pow_f64( ; CHECK-DAG: call double @__raptor_fprt_ieee_64_intr_llvm_powi_f64_i16( ; CHECK-DAG: call double @__raptor_fprt_ieee_64_binop_fadd( -; CHECK-DAG: call void @llvm.nvvm.barrier0() +; CHECK-DAG: call void @llvm.nvvm.barrier From ed5d36a3dc4b0d57d8ee742af787ab5ecfccb8e7 Mon Sep 17 00:00:00 2001 From: Michail Boulasikis Date: Thu, 23 Oct 2025 11:25:00 +0900 Subject: [PATCH 6/7] Fixed XFAIL syntax and expectations. --- test/Integration/Truncate/Fortran/simple-no-bindc.f90 | 2 +- test/Integration/Truncate/Fortran/simple.f90 | 2 +- test/lit.site.cfg.py.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Integration/Truncate/Fortran/simple-no-bindc.f90 b/test/Integration/Truncate/Fortran/simple-no-bindc.f90 index d4c19433..5ee74ffa 100644 --- a/test/Integration/Truncate/Fortran/simple-no-bindc.f90 +++ b/test/Integration/Truncate/Fortran/simple-no-bindc.f90 @@ -1,6 +1,6 @@ ! ! Circumvent tests in versions where LLVM ships with a non-functional flang ! ! (see https://github.com/llvm/llvm-project/issues/138340 ) -! XFAIL: %LLVM_MAJOR == 21 || %LLVM_MAJOR == 22 +! XFAIL: llvm-major:{{21|22}} ! RUN: %flang -O1 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O2 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O3 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s diff --git a/test/Integration/Truncate/Fortran/simple.f90 b/test/Integration/Truncate/Fortran/simple.f90 index 6053fb67..dfe7e904 100644 --- a/test/Integration/Truncate/Fortran/simple.f90 +++ b/test/Integration/Truncate/Fortran/simple.f90 @@ -1,6 +1,6 @@ ! ! Circumvent tests in versions where LLVM ships with a non-functional flang ! ! (see https://github.com/llvm/llvm-project/issues/138340 ) -! XFAIL: %LLVM_MAJOR == 21 || %LLVM_MAJOR == 22 +! XFAIL: llvm-major:{{21|22}} ! RUN: %flang -O0 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O1 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O2 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s diff --git a/test/lit.site.cfg.py.in b/test/lit.site.cfg.py.in index 22c444d4..35d732cc 100644 --- a/test/lit.site.cfg.py.in +++ b/test/lit.site.cfg.py.in @@ -45,7 +45,7 @@ except KeyError: config.excludes = ['Inputs'] # Used when checking for major LLVM versions if tests are expected to fail -config.substitutions.append(('%LLVM_MAJOR', config.llvm_ver)) +config.available_features.add('llvm-major:' + config.llvm_ver) config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) config.substitutions.append(('%lli', config.llvm_tools_dir + "/lli" + (" --jit-kind=mcjit" if int(config.llvm_ver) >= 13 else "") From a6f75cd9461bc90fc771c955eb37cde13c56aa3c Mon Sep 17 00:00:00 2001 From: Michail Boulasikis Date: Thu, 23 Oct 2025 11:32:38 +0900 Subject: [PATCH 7/7] Removed colon and added equals sign --- test/Integration/Truncate/Fortran/simple-no-bindc.f90 | 2 +- test/Integration/Truncate/Fortran/simple.f90 | 2 +- test/lit.site.cfg.py.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Integration/Truncate/Fortran/simple-no-bindc.f90 b/test/Integration/Truncate/Fortran/simple-no-bindc.f90 index 5ee74ffa..79f48165 100644 --- a/test/Integration/Truncate/Fortran/simple-no-bindc.f90 +++ b/test/Integration/Truncate/Fortran/simple-no-bindc.f90 @@ -1,6 +1,6 @@ ! ! Circumvent tests in versions where LLVM ships with a non-functional flang ! ! (see https://github.com/llvm/llvm-project/issues/138340 ) -! XFAIL: llvm-major:{{21|22}} +! XFAIL: llvm-major={{21|22}} ! RUN: %flang -O1 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O2 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O3 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s diff --git a/test/Integration/Truncate/Fortran/simple.f90 b/test/Integration/Truncate/Fortran/simple.f90 index dfe7e904..a53c2831 100644 --- a/test/Integration/Truncate/Fortran/simple.f90 +++ b/test/Integration/Truncate/Fortran/simple.f90 @@ -1,6 +1,6 @@ ! ! Circumvent tests in versions where LLVM ships with a non-functional flang ! ! (see https://github.com/llvm/llvm-project/issues/138340 ) -! XFAIL: llvm-major:{{21|22}} +! XFAIL: llvm-major={{21|22}} ! RUN: %flang -O0 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O1 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s ! RUN: %flang -O2 %s -o %t.a.out %loadFlangRaptor %linkRaptorRT -lm -lmpfr && %t.a.out 100000 2 | FileCheck %s diff --git a/test/lit.site.cfg.py.in b/test/lit.site.cfg.py.in index 35d732cc..6c456a51 100644 --- a/test/lit.site.cfg.py.in +++ b/test/lit.site.cfg.py.in @@ -45,7 +45,7 @@ except KeyError: config.excludes = ['Inputs'] # Used when checking for major LLVM versions if tests are expected to fail -config.available_features.add('llvm-major:' + config.llvm_ver) +config.available_features.add('llvm-major=' + config.llvm_ver) config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) config.substitutions.append(('%lli', config.llvm_tools_dir + "/lli" + (" --jit-kind=mcjit" if int(config.llvm_ver) >= 13 else "")