Conversation
Add jumps after conditional branches if not present Add several asserts to check the instruction stream integrity Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
|
@makachanm this patch adds preference to the basic block system. Currently it is based on the last jump of the block. You could extend this method to support taken conditional branches. When the conditional target is preferred, the targets of the branch and its following jump should be swapped, and the conditional should be inverted. Reason: the conditional part is often merged with its preceding compare instruction, so the jumpIfTrue/jumpIfFalse is not compiled directly. To avoid checking the targets every time, it is easier to just swap the targets of the two instructions. This patch is based on #505. Check the last commit only. |
| Label* target = lastInstr->asExtended()->value().targetLabel->finalTarget(); | ||
| if (!(target->info() & Label::kIsCompiled)) { | ||
| target->addInfo(Label::kIsCompiled); | ||
| return target; |
There was a problem hiding this comment.
This is a greedy algorithm. It could be made more sophistical later. Basic block duplication for simple blocks should also be possible (can be faster even if it increases code size).
|
I see. So far as I understand, We can now see the basic block into actual one piece by piece and move a actual position? |
|
The trick is you don't move the blocks. The How this function selects the next block:
Note: the first step always fails, if the block ends with a return, unreachable, table jump, etc. In these cases the next block can be anything. If the returned "next block" is NULL, it means all blocks are compiled. |
|
So now all I do about branch hinting is can be moved into |
|
Yes. You need to create the infrastructure for having branch hinting, and do the decisions in |
No description provided.