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

Minimal implimentation of prefetch #414

Open
NCGThompson opened this issue Jan 16, 2024 · 6 comments · May be fixed by #420
Open

Minimal implimentation of prefetch #414

NCGThompson opened this issue Jan 16, 2024 · 6 comments · May be fixed by #420

Comments

@NCGThompson
Copy link
Contributor

sym::prefetch_read_data
| sym::prefetch_write_data
| sym::prefetch_read_instruction
| sym::prefetch_write_instruction => {
unimplemented!();
}

Currently, all the prefetch operations lead to unimplemented!() macro. However, prefetches are just a suggestion and can be interpreted as a noop, like assume is.

@antoyo
Copy link
Contributor

antoyo commented Jan 16, 2024

__builtin_prefetch can probably be used here. Not sure if there's anything in gcc to prefetch instructions.

@NCGThompson
Copy link
Contributor Author

__builtin_prefetch can probably be used here. Not sure if there's anything in gcc to prefetch instructions.

I'll take a look while I'm doing the constanty_p one.

@NCGThompson
Copy link
Contributor Author

__builtin_prefetch can probably be used here. Not sure if there's anything in gcc to prefetch instructions.

There is nothing for instructions. Does it make sense to use a data prefetch call in place of an instruction prefetch?

@antoyo
Copy link
Contributor

antoyo commented Jan 16, 2024

I'm not sure. It could be interesting to try and see if the resulting assembly is affected.

@NCGThompson
Copy link
Contributor Author

The assembly will be different on many platforms, but maybe a data prefetch will still benefit instruction load time if it brings it from main memory to intermediate cache. While experimenting does sound interesting, I think we will get better results by asking an expert in computer architecture. I'm assuming we can use conditional compilation and only use it on targets that would benefit. In the mean time, I lean towards being conservative and making instruction prefetch a noop.

@antoyo
Copy link
Contributor

antoyo commented Jan 16, 2024

That's OK for me.

@NCGThompson NCGThompson linked a pull request Jan 29, 2024 that will close this issue
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 a pull request may close this issue.

2 participants