[PATCH] D17288: [CodeGenPrepare] Do select to branch transform when cmp's operand is expensive.

Junmo Park via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 02:23:12 PST 2016


flyingforyou added a comment.

Hi Sanjay.
I already explained that we got improvement on commercial benchmark by e-mail.

> This may happen to be a correct general statement to make today, but not one that is guaranteed to hold for future architectures.


There is concern about this heuristic will not be applied for future architectures. So I added FdivLatency in `SchedMachineModel` for refering.
I think fdiv is special for most of architecture. It wouldn't be pipelined and it has very high latency. So I think this information can be used for another optimizations.

Also, this is very different heuristic from load-cmp-heuristic. Most of load takes 4cycles when the target is in cache. But division takes over 18~30 cycles. This heuristic could be helpful for most of architecture.

And there is a optimization pass `EarlyIfConversion`. This will recover the change when `TBB`, `FBB`'s cost is not good for using branch.

So, How about this approach?


http://reviews.llvm.org/D17288





More information about the llvm-commits mailing list