From 6e71724821aec0728db6c7fea577b1fdae416fd0 Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Sun, 22 Sep 2024 17:46:15 -0400 Subject: [PATCH] [Fix][LLVM] Fix getHostCPUFeatures LLVM version cutoff This PR fixes the LLVM version cutoff for `llvm::sys::getHostCPUFeatures`. Previously the cutoff version is set to 20.0, assuming that the signature change happens since LLVM 20.0. While actually the signature change happens at 19.0. Reference: * LLVM 18.1.8 https://github.com/llvm/llvm-project/blob/llvmorg-18.1.8/llvm/include/llvm/TargetParser/Host.h#L56 * LLVM 19.1.0 https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0-rc1/llvm/include/llvm/TargetParser/Host.h#L55 --- src/target/llvm/codegen_llvm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/llvm/codegen_llvm.cc b/src/target/llvm/codegen_llvm.cc index 4c5bea8c9b4b..e21436e556ee 100644 --- a/src/target/llvm/codegen_llvm.cc +++ b/src/target/llvm/codegen_llvm.cc @@ -2315,7 +2315,7 @@ TVM_REGISTER_GLOBAL("tvm.codegen.llvm.GetHostCPUName").set_body_typed([]() -> st TVM_REGISTER_GLOBAL("tvm.codegen.llvm.GetHostCPUFeatures") .set_body_typed([]() -> Map { -#if TVM_LLVM_VERSION >= 200 +#if TVM_LLVM_VERSION >= 190 Map ret; auto features = llvm::sys::getHostCPUFeatures(); for (auto it = features.begin(); it != features.end(); ++it) {