[llvm] [TailDuplicator] Only duplicate the blocks containing computed gotos (PR #114990)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 05:43:09 PST 2025


DianQK wrote:

> Just getting back to this, sorry! Is this the latest version of the patch that should fix the regressions?
> 
> I tried the patch when building Python on macOS and it improves performance by ~0.5% while with #116072 increases performance by 2-3%

I don't have a CPU like the i7-2640M, but I can observe a significant decrease in `instructions:u` from the perf stat output.

```
perf stat -r 3 ./ajla --nosave loop.ajla 1000000000
    98,475,825,975      instructions:u                   #    2.95  insn per cycle
perf stat -r 3 ./ajla --nosave loop.ajla 1000000000
    77,379,026,755      instructions:u                   #    2.09  insn per cycle
```

This should help CPUs with weaker branch prediction capabilities.

I will rebase this PR after #116072 land.

https://github.com/llvm/llvm-project/pull/114990


More information about the llvm-commits mailing list