Skip to content

Commit 877729d

Browse files
committed
Use more specific warning message
Change-Id: I98a72a95e2b51f8a4b577dcef15f40e7c28719a2
1 parent 1307306 commit 877729d

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
[
@@ -131,6 +135,9 @@ def test_int8_conv2d(target, expected_impl):
131135
assert selected_impl == expected_impl
132136

133137

138+
@pytest.mark.skipif(
139+
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
140+
)
134141
@pytest.mark.parametrize(
135142
"target,expected_impl",
136143
[
@@ -164,6 +171,9 @@ def test_fp32_conv2d(target, expected_impl):
164171
assert selected_impl == expected_impl
165172

166173

174+
@pytest.mark.skipif(
175+
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
176+
)
167177
@pytest.mark.parametrize(
168178
"target,expected_impl",
169179
[

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)