From dedaca32d5b7c0329e457ce18d4115a2125b8095 Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Thu, 16 Jan 2025 13:08:55 +0000 Subject: [PATCH 1/5] [RISCV] Move rva23 evl builder over to cross-compile and execute under qemu-system setup This also moves to `prefer-predicate-over-epilogue=predicate-else-scalar-epilogue`. As the buildbot is on staging only and already has some failures, I think it's ok to make both changes at once rather than carefully staging it. --- buildbot/osuosl/master/config/builders.py | 27 ++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index e97f7672..33592ba2 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -3337,6 +3337,7 @@ )}, ## RISC-V RVA23 profile with EVL vectorizer check-all 2-stage + ## (cross-compile and then test under qemu-system). {'name' : "clang-riscv-rva23-evl-vec-2stage", 'workernames' : ["rise-clang-riscv-rva23-evl-vec-2stage"], 'builddir':"clang-riscv-rva23-evl-vec-2stage", @@ -3345,6 +3346,8 @@ useTwoStage=True, runTestSuite=False, testStage1=False, + checkout_compiler_rt=False, + checkout_zorg=True, extra_cmake_args=[ "-DCMAKE_C_COMPILER=clang", "-DCMAKE_CXX_COMPILER=clang++", @@ -3353,9 +3356,27 @@ "-DCMAKE_C_COMPILER_LAUNCHER=ccache", "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"], extra_stage2_cmake_args=[ - "-DLLVM_ENABLE_LLD=True", - "-DCMAKE_C_FLAGS='-menable-experimental-extensions -march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-dont-vectorize'", - "-DCMAKE_CXX_FLAGS='-menable-experimental-extensions -march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-dont-vectorize'"] + util.Interpolate("-DLLVM_NATIVE_TOOL_DIR=%(prop:builddir)s/stage1.install/bin"), + "-DLLVM_BUILD_TESTS=True", + "-DPython3_EXECUTABLE=/usr/bin/python3", + util.Interpolate("-DLLVM_EXTERNAL_LIT=%(prop:builddir)s/llvm-zorg/buildbot/riscv-rise/lit-on-qemu")], + stage2_toolchain_options=[ + "set(CMAKE_SYSTEM_NAME Linux)", + "set(CMAKE_SYSROOT %(prop:builddir)s/../rvsysroot)", + "set(CMAKE_C_COMPILER_TARGET riscv64-linux-gnu)", + "set(CMAKE_CXX_COMPILER_TARGET riscv64-linux-gnu)", + "set(CMAKE_C_FLAGS_INIT '-march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue')", + "set(CMAKE_CXX_FLAGS_INIT '-march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue')", + "set(CMAKE_LINKER_TYPE LLD)", + "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)", + "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)", + "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)", + "set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)"], + env={ + "BB_IMG_DIR": util.Interpolate("%(prop:builddir)s/.."), + "BB_QEMU_CPU": "zba=true,zbb=true,zbc=false,zbs=true,zfhmin=true,v=true,vext_spec=v1.0,zkt=true,zvfhmin=true,zvbb=true,zvkt=true,zihintntl=true,zicond=true,zcb=true,zfa=true,zawrs=true,rvv_ta_all_1s=true,rvv_ma_all_1s=true,rvv_vl_half_avl=true", + "BB_QEMU_SMP": "32", + "BB_QEMU_MEM": "64G"} )}, # Builders similar to used in Buildkite premerge pipeline. From 5a34255a0db70f6724416a767794a4987b5fddfe Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Sat, 25 Jan 2025 10:40:39 +0000 Subject: [PATCH 2/5] Add LLVM_HOST_TRIPLE --- buildbot/osuosl/master/config/builders.py | 1 + 1 file changed, 1 insertion(+) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index 7a8a81bc..611708fa 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -3382,6 +3382,7 @@ util.Interpolate("-DLLVM_NATIVE_TOOL_DIR=%(prop:builddir)s/stage1.install/bin"), "-DLLVM_BUILD_TESTS=True", "-DPython3_EXECUTABLE=/usr/bin/python3", + "-DLLVM_HOST_TRIPLE=riscv64-linux-gnu", util.Interpolate("-DLLVM_EXTERNAL_LIT=%(prop:builddir)s/llvm-zorg/buildbot/riscv-rise/lit-on-qemu")], stage2_toolchain_options=[ "set(CMAKE_SYSTEM_NAME Linux)", From 1a73eabf9ee6896f1124c209c46fc13afdadefd5 Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Mon, 27 Jan 2025 12:52:28 +0000 Subject: [PATCH 3/5] Add zimop, zcmop, and TODO --- buildbot/osuosl/master/config/builders.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index 611708fa..b42688ab 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -3398,7 +3398,9 @@ "set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)"], env={ "BB_IMG_DIR": util.Interpolate("%(prop:builddir)s/.."), - "BB_QEMU_CPU": "zba=true,zbb=true,zbc=false,zbs=true,zfhmin=true,v=true,vext_spec=v1.0,zkt=true,zvfhmin=true,zvbb=true,zvkt=true,zihintntl=true,zicond=true,zcb=true,zfa=true,zawrs=true,rvv_ta_all_1s=true,rvv_ma_all_1s=true,rvv_vl_half_avl=true", + # TODO: Switch to specifying rva23u64 once support is + # available in a released QEMU. + "BB_QEMU_CPU": "zba=true,zbb=true,zbc=false,zbs=true,zfhmin=true,v=true,vext_spec=v1.0,zkt=true,zvfhmin=true,zvbb=true,zvkt=true,zihintntl=true,zicond=true,zimop=true,zcmop=true,zcb=true,zfa=true,zawrs=true,rvv_ta_all_1s=true,rvv_ma_all_1s=true,rvv_vl_half_avl=true", "BB_QEMU_SMP": "32", "BB_QEMU_MEM": "64G"} )}, From e787a9365c5cb07fd4c737515e6a47788207f6fa Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Mon, 27 Jan 2025 14:56:18 +0000 Subject: [PATCH 4/5] Fix string quoting issue --- buildbot/osuosl/master/config/builders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index b42688ab..a89afbe8 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -3389,8 +3389,8 @@ "set(CMAKE_SYSROOT %(prop:builddir)s/../rvsysroot)", "set(CMAKE_C_COMPILER_TARGET riscv64-linux-gnu)", "set(CMAKE_CXX_COMPILER_TARGET riscv64-linux-gnu)", - "set(CMAKE_C_FLAGS_INIT '-march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue')", - "set(CMAKE_CXX_FLAGS_INIT '-march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue')", + "set(CMAKE_C_FLAGS_INIT \"-march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue\")", + "set(CMAKE_CXX_FLAGS_INIT \"-march=rva23u64 -mllvm -force-tail-folding-style=data-with-evl -mllvm -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue\")", "set(CMAKE_LINKER_TYPE LLD)", "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)", "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)", From 630dd2a3c2682f787237882972128a4604dc0726 Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Mon, 27 Jan 2025 15:33:02 +0000 Subject: [PATCH 5/5] Fix typo in BB_QEMU_CPU definition --- buildbot/osuosl/master/config/builders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index a89afbe8..5b2bb9bd 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -3400,7 +3400,7 @@ "BB_IMG_DIR": util.Interpolate("%(prop:builddir)s/.."), # TODO: Switch to specifying rva23u64 once support is # available in a released QEMU. - "BB_QEMU_CPU": "zba=true,zbb=true,zbc=false,zbs=true,zfhmin=true,v=true,vext_spec=v1.0,zkt=true,zvfhmin=true,zvbb=true,zvkt=true,zihintntl=true,zicond=true,zimop=true,zcmop=true,zcb=true,zfa=true,zawrs=true,rvv_ta_all_1s=true,rvv_ma_all_1s=true,rvv_vl_half_avl=true", + "BB_QEMU_CPU": "rv64,zba=true,zbb=true,zbc=false,zbs=true,zfhmin=true,v=true,vext_spec=v1.0,zkt=true,zvfhmin=true,zvbb=true,zvkt=true,zihintntl=true,zicond=true,zimop=true,zcmop=true,zcb=true,zfa=true,zawrs=true,rvv_ta_all_1s=true,rvv_ma_all_1s=true,rvv_vl_half_avl=true", "BB_QEMU_SMP": "32", "BB_QEMU_MEM": "64G"} )},