Skip to content

Commit abeb0fa

Browse files
committed
Use more specific warning message
Change-Id: I98a72a95e2b51f8a4b577dcef15f40e7c28719a2
1 parent 52cbe87 commit abeb0fa

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/target/llvm/llvm_instance.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ LLVMTargetInfo::LLVMTargetInfo(LLVMInstance& instance, const TargetJSON& target)
225225
// give the code a chance to run with a less-specific target.
226226
LOG(ERROR) << "LLVM cpu architecture `-mcpu=" << cpu_
227227
<< "` is not valid in `-mtriple=" << triple_ << "`"
228-
<< ", cpu architecture ignored";
228+
<< ", using default `-mcpu=" << String(defaults::cpu) << "`";
229229
}
230230
}
231231

tests/python/relay/strategy/test_select_implementation.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from tvm.relay.testing import run_infer_type, run_opt_pass
2828
import tvm.testing
2929
from tvm import topi
30+
from tvm.target.codegen import llvm_version_major
3031

3132

3233
@pytest.mark.parametrize(
@@ -90,6 +91,9 @@ def _get_conv2d_impl(dtype, target):
9091
return impl.name
9192

9293

94+
@pytest.mark.skipif(
95+
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
96+
)
9397
@pytest.mark.parametrize(
9498
"target,expected_impl",
9599
[
@@ -132,6 +136,9 @@ def test_int8_conv2d(target, expected_impl):
132136
assert selected_impl == expected_impl
133137

134138

139+
@pytest.mark.skipif(
140+
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
141+
)
135142
@pytest.mark.parametrize(
136143
"target,expected_impl",
137144
[
@@ -166,6 +173,9 @@ def test_fp32_conv2d(target, expected_impl):
166173
assert selected_impl == expected_impl
167174

168175

176+
@pytest.mark.skipif(
177+
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
178+
)
169179
@pytest.mark.parametrize(
170180
"target,expected_impl",
171181
[

tests/python/target/test_llvm_features_info.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ def test_llvm_targets(capfd):
4242
tvm.target.codegen.llvm_get_cpu_features(
4343
tvm.target.Target("llvm -mtriple=x86_64-linux-gnu -mcpu=dummy")
4444
)
45-
expected_str = ("Error: LLVM cpu architecture `-mcpu=dummy` is not valid in "
46-
"`-mtriple=x86_64-linux-gnu`, cpu architecture ignored")
45+
expected_str = (
46+
"Error: LLVM cpu architecture `-mcpu=dummy` is not valid in "
47+
"`-mtriple=x86_64-linux-gnu`, using default `-mcpu=generic`"
48+
)
4749
assert expected_str in capfd.readouterr().err
4850

4951

0 commit comments

Comments
 (0)