Skip to content

[FIX][LLVM] Workaround -mcpu=apple-latest for llvm above 18.0 (#17492)#17549

Merged
tqchen merged 1 commit intoapache:mainfrom
cbalint13:tvm-issue-17492
Nov 30, 2024
Merged

[FIX][LLVM] Workaround -mcpu=apple-latest for llvm above 18.0 (#17492)#17549
tqchen merged 1 commit intoapache:mainfrom
cbalint13:tvm-issue-17492

Conversation

@cbalint13
Copy link
Copy Markdown
Contributor

@cbalint13 cbalint13 commented Nov 30, 2024

This PR address a fix for #17492

  • It seems that LLVM version >= 19 misses the mcpu apple-latest in the llvm backend.
  • Relevant LLVM change makes this alias unavailable, but works from llc/clang higher frontends.

Error:

llvm_instance.cc:226: Error: Using LLVM 19.1.2 with `-mcpu=apple-latest` is not valid in `-mtriple=arm64-apple-macos`, using default `-mcpu=generic`
llvm_instance.cc:226: Error: Using LLVM 19.1.2 with `-mcpu=apple-latest` is not valid in `-mtriple=arm64-apple-macos`, using default `-mcpu=generic`
llvm_instance.cc:226: Error: Using LLVM 19.1.2 with `-mcpu=apple-latest` is not valid in `-mtriple=arm64-apple-macos`, using default `-mcpu=generic`

Notes

print( "LLVM version = [%s]" % tvm.target.codegen.llvm_version_major() )
print( tvm.target.codegen.llvm_get_cpu_archlist(tvm.target.Target("llvm -mtriple=arm64-apple-macos")) )
LLVM version = [18]
["a64fx", "ampere1", "ampere1a", "ampere1b", "apple-a10", "apple-a11", "apple-a12", "apple-a13", 
"apple-a14", "apple-a15", "apple-a16", "apple-a17", "apple-a7", "apple-a8", "apple-a9", "apple-latest",
"apple-m1", "apple-m2", "apple-m3", "apple-s4", "apple-s5", "carmel", "cortex-a34", "cortex-a35", 
"cortex-a510", "cortex-a520", "cortex-a53", "cortex-a55", "cortex-a57", "cortex-a65", "cortex-a65ae", 
"cortex-a710", "cortex-a715", "cortex-a72", "cortex-a720", "cortex-a73", "cortex-a75", "cortex-a76", 
"cortex-a76ae", "cortex-a77", "cortex-a78", "cortex-a78c", "cortex-r82", "cortex-x1", "cortex-x1c", 
"cortex-x2", "cortex-x3", "cortex-x4", "cyclone", "exynos-m3", "exynos-m4", "exynos-m5", "falkor",
 "generic", "kryo", "neoverse-512tvb", "neoverse-e1", "neoverse-n1", "neoverse-n2", "neoverse-v1", 
"neoverse-v2", "saphira", "thunderx", "thunderx2t99", "thunderx3t110", "thunderxt81", "thunderxt83",
 "thunderxt88", "tsv110"]
LLVM version = [19]
["a64fx", "ampere1", "ampere1a", "ampere1b", "apple-a10", "apple-a11", "apple-a12", "apple-a13",
 "apple-a14", "apple-a15", "apple-a16", "apple-a17", "apple-a7", "apple-m4", "carmel", "cortex-a34", 
"cortex-a35", "cortex-a510", "cortex-a520", "cortex-a520ae", "cortex-a53", "cortex-a55", "cortex-a57", 
"cortex-a65", "cortex-a65ae", "cortex-a710", "cortex-a715", "cortex-a72", "cortex-a720", "cortex-a720ae", 
"cortex-a725", "cortex-a73", "cortex-a75", "cortex-a76", "cortex-a76ae", "cortex-a77", "cortex-a78", 
"cortex-a78ae", "cortex-a78c", "cortex-r82", "cortex-r82ae", "cortex-x1", "cortex-x1c", "cortex-x2", 
"cortex-x3", "cortex-x4", "cortex-x925", "exynos-m3", "exynos-m4", "exynos-m5", "falkor", "generic", 
"kryo", "neoverse-512tvb", "neoverse-e1", "neoverse-n1", "neoverse-n2", "neoverse-n3", "neoverse-v1",
 "neoverse-v2", "neoverse-v3", "neoverse-v3ae", "oryon-1", "saphira", "thunderx", "thunderx2t99", 
"thunderx3t110", "thunderxt81", "thunderxt83", "thunderxt88", "tsv110"]

@cbalint13 cbalint13 marked this pull request as ready for review November 30, 2024 12:29
@cbalint13
Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants