<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic BACLEAR and BPUCLEAR in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/BACLEAR-and-BPUCLEAR/m-p/951230#M2200</link>
    <description>&lt;P&gt;I've been exploring the perfomrance of branch prediction lately on my SB and IB parts. &amp;nbsp;I've observed the redirect latencies from the uop$ and from the ILD differ greatly.. but I'm still waiting on some explanation of the difference in 15 and 22-23 clks I observe between the uop$ and the ILD. &amp;nbsp; I measured these latencies using indirect jumps.&lt;/P&gt;
&lt;P&gt;I then started exploring the JCC prediction behavior. &amp;nbsp;Again, because branches in my code and those high performance code I analyze are important drivers of performance. &amp;nbsp;I observed that SB and IB never mispredict a series of continually taken branches.. which surprised me. &amp;nbsp;I wondered how this could be the case.. and then I investigated the BACLEAR and BPUCLEAR stats in PMC 0xE6 and 0xE8. &amp;nbsp;I observe these are occuring. &amp;nbsp;Can you explain, if possible what these are? &amp;nbsp;The System and Optimization guides don't do any justice to their explanation.&lt;/P&gt;
&lt;P&gt;If you have a series of taken branches, 3000 to possibly 10K, my questions are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I see no BACLEARs till I start missing branches in your BTB, which is what I was interested in observing, it just surprised me that for 10K branches you never mispredicted if they were always taken&lt;/LI&gt;
&lt;LI&gt;you never mispredict according to your PMC stats for branch prediction (again these are likely based upon executed branches)&lt;/LI&gt;
&lt;LI&gt;I would presume you initially take the not-taken path&lt;/LI&gt;
&lt;LI&gt;however I'm observing a fair amount of "late BPU clears" as well as "BACLEARs"&lt;/LI&gt;
&lt;LI&gt;you likely don't know the branch is a branch until later I presume tilly our branch gets to your instruction decoder, you have no record of that branch in your BTB. &lt;STRONG&gt;Question: is this what a "late BPU clear" is. You find there's a branch, and it's a JCC, and you re-direct your fetch to the not-taken path? &amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Once you determine it's a branch, and your re-directed to the not-taken path, which is incorrect, you then just have a "gizmo" of sorts which sees that all the JCC are taken and then you redirect the fetch again, but this time to the taken path. &amp;nbsp;&lt;STRONG&gt;Question: is a BACLEAR the 2nd redirect which uses the said "gizmo" in the BP to redirect fetch to the front end?&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Again, thanks for any pointers or insight. &amp;nbsp;Also .. if someone could answer my earlier post about IF redirect in uop$ vs ILD.. I'd very much appreciate it.&lt;/P&gt;
&lt;P&gt;Perfwise&lt;/P&gt;</description>
    <pubDate>Thu, 21 Feb 2013 20:04:18 GMT</pubDate>
    <dc:creator>perfwise</dc:creator>
    <dc:date>2013-02-21T20:04:18Z</dc:date>
    <item>
      <title>BACLEAR and BPUCLEAR</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/BACLEAR-and-BPUCLEAR/m-p/951230#M2200</link>
      <description>&lt;P&gt;I've been exploring the perfomrance of branch prediction lately on my SB and IB parts. &amp;nbsp;I've observed the redirect latencies from the uop$ and from the ILD differ greatly.. but I'm still waiting on some explanation of the difference in 15 and 22-23 clks I observe between the uop$ and the ILD. &amp;nbsp; I measured these latencies using indirect jumps.&lt;/P&gt;
&lt;P&gt;I then started exploring the JCC prediction behavior. &amp;nbsp;Again, because branches in my code and those high performance code I analyze are important drivers of performance. &amp;nbsp;I observed that SB and IB never mispredict a series of continually taken branches.. which surprised me. &amp;nbsp;I wondered how this could be the case.. and then I investigated the BACLEAR and BPUCLEAR stats in PMC 0xE6 and 0xE8. &amp;nbsp;I observe these are occuring. &amp;nbsp;Can you explain, if possible what these are? &amp;nbsp;The System and Optimization guides don't do any justice to their explanation.&lt;/P&gt;
&lt;P&gt;If you have a series of taken branches, 3000 to possibly 10K, my questions are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I see no BACLEARs till I start missing branches in your BTB, which is what I was interested in observing, it just surprised me that for 10K branches you never mispredicted if they were always taken&lt;/LI&gt;
&lt;LI&gt;you never mispredict according to your PMC stats for branch prediction (again these are likely based upon executed branches)&lt;/LI&gt;
&lt;LI&gt;I would presume you initially take the not-taken path&lt;/LI&gt;
&lt;LI&gt;however I'm observing a fair amount of "late BPU clears" as well as "BACLEARs"&lt;/LI&gt;
&lt;LI&gt;you likely don't know the branch is a branch until later I presume tilly our branch gets to your instruction decoder, you have no record of that branch in your BTB. &lt;STRONG&gt;Question: is this what a "late BPU clear" is. You find there's a branch, and it's a JCC, and you re-direct your fetch to the not-taken path? &amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Once you determine it's a branch, and your re-directed to the not-taken path, which is incorrect, you then just have a "gizmo" of sorts which sees that all the JCC are taken and then you redirect the fetch again, but this time to the taken path. &amp;nbsp;&lt;STRONG&gt;Question: is a BACLEAR the 2nd redirect which uses the said "gizmo" in the BP to redirect fetch to the front end?&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Again, thanks for any pointers or insight. &amp;nbsp;Also .. if someone could answer my earlier post about IF redirect in uop$ vs ILD.. I'd very much appreciate it.&lt;/P&gt;
&lt;P&gt;Perfwise&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2013 20:04:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/BACLEAR-and-BPUCLEAR/m-p/951230#M2200</guid>
      <dc:creator>perfwise</dc:creator>
      <dc:date>2013-02-21T20:04:18Z</dc:date>
    </item>
  </channel>
</rss>

