43a44,46
> STATISTIC(NumTailDups , "Number of tail duplicated blocks");
> STATISTIC(NumInstrDups , "Additional instructions due to tail duplication");
>
45a49
>
196d199
<
205c208
< // Do tail duplication once after tail merging is done. Otherwise it is
---
> // Do tail duplication after tail merging is done. Otherwise it is
208c211,216
< MadeChange |= TailDuplicateBlocks(MF);
---
> MadeChangeThisIteration = true;
> while (MadeChangeThisIteration) {
> MadeChangeThisIteration = false;
> MadeChangeThisIteration |= TailDuplicateBlocks(MF);
> MadeChange |= MadeChangeThisIteration;
> }
1006,1008d1013
< // Make sure blocks are numbered in order
< MF.RenumberBlocks();
<
1019a1025
> NumInstrDups -= MBB->size();
1099a1106
> NumInstrDups += TailBB->size() - 1; // subtract one for removed branch
1109a1117
> ++NumTailDups;
> STATISTIC(NumTailDups , "Number of tail duplicated blocks");
> STATISTIC(NumInstrDups , "Additional instructions due to tail duplication");
>
45a49
>
196d199
<
205c208
< // Do tail duplication once after tail merging is done. Otherwise it is
---
> // Do tail duplication after tail merging is done. Otherwise it is
208c211,216
< MadeChange |= TailDuplicateBlocks(MF);
---
> MadeChangeThisIteration = true;
> while (MadeChangeThisIteration) {
> MadeChangeThisIteration = false;
> MadeChangeThisIteration |= TailDuplicateBlocks(MF);
> MadeChange |= MadeChangeThisIteration;
> }
1006,1008d1013
< // Make sure blocks are numbered in order
< MF.RenumberBlocks();
<
1019a1025
> NumInstrDups -= MBB->size();
1099a1106
> NumInstrDups += TailBB->size() - 1; // subtract one for removed branch
1109a1117
> ++NumTailDups;