Skip to content

Commit c584c93

Browse files
committed
[LLVM][CPPTEST] Small fixes for LLVM >= 20
1 parent 34d4bc7 commit c584c93

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/cpp/target/parsers/aprofile_test.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,12 @@ TEST_F(AProfileParser, DefaultSVESupportSVESupport) {
317317
TargetJSON target = ParseTargetWithAttrs("", "aarch64-arm-none-eabi", {arch_attr});
318318
TargetFeatures features = Downcast<TargetFeatures>(target.at("features"));
319319
EXPECT_TRUE(IsArch(target));
320+
#if TVM_LLVM_VERSION >= 190
321+
// The generic aarch64 should not have SVE enabled
322+
EXPECT_FALSE(Downcast<Bool>(features.at("has_sve")));
323+
#else
320324
EXPECT_TRUE(Downcast<Bool>(features.at("has_sve")));
325+
#endif
321326

322327
// Check that the "has_sve" feature is set when "+sve" is explicitly set as an attribute.
323328
target = ParseTargetWithAttrs("", "aarch64-arm-none-eabi", {arch_attr, "+sve"});
@@ -359,7 +364,12 @@ TEST_F(AProfileParser, DefaultFP16Support) {
359364
TargetJSON target = ParseTargetWithAttrs("", "aarch64-arm-none-eabi", {arch_attr});
360365
TargetFeatures features = Downcast<TargetFeatures>(target.at("features"));
361366
EXPECT_TRUE(IsArch(target));
367+
#if TVM_LLVM_VERSION >= 190
368+
// The generic aarch64 should not have FP16 enabled
369+
EXPECT_FALSE(Downcast<Bool>(features.at("has_fp16_simd")));
370+
#else
362371
EXPECT_TRUE(Downcast<Bool>(features.at("has_fp16_simd")));
372+
#endif
363373

364374
// Check that the "has_fp16_simd" feature is set when "+fullfp16" is explicitly set as an
365375
// attribute.

tests/cpp/tir_scalable_datatype.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,18 @@ TEST(ScalableDataType, TestScalableIntrinCall) {
189189
tvm::DataType scalable_type = tvm::DataType(kDLInt, 32, 4, true);
190190
tvm::tir::Call call = tvm::tir::Call(
191191
scalable_type, tvm::tir::builtin::call_llvm_intrin(),
192+
#if TVM_LLVM_VERSION >= 200
193+
{tvm::IntImm(tvm::DataType::Int(32), ::llvm::Intrinsic::stepvector)});
194+
#else
192195
{tvm::IntImm(tvm::DataType::Int(32), ::llvm::Intrinsic::experimental_stepvector)});
196+
#endif
193197
ASSERT_EQ(call->dtype, scalable_type);
194198
ASSERT_EQ(call->Script(),
199+
#if TVM_LLVM_VERSION >= 200
200+
"T.call_llvm_intrin(\"int32xvscalex4\", \"llvm.stepvector\")");
201+
#else
195202
"T.call_llvm_intrin(\"int32xvscalex4\", \"llvm.experimental.stepvector\")");
203+
#endif
196204
}
197205
#endif
198206

0 commit comments

Comments
 (0)