[PATCH] D28249: Improve scheduling with branch coalescing

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 11:27:55 PST 2017


echristo added a comment.

In https://reviews.llvm.org/D28249#682567, @nemanjai wrote:

> In https://reviews.llvm.org/D28249#681685, @hiraditya wrote:
>
> > Because select gets converted to branches in PowerPC, I was wondering if there is a  way to not generate selects in the first place.
>
>
> It is not true in general that selects get converted to branches on PowerPC. For example, integer selects can be lowered into an actual "integer select" instruction under the "right" circumstances.
>  I'm sure there **is** a way to prevent the selects from being produced, but I am not sure this would have any effect on this optimization. For the specific test case that is added as part of this patch, it appears that SROA produces the selects. I haven't personally looked at the semantics of SROA and the heuristics it uses to produce a select or not, but there is presumably a way to tell it not to do so.


In general, we want to produce selects rather than explicit branching due to superblock formation etc. On Power9 we'll find that the integer select instruction is also much faster than on Power8 and so will experience less of a penalty as well.


https://reviews.llvm.org/D28249





More information about the llvm-commits mailing list