Skip to content

Commit d58868e

Browse files
asantagatatpatki
andauthored
Pin PFA to Clang-20
Add changes to support clang-20. --------- Co-authored-by: Tapasya Patki <[email protected]>
1 parent b0a4343 commit d58868e

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

.github/workflows/github-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
run: |
6363
sudo apt-get update
6464
sudo apt install clang-20 llvm-dev libjansson-dev libssl-dev bison flex make cmake mpich pybind11-dev
65-
clang++ --version
65+
clang++-20 --version
6666
6767
- name: Clone Caliper
6868
uses: actions/checkout@v2
@@ -84,7 +84,7 @@ jobs:
8484
cd src/c
8585
mkdir build install
8686
cd build
87-
export CMAKE_OPTS="-DCMAKE_CXX_COMPILER=clang++ -DLLVM_DIR=/usr/lib/llvm-18/cmake -DCMAKE_INSTALL_PREFIX=../install"
87+
export CMAKE_OPTS="-DCMAKE_CXX_COMPILER=clang++-20 -DLLVM_DIR=/usr/lib/llvm-20/cmake -DCMAKE_INSTALL_PREFIX=../install"
8888
export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_BUILD_TYPE=${{matrix.CMAKE_BUILD_TYPE}}"
8989
export CMAKE_OPTS="${CMAKE_OPTS} -DPERFFLOWASPECT_WITH_CUDA=${{matrix.PERFFLOWASPECT_WITH_CUDA}}"
9090
export CMAKE_OPTS="${CMAKE_OPTS} -DPERFFLOWASPECT_WITH_MPI=${{matrix.PERFFLOWASPECT_WITH_MPI}}"

src/c/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ project(PerfFlowAspect VERSION "0.1.0")
55
# Higher-level build options.
66
option(PERFFLOWASPECT_WITH_CALIPER "Build with Caliper support" OFF)
77

8-
# Fail if using Clang < 18.0
8+
# Fail if using Clang < 20.0
99
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
10-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
11-
message(FATAL_ERROR "Clang++ version must be equal to 18.0!")
10+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20.0)
11+
message(FATAL_ERROR "Clang++ version must be equal to 20.0!")
1212
endif()
1313
else()
14-
message(FATAL_ERROR "Unsupported CXX compiler: please use Clang == 18.0")
14+
message(FATAL_ERROR "Unsupported CXX compiler: please use Clang == 20.0")
1515
endif()
1616

1717
include(cmake/CMakeBasics.cmake)

src/c/host-configs/tuo-main.cmake

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
##############################################################
2+
# Copyright 2021 Lawrence Livermore National Security, LLC
3+
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
4+
#
5+
# This file is part of the Flux resource manager framework.
6+
# For details, see https://github.com/flux-framework.
7+
#
8+
# SPDX-License-Identifier: LGPL-3.0
9+
##############################################################
10+
11+
set(CMAKE_C_COMPILER "/opt/rocm-7.0.0/lib/llvm/bin/amdclang" CACHE PATH "")
12+
set(CMAKE_CXX_COMPILER "/opt/rocm-7.0.0/lib/llvm/bin/amdclang++" CACHE PATH "")
13+
14+
set(PERFFLOWASPECT_WITH_CUDA "OFF" CACHE BOOL "")
15+
16+
# To enable fine-grained profiling with Caliper, utilize the below options.
17+
# Caliper should be built with the same compilers as the PerfFlowAspect.
18+
# set(PERFFLOWASPECT_WITH_CALIPER ON CACHE BOOL "")
19+
# set(caliper_DIR "path-to-caliper-install-directory" CACHE PATH "")

src/c/weaver/weave/perfflow_weave_common.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ bool weave_ns::WeaveCommon::insertAfter(Module &m, Function &f, StringRef &a,
169169

170170
if (valid) {
171171
IRBuilder<> builder(inst);
172-
Value *v1 = builder.CreateGlobalStringPtr(m.getName(), "str");
173-
Value *v2 = builder.CreateGlobalStringPtr(f.getName(), "str");
174-
Value *v3 = builder.CreateGlobalStringPtr(StringRef(scope), "str");
175-
Value *v4 = builder.CreateGlobalStringPtr(StringRef(flow), "str");
176-
Value *v5 = builder.CreateGlobalStringPtr(StringRef(pcut), "str");
172+
Value *v1 = builder.CreateGlobalString(m.getName(), "str");
173+
Value *v2 = builder.CreateGlobalString(f.getName(), "str");
174+
Value *v3 = builder.CreateGlobalString(StringRef(scope), "str");
175+
Value *v4 = builder.CreateGlobalString(StringRef(flow), "str");
176+
Value *v5 = builder.CreateGlobalString(StringRef(pcut), "str");
177177
std::vector<Value *> args;
178178
args.push_back(ConstantInt::get(Type::getInt32Ty(context), async));
179179
args.push_back(v1);
@@ -216,11 +216,11 @@ bool weave_ns::WeaveCommon::insertBefore(Module &m, Function &f, StringRef &a,
216216
// weaveFuncTy);
217217
auto &entry = f.getEntryBlock();
218218
IRBuilder<> builder(&entry);
219-
Value *v1 = builder.CreateGlobalStringPtr(m.getName(), "str");
220-
Value *v2 = builder.CreateGlobalStringPtr(f.getName(), "str");
221-
Value *v3 = builder.CreateGlobalStringPtr(StringRef(scope), "str");
222-
Value *v4 = builder.CreateGlobalStringPtr(StringRef(flow), "str");
223-
Value *v5 = builder.CreateGlobalStringPtr(StringRef(pcut), "str");
219+
Value *v1 = builder.CreateGlobalString(m.getName(), "str");
220+
Value *v2 = builder.CreateGlobalString(f.getName(), "str");
221+
Value *v3 = builder.CreateGlobalString(StringRef(scope), "str");
222+
Value *v4 = builder.CreateGlobalString(StringRef(flow), "str");
223+
Value *v5 = builder.CreateGlobalString(StringRef(pcut), "str");
224224
builder.SetInsertPoint(&entry, entry.begin());
225225
std::vector<Value *> args;
226226
args.push_back(ConstantInt::get(Type::getInt32Ty(context), async));
@@ -243,7 +243,7 @@ bool weave_ns::WeaveCommon::instrumentCaliper(Module &M, Function &F)
243243

244244
IRB.SetInsertPoint(Entry.getTerminator());
245245
std::string FunctionName = F.getName().str();
246-
auto *FnStr = IRB.CreateGlobalStringPtr(FunctionName);
246+
auto *FnStr = IRB.CreateGlobalString(FunctionName);
247247
IRB.CreateCall(CaliBeginRegion, {FnStr});
248248

249249
bool RetFound = false;

src/c/weaver/weave/perfflow_weave_new_pass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ PassPluginLibraryInfo getNewWeavingPassPluginInfo()
6161
const auto pass_callback = [](PassBuilder & PB)
6262
{
6363
PB.registerPipelineEarlySimplificationEPCallback(
64-
[&](ModulePassManager & MPM, auto)
64+
[&](ModulePassManager & MPM, OptimizationLevel OL, ThinOrFullLTOPhase TOFLTOP)
6565
{
6666
MPM.addPass(NewWeavingPass());
67-
return true;
6867
}
6968
);
7069
};

0 commit comments

Comments
 (0)