Select appropriate branch cost, if no retirement data.

This commit is contained in:
Bartosz Taudul 2022-04-01 19:09:56 +02:00
parent 88a153504d
commit 2fc64fceba
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1291,7 +1291,15 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
int idx = 0;
for( auto& v : s_CostName )
{
if( ImGui::Selectable( v, idx == (int)m_cost ) ) m_cost = (CostType)idx;
if( ImGui::Selectable( v, idx == (int)m_cost ) )
{
m_cost = (CostType)idx;
if( m_cost == CostType::SlowBranches && !worker.HasHwBranchRetirement() )
{
m_cost = CostType::BranchMiss;
}
}
if( (CostType)idx == s_costSeparateAfter ) ImGui::Separator();
idx++;
}