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

disabling BP has no impact in case of CPU (x86) #70

Open
FanosLab opened this issue Oct 3, 2023 · 0 comments
Open

disabling BP has no impact in case of CPU (x86) #70

FanosLab opened this issue Oct 3, 2023 · 0 comments

Comments

@FanosLab
Copy link

FanosLab commented Oct 3, 2023

Hello,
In running few experiments using the BP, I came to an issue where whether we disable BP or not, it does not have any impact on the results.
Looking into the issue, I found that in the frontend_c::predict_bpu function, the BP disabled path has no impact in case of CPU (I am also not very sure how it works on the GPU case):
if (*m_simBase->m_knobs->KNOB_USE_BRANCH_PREDICTION) { // do nothing } // no branch prediction else { // GPU : stall on branch policy, stop fetching if (m_ptx_sim && *m_simBase->m_knobs->KNOB_MT_NO_FETCH_BR) { set_br_wait(uop->m_thread_id); mispredicted = false; } }

My understanding from the flow that is should return mispredicted = true if BP was disabled?
Although semantically disabling BP is not the same as misprediction but this is the closest I can get form the code?
right now simply disabling BP has no impact.

In the meantime, I did something like:
if (*m_simBase->m_knobs->KNOB_USE_BRANCH_PREDICTION) { // do nothing } // no branch prediction else { // GPU : stall on branch policy, stop fetching if (m_ptx_sim && *m_simBase->m_knobs->KNOB_MT_NO_FETCH_BR) { set_br_wait(uop->m_thread_id); mispredicted = false; } else { //CPU x86 path should return misprediction in case that bp is disabled! mispredicted = true; } }
Not sure if this is what originally the code intended or not.

Mohamed

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

1 participant