3 ms·
I wonder are there any compilers that recognizes switch-in-loop pattern of interprets and optimizes it to be branch-predictor friendly using multiple indirect j
by fpoling 4mo ago
I wonder are there any compilers that recognizes switch-in-loop pattern of interprets and optimizes it to be branch-predictor friendly using multiple indirect jumps?
- dhosek 4mo agoI believe that Rust does this which implies that it might be common to the clang back end.
- keynha 4mo ago[flagged]
- ack_complete 4mo agoMSVC can do this for x86 if the cases are densely packed and the default is blocked: https://gcc.godbolt.org/z/GPo9fMx8G https://gcc.godbolt.org/z/GPo9fMx8G However, this optimization is less effective on modern CPUs with more powerful indirect predictors using global history.