[PATCH] D33150: [CodeGenPrep]Forming branch from select aggressively in loop

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 11:02:07 PDT 2017


junbuml added a comment.

This was an experimental change to see the impact of aggressive use of branch from SelectInst. Basically, checking if a SelectInst is in a loop latch would be not enough information to determine the profitability of turning a SelectInst into a branch. However, I doubt if the current heuristic used in isFormingBranchFromSelectProfitable(), which simply check if one of select's operands is expensive, is reasonable enough to determine profitability of this transformation.

As a part of improving this transformation, I was trying to see other good place for this in MI level. For me, EarlyIfConv seems to be feasible for this using MachineTraceMetrics. Current EarlyIfConv performs the exactly opposite way of transformation (from branch to select) based on a heuristic which check if extra cycles added in the critical path when using select is more than half of a mispredict penalty. Based on this existing framework in EarlyIfConv, I'm trying to do the select to branch transformation using similar, but opposite way of this heuristic. Can anyone give me any feedback about this approach?


https://reviews.llvm.org/D33150





More information about the llvm-commits mailing list