andreas-abel / uiCA

uops.info Code Analyzer
GNU Affero General Public License v3.0
238 stars 16 forks source link

Please model non-taken branches as 1*p06 on hsw/skl #27

Open amonakov opened 1 year ago

amonakov commented 1 year ago

At the moment uica removes p0 as a possible execution port on hsw/skl for a branch early on:

https://github.com/andreas-abel/uiCA/blob/9cbbe931247f45f756738cf35800b5e8dff7bbb0/convertXML.py#L95-L96

I'd like to suggest that this should be done only for the branch that terminates the input basic block. If the user provided a snippet that contains extra branches in the middle, like I did in issue #14 earlier, they are assumed to be never taken, and hence modeling them as occupying either port 0 or port 6 would be more accurate.

edit: to be clear, I understand that with extra branches the input snippet is not a basic block (potentially an "extended basic block" in compiler developer speak, if jumping into it after the first instruction is impossible)