[llvm] [SelectOpt] Don't convert constant selects to branches. (PR #110858)

Sotiris Apostolakis via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 06:53:21 PDT 2024


sapostolakis wrote:

Yeah I agree that this is reasonable when considering the value operands and does not miss out on any of the core opportunities of selectopt. I still think the select condition cost might play a role in the cost model, but I see that in your test case and probably in your motivating example the condition was actually expensive and still the select was the optimal choice. I also remember that a heuristic that I tried that focused on the condition was not profitable. So, overall, the proposed change sounds reasonable.

I tested this change on an internal Google macrobenchmark for x86 and the performance was neutral, so I am okay with landing this change, given your observed gains and lack of indication of regressions. 



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


More information about the llvm-commits mailing list