Open suresh-srinivas opened 2 years ago
Yes, it looks similar to losing addr32 prefix: LLVM MC might be losing the prefix during disassembly, not setting it on MCInst.
On the other hand, these prediction prefixes are optional so we may want to strip them by default. What's the use case or perf effect here?
Thanks @aaupov
This is ignored by the current processors. The static prediction is NT (Not Taken) and the prefix is ignored. They are also mostly not generated (except when using special compiler flags and likely/unlikely macros). So striping them by default would be right.
With or without the hint, the BPU is updated when the branch is taken.
We are doing some early research work to mark common conditional branches with 3E (so the branch instruction is predicted Taken by the CPU). We wanted to use LBR or conditional branch taken to collect profile and then use BOLT to apply the hint.
For this the following we will need the following
Appreciate any directions on this.
Thanks
--Suresh
Discussing with @maksfb it looks like it is similar to issue https://reviews.llvm.org/D120592
I have an input binary of the form
It has 3 conditional branches with a prefix of 2e. This is the output after BOLTing. The 3 conditional branches don't have the prefixes anymore.
This looks like an underlying LLVM problem and not a BOLT problem? I noticed the llvm-objdump does not seem to know about the prefixes, compared to the regular objdump. @maksfb @rafaelauler @aaupov
Thanks
--Suresh