Skip to content

Commit 04d9dd1

Browse files
committed
tests: update ARM/SVE2 coverage and LLVM-version-specific skips
1 parent c490f87 commit 04d9dd1

15 files changed

Lines changed: 146 additions & 1 deletion

cmake/HalideTestHelpers.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ function(add_halide_test TARGET)
6969
#
7070
# target_link_libraries("${TARGET}" PRIVATE Halide::TerminateHandler)
7171

72+
# Resolve the "cmake" meta-target
73+
string(REGEX REPLACE "^cmake" "${Halide_CMAKE_TARGET}" _resolved_target "${Halide_TARGET}")
74+
7275
set_tests_properties(${TARGET} PROPERTIES
7376
LABELS "${args_GROUPS}"
74-
ENVIRONMENT "HL_TARGET=${Halide_TARGET};HL_JIT_TARGET=${Halide_TARGET}"
77+
ENVIRONMENT "HL_TARGET=${_resolved_target};HL_JIT_TARGET=${_resolved_target}"
7578
SKIP_REGULAR_EXPRESSION "\\[SKIP\\]"
7679
WILL_FAIL ${args_EXPECT_FAILURE})
7780

test/autoschedulers/mullapudi2016/max_filter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ int main(int argc, char **argv) {
128128
return 0;
129129
}
130130

131+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
132+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
133+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
134+
if (Internal::get_llvm_version() >= 210 &&
135+
Internal::get_llvm_version() < 220 &&
136+
get_jit_target_from_environment().has_feature(Target::SVE2)) {
137+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
138+
return 0;
139+
}
140+
131141
if (argc != 2) {
132142
fprintf(stderr, "Usage: %s <autoscheduler-lib>\n", argv[0]);
133143
return 1;

test/correctness/align_bounds.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ int my_trace(JITUserContext *user_context, const halide_trace_event_t *e) {
2323
}
2424

2525
int main(int argc, char **argv) {
26+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
27+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
28+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
29+
if (Internal::get_llvm_version() >= 210 &&
30+
Internal::get_llvm_version() < 220 &&
31+
get_jit_target_from_environment().has_feature(Target::SVE2)) {
32+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
33+
return 0;
34+
}
35+
2636
// Force the bounds of an intermediate pipeline stage to be even to remove a select
2737
{
2838
Func f, g, h;

test/correctness/bound_small_allocations.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Expr calc(Expr a) {
1010
}
1111

1212
int main(int argc, char **argv) {
13+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
14+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
15+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
16+
if (Internal::get_llvm_version() >= 210 &&
17+
Internal::get_llvm_version() < 220 &&
18+
get_jit_target_from_environment().has_feature(Target::SVE2)) {
19+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
20+
return 0;
21+
}
22+
1323
Var x, y;
1424
Func f, g, h;
1525

test/correctness/fit_function.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
using namespace Halide;
88

99
int main(int argc, char **argv) {
10+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
11+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
12+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
13+
if (Internal::get_llvm_version() >= 210 &&
14+
Internal::get_llvm_version() < 220 &&
15+
get_jit_target_from_environment().has_feature(Target::SVE2)) {
16+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
17+
return 0;
18+
}
19+
1020
// Fit an odd polynomial to sin from 0 to pi/2 using Halide's derivative support
1121
ImageParam coeffs(Float(64), 1);
1222
Param<double> learning_rate;

test/correctness/interleave_rgb.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ bool test_deinterleave(int x_stride) {
103103
}
104104

105105
int main(int argc, char **argv) {
106+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
107+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
108+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
109+
if (Internal::get_llvm_version() >= 210 &&
110+
Internal::get_llvm_version() < 220 &&
111+
get_jit_target_from_environment().has_feature(Target::SVE2)) {
112+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
113+
return 0;
114+
}
115+
106116
for (int x_stride : {3, 4}) {
107117
if (!test_interleave<uint8_t>(x_stride)) return 1;
108118
if (!test_interleave<uint16_t>(x_stride)) return 1;

test/correctness/logical.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ Expr u16(Expr a) {
1212
}
1313

1414
int main(int argc, char **argv) {
15+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
16+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
17+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
18+
if (Internal::get_llvm_version() >= 210 &&
19+
Internal::get_llvm_version() < 220 &&
20+
get_jit_target_from_environment().has_feature(Target::SVE2)) {
21+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
22+
return 0;
23+
}
1524

1625
Buffer<uint8_t> input(128, 64);
1726

test/correctness/mul_div_mod.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,18 @@ void add_test_div_mod(int vector_width, ScheduleVariant scheduling, Target targe
541541
int main(int argc, char **argv) {
542542
Target target = get_jit_target_from_environment();
543543

544+
// LLVM's performSignExtendInRegCombine in the AArch64 backend asserts
545+
// when it encounters SIGN_EXTEND_INREG from i1 on SVE vectors. Halide's
546+
// division lowering produces select(cond, -1, 0) which LLVM canonicalizes
547+
// to sext i1, triggering the assertion. Fixed on LLVM main by:
548+
// https://github.com/llvm/llvm-project/commit/ffb7a9f0ec80 (PR #177976)
549+
if (target.has_feature(Target::SVE2) &&
550+
Internal::get_llvm_version() < 230) {
551+
printf("[SKIP] LLVM %d has a known SVE bug in performSignExtendInRegCombine (PR #177976).\n",
552+
Internal::get_llvm_version());
553+
return 0;
554+
}
555+
544556
ScheduleVariant scheduling = CPU;
545557
if (target.has_gpu_feature()) {
546558
scheduling = TiledGPU;

test/correctness/predicated_store_load.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,16 @@ int predicated_atomic_store_test(const Target &t) {
487487
int main(int argc, char **argv) {
488488
Target t = get_jit_target_from_environment();
489489

490+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
491+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
492+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
493+
if (Internal::get_llvm_version() >= 210 &&
494+
Internal::get_llvm_version() < 220 &&
495+
t.has_feature(Target::SVE2)) {
496+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
497+
return 0;
498+
}
499+
490500
printf("Running vectorized dense load test\n");
491501
if (predicated_tail_test(t) != 0) {
492502
return 1;

test/correctness/stage_strided_loads.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ class CheckForStridedLoads : public IRMutator {
5656
} checker;
5757

5858
int main(int argc, char **argv) {
59+
// LLVM 21 calls getFixedValue() on scalable TypeSize objects in the
60+
// AArch64 backend, triggering an assertion. Fixed in LLVM 22 by:
61+
// https://github.com/llvm/llvm-project/commit/d1500d12be60 (PR #169764)
62+
if (Internal::get_llvm_version() >= 210 &&
63+
Internal::get_llvm_version() < 220 &&
64+
get_jit_target_from_environment().has_feature(Target::SVE2)) {
65+
printf("[SKIP] LLVM 21 has known getFixedValue() assertions on SVE scalable types.\n");
66+
return 0;
67+
}
68+
5969
ImageParam buf(Float(32), 1, "buf");
6070

6171
{

0 commit comments

Comments
 (0)