Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

cbalint13
Copy link
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
Contributor Author

@tqchen tqchen merged commit d94f115 into apache:main Nov 30, 2024
24 of 25 checks passed
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