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

__builtin_readcyclecounter broken on mac arm64 #600

Open
devnexen opened this issue Feb 28, 2023 · 2 comments
Open

__builtin_readcyclecounter broken on mac arm64 #600

devnexen opened this issue Feb 28, 2023 · 2 comments

Comments

@devnexen
Copy link
Collaborator

devnexen commented Feb 28, 2023

image

disabling this particular builtin rather than disabling all seems enough to fix the tests.
@jrtc27
Copy link
Contributor

jrtc27 commented Sep 6, 2023

https://reviews.llvm.org/D136999 probably fixes this (and avoids getting nonsense deltas when bouncing between cores)

@davidchisnall
Copy link
Collaborator

Thanks @jrtc27. It looks as if that hasn't yet been merged into Apple's version of LLVM (Apple Clang 14.0.3 is based on upstream clang 15.0.0 and still emits mrs x0, PMCCNTR_EL0 for this builtin). It's a bit annoying that clang doesn't provide pre-defined macros for bug fixes, because the conditional for version matching between Apple and upstream clang versions here would be quite complex.

@mjp41, it looks as if the builtin is inlined but the method with the inline assembly isn't, so we probably want to slap an ALWAYSINLINE on it (inlining a single-instruction method is always the right choice, but I think LLVM's cost function doesn't count the size of assembly blocks).

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

No branches or pull requests

3 participants