[PATCH] D16836: [CodeGenPrepare] Don't transform select instructions into branches when both of operands are cheap

Mitch Bodart via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 15:59:41 PST 2016


mbodart added a comment.

I'm looking into resurrecting the nonlocal dead store elimination in http://reviews.llvm.org/D13363,
but one of the snags is a performance issue related to select-vs-branch choices.  That change enables
more selects, which unfortunately incur a 10 to 20% perf drop on some benchmarks in the EEMBC automotive
suite, on various X86 architectures.

One technique for recouping most of these drops is to relax the load-feeding-cmp heuristic in
isFormingBranchFromSelectProfitable, to allow the load to have multiple users, all of which are cmp's.
Yes, this is subject to the same "is this a reasonable heuristic at this point in compilation" questions
as discussed in this review, and a target-specific lowering may be preferable.  But such lowering does
not yet exist, which is perhaps why we're seeing continual tuning in this function.

Is it worth pursuing more tuning in isFormingBranchFromSelectProfitable,
or is that likely to be rejected in favor of option 2?

regards,

- mitch


http://reviews.llvm.org/D16836





More information about the llvm-commits mailing list